Author SHA1 Message Date
Mathew a726df5b7c fixed nginx issue 2026-10-22 16:38:40 +01:00
Mathew 9d15d86613 fixed domain issue 2026-10-22 16:07:33 +01:00
Mathew 6193409838 replace docker deployment with native system 2026-10-22 15:40:27 +01:00
Mathew 36aa23c4b3 fixing installer 2026-10-22 14:16:49 +01:00
31 changed files with 349 additions and 335 deletions
-19
View File
@@ -1,19 +0,0 @@
**/bin
**/obj
**/node_modules
**/dist
.git
.env
.env.*
**/keys
tests
*.tar*
**/pms.local.json
**/payments.local.json
.guestops-maintenance.lock
.guestops-test-keyring
**/__pycache__
*.tar.gpg
guestops-backup-*
guestops-restore-*
+16 -25
View File
@@ -1,25 +1,16 @@
# Keep .env private (chmod 600). Never commit real values. # Native .NET configuration. Keep real credentials out of source control.
# The MongoDB URI must use an application-scoped user and a host address that Mongo__ConnectionString=mongodb://127.0.0.1:27017
# is reachable from Docker; 127.0.0.1 inside a container is the container. Mongo__Database=guestops
MONGO_CONNECTION_STRING= Keys__Path=./keys
MONGO_DATABASE=guestops PublicUrl=https://sandbox-guestops.futuresens.co.uk
GUESTOPS_PUBLIC_ORIGIN=https://guestops-sandbox.futuresens.co.uk AllowedHosts=sandbox-guestops.futuresens.co.uk;localhost;127.0.0.1
GUESTOPS_ALLOWED_HOSTS=guestops-sandbox.futuresens.co.uk;localhost;127.0.0.1 Proxy__KnownAddress=127.0.0.1
GOOGLE_CLIENT_ID= Google__ClientId=
GOOGLE_CLIENT_SECRET= Google__ClientSecret=
GOOGLE_ENABLE_SENDING=false Google__EnableSending=false
# Only API service needs the AI key. AI remains off per hotel until owner opts in. Ai__ApiKey=
AI_API_KEY= Ai__Model=
AI_MODEL= AutoReply__EnableLive=false
# Optional private host-side JSON file binding internal hotel IDs to OHIP credentials. # Optional private files. Leave unset to disable PMS and payment integrations.
# Default example has no connections. Never commit the real configuration. Pms__ConfigFile=
PMS_CONFIG_FILE_HOST=./deploy/pms.example.json Payments__ConfigFile=
# Ansible builds the reviewed source package. Set these to its full-commit image tags.
GUESTOPS_API_IMAGE=guestops-api:local
GUESTOPS_WORKER_IMAGE=guestops-worker:local
# Private NMI configuration; leave the empty example until sandbox setup.
PAYMENTS_CONFIG_FILE_HOST=./deploy/payments.example.json
# Enable only after Google delivery and FAQ test-mode acceptance.
AUTO_REPLY_ENABLE_LIVE=false
+1 -1
View File
@@ -1,7 +1,7 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<TargetFramework>net10.0</TargetFramework> <TargetFramework>net10.0</TargetFramework>
<Version>0.2.1</Version> <Version>0.2.2</Version>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
-35
View File
@@ -1,35 +0,0 @@
FROM node:22-bookworm-slim AS frontend
WORKDIR /build/web
COPY web/package*.json ./
RUN npm ci --no-audit --no-fund
COPY web/ ./
RUN npm run build
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS backend
WORKDIR /build
COPY Directory.Build.props ./
COPY src/ ./src/
RUN dotnet publish src/GuestOps.Api/GuestOps.Api.csproj -c Release -o /publish/api
RUN dotnet publish src/GuestOps.Worker/GuestOps.Worker.csproj -c Release -o /publish/worker
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS api
WORKDIR /app
RUN groupadd --gid 25001 guestops-secrets \
&& usermod --append --groups guestops-secrets app \
&& mkdir -p /var/lib/guestops/keys \
&& chown -R app:app /var/lib/guestops \
&& chmod 700 /var/lib/guestops/keys
COPY --from=backend /publish/api ./
COPY --from=frontend /build/web/dist ./wwwroot/
ENV ASPNETCORE_URLS=http://+:8080 ASPNETCORE_ENVIRONMENT=Production Keys__Path=/var/lib/guestops/keys
USER app
EXPOSE 8080
ENTRYPOINT ["dotnet", "GuestOps.Api.dll"]
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS worker
WORKDIR /app
RUN mkdir -p /var/lib/guestops/keys && chown -R app:app /var/lib/guestops && chmod 700 /var/lib/guestops/keys
COPY --from=backend /publish/worker ./
ENV DOTNET_ENVIRONMENT=Production Keys__Path=/var/lib/guestops/keys
USER app
ENTRYPOINT ["dotnet", "GuestOps.Worker.dll"]
+12 -12
View File
@@ -1,7 +1,7 @@
# GuestOps Milestone Report # GuestOps Milestone Report
Version: **0.2.1 release candidate** Version: **0.2.2 release candidate**
Last updated: **30 September 2026** Last updated: **22 October 2026**
This is the working delivery tracker for GuestOps Web. Update a milestone when its state changes and link the pull request, release artifact, test run, or acceptance record that proves the change. This is the working delivery tracker for GuestOps Web. Update a milestone when its state changes and link the pull request, release artifact, test run, or acceptance record that proves the change.
@@ -11,7 +11,7 @@ This summary explains what each milestone delivers and where it currently stands
| # | Milestone | What it delivers | Current position | | # | Milestone | What it delivers | Current position |
| ---: | --- | --- | --- | | ---: | --- | --- | --- |
| 1 | Web foundation | The React application, ASP.NET Core API, tenant-isolated MongoDB storage, preview mode, and container foundation. | **Implemented.** The application foundation and automated tests are on `main`. | | 1 | Web foundation | The React application, ASP.NET Core API, tenant-isolated MongoDB storage, preview mode, and native Linux foundation. | **Implemented.** The application foundation and automated tests are on `main`. |
| 2 | AI suggestions and reviewed Gmail sending | AI-assisted reply drafts and staff-reviewed Gmail delivery with safety and duplicate-send controls. | **Implemented; acceptance required.** Real Gmail threading, revocation, uncertain-send, and staff-review scenarios still need live evidence. | | 2 | AI suggestions and reviewed Gmail sending | AI-assisted reply drafts and staff-reviewed Gmail delivery with safety and duplicate-send controls. | **Implemented; acceptance required.** Real Gmail threading, revocation, uncertain-send, and staff-review scenarios still need live evidence. |
| 3 | OHIP PMS workflow | Internal proposal, approval, and execution controls for PMS operations. | **Implemented; acceptance required.** The workflow exists, but provider-contract and sandbox acceptance remain outstanding. | | 3 | OHIP PMS workflow | Internal proposal, approval, and execution controls for PMS operations. | **Implemented; acceptance required.** The workflow exists, but provider-contract and sandbox acceptance remain outstanding. |
| 4 | NMI payment workflow | Internal payment proposal, approval, status, expiry, and reconciliation controls. | **Implemented; acceptance required.** The workflow exists, but real payment-provider sandbox acceptance remains outstanding. | | 4 | NMI payment workflow | Internal payment proposal, approval, status, expiry, and reconciliation controls. | **Implemented; acceptance required.** The workflow exists, but real payment-provider sandbox acceptance remains outstanding. |
@@ -19,8 +19,8 @@ This summary explains what each milestone delivers and where it currently stands
| 6 | Team onboarding and account recovery | Staff invitations, password setup/reset, access disable/restore, and administrator recovery. | **Implemented; acceptance required.** Deployed link delivery, expiry, recovery, and administrator procedures still need operational evidence. | | 6 | Team onboarding and account recovery | Staff invitations, password setup/reset, access disable/restore, and administrator recovery. | **Implemented; acceptance required.** Deployed link delivery, expiry, recovery, and administrator procedures still need operational evidence. |
| 7 | Google connection recovery | OAuth reconnect, checkpoint recovery, grant revocation handling, and worker restart safety. | **Implemented; acceptance required.** Dedicated Google-account and worker-restart exercises have not yet been accepted. | | 7 | Google connection recovery | OAuth reconnect, checkpoint recovery, grant revocation handling, and worker restart safety. | **Implemented; acceptance required.** Dedicated Google-account and worker-restart exercises have not yet been accepted. |
| 8 | Operational readiness | Host backup, monitoring, and recovery are provided by the existing central infrastructure. | **External.** GuestOps no longer carries a second application-specific operational stack. | | 8 | Operational readiness | Host backup, monitoring, and recovery are provided by the existing central infrastructure. | **External.** GuestOps no longer carries a second application-specific operational stack. |
| 9 | Versioned releases | A deterministic version-named source archive and Ansible-controlled installation. | **Implemented; acceptance required.** Package the tested commit as `guestops_<version>.tar.gz` and deploy it through the central playbook. | | 9 | Versioned releases | A deterministic version-named native archive and Ansible-controlled installation. | **Implemented; acceptance required.** Package the tested commit as `guestops_<version>.tar.gz` and deploy it through the central playbook. |
| 10 | Debian deployment and persistence | Secure Debian/Compose deployment, HTTPS, external MongoDB, and persistent Data Protection keys. | **In progress.** The single Ansible playbook builds the API/worker, configures Nginx, restricts the listener and checks public readiness; sandbox deployment remains to be exercised. | | 10 | Debian deployment and persistence | Native systemd deployment, HTTPS, local MongoDB, and persistent Data Protection keys. | **In progress.** The single Ansible playbook installs the self-contained API/worker, configures Nginx, restricts the listener and checks public readiness; sandbox deployment remains to be exercised. |
| 11 | Backups, monitoring, and recovery | Existing central MongoDB backup, Filebeat, host monitoring, and version-based rollback. | **External.** Rollback selects an older archive and reruns the same deployment playbook. | | 11 | Backups, monitoring, and recovery | Existing central MongoDB backup, Filebeat, host monitoring, and version-based rollback. | **External.** Rollback selects an older archive and reruns the same deployment playbook. |
| 12 | Google mailbox acceptance | End-to-end Gmail consent, import, recovery, reviewed sending, reconciliation, and revocation evidence. | **In progress.** The runbook, record validator and release-bound Gate B bundle integration exist; the live synthetic-data exercise and independent review remain outstanding. | | 12 | Google mailbox acceptance | End-to-end Gmail consent, import, recovery, reviewed sending, reconciliation, and revocation evidence. | **In progress.** The runbook, record validator and release-bound Gate B bundle integration exist; the live synthetic-data exercise and independent review remain outstanding. |
| 13 | Rezlynx/Guestline adapter | The real PMS provider adapter, mappings, idempotency, reconciliation, and ambiguous-write handling. | **Planned.** Provider contract and sandbox access are still required before implementation and acceptance. | | 13 | Rezlynx/Guestline adapter | The real PMS provider adapter, mappings, idempotency, reconciliation, and ambiguous-write handling. | **Planned.** Provider contract and sandbox access are still required before implementation and acceptance. |
@@ -29,7 +29,7 @@ This summary explains what each milestone delivers and where it currently stands
| 16 | Identity, preferences, and privacy | Account/session controls, hotel preferences, privacy inventory, retention decisions, and audit review. | **Implemented; acceptance required.** Legal and operational decisions, identity checks, and independent review remain outstanding. | | 16 | Identity, preferences, and privacy | Account/session controls, hotel preferences, privacy inventory, retention decisions, and audit review. | **Implemented; acceptance required.** Legal and operational decisions, identity checks, and independent review remain outstanding. |
| 17 | Inbox usability and desktop parity | Stable pagination, protected unsaved drafts, hotel-timezone display, and desktop workflow parity. | **Implemented; acceptance required.** Automated checks pass; the supervised desktop exercise and independent approval remain outstanding. | | 17 | Inbox usability and desktop parity | Stable pagination, protected unsaved drafts, hotel-timezone display, and desktop workflow parity. | **Implemented; acceptance required.** Automated checks pass; the supervised desktop exercise and independent approval remain outstanding. |
| 18 | Pilot, capacity, and release approval | Capacity proof, incident exercise, five-business-day hotel pilot, findings closure, and Gate B approval. | **In progress.** Live prerequisites, incident rehearsal, five-day pilot and named approvals remain open. | | 18 | Pilot, capacity, and release approval | Capacity proof, incident exercise, five-business-day hotel pilot, findings closure, and Gate B approval. | **In progress.** Live prerequisites, incident rehearsal, five-day pilot and named approvals remain open. |
| 19 | Account security and self-service | TOTP MFA, recovery codes, transactional email, granular roles, preferences, and security notifications. | **Implemented on the development branch; acceptance required.** Keep it separate until `0.2.1` is approved and tagged, then review, merge, and version it as `0.3.0`. | | 19 | Account security and self-service | TOTP MFA, recovery codes, transactional email, granular roles, preferences, and security notifications. | **Implemented on the development branch; acceptance required.** Keep it separate until `0.2.2` is approved and tagged, then review, merge, and version it as `0.3.0`. |
## Status key ## Status key
@@ -51,7 +51,7 @@ This summary explains what each milestone delivers and where it currently stands
| # | Milestone | Gate | Status | Evidence and remaining work | | # | Milestone | Gate | Status | Evidence and remaining work |
| ---: | --- | :---: | --- | --- | | ---: | --- | :---: | --- | --- |
| 1 | Web foundation | A | Implemented | The current `main` branch provides the React workspace, ASP.NET Core API, tenant-scoped MongoDB access, read-only Google import foundation, preview mode, container definitions, and automated tests. Live provider and host acceptance still apply. | | 1 | Web foundation | A | Implemented | The current `main` branch provides the React workspace, ASP.NET Core API, tenant-scoped MongoDB access, read-only Google import foundation, preview mode, native Linux packaging, and automated tests. Live provider and host acceptance still apply. |
| 2 | AI suggestions and reviewed Gmail sending | B | Implemented / acceptance required | Promoted to local `main`; verify real mailbox threading, reconnect/revocation, duplicate-send prevention, uncertain outcomes, and staff review before pilot use. | | 2 | AI suggestions and reviewed Gmail sending | B | Implemented / acceptance required | Promoted to local `main`; verify real mailbox threading, reconnect/revocation, duplicate-send prevention, uncertain outcomes, and staff review before pilot use. |
| 3 | OHIP PMS workflow | C | Implemented / acceptance required | Proposal, approval, and execution controls are promoted to local `main`. Provider sandbox and contract-level acceptance remain independent requirements. | | 3 | OHIP PMS workflow | C | Implemented / acceptance required | Proposal, approval, and execution controls are promoted to local `main`. Provider sandbox and contract-level acceptance remain independent requirements. |
| 4 | NMI payment workflow | C | Implemented / acceptance required | Payment proposal and approval controls are promoted to local `main`. Sandbox acceptance, reconciliation, expiry, and ambiguous-result recovery remain required. | | 4 | NMI payment workflow | C | Implemented / acceptance required | Payment proposal and approval controls are promoted to local `main`. Sandbox acceptance, reconciliation, expiry, and ambiguous-result recovery remain required. |
@@ -59,8 +59,8 @@ This summary explains what each milestone delivers and where it currently stands
| 6 | Team onboarding and account recovery | B | Implemented / acceptance required | Invitation, password reset, and recovery flows are promoted to local `main`; verify deployed links, mail delivery, token expiry, and administrator recovery procedures. | | 6 | Team onboarding and account recovery | B | Implemented / acceptance required | Invitation, password reset, and recovery flows are promoted to local `main`; verify deployed links, mail delivery, token expiry, and administrator recovery procedures. |
| 7 | Google connection recovery | B | Implemented / acceptance required | Connection epochs, checkpoint recovery, and revocation handling are promoted to local `main`; complete real Google acceptance and worker-restart exercises. | | 7 | Google connection recovery | B | Implemented / acceptance required | Connection epochs, checkpoint recovery, and revocation handling are promoted to local `main`; complete real Google acceptance and worker-restart exercises. |
| 8 | Operational readiness tooling | A | External | Use the existing host backup, Filebeat, monitoring and recovery processes instead of a second GuestOps-specific operational stack. | | 8 | Operational readiness tooling | A | External | Use the existing host backup, Filebeat, monitoring and recovery processes instead of a second GuestOps-specific operational stack. |
| 9 | Gitea and versioned releases | A | In progress | `deploy/package_source.py` packages an explicit committed ref as immutable `guestops_<version>.tar.gz`, verifies matching .NET/frontend versions, and refuses overwrite. Deploy it through the central version-selected Ansible playbook. | | 9 | Gitea and versioned releases | A | In progress | `deploy/package_release.py` builds an explicit committed ref as an immutable self-contained Linux x64 `guestops_<version>.tar.gz`, verifies matching .NET/frontend versions, and refuses overwrite. Deploy it through the central version-selected Ansible playbook. |
| 10 | Debian deployment and persistence | A | In progress | Compose runs API and worker against the existing MongoDB, preserves a named Data Protection key volume, and binds the API to loopback. Exercise the single Ansible playbook on sandbox and confirm a second deployment preserves the keys. | | 10 | Debian deployment and persistence | A | In progress | Native systemd services run the API and worker against local MongoDB, preserve `/var/lib/guestops/keys`, and bind the API to loopback. Exercise the single Ansible playbook on sandbox and confirm a second deployment preserves the keys. |
| 11 | Backups, monitoring, and recovery | A | External | The existing central MongoDB backup, Filebeat, host monitoring and archive retention remain authoritative. Rollback selects an earlier GuestOps version and reruns the deployment playbook. | | 11 | Backups, monitoring, and recovery | A | External | The existing central MongoDB backup, Filebeat, host monitoring and archive retention remain authoritative. Rollback selects an earlier GuestOps version and reruns the deployment playbook. |
| 12 | Google mailbox and reviewed-reply acceptance | B | In progress | The synthetic-data provider runbook, exact scenario set and restricted-record validator are implemented and wired into the Gate B bundle validator. Complete every scenario against the accepted Debian release and dedicated Google sandbox accounts, independently review the evidence, and retain the validated record. | | 12 | Google mailbox and reviewed-reply acceptance | B | In progress | The synthetic-data provider runbook, exact scenario set and restricted-record validator are implemented and wired into the Gate B bundle validator. Complete every scenario against the accepted Debian release and dedicated Google sandbox accounts, independently review the evidence, and retain the validated record. |
| 13 | Rezlynx/Guestline adapter | C | Planned | Obtain the provider contract and sandbox, implement the adapter and mapping, and accept idempotency, stale-data, ambiguous-write, and reconciliation paths. | | 13 | Rezlynx/Guestline adapter | C | Planned | Obtain the provider contract and sandbox, implement the adapter and mapping, and accept idempotency, stale-data, ambiguous-write, and reconciliation paths. |
@@ -81,9 +81,9 @@ Milestones 13 (Guestline/Rezlynx) and 14 (payments) can progress as parallel pro
## Next actions ## Next actions
- [ ] Merge the Action removal and release-process update to the intended default branch; that resulting commit becomes the new package candidate. - [ ] Merge the Action removal and release-process update to the intended default branch; that resulting commit becomes the new package candidate.
- [x] Preserve the published `0.2.0` tag unchanged and use the clean `0.2.1` candidate line from `main`, excluding Milestone 19 application code. - [x] Preserve the published `0.2.0` tag unchanged and use the clean `0.2.2` candidate line from `main`, excluding Milestone 19 application code.
- [ ] Create the immutable versioned archive with `deploy/package_source.py`, copy it into the Ansible files directory, and select its version in group vars. - [ ] Create the immutable versioned archive with `deploy/package_release.py`, copy it into the Ansible files directory, and select its version in group vars.
- [ ] Create and archive the immutable `0.2.1` approval tag only after Gate B approval. - [ ] Create and archive the immutable `0.2.2` approval tag only after Gate B approval.
- [ ] Deploy to the target Debian environment with persistent MongoDB and data-protection keys. - [ ] Deploy to the target Debian environment with persistent MongoDB and data-protection keys.
- [ ] Confirm the existing central backup and monitoring processes include GuestOps, then test rollback by selecting the previous version. - [ ] Confirm the existing central backup and monitoring processes include GuestOps, then test rollback by selecting the previous version.
- [ ] Complete real Google mailbox acceptance without using production guest data. - [ ] Complete real Google mailbox acceptance without using production guest data.
+4 -4
View File
@@ -2,7 +2,7 @@
A Linux-hosted hotel email workspace, developed separately from the Windows GuestOps application. **This migration now includes AI draft generation, staff-approved Gmail sending, reviewed OHIP reservation updates, NMI hosted invoices, controlled FAQ auto-replies and team onboarding. It is not yet a production-complete replacement.** A Linux-hosted hotel email workspace, developed separately from the Windows GuestOps application. **This migration now includes AI draft generation, staff-approved Gmail sending, reviewed OHIP reservation updates, NMI hosted invoices, controlled FAQ auto-replies and team onboarding. It is not yet a production-complete replacement.**
Current release-candidate version: **0.2.1** Current release-candidate version: **0.2.2**
Project progress is tracked in the [milestone report](MILESTONES.md). User-visible changes and release limitations are recorded in the [release notes](RELEASE_NOTES.md). Project progress is tracked in the [milestone report](MILESTONES.md). User-visible changes and release limitations are recorded in the [release notes](RELEASE_NOTES.md).
@@ -19,7 +19,7 @@ Project progress is tracked in the [milestone report](MILESTONES.md). User-visib
- Controlled FAQ auto-replies: exact plain-text questions, owner-reviewed answers, test mode, daily quotas and thread/knowledge rechecks. Live mode defaults off. - Controlled FAQ auto-replies: exact plain-text questions, owner-reviewed answers, test mode, daily quotas and thread/knowledge rechecks. Live mode defaults off.
- Owner-issued staff invitations, assisted password recovery, session invalidation, disabled-account restoration and a hotel setup checklist. See [team access](docs/accounts.md). - Owner-issued staff invitations, assisted password recovery, session invalidation, disabled-account restoration and a hotel setup checklist. See [team access](docs/accounts.md).
- Google mailbox health, owner-only disconnect/reconnect and import restart, revoked-consent handling, retry delays and connection-bound delivery approvals. See [mailbox management](docs/mailboxes.md). - Google mailbox health, owner-only disconnect/reconnect and import restart, revoked-consent handling, retry delays and connection-bound delivery approvals. See [mailbox management](docs/mailboxes.md).
- Docker image builds, private MongoDB configuration and an Nginx HTTPS example for the Debian sandbox. - Self-contained Linux API and worker releases, native systemd services, local MongoDB configuration and an Nginx HTTPS example for the Debian sandbox.
## Explicit limits ## Explicit limits
@@ -59,7 +59,7 @@ For MongoDB-backed operation, disable Preview and set `Mongo__ConnectionString`,
The owner-only Workspace health page remains available in the application. Host monitoring, MongoDB backup and disaster recovery are provided by the existing central infrastructure. The owner-only Workspace health page remains available in the application. Host monitoring, MongoDB backup and disaster recovery are provided by the existing central infrastructure.
Release packaging is runner-free. `deploy/package_source.py` creates an immutable `guestops_<version>.tar.gz` archive from one explicit committed Git ref for handoff to the Futuresens Ansible deployment. It never packages uncommitted working-tree files. Release packaging is runner-free. `deploy/package_release.py` builds an immutable, self-contained Linux x64 `guestops_<version>.tar.gz` archive from one explicit committed Git ref for handoff to the Futuresens Ansible deployment. It never packages uncommitted working-tree files. Target servers need no application build tooling or .NET runtime installation.
## Verification ## Verification
@@ -68,7 +68,7 @@ dotnet run --project tests/GuestOps.Tests
cd web && npm ci && npm run build cd web && npm ci && npm run build
``` ```
Set `MONGO_TEST_URI` to an isolated MongoDB server and `TEST_API_URL=http://127.0.0.1:5180` with a preview API running to enable database and HTTP integration checks. The suite creates and drops only its own randomly named `guestops_test_*` database. Run these checks before creating a versioned source package. GuestOps does not require a Gitea Actions runner; deployment follows the existing Futuresens source-package and Ansible process described in the [deployment guide](docs/deployment.md). Set `MONGO_TEST_URI` to an isolated MongoDB server and `TEST_API_URL=http://127.0.0.1:5180` with a preview API running to enable database and HTTP integration checks. The suite creates and drops only its own randomly named `guestops_test_*` database. Run these checks before creating a versioned release package. GuestOps does not require a Gitea Actions runner; deployment follows the existing Futuresens release-package and Ansible process described in the [deployment guide](docs/deployment.md).
See [controlled FAQ automation](docs/auto-replies.md), [NMI payment setup and recovery](docs/payments.md), [OHIP reservation setup and recovery](docs/pms.md), [AI drafts and reply delivery setup](docs/replies.md), [migration status](docs/migration.md) and [deployment guide](docs/deployment.md). See [controlled FAQ automation](docs/auto-replies.md), [NMI payment setup and recovery](docs/payments.md), [OHIP reservation setup and recovery](docs/pms.md), [AI drafts and reply delivery setup](docs/replies.md), [migration status](docs/migration.md) and [deployment guide](docs/deployment.md).
+7 -7
View File
@@ -1,8 +1,8 @@
# GuestOps Release Notes # GuestOps Release Notes
## 0.2.1 — Gate B release candidate ## 0.2.2 — Gate B native deployment candidate
This candidate freezes the implemented Gate B scope for controlled acceptance. It is not yet approved for live hotel operations and does not become a release until the exact commit is pushed, a checksummed source package and operational evidence are retained, the supervised pilot is approved and the immutable `0.2.1` tag is created. This candidate freezes the implemented Gate B scope for controlled acceptance and replaces the unsuccessful source-build `0.2.1` deployment artifact with self-contained Linux x64 API and worker applications managed by systemd. It is not yet approved for live hotel operations and does not become a release until the exact commit is pushed, a checksummed native package and operational evidence are retained, the supervised pilot is approved and the immutable `0.2.2` tag is created.
### Promoted scope ### Promoted scope
@@ -13,13 +13,13 @@ This candidate freezes the implemented Gate B scope for controlled acceptance. I
- Release-bound automation and identity/privacy acceptance records covering training, provider decisions, retention ownership and known limitations. - Release-bound automation and identity/privacy acceptance records covering training, provider decisions, retention ownership and known limitations.
- Stable tenant-scoped inbox pagination beyond the former 500-message view, unsaved-draft guards including browser history navigation, consistent hotel-timezone timestamps across operational screens, and a release-bound desktop-parity acceptance record. - Stable tenant-scoped inbox pagination beyond the former 500-message view, unsaved-draft guards including browser history navigation, consistent hotel-timezone timestamps across operational screens, and a release-bound desktop-parity acceptance record.
- A bounded read-only sandbox capacity probe plus machine-validated, release-bound supervised-pilot run, go/no-go and incident-exercise records. - A bounded read-only sandbox capacity probe plus machine-validated, release-bound supervised-pilot run, go/no-go and incident-exercise records.
- Backup, restore, opt-in systemd scheduling, deployment, persistence-drill, diagnostic, release-evidence, Google acceptance-record validation and rollback tooling. - Native systemd API and worker deployment with persistent Data Protection keys, loopback-only HTTP, Nginx HTTPS, and version-selected rollback.
These capabilities still require their separately documented provider, host and operational acceptance. Google, PMS and payment-provider acceptance is not established by local automated tests. These capabilities still require their separately documented provider, host and operational acceptance. Google, PMS and payment-provider acceptance is not established by local automated tests.
### Known limitations and launch conditions ### Known limitations and launch conditions
- Gate A still requires a checksummed source package from the exact default-branch commit, Ansible installation on the target Debian host, persistent storage/key validation, monitoring, and a successful restore/rollback exercise. - Gate A still requires a checksummed native package from the exact default-branch commit, Ansible installation on the target Debian host, persistent storage/key validation, monitoring, and a successful restore/rollback exercise.
- Gate B still requires real Google acceptance and supervised staff testing, including desktop-parity acceptance of pagination, draft protection, proxy-aware login throttling and saved-hotel-timezone rendering. - Gate B still requires real Google acceptance and supervised staff testing, including desktop-parity acceptance of pagination, draft protection, proxy-aware login throttling and saved-hotel-timezone rendering.
- Gate C still requires the Rezlynx/Guestline adapter and independently accepted PMS/payment workflows, plus privacy, identity, capacity, and release approvals. - Gate C still requires the Rezlynx/Guestline adapter and independently accepted PMS/payment workflows, plus privacy, identity, capacity, and release approvals.
- FAQ live mode and all external write actions must remain disabled until their corresponding acceptance gate has passed. - FAQ live mode and all external write actions must remain disabled until their corresponding acceptance gate has passed.
@@ -28,7 +28,7 @@ See [MILESTONES.md](MILESTONES.md) for the gate assessment, delivery sequence, a
## 0.2.0 — Superseded candidate identifier ## 0.2.0 — Superseded candidate identifier
The published `0.2.0` tag is retained unchanged for auditability but is not the approved deployment candidate. It identifies a development-line commit that is not on the clean Gate B release branch. Do not package or deploy it; `0.2.1` supersedes it. The published `0.2.0` tag is retained unchanged for auditability but is not the approved deployment candidate. It identifies a development-line commit that is not on the clean Gate B release branch. Do not package or deploy it; `0.2.2` supersedes it.
## 0.1.0 — 29 September 2026 ## 0.1.0 — 29 September 2026
@@ -40,9 +40,9 @@ The `0.1.0` tag identifies the initial GuestOps Web foundation. It is not approv
- ASP.NET Core authentication with protected cookies, password hashing, CSRF validation, login throttling, role checks, and server-derived hotel membership. - ASP.NET Core authentication with protected cookies, password hashing, CSRF validation, login throttling, role checks, and server-derived hotel membership.
- Tenant-scoped MongoDB storage with optimistic concurrency, unique mailbox/message indexes, OAuth state expiry, and worker leases. - Tenant-scoped MongoDB storage with optimistic concurrency, unique mailbox/message indexes, OAuth state expiry, and worker leases.
- Read-only Google OAuth and recent-message import foundation with checkpoint and duplicate protection. - Read-only Google OAuth and recent-message import foundation with checkpoint and duplicate protection.
- Preview mode, Linux container definitions, Nginx HTTPS example, and automated backend/frontend verification. - Preview mode, native Linux packaging, Nginx HTTPS example, and automated backend/frontend verification.
- Live email sending, PMS writes, payment workflows, and automatic FAQ replies were disabled in this foundation. - Live email sending, PMS writes, payment workflows, and automatic FAQ replies were disabled in this foundation.
### Versioning ### Versioning
The foundation remains tagged `0.1.0`. The .NET projects and frontend package now share candidate version `0.2.1`; create that immutable tag only after the exact commit, checksummed artifacts and Gate B acceptance evidence have been approved. The foundation remains tagged `0.1.0`. The .NET projects and frontend package now share candidate version `0.2.2`; create that immutable tag only after the exact commit, checksummed artifacts and Gate B acceptance evidence have been approved.
-60
View File
@@ -1,60 +0,0 @@
name: guestops
x-app-env: &app-env
Mongo__ConnectionString: ${MONGO_CONNECTION_STRING:?Set MONGO_CONNECTION_STRING}
Mongo__Database: ${MONGO_DATABASE:-guestops}
Keys__Path: /var/lib/guestops/keys
PublicUrl: ${GUESTOPS_PUBLIC_ORIGIN:?Set GUESTOPS_PUBLIC_ORIGIN}
Google__ClientId: ${GOOGLE_CLIENT_ID:-}
Google__ClientSecret: ${GOOGLE_CLIENT_SECRET:-}
AutoReply__EnableLive: ${AUTO_REPLY_ENABLE_LIVE:-false}
Google__EnableSending: ${GOOGLE_ENABLE_SENDING:-false}
Logging__LogLevel__Default: Warning
Logging__LogLevel__Microsoft.AspNetCore.Hosting.Diagnostics: Warning
x-logging: &logging
driver: json-file
options: { max-size: "10m", max-file: "3" }
services:
api:
image: ${GUESTOPS_API_IMAGE:-guestops-api:local}
build: { context: ., target: api }
restart: unless-stopped
ports: ["127.0.0.1:8080:8080"]
environment:
<<: *app-env
ASPNETCORE_ENVIRONMENT: Production
AllowedHosts: ${GUESTOPS_ALLOWED_HOSTS:?Set GUESTOPS_ALLOWED_HOSTS}
Proxy__KnownAddress: ${GUESTOPS_GATEWAY:-172.30.87.1}
Ai__ApiKey: ${AI_API_KEY:-}
Ai__Model: ${AI_MODEL:-}
Payments__ConfigFile: /run/guestops/payments.json
Pms__ConfigFile: /run/guestops/pms.json
volumes:
- app-keys:/var/lib/guestops/keys
- ${PMS_CONFIG_FILE_HOST:-./deploy/pms.example.json}:/run/guestops/pms.json:ro
- ${PAYMENTS_CONFIG_FILE_HOST:-./deploy/payments.example.json}:/run/guestops/payments.json:ro
labels:
co.elastic.logs/enabled: "true"
service.name: guestops-api
logging: *logging
mem_limit: 1g
security_opt: ["no-new-privileges:true"]
worker:
image: ${GUESTOPS_WORKER_IMAGE:-guestops-worker:local}
build: { context: ., target: worker }
restart: unless-stopped
environment: *app-env
volumes: ["app-keys:/var/lib/guestops/keys"]
labels:
co.elastic.logs/enabled: "true"
service.name: guestops-worker
logging: *logging
mem_limit: 768m
security_opt: ["no-new-privileges:true"]
volumes:
app-keys:
networks:
default:
ipam:
config:
- subnet: ${GUESTOPS_SUBNET:-172.30.87.0/24}
gateway: ${GUESTOPS_GATEWAY:-172.30.87.1}
+1 -1
View File
@@ -2,7 +2,7 @@
"acceptedAt": "2026-01-01T00:00:00Z", "acceptedAt": "2026-01-01T00:00:00Z",
"acceptedBy": "REPLACE WITH APPROVER", "acceptedBy": "REPLACE WITH APPROVER",
"endedAt": "2026-01-01T00:00:00Z", "endedAt": "2026-01-01T00:00:00Z",
"environment": "https://guestops-sandbox.futuresens.co.uk", "environment": "https://sandbox-guestops.futuresens.co.uk",
"mailboxLabel": "sandbox mailbox A", "mailboxLabel": "sandbox mailbox A",
"operator": "REPLACE WITH OPERATOR", "operator": "REPLACE WITH OPERATOR",
"releaseCommit": "0000000000000000000000000000000000000000", "releaseCommit": "0000000000000000000000000000000000000000",
+207
View File
@@ -0,0 +1,207 @@
#!/usr/bin/env python3
"""Build a deterministic self-contained Linux GuestOps release archive."""
from __future__ import annotations
import argparse
import gzip
import io
import json
from pathlib import Path
import re
import shutil
import subprocess
import sys
import tarfile
import tempfile
import xml.etree.ElementTree as ET
from collections.abc import Callable, Sequence
SEMVER = re.compile(r"[0-9]+\.[0-9]+\.[0-9]+")
FULL_SHA = re.compile(r"[0-9a-f]{40}")
LINUX_RUNTIME = "linux-x64"
Runner = Callable[[Sequence[str], Path], None]
def git(repository: Path, *arguments: str, binary: bool = False) -> bytes | str:
result = subprocess.run(
["git", "-C", str(repository), *arguments],
check=True,
capture_output=True,
text=not binary,
)
return result.stdout if binary else result.stdout.strip()
def committed_text(repository: Path, commit: str, path: str) -> str:
return str(git(repository, "show", f"{commit}:{path}"))
def versions(repository: Path, commit: str) -> tuple[str, str]:
props = ET.fromstring(committed_text(repository, commit, "Directory.Build.props"))
version_node = props.find(".//Version")
if version_node is None or not version_node.text:
raise ValueError("The committed Directory.Build.props has no Version element.")
dotnet_version = version_node.text.strip()
package = json.loads(committed_text(repository, commit, "web/package.json"))
return dotnet_version, str(package.get("version", ""))
def run_build(arguments: Sequence[str], working_directory: Path) -> None:
command = list(arguments)
executable = shutil.which(command[0])
if executable is None:
raise FileNotFoundError(f"Required build tool is not installed: {command[0]}")
command[0] = executable
subprocess.run(command, cwd=working_directory, check=True)
def extract_commit(repository: Path, commit: str, destination: Path) -> None:
archive = bytes(git(repository, "archive", "--format=tar", commit, binary=True))
with tarfile.open(fileobj=io.BytesIO(archive), mode="r:") as source:
source.extractall(destination, filter="data")
def add_directory(package: tarfile.TarFile, name: str) -> None:
entry = tarfile.TarInfo(name.rstrip("/") + "/")
entry.type = tarfile.DIRTYPE
entry.mode = 0o755
entry.uid = entry.gid = 0
entry.uname = entry.gname = "root"
entry.mtime = 0
package.addfile(entry)
def add_file(package: tarfile.TarFile, source: Path, name: str, executable: bool) -> None:
content = source.read_bytes()
entry = tarfile.TarInfo(name)
entry.size = len(content)
entry.mode = 0o755 if executable else 0o644
entry.uid = entry.gid = 0
entry.uname = entry.gname = "root"
entry.mtime = 0
package.addfile(entry, io.BytesIO(content))
def release_bytes(release: Path, version: str) -> bytes:
prefix = f"guestops_{version}"
tar_bytes = io.BytesIO()
with tarfile.open(fileobj=tar_bytes, mode="w", format=tarfile.PAX_FORMAT) as package:
add_directory(package, prefix)
for component in ("api", "worker"):
root = release / component
add_directory(package, f"{prefix}/{component}")
for path in sorted(root.rglob("*"), key=lambda item: item.as_posix()):
relative = path.relative_to(release).as_posix()
target = f"{prefix}/{relative}"
if path.is_dir():
add_directory(package, target)
elif path.is_file():
add_file(
package,
path,
target,
relative in {"api/GuestOps.Api", "worker/GuestOps.Worker"},
)
compressed = io.BytesIO()
with gzip.GzipFile(fileobj=compressed, mode="wb", filename="", mtime=0) as stream:
stream.write(tar_bytes.getvalue())
return compressed.getvalue()
def build_package(
repository: Path,
ref: str,
output_directory: Path,
runner: Runner = run_build,
) -> tuple[Path, dict[str, str]]:
repository = repository.resolve()
output_directory = output_directory.resolve()
if not (repository / ".git").exists():
raise ValueError("--repository must be a Git working tree.")
commit = str(git(repository, "rev-parse", "--verify", f"{ref}^{{commit}}")).lower()
if FULL_SHA.fullmatch(commit) is None:
raise ValueError("The selected ref did not resolve to a full Git commit SHA.")
dotnet_version, web_version = versions(repository, commit)
if dotnet_version != web_version:
raise ValueError(
f"Committed release versions differ: .NET={dotnet_version}, web={web_version}."
)
if SEMVER.fullmatch(dotnet_version) is None:
raise ValueError("The committed version must use MAJOR.MINOR.PATCH.")
output = output_directory / f"guestops_{dotnet_version}.tar.gz"
if output.exists():
raise ValueError("The output package already exists; published versions are not overwritten.")
with tempfile.TemporaryDirectory(prefix="guestops-release-") as temporary:
root = Path(temporary)
source = root / "source"
release = root / "release"
source.mkdir()
(release / "api").mkdir(parents=True)
(release / "worker").mkdir(parents=True)
extract_commit(repository, commit, source)
runner(["npm", "ci", "--no-audit", "--no-fund"], source / "web")
runner(["npm", "run", "build"], source / "web")
common = [
"--configuration", "Release",
"--runtime", LINUX_RUNTIME,
"--self-contained", "true",
"--no-restore",
"-p:UseAppHost=true",
"-p:ContinuousIntegrationBuild=true",
"-p:Deterministic=true",
f"-p:PathMap={source}=/src",
]
runner(
["dotnet", "restore", "src/GuestOps.Api/GuestOps.Api.csproj", "--runtime", LINUX_RUNTIME],
source,
)
runner(
["dotnet", "publish", "src/GuestOps.Api/GuestOps.Api.csproj", *common, "--output", str(release / "api")],
source,
)
runner(
["dotnet", "restore", "src/GuestOps.Worker/GuestOps.Worker.csproj", "--runtime", LINUX_RUNTIME],
source,
)
runner(
["dotnet", "publish", "src/GuestOps.Worker/GuestOps.Worker.csproj", *common, "--output", str(release / "worker")],
source,
)
shutil.copytree(source / "web" / "dist", release / "api" / "wwwroot")
for required in (release / "api" / "GuestOps.Api", release / "worker" / "GuestOps.Worker"):
if not required.is_file():
raise ValueError(f"Expected native executable was not produced: {required.name}.")
if not (release / "api" / "wwwroot" / "index.html").is_file():
raise ValueError("The frontend build did not produce index.html.")
content = release_bytes(release, dotnet_version)
output_directory.mkdir(parents=True, exist_ok=True)
output.write_bytes(content)
return output, {"commit": commit, "version": dotnet_version, "runtime": LINUX_RUNTIME}
def main() -> None:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--ref", required=True, help="Exact tag, branch, or full commit to package.")
parser.add_argument("--repository", type=Path, default=Path(__file__).resolve().parents[1])
parser.add_argument("--output-directory", required=True, type=Path)
args = parser.parse_args()
try:
archive, details = build_package(args.repository, args.ref, args.output_directory)
except (OSError, ValueError, ET.ParseError, json.JSONDecodeError, subprocess.SubprocessError) as error:
print(f"Release packaging failed: {error}", file=sys.stderr)
raise SystemExit(1)
print(json.dumps({"archive": str(archive), **details}, indent=2))
if __name__ == "__main__":
main()
-104
View File
@@ -1,104 +0,0 @@
#!/usr/bin/env python3
"""Create a deterministic GuestOps source package from one committed Git tree."""
from __future__ import annotations
import argparse
import gzip
import io
import json
from pathlib import Path
import re
import subprocess
import sys
import xml.etree.ElementTree as ET
SEMVER = re.compile(r"[0-9]+\.[0-9]+\.[0-9]+")
FULL_SHA = re.compile(r"[0-9a-f]{40}")
def git(repository: Path, *arguments: str, binary: bool = False) -> bytes | str:
result = subprocess.run(
["git", "-C", str(repository), *arguments],
check=True,
capture_output=True,
text=not binary,
)
return result.stdout if binary else result.stdout.strip()
def committed_text(repository: Path, commit: str, path: str) -> str:
return str(git(repository, "show", f"{commit}:{path}"))
def versions(repository: Path, commit: str) -> tuple[str, str]:
props = ET.fromstring(committed_text(repository, commit, "Directory.Build.props"))
version_node = props.find(".//Version")
if version_node is None or not version_node.text:
raise ValueError("The committed Directory.Build.props has no Version element.")
dotnet_version = version_node.text.strip()
package = json.loads(committed_text(repository, commit, "web/package.json"))
web_version = str(package.get("version", ""))
return dotnet_version, web_version
def build_package(repository: Path, ref: str, output_directory: Path) -> tuple[Path, dict[str, str]]:
repository = repository.resolve()
output_directory = output_directory.resolve()
if not (repository / ".git").exists():
raise ValueError("--repository must be a Git working tree.")
commit = str(git(repository, "rev-parse", "--verify", f"{ref}^{{commit}}")).lower()
if FULL_SHA.fullmatch(commit) is None:
raise ValueError("The selected ref did not resolve to a full Git commit SHA.")
dotnet_version, web_version = versions(repository, commit)
if dotnet_version != web_version:
raise ValueError(
f"Committed release versions differ: .NET={dotnet_version}, web={web_version}."
)
if SEMVER.fullmatch(dotnet_version) is None:
raise ValueError("The committed version must use MAJOR.MINOR.PATCH.")
prefix = f"guestops_{dotnet_version}/"
tar_bytes = bytes(
git(
repository,
"archive",
"--format=tar",
f"--prefix={prefix}",
commit,
binary=True,
)
)
compressed = io.BytesIO()
with gzip.GzipFile(fileobj=compressed, mode="wb", filename="", mtime=0) as stream:
stream.write(tar_bytes)
archive_bytes = compressed.getvalue()
archive = output_directory / f"guestops_{dotnet_version}.tar.gz"
if archive.exists():
raise ValueError("The output package already exists; published versions are not overwritten.")
output_directory.mkdir(parents=True, exist_ok=True)
archive.write_bytes(archive_bytes)
return archive, {"commit": commit, "version": dotnet_version}
def main() -> None:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--ref", required=True, help="Exact tag, branch, or full commit to package.")
parser.add_argument("--repository", type=Path, default=Path(__file__).resolve().parents[1])
parser.add_argument("--output-directory", required=True, type=Path)
args = parser.parse_args()
try:
archive, details = build_package(args.repository, args.ref, args.output_directory)
except (OSError, ValueError, ET.ParseError, json.JSONDecodeError, subprocess.SubprocessError) as error:
print(f"Source packaging failed: {error}", file=sys.stderr)
raise SystemExit(1)
print(json.dumps({"archive": str(archive), **details}, indent=2))
if __name__ == "__main__":
main()
+1 -1
View File
@@ -34,7 +34,7 @@ def timestamp(value: object, field: str) -> dt.datetime:
def validate(record: object) -> None: def validate(record: object) -> None:
require(isinstance(record, dict), "Approval record must be a JSON object.") require(isinstance(record, dict), "Approval record must be a JSON object.")
require(record.get("schemaVersion") == 2, "Unsupported approval schema; Gate B 0.2.1 requires schemaVersion 2.") require(record.get("schemaVersion") == 2, "Unsupported approval schema; Gate B 0.2.2 requires schemaVersion 2.")
gate = record.get("targetGate") gate = record.get("targetGate")
require(gate in ("B", "C"), "targetGate must be B or C.") require(gate in ("B", "C"), "targetGate must be B or C.")
require(record.get("decision") == "approved", "Only an explicit approved decision passes validation.") require(record.get("decision") == "approved", "Only an explicit approved decision passes validation.")
+3 -4
View File
@@ -16,18 +16,17 @@ An email belongs to one hotel account. Existing active accounts cannot be reassi
## Owner recovery on the Linux server ## Owner recovery on the Linux server
The server administrator must verify the owner's identity before issuing a recovery link. On the server, in the directory containing the deployed Compose file and its private environment file: The server administrator must verify the owner's identity before issuing a recovery link. On the server:
```sh ```sh
read -r -p 'Verified owner email: ' RECOVERY_EMAIL read -r -p 'Verified owner email: ' RECOVERY_EMAIL
export RECOVERY_EMAIL sudo -u cms sh -c 'set -a; . /etc/guestops/guestops.env; set +a; RECOVERY_EMAIL="$1" /srv/guestops/api/GuestOps.Api --recover-owner' sh "$RECOVERY_EMAIL"
docker compose run --rm --no-deps -e RECOVERY_EMAIL api --recover-owner
unset RECOVERY_EMAIL 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. 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 ## Storage and session behavior
+1 -1
View File
@@ -12,7 +12,7 @@ The first version requires a top-level plain-text MIME message. HTML and multipa
## Enable live mode after acceptance ## Enable live mode after acceptance
Keep `AUTO_REPLY_ENABLE_LIVE=false` in the deployment `.env` until the Google send/reconciliation workflow and FAQ test-mode results have been accepted. Then set it true and restart both API and worker. Gmail sending must be configured, the hotel must enable staff sending, and the mailbox must have send consent. Finally, the owner explicitly confirms test-mode acceptance and selects **Enable live replies**. Keep `AutoReply__EnableLive=false` in `/etc/guestops/guestops.env` until the Google send/reconciliation workflow and FAQ test-mode results have been accepted. Then set it true and restart `guestops-api.service` and `guestops-worker.service`. Gmail sending must be configured, the hotel must enable staff sending, and the mailbox must have send consent. Finally, the owner explicitly confirms test-mode acceptance and selects **Enable live replies**.
Before test-mode acceptance, use **Batch safety evaluation** with representative synthetic cases. Each JSON case has a unique `id`, `subject`, `body`, `expectedMatch`, and optionally `expectedKnowledgeId`. The no-send evaluator accepts 1–100 cases, reads the hotel's current reviewed rules and knowledge, and reports false positives, false negatives and per-case reasons without saving a conversation or consuming a quota. Before test-mode acceptance, use **Batch safety evaluation** with representative synthetic cases. Each JSON case has a unique `id`, `subject`, `body`, `expectedMatch`, and optionally `expectedKnowledgeId`. The no-send evaluator accepts 1–100 cases, reads the hotel's current reviewed rules and knowledge, and reports false positives, false negatives and per-case reasons without saving a conversation or consuming a quota.
+37 -21
View File
@@ -1,7 +1,7 @@
# GuestOps deployment # GuestOps deployment
GuestOps is deployed by the central Futuresens Ansible repository. Sandbox is 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`. `https://guestops.futuresens.co.uk`.
## Prepare a version ## Prepare a version
@@ -14,14 +14,15 @@ dotnet run --project tests/GuestOps.Tests
python3 -m unittest discover -s tests -p "test_*.py" python3 -m unittest discover -s tests -p "test_*.py"
cd web && npm ci && npm run build && cd .. cd web && npm ci && npm run build && cd ..
python3 deploy/package_source.py \ python3 deploy/package_release.py \
--ref FULL_COMMIT_OR_TAG \ --ref FULL_COMMIT_OR_TAG \
--output-directory ../ansible/playbooks/files/guestops --output-directory ../ansible/playbooks/files/guestops
``` ```
For version `0.2.1`, this creates `guestops_0.2.1.tar.gz`. Published version For version `0.2.2`, this creates `guestops_0.2.2.tar.gz`. The archive contains
files are immutable; change the application version before making another self-contained Linux x64 API and worker applications, including the built
archive. frontend. Published version files are immutable; change the application version
before making another archive.
## Configure Ansible ## Configure Ansible
@@ -29,37 +30,52 @@ The server group needs only the application switch, version and subdomain:
```yaml ```yaml
hasguestops: true hasguestops: true
guestopsversion: "0.2.1" guestopsversion: "0.2.2"
guestopssubdomain: "guestops-sandbox" guestopssubdomain: "sandbox-guestops"
``` ```
Production uses `guestopssubdomain: "guestops"`. Runtime credentials and the Production uses `guestopssubdomain: "guestops"`. The native services use the
MongoDB connection string belong in encrypted Ansible Vault data. The MongoDB existing MongoDB service on `127.0.0.1:27017`. Google sending,
URI must use a least-privilege `guestops` database user and an address reachable automatic live replies, AI, PMS connections, and payment connections remain
from Docker containers. disabled until they are configured separately.
## Deploy ## Deploy
Deploy sandbox first: Deploy sandbox first:
```sh ```sh
ansible-playbook playbooks/guestops.yml -K --ask-vault-pass \ ansible-playbook playbooks/guestops.yml -K \
--extra-vars "thehost=sandbox" --extra-vars "thehost=sandbox"
``` ```
After acceptance, deploy the same versioned archive to production: After acceptance, deploy the same versioned archive to production:
```sh ```sh
ansible-playbook playbooks/guestops.yml -K --ask-vault-pass \ ansible-playbook playbooks/guestops.yml -K \
--extra-vars "thehost=dbserver" --extra-vars "thehost=dbserver"
``` ```
The playbook stops the existing Compose project without deleting volumes, The playbook stops the existing systemd services, replaces `/srv/guestops`,
replaces `/srv/guestops`, renders private configuration, builds and starts the renders its environment configuration, starts the self-contained API and worker,
API and worker, configures Nginx, and verifies local and public readiness. Port and manages its Nginx site. It serves HTTP before the certificate exists and
8080 remains loopback-only and the `guestops_app-keys` volume survives switches the site to HTTPS after Certbot has created the certificate. Port 8080
redeployment. remains loopback-only and `/var/lib/guestops/keys` survives redeployment.
To roll back, select an older retained `guestopsversion` in group vars and run On the first deployment, create the certificate after the HTTP site is available:
the same playbook. MongoDB backup, Filebeat, certificates, and host monitoring
are provided by the existing central infrastructure. ```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 obtains and renews the
certificate. Rerun the GuestOps playbook after initial certificate creation so
Ansible writes the final HTTPS proxy configuration.
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, certificate
renewal, and host monitoring are provided by the existing central infrastructure.
+1 -1
View File
@@ -1,6 +1,6 @@
# Gate B automation, identity and privacy acceptance # Gate B automation, identity and privacy acceptance
Run these reviews against the exact `0.2.1` candidate on the accepted HTTPS sandbox. Keep guest data, staff addresses, provider agreements, screenshots and raw reports in the restricted evidence store. Repository records contain opaque references only. Run these reviews against the exact `0.2.2` candidate on the accepted HTTPS sandbox. Keep guest data, staff addresses, provider agreements, screenshots and raw reports in the restricted evidence store. Repository records contain opaque references only.
## Knowledge, AI and FAQ automation ## Knowledge, AI and FAQ automation
+2 -2
View File
@@ -42,7 +42,7 @@ Implemented owner-only disconnect/reconnect and import restart controls, synchro
## Milestone 8: operational readiness ## Milestone 8: operational readiness
The application provides owner-only workspace health, database readiness and worker heartbeat information. Docker, Filebeat, MongoDB backup, host monitoring and disaster recovery are owned by the existing central infrastructure rather than duplicated inside GuestOps. The application provides owner-only workspace health, database readiness and worker heartbeat information. Filebeat, MongoDB backup, host monitoring and disaster recovery are owned by the existing central infrastructure rather than duplicated inside GuestOps. GuestOps runs as native systemd services.
## Remaining milestones ## Remaining milestones
@@ -56,7 +56,7 @@ Windows DPAPI settings must not be copied to Linux as usable credentials. Re-ent
## Capacity and operations ## Capacity and operations
Target supplied by the owner: Debian 12, 4 CPU cores, 7.6 GiB RAM, 18 GiB free disk; MongoDB on the same machine. Compose includes conservative starting memory limits and capped logs, not a capacity guarantee. Keep database/key backups off-server and do not import entire mailboxes by default. Establish retention and restore testing before real guest data is used. Target supplied by the owner: Debian 12, 4 CPU cores, 7.6 GiB RAM, 18 GiB free disk; MongoDB on the same machine. The native API and worker write to the systemd journal; their resource use must be confirmed during sandbox acceptance. Keep database/key backups off-server and do not import entire mailboxes by default. Establish retention and restore testing before real guest data is used.
+1 -1
View File
@@ -23,7 +23,7 @@ Copy `deploy/payments.example.json` to a private `payments.local.json` outside t
Use the internal 32-character hotel ID shown on the Payments page. `MerchantAccount` is an administrator-maintained identity binding: verify it against the merchant account behind the key. Do not reuse the same identity for a different merchant. The API accepts only `https://sandbox.nmi.com` and `https://secure.nmi.com`; confirm the correct environment and key with NMI. Use the internal 32-character hotel ID shown on the Payments page. `MerchantAccount` is an administrator-maintained identity binding: verify it against the merchant account behind the key. Do not reuse the same identity for a different merchant. The API accepts only `https://sandbox.nmi.com` and `https://secure.nmi.com`; confirm the correct environment and key with NMI.
Set `PAYMENTS_CONFIG_FILE_HOST` in the deployment `.env` to the absolute private file path. Compose mounts it read-only in the API only. Restrict file permissions to the administrator and the container user/group that needs read access. Determine the image's user with `docker run --rm --entrypoint id YOUR_API_IMAGE -u` before assigning permissions. Restart the API after changes. The default empty example disables the integration. Do not commit private configuration or put keys in the browser. Store the private file as `/etc/guestops/payments.json`, owned by `root:cms` with mode `0640`, and set `Payments__ConfigFile=/etc/guestops/payments.json` in `/etc/guestops/guestops.env`. Only the native API service reads it. Restart `guestops-api.service` after changes. Leaving the setting unset disables the integration. Do not commit private configuration or put keys in the browser or release archive.
After sandbox acceptance, enable `CreatesEnabled` on the server and **Allow owner-approved payment invoices** in the hotel's Payments page. Both controls are required. Turning off creation leaves read-only reconciliation available. Key rotation preserves reconciliation for the same merchant binding; pending approvals require the original credential revision and must be replaced after rotation. Changing the merchant identity blocks reconciliation until the original binding is restored. After sandbox acceptance, enable `CreatesEnabled` on the server and **Allow owner-approved payment invoices** in the hotel's Payments page. Both controls are required. Turning off creation leaves read-only reconciliation available. Key rotation preserves reconciliation for the same merchant binding; pending approvals require the original credential revision and must be replaced after rotation. Changing the merchant identity blocks reconciliation until the original binding is restored.
+2 -2
View File
@@ -29,9 +29,9 @@ Copy `deploy/pms.example.json` to a private `pms.local.json` outside your checko
Use the client-credentials grant and property permissions supplied for your OHIP environment. Confirm the note type and notification-location codes with the property. The gateway must be an HTTPS origin, without a path. There is no shared fallback configuration between hotels. Use the client-credentials grant and property permissions supplied for your OHIP environment. Confirm the note type and notification-location codes with the property. The gateway must be an HTTPS origin, without a path. There is no shared fallback configuration between hotels.
Set `PMS_CONFIG_FILE_HOST` in the deployment `.env` to the absolute private file path. Compose mounts it read-only into the API; the worker does not receive these credentials. Restrict host permissions to the administrator and the API container's user/group, while allowing that user to read the file. Obtain the image's user ID with `docker run --rm --entrypoint id YOUR_API_IMAGE -u` before assigning permissions. Never put credentials in the browser, repository or an image. Restart the API after configuration changes; this file is not hot-reloaded. Store the private file as `/etc/guestops/pms.json`, owned by `root:cms` with mode `0640`, and set `Pms__ConfigFile=/etc/guestops/pms.json` in `/etc/guestops/guestops.env`. Only the native API service needs these credentials. Never put them in the browser, repository or release archive. Restart `guestops-api.service` after configuration changes; this file is not hot-reloaded.
The default deployment mounts an empty example and makes no OHIP calls. Begin with sandbox credentials and `WritesEnabled: false`. Lookups can be tested without enabling writes. After sandbox acceptance, server write enablement and the hotel's owner-controlled MongoDB setting must both be enabled. Every operation still needs individual owner approval. The default deployment does not set a PMS configuration file and makes no OHIP calls. Begin with sandbox credentials and `WritesEnabled: false`. Lookups can be tested without enabling writes. After sandbox acceptance, server write enablement and the hotel's owner-controlled MongoDB setting must both be enabled. Every operation still needs individual owner approval.
## Review and recovery ## Review and recovery
+3 -3
View File
@@ -5,8 +5,8 @@ This milestone adds AI suggestions and a persistent send queue. It does not enab
## Enable on the sandbox ## Enable on the sandbox
1. Deploy the reviewed images using the deployment guide. Existing hotel records default to AI off and sending off. 1. Deploy the reviewed images using the deployment guide. Existing hotel records default to AI off and sending off.
2. Set `AI_API_KEY` and `AI_MODEL` in the server's private `.env`. Choose a model available to your OpenAI project that supports the Responses API and strict JSON-schema output. No model is silently selected and no key is stored in frontend code or MongoDB. Only the API container receives the AI key. 2. Set `Ai__ApiKey` and `Ai__Model` in the server's private `/etc/guestops/guestops.env`. Choose a model available to your OpenAI project that supports the Responses API and strict JSON-schema output. No model is silently selected and no key is stored in frontend code or MongoDB. Only the API uses the AI key.
3. Recreate API/worker containers. In hotel Settings, the owner can enable AI drafts. The opt-in explains that staff-requested generation sends the message subject/body and selected approved hotel answers to OpenAI. Requests use `store: false`; this does not replace reviewing the provider's data-processing and retention arrangements. 3. Restart `guestops-api.service`. In hotel Settings, the owner can enable AI drafts. The opt-in explains that staff-requested generation sends the message subject/body and selected approved hotel answers to OpenAI. Requests use `store: false`; this does not replace reviewing the provider's data-processing and retention arrangements.
4. For sending, set `GOOGLE_ENABLE_SENDING=true`, recreate API/worker, and reconnect Google. The OAuth request then includes `gmail.readonly` and `gmail.send`. An existing read-only refresh token is not assumed to have send permission; the returned grant must explicitly include `gmail.send`. 4. For sending, set `GOOGLE_ENABLE_SENDING=true`, recreate API/worker, and reconnect Google. The OAuth request then includes `gmail.readonly` and `gmail.send`. An existing read-only refresh token is not assumed to have send permission; the returned grant must explicitly include `gmail.send`.
5. Enable staff-approved sending in that hotel's Settings. Use a dedicated test mailbox and synthetic guest messages for live acceptance tests before enabling a real hotel mailbox. 5. Enable staff-approved sending in that hotel's Settings. Use a dedicated test mailbox and synthetic guest messages for live acceptance tests before enabling a real hotel mailbox.
@@ -34,6 +34,6 @@ Current limitations: messages imported before reply headers were stored must be
## Verification ## Verification
The test suite covers competing workers, send identity/thread headers, invalid recipients, header injection, uncertain outcomes, restart recovery, pre-send token failure, disabling hotel sending, cross-hotel access, Gmail reconciliation mismatches, AI source isolation, invalid citations, escalations and incomplete responses. Run the production-container login and restart-persistence smoke checks before packaging and during Ansible deployment verification. Live acceptance must additionally verify Google consent, actual threading, grant revocation, a representative AI draft evaluation set and provider error behaviour with the configured accounts. The test suite covers competing workers, send identity/thread headers, invalid recipients, header injection, uncertain outcomes, restart recovery, pre-send token failure, disabling hotel sending, cross-hotel access, Gmail reconciliation mismatches, AI source isolation, invalid citations, escalations and incomplete responses. Run the native-service login and restart-persistence smoke checks before packaging and during Ansible deployment verification. Live acceptance must additionally verify Google consent, actual threading, grant revocation, a representative AI draft evaluation set and provider error behaviour with the configured accounts.
Implementation references: [OpenAI Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs), [Gmail sending](https://developers.google.com/workspace/gmail/api/guides/sending), [Gmail threads](https://developers.google.com/workspace/gmail/api/guides/threads). Implementation references: [OpenAI Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs), [Gmail sending](https://developers.google.com/workspace/gmail/api/guides/sending), [Gmail threads](https://developers.google.com/workspace/gmail/api/guides/threads).
+1 -1
View File
@@ -16,7 +16,7 @@ public sealed class GoogleMailbox(HttpClient http, IConfiguration config, IStore
private readonly IDataProtector protector = protection.CreateProtector("GoogleMailbox.refresh.v1"); private readonly IDataProtector protector = protection.CreateProtector("GoogleMailbox.refresh.v1");
private string ClientId => config["Google:ClientId"] ?? ""; private string ClientId => config["Google:ClientId"] ?? "";
private string ClientSecret => config["Google:ClientSecret"] ?? ""; 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 Configured => ClientId.Length > 0 && ClientSecret.Length > 0;
public bool SendingConfigured => Configured && config.GetValue<bool>("Google:EnableSending"); public bool SendingConfigured => Configured && config.GetValue<bool>("Google:EnableSending");
public string AuthorizationUrl(string state) => "https://accounts.google.com/o/oauth2/v2/auth?" + string.Join("&", new Dictionary<string,string> { public string AuthorizationUrl(string state) => "https://accounts.google.com/o/oauth2/v2/auth?" + string.Join("&", new Dictionary<string,string> {
+6 -6
View File
@@ -1,4 +1,4 @@
"""Exercise disposable deployment containers through the host's trusted proxy address. """Exercise a disposable native deployment through the host's trusted proxy address.
The forwarded HTTPS header simulates Nginx TLS termination; this is never run The forwarded HTTPS header simulates Nginx TLS termination; this is never run
against an existing hotel database. Cookie values and credentials are not logged. against an existing hotel database. Cookie values and credentials are not logged.
@@ -35,7 +35,7 @@ def request(path, method="GET", data=None, expected=200):
return json.loads(body) if "application/json" in response.headers.get("Content-Type", "") else body return json.loads(body) if "application/json" in response.headers.get("Content-Type", "") else body
assert "root" in request("/"), "Container must serve the built React interface" assert "root" in request("/"), "Native API must serve the built React interface"
request("/api/hotel", expected=401) request("/api/hotel", expected=401)
session = request("/api/session") session = request("/api/session")
assert session["preview"] is False and session["user"] is None assert session["preview"] is False and session["user"] is None
@@ -60,19 +60,19 @@ assert "securityKey" not in payment_status
request("/api/payments/controls", "PUT", {"version": 0, "enabled": True}, expected=400) request("/api/payments/controls", "PUT", {"version": 0, "enabled": True}, expected=400)
assert request("/api/payments/requests") == [] assert request("/api/payments/requests") == []
hotel = request("/api/hotel") hotel = request("/api/hotel")
assert "root" in request("/account"), "Container must serve account link page" assert "root" in request("/account"), "Native API must serve account link page"
assert len(request("/api/onboarding")["steps"]) == 5 assert len(request("/api/onboarding")["steps"]) == 5
team = request("/api/team") team = request("/api/team")
assert all("passwordHash" not in member and "securityStamp" not in member and "accountLinkHash" not in member for member in team) assert all("passwordHash" not in member and "securityStamp" not in member and "accountLinkHash" not in member for member in team)
if "--read" in sys.argv: if "--read" in sys.argv:
assert hotel["signature"] == "Persisted across container restart" assert hotel["signature"] == "Persisted across service restart"
invited = next(member for member in team if member["email"] == "deployment-staff@example.invalid") invited = next(member for member in team if member["email"] == "deployment-staff@example.invalid")
assert invited["pending"] and not invited["active"] and invited["linkPurpose"] == "Invite" assert invited["pending"] and not invited["active"] and invited["linkPurpose"] == "Invite"
else: else:
hotel["signature"] = "Persisted across container restart" hotel["signature"] = "Persisted across service restart"
request("/api/hotel", "PUT", hotel) request("/api/hotel", "PUT", hotel)
invite = request("/api/team/invite", "POST", {"name": "Deployment Staff", "email": "deployment-staff@example.invalid"}) 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/auth/logout", "POST")
request("/api/hotel", expected=401) request("/api/hotel", expected=401)
print("Production smoke checks passed: built UI, secure cookies, owner login, persisted settings and staff invitation, onboarding and logout.") print("Production smoke checks passed: built UI, secure cookies, owner login, persisted settings and staff invitation, onboarding and logout.")
+1 -1
View File
@@ -16,7 +16,7 @@ def valid_record():
"desktopBaselineCommit": acceptance.DESKTOP_BASELINE, "desktopBaselineCommit": acceptance.DESKTOP_BASELINE,
"releaseCommit": "a" * 40, "releaseCommit": "a" * 40,
"releaseRecordSha256": "b" * 64, "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"}, "browser": {"name": "Microsoft Edge", "version": "140.0.0.0", "operatingSystem": "Windows 11"},
"viewport": {"width": 1440, "height": 900, "deviceScaleFactor": 1}, "viewport": {"width": 1440, "height": 900, "deviceScaleFactor": 1},
"hotelTimeZone": "Europe/London", "hotelTimeZone": "Europe/London",
+1 -1
View File
@@ -21,7 +21,7 @@ def base(system):
return { return {
"schemaVersion": 1, "system": system, "targetGate": "B", "schemaVersion": 1, "system": system, "targetGate": "B",
"releaseCommit": "a" * 40, "releaseRecordSha256": "b" * 64, "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", "operator": "Acceptance operator", "reviewedBy": "Independent reviewer",
"startedAt": "2026-10-01T09:00:00Z", "endedAt": "2026-10-01T10:00:00Z", "reviewedAt": "2026-10-01T11:00:00Z", "startedAt": "2026-10-01T09:00:00Z", "endedAt": "2026-10-01T10:00:00Z", "reviewedAt": "2026-10-01T11:00:00Z",
} }
+1 -1
View File
@@ -14,7 +14,7 @@ def valid_report():
"system": "google-mailbox", "system": "google-mailbox",
"releaseCommit": "a" * 40, "releaseCommit": "a" * 40,
"releaseRecordSha256": "b" * 64, "releaseRecordSha256": "b" * 64,
"environment": "https://guestops-sandbox.futuresens.co.uk", "environment": "https://sandbox-guestops.futuresens.co.uk",
"mailboxLabel": "sandbox mailbox A", "mailboxLabel": "sandbox mailbox A",
"operator": "Test operator", "operator": "Test operator",
"startedAt": "2026-09-29T10:00:00Z", "startedAt": "2026-09-29T10:00:00Z",
+1 -1
View File
@@ -17,7 +17,7 @@ def valid_record(gate="B"):
"dataClassification": "synthetic-only", "dataClassification": "synthetic-only",
"releaseCommit": "a" * 40, "releaseCommit": "a" * 40,
"releaseRecordSha256": "b" * 64, "releaseRecordSha256": "b" * 64,
"environment": "https://guestops-sandbox.futuresens.co.uk", "environment": "https://sandbox-guestops.futuresens.co.uk",
"operator": "Exercise operator", "operator": "Exercise operator",
"incidentCommander": "Incident commander", "incidentCommander": "Incident commander",
"reviewedBy": "Independent reviewer", "reviewedBy": "Independent reviewer",
@@ -8,9 +8,9 @@ import unittest
ROOT = Path(__file__).resolve().parents[1] ROOT = Path(__file__).resolve().parents[1]
spec = importlib.util.spec_from_file_location("package_source", ROOT / "deploy" / "package_source.py") spec = importlib.util.spec_from_file_location("package_release", ROOT / "deploy" / "package_release.py")
package_source = importlib.util.module_from_spec(spec) package_release = importlib.util.module_from_spec(spec)
spec.loader.exec_module(package_source) spec.loader.exec_module(package_release)
def run(repository: Path, *arguments: str) -> str: def run(repository: Path, *arguments: str) -> str:
@@ -23,10 +23,12 @@ def run(repository: Path, *arguments: str) -> str:
return result.stdout.strip() return result.stdout.strip()
class PackageSourceTests(unittest.TestCase): class PackageReleaseTests(unittest.TestCase):
def repository(self, root: Path, dotnet_version: str = "1.2.3", web_version: str = "1.2.3") -> tuple[Path, str]: def repository(self, root: Path, dotnet_version: str = "1.2.3", web_version: str = "1.2.3") -> tuple[Path, str]:
repository = root / "repository" repository = root / "repository"
(repository / "web").mkdir(parents=True) (repository / "web").mkdir(parents=True)
(repository / "src" / "GuestOps.Api").mkdir(parents=True)
(repository / "src" / "GuestOps.Worker").mkdir(parents=True)
run(repository, "init") run(repository, "init")
run(repository, "config", "user.name", "GuestOps Test") run(repository, "config", "user.name", "GuestOps Test")
run(repository, "config", "user.email", "guestops@example.invalid") run(repository, "config", "user.email", "guestops@example.invalid")
@@ -43,27 +45,44 @@ class PackageSourceTests(unittest.TestCase):
run(repository, "commit", "-m", "fixture") run(repository, "commit", "-m", "fixture")
return repository, run(repository, "rev-parse", "HEAD") return repository, run(repository, "rev-parse", "HEAD")
def test_packages_only_the_selected_commit_with_version_name(self): @staticmethod
def fake_builder(arguments, working_directory: Path) -> None:
if list(arguments[:3]) == ["npm", "run", "build"]:
content = (working_directory.parent / "application.txt").read_text(encoding="utf-8")
(working_directory / "dist").mkdir()
(working_directory / "dist" / "index.html").write_text(content, encoding="utf-8")
if arguments[0:2] == ["dotnet", "publish"]:
output = Path(arguments[arguments.index("--output") + 1])
executable = "GuestOps.Api" if "GuestOps.Api" in arguments[2] else "GuestOps.Worker"
(output / executable).write_bytes(executable.encode("ascii"))
def test_packages_only_selected_commit_as_native_release(self):
with tempfile.TemporaryDirectory() as directory: with tempfile.TemporaryDirectory() as directory:
root = Path(directory) root = Path(directory)
repository, commit = self.repository(root) repository, commit = self.repository(root)
(repository / "application.txt").write_text("uncommitted change\n", encoding="utf-8") (repository / "application.txt").write_text("uncommitted change\n", encoding="utf-8")
archive, details = package_source.build_package(repository, commit, root / "output") archive, details = package_release.build_package(
repository, commit, root / "output", self.fake_builder
)
self.assertEqual(archive.name, "guestops_1.2.3.tar.gz") self.assertEqual(archive.name, "guestops_1.2.3.tar.gz")
self.assertEqual(details, {"commit": commit, "version": "1.2.3"}) self.assertEqual(details, {"commit": commit, "version": "1.2.3", "runtime": "linux-x64"})
with tarfile.open(archive, "r:gz") as package: with tarfile.open(archive, "r:gz") as package:
member = package.extractfile("guestops_1.2.3/application.txt") names = package.getnames()
self.assertIsNotNone(member) self.assertIn("guestops_1.2.3/api/GuestOps.Api", names)
self.assertEqual(member.read().decode("utf-8").strip(), "committed application") self.assertIn("guestops_1.2.3/worker/GuestOps.Worker", names)
index = package.extractfile("guestops_1.2.3/api/wwwroot/index.html")
self.assertEqual(index.read().decode("utf-8").strip(), "committed application")
self.assertEqual(package.getmember("guestops_1.2.3/api/GuestOps.Api").mode, 0o755)
self.assertEqual(package.getmember("guestops_1.2.3/worker/GuestOps.Worker").mode, 0o755)
def test_same_commit_produces_identical_package(self): def test_same_commit_produces_identical_package(self):
with tempfile.TemporaryDirectory() as directory: with tempfile.TemporaryDirectory() as directory:
root = Path(directory) root = Path(directory)
repository, commit = self.repository(root) repository, commit = self.repository(root)
first, _ = package_source.build_package(repository, commit, root / "first") first, _ = package_release.build_package(repository, commit, root / "first", self.fake_builder)
second, _ = package_source.build_package(repository, commit, root / "second") second, _ = package_release.build_package(repository, commit, root / "second", self.fake_builder)
self.assertEqual(first.read_bytes(), second.read_bytes()) self.assertEqual(first.read_bytes(), second.read_bytes())
def test_rejects_mismatched_versions_and_existing_output(self): def test_rejects_mismatched_versions_and_existing_output(self):
@@ -71,14 +90,14 @@ class PackageSourceTests(unittest.TestCase):
root = Path(directory) root = Path(directory)
repository, commit = self.repository(root, web_version="1.2.4") repository, commit = self.repository(root, web_version="1.2.4")
with self.assertRaisesRegex(ValueError, "versions differ"): with self.assertRaisesRegex(ValueError, "versions differ"):
package_source.build_package(repository, commit, root / "output") package_release.build_package(repository, commit, root / "output", self.fake_builder)
with tempfile.TemporaryDirectory() as directory: with tempfile.TemporaryDirectory() as directory:
root = Path(directory) root = Path(directory)
repository, commit = self.repository(root) repository, commit = self.repository(root)
package_source.build_package(repository, commit, root / "output") package_release.build_package(repository, commit, root / "output", self.fake_builder)
with self.assertRaisesRegex(ValueError, "not overwritten"): with self.assertRaisesRegex(ValueError, "not overwritten"):
package_source.build_package(repository, commit, root / "output") package_release.build_package(repository, commit, root / "output", self.fake_builder)
if __name__ == "__main__": if __name__ == "__main__":
+1 -1
View File
@@ -13,7 +13,7 @@ def valid_record():
return { return {
"schemaVersion": 1, "system": "guestops-supervised-pilot", "targetGate": "B", "schemaVersion": 1, "system": "guestops-supervised-pilot", "targetGate": "B",
"releaseCommit": "a" * 40, "releaseRecordSha256": "b" * 64, "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, "hotelCount": 1, "plannedBusinessDays": 5,
"owners": {"hotelOwner": "Hotel owner", "technicalOwner": "Technical owner", "rollbackDecisionMaker": "Technical owner"}, "owners": {"hotelOwner": "Hotel owner", "technicalOwner": "Technical owner", "rollbackDecisionMaker": "Technical owner"},
"startedOn": days[0], "endedOn": days[-1], "startedOn": days[0], "endedOn": days[-1],
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "guestops-web", "name": "guestops-web",
"version": "0.2.1", "version": "0.2.2",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "guestops-web", "name": "guestops-web",
"version": "0.2.1", "version": "0.2.2",
"dependencies": { "dependencies": {
"lucide-react": "^0.577.0", "lucide-react": "^0.577.0",
"react": "19.2.8", "react": "19.2.8",
+1 -1
View File
@@ -1 +1 @@
{"name":"guestops-web","private":true,"version":"0.2.1","type":"module","scripts":{"dev":"vite --host 127.0.0.1","build":"tsc -b && vite build","check":"tsc -b"},"dependencies":{"react":"19.2.8","react-dom":"19.2.8","lucide-react":"^0.577.0"},"devDependencies":{"@types/react":"^19.2.0","@types/react-dom":"^19.2.0","@vitejs/plugin-react":"6.1.1","typescript":"~5.9.3","vite":"8.2.2"}} {"name":"guestops-web","private":true,"version":"0.2.2","type":"module","scripts":{"dev":"vite --host 127.0.0.1","build":"tsc -b && vite build","check":"tsc -b"},"dependencies":{"react":"19.2.8","react-dom":"19.2.8","lucide-react":"^0.577.0"},"devDependencies":{"@types/react":"^19.2.0","@types/react-dom":"^19.2.0","@vitejs/plugin-react":"6.1.1","typescript":"~5.9.3","vite":"8.2.2"}}
+1 -1
View File
@@ -20,7 +20,7 @@ export function OperationsPage({owner,go}:{owner:boolean;go:(path:string)=>void}
{error&&<div className="alert" role="alert">{error} The information below may be out of date.</div>} {error&&<div className="alert" role="alert">{error} The information below may be out of date.</div>}
{data&&<> {data&&<>
<p className="small muted">Checked {when(data.checkedAt)}{data.preview?' · Sample workspace':''}</p> <p className="small muted">Checked {when(data.checkedAt)}{data.preview?' · Sample workspace':''}</p>
<section className="settings-card"><h2>Application and worker</h2><div className="mailbox-health"><div><span>Database connection</span><strong>{data.preview?'Temporary preview storage':data.database}</strong></div><div><span>Background worker</span><strong>{data.worker.state==='Reporting'?'Reporting normally':data.worker.state==='Preview'?'Unavailable in preview':data.worker.state==='Stale'?'Heartbeat overdue':'No heartbeat received'}</strong></div><div><span>Last worker heartbeat</span><strong>{when(data.worker.lastSeenAt)}</strong></div></div>{['Stale','NotSeen'].includes(data.worker.state)&&<p className="mailbox-explanation">Ask your server administrator to check the worker container and its database connection. Imports and queued replies may be delayed.</p>}<p className="small muted">A heartbeat confirms the worker process can reach storage. It does not prove that Google, payment or PMS requests are succeeding.</p></section> <section className="settings-card"><h2>Application and worker</h2><div className="mailbox-health"><div><span>Database connection</span><strong>{data.preview?'Temporary preview storage':data.database}</strong></div><div><span>Background worker</span><strong>{data.worker.state==='Reporting'?'Reporting normally':data.worker.state==='Preview'?'Unavailable in preview':data.worker.state==='Stale'?'Heartbeat overdue':'No heartbeat received'}</strong></div><div><span>Last worker heartbeat</span><strong>{when(data.worker.lastSeenAt)}</strong></div></div>{['Stale','NotSeen'].includes(data.worker.state)&&<p className="mailbox-explanation">Ask your server administrator to check the worker service and its database connection. Imports and queued replies may be delayed.</p>}<p className="small muted">A heartbeat confirms the worker process can reach storage. It does not prove that Google, payment or PMS requests are succeeding.</p></section>
<section className="settings-card"><h2>Mailbox connections</h2><div className="mailbox-health"><div><span>Total</span><strong>{data.mailboxes.total}</strong></div><div><span>Connected</span><strong>{data.mailboxes.connected}</strong></div><div><span>Need attention</span><strong>{data.mailboxes.attention}</strong></div></div><button className="button secondary" onClick={()=>go('/settings')}>Review mailbox status</button></section> <section className="settings-card"><h2>Mailbox connections</h2><div className="mailbox-health"><div><span>Total</span><strong>{data.mailboxes.total}</strong></div><div><span>Connected</span><strong>{data.mailboxes.connected}</strong></div><div><span>Need attention</span><strong>{data.mailboxes.attention}</strong></div></div><button className="button secondary" onClick={()=>go('/settings')}>Review mailbox status</button></section>
<section className="settings-card"><h2>Reply delivery</h2><div className="mailbox-health"><div><span>Queued or submitting</span><strong>{data.replies.pending}</strong></div><div><span>Need verification</span><strong>{data.replies.uncertain}</strong></div><div><span>Stopped before sending</span><strong>{data.replies.rejected}</strong></div></div><p className="small muted">Based on {data.replies.sampleSize} recent conversations, up to {data.replies.sampleLimit}. Older deliveries may exist. Verify uncertain results in Gmail before taking further action.</p><div className="form-actions"><button className="button secondary" onClick={()=>go('/inbox')}>Review the inbox</button></div></section> <section className="settings-card"><h2>Reply delivery</h2><div className="mailbox-health"><div><span>Queued or submitting</span><strong>{data.replies.pending}</strong></div><div><span>Need verification</span><strong>{data.replies.uncertain}</strong></div><div><span>Stopped before sending</span><strong>{data.replies.rejected}</strong></div></div><p className="small muted">Based on {data.replies.sampleSize} recent conversations, up to {data.replies.sampleLimit}. Older deliveries may exist. Verify uncertain results in Gmail before taking further action.</p><div className="form-actions"><button className="button secondary" onClick={()=>go('/inbox')}>Review the inbox</button></div></section>
<section className="settings-card"><h2>Backups and recovery</h2><p className="muted">Your server administrator runs encrypted backups and isolated restore drills. Ask them to confirm the latest off-server backup and successful restore test.</p><p className="small muted">This page does not claim a backup exists or that the server is ready for production. Provider acceptance and recovery checks are separate.</p></section> <section className="settings-card"><h2>Backups and recovery</h2><p className="muted">Your server administrator runs encrypted backups and isolated restore drills. Ask them to confirm the latest off-server backup and successful restore test.</p><p className="small muted">This page does not claim a backup exists or that the server is ready for production. Provider acceptance and recovery checks are separate.</p></section>