-
Notifications
You must be signed in to change notification settings - Fork 71
/
setup-keter.sh
executable file
·54 lines (43 loc) · 1.28 KB
/
setup-keter.sh
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
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
mkdir -p /opt/keter/bin
cp ~/.local/bin/keter /opt/keter/bin
mkdir -p /opt/keter/etc
cat > /tmp/keter-config.yaml <<EOF
# Directory containing incoming folder, where to store logs, etc. Relative to
# the config file directory.
root: ..
# Keter can listen on multiple ports for incoming connections. These ports can
# have HTTPS either enabled or disabled.
listeners:
# HTTP
- host: "!6" # Listen on all IPv4 hosts
port: 80 # Could be used to modify port
# HTTPS
- host: "!6"
port: 443
key: key.pem
certificate: certificate.pem
# User to run applications as
# setuid: ubuntu
# Get the user's IP address from x-forwarded-for. Useful when sitting behind a
# load balancer like Amazon ELB.
# ip-from-header: true
EOF
chown root:root /tmp/keter-config.yaml
mv /tmp/keter-config.yaml /opt/keter/etc
cat > /tmp/keter.service <<EOF
[Unit]
Description=Keter Web Server
Documentation=man:keter(1p) http://github.com/snoyberg/keter
After=network.service
[Service]
ExecStart=/opt/keter/bin/keter /opt/keter/etc/keter-config.yaml
[Install]
WantedBy=multi-user.target
EOF
chown root:root /tmp/keter.service
mv /tmp/keter.service /etc/systemd/system/
systemctl enable keter
systemctl start keter
mkdir -p /opt/keter/incoming
chown "$(whoami)" /opt/keter/incoming