Commit Graph
100 Commits
Author SHA1 Message Date
F4ilji a18765aafa feat(vikon): merge update buttons into single flow with all parts selected by default 2026-07-05 13:10:49 +05:00
F4ilji af86841ebc feat(vikon): improve part update UI with per-part status indicators and Russian messages 2026-07-05 12:53:44 +05:00
F4ilji 08c04c5615 feat(vikon): show disabled modules with warning instead of hiding them 2026-07-05 12:34:44 +05:00
F4ilji efce5be699 fix(vikon): use moduleData['id'] instead of array key, handle additional_access_flags 2026-07-05 12:25:15 +05:00
F4ilji 97c4ab99f1 debug(vikon): log raw API response structure for parts mapping 2026-07-05 12:19:14 +05:00
F4ilji a162154f70 fix(vikon): cast API module IDs to int for Vue compatibility 2026-07-05 12:12:04 +05:00
F4ilji 0a5f99e6ae refactor(vikon): remove hardcoded module IDs and use config everywhere 2026-07-05 11:40:02 +05:00
F4ilji 8cf195efb0 refactor(vikon): fetch parts from VIKON API instead of hardcoded config 2026-07-05 11:32:54 +05:00
F4ilji 9a9521c570 fix(vikon): initialize selectedParts arrays to prevent crash on checkbox click 2026-07-05 11:11:24 +05:00
F4ilji af1fb094d2 fix(vikon): check HTTP status instead of JSON field for part generation check 2026-07-05 10:55:37 +05:00
F4ilji 3d9982e5be fix(vikon): handle numeric status codes from VIKON API (1=completed, -1=failed) 2026-07-05 10:46:02 +05:00
F4ilji 2bf2f4a861 fix(vikon): send POST data as form-urlencoded to match VIKON API expectations 2026-07-05 10:31:40 +05:00
F4ilji e83cd0109d fix(vikon): correct VIKON API endpoint names for part updates 2026-07-05 10:21:27 +05:00
F4ilji d83364432e feat(vikon): replace part select with checkboxes for multi-selection 2026-07-05 09:55:45 +05:00
F4ilji 11b2def517 test(vikon): add validateFileTypes mock to UpdatePartActionTest 2026-07-05 03:02:03 +05:00
F4ilji e8e36156e9 fix(vikon): add file type validation and temp cleanup in UpdatePartAction 2026-07-05 03:01:12 +05:00
F4ilji 059705d60d test(vikon): add feature tests for part update endpoint 2026-07-05 02:58:32 +05:00
F4ilji 1d423adc12 feat(vikon): add part selection UI to Vue dashboard 2026-07-05 02:52:50 +05:00
F4ilji b259809960 feat(vikon): add updatePart endpoint with request validation 2026-07-05 02:50:41 +05:00
F4ilji 15f72b4de1 feat(vikon): add restoreAfterFail for crash recovery in FilesystemTask 2026-07-05 02:47:40 +05:00
F4ilji da90011ad3 feat(vikon): add UpdatePartAction for partial module updates 2026-07-05 02:45:47 +05:00
F4ilji 514123a19f feat(vikon): add parts config for partial updates 2026-07-05 02:42:51 +05:00
F4ilji 4764d4e2d9 feat(vikon): add PollPartStatusTask for part update polling 2026-07-05 02:41:23 +05:00
F4ilji a624b83f18 feat(vikon): add atomicSwap to FilesystemTask for crash-safe updates 2026-07-05 02:35:25 +05:00
F4ilji 982e80027d docs: add partial updates implementation plan 2026-07-05 02:31:27 +05:00
F4ilji 5c081261b0 docs: add partial updates design spec for VikonIntegration module 2026-07-05 02:29:18 +05:00
F4ilji cc69c3566b docs: add dashboard error page final report and plan 2026-07-05 01:21:39 +05:00
F4ilji df6110adf8 feat(dashboard): modify exception handlers to render DashboardError for dashboard routes 2026-07-05 01:19:04 +05:00
F4ilji a4fef0bb3d feat(dashboard): add DashboardError.vue with full error context display 2026-07-05 01:18:04 +05:00
F4ilji e3511462f7 fix(vikon): skip existing files during FM sync, match original PHP diff behavior
Original vikon_core sync_root_dir.php only downloads files that are
missing locally or have size 0. Added local file size check before
downloading to avoid re-fetching 14GB+ of existing files.
2026-07-04 23:25:59 +05:00
F4ilji b538b4119f fix(vikon): all FM files go to files/ dir, matching original PHP getFsPathByModule
Original vikon_core Path::getFsPathByModule() returns moduleRoot/files/,
not moduleRoot. Root FM files, 3-letter subdirs, and new files all go
under files/ directory. index.html etc come from core ZIP, not FM sync.
2026-07-04 23:02:43 +05:00
F4ilji cccdbbbbd8 fix(vikon): keep ZIP and extracted files in temp after update 2026-07-04 22:41:39 +05:00
F4ilji a33d93e163 fix(vikon): root files to module root, 3-letter dirs to files/{code}/
- UpdateCoreAction: split syncDirFiles into syncRootDir (→module root)
  and syncSubDir (→files/{dirId})
- SyncFilesAction: same split, matching original PHP vikon_core behavior
- index.html, file_stubs/ etc go to module root
- 3-letter FM codes (eib, eid, rir) go inside files/
2026-07-04 22:40:30 +05:00
F4ilji a7d0628a13 fix(vikon): use module root as FM sync base path instead of files/ subdir
Root files (index.html, file_stubs/) and non-3-letter directories now go
to module root where VIKON expects them, not into files/ subdirectory.
dir_name from FM API is relative to module root.
2026-07-04 22:31:10 +05:00
F4ilji bf3bcc4eca fix(vikon): revert syncDirFiles - keep 3-letter dirIds as subdirectories 2026-07-04 22:18:20 +05:00
F4ilji c4314e2f43 fix(vikon): use getFileByIdentityInfo dir_name for correct file paths 2026-07-04 22:15:59 +05:00
F4ilji d7c9de2bd6 fix(vikon): restore syncDirFiles subdirs - files go to files/{dirId}/ 2026-07-04 21:55:29 +05:00
F4ilji 241ac576fe fix(vikon): revert syncDirFiles - save files directly in files/ without subdirs 2026-07-04 21:52:21 +05:00
F4ilji 997ef6d483 fix(vikon): syncDirFiles saves to correct subdirectory, increase timeouts to 600s 2026-07-04 21:49:17 +05:00
F4ilji b115cb93fd fix(vikon): increase nginx fastcgi_read_timeout to 600s, PHP set_time_limit 600 2026-07-04 21:40:51 +05:00
F4ilji 204e31c06d fix(vikon): show detailed error message with HTTP status code 2026-07-04 21:33:20 +05:00
F4ilji 87732720ef feat(vikon): merge core update + FM sync into single Update button 2026-07-04 21:25:29 +05:00
F4ilji 20382da0bc fix(vikon): rewrite SyncFilesAction - always download, add logging 2026-07-04 21:11:00 +05:00
F4ilji 0811c4f1fc fix(vikon): add parameter to SyncFilesAction singleton 2026-07-04 20:55:14 +05:00
F4ilji 8e5f26da8d feat(vikon): add file sync from VIKON file manager (FM) 2026-07-04 20:41:49 +05:00
F4ilji e64f9cca83 fix(vikon): save ABITUR API response in temp for reference 2026-07-04 20:26:25 +05:00
F4ilji b4829492e5 fix(vikon): keep ZIP archive in temp after update 2026-07-04 20:17:33 +05:00
F4ilji d358e6fdb0 fix(vikon): keep downloaded files in temp after update 2026-07-04 20:16:56 +05:00
F4ilji b6140b77f5 vsoko conf changes 2026-07-04 20:03:19 +05:00
F4ilji b94e0aad87 fix(vikon): replace router.reload with alert after update success 2026-07-04 19:37:49 +05:00
F4ilji e0cf362433 fix(vikon): create target directories before rename in syncFiles 2026-07-04 19:29:50 +05:00
F4ilji 0097a803b4 fix(vikon): sync from extracted subdirectory inside ZIP 2026-07-04 19:21:32 +05:00
F4ilji 7d6b1a2342 fix(vikon): return actual error message in updateModule response 2026-07-04 19:16:43 +05:00
F4ilji 13df1c3a64 fix(vikon): simplify syncFiles - just overwrite, no backups or deletes 2026-07-04 19:11:25 +05:00
F4ilji 93bd3963bf fix(vikon): use rename() instead of copy() for syncFiles - atomic, no extra disk space 2026-07-04 19:09:13 +05:00
F4ilji e502225e9c fix(vikon): clean up corrupted CheckAccessAction file 2026-07-04 19:01:05 +05:00
F4ilji 44abdb471f fix(vikon): check writability only for module dirs (sveden, abitur, vsoko) 2026-07-04 18:46:23 +05:00
F4ilji cb9639f10f fix(vikon): fix excluded dirs matching for public/build and public/vikon_core 2026-07-04 18:45:34 +05:00
F4ilji 4cc3505050 fix(vikon): exclude non-writable dirs from access check (vendor, build, vikon_core) 2026-07-04 18:34:19 +05:00
F4ilji 11b145861d fix(vikon): use vikon_core redirect_uri in oauthCallback to match VIKON server registration 2026-07-04 18:28:34 +05:00
F4ilji 7b9cf25631 fix(vikon): skip authenticate call on OAuth callback, tokens already saved server-side 2026-07-04 18:22:51 +05:00
F4ilji 90d7cbc270 fix(vikon): redirect OAuth callback to /dashboard/vikon-updates/callback 2026-07-04 18:14:53 +05:00
F4ilji 3424553d39 fix(nginx): allow vikon_core/update/index.php for OAuth callback 2026-07-04 18:11:49 +05:00
F4ilji 15dd66b636 fix(vikon): register vikon.refresh in correct HttpKernel (Ship) 2026-07-04 17:55:53 +05:00
F4ilji 5600f21937 fix(vikon): rename authorize() to getAuthUrl() to avoid parent conflict 2026-07-04 17:46:14 +05:00
F4ilji 3dc29d44d8 fix(vikon): DNS bypass, OAuth callback, ABITUR init, token cache, ZIP security
- Add CURLOPT_RESOLVE DNS bypass for db-nica.ru / file.db-nica.ru
- Add OAuth callback route with CSRF state validation
- Add /authorize endpoint to generate OAuth URL with state
- Add ABITUR special case: init empty module core without ZIP download
- Add token validation caching (150s) to reduce API calls
- Block PHP/PHTML/PHAR files inside ZIP before extraction
- Add VikonTokenRefresh middleware for auto token refresh
- Add vikon.refresh middleware alias to Kernel
2026-07-04 17:44:50 +05:00
F4ilji 93721fc5ae fix(vikon): use correct VIKON API endpoints
- CheckAccessAction: pull_updates/assist/getModulesTreeAsync (not checkAccessJson)
- CheckVersionAction: pull_updates/assist/getUpdateVersionJson (not getLatestVersion)

These are the actual endpoints used by the original vikon_core update.js
2026-07-04 13:57:17 +05:00
F4ilji 967db81d3c fix(vikon): use correct token introspect endpoint for update system
Original vikon_core security.php validates tokens via:
  POST db-nica.ru/oauth2/resource/token/introspect
  Body: client_id=542&access_token=XXX

Our code was incorrectly using:
  GET auth.db-nica.ru/api/profile_applicant/check_access_token
  Header: Authorization: Bearer XXX

This was the WRONG endpoint — the profile check is for abitur forms,
not for the update system.
2026-07-04 13:54:56 +05:00
F4ilji a963647770 fix(vikon): use form-encoded POST + correct domain for OAuth token exchange
- HttpTask::post() now sends application/x-www-form-urlencoded (not JSON)
- AuthenticateAction sends to db-nica.ru (not auth.db-nica.ru) matching original vikon_core
- Original code: remoteRequest($apiDomen . 'oauth2/authorize/token', ...)
2026-07-04 13:46:49 +05:00
F4ilji 2ccfb24d1d fix(vikon): use vikon_core redirect_uri for OAuth (registered on VIKON server)
- vikon_core/update/index.php now redirects OAuth callback to /dashboard/vikon-updates
- Vue frontend sends redirect_uri=https://www.ntspi.ru/vikon_core/update/index.php
- This URL is registered on db-nica.ru for client_id=542
2026-07-04 13:43:42 +05:00
F4ilji 94e17dfbbc fix(vikon): use api_domain for OAuth authorize URL (not auth_domain)
Original vikon_core used db-nica.ru for /oauth2/authorize, not auth.db-nica.ru.
This was causing 'Client authentication failed' error.
2026-07-04 13:33:39 +05:00
F4ilji ba99b2a093 fix(vikon): switch validateFileTypes from blacklist to whitelist
Based on actual file analysis of sveden/abitur/vsoko modules:
- html, css, js, map (content + assets)
- png, jpg, gif, svg, ico, bmp (images)
- ttf, woff, woff2, eot (fonts)
- pdf, doc, docx (documents)
- vikon (module-specific)

No PHP/ASP/executables in allowed list — any non-whitelisted file is blocked.
2026-07-04 13:21:54 +05:00
F4ilji f4f8bc8e77 feat(vikon): rewrite VikonIntegration from scratch — OAuth + core update
- HttpTask: Laravel Http facade with SSL enabled, retry, timeout
- ValidateTokenTask: token check via auth.db-nica.ru
- RefreshTokenTask: token refresh via db-nica.ru
- FilesystemTask: path traversal protection, blocked extensions (PHP/ASP/etc)
- AuthenticateAction: OAuth2 code→token exchange
- CheckAccessAction: token validation + filesystem writability check
- CheckVersionAction: version comparison against remote API
- UpdateCoreAction: ZIP download, Zip Slip protection, atomic sync with rollback
- VikonController: thin controller, 7 endpoints with Session-based token storage
- Routes: access-check, dashboard.auth, throttle:30,1 middleware
- Vue 3 Composition API frontend with progress bar
- Config: all secrets in .env via config/vikon.php
- vikon_core kept as fallback (not deleted)
2026-07-04 12:53:28 +05:00
F4ilji 82df1210c2 feat(vikon): add config/vikon.php with module definitions 2026-07-04 12:41:22 +05:00
F4ilji 47aac647ac feat(vikon): remove broken VikonIntegration container - starting fresh 2026-07-04 12:40:41 +05:00
F4ilji 67b9aae961 feat(ci): add migration rollback and remove duplicate chown in Jenkinsfile
- Save pre-deploy SHA before git pull for automatic rollback
- On migrate failure: git reset + migrate:rollback + reinstall deps + restart
- Remove duplicate chown from Restart Services stage (already in Fix Permissions)
- Clean up .deploy_prev_sha after deploy completes
2026-07-03 09:57:34 +05:00
F4ilji 282d5a7c38 Add email attachments cleanup (older than 3 days) 2026-07-02 23:12:29 +05:00
F4ilji d1f216d04a Reduce backup retention to 3 days 2026-07-02 22:31:18 +05:00
F4ilji bb04a1af14 Add DB backup stage before deploy 2026-07-02 22:22:27 +05:00
F4ilji dcb0426264 Fix prod nginx: ^~ for Jenkins proxy 2026-07-02 21:48:07 +05:00
F4ilji b877153f3f Fix: use ^~ for Jenkins to override regex static locations 2026-07-02 21:46:15 +05:00
F4ilji db968ad9b0 Simplify Jenkins proxy: remove port exposure, add proxy_redirect 2026-07-02 21:43:56 +05:00
F4ilji acae8ae59d Fix: use ^~ for Jenkins static assets to override regex 2026-07-02 21:42:16 +05:00
F4ilji b041558cc3 Fix Jenkins proxy: separate static assets location 2026-07-02 21:41:32 +05:00
F4ilji c807947968 Fix Jenkins proxy with sub_filter for static assets 2026-07-02 21:40:29 +05:00
F4ilji e0ceecf157 Add Jenkins prefix /jenkins for nginx proxy 2026-07-02 21:39:35 +05:00
F4ilji aff60841b4 Add Jenkins proxy to test nginx config 2026-07-02 21:38:29 +05:00
F4ilji ba362902e6 Add Jenkins reverse proxy via nginx 2026-07-02 21:36:23 +05:00
F4ilji f652308421 Add jenkins service to docker-compose.yml 2026-07-02 21:15:27 +05:00
F4ilji d87bc581d1 Fix: remove dead placeholder view path in AppServiceProvider 2026-07-02 20:56:37 +05:00
F4ilji acef609a2f Fix composer open_basedir restriction 2026-07-02 20:54:14 +05:00
F4ilji 44ad8ef460 Fix: use docker exec instead of docker compose to avoid container name conflicts 2026-07-02 20:53:04 +05:00
F4ilji 25bc144ac7 Add Jenkinsfile for CI/CD pipeline 2026-07-02 20:51:45 +05:00
F4ilji 709c51ea49 remove: all deploy UI/backend code, keep _deploy folder only
- Delete DeployRunCommand, DeployController, deploy API routes
- Delete Dashboard/Deploy Vue pages and components
- Remove deploy route from web.php
- Remove deploy quick action from config
- Remove DeployRunCommand from ConsoleKernel
2026-07-02 17:36:42 +05:00
F4ilji c8693b8f0e fix: replace web middleware with minimal session+CSRF stack for deploy API 2026-07-02 17:34:27 +05:00
F4ilji 48ffd217b8 fix: secure deploy API, remove Docker-in-Docker, add DB backup
- Add web+superadmin middleware to /api/deploy routes
- Return JSON 403 in EnsureUserIsSuperadmin for API requests
- Remove Docker CLI and docker.sock from app container
- Replace docker compose restart with supervisorctl
- Add mysqldump backup step before migrations
2026-07-02 17:26:38 +05:00
F4ilji 6ed11cab2d change 2026-07-02 17:11:38 +05:00
F4ilji fce1d3f454 fix: proper route structure - API in api.php, web in web.php 2026-07-02 17:10:44 +05:00
F4ilji b2fec84080 fix: empty api.php since deploy routes moved to web 2026-07-02 17:05:55 +05:00
F4ilji 8b312e0ecd fix: move deploy API routes to web group with session auth 2026-07-02 17:01:32 +05:00