This assumes you have docker and docker-compose installed.
config.dist.yaml
and docker-compose.dist.yaml
to your needs, remove the .dist
suffixconfig.yaml
, if using gmail, use 2-FA with an app passworddocs
, customizing the domain names (and ports if the defaults are not used)
for apache, enable the following modules:
sudo a2enmod proxy
sudo a2enmod proxy_http
config.extension.dist.ts
and remove the .dist
suffixadminsWhitelist.dist.ts
and rename it to adminsWhitelist.ts
ssh-keygen -t rsa -b 4096 -m PEM -f private.key
(do not set a passphrase)webpack.config.extension.json
and rebuildCreate 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:
yarn
First start the test database with:
docker-compose up -d test-db
Then run the tests once with:
yarn test
Or continuously with:
yarn tdd
Starts the docker database:
docker compose up -d development-db
Start the docker server:
yarn dev
Populate the local database from the remote one:
scripts.conf.dist
to scripts.conf
and modify appropriately./update-db
backup
inside the home bin
directory (create it if it doesn't exist)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 down
Pull the code:
git pull
If the server is not very big on ram and disk, prune the docker cache:
docker system prune
Build the server code:
docker-compose build
Start the server in the background:
docker-compose up -d app-server
Or preferably in tmux:
docker-compose up app-server