Skip to content

Conversation

@buchdag
Copy link
Member

@buchdag buchdag commented Jan 18, 2025

Fix proposed by @andrei-datcu for #1179

The entrypoint will fail if test -S $socket_file is false but only display a warning if test -r $socket_file is false.

Fail if test -S $socket_file is false. Only display a warning if test -r $socket_file is false.
@buchdag buchdag added the type/fix PR for a bug fix label Jan 18, 2025
@buchdag buchdag self-assigned this Jan 18, 2025
@buchdag buchdag linked an issue Jan 18, 2025 that may be closed by this pull request
@andrei-datcu
Copy link

I don't have the proper historical context of why the -r check was introduced, but for the original problem the check tried to resolve would this change work or would the -S check fail before -r test would get a chance to run? I was thinking the -r check would only be done if the -S failed to try and output a more explicit error message.

@buchdag
Copy link
Member Author

buchdag commented Jan 18, 2025

The -r check was added here #1149

So maybe something like this instead ?

if [[ ! -S $socket_file ]]; then if [[ ! -r $socket_file ]]; then echo "Warning: Docker host socket at $socket_file might not be readable. Please check user permissions" >&2 echo "If you are in a SELinux environment, try using: '-v /var/run/docker.sock:$socket_file:z'" >&2 fi echo "Error: you need to share your Docker host socket with a volume at $socket_file" >&2 echo "Typically you should run your container with: '-v /var/run/docker.sock:$socket_file:ro'" >&2 exit 1 fi 
@andrei-datcu
Copy link

Yes, that looks better to me.

@buchdag buchdag marked this pull request as ready for review January 18, 2025 18:57
@buchdag
Copy link
Member Author

buchdag commented Jan 18, 2025

Done, pushed as nginxproxy/acme-companion:1182 if you wish to try it before we merge this.

@andrei-datcu
Copy link

I've just tested it and it's working nicely. Thank you! :)

@buchdag buchdag merged commit f47ced8 into main Jan 19, 2025
36 checks passed
@buchdag buchdag deleted the fix/1179 branch January 19, 2025 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/fix PR for a bug fix

3 participants