1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-22 13:12:41 +00:00

Add prototype for new Apache configuration

Needs testing
This commit is contained in:
J. King 2021-05-19 18:59:20 -04:00
parent 3a3b9231df
commit 6d790c5efd
5 changed files with 63 additions and 26 deletions

23
dist/apache.conf vendored
View file

@ -1,23 +0,0 @@
# N.B. the unix:/var/run/php/php7.2-fpm.sock path used repeatedly below will
# vary from system to system and will be probably need to be changed
<VirtualHost *:80>
ServerName localhost
# adjust according to your installation path
DocumentRoot /usr/share/arsse/www
# adjust according to your installation path
ProxyFCGISetEnvIf "true" SCRIPT_FILENAME "/usr/share/arsse/arsse.php"
ProxyPreserveHost On
# Nextcloud News v1.2, Tiny Tiny RSS API, TT-RSS newsfeed icons, Miniflux API
<LocationMatch "(/index\.php/apps/news/api/?.+|/tt-rss/(api|feed-icons)|/v1/)">
ProxyPass "unix:/var/run/php/php7.2-fpm.sock|fcgi://localhost/usr/share/arsse"
</LocationMatch>
# Nextcloud News API detection, Fever API, Miniflux miscellanies
<LocationMatch "(/index\.php/apps/news/api/?$|/fever|/version$|/healthcheck$)">
# these locations should not be behind HTTP authentication
ProxyPass "unix:/var/run/php/php7.2-fpm.sock|fcgi://localhost/usr/share/arsse"
</LocationMatch>
</VirtualHost>

41
dist/apache/arsse-loc.conf vendored Normal file
View file

@ -0,0 +1,41 @@
# Nextcloud News version list
<LocationMatch "^/index\.php/apps/news/api/?$">
ProxyPass ${ARSSE_PROXY}
</LocationMatch>
# Nextcloud News protocol
<Location "/index.php/apps/news/api">
ProxyPass ${ARSSE_PROXY}
</Location>
# Tiny Tiny RSS protocol
<Location "/tt-rss/api">
ProxyPass ${ARSSE_PROXY}
</Location>
# Tiny Tiny RSS feed icons
<Location "/tt-rss/feed-icons">
ProxyPass ${ARSSE_PROXY}
</Location>
# NOTE: The DocumentRoot directive will dictate whether TT-RSS static images are served correctly
# Fever protocol
<Location "/fever">
ProxyPass ${ARSSE_PROXY}
</Location>
# Miniflux protocol
<Location "/v1">
ProxyPass ${ARSSE_PROXY}
</Location>
# Miniflux version number
<Location "/version">
ProxyPass ${ARSSE_PROXY}
</Location>
# Miniflux "health check"
<Location "/healthcheck">
ProxyPass ${ARSSE_PROXY}
</Location>

10
dist/apache/arsse.conf vendored Normal file
View file

@ -0,0 +1,10 @@
Define ARSSE_CONF "/etc/arsse/apache/"
Define ARSSE_DATA "/usr/share/arsse/"
Define ARSSE_PROXY "unix:/var/run/php/arsse.sock|fcgi://localhost${ARSSE_DATA}"
DocumentRoot "${ARSSE_DATA}www"
ProxyPreserveHost On
ProxyFCGISetEnvIf "true" SCRIPT_FILENAME "${ARSSE_DATA}arsse.php"
Include "${ARSSE_CONF}arsse-loc.conf"

9
dist/apache/example.conf vendored Normal file
View file

@ -0,0 +1,9 @@
<VirtualHost *:443>
ServerName "news.example.com"
SSLEngine On
SSLCertificateFile "/etc/letsencrypt/live/news.example.com/fullchain.pem"
SSLCertificateKeyFile "/etc/letsencrypt/live/news.example.com/privkey.pem"
Include "/etc/arsse/apache/arsse.conf"
</VirtualHost>

6
dist/arch/PKGBUILD vendored
View file

@ -35,7 +35,7 @@ package() {
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"
cp -r dist/nginx config.defaults.php "$pkgdir/etc/webapps/arsse"
cp -r dist/nginx dist/apache config.defaults.php "$pkgdir/etc/webapps/arsse"
cd "$pkgdir"
# adjust permissions, just in case
chmod -R u=rwX,g=rX,o=rX *
@ -46,7 +46,7 @@ package() {
install -Dm755 dist/arsse "$pkgdir/usr/bin"
install -Dm640 dist/arch/config.php "$pkgdir/etc/webapps/arsse"
# patch generic configuration files to use Arch-specific paths and identifiers
sed -ise 's/\/\(etc\|usr\/share\)\/arsse\//\/\1\/webapps\/arsse\//' "$pkgdir/etc/webapps/arsse/nginx/"* "$pkgdir/usr/lib/tmpfiles.d/arsse.conf" "$pkgdir/usr/lib/systemd/system/"* "$pkgdir/usr/bin/"*
sed -ise 's/\/var\/run\/php\//\/run\/php-fpm\//' "$pkgdir/etc/webapps/arsse/nginx/"* "$pkgdir/etc/php/php-fpm.d/arsse.conf"
sed -ise 's/\/\(etc\|usr\/share\)\/arsse\//\/\1\/webapps\/arsse\//' "$pkgdir/etc/webapps/arsse/nginx/"* "$pkgdir/etc/webapps/arsse/apache/"* "$pkgdir/usr/lib/tmpfiles.d/arsse.conf" "$pkgdir/usr/lib/systemd/system/"* "$pkgdir/usr/bin/"*
sed -ise 's/\/var\/run\/php\//\/run\/php-fpm\//' "$pkgdir/etc/webapps/arsse/nginx/"* "$pkgdir/etc/webapps/arsse/apache/"* "$pkgdir/etc/php/php-fpm.d/arsse.conf"
sed -ise 's/www-data/http/' "$pkgdir/etc/php/php-fpm.d/arsse.conf"
}