fancy dash

This commit is contained in:
Mateusz Gruszczyński committed 2026-10-22 11:23:32 +02:00
1 parent 3b317a4f0c
commit ccccdc2031
16 files changed
+1530 -34

No files matched your search

+43 -23
View File
@@ -23,7 +23,8 @@ http {
uwsgi_temp_path /tmp/uwsgi_temp;
scgi_temp_path /tmp/scgi_temp;
# Linux APT/RPM repository.
# Dynamic dashboard is private to the Docker network.
# Keep package catalogs/files served from local storage by nginx.
server {
listen 8080 default_server;
server_name _;
@@ -35,8 +36,7 @@ http {
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "DENY" always;
add_header Referrer-Policy "no-referrer" always;
add_header Cache-Control "max-age=600" always;
if ($request_method !~ ^(GET|HEAD)$) {
return 405;
}
@@ -46,13 +46,20 @@ http {
return 200 "ok\n";
}
# Actual site and its original /index.html link use the live dashboard.
location = / {
try_files /index.html @linux_initializing;
proxy_set_header X-Repo-Site linux;
proxy_pass http://repository-dashboard:8000/;
}
location @linux_initializing {
default_type text/html;
return 200 '<!doctype html><html><head><meta charset="utf-8"><title>RustProxy repository</title></head><body><h1>RustProxy Linux repository</h1><p>Repository is being initialized.</p></body></html>';
location = /index.html {
proxy_set_header X-Repo-Site linux;
proxy_pass http://repository-dashboard:8000/index.html;
}
location ^~ /ui/ {
proxy_pass http://repository-dashboard:8000;
}
location = /api/v1/packages {
proxy_pass http://repository-dashboard:8000;
}
location ~ (^|/)\. {
@@ -60,12 +67,12 @@ http {
}
location / {
expires 10m;
try_files $uri =404;
}
}
# OPNsense/FreeBSD pkg repository. It has a separate public URL and local port,
# but follows the same atomic repository/current switch as the Linux repo.
# Separate OPNsense hostname/port, with native FreeBSD at /freebsd/.
server {
listen 8081;
server_name _;
@@ -77,7 +84,6 @@ http {
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "DENY" always;
add_header Referrer-Policy "no-referrer" always;
add_header Cache-Control "max-age=600" always;
if ($request_method !~ ^(GET|HEAD)$) {
return 405;
@@ -88,29 +94,43 @@ http {
return 200 "ok\n";
}
# Native FreeBSD package repo at <OPNSENSE_REPOSITORY_URL>/freebsd/.
# Keep a distinct catalog so clients never see the OPNsense plugin.
location = / {
proxy_set_header X-Repo-Site opnsense;
proxy_pass http://repository-dashboard:8000/;
}
location = /index.html {
proxy_set_header X-Repo-Site opnsense;
proxy_pass http://repository-dashboard:8000/index.html;
}
location = /freebsd { return 301 /freebsd/; }
location = /freebsd/ {
proxy_set_header X-Repo-Site freebsd;
proxy_pass http://repository-dashboard:8000/freebsd/;
}
location = /freebsd/index.html {
proxy_set_header X-Repo-Site freebsd;
proxy_pass http://repository-dashboard:8000/freebsd/index.html;
}
location ^~ /ui/ {
proxy_pass http://repository-dashboard:8000;
}
location = /api/v1/packages {
proxy_pass http://repository-dashboard:8000;
}
# Nginx still handles pkg catalog downloads directly, untouched.
location /freebsd/ {
alias /srv/repository/freebsd/;
index index.html;
expires 10m;
autoindex off;
}
location = / {
try_files /index.html @opnsense_initializing;
}
location @opnsense_initializing {
default_type text/html;
return 200 '<!doctype html><html><head><meta charset="utf-8"><title>RustProxy OPNsense repository</title></head><body><h1>RustProxy OPNsense repository</h1><p>Repository is being initialized.</p></body></html>';
}
location ~ (^|/)\. {
deny all;
}
location / {
expires 10m;
try_files $uri =404;
}
}