From 582f351216738f5f50d45ca1a27e45618811c69d Mon Sep 17 00:00:00 2001 From: Xavier Logerais Date: Tue, 7 Oct 2025 00:07:42 +0200 Subject: [PATCH 1/3] feat: Add unattended-upgrades system profile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a new system profile to enable automatic security updates on Ubuntu containers using unattended-upgrades. Features: - Automatic installation of unattended-upgrades and apt-listchanges - Daily security updates for Ubuntu packages - Weekly cleanup of unused packages - Configurable automatic reboot (disabled by default) - ESM (Extended Security Maintenance) updates support Configuration: - Updates check: Daily - Security updates: Automatic - Autoclean interval: 7 days - Automatic reboot: Disabled (can be enabled by setting to "true") - Reboot time: 02:00 (if enabled) - Remove unused dependencies: Enabled Usage: Apply this profile to any Ubuntu container to enable automatic security updates: lxc profile assign mycontainer default,unattended-upgrades Closes #5 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../system/unattended-upgrades.profile.yaml | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 profiles/system/unattended-upgrades.profile.yaml diff --git a/profiles/system/unattended-upgrades.profile.yaml b/profiles/system/unattended-upgrades.profile.yaml new file mode 100644 index 0000000..1ec5166 --- /dev/null +++ b/profiles/system/unattended-upgrades.profile.yaml @@ -0,0 +1,32 @@ +name: unattended-upgrades +description: "Profil pour activer les unattended upgrades sur Ubuntu" +devices: {} +config: + cloud-init.vendor-data: | + #cloud-config + package_update: true + package_upgrade: true + packages: + - unattended-upgrades + - apt-listchanges + + write_files: + - path: /etc/apt/apt.conf.d/20auto-upgrades + content: | + APT::Periodic::Update-Package-Lists "1"; + APT::Periodic::Unattended-Upgrade "1"; + APT::Periodic::AutocleanInterval "7"; + + - path: /etc/apt/apt.conf.d/50unattended-upgrades + content: | + Unattended-Upgrade::Allowed-Origins { + "${distro_id}:${distro_codename}"; + "${distro_id}:${distro_codename}-security"; + "${distro_id}ESM:${distro_codename}"; + }; + Unattended-Upgrade::Automatic-Reboot "false"; + Unattended-Upgrade::Automatic-Reboot-Time "02:00"; + Unattended-Upgrade::Remove-Unused-Dependencies "true"; + + runcmd: + - [ systemctl, enable, --now, unattended-upgrades ] -- 2.43.0 From 0a363c086aa95273d39cd3a1c3ef187eb99960bb Mon Sep 17 00:00:00 2001 From: Xavier Logerais Date: Sat, 11 Oct 2025 19:25:47 +0200 Subject: [PATCH 2/3] feat: Add profile to install streamrip application --- profiles/applications/streamrip.profile.yaml | 49 ++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 profiles/applications/streamrip.profile.yaml diff --git a/profiles/applications/streamrip.profile.yaml b/profiles/applications/streamrip.profile.yaml new file mode 100644 index 0000000..b92aec4 --- /dev/null +++ b/profiles/applications/streamrip.profile.yaml @@ -0,0 +1,49 @@ +name: streamrip +description: Install streamrip (https://github.com/nathom/streamrip) +config: + cloud-init.vendor-data: | + #cloud-config + + # Packages + package_update: true + package_upgrade: true + packages: + - curl + - python3-venv + - build-essential + - zlib1g-dev + - libjpeg-dev + + users: + - name: rip + groups: sudo + shell: /bin/bash + sudo: ['ALL=(ALL) NOPASSWD:ALL'] + + write_files: + - path: /tmp/setup-mise.bash + permissions: '0755' + owner: root:root + content: | + #!/bin/bash + echo "This script runs as the user" $(whoami) > /tmp/setup-mise.log + exec 2>&1 >> /tmp/setup-mise.log + + # Install mise + curl https://mise.run | sh + echo 'test -x ~/.local/bin/mise && source <(~/.local/bin/mise activate bash)' >> ~/.bashrc + + # Activate mise + test -x ~/.local/bin/mise && source <(~/.local/bin/mise activate bash) + + # Configure mise + mise settings set experimental true + mise use -g usage # for completion + + # Install streamrip + mise use -g python + mise use -g pipx + mise use -g pipx:streamrip + + runcmd: + - sudo -u rip /tmp/setup-mise.bash -- 2.43.0 From ce80ba0ee8564984b7b5ea735920e8698ff404e6 Mon Sep 17 00:00:00 2001 From: Xavier Logerais Date: Mon, 6 Oct 2025 23:47:52 +0200 Subject: [PATCH 3/3] chore: minor changes in profiles - reorder keys - clean useless (dynamic) fields - rename somes profile to normalize naming --- network/back.network.yaml | 16 ++++------------ network/front.network.yaml | 6 +++--- network/home.network.yaml | 6 +++--- network/public.network.yaml | 4 ++-- profiles/limits/size-small.profile.yaml | 5 +++++ profiles/proxy/proxy-docker-tcp.profile.yaml | 2 +- profiles/proxy/proxy-docker-unix.profile.yaml | 3 +-- 7 files changed, 19 insertions(+), 23 deletions(-) create mode 100644 profiles/limits/size-small.profile.yaml diff --git a/network/back.network.yaml b/network/back.network.yaml index a5d05fc..ee8556b 100644 --- a/network/back.network.yaml +++ b/network/back.network.yaml @@ -1,3 +1,7 @@ +name: network-back +description: "Back network" +managed: true +type: bridge config: dns.domain: back.lxd dns.zone.forward: back.lxd @@ -5,15 +9,3 @@ config: ipv4.nat: "true" ipv6.address: fd42:7d68:cedd:4230::1/64 ipv6.nat: "true" -description: "" -name: back -type: bridge -used_by: -- /1.0/instances/gitea -- /1.0/instances/postgresql -- /1.0/profiles/back -- /1.0/profiles/frontback -managed: true -status: Created -locations: -- none diff --git a/network/front.network.yaml b/network/front.network.yaml index 442b04b..e79f88f 100644 --- a/network/front.network.yaml +++ b/network/front.network.yaml @@ -1,7 +1,7 @@ -type: bridge -name: front -description: "Frontend network" +name: network-front +description: "Front network" managed: true +type: bridge config: dns.domain: front.lxd dns.zone.forward: front.lxd diff --git a/network/home.network.yaml b/network/home.network.yaml index 2563376..c73adc4 100644 --- a/network/home.network.yaml +++ b/network/home.network.yaml @@ -1,7 +1,7 @@ -type: bridge -name: home -description: "home network" +name: network-home +description: "Home network" managed: true +type: bridge config: dns.domain: home.lxd dns.zone.forward: home.lxd diff --git a/network/public.network.yaml b/network/public.network.yaml index da15e79..9cf6ad6 100644 --- a/network/public.network.yaml +++ b/network/public.network.yaml @@ -1,7 +1,7 @@ -name: public +name: network-public description: "Public network" -type: bridge managed: true +type: bridge config: dns.domain: public.lxd dns.zone.forward: public.lxd diff --git a/profiles/limits/size-small.profile.yaml b/profiles/limits/size-small.profile.yaml new file mode 100644 index 0000000..8cbf72e --- /dev/null +++ b/profiles/limits/size-small.profile.yaml @@ -0,0 +1,5 @@ +name: size-small +description: "Small sized instance limits" +limits: + cpu: 1 + memory: 2GB diff --git a/profiles/proxy/proxy-docker-tcp.profile.yaml b/profiles/proxy/proxy-docker-tcp.profile.yaml index aa7b383..b58ecf4 100644 --- a/profiles/proxy/proxy-docker-tcp.profile.yaml +++ b/profiles/proxy/proxy-docker-tcp.profile.yaml @@ -1,7 +1,7 @@ name: proxy-docker-tcp description: Expose private docker sock via tcp on the host devices: - dockersock: + docker: type: proxy listen: tcp:0.0.0.0:2375 connect: unix:/run/docker.sock diff --git a/profiles/proxy/proxy-docker-unix.profile.yaml b/profiles/proxy/proxy-docker-unix.profile.yaml index 3a19765..623e992 100644 --- a/profiles/proxy/proxy-docker-unix.profile.yaml +++ b/profiles/proxy/proxy-docker-unix.profile.yaml @@ -1,9 +1,8 @@ name: proxy-docker-unix description: Expose the Docker socket as a Unix socket devices: - docker-socket: + docker: type: proxy - # listen: unix:/tmp/lxd-docker-unix.sock listen: unix:/var/run/docker.sock connect: unix:/run/docker.sock uid: 1000 -- 2.43.0