-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mr. Test
committed
Sep 7, 2024
1 parent
141b3e4
commit 5df07de
Showing
30 changed files
with
410 additions
and
514 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
generated_templates/yunohost_django_package/django_example_ynh/check_process
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
generated_templates/yunohost_django_package/django_example_ynh/conf/manage.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!__DATA_DIR__/venv/bin/python3 | ||
#!__DATA_DIR__/.venv/bin/python | ||
|
||
import os | ||
import sys | ||
|
2 changes: 1 addition & 1 deletion
2
generated_templates/yunohost_django_package/django_example_ynh/conf/setup_user.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 43 additions & 6 deletions
49
generated_templates/yunohost_django_package/django_example_ynh/conf/systemd.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,54 @@ | ||
[Unit] | ||
Description=__APP__ server | ||
After=redis.service postgresql.service | ||
After=network.target redis.service postgresql.service | ||
|
||
[Service] | ||
User=__APP__ | ||
Group=__APP__ | ||
WorkingDirectory=__DATA_DIR__/ | ||
|
||
ExecStart=__DATA_DIR__/venv/bin/gunicorn --config __DATA_DIR__/gunicorn.conf.py wsgi | ||
ExecStart=__DATA_DIR__/.venv/bin/gunicorn --config __DATA_DIR__/gunicorn.conf.py wsgi | ||
|
||
StandardOutput=syslog | ||
StandardError=syslog | ||
SyslogIdentifier=__APP__-server | ||
|
||
#____________________________________________________________________________________ | ||
# Below copy&paste from: | ||
# https://github.com/YunoHost-Apps/homeassistant_ynh/blob/master/conf/systemd.service | ||
|
||
|
||
RestartForceExitStatus=100 | ||
Restart=on-failure | ||
RestartSec=5s | ||
StandardOutput=append:__LOG_FILE__ | ||
StandardError=inherit | ||
|
||
# Sandboxing options to harden security | ||
# Depending on specificities of your service/app, you may need to tweak these | ||
# .. but this should be a good baseline | ||
# Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html | ||
NoNewPrivileges=yes | ||
PrivateTmp=yes | ||
#CANT BE ACTIVATED FOR __APP__ #PrivateDevices=yes | ||
#CANT BE ACTIVATED FOR __APP__ #RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 | ||
RestrictNamespaces=yes | ||
RestrictRealtime=yes | ||
#CANT BE ACTIVATED FOR __APP__ (see issue #40) #DevicePolicy=closed | ||
ProtectSystem=full | ||
ProtectControlGroups=yes | ||
ProtectKernelModules=yes | ||
# ProtectKernelTunables=yes | ||
LockPersonality=yes | ||
SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap | ||
|
||
# Denying access to capabilities that should not be relevant for webapps | ||
# Doc: https://man7.org/linux/man-pages/man7/capabilities.7.html | ||
CapabilityBoundingSet=~CAP_RAWIO CAP_MKNOD | ||
CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE | ||
CapabilityBoundingSet=~CAP_SYS_BOOT CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_PACCT | ||
CapabilityBoundingSet=~CAP_LEASE CAP_LINUX_IMMUTABLE CAP_IPC_LOCK | ||
CapabilityBoundingSet=~CAP_BLOCK_SUSPEND CAP_WAKE_ALARM | ||
CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG | ||
CapabilityBoundingSet=~CAP_MAC_ADMIN CAP_MAC_OVERRIDE | ||
CapabilityBoundingSet=~CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW | ||
CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.