diff --git a/.env b/.env new file mode 100644 index 000000000..7d1623561 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +APPRISE_API_URL=http://localhost:8000 \ No newline at end of file diff --git a/Client/src/Components/Notifications/NotificationForm.jsx b/Client/src/Components/Notifications/NotificationForm.jsx new file mode 100644 index 000000000..0519ecba6 --- /dev/null +++ b/Client/src/Components/Notifications/NotificationForm.jsx @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Server/db/models/Notification.js b/Server/db/models/Notification.js index 8767880c1..74aa3d50d 100644 --- a/Server/db/models/Notification.js +++ b/Server/db/models/Notification.js @@ -8,7 +8,21 @@ const NotificationSchema = mongoose.Schema( }, type: { type: String, - enum: ["email", "sms"], + enum: ["email", "sms", "apprise"], + }, + appriseUrl: { + type: String, + validate: { + validator: function(v) { + if (this.type !== 'apprise') return true; + if (!v || v.length > 2048) return false; + + // Apprise URL format: scheme://[user:pass@]host[:port]/path + const appriseUrlRegex = /^[a-zA-Z]+:\/\/([^:\s]+:[^@\s]+@)?[^\s\/:]+(:\d+)?(\/[^\s]*)?$/; + return appriseUrlRegex.test(v); + }, + message: 'Invalid Apprise URL: Must be a valid service URL under 2048 characters' + } }, address: { type: String, diff --git a/Server/services/NotificationService.js b/Server/services/NotificationService.js new file mode 100644 index 000000000..0519ecba6 --- /dev/null +++ b/Server/services/NotificationService.js @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..26278cfc2 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,21 @@ +apprise-api: + image: caronc/apprise-api:1.2.0 + container_name: apprise-api + ports: + - "8000:8000" + environment: + - APPRISE_STATELESS_MODE=yes + restart: unless-stopped + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8000/"] + interval: 30s + timeout: 10s + retries: 3 + deploy: + resources: + limits: + cpus: '0.50' + memory: 256M + reservations: + cpus: '0.25' + memory: 128M \ No newline at end of file