Skip to content

Commit

Permalink
Fix missing assignment of webapps to server
Browse files Browse the repository at this point in the history
  • Loading branch information
MTecknology committed Feb 18, 2024
1 parent 7f22630 commit a3df3a1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
3 changes: 1 addition & 2 deletions states/top.sls
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ base:
- match: compound
- ssh

'irc*':
- irssi
'forwarder*':
- webapps

'mikepc*':
Expand Down
7 changes: 6 additions & 1 deletion states/webapps/nginx-cfg/soberpage.conf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ server {
# Alias: sober.page
# Note: Nearly all requests to this domain will use this server block.
##
map $http_cf_visitor $cf_scheme {
default $scheme;
'~"scheme":"https"' "https";
'~"scheme":"http"' "http";
}
server {
# Socket Settings
listen 80;
Expand All @@ -47,5 +52,5 @@ server {

# Forward <fwd>.sober.page/<path> to <fwd>.sobersupport.group/<path>
server_name ~^(?<fwd>.+)\.sober\.page$;
return 301 $scheme://$fwd.sobersupport.group$request_uri;
return 301 $cf_scheme://$fwd.sobersupport.group$request_uri;
}
9 changes: 9 additions & 0 deletions states/webapps/soberpage.sls
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@ soberpage:
- service: nginx
cmd.run:
- name: /srv/soberpage/sync.py -n
- require:
- pkg: nginx
- watch:
- git: soberpage
- watch_in:
- service: nginx
cron.present:
- name: "/srv/soberpage/sync.py -n && service nginx reload"
- identifier: soberpge
- minute: 30
- hour: 0
- require:
- git: soberpage

0 comments on commit a3df3a1

Please sign in to comment.