git ssb

1+

dinoworm ๐Ÿ› / butt-as-a-service



Tree: 5dd0de9aec2519516e453b46919af8a1c764f3ef

Files: 5dd0de9aec2519516e453b46919af8a1c764f3ef / salt / state / pub.sls

1655 bytesRaw
1{# TODO
2
3apt update
4apt upgrade -y
5apt install -y apt-transport-https ca-certificates curl software-properties-common
6wget https://download.docker.com/linux/debian/gpg -O docker-gpg
7sudo apt-key add docker-gpg
8echo "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee -a /etc/apt/sources.list.d/docker.list
9apt update
10apt install -y docker-ce
11systemctl start docker
12systemctl enable docker
13
14docker pull ahdinosaur/ssb-pub
15
16mkdir /root/ssb-pub-data
17chown -R 1000:1000 /root/ssb-pub-data
18
19docker run -d --name sbot \
20 -v ~/ssb-pub-data/:/home/node/.ssb/ \
21 -e ssb_host="<hostname.yourdomain.tld>" \
22 -p 8008:8008 --restart unless-stopped \
23 ahdinosaur/ssb-pub
24
25#}
26
27ahdinosaur/ssb-pub:
28 docker_image.present
29
30ahdinosaur/healer:
31 docker_image.present
32
33healer:
34 docker_container.running:
35 - image: ahdinosaur/healer
36 - require:
37 - docker_image: ahdinosaur/healer
38
39{% set pubs = salt['grains.get']('pub.list', []) %}
40{% for pub in pubs %}
41
42{% set name = pub.name %}
43
44/root/bots/{{name}}
45 file.directory
46
47/root/bots/{{name}}/secret
48 file.managed:
49 - mode:
50 - require:
51 - file: /root/bots/{{name}}
52
53/root/bots/{{name}}/gossip.json
54 file.managed:
55 - require:
56 - file: /root/bots/{{name}}
57
58{{name}}:
59 docker_container.running:
60 - image: ahdinosaur/ssb-pub
61 - env:
62 - ssb_host: {{name}}
63 - binds:
64 - /root/bots/{{name}}:/home/node/.ssb/
65 - ports:
66 - 8008
67 - restart_policy: unless-stopped
68 - require:
69 - docker_image: ahdinosaur/ssb-pub
70 - file: /root/bots/{{name}}/secret
71 - file: /root/bots/{{name}}/gossip.json
72
73{% endfor %}
74

Built with git-ssb-web