#Pre-Requisites
This assumes you have docker and docker-compose installed.
- adjust the files
config.dist.yamlanddocker-compose.dist.yamlto your needs, remove the.distsuffix - don't forget to setup the mailer in
config.yaml, if using gmail, use 2-FA with an app password - setup the virtual hosts defined in
docs, customizing the domain names (and ports if the defaults are not used) for apache, enable the following modules:sudo a2enmod proxysudo a2enmod proxy_http
- enable SSL on the virtual hosts using let's encrypt
- put the correct urls in
config.extension.dist.tsand remove the.distsuffix - define the users that will be able to create an admin account in
adminsWhitelist.dist.tsand rename it toadminsWhitelist.ts - generate a private key:
ssh-keygen -t rsa -b 4096 -m PEM -f private.key(do not set a passphrase) - set correct manifest permissions for domains in
webpack.config.extension.jsonand rebuild - adjust the ports in Dockerfile if needed
Create an apache user to protect the status page:
sudo htpasswd -c /etc/apache2/.htpasswd <username>or on EC2 probably:
sudo htpasswd -c /etc/httpd/.htpasswd <username>Install the dependencies with:
yarnFirst start the test database with:
docker-compose up -d test-dbThen run the tests once with:
yarn testOr continuously with:
yarn tddStarts the docker database:
docker compose up -d development-db
Start the docker server:
yarn dev
Populate the local database from the remote one:
- rename
scripts.conf.disttoscripts.confand modify appropriately - run
./update-db
- place
backupinside the homebindirectory (create it if it doesn't exist) - add crontab to execute this script every day or whenever you want
The following script can also be useful to save the backup to a remote server via scp:
#!/bin/env bash
host=some_host
latest_dump_path=$(find "$HOME"/ytdpnl/ytdpnl*.tar -maxdepth 0 -printf "%T@ %p\n" | sort -n | tail -n1 | cut -d' ' -f2)
name=$(basename "$latest_dump_path")
echo "Latest backup found is:"
res=$(find "$latest_dump_path" -printf '%s %AY-%Am-%Ad %AH:%AM %p\n' | numfmt --field=1 --to=iec-i)
echo " -> $res"
target="$host":"~/backups/$name"
echo "Uploading to $target..."
scp "$latest_dump_path" "$target" || exit 1
echo " -> Upload done."
Stop all containers if running:
docker-compose downPull the code:
git pullIf the server is not very big on ram and disk, prune the docker cache:
docker system pruneBuild the server code:
docker-compose buildStart the server in the background:
docker-compose up -d app-serverOr preferably in tmux:
docker-compose up app-server