<?xml version="1.0" encoding="UTF-8" ?>
<!-- RSS generated by PHPBoost on Wed, 29 Apr 2026 05:39:15 +0200 -->
<rss version="2.0" xmlns:atom="https://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Wiki Les geekeries de rungis]]></title>
		<atom:link href="https://geekrungis.fr/syndication/rss/wiki/" rel="self" type="application/rss+xml"/>
		<link>https://geekrungis.fr</link>
		<description><![CDATA[Wiki Les geekeries de rungis : derniers articles]]></description>
		<copyright>(C) 2005-2026 PHPBoost</copyright>
		<language>fr</language>
		<generator>PHPBoost</generator>
		
            <item>
                <title><![CDATA[Créer un backup chiffré de ses données sur Google Drive avec rclone]]></title>
                <link>https://geekrungis.fr/wiki/creer-un-backup-chiffre-de-ses-donnees-sur-google-drive-avec-rclone</link>
                <guid>https://geekrungis.fr/wiki/creer-un-backup-chiffre-de-ses-donnees-sur-google-drive-avec-rclone</guid>
                <description><![CDATA[Avoir une sauvegarde locale de ses données est une excellente chose, mais pour une protection ultime contre les sinistres (incendie, vol, panne totale du serveur), l'externalisation est indispensable. Ce tutoriel vous explique comment configurer un système de sauvegarde "froide" et chiffrée vers votre espace <strong>Google One</strong> (2 To ou plus) en utilisant <strong>Rclone</strong>.<br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-creation-des-identifiants-google-cloud">Création des identifiants Google Cloud</h2><br />

<br />
Pour éviter les limitations de vitesse et les erreurs de connexion, il est fortement conseillé de créer vos propres identifiants API plutôt que d'utiliser ceux par défaut de Rclone.<br />
<br />
Vous trouverez tout le détail de la manip. à faire sur Google Cloud Console ici <a class="offload" href="https://rclone.org/drive/#making-your-own-client-id">rclone.org</a><br />
<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">&nbsp;
When you use rclone with Google drive in its default configuration you are using rclone's client_id. This is shared between all the rclone users. There is a global rate limit on the number of queries per second that each client_id can do set by Google. rclone already has a high quota and I will continue to make sure it is high enough by contacting Google.
It is strongly recommended to use your own client ID as the default rclone ID is heavily used. If you have multiple services running, it is recommended to use an API key for each service. The default Google quota is 10 transactions per second so it is recommended to stay under that number as if you use more than that, it will cause rclone to rate limit and make things slower.
Here is how to create your own Google Drive client ID for rclone:
Log into the Google API Console with your Google account. It doesn't matter what Google account you use. (It need not be the same account as the Google Drive you want to access)
Select a project or create a new project.
Under "ENABLE APIS AND SERVICES" search for "Drive", and enable the "Google Drive API".
Click "Credentials" in the left-side panel (not "Create credentials", which opens the wizard).
If you already configured an "Oauth Consent Screen", then skip to the next step; if not, click on "CONFIGURE CONSENT SCREEN" button (near the top right corner of the right panel), then click "Get started". On the next screen, enter an "Application name" ("rclone" is OK); enter "User Support Email" (your own email is OK); Next, under Audience select "External". Next enter your own contact information, agree to terms and click "Create". You should now see rclone (or your project name) in a box in the top left of the screen.
(PS: if you are a GSuite user, you could also select "Internal" instead of "External" above, but this will restrict API use to Google Workspace users in your organisation).
You will also have to add some scopes, including
https://www.googleapis.com/auth/docs
https://www.googleapis.com/auth/drive in order to be able to edit, create and delete files with RClone.
https://www.googleapis.com/auth/drive.metadata.readonly which you may also want to add.
To do this, click Data Access on the left side panel, click "add or remove scopes" and select the three above and press update or go to the "Manually add scopes" text box (scroll down) and enter "https://www.googleapis.com/auth/docs,https://www.googleapis.com/auth/drive,https://www.googleapis.com/auth/drive.metadata.readonly", press add to table then update.
You should now see the three scopes on your Data access page. Now press save at the bottom!
After adding scopes, click Audience Scroll down and click "+ Add users". Add yourself as a test user and press save.
Go to Overview on the left panel, click "Create OAuth client". Choose an application type of "Desktop app" and click "Create". (the default name is fine)
It will show you a client ID and client secret. Make a note of these. (If you selected "External" at Step 5 continue to Step 9. If you chose "Internal" you don't need to publish and can skip straight to Step 10 but your destination drive must be part of the same Google Workspace.)
Go to "Audience" and then click "PUBLISH APP" button and confirm. Add yourself as a test user if you haven't already.
Provide the noted client ID and client secret to rclone.
Be aware that, due to the "enhanced security" recently introduced by Google, you are theoretically expected to "submit your app for verification" and then wait a few weeks(!) for their response; in practice, you can go right ahead and use the client ID and client secret with rclone, the only issue will be a very scary confirmation screen shown when you connect via your browser for rclone to be able to get its token-id (but as this only happens during the remote configuration, it's not such a big deal). Keeping the application in "Testing" will work as well, but the limitation is that any grants will expire after a week, which can be annoying to refresh constantly. If, for whatever reason, a short grant time is not a problem, then keeping the application in testing mode would also be sufficient.
&nbsp;</pre></pre></div></div><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-installation-et-configuration-de-rclone">Installation et Configuration de Rclone</h2><br />

<br />
Rclone est le "couteau suisse" du stockage Cloud. Installez-le sur votre serveur (Debian/Ubuntu/Proxmox) :<br />
<br />
<div class="formatter-container formatter-code"><span class="formatter-title">Code : </span><div class="formatter-content"><code><span style="color: #000000">
sudo&nbsp;apt&nbsp;install&nbsp;rclone</span>
</code></div></div><br />
<br />
Lancez la configuration : <strong>rclone config</strong><br />
<br />
<ul class="formatter-ul">
<li class="formatter-li">Tapez <strong>n</strong> pour créer un nouveau remote (nommez-le <em>gdrive</em>).
</li><li class="formatter-li">Choisissez le type <strong>Google Drive</strong>.
</li><li class="formatter-li">Collez votre <strong>Client ID</strong> et votre <strong>Client Secret[/i].
</li><li class="formatter-li">Pour le [b]Scope</strong>, choisissez l'option <strong>1</strong> (Full access).
</li><li class="formatter-li">Répondez <strong>n</strong> à "Use auto config" si vous êtes en SSH, et suivez le lien pour valider l'accès sur votre navigateur.<br />
</li></ul><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-ajout-de-la-couche-de-chiffrement-crypt">Ajout de la couche de chiffrement (Crypt)</h2><br />

<br />
C'est l'étape la plus importante pour la confidentialité. Nous allons créer un second "remote" qui s'appuie sur le premier mais chiffre tout à la volée.<br />
<br />
<div class="formatter-container formatter-code"><span class="formatter-title">Code : </span><div class="formatter-content"><code><span style="color: #000000">
rclone&nbsp;config</span>
</code></div></div><br />
<br />
Créez un nouveau remote (nom : <em>secret_backup</em>), type <strong>crypt</strong>. Pointez-le vers <strong>gdrive:nom_du_dossier</strong>. Définissez deux mots de passe robustes (un pour les données, un pour le sel). <strong>Notez-les précieusement !</strong><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-automatisation-et-notifications-telegram">Automatisation et Notifications Telegram</h2><br />

<br />
Voici un script Bash optimisé pour synchroniser vos données et vous envoyer un rapport sur Telegram :<br />
<br />
<div class="formatter-container formatter-code"><span class="formatter-title">Code : </span><div class="formatter-content"><code><span style="color: #000000">
<br />#!/bin/bash<br />Configuration<br />REMOTE="secret_backup:"<br />SOURCE="/votre/chemin/donnees"<br />LOG="/var/log/rclone_backup.log"<br />TG_TOKEN="VOTRE_TOKEN_BOT"<br />TG_CHATID="VOTRE_CHAT_ID"<br />Synchro<br />rclone&nbsp;sync&nbsp;"$SOURCE"&nbsp;"$REMOTE"&nbsp;--log-file=$LOG&nbsp;--log-level&nbsp;INFO&nbsp;--fast-list<br />Notification<br />if&nbsp;[&nbsp;$?&nbsp;-eq&nbsp;0&nbsp;];&nbsp;then<br />curl&nbsp;-s&nbsp;-X&nbsp;POST&nbsp;"https://api.telegram.org/bot$TG_TOKEN/sendMessage"&nbsp;-d&nbsp;chat_id="$TG_CHATID"&nbsp;-d&nbsp;text="✅&nbsp;Backup&nbsp;réussi&nbsp;le&nbsp;$(date)"<br />else<br />curl&nbsp;-s&nbsp;-X&nbsp;POST&nbsp;"https://api.telegram.org/bot$TG_TOKEN/sendMessage"&nbsp;-d&nbsp;chat_id="$TG_CHATID"&nbsp;-d&nbsp;text="⚠️&nbsp;ERREUR&nbsp;Backup&nbsp;Homelab&nbsp;!"<br />fi</span>
</code></div></div><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-conclusion">Conclusion</h2><br />

<br />
En couplant la puissance de Rclone avec le stockage Google One que vous payez déjà, vous obtenez une sauvegarde hors-site professionnelle, chiffrée de bout en bout et gratuite (incluse dans votre abonnement). Pensez à planifier ce script dans votre <strong>crontab</strong> pour dormir sur vos deux oreilles !]]></description>
                <pubDate>Mon, 27 Apr 2026 22:36:51 +0200</pubDate>
                
            </item>
		
            <item>
                <title><![CDATA[Résoudre l'erreur 500 sur Nextcloud]]></title>
                <link>https://geekrungis.fr/wiki/resoudre-l-erreur-500-sur-nextcloud</link>
                <guid>https://geekrungis.fr/wiki/resoudre-l-erreur-500-sur-nextcloud</guid>
                <description><![CDATA[<h2 class="formatter-title wiki-paragraph-2" id="paragraph-introduction">Introduction</h2><br />

<br />
Suite à des problèmes avec ma VM Nextcloud installée sur proxmox, j'ai restauré un snapshot mais là, problème !<br />
Voici le message qui apparait sur mon navigateur après m'être connecté :<br />
<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">&nbsp;
Internal Server Error
The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.
&nbsp;</pre></pre></div></div><br />
<br />
Dans les logs de Nextcloud, je retrouve ceci :<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">&nbsp;
Failed to open stream: No such file or directory... merged-template-prepend.js.deps
&nbsp;</pre></pre></div></div><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-causes">Causes</h2><br />

C'est un problème de cache. La base de données pointe vers des fichiers Javascript/CSS combinés qui n'existent plus sur le disque suite au retour en arrière.<br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-la-resolution-etape-par-etape">La résolution étape par étape</h2><br />

<br />
<ol class="formatter-ol">
    <li class="formatter-li"> Vider le cache des fichiers JS/CSS (dans le dossier où se trouvent vos fichiers, vous devez avoir un dossier appdata_ocxxxxxxx)<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">&nbsp;
cd appdata_ocxxxx/
sudo rm -rf js/ css/
&nbsp;</pre></pre></div></div>
    </li><li class="formatter-li">Forcer le scan de Nextcloud<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">&nbsp;
sudo -u www-data php occ files:scan-app-data
&nbsp;</pre></pre></div></div>
    </li><li class="formatter-li">Lancer la réparation automatique :<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">&nbsp;
sudo -u www-data php occ maintenance:repair
&nbsp;</pre></pre></div></div>
    </li><li class="formatter-li">Redémarrer apache<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">&nbsp;
sudo systemctl restart apache2
&nbsp;</pre></pre></div></div><br />
</li></ol><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-conclusion">Conclusion</h2><br />

En cas d'erreur 500 persistante après une restauration, ne paniquez pas sur la base de données : vérifiez d'abord le dossier <strong>appdata</strong>. C'est souvent lui qui contient des résidus de cache devenus invalides !]]></description>
                <pubDate>Sun, 19 Apr 2026 14:11:34 +0200</pubDate>
                
            </item>
		
            <item>
                <title><![CDATA[Se connecter en ssh sans mot de passe]]></title>
                <link>https://geekrungis.fr/wiki/se-connecter-en-ssh-sans-mot-de-passe</link>
                <guid>https://geekrungis.fr/wiki/se-connecter-en-ssh-sans-mot-de-passe</guid>
                <description><![CDATA[Si la connexion de fonctionne pas, tail -f /var/log/auth.log<br />
<br />
On pourra notamment y trouver : Authentication refused: bad ownership or modes for file /srv/fad3326e-0020-42e3-8aef-6334719901b7/Homes/Remi/.ssh/authorized_keys<br />
<br />
Il faut alors faire un chmod 644 sur le fichier authorized_keys<br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-demande-du-mot-de-passe-malgre-avoir-fait-le-ssh-copy-id">Demande du mot de passe malgré avoir fait le ssh-copy-id</h2><br />

<br />
Par défaut, ssh tente de se connecter avec une clé privée par défaut. Pour spécifier une clé spécifique : on ajoute l'option -i ficher_clé ou on ajoute l'information dans .ssh/config :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
Host 192.168.1.51
         User Remi
         IdentityFile ~<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>key-smb1
&nbsp;</pre></pre></div></div><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-demande-d-entrer-la-passphrase-a-chaque-connection">Demande d'entrer la passphrase à chaque connection</h2><br />

<br />
Il faut d'abord vérifier que ssh-agent est démarré :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #7a0874; font-weight: bold;">eval</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ssh-agent</span> -s<span style="color: #000000; font-weight: bold;">`</span>
&nbsp;</pre></pre></div></div><br />
<br />
<span class="message-helper notice">Doit retourner le numéro du processus : Agent pid ####</span><br />
<br />
Dans le cas de l'utilisation d'un autre shell, il peut être nécessaire de le préciser.<br />
Par exemple dans fish :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">ssh-agent</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>fish
&nbsp;</pre></pre></div></div><br />
<br />
Si il est bien démarré, il faut ajouter sa clé à l'agent ssh :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">ssh-add</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>key-smb1
&nbsp;</pre></pre></div></div><br />
<br />
En fonction de l'environnement de bureau utilisé, il peut-être nécessaire de faire une manip. en plus.<br />
<br />
Sur KDE Plasma, il est nécessaire de vérifier que que le portefeuille KDE est actif puis de s'assurer que assurer que l'agent SSH utilise bien ksshaskpass avec la commande :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #660033;">-x</span> SSH_ASKPASS <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ksshaskpass
&nbsp;</pre></pre></div></div><br />]]></description>
                <pubDate>Sun, 24 Aug 2025 21:52:26 +0200</pubDate>
                
            </item>
		
            <item>
                <title><![CDATA[Domotique]]></title>
                <link>https://geekrungis.fr/wiki/domotique</link>
                <guid>https://geekrungis.fr/wiki/domotique</guid>
                <description><![CDATA[Je vous partage quelques tips relatifs à l'utilisation de jeedom et de Home Assistant.]]></description>
                <pubDate>Sun, 02 Feb 2025 15:33:31 +0100</pubDate>
                
            </item>
		
            <item>
                <title><![CDATA[[HomeAssistant] Installer zigbee2mqtt et mosquitto sur docker]]></title>
                <link>https://geekrungis.fr/wiki/homeassistant-installer-zigbee2mqtt-et-mosquitto-sur-docker</link>
                <guid>https://geekrungis.fr/wiki/homeassistant-installer-zigbee2mqtt-et-mosquitto-sur-docker</guid>
                <description><![CDATA[<h2 class="formatter-title wiki-paragraph-2" id="paragraph-introduction">Introduction</h2><br />

<br />
Dans cet article, je vais détailler comment installer Zigbee2mqtt et Mosquitto sur un serveur Docker.<br />
Le but est de pouvoir piloter des équipements Zigbee (ampoules, prises, capteurs, etc.) via un serveur MQTT conectable à Home Assistant mais en installant le broker et Zigbee2mqtt à part, ce qui vous permettra dans le futur, si besoin de migrer vers un autre système domotique sans devoir appairer à nouveau tous vos équipements Zigbee.<br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-prerequis">Prérequis</h2><br />

<br />
- Un serveur Docker fonctionnel (personnellement, j'utilise une VM Debian sur mon serveur Proxmox avec docker et Portainer installés dessus).<br />
- Un dongle Zigbee compatible avec Zigbee2mqtt (CC2531, CC2530, CC2531, etc.) >> pour cela, je vous invite à consulter mon article qui vous décrit le flashage du dongle Sonooff Zigbee 3.0 Dongle Plus.<br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-installation-de-mosquitto-et-zigbee2mqtt-dans-une-stack-docker">Installation de Mosquitto et Zigbee2mqtt dans une stack Docker</h2><br />

<br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-deploiement-de-la-stack">Déploiement de la stack</h3><br />

<br />
Je vous donne ma méthode valable avec Portainer.<br />
Allez sur votre portainer, puis dans votre environnement puis cliquez sur "Stacks" et enfin sur "Add stack".<br />
<br />
Copiez le docker-compose suivant dans le champ "Web editor" :<br />
<br />
<div class="formatter-container formatter-code code-YAML"><span class="formatter-title">Code YAML : </span><div class="formatter-content"><pre style="display:inline;"><pre class="yaml" style="font-family:monospace;">&nbsp;
services:
  mosquitto:
    image: eclipse-mosquitto
    container_name: mosquitto
    restart: always
    volumes:
      - /opt/docker/mosquitto/config:/mosquitto/config
      - /opt/docker/mosquitto/data:/mosquitto/data
      - /opt/docker/mosquitto/log:/mosquitto/log
    ports:
      - 1883:1883
      - 9001:9001
&nbsp;
  zigbee2mqtt:
    image: koenkk/zigbee2mqtt
    container_name: zigbee2mqtt
    restart: unless-stopped
    volumes:
      - /opt/docker/zigbee2mqtt:/app/data
      - /run/udev:/run/udev:ro
    devices:
      - /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_d6c634615252ef1185b12a53cc32aab1-if00-port0:/dev/ttyUSB0 
    ports:
      - 8080:8080
    environment:
      - TZ=Europe/Paris
&nbsp;</pre></pre></div></div><br />
<br />
Quelques explications :<br />
- pour mosquitto, on utilise l'image officielle eclipse-mosquitto. Il est important de monter les volumes pour la configuration, les données et les logs.<br />
  Pour le montage des volumes, j'utilise la méthode qui consiste à créer un dossier par conteneur dans /opt/docker/.<br />
  Pour les ports, veillez à ce que ces ports ne soient pas déjà utilisés sur votre serveur.<br />
- pour zigbee2mqtt, on utilise l'image officielle koenkk/zigbee2mqtt. Il est important de monter le volume pour les données et de monter le device du dongle Zigbee.<br />
  Pour les ports, veillez à ce que ces ports ne soient pas déjà utilisés sur votre serveur. L'environnement TZ permet de définir le fuseau horaire.<br />
<br />
<span class="message-helper bgc notice"><br />
Pour trouver le device du dongle Zigbee (ici "usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_d6c634615252ef1185b12a53cc32aab1-if00-port0"), vous pouvez utiliser la commande suivante : `ls -l /dev/serial/by-id/usb*` sur votre serveur qui héberge docker.<br />
Faites attention à bien formater la ligne<br />
</span><br />
<br />
<span class="message-helper bgc warning"><br />
La stack est maintenant déployée et les deux conteneurs installés. Cependant, il reste un peu de configuration à faire pour les deux conteneurs.<br />
</span><br />
<br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-configuration-de-zigbee2mqtt">Configuration de zigbee2mqtt</h3><br />

<br />
Si votre conteneur redémarre sans arrêt (ce qui était mon cas), il est possible que le fichier de configuration ne soit pas correctement configuré (chez moi il était inexistant...).<br />
Vous pouvez dans ce cas arrêter le conteneur avant de créer ou modifier le fichier configuration.yaml<br />
<br />
Ici, il faut commencer par modifier (ou créer, dans mon cas le fichier n'existait pas) le fichier configuration.yaml dans le dossier /opt/docker/zigbee2mqtt.<br />
Voici un exemple de fichier de configuration :<br />
<br />
<div class="formatter-container formatter-code code-YAML"><span class="formatter-title">Code YAML : </span><div class="formatter-content"><pre style="display:inline;"><pre class="yaml" style="font-family:monospace;">&nbsp;
homeassistant:
  enabled: true
mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://192.168.1.82
  user: admin
  password: supermotdepasse
availability:
  enabled: true
  active:
    timeout: 10
  passive:
    timeout: 1500
serial:
  port: /dev/ttyUSB0
frontend:
  enabled: true
  port: 8080
&nbsp;</pre></pre></div></div><br />
<br />
Le base_topic est le nom du topic MQTT qui sera utilisé pour les équipements Zigbee. Vous pouvez mettre ce que vous souhaitez.<br />
L'adresse IP du serveur correspond à l'adresse IP de votre serveur Docker.<br />
<br />
<span class="message-helper bgc notice"><br />
Retenez bien le mot de passe que vous avez mis dans le fichier de configuration, il vous sera utile dans la configuration de mosquitto.<br />
</span><br />
<br />
Ensuite, ajoutez l'utilisateur au groupe dialout pour qu'il puisse accéder au dongle Zigbee :<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">&nbsp;
usermod -a -G dialout $USER
&nbsp;</pre></pre></div></div><br />
<br />
Puis donnez les bons droits aux dossier utiles :<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">&nbsp;
chmod -R 755 /opt/docker/zigbee2mqtt/
chown -R 1000:1000 /opt/docker/zigbee2mqtt/
&nbsp;</pre></pre></div></div><br />
<br />
<span class="message-helper bgc notice"><br />
Si comme moi vous avez une erreur du type : Configuration is not consistent with adapter state/backup! dans les logs du conteneur, il faut supprimer le fichier /opt/docker/zigbee2mqtt/coordinator_backup.json et redémarrer le conteneur.<br />
</span><br />
<br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-configurations-du-conteneur-mosquitto">Configurations du conteneur mosquitto</h3><br />

<br />
<span class="message-helper bgc notice"><br />
Comme pour zigbee2mqtt, vous pouvez arrêter le conteneur s'il redémarre sans cesse, avant de créer le fichier de configuration.<br />
</span><br />
<br />
La première chose à faire est de créer le fichier de configuration de mosquitto.<br />
Pour cela, créez le fichier /opt/docker/mosquitto/config/mosquitto.conf (à adapter à votre installation ,ce chemin correspond à celui que j'ai utilisé dans le docker-compose)<br />
et ajoutez-y le contenu suivant :<br />
<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">&nbsp;
persistence true
persistence_location /mosquitto/data/
log_dest file /mosquitto/log/mosquitto.log
listener 1883
listener 9001
allow_anonymous true
protocol websockets
password_file mosquitto/config/mqtt_passwd
&nbsp;</pre></pre></div></div><br />
<br />
On retrouve ici le dossier /mosquitto/data créé dans docker-compose. Les ports sont également à adapter à votre docker-compose.<br />
On voit également un renvoi vers le fichier mqtt_passwd, on va le créer maintenant.<br />
<br />
Pour cela, on va devoir entrer dans le conteneur :<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">&nbsp;
docker exec -it mosquitto sh
&nbsp;</pre></pre></div></div><br />
<br />
Une fois dans le conteneur, on va créer l'utilisateur avec la commande suivante :<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">&nbsp;
mosquitto_passwd -c /mosquitto/config/mqtt_passwd admin
&nbsp;</pre></pre></div></div><br />
<br />
Il vous sera demandé de saisir un mot de passe, saisissez le mot de passe que vous avez mis dans le fichier de configuration de zigbee2mqtt.<br />
<br />
Vos deux conteneurs devraient normalement être fonctionnels et vous permettre de piloter vos équipements Zigbee via MQTT.<br />
Vous pouvez maintenant vous connecter à l'interface web de Zigbee2mqtt en vous rendant sur <a class="offload" href="http://192.168.1.82:8080">http://192.168.1.82:8080</a> (adaptez l'adresse, il s'agit de l'adresse de votre serveur Docker).]]></description>
                <pubDate>Sun, 02 Feb 2025 15:19:48 +0100</pubDate>
                
            </item>
		
            <item>
                <title><![CDATA[Remapper son clavier sous Wayland]]></title>
                <link>https://geekrungis.fr/wiki/remapper-son-clavier-sous-wayland</link>
                <guid>https://geekrungis.fr/wiki/remapper-son-clavier-sous-wayland</guid>
                <description><![CDATA[Un tuto très rapide pour remapper son clavier sous Wayland. Sur le net, vous trouverez plein de tutos pour faire cela sous X11 mais dans wayland, c'est plus pauvre.<br />
<br />
Pour cela, utilisez le logiciel input remapper. Je vous donne en exemple l'installation et la mise en route sous Fedora :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> dnf <span style="color: #c20cb9; font-weight: bold;">install</span> input-remapper
<span style="color: #c20cb9; font-weight: bold;">sudo</span> systemctl <span style="color: #7a0874; font-weight: bold;">enable</span> <span style="color: #660033;">--now</span> input-remapper
&nbsp;</pre></pre></div></div><br />
<br />
Il suffit ensuite de lancer l'application et de configurer vos remapping dans l'onglet Editor.<br />
<br />
<img src="https://geekrungis.fr/upload/input-remapper.png" alt="input-remapper" /><br />
<br />]]></description>
                <pubDate>Sun, 16 Jun 2024 23:02:13 +0200</pubDate>
                
            </item>
		
            <item>
                <title><![CDATA[Monter automatiquement une partition chiffrée]]></title>
                <link>https://geekrungis.fr/wiki/monterautomatiquementunepartitionchiffre</link>
                <guid>https://geekrungis.fr/wiki/monterautomatiquementunepartitionchiffre</guid>
                <description><![CDATA[Bonjour, aujourd'hui, un article un peu spécifique sur une procédure que j'ai du réaliser et qui m'a demandé pas mal de tests en machine virtuelle avant d'y arriver...<br />
Voici le contexte. Sur mon ordinateur portable, j'ai installé fedora avec du LVM crypté et j'ai donc (mauvais choix peut-être) tout le volume physique qui est crypté et qui contient mon volume group et deux volumes logiques (root et home).<br />
<br />
Pour des questions de place insuffisante, j'ai souhaité ajouter un disque dur sur lequel je ne mettrai que home et le disque inital ne contiendrai que root.<br />
Autre critère pour moi, je ne souhaite pas taper plusieurs mots de passe...<br />
<br />
Et bien c'est parti !<br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-montageautomatiquedelapartitioninitialementcrypte">Montage automatique de la partition initialement cryptée</h2><br />

<br />
Le principe ici est d'utiliser dracut. Habituellement, on va chercher le fichier de clé soit sur une clé usb branchée soit sur une autre partition et on l'indique dans le fstab. Ici cela ne fonctionne pas du fait que la partition qui héberge root est cryptée.<br />
Pour cela, on va utiliser une clé que nous allons mettre dans /boot de façon à ce qu'elle soit accessible.<br />
Je vous renvois vers l'article que j'ai fait sur le sujet ici pour créer cette clé : <a class="offload" href="https://geekrungis.fr/wiki/montage-d-un-volume-crypte-au-demarrage-du-systeme">Article sur LVM</a><br />
<br />
Pas besoin de modifier le fstab mais il faut par contre mettre à jour crypttab (vous devriez normalement déjà y avoir une ligne mais il faut la modifier pour prendre en compte la clé)<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
luks-50de9237-1abf-4bf2-a065-8800fbbeda53 <span style="color: #007800;">UUID</span>=50de9237-1abf-4bf2-a065-8800fbbeda53 <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>.keyfile_luks discard
&nbsp;</pre></pre></div></div><br />
<br />
Ensuite, on va demander à dracut d'aller chercher cette clé<br />
Créer le fichier /etc/dracut.conf.d/copy-keyfile.conf et y ajouter la ligne suivante :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
install_items+=<span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>.keyfile_luks
&nbsp;</pre></pre></div></div><br />
<br />
Mettez ensuite à jour dracut<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
dracut <span style="color: #660033;">-f</span>
&nbsp;</pre></pre></div></div><br />
<br />
<span class="message-helper bgc warning"><br />
Soyez prudent, avec cette configuration, votre partition root est accessible à toute personne qui utiliserait une livecd pour démarrer. Il suffit d'ouvrir le conteneur luks avec la clé puisque celle-ci se trouve sur la partition boot non verrouillée<br />
</span><br />
<br />
On peut ensuite vérifier que cela a bien été pris en compte :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
lsinitrd
&nbsp;</pre></pre></div></div><br />
<br />
Devrait vous renvoyer :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #660033;">-r--------</span>   <span style="color: #000000;">1</span> root     root           <span style="color: #000000;">32</span> Aug  <span style="color: #000000;">9</span> <span style="color: #000000;">20</span>:09 <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>.keyfile_luks
&nbsp;</pre></pre></div></div><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-la-nouvelle-partition-home">La nouvelle partition home</h2><br />

<br />
Ici, nous allons monter automatiquement notre nouvelle partition home sans clé ni pass-phrase. Le principe est tout simplement de mettre en passphrase le mot de passe de la session utilisateur et d'utiliser pam pour décrypter cette partition lorsuq'on entre le mot de passe de la session.<br />
Encore une fois, je vous renvoi vers un article que j'ai écrit sur la façon de créer une partition chiffréé. Cela s'applique aussi à une partition dans un volume logique. Article ici : <a class="offload" href="https://geekrungis.fr/wiki/sauvegarde-distante-sur-un-disque-dur-externe-chiffre">Sauvegarde distante sur un disque dur externe chiffré</a><br />
<br />
Nous allons donc monter et décrypter cette partition de façon automatique après ouverture de la session.<br />
<br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-installationdeslibrairiesncessaires">Installation des librairies nécessaires</h3><br />

<br />
Installez ensuite la librairie nécessaire (ici c'est pour une base redhat, à adapter en fonction de votre distribution):<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> dnf <span style="color: #c20cb9; font-weight: bold;">install</span> pam_mount
&nbsp;</pre></pre></div></div><br />
<br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-modification-du-fstab">Modification du fstab</h3><br />

<br />
Modifier votre fichier /etc/fstab :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span>homevg-homelv       <span style="color: #000000; font-weight: bold;">/</span>home        ext4    rw,<span style="color: #007800;">helper</span>=crypt,noauto  <span style="color: #000000;">0</span>       <span style="color: #000000;">0</span>
&nbsp;</pre></pre></div></div><br />
<br />
<span class="message-helper bgc notice"><br />
Le premier paramètre correspond à la partition, ici chez moi il s'agit d'une partition sur un volume logique. N'oubliez pas le "helper=crypt"<br />
</span><br />
<br />
<span class="message-helper bgc warning"><br />
Il n'a rien à ajouter dans /etc/crypttab pour cette partition !<br />
</span><br />
<br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-paramtragedepam_mount">Paramétrage de pam_mount</h3><br />

<br />
Editez le fichier /etc/security/pam_mount.conf.xml et ajouter au début de celui-ci, après la première balise <pam-mount> et après la ligne <! --Volume definition -->, la ligne suivante :<br />
<div class="formatter-container formatter-code code-XML"><span class="formatter-title">Code XML : </span><div class="formatter-content"><pre style="display:inline;"><pre class="xml" style="font-family:monospace;">&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;"><volume</span> <span style="color: #000066;">user</span>=<span style="color: #ff0000;">"remi"</span> <span style="color: #000066;">mountpoint</span>=<span style="color: #ff0000;">"/home"</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">"/dev/mapper/homevg-homelv"</span> <span style="color: #000066;">fstype</span>=<span style="color: #ff0000;">"crypt"</span> <span style="color: #000066;">options</span>=<span style="color: #ff0000;">"relatime"</span><span style="color: #000000; font-weight: bold;">/></span></span>
&nbsp;</pre></pre></div></div><br />
<br />
<span class="message-helper bgc notice"><br />
volume user permet de restreindre les utilisateur, on peut mettre * si on ne souhaite pas de restriction<br />
Il faut bien sûr adapter le mountpoint et le path à votre cas<br />
</span><br />
<br />
Ensuite, c'est ici que j'ai eu le plus de mal, il y a des lignes à ajouter dans le bon fichier et dans le bon ordre. Je vous donne ma configuration qui fonctionne sur une fedora sous Gnome.<br />
Je vous renvoi vers ces deux sites desquels je me suis inspiré si vous n'avez pas les mêmes fichiers :<br />
<ul class="formatter-ul">
<li class="formatter-li"> <a class="offload" href="https://wiki.archlinux.org/title/pam_mount">pam_mount</a>
</li><li class="formatter-li"> <a class="offload" href="https://www.spinics.net/linux/fedora/fedora-users/msg500088.html">Mount samba share using pam_mount</a><br />
</li></ul><br />
<br />
J'ai donc modifié le fichier /etc/pam.d/gdm-password et j'ai ajouté les lignes suivantes :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
auth optional pam_mount.so
&nbsp;</pre></pre></div></div><br />
avant la ligne "auth substack password-auth"<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
password optional pam_mount.so
&nbsp;</pre></pre></div></div><br />
avant la ligne "password substack password-auth"<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
session optional pam_mount.so
&nbsp;</pre></pre></div></div><br />
avant la ligne "session required pam_selinux.so close"<br />
<br />
<span class="message-helper bgc warning"><br />
Je l'ai déjà mentionné plus haut mais pour que cela fonctionne, la passphrase du volume ou de la partition cryptée doit être le même que le mot de passe de session.<br />
</span><br />]]></description>
                <pubDate>Tue, 05 Dec 2023 10:58:43 +0100</pubDate>
                
            </item>
		
            <item>
                <title><![CDATA[Monter automatiquement une partition chifréée à l'aide de pam et dracut]]></title>
                <link>https://geekrungis.fr/wiki/monterautomatiquementunepartitionchifreol\'aidedepametdracut</link>
                <guid>https://geekrungis.fr/wiki/monterautomatiquementunepartitionchifreol\'aidedepametdracut</guid>
                <description><![CDATA[test]]></description>
                <pubDate>Wed, 29 Nov 2023 14:35:24 +0100</pubDate>
                
            </item>
		
            <item>
                <title><![CDATA[Paramétrer simplement l'envoi de mail sur un serveur]]></title>
                <link>https://geekrungis.fr/wiki/parametrer-simplement-l-envoi-de-mail-sur-un-serveur</link>
                <guid>https://geekrungis.fr/wiki/parametrer-simplement-l-envoi-de-mail-sur-un-serveur</guid>
                <description><![CDATA[Dans cet article, nous allons décrire comment paramétrer l'envoi de mail à a partir d'un serveur. Cela peut s'avérer très utile pour qu'un serveur envoi des mails lors de la réalisation d'une tache, ou pour intégrer l''envoi d'un mail dans un script.<br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-installationdespaquetsncessaires">Installation des paquets nécessaires</h2><br />

<br />
Je donne les commandes ici pour Debian et dérivés mais ces paquets existent sur d'autres distributions.<br />
<br />
On installe les paquets msmtp, msmtp-mta ainsi que bsd-mailx.<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> apt <span style="color: #c20cb9; font-weight: bold;">install</span> msmtp msmtp-mta bsd-mailx</pre></pre></div></div><br />
<br />
Ce dernier paquet est utile seulement si vous souhaitez utiliser la commande mail pour l'envoi des messages. Sans ce paquet, seule la commande msmtp fonctionne. Pour un script, ce n'est pas grave mais certains logiciels envoient des mails seulement par la commande mail. C'est le cas par exemple de unattended-upgrades<br />
<br />
Vérifier ensuite que le système utilise bien msmtp pour l'envoi de mails :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-la</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sendmail</span>
&nbsp;</pre></pre></div></div><br />
<br />
Doit retourner :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sendmail</span> -<span style="color: #000000; font-weight: bold;">></span> ..<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>msmtp
&nbsp;</pre></pre></div></div><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-configuration">Configuration</h2><br />

<br />
Pour fonctionner, le service s'appui sur le fichier de configuration suivant, à éditer :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>msmtprc</pre></pre></div></div><br />
<br />
<span class="message-helper bgc notice"><br />
Ce fichier fonctionne pour envoyer des mail à partir du compte root. Pour envoyer un mail à partir d'un autre utilisateur, créer un fichier .msmtprc dans le dossier utilisateur<br />
</span><br />
<br />
On peut y insérer les options par défaut pour tous les comptes que l'on paramètre :<br />
<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">&nbsp;
# Valeurs par defaut pour tous les comptes.
defaults
auth           on
tls            on
tls_starttls   off
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile        /var/log/msmtp.log
&nbsp;</pre></pre></div></div><br />
<br />
<span class="message-helper bgc warning"><br />
Attention à la configuration en fonction de votre fournisseur de mail. Par exemple, Infomaniak ne supporte pas le STARTTLS il faut utiliser le port 465, activer tls mais désactiver STARTTLS<br />
</span><br />
<br />
<br />
<span class="message-helper bgc warning"><br />
L'utilisateur qui enverra le mail doit avoir accès au fichier de log. On peut donc soit créer un fichier de log dans le dossier de l'utilisateur soit lui donner les droits sur ce fichier de log.<br />
</span><br />
<br />
On créé ensuite une partie pour chaque compte que l'on souhaite paramétrer :<br />
<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">&nbsp;
account            [nom du compte]
host               [serveur smtp]
port               [port smtp]
from               [adresse mail] ou [Nom expéditeur]
user               [utilisateur du compte mail utilisé]
password           [mot de passe du compte mail]
&nbsp;</pre></pre></div></div><br />
<br />
Par exemple, pour un compte gmail<br />
<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">&nbsp;
account            Gmail rungis
host               smtp.gmail.com
port               587
from               Rungis
user               votreadressemail@gmail.com
password           MonMotDePasseGmail
&nbsp;</pre></pre></div></div><br />
<br />
Ajouter une ligne à la fin du fichier pour spécifier le nom du compte par défaut à utiliser<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
account default : Gmail rungis
&nbsp;</pre></pre></div></div><br />
<br />
<span class="message-helper bgc warning"><br />
Vu que le fichier contient le mot de passe du compte mail, pensez à réduire les droits sur ce fichier avec les commandes suivantes :<br />
</span><br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> root:root <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>msmtprc
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">600</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>msmtprc
&nbsp;</pre></pre></div></div><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-test">Test</h2><br />

<br />
Vous pouvez ensuite tester l'envoi d'un mail par la commande suivante :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"Corps du mail"</span> <span style="color: #000000; font-weight: bold;">|</span> mail <span style="color: #660033;">-s</span> <span style="color: #ff0000;">"Sujet du mail"</span> <span style="color: #660033;">--</span> destinataire<span style="color: #000000; font-weight: bold;">@</span>gmail.com</pre></pre></div></div><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-installation-de-mutt">Installation de mutt</h2><br />

<br />
msmtp fonctionne seul mais mutt offre plus de fonctionnalités, notamment l'envoi de pièces jointes.<br />
<br />
On installe mutt :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
apt update
apt <span style="color: #c20cb9; font-weight: bold;">install</span> mutt
&nbsp;</pre></pre></div></div><br />
<br />
Puis on créé le fichier .muttrc dans le dossier home de l'utilisateur :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">vim</span> ~<span style="color: #000000; font-weight: bold;">/</span>.muttrc
&nbsp;</pre></pre></div></div><br />
<br />
Et on y ajoute les lignes suivantes :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">sendmail</span>=<span style="color: #ff0000;">"/bin/msmtp"</span>
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">use_from</span>=no
&nbsp;</pre></pre></div></div><br />
<br />
<span class="message-helper bgc notice"><br />
Pas besoin de plus d'options, le reste est déjà défini dans le fichier de configuration de msmtp<br />
</span><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-test-avec-mutt">Test avec mutt</h2><br />

<br />
On peut tout d'abord créer une petite pièce jointe de test<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"coucou"</span> <span style="color: #000000; font-weight: bold;">>></span> fichiertest.txt
&nbsp;</pre></pre></div></div><br />
<br />
Puis on envoi ce fichier à l'adresse souhaitée :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"texte dans le mail"</span> <span style="color: #000000; font-weight: bold;">|</span> mutt <span style="color: #660033;">-s</span> <span style="color: #ff0000;">"Sujet du mail"</span> <span style="color: #660033;">-a</span> fichiertest.txt <span style="color: #660033;">--</span> adresse<span style="color: #000000; font-weight: bold;">@</span>mail.from
&nbsp;</pre></pre></div></div><br />]]></description>
                <pubDate>Sun, 12 Nov 2023 19:27:32 +0100</pubDate>
                
            </item>
		
            <item>
                <title><![CDATA[Gestion des paquets sous Debian]]></title>
                <link>https://geekrungis.fr/wiki/gestion-des-paquets-sous-debian</link>
                <guid>https://geekrungis.fr/wiki/gestion-des-paquets-sous-debian</guid>
                <description><![CDATA[Ici, je ne vous ferai pas un article sur comment installer un paquet mais juste quelques commandes qu'on utilise pas souvent mais qui sont pratiques.<br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-rtrograderunpaquet">Rétrograder un paquet</h2><br />

<br />
Si vous avez besoin de réinstaller une version plus ancienne d'un paquet :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> apt <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #007800;">packagename</span>=version
&nbsp;</pre></pre></div></div><br />
<br />
<span class="message-helper bgc notice"><br />
packagename = nom du paquet<br />
version = version souhaitée du paquet<br />
</span><br />
<br />
Par exemple, pour rétrograder influlxdb2 de la version 2.7.3-1 à la version 2.7.1-1 :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> apt <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #007800;">influxdb2</span>=2.7.1-<span style="color: #000000;">1</span>
&nbsp;</pre></pre></div></div><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-empcherlamiseojourd'unpaquet">Empêcher la mise à jour d'un paquet</h2><br />

<br />
En lien avec la commande précédente, si vous souhaitez que ce même paquet ne soit pas mis à jour lors de vos prochains update :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-mark</span> hold influxdb2
&nbsp;</pre></pre></div></div><br />
<br />
Vous pouvez lister les paquets bloqués :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-mark</span> showhold
&nbsp;</pre></pre></div></div><br />
<br />
<span class="message-helper bgc warning"><br />
Attention à ne pas laisser un paquet bloqué trop longtemps. Vous pourrez avoir des problèmes de sécurité avec un paquet non mis à jour.<br />
</span><br />]]></description>
                <pubDate>Sun, 12 Nov 2023 15:18:43 +0100</pubDate>
                
            </item>
		
	</channel>
</rss>
