diff --git a/.env.example b/.env.example index e29bd46..637077d 100644 --- a/.env.example +++ b/.env.example @@ -2,8 +2,8 @@ Mongo__ConnectionString=mongodb://127.0.0.1:27017 Mongo__Database=guestops Keys__Path=./keys -PublicUrl=https://guestops-sandbox.futuresens.co.uk -AllowedHosts=guestops-sandbox.futuresens.co.uk;localhost;127.0.0.1 +PublicUrl=https://sandbox-guestops.futuresens.co.uk +AllowedHosts=sandbox-guestops.futuresens.co.uk;localhost;127.0.0.1 Proxy__KnownAddress=127.0.0.1 Google__ClientId= Google__ClientSecret= diff --git a/deploy/google-acceptance.example.json b/deploy/google-acceptance.example.json index ca2f36f..8f55076 100644 --- a/deploy/google-acceptance.example.json +++ b/deploy/google-acceptance.example.json @@ -2,7 +2,7 @@ "acceptedAt": "2026-01-01T00:00:00Z", "acceptedBy": "REPLACE WITH APPROVER", "endedAt": "2026-01-01T00:00:00Z", - "environment": "https://guestops-sandbox.futuresens.co.uk", + "environment": "https://sandbox-guestops.futuresens.co.uk", "mailboxLabel": "sandbox mailbox A", "operator": "REPLACE WITH OPERATOR", "releaseCommit": "0000000000000000000000000000000000000000", diff --git a/docs/accounts.md b/docs/accounts.md index 41b473a..6afcc21 100644 --- a/docs/accounts.md +++ b/docs/accounts.md @@ -26,7 +26,7 @@ unset RECOVERY_EMAIL The command uses the configured database, generates a private link, prints it to the administrator's terminal and exits. Share it only with the verified owner. Do not paste it into tickets, chat logs, build logs or source control; avoid running this command in a recorded terminal. It expires in 30 minutes and can be consumed once. Running the command again invalidates the earlier link. Bootstrap remains a create-only command and cannot reset passwords. -`PublicUrl` must be the configured HTTPS origin, such as `https://guestops-sandbox.futuresens.co.uk`. Request Host headers never determine recovery-link origins. The Development-only preview uses `http://127.0.0.1:5173`. +`PublicUrl` must be the configured HTTPS origin, such as `https://sandbox-guestops.futuresens.co.uk`. Request Host headers never determine recovery-link origins. The Development-only preview uses `http://127.0.0.1:5173`. ## Storage and session behavior diff --git a/docs/deployment.md b/docs/deployment.md index 327e733..681323d 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -1,7 +1,7 @@ # GuestOps deployment GuestOps is deployed by the central Futuresens Ansible repository. Sandbox is -`https://guestops-sandbox.futuresens.co.uk` and production is +`https://sandbox-guestops.futuresens.co.uk` and production is `https://guestops.futuresens.co.uk`. ## Prepare a version @@ -31,7 +31,7 @@ The server group needs only the application switch, version and subdomain: ```yaml hasguestops: true guestopsversion: "0.2.2" -guestopssubdomain: "guestops-sandbox" +guestopssubdomain: "sandbox-guestops" ``` Production uses `guestopssubdomain: "guestops"`. The native services use the @@ -57,9 +57,25 @@ ansible-playbook playbooks/guestops.yml -K \ The playbook stops the existing systemd services, replaces `/srv/guestops`, renders its environment configuration, starts the self-contained API and worker, -configures Nginx, and verifies local and public readiness. Port 8080 remains -loopback-only and `/var/lib/guestops/keys` survives redeployment. +configures an HTTP Nginx site when a certificate does not yet exist, and verifies +local readiness. Port 8080 remains loopback-only and +`/var/lib/guestops/keys` survives redeployment. + +On the first deployment, create the certificate after the HTTP site is available: + +```sh +sudo certbot --nginx \ + -d sandbox-guestops.futuresens.co.uk \ + --non-interactive \ + --agree-tos \ + -m dmccallum@futuresens.co.uk \ + --redirect +``` + +For production, use `-d guestops.futuresens.co.uk`. Certbot updates the existing +Nginx site and manages renewal. Later GuestOps deployments detect the certificate +and leave that Certbot-managed site unchanged. To roll back, select an older retained native `guestopsversion` (version 0.2.2 or -later) in group vars and run the same playbook. MongoDB backup, Filebeat, certificates, and host monitoring -are provided by the existing central infrastructure. +later) in group vars and run the same playbook. MongoDB backup, Filebeat, certificate +renewal, and host monitoring are provided by the existing central infrastructure. diff --git a/src/GuestOps.Api/GoogleMailbox.cs b/src/GuestOps.Api/GoogleMailbox.cs index 514db2b..f1accd9 100644 --- a/src/GuestOps.Api/GoogleMailbox.cs +++ b/src/GuestOps.Api/GoogleMailbox.cs @@ -16,7 +16,7 @@ public sealed class GoogleMailbox(HttpClient http, IConfiguration config, IStore private readonly IDataProtector protector = protection.CreateProtector("GoogleMailbox.refresh.v1"); private string ClientId => config["Google:ClientId"] ?? ""; private string ClientSecret => config["Google:ClientSecret"] ?? ""; - private string Callback => (config["PublicUrl"] ?? "https://guestops-sandbox.futuresens.co.uk").TrimEnd('/') + "/api/integrations/google/callback"; + private string Callback => (config["PublicUrl"] ?? "https://sandbox-guestops.futuresens.co.uk").TrimEnd('/') + "/api/integrations/google/callback"; public bool Configured => ClientId.Length > 0 && ClientSecret.Length > 0; public bool SendingConfigured => Configured && config.GetValue("Google:EnableSending"); public string AuthorizationUrl(string state) => "https://accounts.google.com/o/oauth2/v2/auth?" + string.Join("&", new Dictionary { diff --git a/tests/production_smoke.py b/tests/production_smoke.py index eb76dda..b0c4ee3 100644 --- a/tests/production_smoke.py +++ b/tests/production_smoke.py @@ -72,7 +72,7 @@ else: hotel["signature"] = "Persisted across service restart" request("/api/hotel", "PUT", hotel) invite = request("/api/team/invite", "POST", {"name": "Deployment Staff", "email": "deployment-staff@example.invalid"}) - assert invite["link"].startswith("https://guestops-sandbox.futuresens.co.uk/account#token=") + assert invite["link"].startswith("https://sandbox-guestops.futuresens.co.uk/account#token=") request("/api/auth/logout", "POST") request("/api/hotel", expected=401) print("Production smoke checks passed: built UI, secure cookies, owner login, persisted settings and staff invitation, onboarding and logout.") diff --git a/tests/test_desktop_acceptance.py b/tests/test_desktop_acceptance.py index 80c4f60..86dadc8 100644 --- a/tests/test_desktop_acceptance.py +++ b/tests/test_desktop_acceptance.py @@ -16,7 +16,7 @@ def valid_record(): "desktopBaselineCommit": acceptance.DESKTOP_BASELINE, "releaseCommit": "a" * 40, "releaseRecordSha256": "b" * 64, - "environment": "https://guestops-sandbox.futuresens.co.uk", + "environment": "https://sandbox-guestops.futuresens.co.uk", "browser": {"name": "Microsoft Edge", "version": "140.0.0.0", "operatingSystem": "Windows 11"}, "viewport": {"width": 1440, "height": 900, "deviceScaleFactor": 1}, "hotelTimeZone": "Europe/London", diff --git a/tests/test_gate_b_acceptance.py b/tests/test_gate_b_acceptance.py index d09045b..3cfcbe4 100644 --- a/tests/test_gate_b_acceptance.py +++ b/tests/test_gate_b_acceptance.py @@ -21,7 +21,7 @@ def base(system): return { "schemaVersion": 1, "system": system, "targetGate": "B", "releaseCommit": "a" * 40, "releaseRecordSha256": "b" * 64, - "environment": "https://guestops-sandbox.futuresens.co.uk", + "environment": "https://sandbox-guestops.futuresens.co.uk", "operator": "Acceptance operator", "reviewedBy": "Independent reviewer", "startedAt": "2026-10-01T09:00:00Z", "endedAt": "2026-10-01T10:00:00Z", "reviewedAt": "2026-10-01T11:00:00Z", } diff --git a/tests/test_google_acceptance.py b/tests/test_google_acceptance.py index 39b7a4a..5310a1e 100644 --- a/tests/test_google_acceptance.py +++ b/tests/test_google_acceptance.py @@ -14,7 +14,7 @@ def valid_report(): "system": "google-mailbox", "releaseCommit": "a" * 40, "releaseRecordSha256": "b" * 64, - "environment": "https://guestops-sandbox.futuresens.co.uk", + "environment": "https://sandbox-guestops.futuresens.co.uk", "mailboxLabel": "sandbox mailbox A", "operator": "Test operator", "startedAt": "2026-09-29T10:00:00Z", diff --git a/tests/test_incident_exercise.py b/tests/test_incident_exercise.py index b6ca6b5..ef586dc 100644 --- a/tests/test_incident_exercise.py +++ b/tests/test_incident_exercise.py @@ -17,7 +17,7 @@ def valid_record(gate="B"): "dataClassification": "synthetic-only", "releaseCommit": "a" * 40, "releaseRecordSha256": "b" * 64, - "environment": "https://guestops-sandbox.futuresens.co.uk", + "environment": "https://sandbox-guestops.futuresens.co.uk", "operator": "Exercise operator", "incidentCommander": "Incident commander", "reviewedBy": "Independent reviewer", diff --git a/tests/test_pilot_run.py b/tests/test_pilot_run.py index 5c43253..343ba41 100644 --- a/tests/test_pilot_run.py +++ b/tests/test_pilot_run.py @@ -13,7 +13,7 @@ def valid_record(): return { "schemaVersion": 1, "system": "guestops-supervised-pilot", "targetGate": "B", "releaseCommit": "a" * 40, "releaseRecordSha256": "b" * 64, - "environment": "https://guestops-sandbox.futuresens.co.uk", "hotelLabel": "pilot-hotel-a", + "environment": "https://sandbox-guestops.futuresens.co.uk", "hotelLabel": "pilot-hotel-a", "hotelCount": 1, "plannedBusinessDays": 5, "owners": {"hotelOwner": "Hotel owner", "technicalOwner": "Technical owner", "rollbackDecisionMaker": "Technical owner"}, "startedOn": days[0], "endedOn": days[-1],