From 0261e875679f1bf63c8d689da7fc7e014597885d Mon Sep 17 00:00:00 2001 From: Stonewall Jackson Date: Sat, 4 Feb 2023 01:23:43 -0500 Subject: initial commit --- .../etc/systemd/system/psitransfer.service.j2 | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 roles/psitransfer/templates/etc/systemd/system/psitransfer.service.j2 (limited to 'roles/psitransfer/templates/etc/systemd/system/psitransfer.service.j2') diff --git a/roles/psitransfer/templates/etc/systemd/system/psitransfer.service.j2 b/roles/psitransfer/templates/etc/systemd/system/psitransfer.service.j2 new file mode 100644 index 0000000..6bb8c97 --- /dev/null +++ b/roles/psitransfer/templates/etc/systemd/system/psitransfer.service.j2 @@ -0,0 +1,36 @@ +[Unit] +Description=Psitransfer File Sharing +After=network.target +AssertPathExists={{ psitransfer_install_dir }} + +[Service] +Type=simple +Environment="PSITRANSFER_IFACE=127.0.0.1" +Environment="PSITRANSFER_PORT={{ psitransfer_port }}" +Environment=NODE_ENV=production +EnvironmentFile=-/etc/sysconfig/psitransfer +ExecStart=/usr/bin/node app.js +WorkingDirectory={{ psitransfer_install_dir }} +User={{ psitransfer_user }} +Group={{ psitransfer_user }} +Restart=on-failure + +# See https://www.freedesktop.org/software/systemd/man/systemd.exec.html +# for details +DevicePolicy=closed +NoNewPrivileges=yes +PrivateDevices=yes +PrivateTmp=yes +ProtectControlGroups=yes +ProtectKernelModules=yes +ProtectKernelTunables=yes +RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 +RestrictNamespaces=yes +RestrictRealtime=yes +SystemCallFilter=~@clock @debug @module @mount @obsolete @privileged @reboot @setuid @swap + +ProtectSystem=full +ProtectHome=true + +[Install] +WantedBy=multi-user.target -- cgit