Diff -- /var/www/vhosts/3dshawn.com/site1/MODS/Urls.pm
Diff
/var/www/vhosts/3dshawn.com/site1/MODS/Urls.pm
added on local at 2026-07-10 18:57:30
Added
+50
lines
Removed
-0
lines
Context
0
unchanged
Blobs
from
to 55e67315b8b3
to 55e67315b8b3
Unified diff
Naive LCS-based line diff. Additions in emerald, deletions in rose. Both sides decompressed live from BLOB_STORE.| 1 | package MODS::Urls; | |
| 2 | #====================================================================== | |
| 3 | # DriftSense -- URL registry. | |
| 4 | # | |
| 5 | # Templates reference these by key via [url:keyname]. Change a URL in | |
| 6 | # one place, every template + CGI that links to it updates. | |
| 7 | # | |
| 8 | # NOTE: v1 hardcoded '/shawn/misc/sys_mon/' as a URL prefix, which was | |
| 9 | # fine when it was a private tool. DriftSense ships as a product served | |
| 10 | # at the docroot of a dedicated install, so URLs are root-relative. | |
| 11 | #====================================================================== | |
| 12 | use strict; | |
| 13 | use warnings; | |
| 14 | use MODS::RandCode; | |
| 15 | ||
| 16 | my $randcode = MODS::RandCode->new; | |
| 17 | ||
| 18 | sub new { return bless({}, shift); } | |
| 19 | ||
| 20 | sub urls { | |
| 21 | # Append a random 5-char nocache param so browsers don't stale-cache CGI output. | |
| 22 | my $nc = 'c=' . $randcode->generate(5); | |
| 23 | ||
| 24 | return { | |
| 25 | # --- Monitor pages --- | |
| 26 | dashboard => "/dashboard.cgi?$nc", | |
| 27 | file_changes => "/file_changes.cgi?$nc", | |
| 28 | schema_changes => "/schema_changes.cgi?$nc", | |
| 29 | table_locks => "/table_locks.cgi?$nc", | |
| 30 | named_releases => "/named_releases.cgi?$nc", | |
| 31 | db_fails => "/db_fails.cgi?$nc", | |
| 32 | file_history => "/file_history.cgi?$nc", | |
| 33 | file_search => "/file_search.cgi?$nc", | |
| 34 | blob_download => "/blob.cgi?$nc", | |
| 35 | ||
| 36 | # --- Configuration pages --- | |
| 37 | databases => "/databases.cgi?$nc", | |
| 38 | file_monitors => "/file_monitors.cgi?$nc", | |
| 39 | servers => "/servers.cgi?$nc", | |
| 40 | containers => "/containers.cgi?$nc", | |
| 41 | settings => "/settings.cgi?$nc", | |
| 42 | ||
| 43 | # --- API endpoints (agents / integrations, no nocache) --- | |
| 44 | api_ingest_file => '/api/ingest_file.cgi', | |
| 45 | api_ingest_sql => '/api/ingest_sql.cgi', | |
| 46 | api_heartbeat => '/api/heartbeat.cgi', | |
| 47 | }; | |
| 48 | } | |
| 49 | ||
| 50 | 1; |