Commit 8192b526b3113379f8313148ee2bd69543f4d7bd
or hub not hubs
Michael Williams committed on 12/25/2017, 9:52:45 AMParent: 94540f5f28111d29aefd6f03c4aecbcceb764733
Files changed
README.md | changed |
salt/state/hub.sls | changed |
salt/state/pub.sls | deleted |
README.md | ||
---|---|---|
@@ -9,8 +9,10 @@ | ||
9 | 9 … | most people seem happy to pay $5 / month. |
10 | 10 … | |
11 | 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 | 12 … | |
13 … | +hubs > pubs > rugs | |
14 … | + | |
13 | 15 … | ## job stories |
14 | 16 … | |
15 | 17 … | - when i want to start a bot, |
16 | 18 … | - if i haven't been here before: i can register, setup a monthly payment, and name my first bot |
salt/state/hub.sls | ||
---|---|---|
@@ -1,0 +1,84 @@ | ||
1 … | +ahdinosaur/ssb-pub: | |
2 … | + docker_image.present | |
3 … | + | |
4 … | +ahdinosaur/healer: | |
5 … | + docker_image.present | |
6 … | + | |
7 … | +healer: | |
8 … | + docker_container.running: | |
9 … | + - image: ahdinosaur/healer | |
10 … | + - require: | |
11 … | + - docker_image: ahdinosaur/healer | |
12 … | + | |
13 … | +{% set seeds = salt['grains.get']('hub.seeds', []) %} | |
14 … | +{% set pubs = salt['grains.get']('hub.pubs', []) %} | |
15 … | + | |
16 … | +{% for pub in pubs %} | |
17 … | + | |
18 … | +{% set name = pub.name %} | |
19 … | +{% set port = pub.port or 8008 %} | |
20 … | + | |
21 … | +{% set secret = pub.secret %} | |
22 … | +{% set curve = secret.curve %} | |
23 … | +{% set public = secret.public %} | |
24 … | +{% set private = secret.private %} | |
25 … | + | |
26 … | +{{ name }}/: | |
27 … | + file.directory: | |
28 … | + - name: /root/bots/{{ name }}/ | |
29 … | + - mode: 755 | |
30 … | + - user: debian | |
31 … | + - group: debian | |
32 … | + - recurse: | |
33 … | + - user | |
34 … | + - group | |
35 … | + | |
36 … | +{{ name }}/secret: | |
37 … | + file.managed: | |
38 … | + - name: /root/bots/{{ name }}/secret | |
39 … | + - dataset: | |
40 … | + curve: {{ curve }} | |
41 … | + public: {{ public }}.{{ curve }} | |
42 … | + private: {{ private }}.{{ curve }} | |
43 … | + id: @{{ public }}.{{ curve }} | |
44 … | + - mode: 0400 | |
45 … | + - user: debian | |
46 … | + - group: debian | |
47 … | + - formatter: json | |
48 … | + - merge_if_exists: True | |
49 … | + - require: | |
50 … | + - file: {{ name }}/ | |
51 … | + | |
52 … | +{{ name }}/config: | |
53 … | + file.serialize: | |
54 … | + - name: /root/bots/{{ name }}/config | |
55 … | + - dataset: | |
56 … | + seeds: | |
57 … | + - net:{{ name }}:{{ port }}~shs:{{ public }} | |
58 … | + {% for seed in seeds %} | |
59 … | + - {{ seed }} | |
60 … | + {% endfor %} | |
61 … | + - formatter: json | |
62 … | + - mode: 644 | |
63 … | + - user: debian | |
64 … | + - group: debian | |
65 … | + - merge_if_exists: True | |
66 … | + - require: | |
67 … | + - file: {{ name }}/ | |
68 … | + | |
69 … | +{{ name }}: | |
70 … | + docker_container.running: | |
71 … | + - image: ahdinosaur/ssb-pub | |
72 … | + - env: | |
73 … | + - ssb_host: {{ name }} | |
74 … | + - binds: | |
75 … | + - /root/bots/{{ name }}:/home/node/.ssb/ | |
76 … | + - ports: | |
77 … | + - 8008 | |
78 … | + - restart_policy: unless-stopped | |
79 … | + - require: | |
80 … | + - docker_image: ahdinosaur/ssb-pub | |
81 … | + - file: {{ name }}/secret | |
82 … | + - file: {{ name }}/config | |
83 … | + | |
84 … | +{% endfor %} |
salt/state/pub.sls | ||
---|---|---|
@@ -1,83 +1,0 @@ | ||
1 | -ahdinosaur/ssb-pub: | |
2 | - docker_image.present | |
3 | - | |
4 | -ahdinosaur/healer: | |
5 | - docker_image.present | |
6 | - | |
7 | -healer: | |
8 | - docker_container.running: | |
9 | - - image: ahdinosaur/healer | |
10 | - - require: | |
11 | - - docker_image: ahdinosaur/healer | |
12 | - | |
13 | -{% set seeds = salt['grains.get']('pub.seeds', []) %} | |
14 | -{% set pubs = salt['grains.get']('pub.list', []) %} | |
15 | -{% for pub in pubs %} | |
16 | - | |
17 | -{% set name = pub.name %} | |
18 | -{% set port = pub.port or 8008 %} | |
19 | - | |
20 | -{% set secret = pub.secret %} | |
21 | -{% set curve = secret.curve %} | |
22 | -{% set public = secret.public %} | |
23 | -{% set private = secret.private %} | |
24 | - | |
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: | |
36 | - file.managed: | |
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 | |
48 | - - require: | |
49 | - - file: {{ name }}/ | |
50 | - | |
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 | |
65 | - - require: | |
66 | - - file: {{ name }}/ | |
67 | - | |
68 | -{{ name }}: | |
69 | - docker_container.running: | |
70 | - - image: ahdinosaur/ssb-pub | |
71 | - - env: | |
72 | - - ssb_host: {{ name }} | |
73 | - - binds: | |
74 | - - /root/bots/{{ name }}:/home/node/.ssb/ | |
75 | - - ports: | |
76 | - - 8008 | |
77 | - - restart_policy: unless-stopped | |
78 | - - require: | |
79 | - - docker_image: ahdinosaur/ssb-pub | |
80 | - - file: {{ name }}/secret | |
81 | - - file: {{ name }}/config | |
82 | - | |
83 | -{% endfor %} |
Built with git-ssb-web