Outils pour utilisateurs

Outils du site


blog

8 billet(s) pour mars 2026

Notes conteneurs oras artifact OCI2026/03/23 21:13Jean-Baptiste
Notes podman secret2026/03/23 15:10Jean-Baptiste
Notes ansible podman2026/03/23 14:08Jean-Baptiste
Notes podman volume2026/03/23 14:00Jean-Baptiste
Find list - Trouver des fichiers à partir d'une liste2026/03/18 14:32Jean-Baptiste
AWX inventaire vault2026/03/17 18:04Jean-Baptiste
AWX - Configuration git en local (sans serveur web)2026/03/05 16:24Jean-Baptiste
OpenSMTP2026/03/03 16:58Jean-Baptiste

Notes webmail Roundcube

docker run -ti --rm -p 127.0.0.1:8081:80 \
    -e ROUNDCUBEMAIL_DEFAULT_HOST=tls://imap.acme.fr \
    -e ROUNDCUBEMAIL_SMTP_SERVER=smtp.acme.fr \
    -e ROUNDCUBEMAIL_SMTP_PORT=25 \
    roundcube/roundcubemail
docker ps
docker update --restart unless-stopped 22eac34b881c

/etc/nginx/sites-available/mail.acme.fr

server {                            
    if ($host = mail.acme.fr) {                 
        return 301 https://$host$request_uri;              
    } # managed by Certbot                                                   
 
 
        listen 80;
        listen [::]:80;
        server_name mail.acme.fr;
        return 301 https://mail.acme.fr$request_uri;                     
 
 
} 
 
server {
        #listen 127.0.0.1:444 ssl;
        listen 443 ssl;
        listen [::]:443 ssl;
 
        server_name mail.acme.fr;
        ssl_certificate /etc/letsencrypt/live/mail.acme.fr/fullchain.pem; # managed by Certbot
        ssl_certificate_key /etc/letsencrypt/live/mail.acme.fr/privkey.pem; # managed by Certbot
        ssl_session_timeout 5m;
        ssl_prefer_server_ciphers on;
        #ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_protocols TLSv1.2;
        ssl_ciphers ALL:!aNULL:!eNULL:!LOW:!EXP:!RC4:!3DES:+HIGH:+MEDIUM;
        #ssl_dhparam /etc/ssl/private/dh2048.pem;
        ssl_dhparam /etc/nginx/ssl/dhparam4.pem;
        add_header Strict-Transport-Security max-age=2678400;
 
        #auth_basic "Restricted";
        #auth_basic_user_file /etc/nginx/wiki.htpasswd;
        client_max_body_size 20m;
        proxy_read_timeout 3600;
 
 
        location / {
                 proxy_redirect off;
                 proxy_set_header Host $http_host;
                 proxy_set_header X-Forwarded-Server $host;
                 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                 proxy_set_header X-Real-IP $remote_addr;
                 proxy_pass http://127.0.0.1:8081;
        }
 
}

/etc/postfix/main.cf

# Ajouter le réseau de Docker dans mynetworks
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 172.16.0.0/12

Puis

postfix reload

Cela permet de pouvoir envoyer des mails à soi-même dans le cas où nous interdisons les mails de “mondomain.com” depuis internet.

Voir smtpd_client_restrictions = permit_mynetworks, check_client_access hash:/etc/postfix/client_checks

Pb

Erreur upstream timed out (110: Connection timed out)
2023/03/23 16:24:33 [error] 20264#20264: *66053 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 192.168.78.117, server: mail.acme.fr, request: "GET /?_task=mail&_action=search&_interval=&_q=plop&_headers=text&_layout=widescreen&_filter=ALL&_scope=all&_remote=1&_unlock=loading1679585013210&_=1679584230928 HTTP/1.1", upstream: "http://127.0.0.1:8081/?_task=mail&_action=search&_interval=&_q=david&_headers=text&_layout=widescreen&_filter=ALL&_scope=all&_remote=1&_unlock=loading1679585013210&_=1679584230928", host: "mail.acme.fr", referrer: "https://mail.acme.fr/?_task=mail&_mbox=INBOX"
Solution
Pb taille des pièces jointes
Solution
2025/03/24 15:06

Notes Webdav

Serveur

Voir :

Vérifier que votre serveur implémente implémente correctement le protocole Webdav avec Litmus

WebDAV server protocol compliance test suite

Nginx

Voir proxy_request_buffering off;

apt-get install nginx-full

/etc/nginx/sites-available/webdav

server {
    listen 80;
    server_name webdav.acme.fr;
 
    access_log  /var/log/nginx/webdav-access.log;
    error_log  /var/log/nginx/webdav-error.log;
 
    autoindex on;
    charset utf-8;
    client_max_body_size 10M;
 
location / {
    root /var/www/webdav;
 
    #client_body_temp_path /var/www/webdav-tmp;
 
    dav_methods PUT DELETE MKCOL COPY MOVE;
    dav_ext_methods PROPFIND OPTIONS;
    #auth_basic_user_file $HOME/.htpasswd;
    #min_delete_depth 0;
 
    #auth_basic "Restricted";
    #auth_basic_user_file /etc/nginx/webdav.htpasswd;
 
    create_full_put_path  on;
    dav_access user:rw group:rw all:r;
 
    limit_except GET {
        allow 192.168.1.22;
        allow all;
        #deny  all;
    }
}
}
davserver (python)

Voir :

#sudo apt-get install python3-webdav
python3 -m pip install PyWebDAV3

config.ini

[DAV]
 
#baseurl =
baseurl = https://dav.acme.fr
 
# Verbose?
# verbose enabled is like loglevel = INFO
verbose = 1
 
#log level : DEBUG, INFO, WARNING, ERROR, CRITICAL (Default is WARNING)
#loglevel = WARNING
 
# main directory 
directory = /var/www/webdav
 
# Server address
port = 8082
host = localhost
 
# disable auth
noauth = 1
 
# Enable mysql auth
mysql_auth=0
 
# admin user
user = test
password = test00
 
# daemonize?
daemonize = 0
daemonaction = start
 
# instance counter
counter = 0
 
# mimetypes support
#mimecheck = 1
mimecheck = 0
 
# webdav level (1 = webdav level 2)
lockemulation = 1
 
# internal features
#chunked_http_response = 1
#http_request_use_iterator = 0
#http_response_use_iterator = 0
su - www-data 
davserver -c config.ini
Weborf - Le serveur ultra léger

https://github.com/ltworf/weborf/blob/master/examples/auth.py

apt-get install weborf
python /usr/share/doc/weborf/examples/auth.py
chmod 777 /tmp/weborf_auth.socket
iptables -A INPUT -i eth0 -p tcp -m tcp --dport 8083 -j REJECT
iptables-save > /etc/iptables/rules.v4

Client

Voir :

davfs2 http://doc.ubuntu-fr.org/davfs2

cadaver https://webdav.acme.fr

Pour ne pas taper le mdp à chaque fois

~/.netrc

default
login    myusername
password P@ssw0rd
 
machine  webdav.acme.fr
login    myusername
password P@ssw0rd
chmod 600 ~/.netrc

Voir man netrc

Exemple de fichier conf (commandes lancées automatique au démarrage de cadaver)

~/.cadaverrc

set editor vim
set pager less
set tolerant

cd home
WDFS

Voir aussi :

Ajout de l'utilisateur “jean” au groupe “fuse” Apparement pas nécessaire si fuse est installé alors qu'il n'existe pas de compte “fuse” Est-ce lié à systemd ?

adduser jean fuse

Montage (dans un dossier vide)
Exemples :

mkdir -p ~/mnt/wd-partage
wdfs -o username=utilisateur -o password=MDP_En_Clair https://webdav.acme.fr/partage ~/mnt/wd-partage

Pour démonter

fusermount -u ~/mnt/

Protocole

Curl

Faut-il préciser le Content-Type ?

curl -XPROPFIND https://user:pass@dav.acme.fr/ -H "Depth:infinity" |xmllint --format -
 
curl --request PROPFIND  --user user:pass --header "Content-Type: text/xml" --header "Brief:t" --data "<D:propfind xmlns:D='DAV:'><D:prop><D:displayname/></D:prop></D:propfind>" https://dav.acme.fr/
 
curl -X PROPFIND -H "Content-Type: text/xml" http://USER:PASSWORD@HOST/owncloud/remote.php/webdav/FOLDER | xmllint --format -

Envoyer un fichier

curl -X PUT https://webdav.server/dir/file.txt -d @~/file.txt

Déplacer un fichier

curl -X MOVE -H 'Destination: https://webdav.server/dir/file2.txt' https://webdav.server/dir/file.txt

Juste un bout d'un fichier grâce à Content-Range

curl -H 'Content-Range: bytes 10-20/*' https://webdav.server/dir.file.txt
2025/03/24 15:06

Notes web

Coloration syntaxique

La coloration syntaxique de la note précédente a été faite avec pygmentize. Par exemple:

pygmentize -f html -l cpp -o code.html code

Pour récupérer le style CSS:

pygmentize -f html -S colorful

web worker / worker API / consumers

Three parties :

  • The web worker is responsible for running scripts in its own separate thread.
  • The worker API exposes a consumer-to-provider communication interface.
  • The consumers want to run some scripts outside the main thread, so they don’t block the main thread.

Source : https://pyodide.org/en/stable/usage/webworker.html

2025/03/24 15:06

Notes Wayland

Voir :

Voir aussi :

Désactiver Wayland et repasser à Xorg

/etc/gdm3/daemon.conf

[daemon]
WaylandEnable=false
 
[debug]
# Uncomment the line below to turn on debugging
#Enable=true

Suis-je sous Xorg X11 ou sous Wayland

$ echo $XDG_SESSION_TYPE
x11

$ echo $XDG_SESSION_TYPE
wayland

# Xorg ou Xwayland ?
$ ps -e |grep X
 1467 tty7     3-00:41:28 Xorg
jean@debian10:~$ loginctl 
SESSION  UID USER SEAT  TTY
      1 1000 jibe seat0    

1 sessions listed.
jibe@debian10:~$ loginctl show-session 1
Id=1
User=1000
Name=jean
Timestamp=Wed 2019-12-18 15:33:31 CET
TimestampMonotonic=17592338
VTNr=7
Seat=seat0
Display=:0
Remote=no
Service=sddm-autologin
Scope=session-1.scope
Leader=589
Audit=1
Type=x11
Class=user
Active=yes
State=active
IdleHint=no
IdleSinceHint=0
IdleSinceHintMonotonic=0
LockedHint=no

ou

$ loginctl
SESSION  UID USER       SEAT TTY   STATE  IDLE SINCE
      1 1000 management -    pts/1 active yes  2 weeks 1 day ago

1 sessions listed.

$ loginctl show-session 1 -p Type
Type=tty

$ echo $XDG_RUNTIME_DIR
/run/user/1000/

Faire fonctionner Synaptic en root

xhost +si:localuser:root

~/.bashrc

alias synaptic="xhost +si:localuser:root ; sudo /usr/sbin/synaptic ; xhost -si:localuser:root"

VNC

WayPipe

Le déport d'affichage X11 de ssh fonctionne sous Wayland comme auparavant pour les applications X11. Les applications Wayland natives ne fonctionnent pas en déport d'affichage.

Voir https://linuxfr.org/users/tarnyko/journaux/waypipe-affichage-distant-natif-pour-wayland

Concrètement, c’est aussi simple que de lancer waypipe ssh user@192.168.1.20 xterm entre deux machines équipées du binaire waypipe dans leur $PATH

waypipe ssh user@192.168.1.20 xterm
gnome-remote-desktop

Voir :

Install de Gnome Remote Desktop (dépend de PipeWire)

apt-get install gnome-remote-desktop

Enabling

Open Settings, select Sharing, and enable Screen sharing. This should automatically enable the service and you should immediately be able to connect via VNC.

Autres

MOZ_ENABLE_WAYLAND=1 firefox
 
sudo flatpak override --socket=wayland org.mozilla.firefox
sudo flatpak override --env MOZ_ENABLE_WAYLAND=1 org.mozilla.firefox

Voir https://linuxfr.org/users/antistress/journaux/parametrer-wayland-et-webrender-pour-firefox-sur-ma-distrib

Pb

Err
$ kitty
[066 14:06:15.666193] [glfw error 65544]: Wayland: Failed to connect to display
Solution

https://github.com/glfw/glfw/issues/1390

mv /usr/lib/kitty/kitty/glfw-wayland.so{,.orig}
2025/03/24 15:06
blog.txt · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki