summaryrefslogtreecommitdiff
path: root/config-mgmt-nginx.PKGBUILD
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2017-01-31 19:28:22 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2017-01-31 19:39:36 -0500
commita0782f73c62f216992de2d60620711dded9046cb (patch)
tree4158c6699d87d81c23e4504f1e207ae27c41e098 /config-mgmt-nginx.PKGBUILD
parent4195b07e605811accc90832907e620dee6584094 (diff)
config-mgmt-nginx: Holo lets me put more of the config here.
Diffstat (limited to 'config-mgmt-nginx.PKGBUILD')
-rw-r--r--config-mgmt-nginx.PKGBUILD40
1 files changed, 38 insertions, 2 deletions
diff --git a/config-mgmt-nginx.PKGBUILD b/config-mgmt-nginx.PKGBUILD
index 626c8b1..11d62d2 100644
--- a/config-mgmt-nginx.PKGBUILD
+++ b/config-mgmt-nginx.PKGBUILD
@@ -1,5 +1,5 @@
. ${BUILDFILE%/*}/common.sh
-pkgver=20161112
+pkgver=20170131
package() {
preamble
@@ -7,6 +7,43 @@ preamble
depends+=(nginx)
+# `fastcgi.conf`, `fastcgi_params`, `scgi_params` and `uwsgi_params`
+# have been edited to pass 127.0.0.1 as the client IP address to
+# worker processes, to protect user privacy.
+add-file -m755 usr/share/holo/files/10-"$pkgname"/etc/nginx/fastcgi.conf.holoscript <<EOF
+#!/bin/sh
+{
+ echo '# -*- Mode: nginx; nginx-indent-level: 8; indent-tabs-mode: t -*-'
+ echo
+ sed -e '/^# -\\*- /d' -e 's/\\\$remote_addr;\$/127.0.0.1; # \$remote_addr; # Anonymize/'
+} | cat -s
+EOF
+ln -sfT fastcgi.conf.holoscript usr/share/holo/files/10-"$pkgname"/etc/nginx/fastcgi_params.holoscript
+ln -sfT fastcgi.conf.holoscript usr/share/holo/files/10-"$pkgname"/etc/nginx/scgi_params.holoscript
+ln -sfT fastcgi.conf.holoscript usr/share/holo/files/10-"$pkgname"/etc/nginx/uwsgi_params.holoscript
+
+# `mime.types` has had xz, gzip, bzip2, tar, PGP (`.sig`), and
+# bittorrent types added to it. This list was based on the unmatched
+# file extensions that `find` turned up on `repo.parabola.nu`.
+add-file -m755 usr/share/holo/files/10-"$pkgname"/etc/nginx/mime.types.holoscript <<EOF
+#!/bin/sh
+{
+ echo '# -*- Mode: nginx; nginx-indent-level: 4; indent-tabs-mode: nil -*-'
+ echo
+ sed -e '
+/types {/ {
+ a\\ application/x-xz xz;
+ a\\ application/x-gzip gz;
+ a\\ application/x-bzip2 bz2;
+ a\\ application/x-tar tar;
+ a\\ application/octet-stream sig;
+ a\\ application/x-bittorrent torrent;
+ a\\
+
+}'
+} | awk '\$0==""||!x[\$0]++' | cat -s
+EOF
+
add-file etc/nginx/sites/alias-parabolagnulinux_org.conf <<EOF
# -*- Mode: nginx; nginx-indent-level: 8; indent-tabs-mode: t -*-
# Redirect everything from *.parabolagnulinux.org to *.parabola.nu
@@ -45,4 +82,3 @@ add-unit etc/systemd/system/multi-user.target.wants/nginx.service
postamble
}
-