Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
homeserver:orangepi3b [2024/10/03 17:26] – supprimée - modification externe (Date inconnue) 127.0.0.1 | homeserver:orangepi3b [2024/11/22 18:26] (Version actuelle) – cyrille | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
+ | ====== Orange PI 3B ====== | ||
+ | |||
+ | <WRAP center round important 60%> | ||
+ | Globalement pour l' | ||
+ | [[homeserver: | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | [[homeserver: | ||
+ | |||
+ | Pour utilisation serveur auto hébergé. | ||
+ | Un grand merci à https:// | ||
+ | |||
+ | |||
+ | ===== Liens ===== | ||
+ | |||
+ | * https:// | ||
+ | * https:// | ||
+ | * https:// | ||
+ | * https:// | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== Augmenter la zram des log ===== | ||
+ | Par défaut que 50Mo, le serveur râle de temps en temps... | ||
+ | |||
+ | Pour augmenter cela, éditer | ||
+ | |||
+ | <code | download> | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | Et passer à 500 Mo | ||
+ | <code | download> | ||
+ | # size of the tmpfs mount -- | ||
+ | # please keep in mind to adjust / | ||
+ | SIZE=50M | ||
+ | </ | ||
+ | |||
+ | Rebooter | ||
+ | |||
+ | ===== Brancher un disque USB au démarrage pour augmenter le stockage ===== | ||
+ | |||
+ | Dans mon cas, sert à créer un stockage externe nextclound (qui hébergera notamment la musique de Navidrome) | ||
+ | |||
+ | Editer le fstab et insérer cette ligne. Les options sont importantes afin que la séquence de boot ne soit pas perturbée. | ||
+ | |||
+ | <code | download> | ||
+ | UUID=a85a287d-6bc2-4b6d-8219-33ea9cd3d2e2 /diskUSB ext4 user, | ||
+ | </ | ||
+ | |||
+ | ===== Nextcloud ===== | ||
+ | Afin d' | ||
+ | |||
+ | ===== Gestion Ventilo ===== | ||
+ | Pour l' | ||
+ | A adapter avec le ventillo. | ||
+ | |||
+ | Le script | ||
+ | <code | download> | ||
+ | cat scripts/ | ||
+ | #!/bin/bash | ||
+ | |||
+ | WAIT=0.5 | ||
+ | |||
+ | gpio mode 10 out | ||
+ | gpio mode 6 out | ||
+ | gpio mode 5 out | ||
+ | |||
+ | while true; do | ||
+ | |||
+ | gpio write 10 0 | ||
+ | gpio write 6 0 | ||
+ | gpio write 5 0 | ||
+ | |||
+ | sleep $WAIT | ||
+ | |||
+ | gpio write 10 1 | ||
+ | gpio write 6 1 | ||
+ | gpio write 5 1 | ||
+ | |||
+ | sleep $WAIT | ||
+ | |||
+ | done | ||
+ | </ | ||
+ | |||
+ | |||
+ | Le service systemd | ||
+ | <code | download> | ||
+ | cat / | ||
+ | [Unit] | ||
+ | Description=Gestion du ventilateur | ||
+ | ConditionPathExists=/ | ||
+ | after=network.target | ||
+ | |||
+ | [Service] | ||
+ | Type=forking | ||
+ | ExecStart=/ | ||
+ | TimeoutSec=0 | ||
+ | StandardOutput=tty | ||
+ | RemainAfterExit=yes | ||
+ | SysVStartPriority=99 | ||
+ | |||
+ | [Install] | ||
+ | WantedBy=multi-user.target | ||
+ | </ | ||
+ | |||
+ | Activer le service au démarrage | ||
+ | <code | download> | ||
+ | systemctl enable fan.service | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Bug carte ethernet ===== | ||
+ | |||
+ | Je ne sais pourquoi la carte ethernet du jour au lendemain est devenue HS. Impossible d' | ||
+ | |||
+ | Bug référencé ici | ||
+ | https:// | ||
+ | |||
+ | La solution est d' | ||
+ | |||
+ | <code | download> | ||
+ | #!/bin/sh | ||
+ | |||
+ | # SOURCE | ||
+ | |||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | |||
+ | / | ||
+ | </ | ||
+ | |||
+ | Par contre il faudra le lancer après chaque reboot... Donc le coller sur une crontab root | ||
+ | |||
+ | <code | download> | ||
+ | # | ||
+ | # For more information see the manual pages of crontab(5) and cron(8) | ||
+ | # | ||
+ | # m h dom mon dow | ||
+ | |||
+ | # Fix ethernet bug | ||
+ | @reboot / | ||
+ | </ | ||
+ | |||
+ | <WRAP center round todo 60%> | ||
+ | Attention cette procédure semble changer l'ipv6 de la carte, donc il faut mettre à jour sa zone DNS... A suivre. | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Ajout d' | ||
+ | Modifier le message d' | ||
+ | |||
+ | Le message d' | ||
+ | Il suffit de les préfixer d'un nombre, ils sont lus par ordre croissant. | ||
+ | < | ||
+ | ls / | ||
+ | 10-orangepi-header | ||
+ | 10-uname | ||
+ | 30-orangepi-sysinfo | ||
+ | </ | ||
+ | |||
+ | Exemple d' | ||
+ | < | ||
+ | # nano / | ||
+ | </ | ||
+ | |||
+ | Avec ce contenu | ||
+ | <code | download> | ||
+ | #!/bin/bash | ||
+ | # Afficher | ||
+ | |||
+ | DISK=/ | ||
+ | NOMDISK=" | ||
+ | |||
+ | # Couleurs | ||
+ | VERT=" | ||
+ | COLDEFAUT=" | ||
+ | |||
+ | echo -e " | ||
+ | |||
+ | echo "" | ||
+ | </ | ||
+ | |||
+ | Le rendre executable | ||
+ | < | ||
+ | # chmod +x / | ||
+ | </ | ||
+ | |||
+ | Puis au prochain log, l' | ||
+ | |||
+ | Pour le tester de suite | ||
+ | < | ||
+ | update-motd | ||
+ | </ | ||
+ | ===== Migration vers DEBIAN 12 / YUNOHOST 12 ===== | ||
+ | Passage sans soucis | ||
+ | |||
+ | Mise à jour complète au préalable et backups des apps et du systeme | ||
+ | <code | download> | ||
+ | yunohost tools update | ||
+ | yunohost tools upgrade apps | ||
+ | yunohost tools upgrade system | ||
+ | </ | ||
+ | |||
+ | Backups | ||
+ | <code | download> | ||
+ | yunohost backup create --apps -n 20241109apps -o /diskUSB | ||
+ | yunohost backup create --system -n 20241109sys -o /diskUSB | ||
+ | </ | ||
+ | |||
+ | Lancement de la migration | ||
+ | <code | download> | ||
+ | yunohost tools migrations run | ||
+ | yunohost tools migrations run --accept-disclaimer | ||
+ | </ | ||
+ | |||
+ | Accès refusé aux pages internet, relancer nginx et c'est réglé | ||
+ | <code | download> | ||
+ | service nginx restart | ||
+ | </ | ||
+ | |||
+ | Soucis au niveau d'apt. Pour le régler : | ||
+ | <code | download> | ||
+ | yunohost tools regen-conf apt --dry-run --with-diff | ||
+ | yunohost tools regen-conf apt --force | ||
+ | </ | ||
+ | |||
+ | Soucis au niveau d'une clef (ugly) méthode pour le régler : | ||
+ | <code | download> | ||
+ | cd /etc/apt | ||
+ | cp trusted.gpg trusted.gpg.d | ||
+ | </ | ||
+ | |||
+ | Installation du rspamd pose soucis. Suffit de supprimer l' | ||
+ | <code | download> | ||
+ | apt purge rspamd | ||
+ | rm -rf /etc/rspamd | ||
+ | </ | ||
+ | Et d' | ||
+ | |||
+ | <code | download> | ||
+ | yunohost --version | ||
+ | yunohost: | ||
+ | repo: stable | ||
+ | version: 12.0.6 | ||
+ | yunohost-admin: | ||
+ | repo: stable | ||
+ | version: 12.0.3.5 | ||
+ | yunohost-portal: | ||
+ | repo: stable | ||
+ | version: 12.0.6 | ||
+ | moulinette: | ||
+ | repo: stable | ||
+ | version: 12.0.3 | ||
+ | ssowat: | ||
+ | repo: stable | ||
+ | version: 12.0.3 | ||
+ | </ | ||
+ | <code | download> | ||
+ | lsb_release -a | ||
+ | No LSB modules are available. | ||
+ | Distributor ID: Debian | ||
+ | Description: | ||
+ | Release: 12 | ||
+ | Codename: | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== Créer une liste blanche (whitelist) et une liste noire (blacklist) pour rspamd (yunohost 12) ===== | ||
+ | |||
+ | |||
+ | Après avoir relu la doc très consistante de **rspamd** et épluché le web, j’ai adopté cette solution qui me convient (elle peut être très adaptée à tous les besoins mais faut l’assimiler ;) | ||
+ | |||
+ | Donc, tout ce passe dans /etc/rspamd et surtout dans le dossier local.d/ (donc dans **/ | ||
+ | |||
+ | De base, il n’y a que le fichier redis.conf | ||
+ | |||
+ | Créer un fichier de **multimap.conf** contenant la map suivante : | ||
+ | |||
+ | <code | download> | ||
+ | WHITELIST_SENDER_DOMAIN { | ||
+ | type = " | ||
+ | filter = " | ||
+ | map = " | ||
+ | action = " | ||
+ | } | ||
+ | |||
+ | WHITELIST_SENDER_EMAIL { | ||
+ | type = " | ||
+ | map = " | ||
+ | action = " | ||
+ | } | ||
+ | |||
+ | BLACKLIST_SENDER_DOMAIN { | ||
+ | type = " | ||
+ | filter = " | ||
+ | map = " | ||
+ | action = " | ||
+ | } | ||
+ | |||
+ | BLACKLIST_SENDER_EMAIL { | ||
+ | type = " | ||
+ | map = " | ||
+ | action = " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Créer ensuite un fichier **whitelist.sender.domain.map** qui permettra une liste blanche basée sur le domaine.extension et un fichier **whitelist.sender.email.map** qui fournira une liste blanche basée sur l’adresse mail | ||
+ | |||
+ | Donc, par exemple **whitelist.sender.domain.map** | ||
+ | |||
+ | <code | download> | ||
+ | site1.ext | ||
+ | site2.ext | ||
+ | </ | ||
+ | |||
+ | Et pour les adresses mails **whitelist.sender.email.map** | ||
+ | |||
+ | <code | download> | ||
+ | mail@site1.ext | ||
+ | mail@site2.ext | ||
+ | </ | ||
+ | |||
+ | Faire de même pour la liste noire, pour cela créer 2 fichiers **blacklist.sender.domain.map** et **blacklist.sender.email.map** et les renseigner comme ceux de la liste blanche. Sinon les laisser vides. | ||
+ | |||
+ | Attention, pour la blacklist , les mails reviendront à l’expéditeur avec ce message | ||
+ | |||
+ | <code | download> | ||
+ | < | ||
+ | BLACKLIST_SENDER_DOMAIN (in reply to end of DATA command) | ||
+ | </ | ||
+ | |||
+ | Relancer ensuite **rpsamd** | ||
+ | |||
+ | <code | download> | ||
+ | service rspamd restart | ||
+ | </ | ||
+ | |||
+ | C’est mis en place | ||
+ | |||
+ | Plus d’infos ici : [[https:// | ||
+ | |||
+ | |||