Fleebmarket is a frontend to the /r/mechmarket subreddit (seconds hand mechanical keyboards marketplace). You can reach the website at "https://fleebmarket.mmill.eu"
This repo holds the full source code of the website.
.env.skeleton
to .env
, then fill the values (you can ignore settings for blue/green deployment)scripts/deploy_swarm.sh
.Fleebmarket is currently deployed on a bare-metal server, this sections describe the current setup.
It shouldn't be too difficult to adapt, or even dockerize everything, but some settings are hard-coded.
/fleebmarket_blue
and /fleebmarket_green
. .env
files, with values for blue/green deployment set-up accordingly.backend/.venv
for each of these folders./data
folder contains data for the various services. It contains the following folders (some have to be manually created):
alerts
: alerts configurationbackend_blue
, backend_green
: django static files for each of the backendsmeilisearch
: meilisearch databasepostgres
: postgres databaseServices are run as systemd user services. Services files are present in the services/systemd
directory, which is symlinked on the server to ~/.config/systemd/user
. Services can then be managed with systemd --user
commands:
meilisearch.service
and postgresql.service
can be enabled and started right awaybackend@blue.service
and backend@green.service
The alerting system works by parsing journald logs.
Nginx is the only service running as root. You can find configuration files in services/nginx
.
Monitorix is used to monitor the server, as well as fleebmarket usage. Some settings can be found in services/monitorix
.
Additionally, a Huey job parses journald logs, and send alerts to the configured discord channel when it finds messages with level ERROR or higher (cysystemd is used to give the right level to python log messages).
and set related field in .env
file. This is usefull if you want to develop features related to those kind of accounts; otherwise you can log in the django admin panel at localhost:8000/admin
, and then go back to the website.