signal-cli-rest-api
signal-cli-rest-api copied to clipboard
Latest entrypoint.sh changes: export HOST_IP causing issues.
The problem
https://github.com/bbernhard/signal-cli-rest-api/blob/master/entrypoint.sh#L32 is failing under certain IP configurations.
hostname -i
can return more than one IP, e.g. if IPv6 is configured too. And the man page says it should not be used anymore. See https://stackoverflow.com/questions/13322485/how-to-get-the-primary-ip-address-of-the-local-machine-on-linux-and-os-x
In may case the container is not starting anymore with following error:
+ export HOST_IP=fd61:a8b9:a1ec:9e8e:8222:ec95:d130:f814 172.16.248.31
/entrypoint.sh: 32: export: 172.16.248.31: bad variable name
Are you using the latest released version?
- [X] Yes
Have you read the troubleshooting page?
- [X] Yes
What type of installation are you running?
signal-cli-rest-api Docker Container
In which mode are you using the docker container?
JSON-RPC Mode
What's the architecture of your host system?
x86-64
Additional information
No response
I have the same problem. Since the container is not starting up anymore this should be labeld as a critical bug.
Thanks for the report. It should (hopefully) be fixed. In case you want to give it a try, here's a test image: bbernhard/signal-cli-rest-api:0.101-dev
Yes, at least for me it is working again. Thanks for the quick fix!
This will also return more than one IPv4 address if multiple networks or interfaces are used (also breaking startup)
This will also return more than one IPv4 address if multiple networks or interfaces are used (also breaking startup)
Could you please send me the output of hostname -I
inside the docker container
Here both outputs:
root@signal-cli-rest-api-75f5dbc698-69k65:/# hostname -I
172.16.58.246 fd61:a8b9:a1ec:9e8e:2edd:ae8c:173d:9824
root@signal-cli-rest-api-75f5dbc698-69k65:/# hostname -i
fd61:a8b9:a1ec:9e8e:2edd:ae8c:173d:9824 172.16.58.246
Following the man-page the order is random. I think gathering the IP is a complex thing following the stackoverflow article above.
I am not sure about the usecase you are following. Have you tried to use the hostname or 0.0.0.0 instead of a specific IP?
If I change https://github.com/bbernhard/signal-cli-rest-api/blob/master/src/main.go#L245 to
// swaggerUrl := ginSwagger.URL("http://" + swaggerIp + ":" + string(port) + "/swagger/doc.json")
router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
then it works out of the box with docker. In kubernetes I have to set env SWAGGER_IP
to the exposed service name.
This will also return more than one IPv4 address if multiple networks or interfaces are used (also breaking startup)
Could you please send me the output of
hostname -I
inside the docker container
This is what was put in the startup log with two networks, the first internal for Home Assistant, the other provides WAN. Seems fixed in latest-dev
signal | + hostname -i
signal | + export HOST_IP=172.25.0.6 172.24.0.3
signal | /entrypoint.sh: 32: export: 172.24.0.3: bad variable name