Web server listens only on 127.0.0.1 #102

Closed
opened 2020-03-10 15:24:29 +01:00 by netandreus · 11 comments
netandreus commented 2020-03-10 15:24:29 +01:00 (Migrated from github.com)

Describe the bug
Liberemail webserver listens only at 127.0.0.1

To Reproduce
Steps to reproduce the behavior:

  1. Starts libremail webserver by this command ./sync/libremail
  2. Connect to default port (9898) from another machine.
  3. There is no connection.

Expected behavior
Web UI should be opened.

Server:

  • OS: Ubuntu 16.04

Desktop:

  • Browser: Chrome
  • Version: 80.0.3987.132 (Official Build) (64-bit)

Possible solution
I think solution can be made by describing server configuration parameters like "hostname" / "address" in this part of manual:
https://github.com/mikegioia/libremail/blob/master/sync/doc/configuration.md#server

**Describe the bug** Liberemail webserver listens only at 127.0.0.1 **To Reproduce** Steps to reproduce the behavior: 1. Starts libremail webserver by this command ./sync/libremail 2. Connect to default port (9898) from another machine. 3. There is no connection. **Expected behavior** Web UI should be opened. **Server:** - OS: Ubuntu 16.04 **Desktop:** - Browser: Chrome - Version: 80.0.3987.132 (Official Build) (64-bit) **Possible solution** I think solution can be made by describing server configuration parameters like "hostname" / "address" in this part of manual: https://github.com/mikegioia/libremail/blob/master/sync/doc/configuration.md#server
mikegioia commented 2020-03-10 15:27:01 +01:00 (Migrated from github.com)

Great catch @netandreus

Great catch @netandreus
mikegioia commented 2020-03-11 06:11:26 +01:00 (Migrated from github.com)

@netandreus I pushed a potential fix for this to the branch issue102, the PR is here: #103. If you have the chance, would you mind pulling down that branch and updating the two config files in /sync/config/local.ini and /sync/client/config.json? They need to match.

@netandreus I pushed a potential fix for this to the branch issue102, the PR is here: #103. If you have the chance, would you mind pulling down that branch and updating the two config files in `/sync/config/local.ini` and `/sync/client/config.json`? They need to match.
netandreus commented 2020-03-11 07:44:18 +01:00 (Migrated from github.com)

@mikegioia Just checked #103 Now server responds to browser from another machine but websocket still try to connect to localhost.

libremail-local-ini

libremail-config-json

libremail-browser-error

@mikegioia Just checked #103 Now server responds to browser from another machine but websocket still try to connect to localhost. ![libremail-local-ini](https://user-images.githubusercontent.com/313477/76389648-c460e380-637c-11ea-8fe5-f9ec6defb821.png) ![libremail-config-json](https://user-images.githubusercontent.com/313477/76389650-c75bd400-637c-11ea-9666-9bb0e9fa63f5.png) ![libremail-browser-error](https://user-images.githubusercontent.com/313477/76389651-c9259780-637c-11ea-86ed-b820a7d2f770.PNG)
netandreus commented 2020-03-11 21:28:59 +01:00 (Migrated from github.com)

I think problem is here: mikegioia/libremail@ff8db935a4/sync/client/dist/libremail.js (L59)

localhost and port are hardcoded.

I think problem is here: https://github.com/mikegioia/libremail/blob/ff8db935a4034e549f4e8557322695c8251edf44/sync/client/dist/libremail.js#L59 localhost and port are hardcoded.
mikegioia commented 2020-03-11 22:02:41 +01:00 (Migrated from github.com)

@netandreus If you switch to the branch issue102 and re-compile the client I think it should work for you. I apologize, I should have specified it clearer. I would make sure the following are done:

  1. Switch to branch issue102
  2. Update sync/config/local.ini with your server/port/host settings
  3. Update sync/client/config.json with your port/host settings
  4. In sync/client run npm install and the grunt command to re-compile the front-end assets

Let me know if you run into any problems. The config.json file has the host/port for the web socket connecting and needs to match what's in the sync/config/local.ini file.

@netandreus If you switch to the branch `issue102` and re-compile the client I think it should work for you. I apologize, I should have specified it clearer. I would make sure the following are done: 1. Switch to branch `issue102` 2. Update `sync/config/local.ini` with your server/port/host settings 3. Update `sync/client/config.json` with your port/host settings 4. In `sync/client` run `npm install` and the `grunt` command to re-compile the front-end assets Let me know if you run into any problems. The config.json file has the host/port for the web socket connecting and needs to match what's in the sync/config/local.ini file.
netandreus commented 2020-03-12 10:06:45 +01:00 (Migrated from github.com)

@mikegioia I did everything you wrote. Now there is no errors in web browser console, web UI opened but there is no elements on it, only "Waiting for signal message".

waiting-for-signal

@mikegioia I did everything you wrote. Now there is no errors in web browser console, web UI opened but there is no elements on it, only "Waiting for signal message". ![waiting-for-signal](https://user-images.githubusercontent.com/313477/76505081-e7ad9080-6459-11ea-9d95-34b6ddde3a5e.PNG)
mikegioia commented 2020-03-12 13:53:52 +01:00 (Migrated from github.com)

Do you mind posting examples of what values you're using in the config files?

Do you mind posting examples of what values you're using in the config files?
netandreus commented 2020-03-12 18:19:24 +01:00 (Migrated from github.com)

No problem, here they are.

local.ini

; Put your local configuration and overrides here. This
; extends default.ini.
[app]
memory="512M"
sync[sleep_minutes] = 15
timezone = "Europe/Moscow"
ignored_folders[] = "[Gmail]"
ignored_folders[] = "Archive"
ignored_folders[] = "Calendar"
ignored_folders[] = "Calendar/Birthdays"
ignored_folders[] = "Calendar/United States holidays"
ignored_folders[] = "Contacts"
ignored_folders[] = "Conversation History"
ignored_folders[] = "Junk Email"
ignored_folders[] = "Outbox"
ignored_folders[] = "RSS Feeds"
ignored_folders[] = "Tasks"
ignored_folders[] = "Notes"

[server]
port = "9898"
host = "libremail"
address = "0.0.0.0"

[sql]
database="libremail"
hostname="localhost"
port="3306"
username="libremail"
password="xxxxxxxxx"

config.json

{
    "server": "libremail",
    "port": 9898
}
No problem, here they are. **local.ini** ``` ; Put your local configuration and overrides here. This ; extends default.ini. [app] memory="512M" sync[sleep_minutes] = 15 timezone = "Europe/Moscow" ignored_folders[] = "[Gmail]" ignored_folders[] = "Archive" ignored_folders[] = "Calendar" ignored_folders[] = "Calendar/Birthdays" ignored_folders[] = "Calendar/United States holidays" ignored_folders[] = "Contacts" ignored_folders[] = "Conversation History" ignored_folders[] = "Junk Email" ignored_folders[] = "Outbox" ignored_folders[] = "RSS Feeds" ignored_folders[] = "Tasks" ignored_folders[] = "Notes" [server] port = "9898" host = "libremail" address = "0.0.0.0" [sql] database="libremail" hostname="localhost" port="3306" username="libremail" password="xxxxxxxxx" ``` **config.json** ``` { "server": "libremail", "port": 9898 } ```
mikegioia commented 2020-03-15 18:59:59 +01:00 (Migrated from github.com)

@netandreus I was able to get this running using the same configuration for server, port, and address. I was wondering, are you running ./libremail or ./server to test it out? You'll need to run ./libremail to see the sync client working.

@netandreus I was able to get this running using the same configuration for server, port, and address. I was wondering, are you running `./libremail` or `./server` to test it out? You'll need to run `./libremail` to see the sync client working.
netandreus commented 2020-03-16 07:36:25 +01:00 (Migrated from github.com)

@mikegioia thank for support! Client is now working. This is a coorect startup procedure (for issue102):

  1. Update sync/config/local.ini with your server/port/host settings
  2. Update sync/client/config.json with your port/host settings
  3. In sync/client run npm install and the grunt command to re-compile the front-end assets
  4. Run ./sync/sync (and don't stop it)
  5. Run ./sync/libremail (and don't stop it).
@mikegioia thank for support! Client is now working. This is a coorect startup procedure (for issue102): 1. Update sync/config/local.ini with your server/port/host settings 2. Update sync/client/config.json with your port/host settings 3. In sync/client run npm install and the grunt command to re-compile the front-end assets 4. Run ./sync/sync (and don't stop it) 5. Run ./sync/libremail (and don't stop it).
mikegioia commented 2020-03-18 19:59:38 +01:00 (Migrated from github.com)

@netandreus You shouldn't need to do step 4 in your list there. That's running two copies of the sync process. ./libremail runs both server and sync (fyi).

@netandreus You shouldn't need to do step 4 in your list there. That's running two copies of the sync process. ./libremail runs both server and sync (fyi).
Sign in to join this conversation.
No description provided.