Added installation instructions and example files
This commit is contained in:
54
README.md
54
README.md
@ -40,3 +40,57 @@ remove it if no new features required them.
|
||||
|
||||
I'll gladly accept any help in coming up with a good solution which doesn't need to store anything at all!
|
||||
|
||||
# Set Up
|
||||
|
||||
This might not be the ideal setup to run this, but here's how I am doing it. Instructions are for running on a Debian
|
||||
or Debian derivative, using Apache as HTTP Proxy. Other setups are possible, but not covered here.
|
||||
By default, NVM is used to install NodeJS, but you can install it any way you want.
|
||||
|
||||
This is based on [SvelteKit's instructions](https://kit.svelte.dev/docs/adapter-node#deploying)
|
||||
|
||||
On your server, install the requirements:
|
||||
- Apache2 HTTP Server
|
||||
- NodeJS (via [NVM](https://github.com/nvm-sh/nvm))
|
||||
|
||||
#### On your server
|
||||
|
||||
Create a directory for the app. This will be called `$APP_DIR` from now on.
|
||||
|
||||
Place `package.json`, `apache2.conf.EXAMPLE`, `moshing-mammut.service.EXAMPLE` and `start.sh.EXAMPLE` in this directory.
|
||||
|
||||
Copy `apache2.conf.EXAMPLE` to `/etc/apache2/sites-available/moshingmammut.conf` and replace `ServerName` with your
|
||||
Domain. If you do not need or want SSL support, remove the whole `<IfModule mod_ssl.c>` block.
|
||||
If you do, add the path to your SSLCertificateFile and SSLCertificateKeyFile.
|
||||
|
||||
Copy `moshing-mammut.service.EXAMPLE` to `/etc/systemd/system/moshing-mammut.service`
|
||||
and replace `/PATH_TO_MOSHING_MAMMUT` with your `$APP_DIR`. Also replace `MOSHING_MAMMUT_USER` with the user you want
|
||||
to run the app as.
|
||||
|
||||
Rename `start.sh.EXAMPLE` to `start.sh` and replace `/PATH_TO_YOUR_NVM/.nvm/nvm.sh` with the path to your NVM
|
||||
installation.
|
||||
If you do not have NVM installed, simply remove the line and make sure your node executable can be found either by
|
||||
specifying the full path or by adding it to your $PATH.
|
||||
|
||||
Run `npm ci --omit dev` to install the dependencies.
|
||||
|
||||
#### On your development machine
|
||||
|
||||
Copy `.env.EXAMPLE` to `.env` and add your `YOUTUBE_API_KEY`.
|
||||
To obtain one follow [YouTube's guide](https://developers.google.com/youtube/registering_an_application) to create an
|
||||
*API key*. As soon as #13 is implemented, this will be optional!
|
||||
|
||||
Run `npm run build` and copy the output folder, usually `build` to `$APP_DIR` on your server.
|
||||
|
||||
#### On your server again
|
||||
|
||||
Now, you are ready to start everything up.
|
||||
|
||||
Enable the site in Apache2 by running `a2ensite moshingmammut.conf`.
|
||||
|
||||
Create and start the system service by running `sudo systemctl enable moshing-mammut.service`
|
||||
and then `service moshing-mammut start`.
|
||||
|
||||
Verify that everything is okay with `service moshing-mammut status`.
|
||||
|
||||
The app should now be reachable on http://localhost:3000 or whatever you configured your domain to be!
|
||||
|
||||
|
Reference in New Issue
Block a user