Skip to content

Commit

Permalink
add gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
andibraeu committed Aug 22, 2021
1 parent 5912ded commit f21e20f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ This collection of scripts and configuration creates everything needed for redir
2. Configure the redirects you want in `vars/main.yaml`. See the example file.
3. run `./create_vars.py > vars/vhosts.yaml` to create the vhosts configuration
4. run `ansible-playbook -i inventory configure_redirects.yaml` to create everything. This can take a while.
5. copy the file `apache/410.html` to the web root folder of `zzz.freifunk.net`
14 changes: 14 additions & 0 deletions apache/410.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>410 Gone - Subdomain unbekannt</title>
</head>
<body>
<h1>410 Gone - diese Subdomain gibt es nicht unter freifunk.net</h1>
<p>
Alles über freifunk kannst du auf unserer Homepage <a href="https://freifunk.net">freifunk.net</a> erfahren.
</p>
</body>
</html>
24 changes: 18 additions & 6 deletions create_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,29 @@
output['apache_vhosts_ssl'].append(vhost_ssl)

fallbackVhost = dict()
fallbackVhost['servername'] = "www.freifunk.net"
fallbackVhost['servername'] = "zzz.freifunk.net"
fallbackVhost['serveralias'] = []
fallbackVhost['serveralias'].append("*.freifunk.net")
fallbackVhost['serveralias'].append("www.freifunk.net")
fallbackVhost['redirect_to_servername'] = False
fallbackCustomError = dict()
fallbackCustomError['code'] = 410
fallbackCustomError['action'] = "/410.html"
fallbackVhost['custom_errors'] = []
fallbackVhost['custom_errors'].append(fallbackCustomError)
fallbackVhost['custom_rewrites'] = []
fallbackCondition = dict()
fallbackCondition['test_string'] = "%{HTTP_HOST}"
fallbackCondition['pattern'] = "!^freifunk\\.net"
fallbackCondition['flags'] = "[NC]"
fallbackCondition1 = dict()
fallbackCondition1['test_string'] = "%{HTTP_HOST}"
fallbackCondition1['pattern'] = "!^freifunk\\.net"
fallbackCondition1['flags'] = "[NC]"
fallbackCondition2 = dict()
fallbackCondition2['test_string'] = "%{REQUEST_URI}"
fallbackCondition2['pattern'] = "!^/410\.html"
fallbackCondition2['flags'] = "[NC]"
fallbackPattern = dict()
fallbackPattern['conditions'] = []
fallbackPattern['conditions'].append(fallbackCondition)
fallbackPattern['conditions'].append(fallbackCondition1)
fallbackPattern['conditions'].append(fallbackCondition2)
fallbackPattern['substitution'] = "-"
fallbackPattern['flags'] = "[G]"
fallbackPattern['pattern'] = "^.*$"
Expand Down

0 comments on commit f21e20f

Please sign in to comment.