Posts

Showing posts from 2024

Debian 12 (Proxmox Mail Gateway) and starting mailCow mail service

Hello. If You have a problem with starting the MailCow mail service on the Debian 12 (Proxmox Mail Gateway iso) You can use this article . 1. Need to check what template to use Apparmor root@pmg:/home/user# apparmor_status apparmor module is loaded. 10 profiles are loaded. 9 profiles are in enforce mode. docker-default /usr/bin/freshclam /usr/lib/NetworkManager/nm-dhcp-client.action /usr/lib/NetworkManager/nm-dhcp-helper /usr/lib/connman/scripts/dhclient-script /usr/sbin/clamd /{,usr/}sbin/dhclient lsb_release nvidia_modprobe nvidia_modprobe//kmod 0 profiles are in complain mode 0 profiles are in kill mode. 0 profiles are in unconfined mode. 108 processes have profiles defined. 1 processes are in enforce mode.   2. Create apparmor template in /etc/apparmor.d/docker-default #include <tunables/global> profile docker-default flags=(attach_disconnected,mediate_deleted) { #include <abstractions/base> ptrace peer=@{profile_name}, network, capabi...

Custom outgoing IP from docker container

Image
Hi. If You want to configure a custom docker container to use one public IPs that are located on the host system You can use this schema. First, need install docker engine on the system  - install docker   Next, create docker networks  like this --------------------------------------------------------- docker network create --attachable --opt 'com.docker.network.bridge.name=my-network-1' --opt 'com.docker.network.bridge.enable_ip_masquerade=false' --subnet=172.20.10.0/24 --gateway=172.20.10.1 my-network-1 docker network create --attachable --opt 'com.docker.network.bridge.name=my-network-2' --opt 'com.docker.network.bridge.enable_ip_masquerade=false'   --subnet=172.20.20.0/24 --gateway=172.20.20.1 my-network-2 docker network create --attachable --opt 'com.docker.network.bridge.name=my-network-3' --opt 'com.docker.network.bridge.enable_ip_masquerade=false'  --subnet=172.20.30.0/24 --gateway=172.20.30.1 my-network-3 ------------------------...

Docker certbor autoreNEW cert cron job

Hi. If You using a Portainer for deploy yours applications with nginx, apache and Let’s Encrypt SSL you will need to auto renew the certificates when they were ended. I'm using that bash script and put it in the  /etc/cron.weekly folder (using UBUNTU 22.03)  #!/bin/bash # Set PATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin # Run the certbot container to renew the certs docker run --rm -v certbot-webroot-VOLUME:/var/www/certbot -v certbot-data-VOLUME:/etc/letsencrypt:rw certbot/certbot renew # Restart container docker restart container-WITH-WEB-SERVER # Copy cert for Portainer cat /var/lib/docker/volumes/certbot-data-VOLUME/_data/live/YOUR.DOMAIN.COM/fullchain.pem > /opt/portainer/certs/cert.pem cat /var/lib/docker/volumes/certbot-data/_data/live/YOUR.DOMAIN.COM/privkey.pem > /opt/portainer/certs/key.pem docker restart portainer PS. When You will put script to the   /etc/cron.weekly   folder don't add an extension to the script ...