Server and contracts: public URL on port 443 (D-124)
Kvitt is served on the default HTTPS port through Nginx Proxy Manager, so the OpenAPI server is https://{host} (contracts/openapi.yaml and openapi.rs PUBLIC_SERVER_URL), examples E-7 public_url and E-12 link are https://kvitt.example.invalid without a port, tools/contracts-check.py expects the portless header, and the server's tests, config message and README name no port. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TQd3pEP9UeN2uifbHknQ7B
This commit is contained in:
@@ -12,7 +12,7 @@ fn run(dir: &std::path::Path, args: &[&str]) -> Output {
|
||||
Command::new(env!("CARGO_BIN_EXE_kvitt-server"))
|
||||
.args(args)
|
||||
.env("KVITT_DATA_DIR", dir)
|
||||
.env("KVITT_PUBLIC_URL", "https://kvitt.example:8443")
|
||||
.env("KVITT_PUBLIC_URL", "https://kvitt.example")
|
||||
.env("RUST_LOG", "warn")
|
||||
.output()
|
||||
.unwrap()
|
||||
@@ -26,7 +26,7 @@ fn printed_code(output: &Output) -> String {
|
||||
.find_map(|l| l.strip_prefix("Link:"))
|
||||
.unwrap()
|
||||
.trim();
|
||||
let code = link.strip_prefix("https://kvitt.example:8443/i/").unwrap();
|
||||
let code = link.strip_prefix("https://kvitt.example/i/").unwrap();
|
||||
assert_eq!(code.len(), 12);
|
||||
let display = stdout
|
||||
.lines()
|
||||
@@ -131,7 +131,7 @@ fn printed_partner_code(output: &Output, from: &str) -> String {
|
||||
.find_map(|l| l.strip_prefix("Link:"))
|
||||
.unwrap()
|
||||
.trim();
|
||||
let rest = link.strip_prefix("https://kvitt.example:8443/i/").unwrap();
|
||||
let rest = link.strip_prefix("https://kvitt.example/i/").unwrap();
|
||||
let (code, query) = rest.split_once('?').unwrap();
|
||||
assert_eq!(query, format!("from={from}"));
|
||||
assert_eq!(code.len(), 12);
|
||||
|
||||
@@ -34,9 +34,9 @@ async fn e4_english_by_default_with_both_links_and_the_grouped_code() {
|
||||
assert!(html.contains(">Open in Kvitt</a>"));
|
||||
assert!(html.contains("7K3M-QX9D-2HPA"));
|
||||
assert!(html.contains(
|
||||
"href=\"kvitt://invite?server=https%3A%2F%2Fkvitt%2Eexample%2Einvalid%3A8443&code=7K3MQX9D2HPA\""
|
||||
"href=\"kvitt://invite?server=https%3A%2F%2Fkvitt%2Eexample%2Einvalid&code=7K3MQX9D2HPA\""
|
||||
));
|
||||
assert!(html.contains("href=\"https://kvitt.example.invalid:8443/apk/files/kvitt-412.apk\""));
|
||||
assert!(html.contains("href=\"https://kvitt.example.invalid/apk/files/kvitt-412.apk\""));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
@@ -90,7 +90,7 @@ async fn e4_passes_the_admin_name_of_an_e12_link_into_the_app_link_only() {
|
||||
assert_eq!(reply.status, 200);
|
||||
let html = reply.text();
|
||||
assert!(html.contains(
|
||||
"href=\"kvitt://invite?server=https%3A%2F%2Fkvitt%2Eexample%2Einvalid%3A8443&code=7K3MQX9D2HPA&from=%C3%85sa%20Berg\""
|
||||
"href=\"kvitt://invite?server=https%3A%2F%2Fkvitt%2Eexample%2Einvalid&code=7K3MQX9D2HPA&from=%C3%85sa%20Berg\""
|
||||
), "{html}");
|
||||
// The name is not shown on the page itself.
|
||||
assert!(!html.contains("Åsa"));
|
||||
|
||||
Reference in New Issue
Block a user