Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
bricoler:prive:yunohost [2025/03/25 11:45] – ancienne révision (2024/12/03 14:24) restaurée dpt | bricoler:prive:yunohost [2025/04/19 13:49] (Version actuelle) – dpt | ||
---|---|---|---|
Ligne 5: | Ligne 5: | ||
;#; | ;#; | ||
{{tag> | {{tag> | ||
- | * adresse IP : 102.168.0.20 | + | * adresse IP : 166.48.211.5 (avril 2025) |
* mot de passe bangastidebinemeuf | * mot de passe bangastidebinemeuf | ||
- | * ssh admin@192.180.0.20 | + | * local 192.168.1.109 |
* domaines des applications installées | * domaines des applications installées | ||
* [[https:// | * [[https:// | ||
Ligne 16: | Ligne 16: | ||
{{ : | {{ : | ||
- | ====== Domaines dans cloudflare====== | + | |
- | * __pascot.ca__ | + | |
- | * __aquarelles.pascot.ca__ | + | |
- | * __art.pascot.ca__ | + | |
- | * blog.pascot.ca | + | |
- | * gerer.pascot.ca | + | |
- | * __ia.pascot.ca__ | + | |
- | * lus.pascot.ca | + | |
- | * __photos.pascot.ca__ | + | |
- | * plume.pascot.ca | + | |
- | * test.pascot.ca | + | |
- | * wf.pascot.ca | + | |
- | * __yes.pascot.ca__ | + | |
Ligne 39: | Ligne 27: | ||
Mais la gestion sur les contenus se fait dans les ACL pour les utilisateurs et groupes définis dans yunohost | Mais la gestion sur les contenus se fait dans les ACL pour les utilisateurs et groupes définis dans yunohost | ||
- | < | + | ====== DNS dynamique ====== |
- | users: | + | |
- | | + | mon serveur est local sur un raspberry et mon service DNS est cloudflare |
- | | + | ChatGPT a dit : |
- | mail: admin_legacy | + | |
- | | + | Parfait, t’as déjà une super base alors ! Si ton serveur tourne sur un Raspberry Pi localement, et que tu utilises Cloudflare pour gérer ton nom de domaine, tu peux mettre en place un Dynamic DNS maison qui met à jour ton enregistrement DNS automatiquement à chaque changement d’IP. |
- | | + | |
- | am: | + | Voici comment faire proprement |
- | | + | ✅ Objectif |
- | mail: am@pascot.ca | + | |
- | | + | Mettre à jour automatiquement ton enregistrement DNS (chez Cloudflare) quand l’IP publique de ta box change, pour que ton nom de domaine pointe toujours vers ton Raspberry. |
- | | + | 🔧 Étapes pour mettre en place le DDNS avec Cloudflare |
- | dp: | + | 1. Crée un Token API Cloudflare |
- | fullname: Daniel Pascot | + | |
- | mail: dp@pascot.ca | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | mail: fp@pascot.ca | + | |
- | | + | |
- | | + | |
- | ia: | + | |
- | | + | |
- | mail: ia@pascot.ca | + | 2. Installe un script DDNS sur ton Raspberry Pi |
- | | + | |
- | | + | Voici un petit script en Python qui fonctionne super bien : |
- | root@pascot:/ | + | |
- | groups: | + | sudo apt update |
- | | + | sudo apt install python3-pip |
- | | + | pip3 install requests |
- | - dp | + | |
- | - admin | + | Crée un fichier cloudflare_ddns.py |
- | | + | |
- | | + | import requests |
- | - fp | + | |
- | - dp | + | # CONFIGURATION |
- | - am | + | ZONE_NAME = " |
- | - ia | + | RECORD_NAME = " |
- | | + | CF_API_TOKEN = " |
- | | + | CF_EMAIL = "ton@email.com" |
- | root@pascot:/home/admin# yunohost user permission list | + | CF_API_URL = "https://api.cloudflare.com/ |
- | permissions: | + | |
- | | + | # Récupère l’IP publique |
- | | + | ip = requests.get(" |
- | | + | |
- | | + | # Récupère l'ID de la zone |
- | | + | zone_resp = requests.get( |
- | | + | |
- | | + | |
- | | + | |
- | - visitors | + | ) |
- | - admins | + | zone_id = zone_resp.json()[" |
- | - ia | + | |
- | | + | # Récupère l' |
- | | + | dns_records = requests.get( |
- | | + | |
- | | + | |
- | - visitors | + | |
- | - admins | + | ) |
- | dokuwiki__6.admin: | + | record = dns_records.json()[" |
- | | + | |
- | | + | # Met à jour l' |
- | | + | if record[" |
- | - visitors | + | |
- | - admins | + | |
- | | + | |
- | | + | headers={ |
- | | + | " |
- | | + | " |
- | - admins | + | }, |
- | - am | + | |
- | nextcloud.api: | + | " |
- | | + | " |
- | - visitors | + | " |
- | - admins | + | " |
- | | + | " |
- | | + | } |
- | - visitors | + | ) |
- | - admins | + | |
- | piwigo.main: | + | else: |
- | | + | |
- | - visitors | + | |
- | - admins | + | 3. Automatiser avec cron |
- | | + | |
- | | + | Fais tourner ça toutes les 5 minutes |
- | ssh.main: | + | |
- | | + | crontab |
- | xmpp.main: | + | |
- | allowed: admins | + | Ajoute |
- | </ | + | |
+ | */5 * * * * / | ||
+ | |||
+ | Et voilà ! À partir de là, même si ton IP change, ton Raspberry mettra à jour automatiquement ton enregistrement DNS sur Cloudflare. | ||