waw-eve / seat-mumble-register

mumble registration and certificate generation plugin for SeAT
GNU General Public License v2.0
0 stars 1 forks source link

Stuck on config #2

Closed deMathias closed 3 years ago

deMathias commented 3 years ago

Hello, first of all thank you for adding a mumble plugin. Teamspeak very costly.

I have added plugin to seat (=ok) image

I have docker running (=ok) image port 81 because 80 in use.

I set up ice on murmur and change config to have new encrypt key and ice password.

on seat i set up like this:

image

after trying to register i get error 500.

image

What am I missing sir?

if you want to chat my discord is Opolusia#0093

KagurazakaNyaa commented 3 years ago

Can you try to use an external IP address for the Agent URL instead of 127.0.0.1? Or if the agent and SeAT are in the same docker network, you can try to use the container name to access the agent.

KagurazakaNyaa commented 3 years ago

I just configured it in the local cluster, and the problem can be reproduced when the URL is configured as 127.0.0.1. I tried the following configuration and it worked very well.

docker-compose.yml

version: "3.3"
services:
  server:
    image: sudoforge/mumble-server
    restart: unless-stopped
    ports:
      - "64738:64738/tcp"
      - "64738:64738/udp"
      - "6502:6502/tcp"
    environment:
      #- MUMBLE_SERVERPASSWORD=
      - MUMBLE_ENABLESSL=0
      - MUMBLE_ICE=tcp -h 0.0.0.0 -p 6502
      - MUMBLE_ICESECRETREAD=testtesttest
      - MUMBLE_ICESECRETWRITE=testtesttest
      - MUMBLE_IMAGEMESSAGELENGTH=0
      - MUMBLE_SENDVERSION=true
      - MUMBLE_DEFAULTCHANNEL=1
      - MUMBLE_SUGGESTPOSITIONAL=true
      - MUMBLE_SUGGESTPUSHTOTALK=true
      - MUMBLE_SUGGESTVERSION=1.3.0
      - SUPERUSER_PASSWORD=testtesttest
    volumes:
      - ./data/mumble:/data

  agent:
    image: alliancewaw/seat-mumble-register
    restart: unless-stopped
    depends_on:
      - server
    ports:
      - 81:80/tcp
    volumes:
      - ./data/agent:/app/data

data/agent/config.json

{
  "encryptKey": "testtesttest",
  "mumbleIceAddr": "tcp -h server -p 6502",
  "mumbleIceSecret": "testtesttest"
}

image

deMathias commented 3 years ago

I have nginx with 2 websites non-docker (seat & tripwire). I will try your solution. But I don't want to open port 81 to public. I only run your app in docker.

KagurazakaNyaa commented 3 years ago

I have nginx with 2 websites non-docker (seat & tripwire). I will try your solution. But I don't want to open port 81 to public. I only run your app in docker.

Maybe you don't have to configure port forwarding to expose this port to the outside, you can try to configure a static IP for this container to access it from the host. Please refer to this answer to try to configure your docker-compose.yml https://stackoverflow.com/a/61954291.

deMathias commented 3 years ago

I have a static IP for the host. If i try the static IP i get the same error. If i use FQDN i now get image

KagurazakaNyaa commented 3 years ago

Can I take a look at the log of your agent. Please execute docker-compose logs agent and attach its output. Please replace the agent in the command with the service name in the docker-compose configuration you actually use.

deMathias commented 3 years ago
[main] INFO com.waw_eve.seat.mumble.App - Load config file success.
[main] INFO com.waw_eve.seat.mumble.utils.CryptUtil - Initializing crypt tool...
[main] INFO com.waw_eve.seat.mumble.utils.CryptUtil - The crypt tool is initialized.
[main] INFO com.waw_eve.seat.mumble.MumbleClient - Initializing mumble client...
Exception in thread "main" com.zeroc.Ice.ConnectionRefusedException
    error = 0
        at com.zeroc.IceInternal.OutgoingAsync.waitForResponseOrUserEx(OutgoingAsync.java:140)
        at com.zeroc.IceInternal.OutgoingAsync.waitForResponse(OutgoingAsync.java:112)
        at com.zeroc.Ice._ObjectPrxI.ice_isA(_ObjectPrxI.java:31)
        at com.zeroc.Ice.ObjectPrx._checkedCast(ObjectPrx.java:949)
        at com.zeroc.Ice.ObjectPrx._checkedCast(ObjectPrx.java:868)
        at Murmur.MetaPrx.checkedCast(MetaPrx.java:749)
        at com.waw_eve.seat.mumble.MumbleClient.init(MumbleClient.java:39)
        at com.waw_eve.seat.mumble.App.main(App.java:54)
Caused by: java.net.ConnectException: Connection refused
        at java.base/sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
        at com.zeroc.IceInternal.Network.doFinishConnect(Network.java:536)
        at com.zeroc.IceInternal.StreamSocket.connect(StreamSocket.java:92)
        at com.zeroc.IceInternal.TcpTransceiver.initialize(TcpTransceiver.java:25)
        at com.zeroc.Ice.ConnectionI.initialize(ConnectionI.java:2116)
        at com.zeroc.Ice.ConnectionI.message(ConnectionI.java:1098)
        at com.zeroc.IceInternal.ThreadPool.run(ThreadPool.java:410)
        at com.zeroc.IceInternal.ThreadPool.access$500(ThreadPool.java:7)
        at com.zeroc.IceInternal.ThreadPool$EventHandlerThread.run(ThreadPool.java:784)
        at java.base/java.lang.Thread.run(Unknown Source)

How can connection be refused ?

image image

deMathias commented 3 years ago

i will retry with ice="tcp -h 0.0.0.0 -p 6502"

edit: same issue

KagurazakaNyaa commented 3 years ago

Mumble's ice listening address cannot be 127.0.0.1, because the agent is a container and does not run on the host network unless you specify network_mode: host

deMathias commented 3 years ago

Sorry I am not sure what I have to do now? Murmur runs bare metal, not docker.

deMathias commented 3 years ago

I guess I can uninstall my murmur and use your docker compose?

KagurazakaNyaa commented 3 years ago

In my production environment, the configuration in mumble-server.ini is ice="tcp -h 0.0.0.0 -p 6502", and the mumbleIceAddr in data/config.json is tcp -h 120.24.***.*** -p 6502

deMathias commented 3 years ago

I try your docker-compose. Same issue:

image Edit: docker overwrite my config.json with defaults. I am connected now but still error 500. image

KagurazakaNyaa commented 3 years ago

When you request, does the agent log have a record like this in INFO com.waw_eve.seat.mumble.http.HttpHandler-received message:Request()?

deMathias commented 3 years ago

I check docker-compose logs, and actually still connection refused....

image

KagurazakaNyaa commented 3 years ago

Did you remember to restart the agent after you modified config.json? docker-compose restart agent

deMathias commented 3 years ago

Yes I did : image

KagurazakaNyaa commented 3 years ago

Yes I did : image

This is mumble server, not agent. Maybe you should restart agent.

deMathias commented 3 years ago

image

i just copied wrong thing i did restart agent.

KagurazakaNyaa commented 3 years ago

image

i just copied wrong thing i did restart agent.

So does the agent still prompt that the connection is refused in the log?

deMathias commented 3 years ago

yes image

KagurazakaNyaa commented 3 years ago

Is your config.json same with the example I provided?

{
  "encryptKey": "testtesttest",
  "mumbleIceAddr": "tcp -h server -p 6502",
  "mumbleIceSecret": "testtesttest"
}
deMathias commented 3 years ago

OK i have now image I have removed and purged all docker volumes and rebuild containers from scratch now i get connection.

deMathias commented 3 years ago

I still get this error on the website after clicking register. image My encryption key is same on seat as in config.json.

KagurazakaNyaa commented 3 years ago

After you initiate this request, is there a record similar to INFO com.waw_eve.seat.mumble.http.HttpHandler-received message:Request() in the agent's log?

deMathias commented 3 years ago

agent log shows nothing except what is in my earlier screenshot.

deMathias commented 3 years ago

image I can connect to the server.

deMathias commented 3 years ago

Even if we do not get this fixed in the end i will send you some isk for all the trouble.

KagurazakaNyaa commented 3 years ago

Then this means that your request did not reach the agent. You try to use curl to access the URL configured in your SeAT, it should return curl: (52) Empty reply from server

deMathias commented 3 years ago

image

KagurazakaNyaa commented 3 years ago

At the same time, after you execute the curl request, a Crypt message failed should be triggered in the agent log

deMathias commented 3 years ago

I have fixed the issue image Thank you for your time and effort. Where can I send ISK?

deMathias commented 3 years ago

Could you tell me what i have to add to the docker-compose file so i get the murmur-setting.conf file ? I don't want to add all the things as enviroment variables.

deMathias commented 3 years ago

Also I will add your plugin to the community packages docs so more people find it!

KagurazakaNyaa commented 3 years ago

Could you tell me what i have to add to the docker-compose file so i get the murmur-setting.conf file ? I don't want to add all the things as enviroment variables.

For mumble, you only need to modify the ice-related configuration, change its listening ip to 0.0.0.0, modify its secret, and then modify the configuration in config.json to match the mumble server configuration. For docker-compose.yml, you can refer to what I mentioned earlier, to assign a static IP to the agent so that the host can access it without exposing the port.

KagurazakaNyaa commented 3 years ago

Also I will add your plugin to the community packages docs so more people find it!

Thank you very much, I forgot about it before.

deMathias commented 3 years ago

Could you tell me what i have to add to the docker-compose file so i get the murmur-setting.conf file ? I don't want to add all the things as enviroment variables.

For mumble, you only need to modify the ice-related configuration, change its listening ip to 0.0.0.0, modify its secret, and then modify the configuration in config.json to match the mumble server configuration. For docker-compose.yml, you can refer to what I mentioned earlier, to assign a static IP to the agent so that the host can access it without exposing the port.

I understand, but i want the full mumble server config file. So I can change things like root channel name and allowed usernames.

I have made a pull request with ur plugin info: https://github.com/eveseat/docs/pull/121/commits/593180d051fb1a6fdcf3075f7fff25ce746d257f

deMathias commented 3 years ago

https://github.com/mumble-voip/mumble/blob/master/scripts/murmur.ini

I want to edit this file outside of the docker.

KagurazakaNyaa commented 3 years ago

https://github.com/mumble-voip/mumble/blob/master/scripts/murmur.ini

I want to edit this file outside of the docker.

You may not need to run mumble in docker. It is also possible to run it directly on the host. This is the case in my production environment. Just like the configuration I provided before, the mumbleIceAddr should be configured to the IP address of the mumble host. In my test environment, running mumble in docker is to quickly rebuild the test environment.

deMathias commented 3 years ago

The moment I switch from docker mumble to non docker mumble server I get connection refused again.

KagurazakaNyaa commented 3 years ago

The moment I switch from docker mumble to non docker mumble server I get connection refused again.

Have you changed the listening IP address to 0.0.0.0

deMathias commented 3 years ago

Yes but i had to change in docker-compose network-mode:host. Why is it standard bridge that only works if you also docker mumble right?

deMathias commented 3 years ago

image thanks for your effort again!