Minituff / nautical-backup

A simple Docker volume backup tool.
https://minituff.github.io/nautical-backup/
GNU General Public License v3.0
246 stars 3 forks source link

Container with override-source-dir label does not support comma values #323

Open aprice30 opened 2 months ago

aprice30 commented 2 months ago

So I have the following compose.yaml

services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    container_name: nginx_proxy_manager_app
    restart: unless-stopped
    labels:
      nautical-backup.enable: true
      nautical-backup.group: npm
    ports:
      - '80:80'       # HTTP
      - '81:81'       # Admin UI
      - '443:443'     # HTTPS
    networks:
      - homelab
    environment:
      DB_MYSQL_HOST: "db"
      DB_MYSQL_PORT: 3306
      DB_MYSQL_USER: $MYSQL_USER
      DB_MYSQL_PASSWORD: $MYSQL_PASSWORD
      DB_MYSQL_NAME: $MYSQL_DATABASE
    volumes:
      - app_data:/data
      - app_letsencrypt:/etc/letsencrypt
  db:
    image: 'mariadb:latest'
    container_name: nginx_proxy_manager_db
    restart: unless-stopped
    labels:
      nautical-backup.enable: true
      nautical-backup.group: npm
      nautical-backup.override-source-dir: nginxproxymanager_db_mysql
    networks:
      - homelab
    env_file:
      - stack.env
    volumes:
      - db_mysql:/var/lib/mysql
networks:
  homelab:
    external: true
volumes:
  app_data:
  app_letsencrypt:
  db_mysql:

As you can see it has 2 services and the app service has 2 volumes. As I am using portainer and compose the volumes are called:

I tried to apply the following label but it is ignored and the volumes are skipped (https://minituff.github.io/nautical-backup/labels/#override-source-directory-name)

nautical-backup.override-source-dir=nginxproxymanager_app_data,nginxproxymanager_app_letsencrypt

To get this to work I had to use the global VAR

OVERRIDE_SOURCE_DIR=nginx_proxy_manager_app:nginxproxymanager_app_data,nginx_proxy_manager_app:nginxproxymanager_app_letsencrypt

So it seems the container label does not allow a comma separated list but the global does. Would be nice if they were similar as its annoying most config is at my container level except this one.

Minituff commented 2 months ago

Hi,

Thanks for mentioning the nautical-backup.override-source-dir label not accepting multiple values. I should be able to fix this.

I'm looking through your config. I noticed the volumes app_data, app_letsencrypt, db_mysql are not bind mounts. Currently, this is the only type of volume that Nautical natively supports. We do currently have an issue open to track this here https://github.com/Minituff/nautical-backup/issues/304.

I have started on this feature already, but I think it's going to end up being a fairly large update and will require the transition to Version 3.0 -- meaning it will introduce some breaking changes from V2.

I can help you move over to bind mounts if you'd like, or you can standby a little bit until I get V3 rolled out.

aprice30 commented 2 months ago
        It seems to work with the volumes except I do get some errors about chown while it copies folders. The files appear to copy but it says attributes may not have copies.I will stick with docker volumes for now and wait for v3 I think. I’ll watch those issues and can test when released.    ---- On Wed, 18 Sep 2024 01:41:07 +0100  ***@***.******@***.***> wrote ----  

Hi, Thanks for mentioning the nautical-backup.override-source-dir label not accepting multiple values. I should be able to fix this. I'm looking through your config. I noticed the volumes app_data, app_letsencrypt, db_mysql are not bind mounts. Currently, this is the only type of volume that Nautical natively supports. We do currently have an issue open to track this here #304. I have started on this feature already, but I think it's going to end up being a fairly large update and will require the transition to Version 3.0 -- meaning it will introduce some breaking changes from V2. I can help you move over to bind mounts if you'd like, or you can standby a little bit until I get V3 rolled out.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>