Skip to content

Commit

Permalink
Enable full maintenance of DNS
Browse files Browse the repository at this point in the history
  • Loading branch information
MTecknology committed Feb 21, 2024
1 parent 492c860 commit 3a84bd3
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 7 deletions.
47 changes: 47 additions & 0 deletions pillar/webapps.sls
Original file line number Diff line number Diff line change
@@ -1,7 +1,54 @@
#!jinja|yaml|gpg

webapps:
{% if salt.match.glob('irc.lustfield.net') %}
mtpaste: paste.lustfield.net
ipecho: ip.lustfield.net
{% elif salt.match.glob('*.sobersupport.group') %}
soberpage: None # monolithic
{% endif %}

##
# App Tokens
##

{% if salt.match.glob('*.sobersupport.group') %}
cloudflare:
token: |
-----BEGIN PGP MESSAGE-----
hQIMA7+DShJS+9zMAQ/9EHVMrFGifOf4D/6TZl6FR1oFb0cUvYqrWHApDtUcVFYy
a+nD2UsR0MYxCmvPFVGyxxSRWCZWTrDSpUz1oXIPX2ah0cM/MQapfL2sSamMmeYj
HazKR4ucDVk0BfEMSfJBb/dd3ArQrN7jke7kBxjRV2szLts0BzVCRI/Ru6WD9KyD
WdvrRoSfc3BoHwczrr4lLL0yOp5ygm43WzgE8WilvxhbrVnHMs9t3S5hA81akvvY
GZDHKsJGDPNGYOdCebtGrrmY3p+AmymU6vDBld9pVEp8RkVpY5A1OKEhgNcdG+C7
LRjSHMWS8CsFQxASOUXpkEjbLo9EgBiD8E454jEOncJqSThvZO9D1HiQU78IZj/x
sU+aVuwAfQLkzt8kvKOVw/7B1ywy72TKKWBXMRg3+qk5qb1MRKz0HMCBRzxCnW2s
2poWbpOoK+IL5x50h72zW9mNq2Unz0/tl105nbPVc/RtMSuDF2Yw3zfKIX+1+izh
0UYHNckeg749vbVwMBYcxl+O0iMoZMKQKxrx8HqLyJ/rai57ch4X5v3jUnkrmCOQ
mp/YhOREjYynhAhk6m3xnCCMwcapzQyd2Rb0vsr9qErxm4MNa91OGgR8oS9xK3Ok
3jefCkzqgiEjxUcqaD/0UZ9umMj7jhrCPXSumfq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}
18 changes: 11 additions & 7 deletions states/webapps/soberpage.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@ include:
- nginx

cloudflare-api:
file.managed:
- name: /root/.cloudflare.cfg
- contents: TODO
pkg.installed:
- name: python3-cloudflare
file.managed:
- name: /root/.cloudflare.cfg
- contents: |
[CloudFlare]
token = {{ salt.pillar.get('cloudflare:token') }}
zone = {{ salt.pillar.get('cloudflare:zone') }}
- mode: '0600'
- require:
- pkg: cloudflare-api

soberpage:
git.latest:
Expand All @@ -23,22 +29,20 @@ soberpage:
- watch_in:
- service: nginx
cmd.run:
- name: "/srv/webapps/soberpage/sync -n -d /srv/webapps/soberpage/data/domains"
- name: "/srv/webapps/soberpage/sync -n -d /srv/webapps/soberpage/data/domains -r"
- require:
- pkg: nginx
- git: soberpage
- pkg: cloudflare-api
- file: cloudflare-api
- onchanges:
- git: soberpage
- watch_in:
- service: nginx
cron.present:
- name: "/srv/webapps/soberpage/sync -n -d /srv/webapps/soberpage/data/domains && service nginx reload"
- name: "/srv/webapps/soberpage/sync -n -d /srv/webapps/soberpage/data/domains -r && service nginx reload"
- identifier: soberpge
- minute: 30
- hour: 0
- require:
- git: soberpage
- pkg: cloudflare-api
- file: cloudflare-api

0 comments on commit 3a84bd3

Please sign in to comment.