Skip to content

thekid/dialog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

647 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dialog photoblog

Build status on GitHub Uses XP Framework BSD Licence Requires PHP 7.4+ Supports PHP 8.0+

See https://dialog.friebes.info/

Prerequisites

Setup

First, create the import user:

$ echo -n "secret-password-here" | sha256sum
4323135e32ac4...

# Copy the connection URI from MongoDB Atlas
$ mongosh mongodb+srv://[USER]:[PASSWORD]@[PROJECT].[ORG].mongodb.net
$ use dialog
$ db.users.insert({handle: "import", pass: "4323135e32ac4..."});
# ...

Store the connection string in a configuration file named config.ini:

[mongo]
uri=mongodb+srv://[USER]:[PASSWORD]@[PROJECT].[ORG].mongodb.net/?readPreference=nearest

Then, run composer to install PHP and JavaScript dependencies.

$ composer up
# ...

Running locally

Now, Dialog can be run locally.

$ xp serve
# ...

Open http://localhost:8080/ to see the empty page

Importing local directories

Next, we'll import some pictures:

$ xp import import-target/ http://import:pass@localhost:8080/api
# ...

Content

Expects the following directory structure:

import-target
|- content.md
|- image-1.jpg
|- image-2.jpg
`- image-(n).jpg

Journey

Expects the following directory structure:

import-target
|- journey.md
|- part-1
|  |- content.md
|  |- image-1.jpg
|  `- image-2.jpg
|- part-2
|  |- content.md
|  |- image-1.jpg
|  `- image-2.jpg
`- part-(n)