đąApprise API web based push notification
Apprise est une librairie Ă©crite en Python et qui vous permet dâenvoyer des notifications (push) Ă la quasi-totalitĂ© des services existant aujourdâhui.
Pour plus dâinformations sur les options de dĂ©ploiement Docker et les configurations de conteneurs avancĂ©es, reportez-vous Ă la section DĂ©ploiement Docker. Pour une configuration systĂšme et des variables dâenvironnement complĂštes, reportez-vous Ă la section Configuration. Pour des exemples dâutilisation dâAPI et des dĂ©tails sur les points de terminaison, reportez-vous Ă API Reference.
Apprise API
Démarrage rapide avec Docker
La mĂ©thode la plus rapide pour lancer lâAPI Apprise consiste Ă utiliser lâimage Docker prĂ©dĂ©finie. Le service fonctionne sur le port 8000 et ne nĂ©cessite aucune configuration initiale.
Déploiement de base
1
2
3
4
docker run -d \
--name apprise-api \
-p 8000:8000 \
caronc/apprise:latest
Utilisation de Docker Compose
Créer le dossier apprise-api
1
2
mkdir -p $HOME/apprise-api
cd $HOME/apprise-api
Pour une configuration persistante et une gestion plus facile, utilisez le docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
services:
apprise:
image: caronc/apprise:latest
container_name: apprise
ports:
- "8000:8000"
environment:
APPRISE_STATEFUL_MODE: simple
APPRISE_WORKER_COUNT: 1
APPRISE_ADMIN: "y"
volumes:
- ../docker-data/apprise-api/config:/config
- ../docker-data/apprise-api:/attach
1
2
3
git clone https://github.com/caronc/apprise-api.git
cd apprise-api
docker compose up -d
Le service sera disponible Ă lâadresse http://localhost:8000
Proxy nginx
Créer le fichier :
1
sudo nano /etc/nginx/conf.d/apprise.rnmkcy.eu.conf
Ajouter
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Optional: redirect plain HTTP to HTTPS (if you have a server listening 80)
server {
listen 80;
listen [::]:80;
server_name apprise.rnmkcy.eu;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
server_name apprise.rnmkcy.eu;
include /etc/nginx/conf.d/ssl-modern.inc;
# Static assets if needed (adjust path)
location /static/ {
alias /opt/apprise-api/static/;
}
# Protect all other locations with Authelia
location / {
proxy_pass http://192.168.0.222:8000;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $http_host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "";
proxy_buffers 16 64k;
proxy_buffer_size 128k;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
}
# Additional security headers (tune as desired)
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options DENY;
add_header X-XSS-Protection "1; mode=block";
}
Vérifier et recharger NGINX:
1
2
sudo nginx -t
sudo systemctl reload nginx
test
1
2
3
4
curl -s -X POST https://apprise.rnmkcy.eu/notify/ \
-H "Content-Type: application/json" \
-H "Authorization: Bearer APPRISE_KEY" \
-d '{"targets":["ntfy://:tk_xxxxxxxxxxxxxxxxxx@ntfy.rnmkcy.eu/yan_infos"],"title":"Test","body":"Essai..."}'
Configuration web
LâAPI inclut un gestionnaire de configuration intĂ©grĂ© Ă https://apprise.rnmkcy.eu
Les configurations sont stockées sous un identifiant de configuration (ou une clé) unique. Choisir un mot clé: yankey

Entrez vos URL (format TEXT ou YAML) et enregistrez-les sur votre clé.
Ici on utilise ntfy




