From 9524fec6720259f6dcc79d39570b2c4dbd61b76e Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Wed, 11 Feb 2026 15:59:10 +0100 Subject: [PATCH] Updated example configuration files --- README.md | 8 +++---- example_config/apache_vhost.conf | 29 ----------------------- example_config/gunicorn_digimarks_conf.py | 14 +++++++++++ example_config/settings.py | 20 ---------------- example_config/systemd/digimarks.service | 22 +++++++++++++++++ example_config/uwsgi.ini | 15 ------------ 6 files changed, 40 insertions(+), 68 deletions(-) delete mode 100644 example_config/apache_vhost.conf create mode 100644 example_config/gunicorn_digimarks_conf.py delete mode 100644 example_config/settings.py create mode 100644 example_config/systemd/digimarks.service delete mode 100644 example_config/uwsgi.ini diff --git a/README.md b/README.md index 01b3dd0..6a0e4a2 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ Url's are of the form `https://hook.example.com/app//` API documentation is auto-generated, and can be browsed at https://hook.example.com/docs -### Bookmarklet +## 🧩 Bookmarklet To easily save a link from your browser, open its bookmark manager and create a new bookmark with as url: @@ -115,9 +115,9 @@ If you for whatever reason would lose this user key, just either look on the con ## 🔧 Server configuration -- [systemd for digimarks API](https://codeberg.org/diginaut/digimarks/blob/master/example_config/systemd/digimarks.service) which uses the [gunicorn config](https://codeberg.org/diginaut/digimarks/src/branch/master/example_config/uwsgi.ini) -- [nginx for digimarks API]() -- [more config](https://codeberg.org/diginaut/digimarks/src/branch/master/example_config) +- [systemd for digimarks API](https://codeberg.org/diginaut/digimarks/src/branch/fastap/example_config/systemd/digimarks.service) which uses the [gunicorn config](https://codeberg.org/diginaut/digimarks/src/branch/fastapi/example_config/gunicorn_digimarks_conf.py) +- [nginx for digimarks API](https://codeberg.org/diginaut/digimarks/src/branch/fastapi/example_config/nginx_digimarks.conf) +- [more config](https://codeberg.org/diginaut/digimarks/src/branch/fastapi/example_config) ## ✨ What's new? diff --git a/example_config/apache_vhost.conf b/example_config/apache_vhost.conf deleted file mode 100644 index fd0a500..0000000 --- a/example_config/apache_vhost.conf +++ /dev/null @@ -1,29 +0,0 @@ - - ServerAdmin webmaster@example.com - ServerName marks.example.com - - WSGIDaemonProcess digimarks user=youruser group=youruser threads=5 python-path=/srv/marks.example.com/digimarks/ - WSGIScriptAlias / /srv/marks.example.com/digimarks/wsgi.py - - - WSGIProcessGroup digimarks - WSGIApplicationGroup %{GLOBAL} - Require all granted - - - - - Require all granted - - - - ErrorLog /var/log/apache2/error_marks.example.com.log - - # Possible values include: debug, info, notice, warn, error, crit, - # alert, emerg. - LogLevel warn - - CustomLog /var/log/apache2/access_marks.example.com.log combined - ServerSignature On - - diff --git a/example_config/gunicorn_digimarks_conf.py b/example_config/gunicorn_digimarks_conf.py new file mode 100644 index 0000000..783b0a0 --- /dev/null +++ b/example_config/gunicorn_digimarks_conf.py @@ -0,0 +1,14 @@ +# gunicorn_conf.py +from multiprocessing import cpu_count + +bind = "127.0.0.1:8890" + +# Worker Options +#workers = cpu_count() + 1 +workers = 1 +worker_class = 'uvicorn.workers.UvicornWorker' + +# Logging Options +loglevel = 'debug' +accesslog = '/var/log/digimarks/access_log' +errorlog = '/var/log/digimarks/error_log' diff --git a/example_config/settings.py b/example_config/settings.py deleted file mode 100644 index 73e22ce..0000000 --- a/example_config/settings.py +++ /dev/null @@ -1,20 +0,0 @@ -# Virtualenv to use with the wsgi file (optional) -VENV = '/srv/marks.example.com/venv/bin/activate_this.py' - -PORT = 8086 - -DEBUG = False - -# Password/url key to do admin stuff with, like adding a user -# NB: change this to something else! For example, in bash: -# echo -n "yourstring" | sha1sum -SYSTEMKEY = 'S3kr1t' - -# RapidAPI key for favicons -# https://rapidapi.com/realfavicongenerator/api/realfavicongenerator -MASHAPE_API_KEY = 'your_MASHAPE_key' - -LOG_LOCATION = 'digimarks.log' -#LOG_LOCATION = '/var/log/digimarks/digimarks.log' -# How many logs to keep in log rotation: -LOG_BACKUP_COUNT = 10 diff --git a/example_config/systemd/digimarks.service b/example_config/systemd/digimarks.service new file mode 100644 index 0000000..4ec1d6c --- /dev/null +++ b/example_config/systemd/digimarks.service @@ -0,0 +1,22 @@ +[Unit] +Description=Gunicorn Daemon for digimarks FastAPI +After=network.target + +[Service] +User=YOUR_USER +Group=YOUR_USER +WorkingDirectory=/srv/www/marks.example.org/digimarks/src + +Environment="SYSTEM_KEY=RanDomSeCretKeyFoRAdmin" +Environment="FAVICONS_DIR=/srv/www/marks.example.org/favicons" +Environment="DATABASE_FILE=/srv/www/marks.example.org/bookmarks.db" +Environment="STATIC_DIR=digimarks/static" +Environment="TEMPLATE_DIR=digimarks/templates" + +ExecStart=/srv/www/marks.example.org/venv/bin/gunicorn -c /srv/www/marks.example.org/gunicorn_digimarks_conf.py digimarks.main:app + +StandardOutput=file:///var/log/digimarks/stdout.log +StandardError=file:///var/log/digimarks/stderr.log + +[Install] +WantedBy=multi-user.target diff --git a/example_config/uwsgi.ini b/example_config/uwsgi.ini deleted file mode 100644 index 0bb0bb7..0000000 --- a/example_config/uwsgi.ini +++ /dev/null @@ -1,15 +0,0 @@ -# Example supervisord configuration -# Run with /srv/venv/bin/uwsgi --ini /srv/digimarks/uwsgi.ini:digimarks - -[digimarks] -chdir = /srv/digimarks -socket = /tmp/uwsgi_digimarks.sock -module = wsgi -threads = 4 -master = true -processes = 5 -vacuum = true -no-orphans = true -chmod-socket = 666 -logger = main file:/var/log/webapps/digimarks.log -logger = file:/var/log/webapps/digimarks_debug.log