git ssb

1+

dinoworm 🐛 / butt-as-a-service



Commit 40418a9424b81b0aad278b3f2ab3bb4365608462

approaching

Michael Williams committed on 12/25/2017, 8:05:31 AM
Parent: 5dd0de9aec2519516e453b46919af8a1c764f3ef

Files changed

README.mdchanged
salt/state/pub.slschanged
README.mdView
@@ -1,10 +1,16 @@
11 # Butt as a Service
22
3-what if everyone had a friend in the cloud?
3 +what if everyone had a friend in the bot family?
44
55 Butt as a Service helps you provision and monitor Scuttlebutt bots in the cloud.
66
7 +## business
8 +
9 +most people seem happy to pay $5 / month.
10 +
11 +if we prove a successful value flow, we can scale the ecosystem of Scuttlebutt bot providers, in order to support the ecosystem of Scuttlebutt organizers.
12 +
713 ## job stories
814
915 - when i want to start a bot,
1016 - if i haven't been here before: i can register, setup a monthly payment, and name my first bot
salt/state/pub.slsView
@@ -1,30 +1,4 @@
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-
271 ahdinosaur/ssb-pub:
282 docker_image.present
293
304 ahdinosaur/healer:
@@ -35,39 +9,75 @@
359 - image: ahdinosaur/healer
3610 - require:
3711 - docker_image: ahdinosaur/healer
3812
13 +{% set seeds = salt['grains.get']('pub.seeds', []) %}
3914 {% set pubs = salt['grains.get']('pub.list', []) %}
4015 {% for pub in pubs %}
4116
4217 {% set name = pub.name %}
18 +{% set port = pub.port or 8008 %}
4319
44-/root/bots/{{name}}
45- file.directory
20 +{% set secret = pub.secret %}
21 +{% set curve = secret.curve %}
22 +{% set public = secret.public %}
23 +{% set private = secret.private %}
4624
47-/root/bots/{{name}}/secret
25 +{{ name }}/:
26 + file.directory:
27 + - name: /root/bots/{{ name }}/
28 + - mode: 755
29 + - user: debian
30 + - group: debian
31 + - recurse:
32 + - user
33 + - group
34 +
35 +{{ name }}/secret:
4836 file.managed:
49- - mode:
37 + - name: /root/bots/{{ name }}/secret
38 + - dataset:
39 + curve: {{ curve }}
40 + public: {{ public }}.{{ curve }}
41 + private: {{ private }}.{{ curve }}
42 + id: @{{ public }}.{{ curve }}
43 + - mode: 0400
44 + - user: debian
45 + - group: debian
46 + - formatter: json
47 + - merge_if_exists: True
5048 - require:
51- - file: /root/bots/{{name}}
49 + - file: {{ name }}/
5250
53-/root/bots/{{name}}/gossip.json
54- file.managed:
51 +{{ name }}/config:
52 + file.serialize:
53 + - name: /root/bots/{{ name }}/config
54 + - dataset:
55 + seeds:
56 + - net:{{ name }}:{{ port }}~shs:{{ public }}
57 + {% for seed in seeds %}
58 + - {{ seed }}
59 + {% endfor %}
60 + - formatter: json
61 + - mode: 644
62 + - user: debian
63 + - group: debian
64 + - merge_if_exists: True
5565 - require:
56- - file: /root/bots/{{name}}
66 + - file: {{ name }}/
5767
58-{{name}}:
68 +{{ name }}:
5969 docker_container.running:
6070 - image: ahdinosaur/ssb-pub
6171 - env:
62- - ssb_host: {{name}}
72 + - ssb_host: {{ name }}
6373 - binds:
64- - /root/bots/{{name}}:/home/node/.ssb/
74 + - /root/bots/{{ name }}:/home/node/.ssb/
6575 - ports:
6676 - 8008
6777 - restart_policy: unless-stopped
6878 - require:
6979 - docker_image: ahdinosaur/ssb-pub
70- - file: /root/bots/{{name}}/secret
71- - file: /root/bots/{{name}}/gossip.json
80 + - file: {{ name }}/secret
81 + - file: {{ name }}/config
7282
7383 {% endfor %}

Built with git-ssb-web