Allow custom schemes for location settings

This commit is contained in:
Manuel Thalmann 2024-12-04 16:55:56 +01:00
parent 9dc93b1b8e
commit 1c93d4b3f4

View file

@ -76,16 +76,23 @@ begin
end end
function getServiceDefaultProxy -a domain service location function getServiceDefaultProxy -a domain service location
argparse -i "comment=" "path=" "url=" -- $argv argparse -i "comment=" "path=" "scheme=" "url=" -- $argv
set -l scheme
set -l url set -l url
set -l config (getServiceOverrides $argv) set -l config (getServiceOverrides $argv)
set -l portKey (getServicePortKey "$service") set -l portKey (getServicePortKey "$service")
set -l port (yq "$portKey" "$config" | extractPort) set -l port (yq "$portKey" "$config" | extractPort)
if [ -n "$_flag_scheme" ]
set scheme "$_flag_scheme"
else
set scheme http
end
if [ -n "$_flag_url" ] if [ -n "$_flag_url" ]
set url "$_flag_url" set url "$_flag_url"
else else
set url "http://127.0.0.1:$port" set url "$scheme://127.0.0.1:$port"
if [ -n "$_flag_path" ] if [ -n "$_flag_path" ]
set url "$url$_flag_path" set url "$url$_flag_path"