Setup Server on AWS


#1

Hi guys,

i am trying to setup the server on an AWS instance. I used this tutorial to set it up. My local.properties looks following:

# Kontalk server configuration
# if you edit this file you must rebuild your containers:
# ./launcher rebuild
INSTANCE_NAME=Master

# version/branch to build
VERSION=production

# XMPP parameters
XMPP_SERVICE=ec2-18-219-76-209.us-east-2.compute.amazonaws.com
XMPP_LISTEN_PORT=5222
XMPPS_LISTEN_PORT=5223
XMPPS2S_LISTEN_PORT=5269

# Database parameters

# kontalk database user password
MYSQL_PASSWORD=****
# root database user password
MYSQL_ROOT_PASSWORD=****
# database timezone
MYSQL_TIMEZONE=Europe/Berlin
# database initial baseline
# alter this only if you know what you are doing
DATABASE_BASELINE=1

# Other parameters

# Max upload file size
HTTPUPLOAD_MAX_SIZE=20971520

# HTTP listen port
HTTPUPLOAD_LISTEN_PORT=8828

# HTTP URLs
HTTPUPLOAD_PUT_URL=http://18.219.76.209/
HTTPUPLOAD_GET_URL=http://18.219.76.209/

# Backup location
BACKUP_PATH=/mnt/test_backup

When I check the logs (./launcher logs), I get this: https://pastebin.com/fhQFgFjk (Output was too big)

When I try to register with the Android app I get this error message:

2019-01-16 15:23:02.301 6225-10701/org.kontalk.debug E/NumberValidation: validation error.
    org.jivesoftware.smack.SmackException$ConnectionException: The following addresses failed: '18.219.76.209:5222' failed because: /18.219.76.209 exception: java.net.ConnectException: failed to connect to /18.219.76.209 (port 5222) from /192.168.2.188 (port 38867) after 30000ms: isConnected failed: ECONNREFUSED (Connection refused)
        at org.kontalk.client.XMPPTCPConnection.connectUsingConfiguration(XMPPTCPConnection.java:637)
        at org.kontalk.client.XMPPTCPConnection.connectInternal(XMPPTCPConnection.java:912)
        at org.jivesoftware.smack.AbstractXMPPConnection.connect(AbstractXMPPConnection.java:409)
        at org.kontalk.service.XMPPConnectionHelper.connectOnce(XMPPConnectionHelper.java:193)
        at org.kontalk.client.NumberValidator.initConnection(NumberValidator.java:750)
        at org.kontalk.client.NumberValidator.run(NumberValidator.java:311)
        at java.lang.Thread.run(Thread.java:764)

Can somebody give me hint what I am doing wrong?

Kind regards


#2

Hi guys,

I found the problem for my issue. It was a combination of a to weak AWS instance(1) and an Ubuntu(2) problem.

  1. I took the t2.nano instance which was way to weak. I had problems with GPG generator. As I switched to more powerful instance I had no problem with that anymore.
  2. The server code uses some libraries which made some problems on Ubuntu 16.04 as I switched to Debian this problem was also gone

Kind regards


#3

I don’t recall anyone running Kontalk on AWS in the past. If there are specific steps to follow, I would definitely recommend documenting them down here in the forum or on our wiki!

Thanks for sharing your solution. =)


#4

Hello @Seroga88i and welcome.
I’d like to ask you about your setup if you don’t mind.

It was probably because of low entropy. You could try haveged, although some says that faking randomness it’s a trick that could compromise security of the generated keys.
Another thing you can try is generate random events on your server (e.g. do a find / to read all of your filesystem tree, generate random content in files, anything I/O related should do to help generating entropy).
Nevertheless, it should be a matter a time, sometimes a long time, but the wait will eventually end. It’s not strictly a matter of computing power.

Did you change the Dockerfile to use Ubuntu or are you talking about the host system here?


#5

Hi @daniele_athome,

It was probably because of low entropy. You could try haveged, although some says that faking randomness it’s a trick that could compromise security of the generated keys.
Another thing you can try is generate random events on your server (e.g. do a find / to read all of your filesystem tree, generate random content in files, anything I/O related should do to help generating entropy).

You are right, that was the problem and I solved it with find . | xargs file. But the problem was that the small AWS instance got stuck.

Did you change the Dockerfile to use Ubuntu or are you talking about the host system here?

No I didn’t change the Dockerfile, I just started a new AWS instance with debian 9 and this solved my problem.


#6

That’s weird, the only dependencies should be Docker and docker-compose. I mean the Docker container runs Debian and should be independent from the host system. I’ll do some tests.