imtbl / hyve

Expose and consume your hydrus media via HTTP API
GNU Affero General Public License v3.0
31 stars 3 forks source link

Multiple instances #4

Closed FredericaBernkastel closed 4 years ago

FredericaBernkastel commented 4 years ago

1. It is unclear how to run multiple instances from a single source. This can be told for all 3 parts, server, sync and web. I've changed bin/www, so it accepts environment file as an optional agrument:

const envpath = '../' + (process.argv[2] ? process.argv[2] : '.env')
require('dotenv').config({ path: path.resolve(__dirname, envpath )})

Maybe there is a more idiomatic way? Now systemd service can look like this:

Spoiler ``` [Unit] Description=hyve-dolls After=network.target StartLimitIntervalSec=0 [Service] Type=simple Restart=always RestartSec=1 User=bernkastel ExecStart=/usr/bin/node /home/bernkastel/hyve/services/server/bin/www 'dolls.env' WorkingDirectory=/home/bernkastel/hyve/services/server [Install] WantedBy=multi-user.target ```

2. Web needs a base path configuration, so it can be run in a subdirectory. In vue.config.js i've added:

publicPath: process.env.VUE_APP_HYVE_BASE_URL

By default it should be /

imtbl commented 4 years ago

Hey, thank you for this feedback.

Sorry, I won't find time before the weekend to properly look at this.