From 9086a5d9b14a04be1b0ba7f9a5c94bd1dba9697c Mon Sep 17 00:00:00 2001 From: "J. King" Date: Sun, 24 Dec 2023 14:39:42 -0500 Subject: [PATCH] Add interpreter adaptation for service, with documentation --- dist/arch/PKGBUILD | 3 +- dist/arch/arsse-fetch.service | 37 +++++++++++++++++++ dist/arch/arsse.service | 13 +++++++ dist/arch/systemd-environment | 1 + .../010_On_Arch_Linux.md | 17 +++++++++ 5 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 dist/arch/arsse-fetch.service create mode 100644 dist/arch/arsse.service create mode 100644 dist/arch/systemd-environment diff --git a/dist/arch/PKGBUILD b/dist/arch/PKGBUILD index 5e5f991..a84bdf6 100644 --- a/dist/arch/PKGBUILD +++ b/dist/arch/PKGBUILD @@ -39,7 +39,6 @@ package() { cp -r lib locale sql vendor www CHANGELOG UPGRADING README.md arsse.php "$pkgdir/usr/share/webapps/arsse" cp -r manual/* "$pkgdir/usr/share/doc/arsse" cp LICENSE AUTHORS "$pkgdir/usr/share/licenses/arsse" - cp dist/systemd/* "$pkgdir/usr/lib/systemd/system" cp dist/sysuser.conf "$pkgdir/usr/lib/sysusers.d/arsse.conf" cp dist/tmpfiles.conf "$pkgdir/usr/lib/tmpfiles.d/arsse.conf" cp dist/php-fpm.conf "$pkgdir/etc/php/php-fpm.d/arsse.conf" @@ -58,4 +57,6 @@ package() { install -Dm755 dist/arch/arsse "$pkgdir/usr/bin/arsse" cp dist/arch/nginx-arsse-fcgi.conf "$pkgdir/etc/webapps/arsse/nginx/arsse-fcgi.conf" cp dist/arch/apache-arsse-fcgi.conf "$pkgdir/etc/webapps/arsse/apache/arsse-fcgi.conf" + cp dist/arch/*.service "$pkgdir/usr/lib/systemd/system" + cp dist/arch/systemd-environment "$pkgdir/etc/webapps/arsse/systemd-environment" } diff --git a/dist/arch/arsse-fetch.service b/dist/arch/arsse-fetch.service new file mode 100644 index 0000000..1389165 --- /dev/null +++ b/dist/arch/arsse-fetch.service @@ -0,0 +1,37 @@ +[Unit] +Description=The Arsse newsfeed fetching service +Documentation=https://thearsse.com/manual/ +PartOf=arsse.service + +[Install] +WantedBy=multi-user.target + +[Service] +User=arsse +Group=arsse +Type=simple +WorkingDirectory=/usr/share/webapps/arsse +EnvironmentFile=/etc/webapps/arsse/systemd-environment +ExecStart=/usr/bin/arsse daemon + +ProtectProc=invisible +NoNewPrivileges=true +ProtectSystem=full +ProtectHome=true +StateDirectory=arsse +ConfigurationDirectory=arsse +PrivateTmp=true +PrivateDevices=true +RestrictSUIDSGID=true +StandardOutput=journal +StandardError=journal +SyslogIdentifier=arsse +Restart=on-failure +RestartPreventStatus= + +# These directives can be used for extra security, but are disabled for now for compatibility + +#ReadOnlyPaths=/ +#ReadWriePaths=/var/lib/arsse +#NoExecPaths=/ +#ExecPaths=/usr/bin/php diff --git a/dist/arch/arsse.service b/dist/arch/arsse.service new file mode 100644 index 0000000..9a7e91c --- /dev/null +++ b/dist/arch/arsse.service @@ -0,0 +1,13 @@ +[Unit] +Description=The Arsse newsfeed management service +Documentation=https://thearsse.com/manual/ +Requires=arsse-fetch.service +Wants=php-fpm.service php-legacy-fpm.service + +[Install] +WantedBy=multi-user.target + +[Service] +Type=oneshot +RemainAfterExit=true +ExecStart=/usr/bin/true diff --git a/dist/arch/systemd-environment b/dist/arch/systemd-environment new file mode 100644 index 0000000..085e816 --- /dev/null +++ b/dist/arch/systemd-environment @@ -0,0 +1 @@ +ARSSE_PHP=/usr/bin/php \ No newline at end of file diff --git a/docs/en/020_Getting_Started/020_Download_and_Installation/010_On_Arch_Linux.md b/docs/en/020_Getting_Started/020_Download_and_Installation/010_On_Arch_Linux.md index e075c1b..a20c969 100644 --- a/docs/en/020_Getting_Started/020_Download_and_Installation/010_On_Arch_Linux.md +++ b/docs/en/020_Getting_Started/020_Download_and_Installation/010_On_Arch_Linux.md @@ -35,6 +35,23 @@ LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so No additional set-up is required for Nginx. +# Using an alternative PHP interpreter + +The above instructions assume you will be using the `php` package as your PHP interpreter. If you wish to use `php-legacy` (which is always one feature version behind, for compatibility) a few configuration tweaks are required. The follwoing commands are a short summary: + +```sh +# Enable the necessary PHP extensions; curl is optional but recommended; pdo_sqlite may be used instead of sqlite3, but this is not recommended +sudo sed -i -e 's/^;\(extension=\(curl\|iconv\|intl\|sqlite3\)\)$/\1/' /etc/php-legacy/php.ini +# Modify the system service's environment +sudo sed -i -e 's/^ARSSE_PHP=.*/ARSSE_PHP=\/usr\/bin\/php-legacy/' /etc/webapps/arsse/systemd-environment +# Modify the PAM environment for the administrative CLI +echo "export ARSSE_PHP=/usr/bin/php-legacy" | sudo tee -a /etc/profile.d/arsse >/dev/null +# Modify the Nginx and Apache HTTPD configurations +sudo sed -i -se 's/\/run\/php-fpm\//\/run\/php-fpm-legacy\//' /etc/webapps/arsse/apache/arsse-fcgi.conf /etc/webapps/arsse/nginx/arsse-fcgi.conf +``` + +The above procedure can also be applied to use another PHP version from AUR if so desired. + # Next steps If using a database other than SQLite, you will likely want to [set it up](/en/Getting_Started/Database_Setup) before doing anything else.