summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2019-03-08 11:37:52 -0600
committerOmar Roth <omarroth@hotmail.com>2019-03-08 11:37:52 -0600
commitbc1e62ce5162aa3a7c7b13c7381b4f73f50ce642 (patch)
treec6b2a3d5181ddb074772f9154a47b448e5e79a18 /src
parent79c10407968f71737c9cc508e8bb5a3e0fa009c8 (diff)
downloadinvidious-bc1e62ce5162aa3a7c7b13c7381b4f73f50ce642.tar.gz
invidious-bc1e62ce5162aa3a7c7b13c7381b4f73f50ce642.tar.bz2
invidious-bc1e62ce5162aa3a7c7b13c7381b4f73f50ce642.zip
Add 'external_port'
Diffstat (limited to 'src')
-rw-r--r--src/invidious/helpers/helpers.cr1
-rw-r--r--src/invidious/helpers/utils.cr4
2 files changed, 4 insertions, 1 deletions
diff --git a/src/invidious/helpers/helpers.cr b/src/invidious/helpers/helpers.cr
index 3cc4d9cf..075bf84e 100644
--- a/src/invidious/helpers/helpers.cr
+++ b/src/invidious/helpers/helpers.cr
@@ -24,6 +24,7 @@ user: String,
registration_enabled: {type: Bool, default: true},
statistics_enabled: {type: Bool, default: false},
admins: {type: Array(String), default: [] of String},
+ external_port: {type: Int32 | Nil, default: nil},
})
end
diff --git a/src/invidious/helpers/utils.cr b/src/invidious/helpers/utils.cr
index c200801f..3123b1d2 100644
--- a/src/invidious/helpers/utils.cr
+++ b/src/invidious/helpers/utils.cr
@@ -195,6 +195,7 @@ end
def make_host_url(config, kemal_config)
ssl = config.https_only || kemal_config.ssl
+ port = config.external_port || kemal_config.port
if ssl
scheme = "https://"
@@ -202,7 +203,8 @@ def make_host_url(config, kemal_config)
scheme = "http://"
end
- if kemal_config.port != 80 && kemal_config.port != 443
+ # Add if non-standard port
+ if port != 80 && port != 443
port = ":#{kemal_config.port}"
else
port = ""