~nromdotcom/gemif

ref: 4537a2f30ac534f927315780f6176cd14ba1cbe4 gemif/infra/user_data/install_gemif.sh -rw-r--r-- 1.1 KiB
4537a2f3Norm MacLennan Update story 1 year, 1 month ago
                                                                                
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
#! /usr/bin/env sh
mkdir -p /home/ec2-user/gemif && cd $_

cat >/etc/systemd/system/gemif.service <<EOF
[Unit]
Description=GemIF Server
ConditionPathExists=/home/ec2-user/gemif
After=network.target

[Service]
Type=simple
User=ec2-user
Group=ec2-user

Restart=always
RestartSec=10s

WorkingDirectory=/home/ec2-user/gemif
ExecStart=/home/ec2-user/gemif/gemif

[Install]
WantedBy=multi-user.target
EOF

cat >/home/ec2-user/gemif/acme.crt <<EOF
${cert}
EOF

cat >/home/ec2-user/gemif/acme.key <<EOF
${key}
EOF

cat >/home/ec2-user/gemif/config.toml <<EOF
[gemserver]
domain    = "gemif.fedi.farm"
port      = 1965
cert_file = "./acme.crt"
key_file  = "./acme.key"

[engine]
stories_dir         = "./stories/compiled"
render_descriptions = true
statetoken_format   = "proto"
EOF

wget https://git.sr.ht/~nromdotcom/gemif/refs/${version}/gemif-linux-arm64-${version}.tar.gz
wget https://git.sr.ht/~nromdotcom/gemif/refs/${version}/bundled-stories-${version}.tar.gz
tar xvf ./gemif-linux-arm64-${version}.tar.gz --strip=3
tar xvf ./bundled-stories-${version}.tar.gz
chown -R ec2-user .

systemctl daemon-reload
systemctl start gemif.service