Commit Graph

99 Commits

Author SHA1 Message Date
pavlov346346-source
aeca9eae99 fix: lock down caterium-platform-auth-admin CORS to allowlisted origins
This Edge Function grants platform-admin power (list every user across
every workspace, ban/unban accounts, trigger password resets for any
user_id) but answered with Access-Control-Allow-Origin: '*', unlike the
sibling caterium-create-employee function which already uses an origin
allowlist. Authorization itself was never bypassable this way (the
function still requires the caller's own Bearer token and re-checks
sun_is_platform_admin() server-side), but a wildcard CORS response
removes a real layer of defense-in-depth if a platform-admin token were
ever exposed to another origin.

Applies the same allowedOrigin()/corsHeaders() pattern already proven in
caterium-create-employee, and extends edge-security-v1774.mjs (which
already asserted the wildcard was gone from create-employee, but never
checked this function) to cover both.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-12 14:09:16 +03:00
pavlov346346-source
4106452f56 fix: stop the menu-editor button-patch interval once it succeeds
setupOldButton() polled the DOM every 4s forever after the menu editor
first opened, with no way to ever stop - the interval id was not even
kept in a variable. It now returns whether the button was found, the
interval only starts when the first attempt fails, and clears itself
on the first successful attempt (also wired into the existing
disconnect() cleanup alongside the other timers).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-12 14:09:06 +03:00
pavlov346346-source
a08633f9d0 perf: stop recomputing the full client list per client on bulk push
pushAllClients() already has every client profile from its own
listClients() call, but looped through pushClient(key) -> getClient(key)
-> listClients() again for each one - N clients meant N+1 full
order-history recomputations instead of one. pushClient now accepts an
optional already-known profile so the bulk path skips the redundant
lookup; single-key callers (scheduleServerPush's debounce) are
unaffected.

compareClientSources() had the same shape of duplicate work: it called
buildClients()/serverListClients() directly and then again inside
mergeClientSources(). mergeClientSources() now accepts already-computed
local/server arrays instead of always recomputing both.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-12 14:08:57 +03:00
pavlov346346-source
60d00e9f56 fix: correct stale data-layer references in manifest and SW cache
release-manifest.json still pointed "dataLayer" at the removed
data-layer-v1771.js instead of the actually-loaded v1773.

service-worker.js's offline cache list never included
auth-security-v1774.js, order-enhancements-v1775.js or
login-signature-v1776.js despite performance.js loading all three at
runtime - PWA/offline mode could serve a stale or missing module.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-12 14:08:47 +03:00
pavlov346346-source
a98e636937 fix: gate production promotion on QA success; remove dead data-layer files
promote-production.yml triggered on push to main independently of
qa.yml, with no branch protection configured on the repo - a failing
QA run (npm audit, static security tests, e2e) never blocked
production. Switch it to the same workflow_run pattern deploy-timeweb.yml
already uses: only promote the exact commit QA just passed.

Also removes public/core/data-layer-v1770/1771/1772.js: only v1773 is
ever loaded (index.html, performance.js's loadDataLayer, service-worker
cache all reference v1773 only) - the older three were dead weight
shipped to every visitor.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-12 14:08:38 +03:00
pavlov346346-source
da406a0a2f ci: verify refreshed Timeweb PWA cache 2026-09-12 08:14:53 +03:00
pavlov346346-source
311aeefd75 ci: verify Timeweb pull deployment 2026-09-12 07:09:56 +03:00
pavlov346346-source
15dbbc71af fix: show Signature auth from first frame 2026-09-12 03:42:43 +03:00
pavlov346346-source
3682b908e9 fix: make Signature the native Caterium auth screen 2026-09-12 03:41:58 +03:00
pavlov346346-source
6b33f133e9 merge: sync Timeweb production before Signature login rollout 2026-09-11 19:20:11 +03:00
pavlov346346-source
ea9f60103a ci: keep Timeweb hosting deployment workflow 2026-09-11 19:19:51 +03:00
pavlov346346-source
f25232aaed feat: load Caterium Signature login screen 2026-09-11 19:19:12 +03:00
pavlov346346-source
0bf737d2ec feat: add Caterium Signature login design 2026-09-11 19:18:39 +03:00
pavlov346346-source
40470b15e6 Add safe Timeweb hosting deployment workflow 2026-09-11 16:54:22 +03:00
pavlov346346
88b7f55db4 Ops: add self-hosted Supabase stack for Timeweb Cloud migration
Full production-ready docker-compose stack (db, kong, auth, rest,
realtime, storage, imgproxy, meta, functions, studio) targeting
api.caterium.ru, plus bootstrap script for a fresh Cloud Server,
Caddy reverse-proxy config (HTTPS, WebSocket, upload limits), and
dump/restore/verify/storage-sync scripts for moving off the managed
Supabase project (cksuehzcimitsxmeloes). Does not touch public/ or
any live runtime behavior — frontend cutover is documented separately
in frontend-cutover.md and only applied after Etap 8 verification.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-11 16:20:45 +03:00
pavlov346346-source
62c37ebc2d chore: remove temporary Supabase proxy package 2026-09-11 16:07:13 +03:00
pavlov346346-source
50f3e1b249 chore: remove temporary Supabase proxy 2026-09-11 16:06:57 +03:00
pavlov346346-source
18ef6a2e45 feat: add restricted Supabase reverse proxy for Timeweb 2026-09-11 15:56:35 +03:00
pavlov346346-source
a206cfd1f1 feat: add Timeweb Supabase proxy package 2026-09-11 15:56:18 +03:00
pavlov346346-source
d73c90917f style: make order comment button compact 2026-09-11 15:28:09 +03:00
pavlov346346-source
a4a698f332 test: remove reminder requirements from order enhancements 2026-09-11 15:21:32 +03:00
pavlov346346-source
232222c7a7 fix: remove order reminders UI and notification logic 2026-09-11 15:21:13 +03:00
pavlov346346-source
a7e95db66b fix: show comment button under every order position 2026-09-11 14:55:46 +03:00
pavlov346346-source
bd0d9f2cbe ci: publish main to production immediately during active development 2026-09-11 14:55:20 +03:00
pavlov346346-source
1e648c90ac
Fix visible comments on order positions 2026-09-11 14:37:16 +03:00
pavlov346346-source
9bf75ccf11
Add order comments, reminders, search and delivery totals
Add per-line comments, day/hour order reminders, catalog search by number/name, and delivery-inclusive financial summary. Includes static regression checks.
2026-09-11 14:27:17 +03:00
pavlov346346-source
dbbc416676
Fix incorrect order totals from hidden orphan lines
* chore: add one-time order total repair

* fix: exclude hidden orphan lines from totals [order-total-fix]

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-11 13:19:24 +03:00
pavlov346346-source
d5265a1c11
Merge pull request #24 from pavlov346346-source/fix/caterium-branding-v1774
Finish Caterium visible branding
2026-09-11 10:06:01 +03:00
pavlov346346-source
3977fd5f0f test: include Caterium branding checks 2026-09-11 10:03:45 +03:00
pavlov346346-source
1e92a56085 test: guard Caterium visible branding 2026-09-11 10:03:35 +03:00
pavlov346346-source
6ece9ed21e brand: update PWA identity to Caterium 2026-09-11 10:03:25 +03:00
pavlov346346-source
8625f2f532 chore: remove one-time branding repair workflow 2026-09-11 10:03:07 +03:00
github-actions[bot]
b82b2cb8d0 brand: replace visible legacy name [branding-repair] 2026-09-11 07:02:38 +00:00
pavlov346346-source
5c3ee9b679 chore: add one-time branding repair 2026-09-11 10:02:29 +03:00
pavlov346346-source
9290cc0103
Merge pull request #23 from pavlov346346-source/fix/edge-import-pin-v1774
Pin employee Edge import map
2026-09-11 09:59:51 +03:00
pavlov346346-source
bca7408f90 test: enforce exact employee edge import pin 2026-09-11 09:57:33 +03:00
pavlov346346-source
29efa95b5d security: pin employee edge import map 2026-09-11 09:57:23 +03:00
pavlov346346-source
81c63b27b0
Merge pull request #22 from pavlov346346-source/docs/production-source-of-truth-v1774
Make Timeweb the production source of truth
2026-09-11 09:56:29 +03:00
pavlov346346-source
785e75eeda ops: make Cloudflare deploy explicit fallback only 2026-09-11 09:37:03 +03:00
pavlov346346-source
2150257158 docs: mark Cloudflare as verified-production fallback 2026-09-11 09:36:55 +03:00
pavlov346346-source
2817717efd docs: make Timeweb production source of truth 2026-09-11 09:36:48 +03:00
pavlov346346-source
5f6e00c49b
Merge pull request #21 from pavlov346346-source/fix/edge-function-hardening-v1774
Harden employee Edge Function boundary
2026-09-11 09:36:00 +03:00
pavlov346346-source
53a8451132 test: guard exact Caterium employee roles 2026-09-11 07:54:37 +03:00
pavlov346346-source
da78e3125e fix: align edge validation with Caterium employee roles 2026-09-11 07:54:22 +03:00
pavlov346346-source
2d4af76983 test: include employee edge hardening checks 2026-09-11 07:53:19 +03:00
pavlov346346-source
0c4830dcc6 test: guard employee edge security boundary 2026-09-11 07:53:03 +03:00
pavlov346346-source
7044d36ae6 security: harden employee edge function boundary 2026-09-11 07:52:54 +03:00
pavlov346346-source
3fd899978b
Fix high-severity npm audit findings
* security: pin wrangler 4.131.0

* chore: refresh lockfile for security update

* security: refresh npm lockfile [npm-lock-refresh]

* chore: remove one-time npm lock refresh workflow

* ci: use locked dependencies and fail on high audit findings

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-11 07:51:06 +03:00
pavlov346346-source
fccea79255
Harden Supabase advisor findings 2026-09-11 07:45:08 +03:00
pavlov346346-source
5e38bf867b
Fix malformed style boundary and guard HTML integrity
* chore: add one-time index html repair script

* chore: run one-time html repair on fix branch

* fix: close mobile style block [html-repair]

* chore: remove one-time html repair workflow

* chore: remove one-time html repair script

* test: add html style integrity checks

* test: enforce html integrity in deploy checks

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-11 07:41:42 +03:00