vps
October 27, 2024 ยท View on GitHub
Scripts used for installing/managing/restarting/monitoring processes on my server.
Uses supervisord to manage processes.
My fork of superhooks notifies me in discord whenever one of my processes dies, as does netdata if there are any outliers in the hundreds of metrics it takes.
- Puts application code into
~/code - Centralizes logs in
~/logs
This runs on an Debian server, but it should be OS agnostic. vps_install will throw a fatal error before starting if I'm missing any required commands. My server runs nginx, lots of the log based commands assume that.
jobs includes jobs for bgproc (specifically, bgproc_on_machine) related to interacting with the server
bin includes scripts that are run on my machine or on the server
See here for a blog post describing how I set up this server.
-
vps_installclones and sets up environments for each application. Checks that you have corresponding commands/packages installed and that required credential/files are in the right location, installs virtual environments/packages for each application. -
superlets me interact with the underlyingsupervisord/supervisorctlprocesses with my environment variables/configuration. -
logsstreams the logs from all applications -
vps_backupcopies cache/token files to a tar.gz so they can be backed up. runs with bgproc.backup_serveris run from my computer, which ssh's into the server to run that. Runs once per day, inhousekeeping -
vps_deployanddeployare a basic ssh/git pull/restart/view logs script for projects which I deploy frequently -
vps_generate_static_sitesbuilds my static websites and places them in~/static_files. -
remsyncis a script that's run on my machine, which rsyncs files from a local directory to the server. That directory is served with nginx, so I can sync something to the server from my CLI and send someone a link. example output. Has two endpoints,fandp, which specify private (a non-autoindexed nginx listing) and public indexes. -
playlistinterfaces with my playlist manager. It allows me to select multiple playlists, combines all the files from those playlists into a single mp3 and syncs that up to my server withremsync. Often run this on my machine before I leave my house; I then listen to the file on my phone by going to corresponding URL. -
mediaproxyto ssh into the server,youtube-dl/ffmpegsomething and host it on a readable link. Has video/audio wrapper that use more of my personal scripts to prompt me to to select format codes, (similar tompvf). That way, I can press a keybind, which grabs the URL from my clipboard and re-hosts it on my server. -
shortencreates a shortened url usingno-db-shorturl -
approve-commentsapproves comments for my guest book at https://purarue.xyz -
mnuruns the periodic job to update the google sheet -
directoriesis a helper script sourced at the top of other scripts that defines common application location environment variables
Applications:
- https://github.com/purarue/glue
- https://github.com/purarue/exobrain
- https://github.com/purarue/mal-id-cache
- https://github.com/purarue/mal-notify-bot
- https://github.com/purarue/discord-countdown-bot
- https://github.com/purarue/xqc-dvd
- https://github.com/purarue/xkcd-favorites
- https://github.com/purarue/animeshorts
- https://github.com/purarue/subpath-serve
- https://github.com/purarue/no-db-shorturl
- https://github.com/purarue/mnu_gsheets
- https://github.com/Hiyori-API/checker_mal
- https://github.com/purarue/projects
- https://github.com/purarue/my_feed
- https://github.com/purarue/back-arrow-script/
- https://github.com/purarue/server_clipboard
- https://github.com/purarue/dbsentinel
- https://github.com/purarue/currently_listening
- https://github.com/purarue/filmswap