Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] Moving guide and use from shell and run towards compose. #77

Open
BansheeHero opened this issue Apr 15, 2022 · 1 comment

Comments

@BansheeHero
Copy link

BansheeHero commented Apr 15, 2022

Hi,

Since both docker and podman are now using compose files I think it would be nice to do the same.
The benefits are:

  1. Easier deployment and auto-update solo or with other services
  2. Easier guides and support (We can see and help users adjust their compose files.)
    As well as the opportunity to restructure the README.md file.

Turning something like this:

# Security risk: Loading JSON from a remote share.
docker run -d --name audioserve_nfs -p 3000:3000 \
        --user 1099:3000 \
        -v /mnt/share/audiobooks/cz:/audiobooks/cz \
        -v /mnt/share/audiobooks/en:/audiobooks/en \
        -v /mnt/share/audiobooks/digest:/audiobooks/digest \
        -v /mnt/share/audiobooks/audioserve/:/home/audioserve/.audioserve \
        -e AUDIOSERVE_SHARED_SECRET=yourpassword \
        izderadicka/audioserve \
                --tags \
                --behind-proxy \
                --transcoding-max-parallel-processes 24 \
                --positions-backup-file /home/audioserve/.audioserve/positions-backup.json \
                --positions-backup-schedule "0 3 * * *" \
        /audiobooks/cz \
        /audiobooks/en \
        audiobooks/digest

Into something compatible with compose. I am not versed well with docker so I am still trying to write it.
Any suggestions?

version: '3'
services:
  audioserve:
    image: izderadicka/audioserve
    restart: always
    ser: "1099:3000"
    ports:
      - "3000:3000/tcp"
    volumes:
      - /mnt/share/audiobooks/audioserve/:/home/audioserve/.audioserve:Z
      - /mnt/share/audiobooks/en:/audiobooks/en:Z
      - /mnt/share/audiobooks/digest:/audiobooks/digest:Z
      - /mnt/share/audiobooks/cz:/audiobooks/cz:Z
    environment:
      - PUID=1099
      - GUID=3000
      - "AUDIOSERVE_SHARED_SECRET=yourpassword"
    command:
      #      - --no-authentication
      - --tags
      - --behind-proxy
      - --transcoding-max-parallel-processes
      - 24
      - --positions-backup-file
      - /home/audioserve/.audioserve/positions-backup.json
      - --positions-backup-schedule
      - "0 3 * * *"
      - /audiobooks/cz
      - /audiobooks/en
      - /audiobooks/digest

Unfortunately I am stuck at:

podman create --name=audioserve_audioserve_1 --label io.podman.compose.config-hash=123 --label io.podman.compose.project=audioserve --label io.podman.compose.version=0.0.1 --label com.docker.compose.project=audioserve --label com.docker.compose.project.working_dir=/containers/audioserve --label com.docker.compose.project.config_files=docker-compose.yml --label com.docker.compose.container-number=1 --label com.docker.compose.service=audioserve -e PUID=1099 -e GUID=3000 -e AUDIOSERVE_SHARED_SECRET=yourpassword -v /mnt/share/audiobooks/audioserve:/home/audioserve/.audioserve:Z -v /mnt/share/audiobooks/en:/audiobooks/en:Z -v /mnt/share/audiobooks/digest:/audiobooks/digest:Z -v /mnt/share/audiobooks/cz:/audiobooks/cz:Z --net audioserve_default --network-alias audioserve -p 3000:3000/tcp --restart always izderadicka/audioserve --tags --behind-proxy --transcoding-max-parallel-processes 24 --positions-backup-file /home/audioserve/.audioserve/positions-backup.json --positions-backup-schedule 0 3 * * * /audiobooks/cz /audiobooks/en /audiobooks/digest
4acde37a155beda4fd5f111c5bb42de414cabf857b23429519de374ab15e32b0
exit code: 0
podman start -a audioserve_audioserve_1
Error: unable to start container 4acde37a155beda4fd5f111c5bb42de414cabf857b23429519de374ab15e32b0: lsetxattr /mnt/share/audiobooks/digest/Discworld: operation not permitted
exit code: 125

Moving away from command-line syntax should be great for the project and systems that support compose are growing. (and CLI is still functional on docker and podman)

What do you think?

@izderadicka
Copy link
Owner

First technical note to proposed Compose file - if you're using different then default user you must also use --data-dir parameter. As audioserve is defaulting it to ~/.audioserve, which for different user does not exist.
Also looks like you have there ser instead of user.

For the problem looks like it's about permissions - audiserve does not have access to that directory. Maybe related to ser instead user? - then default UID is used. So check user and access.

Now generally to running audioserve. You're right it's getting bit complicated as program envolves.

I thing what is missing is more detailed documentation on common usage scenarios and how to run audioserve in these.

Compose file is for sure good valid option (but I think compose has more value for running multiple services), so having solid example would be nice.
But there are other valid options:

  • shell script - for single service, as in our case, it looks quite similar to Compose file. Almost everything is just parameter to docker run or audioserve. And not everybody is keen of YAML syntax plus shell script can do more.
  • audioserve has it's own config file, where you can set all it's arguments and transcoding details can be set only in this config. It's not much documented unfortunately. This is what I'm using for my instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants