Commit Graph
100 Commits
Author SHA1 Message Date
chris 69d038fe98 Make the mode selection clearer. 2026-09-17 11:10:53 +02:00
chris 5b811260a5 fix: update early signal trap in recover_bad_signature.sh to pass exit code
Line 1003: changed
       to
2026-09-17 00:58:49 +02:00
chrisandClaude Sonnet 4.6 dfacd0ce83 fix/feat: validation improvements and EXIT trap for all bad-signature scripts
fix: treat qpdf exit code 3 (warnings only) as VALID in PDF check
  - exit 0 and exit 3 both map to VALID; only exit 2 is a structural error
  - error detail now includes first matching error line from qpdf output

fix: add EXIT trap so encryption flag and temp files are always cleaned up
  - changed signal trap from  to
  - EXIT fires for any bash exit including syntax errors and unexpected crashes
  - clean_up() now runs  first to prevent re-entry / infinite loop
  - applies to recover_bad_signature.sh (where the flag matters most),
    restore_bad_signature.sh and recreate_bad_signature.sh

feat: check optional validation tools at startup and offer apt install
  - new check_optional_validation_tools() prompts [j/N] in interactive mode
  - covers: imagemagick (identify), ffmpeg (ffprobe), mp3val, flac, vorbis-tools (ogginfo)

feat: use optional tools for deeper file validation when available
  - PNG / GIF / BMP / TIFF: identify -regard-warnings (full decode) with magic-byte fallback
  - MP4 / MOV / M4V: ffprobe -show_streams (container parse) with ftyp-box fallback
  - MP3: new dedicated case — mp3val frame check with ID3/sync-word fallback
  - FLAC: new dedicated case — flac --silent --test with fLaC-signature fallback
  - OGG / OGA / OGV / OPUS: new dedicated case — ogginfo with OggS-signature fallback

Affects: recover_bad_signature.sh, restore_bad_signature.sh, recreate_bad_signature.sh

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GfXh5sRbEaXiEX6KjAPivc
2026-09-16 19:06:03 +02:00
chris 8234c2d9f3 fix: add EXIT trap to ensure encryption flag and temp files are cleaned up on crash 2026-09-16 14:10:47 +02:00
chrisandClaude Sonnet 4.6 8bfc4d04b7 feat(ux): show temp log file paths after YES confirmation in all scripts
After the user confirms with YES, each script now prints the paths of
the two temporary files that are written continuously during the run,
so they can be monitored with tail -f without having to know the paths
by heart. Affects scan_, recover_, restore_, recreate_bad_signature.sh.
recreate shows per-account log file names since it writes one per user.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GfXh5sRbEaXiEX6KjAPivc
2026-09-16 09:20:55 +02:00
chris eef48a9c8d fix(validate): fix unzip hanging on password-protected ZIPs via setsid
unzip -tq on a password-protected archive tries to open /dev/tty to
prompt for the password. Inside a tmux session this generates SIGTTIN,
which stops the process (ps state T). A stopped process cannot receive
SIGTERM, so timeout waited indefinitely for a child that would never exit.

Fix: wrap all unzip calls with setsid so the process runs in a new
session without a controlling terminal. The /dev/tty open then fails
immediately with ENXIO and unzip exits with a non-zero code instead of
blocking. Additional hardening:
- timeout -k 5: send SIGKILL 5 s after SIGTERM as a last resort
- < /dev/null: also cut off stdin as a secondary safeguard
- exit 137 (128+9, SIGKILL) treated as timeout alongside 124
- error output matching "password"/"encrypt"/"need PK compat" reported
  as UNVERIFIED instead of INVALID

Affects: recover_bad_signature.sh, restore_bad_signature.sh,
         recreate_bad_signature.sh
2026-09-16 08:55:50 +02:00
chris 6677f4f0c2 fix(validate): add 120s timeout to unzip integrity checks
unzip -tq can block indefinitely on very large or partially corrupt
ZIP archives (stalls in I/O rather than exiting with a CRC error).
All three scripts that call validate_recovered_file() are affected:
recover_, restore_, recreate_bad_signature.sh.

Both the quick check (unzip -tq) and the verbose error pass (unzip -t)
are now wrapped with `timeout 120`. Exit code 124 (timed out) is
reported as UNVERIFIED with a hint for manual follow-up; any other
non-zero exit is still reported as INVALID with the first error line.
2026-09-16 00:44:02 +02:00
chris b33b859cf2 Fix: Vorzeitiger Abbruch bei großen Accounts nach 3600s Laufzeit
Betroffen: scan_, recover_, restore_, recreate_bad_signature.sh
           und diagnose_share_key.sh

Bei Accounts mit sehr vielen bzw. sehr großen Dateien konnte der
jeweilige Pro-Account-Durchlauf länger als eine Stunde dauern und
wurde dann von PHP mit "Maximum execution time of 3600 seconds
exceeded" abgebrochen - mitten im Lauf, ohne jedes Ergebnis.

- su -c "$PHP_BIN ..." ruft PHP jetzt zusätzlich mit
  -d max_execution_time=0 auf.
- Das allein reicht nicht: Nextclouds eigenes lib/base.php setzt
  beim Bootstrap unbedingt (fest einprogrammiert, nicht
  konfigurierbar) set_time_limit(3600) und überschreibt damit den
  CLI-Flag wieder. Daher zusätzlich direkt nach dem require von
  lib/base.php ein erneutes set_time_limit(0) in jedem der fünf
  eingebetteten PHP-Scripte, das Nextclouds Reset seinerseits
  rückgängig macht.

Kein Verhaltensunterschied für kleine/normale Accounts, betrifft
nur die maximale Laufzeit pro Account.
2026-09-15 21:01:03 +02:00
chris 44f143fbe8 diagnose_share_key.sh: some changes on script output. 2026-09-15 01:17:59 +02:00
chris b1e02b737c Add sone documentation and README's. 2026-09-15 00:27:01 +02:00
chris a8887aeeea delete_files.sh: neues, generisches Script zum gezielten Löschen von Dateien 2026-09-15 00:26:19 +02:00
chris 93e0576777 Some minor changes on scriptb output. 2026-09-15 00:24:31 +02:00
chris 54f16e0a20 occ_scan_bad_signature.sh was replaced by scan_bad_signature.sh 2026-09-14 23:58:32 +02:00
chris f108a71a80 Add Nextcloud bad-signature recovery toolkit 2026-09-14 15:08:53 +02:00
chris c8997cc2e1 Add script 'recover_bad_signature.sh'. 2026-09-11 22:20:59 +02:00
chris 6605d6ab69 scan_bad_signature.sh: add a month-by-month count of bad-signature files, per account and
overall, in both console output and the report file. Helps tell apart
a one-off historical incident from an ongoing/recurring problem.
2026-09-11 14:04:45 +02:00
chris 62417ef150 scan_bad_signature.sh: add period of the finds to the statistics. 2026-09-11 13:54:42 +02:00
chris 94a73f6450 scan_bad_signature.sh: warn if encryption is NOT enabled. 2026-09-11 13:38:14 +02:00
chris dc8948c4de scan_bad_signature.sh: adjust script output. 2026-09-11 13:21:11 +02:00
chris 4e14ee6dbe Add script 'scan_bad_signature.sh'. 2026-09-11 13:13:21 +02:00
chris 94d80c6dfb occ_maintenance.sh: remove LOCK directory if no previos process is running. 2026-04-13 00:07:30 +02:00
chris 6995075721 occ_maintenance.sh: fix error in removing LOCK directory. 2026-04-13 00:03:03 +02:00
chris 81a66209d6 occ_maintenance.sh: Suppress pgrep output in if clause using grep -q . 2026-04-12 22:42:11 +02:00
chris 0ae2bad29b occ_maintenance.sh: don't start if script is already running. 2026-04-12 16:22:02 +02:00
chris 416960f84c update_nextcloud.sh: empty log file at end of the script. 2025-12-20 23:38:21 +01:00
chris 28a7c7aa78 Add script 'get-app-list.sh'. 2025-12-15 21:28:35 +01:00
chris 4ae3118aa8 Fix error in determin systemd support for debian 13 and newer. 2025-12-15 18:05:14 +01:00
chris 09b9273a8d fix error in host configuration. 2025-12-06 13:35:40 +01:00
chris b1f7186090 Support script-driven upgrades for version 32.0.x 2025-12-06 13:02:08 +01:00
chris 7efb678dfb update_nextcloud.sh: reinstall notify_push if this app was installed befor. 2025-12-04 17:13:42 +01:00
chris 3a652d14a1 Add script 'reinstall-notify_push.sh'. 2025-12-04 17:12:52 +01:00
chris c97c7e4163 Add script 'unban-ip-from-redis-cache.sh'. 2025-09-26 13:30:41 +02:00
chris 187310ecb9 Add file 'README.integrity-check'. 2025-07-20 10:42:18 +02:00
chris 793b1b1e1c update_nextcloud.sh: use realpath for data dirctory. 2025-06-20 22:05:33 +02:00
chris b6fd1ab6a3 add-new-account.sh: supprt blank sign in account name. 2025-05-02 18:24:48 +02:00
chris d60a7d5937 update_nextcloud.sh: restart notify_push service if present.. 2025-04-22 17:40:21 +02:00
chris 9346c73f39 A realy smal change on script output. 2025-04-20 02:11:27 +02:00
chris 23edc5828c Add script 'add-new-account.sh'. 2025-04-20 02:07:01 +02:00
chris 73f2f79324 snippets/get-cloud-instance-to-update.sh: a really smal change - remove a blank sign.. 2025-03-30 18:24:15 +02:00
chris 78a10d9169 Add script 'remove-old-nc-installations.sh'. 2025-03-30 18:23:24 +02:00
chris 9893bd4371 restore_nextcloud.sh: some changes in error handling. 2025-03-29 03:06:33 +01:00
chris 00cce38bf1 Add script 'correct-cloud-database-row-format.sh'. 2025-03-28 01:55:32 +01:00
chris 4abff5e4fa update_nextcloud.sh: run 'Migrating the mimetypes' job after update. 2024-10-19 01:43:03 +02:00
chris 6882e48d80 Add 'script occ_migrate_mimetipes.sh'. 2024-08-25 00:35:22 +02:00
chris ab1256f14b update_nextcloud.sh: some changes in script output. 2024-03-31 03:01:42 +02:00
chris a9fb3067df update_nextcloud.sh: start the cronjon manually only on demand. 2023-12-23 02:28:46 +01:00
chris b5a0204dec Some minor changes on script output. 2023-12-18 01:50:28 +01:00
chris ebdccd5c44 occ_maintenance.sh: some minor changes to the script output. 2023-08-05 00:42:42 +02:00
chris 588eb68502 fix error determin configuration file. 2023-08-04 01:39:40 +02:00
chris 2f8d771420 Merge branch 'master' of https://git.oopen.de/script/nextcloud 2023-08-04 01:28:53 +02:00
chris bea755c670 occ_maintenance.sh: fix error determin configuration file. 2023-08-04 01:28:23 +02:00
chris 2c37b04ddf Some post installations on update and restore scripts. 2023-08-03 10:43:06 +02:00
chris d84294cf0b Add snippet 'get-path-of-php-command.sh' and change concerning code.. 2023-08-03 00:11:02 +02:00
chris 1df7bb124b forgot script 'add_user_to_group.sh'.. 2023-08-02 23:19:58 +02:00
chris 14f062908f Rename snippet 'get-php-major-version' to 'get-php-major-version.sh'.. 2023-08-02 23:17:45 +02:00
chris 588cf5ca2e Rename snippet 'get-cloud-instance-to-update' to 'get-cloud-instance-to-update.sh'.. 2023-08-02 23:16:00 +02:00
chris 17eaf8e278 Add snippet 'get-webservice-environment.sh' and change related code.. 2023-08-02 23:05:19 +02:00
chris a335d51975 rename 'check_encryption_scan_legacy-format' to 'check_encryption_scan_legacy-format.sh'. 2023-08-02 14:25:09 +02:00
chris 08a9bc984d add snippet 'get-cloud-instance-to-update'.. 2023-08-02 14:23:46 +02:00
chris f244232347 Move snippet snippet-get-php-major-version into snippet dir and also rename it to 'get-php-major-version'. 2023-08-02 13:13:13 +02:00
chris c0ea4fa6d4 Determin PHP major version also for NGINX hosted nextclouds. Move Determination to separate file. 2023-08-02 12:01:50 +02:00
chris c97ca479b8 hostname.conf.sample: change some file comments.. 2023-08-02 12:00:53 +02:00
chris fb0a3dff2d Add new scripts 'occ_manual_upgrade.sh' and 'occ_update_apps.sh'. 2023-03-04 13:06:47 +01:00
chris f199cc7926 Add scripts for replacing logo and favicon icon. 2023-02-08 17:20:45 +01:00
chris 4e0debbc1e Fix error concerning '
' variable.
2022-07-23 03:28:17 +02:00
chris d7018d7aec different scripts: add '--max_allowed_packet=128M' to mysqldump command. 2022-06-10 03:13:06 +02:00
chris d4d05b76d3 update_nextcloud.sh: add '--max_allowed_packet=128M' to mysqldump command. 2022-06-10 03:00:13 +02:00
chris be414fbc61 Add script 'occ_maintenance.sh'. 2022-02-22 18:19:34 +01:00
chris fdc04674e8 Add script 'occ_file_scan_app-data.sh'. 2022-02-22 17:13:36 +01:00
chris 522df2e02e update_nextcloud.sh: some minor updates. 2021-12-11 03:37:33 +01:00
chris a677f31043 update_nextcloud.sh: support reinstall cuurent version. 2021-12-11 02:39:45 +01:00
chris 35383599ec update_nextcloud.sh: some minor changes. 2021-12-10 03:19:47 +01:00
chris a396b1a433 convert_filecache_bigint.sh: fix error (typo). 2021-12-04 14:44:42 +01:00
chris 0a4997484c occ_file_scan_all_accounts.sh: add support for nginx webservice.. 2021-12-04 14:34:53 +01:00
chris 1ed083f60d convert_filecache_bigint.sh: add support for nginx webservice. 2021-12-04 14:29:16 +01:00
chris 9e509cf641 check_encryption_scan_legacy-format, check_for_old_files.sh: some minor changes. 2021-12-04 14:24:08 +01:00
chris bd34379827 add_user_to_group.sh,remove_user_from_group.sh: some minor changes to be script-compartible.. 2021-12-04 13:47:14 +01:00
chris 0c52c4e588 add_missing_primary-keys.sh: add support for nginx webserver. 2021-12-04 13:32:30 +01:00
chris 5b52de19f6 add_missing_columns.sh: check if database parameter's are given.. 2021-12-04 13:27:38 +01:00
chris 9994606772 add_missing_indices.sh: check if database parameter's are given.. 2021-12-04 13:25:35 +01:00
chris cec514e835 Check webservice bevor PHP version. 2021-12-04 04:08:25 +01:00
chris f34ef5b05b Add support of nginx webserver. Fix error in determin PHP version. 2021-12-04 03:53:35 +01:00
chris 71959acebe check_cert_coolwsd.sh: fix error in restarting the 'coolwsd' service. 2021-11-29 18:57:05 +01:00
chris 7d8b364859 'loolwsd' service was (changed and) renamed to 'coolwsd'. so we add script 'check_cert_coolwsd.sh'. 2021-11-29 18:51:42 +01:00
chris a377f9de32 Add script 'check_encryption_scan_legacy-format'. 2021-11-18 03:00:36 +01:00
chris f4ea2fe495 update_nextcloud.sh: fix error in determin PHP version. 2021-11-18 02:59:04 +01:00
chris d9b31d6f6f Fix error in determine PHP Version. 2021-11-14 23:14:35 +01:00
chris b2f47c8633 update_nextcloud.sh: adjust to match new data directory 'date' - befor it was a symlink to 'data-<version>'. 2021-10-05 02:46:20 +02:00
chris 9400038bbe restore_nextcloud.sh: adjust to match new data directory 'date' - befor it was a symlink to 'data-<version>'. 2021-10-05 02:45:51 +02:00
chris 700a993c85 Merge branch 'master' of https://git.oopen.de/script/nextcloud 2021-10-02 10:55:42 +02:00
chris 4f63d96338 update_nextcloud.sh: use 'occ' to get current version of netxcloud installation. 2021-10-02 10:55:24 +02:00
chris bdfc9206d3 Add README file for handling database error 'InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE'. 2021-10-02 03:46:33 +02:00
chris b35cd9e1f5 Add script 'check_for_old_files.sh'. 2021-08-11 14:29:30 +02:00
chris d4413f9d04 occ_file_scan_all_accounts.sh: minor change in script output. 2021-07-06 00:48:41 +02:00
chris 9e38b08a0e update_nextcloud.sh: support nginx webserver. 2021-04-11 12:47:13 +02:00
chris 2cf20e4294 update_nextcloud.sh: ommit askint for 'ColaboraOnline' - Its not used/needed here. 2021-04-11 12:20:19 +02:00
chris 6626385965 On update ommit update apps because it is done within main update procedure. 2021-04-11 11:32:25 +02:00
chris 146bcee838 update_nextcloud.sh: add support for nginx webserver. 2021-03-31 04:19:19 +02:00
chris 84c890dfcd restore_nextcloud.sh: minor changes on script output 2021-02-06 10:38:03 +01:00
chris 74115ac714 restore_nextcloud.sh: minor changes on script output 2021-02-06 10:37:30 +01:00