Skip to content

Commit

Permalink
Change canonical domain to sober.page (Closes #6)
Browse files Browse the repository at this point in the history
  • Loading branch information
MTecknology committed Jul 16, 2024
1 parent dd509f1 commit 20f44f0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 22 deletions.
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
baseURL: https://about.sobersupport.group/
baseURL: https://about.sober.page/
title: Sober Page

languageCode: en-us
Expand Down
10 changes: 0 additions & 10 deletions content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,6 @@ Potential uses:
- Use it as your own website address (ideal with static sites)
- Use sober.page as a "short url" service

Short URL
---------

All ``sobersupport.group`` URLs are also available via ``sober.page``. This
serves as a convenient "Short URL" which should be easier for both memory and
document spacing.

Example: https://aaX.sober.page/meetings
redirects to https://aaX.sobersupport.group/meetings

Our Commitment
--------------

Expand Down
16 changes: 8 additions & 8 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ server {
}

##
# Canonical Domain: sobersupport.group
# Note: Only external redirects should be hanlded by this server block.
# Canonical Domain: sober.page
# Note: Only external redirects should be handled by this server block.
##
map $host $canonical_redirect {
default https://about.sobersupport.group/unconfigured/;
default https://about.sober.page/unconfigured/;
include canonical_redirects.map;
}
server {
Expand All @@ -24,7 +24,7 @@ server {
add_header Vary "Accept-Encoding";

# Forward to external domain
server_name *.sobersupport.group;
server_name *.sober.page;
return 302 $canonical_redirect;

# Increase cache lifetime
Expand All @@ -35,7 +35,7 @@ server {
}

##
# Alias: sober.page
# Backup/Alias: sobersupport.group
# Note: Nearly all requests to this domain will use this server block.
##
map $http_cf_visitor $cf_scheme {
Expand All @@ -53,8 +53,8 @@ server {
add_header Vary "Accept-Encoding";

# Forward <fwd>.sober.page/<path> to <fwd>.sobersupport.group/<path>
server_name ~^(?<fwd>.+)\.sober\.page$;
return 301 $cf_scheme://$fwd.sobersupport.group$request_uri;
server_name ~^(?<fwd>.+)\.sobersupport\.group$;
return 301 $cf_scheme://$fwd.sober.page$request_uri;

# Increase cache lifetime
add_header Cloudflare-CDN-Cache-Control max-age=86400;
Expand All @@ -77,7 +77,7 @@ server {

# Forward apex and www to about page
server_name sober.page www.sober.page sobersupport.group www.sobersupport.group;
return 301 https://about.sobersupport.group$request_uri;
return 301 https://about.sober.page$request_uri;

# Increase cache lifetime
add_header Cloudflare-CDN-Cache-Control max-age=86400;
Expand Down
4 changes: 2 additions & 2 deletions sync/cloudflare.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def push_dns(source_data, zone=None):
logging.info(f'Creating record for {subdomain}')
cf.zones.dns_records.post(zone, data={
'type': record['type'].upper(),
'name': f'{subdomain}.sobersupport.group',
'name': f'{subdomain}.sober.page',
'content': record['target'],
'proxied': record.get('cache', False),
'comment': 'sync-managed',
Expand All @@ -73,7 +73,7 @@ def push_dns(source_data, zone=None):
cf.zones.dns_records.put(
zone, current_records[subdomain]['id'], data={
'type': record['type'].upper(),
'name': f'{subdomain}.sobersupport.group',
'name': f'{subdomain}.sober.page',
'content': record['target'],
'proxied': record.get('cache', False),
'comment': 'sync-managed',
Expand Down
2 changes: 1 addition & 1 deletion sync/nginx.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ def make_map(data, path='/etc/nginx/canonical_redirects.map'):
if meta['type'].lower() != 'forward':
continue
# Append line for external redirect
fh.write(f'{subdomain}.sobersupport.group\t{meta["target"]};\n')
fh.write(f'{subdomain}.sober.page\t{meta["target"]};\n')

0 comments on commit 20f44f0

Please sign in to comment.