Files: 5dd0de9aec2519516e453b46919af8a1c764f3ef / salt / state / pub.sls
1655 bytesRaw
1 | {# TODO |
2 | |
3 | apt update |
4 | apt upgrade -y |
5 | apt install -y apt-transport-https ca-certificates curl software-properties-common |
6 | wget https://download.docker.com/linux/debian/gpg -O docker-gpg |
7 | sudo apt-key add docker-gpg |
8 | echo "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee -a /etc/apt/sources.list.d/docker.list |
9 | apt update |
10 | apt install -y docker-ce |
11 | systemctl start docker |
12 | systemctl enable docker |
13 | |
14 | docker pull ahdinosaur/ssb-pub |
15 | |
16 | mkdir /root/ssb-pub-data |
17 | chown -R 1000:1000 /root/ssb-pub-data |
18 | |
19 | docker 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 | |
27 | ahdinosaur/ssb-pub: |
28 | docker_image.present |
29 | |
30 | ahdinosaur/healer: |
31 | docker_image.present |
32 | |
33 | healer: |
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