30 lines
686 B
Bash
30 lines
686 B
Bash
#!/bin/sh
|
|
set -e
|
|
|
|
# create user which peach-web runs as
|
|
adduser --quiet --system peach-web
|
|
usermod -g peach peach-web
|
|
|
|
# create nginx config
|
|
cat <<EOF > /etc/nginx/sites-enabled/default
|
|
server {
|
|
listen 80 default_server;
|
|
server_name peach.local www.peach.local;
|
|
|
|
# remove trailing slash if found
|
|
rewrite ^/(.*)/$ /$1 permanent;
|
|
|
|
location / {
|
|
proxy_pass http://127.0.0.1:3000;
|
|
}
|
|
}
|
|
EOF
|
|
|
|
cat <<EOF > /etc/sudoers.d/peach-web
|
|
# allow peach-web to run commands as peach-go-sbot without a password
|
|
peach-web ALL=(peach-go-sbot) NOPASSWD:ALL
|
|
|
|
EOF
|
|
|
|
# cargo deb automatically replaces this token below, see https://github.com/mmstick/cargo-deb/blob/master/systemd.md
|
|
#DEBHELPER# |