|
@@ -2,13 +2,15 @@
|
|
|
# /etc/nginx/sites-enabled/firmware.in.ffho.net (Salt managed)
|
|
|
#
|
|
|
|
|
|
+{%- set acme_thumbprint = salt['pillar.get']('acme:thumbprint', False) %}
|
|
|
+
|
|
|
server {
|
|
|
listen 80;
|
|
|
listen [::]:80;
|
|
|
|
|
|
root {{salt['pillar.get']('nodes:' ~ grains['id'] ~ ':path:firmware', [])}};
|
|
|
|
|
|
- server_name ~^firmware\.(srv\.)?in\.ffho\.net$;
|
|
|
+ server_name ~^firmware\.((srv\.)?in|im)\.ffho\.net$;
|
|
|
fancyindex on;
|
|
|
fancyindex_exact_size off;
|
|
|
fancyindex_name_length 70;
|
|
@@ -21,6 +23,13 @@ server {
|
|
|
fancyindex_ignore header.html favicon.ico models-short.txt models.txt robots.txt scripts;
|
|
|
}
|
|
|
|
|
|
+ {%- if acme_thumbprint %}
|
|
|
+ location ~ "^/\.well-known/acme-challenge/([-_a-zA-Z0-9]+)$" {
|
|
|
+ default_type text/plain;
|
|
|
+ return 200 "$1.{{ acme_thumbprint }}";
|
|
|
+ }
|
|
|
+ {%- endif %}
|
|
|
+
|
|
|
location ~ /\. {
|
|
|
deny all;
|
|
|
}
|
|
@@ -30,10 +39,12 @@ server {
|
|
|
}
|
|
|
|
|
|
location ~ ^/(?<site_code>(ffho(_(\w\w\w))?(_(cty|uml))?))/(stable|testing|experimental)/sysupgrade/((?<branch>(stable|testing|experimental))\.manifest)$ {
|
|
|
+ disable_symlinks off;
|
|
|
try_files $uri /$branch/sysupgrade/$branch.$site_code.manifest /$branch/sysupgrade/$branch.manifest;
|
|
|
}
|
|
|
|
|
|
location ~ ^/(?<site_code>(ffho(_(\w\w\w))?(_(cty|uml))?))/(?<branch>(stable|testing|experimental))/sysupgrade/(?<file>.*) {
|
|
|
+ disable_symlinks off;
|
|
|
try_files $uri /$branch/sysupgrade/$file /stable/sysupgrade/$file /testing/sysupgrade/$file /experimental/sysupgrade/$file;
|
|
|
}
|
|
|
|
|
@@ -42,6 +53,11 @@ server {
|
|
|
return 302 http://ftp.stw-bonn.de/pub/openwrt/$file;
|
|
|
}
|
|
|
|
|
|
+ # lede mirror
|
|
|
+ location ~^/lede/(?<file>.+)$ {
|
|
|
+ return 302 http://downloads.lede-project.org/releases/$file;
|
|
|
+ }
|
|
|
+
|
|
|
# autoupdater legacy glue
|
|
|
location ~ ^/(?<site_code>(ffho(_(\w\w\w))?(_(cty|uml))?))/(?<branch>(stable|testing|experimental))/($branch\.manifest)$ {
|
|
|
try_files $uri /$branch/sysupgrade/$branch.$site_code.manifest /$branch/sysupgrade/$branch.manifest =404;
|