Commit Graph

84 Commits

Author SHA1 Message Date
Egor Bugaev 9e15c3b96c Add rename-user SQL template; make batch transaction handling robust against non-Postgres backends
- New 'rename-user' template (templates / template rename-user <old> <new>):
  best-effort uid rename across core tables (oc_users, oc_preferences,
  oc_group_user, oc_group_admin, oc_ldap_user_mapping, oc_share, oc_mounts,
  oc_storages). Explicitly NOT a supported Nextcloud operation - the
  generated script carries an in-line warning (as leading SQL comments)
  that app-specific tables (Talk, Calendar, Contacts, Mail, 2FA/WebAuthn...)
  are not covered and that the data directory must be renamed on disk
  manually, followed by occ files:scan --all. Documented the same caveat
  in both READMEs.
- Hardened the round-2 transaction wrapping: beginTransaction()/commit()/
  rollBack() are now wrapped in try/catch. PostgreSQL (our backend) has
  fully transactional DDL so this wasn't actually broken here, but
  Nextcloud also supports MySQL/MariaDB via the same IDBConnection, where
  DDL implicitly commits - on that backend a DDL statement in the batch
  would make a later commit()/rollBack() throw 'no active transaction'
  and previously that exception was unhandled (HTTP 500 instead of a
  clean JSON response). Now: if rollBack() itself fails after an error,
  we report rollbackFailed+warning instead of falsely claiming rolledBack,
  since earlier statements in that batch may already be permanently
  applied. If commit() fails with nothing to commit (already
  auto-committed), that's logged only, since the effects are already
  durably persisted.
2026-07-06 19:52:05 +03:00
Egor Bugaev ca0605706f Security hardening round 2: comment-aware forbidden-pattern check, UPDATE confirmation, transactional batches, quote-aware split (incl. double quotes), NULL-safe table rendering, AJAX timeout, request size limit
- removeAllComments() strips -- and /* */ comments before checking
  FORBIDDEN_PATTERNS, closing a bypass where a comment inserted between
  a function name and '(' hid it from the regex (e.g. pg_read_file/**/(...)).
- UPDATE now requires confirm=true just like DELETE (deleteCount/updateCount).
- Batches run inside a single DB transaction; a failing statement rolls back
  everything already applied in that batch instead of leaving partial writes.
- splitStatements() (PHP and JS) now tracks a single quoteChar instead of a
  bool, handling both '...' strings and "..." quoted identifiers symmetrically.
- Frontend TEMPLATES no longer rely on SET/current_setting: the escaped uid
  is inlined into every statement, so partial copy/paste still works.
- renderTable() renders NULL as [NULL] instead of an empty string, so it's
  no longer visually identical to an empty string value.
- Added MAX_SQL_BYTES (1MB) request size limit, returned as HTTP 413.
- Added a 120s client-side AJAX timeout with a distinct timeout message,
  so a hung request doesn't leave the terminal paused indefinitely.
2026-07-06 19:38:25 +03:00
Egor Bugaev 341165eb38 Add post-clone install.sh (cleanup + chown + occ app:enable), document it in both READMEs 2026-07-06 19:15:09 +03:00
Egor Bugaev e069fdeb52 Expand .gitignore: vendor, node_modules, PHPUnit cache, OS/IDE junk 2026-07-06 19:05:48 +03:00
Egor Bugaev 5c5aa3ec6a Document install-on-a-new-server steps and installed_version sync gotcha 2026-07-06 19:02:30 +03:00
fanategorius 7c09dd2278 Update info.xml 2026-07-06 18:57:32 +03:00
Egor Bugaev 6217ec5405 Pin max-version back to 31 (matches actual installed Nextcloud) to keep update banner suppressed 2026-07-06 18:29:12 +03:00
Egor Bugaev c49bebc73e Set max-version to 50 so occweb doesn't block future Nextcloud update visibility 2026-07-06 18:16:11 +03:00
Egor Bugaev 60c5d2e27c Revert max-version to 31 - occweb hasn't been tested against newer Nextcloud releases 2026-07-06 18:15:01 +03:00
Egor Bugaev 6f4a7ee8ff Update app metadata: author, repo links, and Nextcloud compatibility range 2026-07-06 18:06:08 +03:00
Egor Bugaev 8aaab998a1 Harden SQL mode: block file/program access, audit log, row limit, quote-aware statement splitting 2026-07-06 17:54:36 +03:00
Egor Bugaev d4d1fbcbfc Bump version to 0.2.5 to force asset cache-busting 2026-07-06 17:22:27 +03:00
Egor Bugaev d402da8498 Add SQL query templates and psql-style table output for SELECT 2026-07-06 17:16:47 +03:00
Egor Bugaev ec57fbc633 Document restarting PHP after deploying updates (opcache gotcha) 2026-07-06 17:06:05 +03:00
Egor Bugaev 4d87deb176 Require explicit confirmation before running DELETE statements in SQL mode 2026-07-06 17:03:51 +03:00
Egor Bugaev 07df21aac9 Bump version to 0.2.4, document SQL query mode, add Russian README 2026-07-06 16:47:17 +03:00
fanategorius c1d9494414 Update DbController.php 2026-07-06 16:29:09 +03:00
fanategorius b6849053d2 Update index.js 2026-07-06 16:28:22 +03:00
fanategorius b6ea7b9d92 Update index.js 2026-07-06 16:27:52 +03:00
fanategorius b98df89971 Update index.js 2026-07-06 12:51:15 +03:00
fanategorius 26076df94b Update routes.php 2026-07-06 12:48:34 +03:00
fanategorius f612931480 Create DbController.php 2026-07-06 12:47:24 +03:00
fanategorius 27cf74c5eb Update OccOutput.php 2026-07-06 12:44:41 +03:00
Adphi 5b81c89610 add nextcloud 31 support
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
2025-04-10 15:17:47 +02:00
Zeller 44eb700713 fix: adapt breaking changes of OC\Console\Application constructor 2025-04-10 15:08:06 +02:00
Zeller 33613686ea fix: use LoggerInterface instead of deprecated ILogger in OccController 2025-04-10 15:08:06 +02:00
Adphi f078621a47 add nextcloud 30 support
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
2025-01-22 15:14:29 +01:00
Rahammetoela Toekiman b1159a811a fix Declaration of OCA\OCCWeb\Controller\OccOutput::getErrorOutput() must be compatible
Declaration of OCA\OCCWeb\Controller\OccOutput::getErrorOutput() must be compatible with Symfony\Component\Console\Output\ConsoleOutputInterface::getErrorOutput(): Symfony\Component\Console\Output\OutputInterface at /var/www/html/custom_apps/occweb/lib/Controller/OccOutput.php#22
2025-01-22 15:13:23 +01:00
Rahammetoela Toekiman cc591973a4 fix Too few arguments to function OC\Console\Application::__construct(), 5 passed in /var/www/html/custom_apps/occweb/lib/Controller/OccController.php on line 33 and exactly 6 expected
fix #14 #15 #16 #17
2025-01-22 15:13:23 +01:00
Adphi b5087db81b Version compatibility for nextcloud 29
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
2025-01-22 15:04:34 +01:00
Adphi a8694d1bb5 version v0.2.0: nextcloud 28 as minimum version
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
2024-05-16 18:07:39 +02:00
Adphi c016c442e6 version v0.1.2
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
2024-05-15 15:12:00 +02:00
Rahammetoela Toekiman 50e2b4bbab fix Call to undefined method OC\Server::getEventDispatcher() 2024-05-15 15:05:25 +02:00
Adphi 1e3e6a62ed Makefile: use version from app-info
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
2023-08-22 12:46:39 +02:00
Adphi 66c823195c update links to main branch and remove remaning gogs links
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
2023-08-22 12:33:17 +02:00
Alexander Rose bd74348fde fix tabs in routes.php 2023-08-22 12:22:36 +02:00
Alexander Rose 4f6ef754e2 use reflection to get the list of commands for tab-completion 2023-08-22 12:22:36 +02:00
Alexander Rose 2a25ca725e send empty array on OccController->list() 2023-08-22 12:22:36 +02:00
Adphi e62276b8a9 move repository to github
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
2022-03-08 19:34:39 +01:00
Alexander Rose a8ab035eac update appinfo 2022-03-08 19:31:00 +01:00
Alexander Rose 354086c6db fix application logger 2022-03-08 19:31:00 +01:00
adphi 317c2483d4 deprecation notice 2020-06-20 03:59:38 +02:00
adphi d0c4cd1488 obviously, it's in front of the description 2020-06-20 03:46:31 +02:00
adphi 5a5ba37b69 Deprecated application 2020-06-20 03:44:49 +02:00
Adphi 4fecde9d9d returns error message on exception 2020-02-02 17:54:29 +01:00
Adphi 411e9e800f fix name cases 2020-02-02 13:15:44 +00:00
Adphi 6579503c63 Makefile: added make version 2020-02-01 15:10:33 +01:00
Adphi ad5306cf67 occweb lowercase 2020-02-01 14:54:37 +01:00
Adphi f2d7ff4c14 increment version 2020-01-30 22:05:35 +01:00
Adphi aa2848cfee fix #11 2020-01-30 22:04:23 +01:00