Townlight Windows 1.10.0.1

Windows 1.10.0.1

Printable PDF · Editable Word

Townlight 311, Communications, and Parks — Operator, Admin, and Integration Guide

Status and scope

Release Windows 1.10.0.1, runtime 0.4.0.

This guide covers setup and daily use of Townlight 311, Communications and Parks on Windows.

Download the signed Windows installer.

See the Windows acceptance record for hosted Windows and two-PC results.


1. Roles and module access

The existing native roles are:

The supplied role maps in desktop/src-tauri/src/auth.rs and records/backend/townlight_records/auth/desktop_session.py agree on module access.

Role Module access Notes
local-admin All profile modules The source role map returns unrestricted access (None). This includes Records and Code when the active profile mounts them. The first Townlight admin uses this role. Administrative actions such as staff-user creation, disable/reactivate, and passcode reset are gated by the admin session check.
city-staff All profile modules The source role map returns unrestricted access (None). This includes Records and Code when the active profile mounts them. Day-to-day city work is still constrained by the installed profile and configured permissions.
clerk townlight_meetings, townlight_notice, townlight_access, townlight_311, townlight_comms, townlight_parks Clerk has 311, Communications, and Parks workflow access. Clerk does not have townlight_records or townlight_code, and the role map grants no Data receiving/export capability.
records-staff townlight_records only Records-only staff role.
code-staff townlight_code only Code-only staff role.

local-admin and city-staff have all profile-module capabilities. clerk has the six modules listed above. records-staff has Records only. code-staff has Code only. Code is an existing role (code-staff), not an invented role.

Workflow access versus Records/Data administrative capability

Module access is distinct from workflow use. Clerk can operate 311, Communications, and Parks workflows because those modules are present in Clerk’s mapping. That does not grant Clerk the Records module, the Code module, or Data receiving/export capability. A 311 request, Communications article, or Parks maintenance link does not by itself grant Records archive/read-back or Data export. Those capabilities follow the module map and the configured administrative surface.

Records archive/read-back is controlled by townlight_records module access. In the supplied role map, local-admin, city-staff, and records-staff have that module; Clerk and code-staff do not. Code is controlled by townlight_code module access; local-admin, city-staff, and code-staff have that module; Clerk and records-staff do not.

Staff-user creation in auth.rs accepts city-staff, clerk, records-staff, and code-staff. The first admin role is local-admin. Local staff sessions expire after 12 hours and are authenticated with an HMAC session hash stored in local-session.json. The runtime validates the current session, account state, role, expiry, passcode verifier, and per-install session key.


2. Architecture

2. Architecture — diagram 1

The native runtime is private and binds to loopback only. The runtime host is 127.0.0.1; the default runtime port is 15480.

Residents submit through the resident portal into an encrypted command inbox. The outbound host pump applies authenticated resident commands. Durable command identities prevent replay-driven duplication. Queued work is not confirmed until the host applies it.

The public website path is optional and separately deployed. It requires a configured public portal, TLS, and publication/command credentials. The Windows application does not automatically publish a website or configure SMTP.


3. Core workflows

3.1 Townlight 311

Resident flow to staff lifecycle

Resident flow to staff lifecycle — diagram 2

Normal 311 behavior:

Failures and constraints:

Admin limits from the 311 manual:

311 source and API pointers


3.2 Townlight Communications

Draft, exact-revision approval, scheduled publication, correction, and withdrawal

Draft, exact-revision approval, scheduled publication, correction, and withdrawal — diagram 3

Normal Communications behavior:

Publication and delivery:

Records:

Failures and constraints:

Communications Parks source resolver

The Parks communications adapter is implemented in the supplied source at desktop/runtime/python-services/townlight_runtime/communications_parks_sources.py. It resolves Parks sources through the fixed internal application after native proof validation.

Supported source identifiers:

The resolver returns a reference with kind: "parks", the original identifier, revision digest, title, public URL, SHA-256 digest, and eligible: true, plus the captured content. Invalid identifiers return 422; ineligible sources return 404; invalid source responses return 503.


3.3 Townlight Parks

Catalogue, booking, payment, roster, and maintenance flow

Catalogue, booking, payment, roster, and maintenance flow — diagram 4

Normal Parks behavior:

Facility, program, and booking constraints:

Capacity and attendance constraints:

Payments and refunds:

Maintenance and 311:

Records, Data, and private attachments:

Parks failures and constraints:


4. Optional public website and publication integration

The public website is optional and separate. It requires a separately configured public portal, TLS, and command inbox/publication credentials. The Windows application does not automatically publish a website and does not configure SMTP.

4. Optional public website and publication integration — diagram 5

Rules for the optional website path:

Portal TLS and deployment settings:

The portal uses these source-confirmed settings where applicable:

TOWNLIGHT_SECRET_KEY, TOWNLIGHT_DEBUG, TOWNLIGHT_ALLOWED_HOSTS, TOWNLIGHT_CSRF_TRUSTED_ORIGINS, TOWNLIGHT_TRUST_TLS_PROXY, TOWNLIGHT_DB, TOWNLIGHT_STATIC_ROOT, TOWNLIGHT_MEDIA_ROOT, TOWNLIGHT_BRAND, TOWNLIGHT_BASE_URL, TOWNLIGHT_RELEASE_ROOT.

These portal settings are not configured by the Windows installer.

Portal selection contract pointer

The portal lookup calls authenticated:

GET /desktop/v1/portal/selections?request_id=<UUID>

It returns:

{"selections":[{"title":"<public archive title>","selection":{...}}]}

Each selection contains all publication fields with approve_publication: false. Selecting a choice sends request_id, release_copy_id, and archive_id as query parameters and fills the form. Both Meetings and Records permissions remain required.

The portal manual also documents an operator selection file for python manage.py sync_townlight selection.json with fields:

action, approve_publication, archive_id, meeting_id, recording_id, request_id, release_copy_id, expected_release_sha256.

Those identifiers are placeholders in the example. A prepared release copy alone is not public; separate explicit approval authorizes export.


5. Configuration reference

Only environment names present in the supplied source or manuals are listed. This is a configuration reference, not an installation script. Secret values are kept out of this guide.

Native runtime

Name Purpose and constraints
TOWNLIGHT_PRODUCT_PROFILE Selects the product profile. Default in source is records-beta. In the supplied source, the 311, Communications, and Parks routers/repositories are wired under the inspections-preview profile. Other profile values are defined in source.
DATABASE_URL Required. The runtime refuses to start without it. Profiles that require PostgreSQL enforce a PostgreSQL URL.
TOWNLIGHT_PROFILE_ROOT Absolute profile root. Used for config, secrets, queues, and related private state.
TOWNLIGHT_DATA_DIR Alternative data directory input from source. The profile root defaults to its parent when used.
TOWNLIGHT_RUNTIME_HOST Must remain 127.0.0.1. The runtime raises if another host is set.
TOWNLIGHT_RUNTIME_PORT Native runtime port. Default 15480.
TOWNLIGHT_SHARED_STAFF_HOST Set to 1 to install shared staff routing and start the host workers described in source. Without it, unattended host work is not started.
TOWNLIGHT_PUBLISHER_PUBLISH_ORIGIN Canonical website HTTPS origin used by host publication and related workers. Required for the Communications host, resident command pump, and Parks email/catalog work as shown in source.
JWT_SECRET_FILE Secret file path set by the runtime when local secrets are initialized.
FIRST_ADMIN_PASSWORD_FILE Secret file path set by the runtime when local secrets are initialized.
ENCRYPTION_KEY Runtime-held encryption key value/file reference set by the runtime.
TOWNLIGHT_CODE_SOURCE_REGISTRY_DB_URL Set by the runtime from DATABASE_URL for the relevant city-core-style profiles. Code readiness uses it.
TOWNLIGHT_PORTAL_PUBLISHER_TOKEN_FILE Windows-host credential file for portal publication. Restricted absolute file.
TOWNLIGHT_PORTAL_PUBLISHER_TOKEN_SHA256_FILE Website-side digest file for the matching portal publication token. Restricted absolute file.
TOWNLIGHT_NATIVE_ORIGIN Trusted private native runtime origin for the separate portal bridge. HTTPS or loopback HTTP as documented.
TOWNLIGHT_NATIVE_PROOF_FILE Absolute server-only file containing the native session proof. The proof is not sent to the browser. Restricted to the portal service account. Refresh after session expiry, sign-out, account change, or credential change.
TOWNLIGHT_DISPLAY_TIMEZONE Optional IANA display timezone for the portal bridge. Default UTC.
TOWNLIGHT_PORTAL_MAX_BYTES Portal transport maximum. Default 8 GiB, upper bound 64 GiB. This is not the end-to-end recording limit.

Source defaults also include PORTAL_MODE, OLLAMA_BASE_URL, TOWNLIGHT_MEETINGS_OLLAMA_BASE_URL, and TOWNLIGHT_CORE_LLM_PROVIDER. These are configuration references only.

Records, Code, and portal restrictions


6. API and native JSON contract pointers

Runtime health

Source pointer: desktop/runtime/python-services/townlight_runtime/services.py.

311

Communications

Parks

Portal selection and publication


7. Backup, restore, and upgrade references

Back up the database, private files, and keys as a related unit. A database-only backup is incomplete.

Component What to preserve
Native database The database selected by DATABASE_URL, including workflow, audit, ledger, outbox, and queue-related schemas.
Native profile TOWNLIGHT_PROFILE_ROOT, including config/secrets, local session state, publisher queue state, and any profile-backed payment or email settings.
Records and attachments Records archives, private managed files, Parks attachments, Communications attachments, 311 photo bytes, and archive/read-back data.
Communications and Parks outboxes Durable queue work, email outbox state, publisher queue work, and reconciliation state.
Portal The portal database selected by TOWNLIGHT_DB, TOWNLIGHT_MEDIA_ROOT, and TOWNLIGHT_RELEASE_ROOT.
Credentials Portal proof files, publisher token files, token digest files, and native profile secrets. Restricted and protected.

Restore preserves the relationship between durable command identities, ledger entries, queued work, publication state, and Records archives.


8. Troubleshooting

Symptom Source-supported cause and response
Runtime fails with DATABASE_URL must be configured Configure DATABASE_URL. Start through the Townlight supervisor or provide the explicit PostgreSQL URL expected by the profile.
Runtime reports PostgreSQL required The selected profile requires a PostgreSQL DATABASE_URL.
Runtime fails with unsupported product profile Use a profile defined in source.
/health reports degraded with module import error A required module failed to import. Check that the deployed package set matches the installed release and profile.
/health database status is migrations-needed The database is reachable but the task-queue schema is not ready. Apply the explicit migrations for the deployed package set. This guide does not invent a migration CLI.
/ready returns not-ready with domain-inactive The domain application is not active. Verify activation state for the profile and database before expecting domain routes to serve.
311, Communications, or Parks refuses to start Check the corresponding package migrations. The supplied source refuses to start service requests, Communications, or Parks when their migrations are not ready.
Code readiness reports a Code schema problem Check the Code source-registry readiness and the profile. code-staff is the Code-only role; local-admin and city-staff also have Code when the profile mounts it.
Email state stays queued Queued is pending, not SMTP accepted. The host worker must apply the work. Verify TOWNLIGHT_SHARED_STAFF_HOST=1 and the relevant host configuration.
Email state is uncertain Status is unknown after a send was attempted. Reconcile with the mail path and durable outbox state.
Website publication stays queued or retrying The website has not confirmed the action. The host delivers queued copies and withdrawals after staff sign out. Refresh the meeting/publication status before treating a copy or withdrawal as live.
Portal publication credentials fail Verify the Windows token file, website digest file, canonical HTTPS origin, TLS trust, and header preservation on /townlight/v1/publications/. Rotate the matching files to replace the token; remove the digest file to revoke delivery.
Resident command pump or Communications host does not start Check TOWNLIGHT_SHARED_STAFF_HOST=1 and TOWNLIGHT_PUBLISHER_PUBLISH_ORIGIN, plus the required repository and email settings shown in source.
Parks payment stays ambiguous Provider return URLs are not payment proof. Verify the provider transaction, amount, currency, and obligation identity. Reconcile before retry. No live charge is verified by release acceptance.
Parks waitlist promotion or attendance retried Durable command identity and idempotent check-in prevent duplicates. If the result is unclear, inspect durable state rather than repeating the action.
Shutdown reports a worker did not stop cleanly The runtime raises after attempting to stop product threads. Restart after checking durable queue and provider state. A resumed job is not delivery evidence.

9. Acceptance and factual notes