diff --git a/cmd/serve.go b/cmd/serve.go index d11778b2..ab8d75ec 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -320,10 +320,12 @@ func execServe(c *cli.Context) error { return errors.New("if upstream-base-url is set, base-url must also be set") } else if upstreamBaseURL != "" && baseURL != "" && baseURL == upstreamBaseURL { return errors.New("base-url and upstream-base-url cannot be identical, you'll likely want to set upstream-base-url to https://ntfy.sh, see https://ntfy.sh/docs/config/#ios-instant-notifications") - } else if authFile == "" && (enableSignup || enableLogin || enableReservations || stripeSecretKey != "") { - return errors.New("cannot set enable-signup, enable-login, enable-reserve-topics, or stripe-secret-key if auth-file is not set") + } else if authFile == "" && (enableSignup || enableLogin || requireLogin || enableReservations || stripeSecretKey != "") { + return errors.New("cannot set enable-signup, enable-login, require-login, enable-reserve-topics, or stripe-secret-key if auth-file is not set") } else if enableSignup && !enableLogin { return errors.New("cannot set enable-signup without also setting enable-login") + } else if requireLogin && !enableLogin { + return errors.New("cannot set require-login without also setting enable-login") } else if !payments.Available && (stripeSecretKey != "" || stripeWebhookKey != "") { return errors.New("cannot set stripe-secret-key or stripe-webhook-key, support for payments is not available in this build (nopayments)") } else if stripeSecretKey != "" && (stripeWebhookKey == "" || baseURL == "") { diff --git a/web/public/config.js b/web/public/config.js index 2f21dcdd..5b904cd5 100644 --- a/web/public/config.js +++ b/web/public/config.js @@ -6,7 +6,7 @@ // During web development, you may change values here for rapid testing. var config = { - base_url: "http://localhost:8080", // window.location.origin, // Change to test against a different server + base_url: window.location.origin, // Change to test against a different server app_root: "/", enable_login: true, require_login: true,