This project is still young and isn't, at the moment, very stable, so please proceed with caution when running in production.
This method of installation is more involved, and therefore is for more experienced admins. Docker install is the recommended method as there may not be much support available for Dockerless installation. If you have expertise in this area, we would love your help to improve this documentation!
This install method assumes you already have ssl configured with certificates available.
apt install postgresql redis nginx python3-venv python3-pip python3-dev libpq-dev gunicorn gettext-baseLa branche production de BookWyrm contient un certain nombre d'outils qui ne sont pas sur la branche main, prévus pour fonctionner en production, tels que des modifications de docker-compose pour mettre à jour les commandes par défaut ou la configuration des conteneurs, ou des modifications spécifiques à des containers pour activer des fonctionnalités telles que SSL ou des sauvegardes régulières. Tous ces changements n'ont pas nécessairement un impact sur l'installation sans docker, mais la branche production est néanmoins recommandée
Instructions pour l'exécution de BookWyrm en production sans Docker :
/opt/bookwyrm : mkdir /opt/bookwyrm && cd /opt/bookwyrmproduction branch: git clone https://github.com/bookwyrm-social/bookwyrm.git --branch production --single-branch ./cp .env.example .env, and update the following. Passwords should generally be enclosed in "quotation marks". You can use bw-dev create_secrets to generate passwords in .env-file:SECRET_KEY | A difficult to guess, secret string of characters.DOMAIN | Votre domaine webPOSTGRES_PASSWORD | Utilisez un mot de passe sécurisé pour la base de donnéesPOSTGRES_HOST | Mettez à localhost (la machine exécutant votre bdd)POSTGRES_USER | Mettez à bookwyrm (recommendé) ou une valeur personnalisée (configurée plus tard)POSTGRES_DB | Définir à bookwyrmREDIS_ACTIVITY_PASSWORD | Laissez à blanc (adapté pour une machine locale avec un pare-feu)REDIS_ACTIVITY_HOST | Mettez à localhost (la machine exécutant redis)REDIS_BROKER_PASSWORD | Laissez à blanc (adapté pour une machine locale avec un pare-feu)REDIS_BROKER_HOST | Mettez à localhost (la machine exécutant redis)EMAIL_HOST_USER | L'adresse d'expéditeur de laquelle votre application enverra des emailsEMAIL_HOST_PASSWORD | Le mot de passe fourni par votre service d'emailing/var/cache/nginx directory:mkdir /var/cache/nginx
chown www-data:www-data /var/cache/nginx
cp nginx/locations /etc/nginx/conf.d/locations/etc/nginx/conf.d/locations:/app with your install directory /opt/bookwyrm everywhere in the file (including commented out)export DOMAIN=your-web-domain MAX_UPLOAD_MiB=100envsubst '$DOMAIN,$MAX_UPLOAD_MiB' < nginx/server_config > /etc/nginx/conf.d/server_configenvsubst '$DOMAIN,$MAX_UPLOAD_MiB' < nginx/server_name > /etc/nginx/conf.d/server_nameenvsubst '$DOMAIN,$MAX_UPLOAD_MiB' < nginx/https.conf > /etc/nginx/sites-available/bookwyrm.confenvsubst '$DOMAIN,$MAX_UPLOAD_MiB' < nginx/reverse_proxy.conf > /etc/nginx/sites-available/bookwyrm.conf/etc/nginx/sites-available/bookwyrm.conf:ssl_certificate and ssl_certificate_key paths to your fullchain and privkey locations if you are not using nginx as reverse-proxyserver localhost:8000 and server localhost:8888. Vous pouvez choisir un port différent si vous le souhaitezln -s /etc/nginx/sites-available/bookwyrm.conf /etc/nginx/sites-enabled/bookwyrm.confsystemctl reload nginxpython3 -m venv ./venv./venv/bin/pip3 install --upgrade "pip>=25.1.0" ./venv/bin/pip3 install --group main.env config: sudo -i -u postgres psqlCREATE USER bookwyrm WITH PASSWORD 'securedbypassword123';
CREATE DATABASE bookwyrm TEMPLATE template0 ENCODING 'UNICODE';
ALTER DATABASE bookwyrm OWNER TO bookwyrm;
GRANT ALL PRIVILEGES ON DATABASE bookwyrm TO bookwyrm;
\q
venv/bin/python3 manage.py migratevenv/bin/python3 manage.py initdbvenv/bin/python3 manage.py compile_themesvenv/bin/python3 manage.py collectstatic --no-inputbookwyrmuseradd bookwyrm -rchown -R bookwyrm:bookwyrm /opt/bookwyrmsudo -u bookwyrm echo I am the $(whoami) userConfigure, enable, and start BookWyrm's systemd services:
cp contrib/systemd/*.service /etc/systemd/system/systemctl enable bookwyrm bookwyrm-worker bookwyrm-schedulerGénérez le code administrateur avec sudo -u bookwyrm venv/bin/python3 manage.py admin_code, et copiez le pour l'utiliser lors de la création du compte administrateur.
*******************************************
Use this code to create your admin account:
c6c35779-af3a-4091-b330-c026610920d6
*******************************************
Congrats! You did it!! Configure your instance however you'd like.
Like all software, BookWyrm can contain bugs, and often these bugs are in the Python code and easiest to reproduce by getting more context from the logs.
If you use the provided systemd service configurations from contrib/systemd you will be able to read the logs with journalctl:
# viewing logs of the web process
journalctl -u bookwyrm
# viewing logs of the worker process
journalctl -u bookwyrm-worker
# viewing logs of the scheduler process
journalctl -u bookwyrm-scheduler
Feel free to explore additional ways of slicing and dicing logs with flags documented in journalctl --help.
While BookWyrm's application logs will most often be enough, you can find logs for other services like Nginx, PostgreSQL, or Redis are usually in .log files located somewhere in /var/logs.
Voir Participer pour plus de détails.