From 9501cbf678a4ef99ccbd8c53f35b3209569f4c8e Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Sun, 18 Dec 2022 16:46:54 +0100 Subject: Import packaging files - setup.py to install the library as a Python package - systemd services and target for running as a daemon - sysconfig file providing environment variables to the application Signed-off-by: Georg Pfuetzenreuter --- SUSE/takahe-stator.service | 25 +++++++++++++++++++++++++ SUSE/takahe.service | 30 ++++++++++++++++++++++++++++++ SUSE/takahe.sysconfig | 33 +++++++++++++++++++++++++++++++++ SUSE/takahe.target | 10 ++++++++++ 4 files changed, 98 insertions(+) create mode 100644 SUSE/takahe-stator.service create mode 100644 SUSE/takahe.service create mode 100644 SUSE/takahe.sysconfig create mode 100644 SUSE/takahe.target (limited to 'SUSE') diff --git a/SUSE/takahe-stator.service b/SUSE/takahe-stator.service new file mode 100644 index 0000000..5b9e3ac --- /dev/null +++ b/SUSE/takahe-stator.service @@ -0,0 +1,25 @@ +# This file is shipped as part of the Takahe package. +# Author: Georg Pfuetzenreuter + +[Unit] +Description=Takahe Stator +PartOf=takahe.target + +[Service] +User=_takahe +Group=_takahe + +ExecStart=/usr/libexec/takahe/manage.py runstator + +PrivateDevices=yes +PrivateTmp=yes +ProtectControlGroups=yes +ProtectHome=yes +ProtectKernelLogs=yes +ProtectSystem=strict +RestrictAddressFamilies=AF_INET6 AF_INET +SystemCallArchitectures=native +SystemCallFilter=@system-service + +[Install] +WantedBy=multi-user.target diff --git a/SUSE/takahe.service b/SUSE/takahe.service new file mode 100644 index 0000000..dd7d395 --- /dev/null +++ b/SUSE/takahe.service @@ -0,0 +1,30 @@ +# This file is shipped as part of the Takahe package. +# Author: Georg Pfuetzenreuter + +[Unit] +Description=Takahe +After=postgresql.service +Wants=postgresql.service +PartOf=%N.target + +[Service] +User=_%N +Group=_%N + +EnvironmentFile=/etc/sysconfig/%N +ExecStart=/usr/bin/gunicorn %N.%N.wsgi:application -b "$BIND" + +PrivateDevices=yes +PrivateTmp=yes +ProtectControlGroups=yes +ProtectHome=yes +ProtectKernelLogs=yes +ProtectSystem=strict +RestrictAddressFamilies=AF_INET6 AF_INET AF_UNIX +SystemCallArchitectures=native +SystemCallFilter=@system-service + +ReadWritePaths=/srv/%N/media + +[Install] +WantedBy=multi-user.target diff --git a/SUSE/takahe.sysconfig b/SUSE/takahe.sysconfig new file mode 100644 index 0000000..c9f9f3a --- /dev/null +++ b/SUSE/takahe.sysconfig @@ -0,0 +1,33 @@ +# This file is shipped as part of the Takahe package. +# Author: Georg Pfuetzenreuter + +# Hostname or IP address of the database server +PGHOST= + +# Name of the database +PGDATABASE= + +# Username and password to authenticate to the database with +PGUSER= +PGPASSWORD= + +# Random string - generated during installation +TAKAHE_SECRET_KEY=__REPLACE_ME__ + +# Domain Takahe is being served on +TAKAHE_MAIN_DOMAIN= + +# Email address to be promoted as an Administrator - set and uncomment this only for the first start, then comment it again +# TAKAHE_AUTO_ADMIN_EMAIL= + +# Set to true if Takahi is being served behind a reverse proxy +TAKAHE_USE_PROXY_HEADERS=true + +# Directory to store media files in +TAKAHE_MEDIA_ROOT=/srv/takahe/media + +# URL media files are being served from +TAKAHE_MEDIA_URL= + +# IP address and port for the Gunicorn server to bind to +BIND='[::]:8000' diff --git a/SUSE/takahe.target b/SUSE/takahe.target new file mode 100644 index 0000000..9037778 --- /dev/null +++ b/SUSE/takahe.target @@ -0,0 +1,10 @@ +# This file is shipped as part of the Takahe package. +# Author: Georg Pfuetzenreuter + +[Unit] +Description=Target combining all parts of Takahe +After=network.target +Requires=%N.service %N-stator.service + +[Install] +WantedBy=multi-user.target -- cgit v1.2.3