GithubHelp home page GithubHelp logo

Comments (7)

justinsangoi avatar justinsangoi commented on August 25, 2024

I've been working at this a little bit this morning and I've tried several variations.

Using this:

--entrypoint sh -c 'apk add jq; while ! [ -e /data/acme.json ] || ! [ `jq ".[] | .Certificates | length" /data/acme.json` != 0 ]; do sleep 1; done && traefik-certs-dumper file --version v2 --watch --source /data/acme.json --dest /data/certs'

Gives the following Error:

image

Using this:

--entrypoint "sh -c 'apk add jq; while ! [ -e /data/acme.json ] || ! [ `jq \".[] | .Certificates | length\" /data/acme.json` != 0 ]; do sleep 1; done && traefik-certs-dumper file --version v2 --watch --source /data/acme.json --dest /data/certs'"

Gives this error, which I'm inclined to believe is closer to correct but it somehow thinks the directories don't exist despite the volumes very clearly being defined in the parameters above:

image

At this point, I'm not sure if it's Unraid parsing it incorrectly, as I expect it to just take the field in the GUI and intsert it as is into the command. I think if I somehow get it working using command line as a docker run command I can at least rule out that the conversion from Docker Compose is correct.

from traefik-certs-dumper.

justinsangoi avatar justinsangoi commented on August 25, 2024

Trying to run this as a docker run:

docker run -d --name='traefik-certs-dumper' --net='bridge' -v '/mnt/user/appdata/traefik/':'/data/' --entrypoint "sh -c 'apk add jq; while ! [ -e /data/acme.json ] || ! [ `jq ".[] | .Certificates | length" /data/acme.json` != 0 ]; do sleep 1; done && traefik-certs-dumper file --version v2 --watch --source /data/acme.json --dest /data/certs' 'ldez/traefik-certs-dumper:latest'"

Comes out with this error:

jq: error: Could not open file /data/acme.json: No such file or directory
"docker run" requires at least 1 argument.
See 'docker run --help'.

Usage:  docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

Run a command in a new container

Same error it seems - an issue accessing the file under /data/

I know this file exists at the mapped location. I'm missing something here in the syntax I believe.

from traefik-certs-dumper.

justinsangoi avatar justinsangoi commented on August 25, 2024

Seems I'm having some kind of permissions issue. I don't understand how, as the docker system in unraid is root, but it seems that the /data path isn't mounting.

from traefik-certs-dumper.

justinsangoi avatar justinsangoi commented on August 25, 2024

I'm almost certain it's a permissions issue because when I attempt to read and parse the acme.json from SSH as root, it works until I add a select statement to the jq, at which point bash throws an error stating it doesn't have access.

image

This aligns with the error that the attempted docker run statement is throwing. That the path or file doesn't exist, implying it cannot mount it to access it.

from traefik-certs-dumper.

PrplHaz4 avatar PrplHaz4 commented on August 25, 2024

I'm almost certain it's a permissions issue because when I attempt to read and parse the acme.json from SSH as root, it works until I add a select statement to the jq, at which point bash throws an error stating it doesn't have access.

Try explicitly mounting the acme.json - i remember having some issues with the traefik container when just the parent directory was mapped.

from traefik-certs-dumper.

justinsangoi avatar justinsangoi commented on August 25, 2024

I'm almost certain it's a permissions issue because when I attempt to read and parse the acme.json from SSH as root, it works until I add a select statement to the jq, at which point bash throws an error stating it doesn't have access.

Try explicitly mounting the acme.json - i remember having some issues with the traefik container when just the parent directory was mapped.

That's actually the first way I attempted to do it. You can see in the first screenshot of my unraid GUI attempts that I was mapping the acme.json by it's file name. Afterwards, I tried just mapping the entire folder and that didn't work either, same error.

The owner of the file is root, because traefik runs as root in the container, but what confuses me is I'm running docker as root and it still cannot access it.

from traefik-certs-dumper.

justinsangoi avatar justinsangoi commented on August 25, 2024

I tried adding the PGID and PUID defaults that containers use on Unraid and it didnt' solve the directory/file missing error.

So there is still an access issue here. I may dig a bit more, but I've currently got a user script set up that uses jq to extract the keys and install them correctly.

from traefik-certs-dumper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.