Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
infrastructure
Commits
373d4918
Verified
Commit
373d4918
authored
Jul 05, 2021
by
Jelle van der Waa
🚧
Browse files
Add redirects for git.archlinux.org using a map
parent
bbc8c959
Pipeline
#9688
passed with stage
in 49 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
roles/redirects/defaults/main.yml
View file @
373d4918
...
...
@@ -2,6 +2,7 @@
# - domain: the domain to listen on
# - to: the redirect target as defined by the nginx return statement
# - type: HTTP status code to use (302 = temporary redirect, 301 = permanent redirect)
# - map: the mapping file
redirects
:
-
mailman
:
domain
:
mailman.archlinux.org
...
...
@@ -15,3 +16,8 @@ redirects:
domain
:
coc.archlinux.org
to
:
https://gitlab.archlinux.org/archlinux/service-agreements/-/blob/master/code-of-conduct.md
type
:
302
-
cgit
:
domain
:
git.archlinux.org
to
:
https://gitlab.archlinux.org
type
:
301
map
:
maps/cgit-migrated-repos.map
roles/redirects/files/maps/cgit-migrated-repos.map
0 → 100644
View file @
373d4918
/pacman.git https://gitlab.archlinux.org/pacman/pacman;
/pacman-contrib.git https://gitlab.archlinux.org/pacman/pacman-contrib;
/netctl.git https://gitlab.archlinux.org/archlinux/netctl;
/mkinitcpio.git https://github.com/archlinux/mkinitcpio;
roles/redirects/tasks/main.yml
View file @
373d4918
...
...
@@ -14,3 +14,6 @@
template
:
src=nginx.d.conf.j2 dest="/etc/nginx/nginx.d/redirects.conf" owner=root group=root mode=644
notify
:
reload nginx
tags
:
[
'
nginx'
]
-
name
:
copy nginx map files
copy
:
src=maps dest=/etc/nginx/ owner=root group=root mode=0600
roles/redirects/templates/nginx.d.conf.j2
View file @
373d4918
{% for redirect in redirects %}
{% if redirect.map is defined %}
map $uri ${{ redirect.map | hash('md5') }} {
default "";
include {{ redirect.map }};
}
{% endif %}
server {
listen 80;
listen [::]:80;
...
...
@@ -17,7 +24,12 @@ server {
include snippets/letsencrypt.conf;
location / {
return {{ redirect.type }} {{ redirect.to }};
{% if redirect.map is defined %}
if (${{ redirect.map | hash('md5') }} != "") {
return {{ redirect.type }} ${{ redirect.map | hash('md5') }};
}
{% endif %}
return {{ redirect.type }} {{ redirect.to }};
}
}
{% endfor %}
tf-stage1/archlinux.tf
View file @
373d4918
...
...
@@ -288,6 +288,7 @@ locals {
status
=
{
value
=
"stats.uptimerobot.com."
}
svn
=
{
value
=
"gemini"
}
coc
=
{
value
=
"redirect"
}
git
=
{
value
=
"redirect"
}
# MTA-STS
mta
-
sts
=
{
value
=
"mail"
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment