diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 9ee7408..bdac7ae 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -1,5 +1,9 @@ name: CI +# TODO: Check if we can remove composer.json — CI currently uses `composer install` +# and `composer test` (wrappers around `phpunit` and `php -l`). If CI can use +# direct commands, composer.json can be dropped (no runtime deps needed). + on: push: branches: @@ -24,7 +28,7 @@ jobs: - name: Install dependencies working-directory: ./nc_bot_webhooks - run: composer install --prefer-dist + run: composer install - name: Lint PHP files working-directory: ./nc_bot_webhooks diff --git a/README.md b/README.md index 1d2c606..7627cc5 100644 --- a/README.md +++ b/README.md @@ -75,9 +75,20 @@ Go to **Settings → Admin → nc_bot_webhooks**: --- +### Deployment Paths + +The table below lists common Nextcloud install locations. Replace `/var/www/html/custom_apps/` with your environment's path in all commands below. + +| Environment | Nextcloud root | App path | Data dir | +|---|---|---|---| +| Docker (standard) | `/var/www/html/` | `/var/www/html/custom_apps/` | `/var/www/html/data/` | +| TrueNAS Scale (app) | `/var/www/html/` | `/var/www/html/custom_apps/` | configurable (set at install) | +| Ubuntu/deb package | `/var/www/nextcloud/` | `/var/www/nextcloud/custom_apps/` | `/var/www/nextcloud/data/` | +| Manual LAMP (official) | `/var/www/nextcloud/` | `/var/www/nextcloud/custom_apps/` | configurable (set in config.php) | + ### Updating using git -> **Note:** On a standard TrueNAS Scale Nextcloud Docker install, the app is located at `/var/www/html/custom_apps/nc_bot_webhooks/`. Adjust the paths below to match your deployment. +> **Note:** The paths below assume a Docker install. See [Deployment Paths](#deployment-paths) for your environment. ```bash cd /var/www/html/custom_apps/nc_bot_webhooks @@ -93,7 +104,7 @@ php occ maintenance:repair ### Local update -> **Note:** The paths below are specific to a TrueNAS Scale Nextcloud Docker install. Adjust them to match your deployment. +> **Note:** The paths below assume a standard Docker install (`/var/www/html/`). See [Deployment Paths](#deployment-paths) for environment-specific adjustments. This workflow is for when you keep your local development copy synced to your server via the Nextcloud desktop client. Edit files locally, then deploy with the script below. @@ -116,7 +127,7 @@ php occ config:app:delete nc_bot_webhooks routes 2>/dev/null || true php occ maintenance:repair ``` -> **Note:** The path `"/var/www/html/data//files//nc_bot_webhooks/"` is where your Nextcloud user's synced files land on the server (TrueNAS Docker path). Replace `` with your Nextcloud username, and adjust `/nc_bot_webhooks/` to match the directory you are syncing to. +> **Note:** The path `"/var/www/html/data//files//nc_bot_webhooks/"` is where your Nextcloud user's synced files land on the server. Replace `/var/www/html/data` with your environment's data dir from [Deployment Paths](#deployment-paths). --- @@ -382,7 +393,7 @@ Or via `occ`: php occ config:app:set --value=0 core log_level ``` -The default log file on a TrueNAS Scale Nextcloud Docker install is `/var/www/html/data/nextcloud.log`. Adjust the path if your data directory is elsewhere. +The default log file on a TrueNAS Scale Nextcloud Docker install is `/var/www/html/data/nextcloud.log`. Adjust based on your environment's data dir from [Deployment Paths](#deployment-paths). ### Diagnostic grep examples diff --git a/appinfo/info.xml b/appinfo/info.xml index eb7228c..a32df4e 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -5,14 +5,14 @@ nc_bot_webhooks Discord webhook bridge for Nextcloud Talk with image support Accepts Discord webhook-style JSON payloads and posts them into Nextcloud Talk rooms, preserving image attachments. Each room gets its own webhook URL with an auth token for security. - 1.1.0 + 1.1.5 AGPL-3.0-or-later - Kyle + Kyle Ncbotwebhooks integration - + spreed diff --git a/composer.json b/composer.json index db471aa..b2dafc4 100644 --- a/composer.json +++ b/composer.json @@ -7,6 +7,8 @@ "OCA\\Ncbotwebhooks\\": "../lib/" } }, + // NOTE: This autoload path is for dev tooling (phpunit) only. + // Nextcloud apps use their own autoloader — do not rely on this for production. "require-dev": { "phpunit/phpunit": "^10.0" }, diff --git a/img/app (copy).svg b/img/app (copy).svg deleted file mode 100644 index 99f2ac6..0000000 --- a/img/app (copy).svg +++ /dev/null @@ -1,110 +0,0 @@ - -Discord_logo-svgDiscord_logo-svg diff --git a/js/settings.js b/js/settings.js index ff3b2f4..0cfb726 100644 --- a/js/settings.js +++ b/js/settings.js @@ -242,6 +242,7 @@ document.addEventListener('DOMContentLoaded', function () { authTokensState[roomToken] = []; } // Use URL-safe base64 (no +, /, = characters) + // TODO: Switch to server-side token generation for higher security (client-side Math.random() is not cryptographically secure) var raw = Math.random().toString(36).substring(2) + Date.now().toString(36); var token = btoa(raw).replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, ''); authTokensState[roomToken].push(token);