blastbeng / spotisub

Spotify to subsonic Playlist Generator and Importer
MIT License
105 stars 6 forks source link

Cannot append to existing Navidrome compose #1

Closed janaxhell closed 2 months ago

janaxhell commented 2 months ago

Hi, I'm trying to deploy this, but I'm getting this error:

Failed to deploy a stack: validating /data/compose/2/docker-compose.yml: services.navidrome Additional property subtify is not allowed

I have tried to append the subtify part of your compose to my existing Navidrome compose, because I have many ENV already in place. What happens if I deploy it as-is, separately? Will it see Navidrome?

version: "3"
services:
  navidrome:
    image: deluan/navidrome:latest
    user: 998:100 # should be owner of volumes
    ports:
      - "4533:4533"
    restart: unless-stopped
    environment:
      # Optional: put your config options customization here. Examples:
      ND_SCANSCHEDULE: 5 6 * * 0
      ND_LOGLEVEL: info  
      ND_SESSIONTIMEOUT: 72h
      ND_BASEURL: "/music"
      ND_PLAYLISTSPATH: "lidarr/playlists"
      # ND_IMAGECACHESIZE: "100MB"
      ND_SPOTIFY_ID: XXXXXXXXXXXXXXXXXXXXXXXX
      ND_SPOTIFY_SECRET: XXXXXXXXXXXXXXXXXXXXXXXXXXX
      ND_LASTFM_ENABLED: true
      ND_LASTFM_APIKEY: 7XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
      ND_LASTFM_SECRET: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
      ND_SUBSONICARTISTPARTICIPATIONS: true
      ND_LISTENBRAINZ_BASEURL: http://192.168.1.94:42010/apis/listenbrainz/1/
      ND_UIWELCOMEMESSAGE: Be water my friend
      ND_ENABLEREPLAYGAIN: true
      ND_ENABLESHARING: true
      ND_ENABLESTARRATING: true
      ND_IGNOREDARTICLES: "The El La Los Las Le Les Os As O A Il Lo La Gli"
      ND_ENABLEFAVOURITES: true
      ND_ENABLEEXTERNALSERVICES: true
      ND_ENABLECOVERANIMATION: true
      ND_COVERARTPRIORITY: embedded, folder.*, cover.*, front.*
      ND_JUKEBOX_ENABLED: true

    volumes:
      - "/srv/dev-disk-by-uuid-5b67514d-485e-4306-873e-b1cbb54ccf99/Config/Navidrome:/data"
      - "/srv/dev-disk-by-uuid-BAF04088F0404D37/data/media/unmapped:/music/unmapped"
      - "/srv/dev-disk-by-uuid-BAF04088F0404D37/data/media/music:/music/lidarr"

    subtify:
        container_name: subtify
        environment:
            - PUID=998
            - PGID=100
            - TZ=Europe/Rome
            - SPOTIPY_CLIENT_ID=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            - SPOTIPY_CLIENT_SECRET=XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            - SPOTIPY_REDIRECT_URI=http://127.0.0.1:8080/
            - SUBSONIC_API_HOST=http://192.168.1.94
            - SUBSONIC_API_PORT=4533
            - SUBSONIC_API_USER=XXXXXXXXXXXXX
            - SUBSONIC_API_PASS=XXXXXXXXXXXXX
        image: "blastbeng/subtify:latest"
        restart: always
        volumes:
            - "/srv/dev-disk-by-uuid-5b67514d-485e-4306-873e-b1cbb54ccf99/Config/subtify/.env:/home/user/subtify/.env"
            - "/srv/dev-disk-by-uuid-5b67514d-485e-4306-873e-b1cbb54ccf99/Config/subtify/cache:/home/user/subtify/cache"
        ports:
            - 50811:50811
        healthcheck:
            test: ["CMD", "curl", "-f", "http://192.168.1.94:50811/utils/healthcheck"]
            interval: 15s
            timeout: 5s
            retries: 12
        labels:
            - "com.centurylinklabs.watchtower.enable=true"

networks:
  default:
    external:
      name: omv1   
blastbeng commented 2 months ago

You have a bad formatting in your yaml, subtify is as the same level as volumes. Check your compose file or try with this yaml:

version: "3"
services:
  navidrome:
    image: deluan/navidrome:latest
    user: 998:100 # should be owner of volumes
    ports:
      - "4533:4533"
    restart: unless-stopped
    environment:
      # Optional: put your config options customization here. Examples:
      ND_SCANSCHEDULE: 5 6 * * 0
      ND_LOGLEVEL: info  
      ND_SESSIONTIMEOUT: 72h
      ND_BASEURL: "/music"
      ND_PLAYLISTSPATH: "lidarr/playlists"
      # ND_IMAGECACHESIZE: "100MB"
      ND_SPOTIFY_ID: XXXXXXXXXXXXXXXXXXXXXXXX
      ND_SPOTIFY_SECRET: XXXXXXXXXXXXXXXXXXXXXXXXXXX
      ND_LASTFM_ENABLED: true
      ND_LASTFM_APIKEY: 7XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
      ND_LASTFM_SECRET: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
      ND_SUBSONICARTISTPARTICIPATIONS: true
      ND_LISTENBRAINZ_BASEURL: http://192.168.1.94:42010/apis/listenbrainz/1/
      ND_UIWELCOMEMESSAGE: Be water my friend
      ND_ENABLEREPLAYGAIN: true
      ND_ENABLESHARING: true
      ND_ENABLESTARRATING: true
      ND_IGNOREDARTICLES: "The El La Los Las Le Les Os As O A Il Lo La Gli"
      ND_ENABLEFAVOURITES: true
      ND_ENABLEEXTERNALSERVICES: true
      ND_ENABLECOVERANIMATION: true
      ND_COVERARTPRIORITY: embedded, folder.*, cover.*, front.*
      ND_JUKEBOX_ENABLED: true

    volumes:
      - "/srv/dev-disk-by-uuid-5b67514d-485e-4306-873e-b1cbb54ccf99/Config/Navidrome:/data"
      - "/srv/dev-disk-by-uuid-BAF04088F0404D37/data/media/unmapped:/music/unmapped"
      - "/srv/dev-disk-by-uuid-BAF04088F0404D37/data/media/music:/music/lidarr"

  subtify:
    container_name: subtify
    environment:
      - PUID=998
      - PGID=100
      - TZ=Europe/Rome
      - SPOTIPY_CLIENT_ID=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
      - SPOTIPY_CLIENT_SECRET=XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
      - SPOTIPY_REDIRECT_URI=http://127.0.0.1:8080/
      - SUBSONIC_API_HOST=http://192.168.1.94
      - SUBSONIC_API_PORT=4533
      - SUBSONIC_API_USER=XXXXXXXXXXXXX
      - SUBSONIC_API_PASS=XXXXXXXXXXXXX
    image: "blastbeng/subtify:latest"
    restart: always
    volumes:
      - "/srv/dev-disk-by-uuid-5b67514d-485e-4306-873e-b1cbb54ccf99/Config/subtify/.env:/home/user/subtify/.env"
      - "/srv/dev-disk-by-uuid-5b67514d-485e-4306-873e-b1cbb54ccf99/Config/subtify/cache:/home/user/subtify/cache"
    ports:
      - 50811:50811
    healthcheck:
      test: ["CMD", "curl", "-f", "http://192.168.1.94:50811/utils/healthcheck"]
      interval: 15s
      timeout: 5s
      retries: 12

networks:
  default:
    external:
      name: omv1  

and also you don't need these lines if you don't use watchtower.

 labels:
            - "com.centurylinklabs.watchtower.enable=true"

Anyways it also works if you deploy it separately..

Also remember to run the first_run.sh script after your first compose up.

docker compose exec -it subtify /home/user/subtify/first_run.sh --interactive --tty

blastbeng commented 2 months ago

I am closing this, since it was just an indentation error

Reopen if you have any other issue.

janaxhell commented 2 months ago

Thanks, I'll try again. Portainer usually prevents me to deploy if there is an indentation error, seems this time it missed it. Just one thing: I do use watchtower, but I never add any label about it to my containers and they are always updated fine. Is this something specific to subtify?

EDIT I have deployed the second part of the compose separately and after a few minutes as "Starting", it now shows as "Unhealthy" in Portainer. I have tried the script, but it says the container is not running. The log is stuck like this:


[uWSGI] getting INI configuration from uwsgi.ini
*** Starting uWSGI 2.0.21 (64bit) on [Wed Sep 11 19:48:41 2024] ***
compiled with version: 10.2.1 20210110 on 09 September 2024 22:46:17
os: Linux-6.1.0-0.deb11.21-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.90-1~bpo11+1 (2024-05-06)
nodename: 158ba914baa5
machine: x86_64
clock source: unix
detected number of CPU cores: 4
current working directory: /home/user/subtify
detected binary path: /home/user/.local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
your memory page size is 4096 bytes
 *** WARNING: you have enabled harakiri without post buffering. Slow upload could be rejected on post-unbuffered webservers *** 
detected max file descriptor number: 1048576
lock engine: pthread robust mutexes
thunder lock: enabled
uWSGI http bound on 0.0.0.0:50811 fd 4
uwsgi socket 0 bound to TCP address 127.0.0.1:40515 (port auto-assigned) fd 3
Python version: 3.10.15 (main, Sep  9 2024, 18:01:49) [GCC 10.2.1 20210110]
Python main interpreter initialized at 0x56534619dbc0
python threads support enabled
your server socket listen backlog is limited to 4096 connections
your mercy for graceful operations on workers is 60 seconds
mapped 145808 bytes (142 KB) for 1 cores
*** Operational MODE: single process ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 7)
spawned uWSGI worker 1 (pid: 8, cores: 1)
spawned uWSGI http 1 (pid: 9)
░██████╗██╗░░░██╗██████╗░████████╗██╗███████╗██╗░░░██╗
██╔════╝██║░░░██║██╔══██╗╚══██╔══╝██║██╔════╝╚██╗░██╔╝
╚█████╗░██║░░░██║██████╦╝░░░██║░░░██║█████╗░░░╚████╔╝░
░╚═══██╗██║░░░██║██╔══██╗░░░██║░░░██║██╔══╝░░░░╚██╔╝░░
██████╔╝╚██████╔╝██████╦╝░░░██║░░░██║██║░░░░░░░░██║░░░
╚═════╝░░╚═════╝░╚═════╝░░░░╚═╝░░░╚═╝╚═╝░░░░░░░░╚═╝░░░
                              v0.0.3 

```WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x56534619dbc0 pid: 8 (default app)