Multi-site distribution readiness: settings-driven site config, security closeout, release engineering, v0.5.0
Make the app distributable to other GE Aerospace sites (one self-hosted
instance per site, ADR-004). GE values remain the shipped defaults; every
site-specific behavior is now a Setting an admin can change in the UI.
Settings-driven site config:
- Branding: site/QR/badge logos, favicon, primary color (upload endpoints
mirror the map-blueprint pattern; new Settings > Branding section).
- ServiceNow: search/incident/change URL templates ({ticket}), ticket
prefixes, enable toggle. Defaults point at the current
geaerospaceqa.service-now.com global search. Disabled = plain-text tickets.
- Employee-id regex (employeeid_pattern), printer hostname template,
QR label targets (qr_target_printer / qr_target_usb, blank = asset page,
else URL template with placeholders), usb_label_style (barcode|qr).
- West Jefferson floor-plan PNGs removed from the tree; generic placeholder
ships as the map default and sites upload their own blueprint.
Security closeout:
- dashboarddefaults writes now require admin.
- Collector: generic error messages (no str(exc) leak); API key accepted
via X-API-Key header only (BREAKING: querystring api_key removed).
- IP-based login rate limiting (AUTH_RATELIMIT_* knobs) atop account lockout.
- Setting.set() creation race fixed (IntegrityError retry).
Release engineering and docs:
- __version__ 0.5.0 (distinct from __contract_version__, ADR-007),
CHANGELOG.md, Gitea Actions CI config, frontend version aligned.
- One wizard-first install story across README/DEPLOY; new CONFIG.md,
UPGRADE.md, BACKUP-RESTORE.md; CLAUDE.md and ROADMAP de-staled.
- Dockerfile multi-stage build now bundles the frontend; compose binds
MySQL to 127.0.0.1; stale database/schema.sql and one-off SQL removed.
Debt and fixes:
- .query.get() -> db.session.get() sweep; datetime.utcnow() removed
(naive-UTC via timezone-aware now); users.py on authz decorators.
- Fixed 4 stale tests (slides feed shape, shopfloor splitperemployee,
plugin contract purity) and the USB label page field mapping (both usb
modes emit the cmmc shape: device_id/device_desc).
- Health endpoint reports the real version.
248 tests pass; naming/style check green; frontend builds; fresh-DB
flask db upgrade + seeds verified; QR targets verified by decoding
rendered codes.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
16
scripts/migration/one-offs/README.md
Normal file
16
scripts/migration/one-offs/README.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# One-off migration scripts (historical)
|
||||
|
||||
These are hand-run SQL scripts kept for reference. They are NOT part of the
|
||||
Alembic chain (`migrations/versions/`) and are not run by `flask db upgrade`. A
|
||||
fresh install never needs them; they exist for databases that predate the
|
||||
corresponding change.
|
||||
|
||||
- `add_recertification_type.sql` - inserts the blue "Recertification"
|
||||
notification type into an already-existing database. Historical: the
|
||||
notifications plugin now seeds this type on install
|
||||
(`plugins/notifications/plugin.py`), so any fresh install already has it. Only
|
||||
a pre-existing DB that was never re-installed needs this script. Idempotent.
|
||||
|
||||
A related one-off, widening `notifications.employeesso` / `employeename` to
|
||||
TEXT, has been removed because it is fully superseded by Alembic migration
|
||||
`7d02_widen_notification_employee_cols`.
|
||||
21
scripts/migration/one-offs/add_recertification_type.sql
Normal file
21
scripts/migration/one-offs/add_recertification_type.sql
Normal file
@@ -0,0 +1,21 @@
|
||||
-- Recertification notification type (shopdb-flask)
|
||||
--
|
||||
-- Employee-photo type (blue, like recognition) for employees who must retake a
|
||||
-- training course. The shopfloor feed splits it one card per employee and the
|
||||
-- dashboard shows it in a blue "Recertification Required" carousel; the display
|
||||
-- window is two weeks (computed server-side in the notifications API).
|
||||
--
|
||||
-- Idempotent - safe to re-run. The notifications plugin also seeds this type on
|
||||
-- install (plugins/notifications/plugin.py); this file is for databases that
|
||||
-- already exist and are not re-installed.
|
||||
|
||||
INSERT INTO notificationtypes (typename, typedescription, typecolor, isactive)
|
||||
SELECT * FROM (
|
||||
SELECT 'Recertification' AS typename,
|
||||
'Employees due to retake a training course (shows two weeks)' AS typedescription,
|
||||
'recertification' AS typecolor,
|
||||
1 AS isactive
|
||||
) AS t
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM notificationtypes WHERE typename = 'Recertification'
|
||||
);
|
||||
Reference in New Issue
Block a user