non-root container with s6-overlay#798
Conversation
This using s6-overlay to manage processes need to run in the container. jsonrpc2-helper is migrated into the startscript.
|
@bbernhard this is a first draft of my non-root approach. It replaces #789 If you can take a quick look if it going into the right direction or if you see anything showstopper or things that doesn't fit for you. It is a draft. Not heavily tested jet. Need still some cleanup e.g. removal of if you don't want to build on your own for first tests, you can use: ghcr.io/poggenpower/signal:noroot-s6. It is |
|
Many thanks for your PR! I think it might be a good idea to merge any changes to a separate branch - I've just created the Regarding the I'll try to find some time in the next days to check out the code and play a little bit with it myself to get a better feeling how s6 works :) |
|
I have changed the PR to Regarding the wrapper. Shell works pretty well for mangling ENVs and such. I would see a real advantage if there is a real go-wrapper which serves the socket and feed the java sub process to get rid of the ugly Regarding s6-overlay. Unfortunately I was not able to go with |
|
Thanks! I finally found some time to play around with your changes and on my system it's working pretty well so far - great work! (only checked on my x86-64 system for now, but it looks really promising!) A few small things I've noticed:
But those things are really some small details - so there's no need to fix them right now. If you are fine with your PR, I'd like to get your changes merged to the branch. After that, I'd pull in the latest changes from the |
|
just added GIN_MODE
I have used Yes, I think it is good to merge for some testing. still needs cleanup:
|
great, thanks!
Ah, sorry, missed that you used the So I am totally fine with debian :)
Great, then I'll merge it right away. Thanks! |
|
Hello, I'd like to test this as well. Do I need to modify anything anything in the docker compose file, apart from the image now being "bbernhard/signal-cli-rest-api:rootless-latest"? [edit] Which permissions should I assign to the folder mapped to |
The docker compose file should work in the same manner.
At the moment the UID/GID is hard coded to 1000 - as it was before. So for security reasons all files should be owned by this user. As java/signal-cli rely on the ability to lookup a UID by username, changing the UID is tricky. Podman is far better suited to run as non-root. something like: Please report any issue, you stumble upon. I am happy to look into it. |
|
In case anyone else tries and runs into my issue, I had to change the docker compose. I simply swapped the image tag in my docker compose but got this error at first:
first docker compose versionnetworks:
docker-vlan1005:
external: true
services:
signal-api:
container_name: signal-api
image: bbernhard/signal-cli-rest-api:rootless-latest
environment:
MODE: native # can only use normal/native with AUTO_RECEIVE_SCHEDULE
AUTO_RECEIVE_SCHEDULE: 0 22 * * *
LOG_LEVEL: debug
volumes:
# The folder contains the password and cryptographic keys when a new number is registered
- ${DOCKER_PATH}/services/notifications/signal-api/config:/home/.local/share/signal-cli
networks:
docker-vlan1005:
ipv4_address: ${SIGNAL_API_IPV4}
ipv6_address: ${SIGNAL_API_IPV6}
restart: unless-stopped
security_opt:
- no-new-privileges:true
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/v1/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30sThen, the friendly AI suggested I had to remove "no-new-privileges:true" and add tmpfs:
- /run:exec,size=64mthen it worked. If I took a wrong turn somewhere, let me know. Many thanks for this @poggenpower. |
|
@Qhilm thank you for sharing your feedback. you should keep it for security reasons. should be enough to allow s6 to start. Please test and share error message |
|
Tuned it a little, this is working for me: forced all to |
|
Did some further test. It looks like, this it is possible to run with any UID with the compose file above just replace all occurrences. |
|
Hello, if I simply add back but if I add Thanks a lot! |
from test and conversation in closed PR bbernhard#798
This using s6-overlay to manage processes need to run in the container.
s6-services/contains all files for services control.entrypoint.shis not executed anymorejsonrpc2-helper is migrated into the startscript s6-services/signal-json-rpc/run. I don't see an advantage to use a separate
generator. I think it is all in one place now and not less maintainable.