summaryrefslogtreecommitdiff
path: root/config-service-myhostname.PKGBUILD
blob: 921b7e7054afdf407d6f5443397b3666ad3b810f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
. ${BUILDFILE%/*}/common.sh
pkgver=20161111.1

package() {
preamble

add-file etc/nginx/sites/server-myhostname.conf <<EOF
# -*- Mode: nginx; nginx-indent-level: 8; indent-tabs-mode: t -*-

server {
	server_name \$hostname;
	listen 443 ssl http2;
	listen [::]:443 ssl http2;

	error_log  /var/log/nginx/nginx.http.myhostname.error.log  error;
	access_log /var/log/nginx/nginx.http.myhostname.access.log specific;

	location = / {
		uwsgi_pass unix:/run/uwsgi/myhostname.sock;
		uwsgi_modifier1 9; # Standard CGI request
		include uwsgi_params;
	}
}
EOF

add-file etc/uwsgi/myhostname.ini <<EOF
[uwsgi]
master = true
processes = 1

uid = nobody
gid = http

plugins = cgi
cgi = /srv/http/myhostname/sysinfo
EOF

add-unit etc/systemd/system/sockets.target.wants/uwsgi@myhostname.socket

postamble
}