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

Wrong IP address #565

Open
2 tasks done
emonfejm opened this issue Jul 18, 2024 · 2 comments
Open
2 tasks done

Wrong IP address #565

emonfejm opened this issue Jul 18, 2024 · 2 comments

Comments

@emonfejm
Copy link

The problem

It is picking wrong IP addres:

export HOST_IP=$(hostname -I | awk '{print $1}')

If I have 2 IP addresses it is picking dynamic one which means it will be changed every time I restart machine. I want to use my static IP address: 192.168.1.230

+ [ native = json-rpc ]
+ hostname -I
+ awk {print $1}
+ export HOST_IP=172.30.32.1 
+ exec setpriv --reuid=1000 --r

and after restart

+ [ native = json-rpc ]
+ hostname -I
+ awk {print $1}
+ export HOST_IP=172.30.33.2
+ exec setpriv --reuid=1000 --r

Is there an option to chose the IP address? If not what is the reason for that?

Are you using the latest released version?

  • Yes

Have you read the troubleshooting page?

  • Yes

What type of installation are you running?

Home Assistant Signal Addon

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

@bbernhard
Copy link
Owner

You can use the SWAGGER_IP environment variable to override that (see https://github.com/bbernhard/signal-cli-rest-api?tab=readme-ov-file#advanced-settings)

@pmalek
Copy link

pmalek commented Jul 26, 2024

I'm also struggling with this problem (running docker daemon in VM on Mac, separate network unreachable from host).

Setting SWAGGER_IP doesn't help:

docker inspect signal-api | jq ".[0].Config.Env"
[
  "MODE=native",
  "SWAGGER_IP=192.168.1.95",
  "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
  "GIN_MODE=release",
  "PORT=8080",
  "BUILD_VERSION=0.85",
  "SIGNAL_CLI_CONFIG_DIR=/home/.local/share/signal-cli",
  "SIGNAL_CLI_UID=1000",
  "SIGNAL_CLI_GID=1000"
]
docker logs signal-api -f
+ set -e
+ [ -z /home/.local/share/signal-cli ]
+ usermod -u 1000 signal-api
usermod: no changes
+ groupmod -g 1000 signal-api
+ chown 1000:1000 -R /home/.local/share/signal-cli
+ cat
+ cap_prefix=-cap_
+ cat /proc/sys/kernel/cap_last_cap
+ seq -s ,-cap_ 0 40
+ caps=-cap_0,-cap_1,-cap_2,-cap_3,-cap_4,-cap_5,-cap_6,-cap_7,-cap_8,-cap_9,-cap_10,-cap_11,-cap_12,-cap_13,-cap_14,-cap_15,-cap_16,-cap_17,-cap_18,-cap_19,-cap_20,-cap_21,-cap_22,-cap_23,-cap_24,-cap_25,-cap_26,-cap_27,-cap_28,-cap_29,-cap_30,-cap_31,-cap_32,-cap_33,-cap_34,-cap_35,-cap_36,-cap_37,-cap_38,-cap_39,-cap_40
+ [ native = json-rpc ]
+ hostname -I
+ awk {print $1}
+ export HOST_IP=172.17.0.2
+ exec setpriv --reuid=1000 --regid=1000 --init-groups --inh-caps=-cap_0,-cap_1,-cap_2,-cap_3,-cap_4,-cap_5,-cap_6,-cap_7,-cap_8,-cap_9,-cap_10,-cap_11,-cap_12,-cap_13,-cap_14,-cap_15,-cap_16,-cap_17,-cap_18,-cap_19,-cap_20,-cap_21,-cap_22,-cap_23,-cap_24,-cap_25,-cap_26,-cap_27,-cap_28,-cap_29,-cap_30,-cap_31,-cap_32,-cap_33,-cap_34,-cap_35,-cap_36,-cap_37,-cap_38,-cap_39,-cap_40 signal-cli-rest-api -signal-cli-config=/home/.local/share/signal-cli
time="2024-07-26T11:51:53Z" level=info msg="Started Signal Messenger REST API"
[GIN] 2024/07/26 - 11:52:07 | 200 |  871.332174ms |      172.17.0.1 | GET      "/v1/qrcodelink?device_name=signal-api"
[GIN] 2024/07/26 - 11:52:37 | 200 |   664.77195ms |      172.17.0.1 | GET      "/v1/qrcodelink?device_name=signal-api"

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

No branches or pull requests

3 participants