Allow specifying comments for locations

This commit is contained in:
Manuel Thalmann 2024-12-04 16:57:25 +01:00
parent e4cb8cce5f
commit 0a68921220
2 changed files with 9 additions and 3 deletions

View file

@ -91,7 +91,7 @@ begin
printf "%s\0" \
"$_flag_name" / (
for app in $servarr
printf "%s\n" "$app" "/$app"
printf "%s\n" "$app" "/$app" ""
end) \
flood "~ ^/flood.*"
end

View file

@ -134,7 +134,7 @@ begin
for i in (seq 1 2 (count $servers))
set -l locations (getServiceLocations $i $argv | string split0)
for j in (seq 1 2 (count $locations))
for j in (seq 1 3 (count $locations))
set -l file (mktemp)
set -l port (getRandomPort)
set -l service $locations[$j]
@ -167,9 +167,15 @@ begin
"server_name $domain;" \
(getExtraServerConfig $domain $argv)
for j in (seq 1 2 (count $locations))
for j in (seq 1 3 (count $locations))
set -l service $locations[$j]
set -l location $locations[(math $j + 1)]
set -l comment $locations[(math $j + 2)]
if [ -n "$comment" ]
set -a argv --comment "$comment"
end
getServiceLocationConfig $domain $service $location $argv
end