Giter VIP home page Giter VIP logo

registration_server's Introduction

Registration Server

Build Status license

This server exposes an HTTP API that lets you register a WebThings Gateway for tunneling support.

When combined with a PowerDNS server and a PageKite server, this acts as an all-in-one dynamic DNS or tunneling solution, with distributed GeoIP support. This is not only useful for WebThings, but could also be used by a variety of other stacks.

Usage

USAGE:
    main [OPTIONS]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
        --config-file <path>         Path to a toml configuration file.

See config/config.toml for an example configuration file.

Building & Testing

  • First, select the database type you'd like: mysql | postgres | sqlite
  • Run cargo build --features <db_type> to build.
  • Run ./run_tests.sh to test.

Docker build

Build the Docker image with docker build -t registration-server . from the source directory.

You can add the following build args:

  • --build-arg "db_type=<db-type>"
    • <db-type> should be one of: mysql, sqlite, postgres

Deploying

The setup relies on 3 components:

Getting a full setup ready involves the following:

  • Build a Docker image.

  • Install nginx on the container's host.

  • Configure your DNS zone for the domain you want to use. The NS records need to point to your registration server, i.e. the same IP address that will end up serving api.mydomain.org. This will need to be done through your DNS host or domain registrar.

    $ dig +short NS mozilla-iot.org
    ns2.mozilla-iot.org.
    ns1.mozilla-iot.org.
    
  • Run the Docker image with the proper configuration.

Configuration files

Nginx

If you're using Nginx as your reverse proxy on the host, you'll need to add the following server directives to your nginx.conf:

# HTTP version of the main registration server. We redirect to TLS port 8443 to
# avoid conflicting with tunneled domains.
server {
    listen 80;
    listen [::]:80;
    server_name api.mydomain.org;
    return 301 https://$server_name:8443$request_uri;
}

# This default server handles tunneled domains, i.e. myhost.mydomain.org.
server {
    listen 80 default_server;
    listen [::]:80 default_server;
    return 301 https://$host$request_uri;
}

# This is the main registration server.
#
# This section assumes you're using Let's Encrypt to generate a host
# certificate. Adjust accordingly if necessary.
server {
    listen 8443 ssl http2 default_server;
    listen [::]:8443 ssl http2 default_server;
    server_name api.mydomain.org;

    ssl_certificate "/etc/letsencrypt/live/api.mydomain.org/fullchain.pem";
    ssl_certificate_key "/etc/letsencrypt/live/api.mydomain.org/privkey.pem";
    # It is *strongly* recommended to generate unique DH parameters
    # Generate them with: openssl dhparam -out /etc/pki/nginx/dhparams.pem 2048
    ssl_dhparam "/etc/pki/nginx/dhparams.pem";
    ssl_session_cache shared:SSL:1m;
    ssl_session_timeout  10m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers HIGH:SEED:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!RSAPSK:!aDH:!aECDH:!EDH-DSS-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!SRP;
    ssl_prefer_server_ciphers on;

    location / {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://127.0.0.1:81;
    }
}

PageKite

The $CONFIG_DIR/pagekite.conf file is used to set any options for PageKite, where $CONFIG_DIR is the directory you'll end up sharing into your Docker container at /home/user/config. Here's a full example:

--isfrontend
--ports=4443
--protos=https
--authdomain=mydomain.org
--nullui
# Uncomment the following to quiet logging:
#--logfile=/dev/null

PowerDNS

The $CONFIG_DIR/pdns.conf is the PowerDNS configuration file, where $CONFIG_DIR is the directory you'll end up sharing into your Docker container at /home/user/config. It needs to be consistent with the registration configuration to connect on the correct socket for the remote queries:

daemon=no
local-port=53
local-address=0.0.0.0
socket-dir=/run/
launch=remote
remote-connection-string=unix:path=/tmp/pdns_tunnel.sock
write-pid=no
log-dns-details=no
log-dns-queries=no
loglevel=4

# If using geoip in the registration server, uncomment the following:
#query-cache-ttl=0
#cache-ttl=0

Registration Server

The $CONFIG_DIR/config.toml file holds the registration server configuration, where $CONFIG_DIR is the directory you'll end up sharing into your Docker container at /home/user/config. You should take a look at each line and ensure that the values are proper for your domain. In particular, you should look at anything with mydomain.org or an IP address. Here's a sample consistent with the pdns.conf shown above:

[general]
host = "0.0.0.0"
http_port = 81
domain = "mydomain.org"

# For SQLite: db_path should just be a file path.
# For MySQL: db_path should be of the form: mysql://[user[:password]@]host[:port][/database_name]
# For PostgreSQL: db_path should be of the form: postgres://[user[:password]@]host[:port][/database_name]
db_path = "/home/user/data/domains.sqlite"

[pdns]
api_ttl = 1
dns_ttl = 86400
tunnel_ttl = 60
socket_path = "/tmp/pdns_tunnel.sock"
caa_records = [
  "0 issue \"letsencrypt.org\"",
]
mx_records = []
ns_records = [
  [ "ns1.mydomain.org.", "5.6.7.8" ],
  [ "ns2.mydomain.org.", "4.5.6.7" ],
]
txt_records = []
# Check your DNS configuration to fill in this field.
soa_record = "ns1.mydomain.org. dns-admin.mydomain.org. 2018082801 900 900 1209600 60"
# Uncomment to set an IP address to resolve www.mydomain.org and domain.org to.
# www_address = ""

  [pdns.geoip]
  default = "5.6.7.8"

  # If you're not using geoip, you should comment out the next line.
  database = "/var/lib/GeoIP/GeoLite2-Country.mmdb"

    # If you're not using geoip, you should comment out all of the continents,
    # but keep the section header.
    [pdns.geoip.continent]
    AF = "1.2.3.4"
    AN = "2.3.4.5"
    AS = "3.4.5.6"
    EU = "4.5.6.7"
    NA = "5.6.7.8"
    OC = "6.7.8.9"
    SA = "9.8.7.6"

[email]
server = "mail.gandi.net"
user = "[email protected]"
password = "******"
sender = "[email protected]"
reclamation_title = "Reclaim your WebThings Gateway Domain"
reclamation_body = """Hello,
<br>
<br>
Your reclamation token is: {token}
<br>
<br>
If you did not request to reclaim your gateway domain, you can ignore this email."""
confirmation_title = "Welcome to your WebThings Gateway"
confirmation_body = """Hello,
<br>
<br>
Welcome to your WebThings Gateway! To confirm your email address, navigate to <a href="{link}">{link}</a>.
<br>
<br>
Your gateway can be accessed at <a href="https://{domain}">https://{domain}</a>."""
success_page = """<!DOCTYPE html>
<html>
  <head><title>Email Confirmation Successful!</title></head>
  <body>
    <h1>Thank you for verifying your email.</h1>
  </body>
</html>"""
error_page = """<!DOCTYPE html>
<html>
  <head><title>Email Confirmation Error!</title></head>
  <body>
    <h1>An error happened while verifying your email.</h1>
  </body>
</html>"""

geoipupdate

The $CONFIG_DIR/GeoIP.conf file holds the configuration for geoipupdate, where $CONFIG_DIR is the directory you'll end up sharing into your Docker container at /home/user/config. This is only necessary if you're using geoip in the registration server.

# GeoIP.conf file for `geoipupdate` program, for versions >= 3.1.1.
# Used to update GeoIP databases from https://www.maxmind.com.
# For more information about this config file, visit the docs at
# https://dev.maxmind.com/geoip/geoipupdate/.

# `AccountID` is from your MaxMind account.
AccountID <your id>

# `LicenseKey` is from your MaxMind account
LicenseKey <your key>

# `EditionIDs` is from your MaxMind account.
EditionIDs GeoLite2-Country

Running the Docker image

You will have to mount a couple of directories and relay some ports for the Docker image to run properly:

  • Mount $CONFIG_DIR (which was used above) to /home/user/config. This is where all of the configuration files live.
  • If using SQLite as your database, you should also mount another directory to /home/user/data, or wherever else you specified your database to live in the db_path option.

Port 53 over TCP and UDP needs to be forwarded for PowerDNS. The ports used for the HTTP server and the tunnel also need to be forwarded.

Example:

docker run \
    -d \
    -v /opt/docker/registration-server/config:/home/user/config \
    -v /opt/docker/registration-server/data:/home/user/data \
    -p 127.0.0.1:81:81 \
    -p 443:4443 \
    -p 53:53 \
    -p 53:53/udp \
    --log-opt max-size=1m \
    --log-opt max-file=10 \
    --restart unless-stopped \
    --name registration-server \
    webthingsio/registration-server:sqlite

Configuring the Gateway

To configure the WebThings Gateway to use your custom registration server, after doing all the steps above, you can modify your gateway's configuration in ~/.mozilla-iot/config/local.json as follows:

{
  "ssltunnel": {
    "registration_endpoint": "https://api.mydomain.org:8443",
    "domain": "mydomain.org",
    "certemail": "[email protected]"
  }
}

A Docker image has been provided here, containing this server, a PowerDNS server, a PageKite server, and geoipupdate.

API

The API is documented here. Its usage within the WebThings ecosystem is described in this document.

registration_server's People

Contributors

andrenatal avatar benfrancis avatar fabricedesre avatar ferjm avatar hfiguiere avatar michielbdejong avatar mrstegeman avatar samgiles avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

registration_server's Issues

"Error issuing certificate"

STR:

  • Flash 0.1 image onto an SD card
  • Boot Raspberry Pi
  • Type gateway.local or IP address of Pi into browser
  • Enter chosen subdomain and email address

Expected:

  • Gateway redirects to registered subdomain

Actual:

  • "Error issuing certificate. Please try again" displayed on screen
  • In developer tools I can see the status code of the HTTP POST is set to "400 Error issuing certificate - FetchError: request to http://mozilla-iot.org/subscribe?name=tola6 failed, reason: getaddrinfo ENOTFOUND mozilla-iot.org mozilla-iot.org:80"

Support other databases

Currently the storage is done in SQlite. It would be nice to also support databases like PostgreSQL or MySQL.

registration_server entered FATAL state, too many start retries too quickly

Hello guys,
i just cloned the repository and ran the build command, configured the config files and started the docker image using the supplied command and i get the following error:

`ar 09 21:28:11 Reading random entropy from '/dev/urandom'

Mar 09 21:28:11 Loading '/usr/lib/x86_64-linux-gnu/pdns/libremotebackend.so'

Mar 09 21:28:11 This is a standalone pdns

Mar 09 21:28:11 Listening on controlsocket in '/run/pdns.controlsocket'

Mar 09 21:28:11 UDP server bound to 0.0.0.0:53

Mar 09 21:28:11 UDPv6 server bound to [::]:53

Mar 09 21:28:11 TCP server bound to 0.0.0.0:53

Mar 09 21:28:11 TCPv6 server bound to [::]:53

Mar 09 21:28:11 PowerDNS Authoritative Server 4.1.6 (C) 2001-2018 PowerDNS.COM BV

Mar 09 21:28:11 Using 64-bits mode. Built using gcc 8.3.0.

Mar 09 21:28:11 PowerDNS comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it according to the terms of the GPL version 2.

Mar 09 21:28:11 Could not retrieve security status update for '4.1.6-3+deb10u1.Debian' on 'auth-4.1.6-3_deb10u1.Debian.security-status.secpoll.powerdns.com.', RCODE = Non-Existent domain

Mar 09 21:28:11 Creating backend connection for TCP

Mar 09 21:28:11 About to create 3 backend threads for UDP

tunnel_socket_blocks=False; optfile_/home/user/config/pagekite.conf=ok; started=/usr/local/bin/pagekite.py; ll=0; optfile_.SELF/defaults.cfg=ok; ts=6047e86b; argv=--optfile=/home/user/config/pagekite.conf; python=2.7.16 (default, Oct 10 2019, 22:02:15) [GCC 8.3.0]; platform=linux2; version=1.5.2.201011; t=2021-03-09T21:28:11; ca_certs=/etc/ssl/certs/ca-certificates.crt; send_always_buffers=False

id=s1; ll=1; listen=:4443; ts=6047e86b; t=2021-03-09T21:28:11

Mar 09 21:28:11 Done launching threads, ready to distribute questions

2021-03-09 21:28:12,197 INFO success: cron entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

2021-03-09 21:28:12,197 INFO success: pagekite entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

2021-03-09 21:28:12,199 INFO spawned: 'registration_server' with pid 30

2021-03-09 21:28:12,199 INFO success: pdns entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

thread 'main' panicked at 'Invalid config file: Error { inner: ErrorInner { kind: UnquotedString, line: Some(47), col: 7, at: Some(1083), message: "", key: [] } }', src/args.rs:20:33

note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Panic in Arbiter thread.

2021-03-09 21:28:12,205 INFO exited: registration_server (exit status 101; not expected)

2021-03-09 21:28:14,209 INFO spawned: 'registration_server' with pid 31

thread 'main' panicked at 'Invalid config file: Error { inner: ErrorInner { kind: UnquotedString, line: Some(47), col: 7, at: Some(1083), message: "", key: [] } }', src/args.rs:20:33

note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Panic in Arbiter thread.

2021-03-09 21:28:14,215 INFO exited: registration_server (exit status 101; not expected)

2021-03-09 21:28:17,221 INFO spawned: 'registration_server' with pid 32

thread 'main' panicked at 'Invalid config file: Error { inner: ErrorInner { kind: UnquotedString, line: Some(47), col: 7, at: Some(1083), message: "", key: [] } }', src/args.rs:20:33

note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Panic in Arbiter thread.

2021-03-09 21:28:17,227 INFO exited: registration_server (exit status 101; not expected)

2021-03-09 21:28:18,229 INFO gave up: registration_server entered FATAL state, too many start retries too quickly`

i've tried many things but the error persists..
can anyone help or at least confirm that this build is working..

Running this on ubuntu 18.04
cheers,

Error issuing certificate - 400

Hi, I have flashed the latest (v 0.12.0) gateway image to my Raspberry Pi 4. It all boots fine and I can connect to the hotspot but when I try to register for a subdomain I get the error 'Error issuing certificate. Please try again.'. Looking into the console this is an error 400 (I have posted the error below with redacted name and email (####).

For info I tried to go beyond this by skipping the step but when I then try to look for other apps I get a blank list so I really can't do too much.

api.js:504 POST http://192.168.1.106/settings/subscribe net::ERR_ABORTED 400 (Error issuing certificate - FetchError: request to https://api.mozilla-iot.org:8443/subscribe?name=####&email=#### failed, reason: getaddrinfo EAI_AGAIN api.mozilla-iot.org api.mozilla-iot.org:8443)
setupTunnel @ api.js:504
b @ setup-subdomain.js:157

Need list of registered subdomain from Registration server

Hello Folks,

Good day to you!
I am looking for one solution regarding to get list of registered subdomain by calling API to registration server.

Currently Registration server is not providing any API to get registered subdomain list.
Can registration server provide this detail by exposing API or we required code changes to expose API and this detail list?

Looking forward for your expert advice.

Thanks,
Viren

Email confirmation link didn't work

A user reported that they received an email confirmation email that:

  1. Wasn't a clickable hyperlink
  2. When they copy-pasted it into the browser, the URL failed to load with a security error

That was all the information they gave.

TypeError: Cannot redefine property: registration_endpoint

I am unable to setup my custom registration server, after doing all the steps in README, I am getting an error while running the gateway.

Object.defineProperty(mergeInto, prop, Object.getOwnPropertyDescriptor(Object(mergeFrom), prop));
                 ^
TypeError: Cannot redefine property: registration_endpoint

from this file

gateway/node_modules/config/lib/config.js:1314

My local.json file looks like this (With my own NS details):

{
  "ssltunnel": {
    "registration_endpoint": "https://api.mydomain.org:8443",
    "domain": "mydomain.org",
    "certemail": "[email protected]"
  }
}

I am running the gateway on Raspberry Pi 3B+. As soon as revert the changes in local.json, everything works all good. Is there something that I have missed?

Error issuing certificate

STR:

  • Flash latest OpenWrt image (openwrt-rpi-0.8.1-2.img.zip)
  • Try to register a subdomain during first time setup

Expected:

  • Successful registration, redirected to new subdomain

Actual:

  • POST gets a 400 response with the following error message:

Error issuing certificate - FetchError: request to https://api.mozilla-iot.org:8443/subscribe?name=tola2&[email protected] failed, reason: getaddrinfo EAI_AGAIN api.mozilla-iot.org:8443

Is this maybe a DNS problem?

See also: #20

Implement domain recovery flow

When a user has an email address registered, it is possible to use it to recover the domain information and to re-configure the gateway with an existing domain.
This needs another email verification process flow.

Support SASL with OAuth2 for outgoing mail

Later this year, Google will start the process of deprecating what they call "Less Secure Apps" which only use a username and password to access Google Accounts, which includes apps using protocols like IMAP and SMTP.

Currently GMail is used as an outgoing SMTP mail server for the webthings.io instance of the registration server, to send emails to confirm an email address or reclaim a subdomain.

From 15th June 2024, no new users will be able to enable less secure apps which will mean that people won't be able to configure new instances of the registration server to use Google as an SMTP server (not a huge problem, since other options are available and the webthings.io instance should keep working).

From 30th September 2024 access to Less Secure Apps will be turned off for all Google Workspace accounts, and protocols like IMAP and SMTP will stop working. This is a bigger problem because it means the webthings.io registration server will no longer be able to send new outgoing emails.

In order for the registration server to continue sending outgoing mail via Google's mail servers, we will need to implement OAuth2 support on the registration server, to authenticate with the [email protected] GMail account.

The Google Workspace documentation says this involves using SASL (Simple Authentication and Security Layer) authentication for SMTP. It's possible that the application may also have to be verified by Google in order to gain this API access, but there are exceptions which I think may cover us.

The registration server appears to use the lettre Rust library for outgoing mail. According to the documentation, the authentication module of this library "provides limited SASL authentication mechanisms", but I'm not sure what this means.


An alternative to implementing OAuth2 for the registration server would be to switch to an alternative paid email service which still supports less secure password-based SMTP authentication, but that will entail an additional ongoing cost because webthings.io currently piggyback's on top of Krellian's paid Google Workspace account. It would also mean we couldn't use other Google Workspace features for webthings.io like the [email protected] email alias in Google Groups. Using a lesser known outgoing mail service may also result in more outgoing emails being filtered out as spam.

DNS Outages

STR:

  • Leave registration server running and wait

Expected:

  • It keeps working

Actual:

  • Tunnelling service (and webthings.io website) suddenly drop offline and are inaccessible until the registration server is rebooted

This has been happening regularly for many months now, and requires a reboot of the registration server EC2 instances in order to fix it. We believe it is caused by PowerDNS crashing so that the registration server no longer resolves DNS lookups.

In the logs of the registration server docker container there is an error which says "5001 questions waiting for database/backend attention. Limit is 5000, respawning". pdns then re-spawns and after that happens so many times, the init system in the docker container gives up and just kills it. This is happening on both EC2 instances.

We think that the DNS servers are occasionally getting overwhelmed by traffic but we don't know where it's coming from, I suspect it isn't WebThings users because there are lots of failed lookups for subdomains that don't exist in the logs.

Some potential solutions:

  1. Configuring rate limiting with something like dnsdist to set a limit on queries per second per IP address
  2. Re-configure pdns to use the gmysql back end so that pdns reads records directly from the database, rather than directing them to the registration server which then queries the database
  3. Modify the registration server by adding an option to use a hosted DNS service like Cloudflare as a back end, to take load off our EC2 instances. Downsides being 1. We would be dependent on Cloudflare 2. We'd have to set a TTL limit of minimum 60 seconds, so there would be brief outages when a gateway changes IP (but at least not the whole domain)
  4. Same as number 3, but re-write the registration server in Node.js so that more people are able to work on it (we have an IoT gateway written in Node.js and a cloud service written in Rust and it should probably be the other way around!)

My personal preference is to start with option 1 and see if it helps. I suspect the spikes in traffic are not coming from WebThings users and if we cut off the source of the excessive traffic the service would hopefully go back to being stable again.

If anyone has experience of configuring rate limiting for pdns, I would be grateful for some help.

Unable to reclaim domain in Webthings

I have entered the reclaim token on an existing domain but there is "Error issuing certificate. Please try again" popping up.

Any advice on this? TIA.

Figure out localization

Some entries in the config files need to be localizable:

  • confirmation_title
  • confirmation_body
  • success_page
  • error_page

Cannot /subscribe to Registration Server: dbtype=sqlite

What happened:
I build docker: Registration Server: dbtype=sqlite (wot.service.local, os: centos 7) and run pagekite client for service: https (c.wot.service.local, os: centos 7). I can access service: https through https://c.wot.service.local but i cannot /subscribe c.wot.service.local to Registration Server.

What you expected to happen:
I can use /subscribe & /reclaim for new device registration

How to reproduce it (as minimally and precisely as possible):

  • At wot.service.local

systemctl start nginx (run at port 80 & set confugration-file )

docker run --name wot -d -v /opt/docker-run/registration_server/data:/home/user/data -v /opt/docker-run/registration_server/config:/home/user/config -p 81:81 -p 444:4444 -p 443:4443 -p 53:53 -p 53:53/udp local/registration_server:0.1

netstat -tna | grep LISTEN

tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN
tcp6       0      0 :::81                   :::*                    LISTEN
tcp6       0      0 :::53                   :::*                    LISTEN
tcp6       0      0 :::22                   :::*                    LISTEN
tcp6       0      0 ::1:25                  :::*                    LISTEN
tcp6       0      0 :::443                  :::*                    LISTEN
tcp6       0      0 :::444                  :::*                    LISTEN
  • At c.wot.service.local

I run nginx:https and pagekite client.

  • Testing (docker name: wot is registraton server)

$ docker restart wot
$ docker logs -f wot

+ ROOT_DIR=/home/user/config
+ source /home/user/config/env
++ DOMAIN=wot.service.local
++ export RUST_LOG=debug
++ RUST_LOG=debug
+ pdns_server --config-dir=/home/user/config
Aug 25 02:11:16 Reading random entropy from '/dev/urandom'
+ '[' -n '' ']'
+ RUST_LOG=registration_server=debug,maxminddb=info
+ ./target/release/main --config-file=/home/user/config/config.toml
+ pagekite.py --isfrontend --ports=4443 --protos=https --authdomain=wot.service.local
DEBUG:<unknown>: new(): Opening database at postgres://USER:PASS@IP:5432/DB
DEBUG:<unknown>: start_socket_endpoint(): Starting the pdns socket endpoint at /tmp/powerdns_tunnel.sock
started=/usr/local/bin/pagekite.py; ll=0; ts=5b80bac5; argv=--isfrontend --ports=4443 --protos=https --authdomain=wot.service.local; platform=linux2; version=0.5.9.3; t=2018-08-25T02:11:17; ca_certs=/etc/ssl/certs/ca-certificates.crt
info=Collecting entropy for a secure secret.; ll=1; ts=5b80bac5; t=2018-08-25T02:11:17
debug=Seeded signatures using /dev/urandom, hooray!; ll=2; ts=5b80bac5; t=2018-08-25T02:11:17
debug=UiComm: Created; ll=3; ts=5b80bac5; t=2018-08-25T02:11:17
id=s0; ll=4; listen=:4443; ts=5b80bac5; t=2018-08-25T02:11:17
ts=5b80bac5; t=2018-08-25T02:11:17; ll=5; debug=TunnelManager: loop #1, interval=5
ts=5b80bac5; t=2018-08-25T02:11:17; ll=6; debug=Not sure which servers to contact, making no changes.ts=5b80bac5; t=2018-08-25T02:11:17; ll=7; debug=Entering main epoll loop

ts=5b80bac7; t=2018-08-25T02:11:19; ll=8; accept=~97.15:38836; id=s0
ts=5b80bac7; t=2018-08-25T02:11:19; ll=9; debug=No back-end; on_port=4443; proto=http; domain=ping.pagekite; is=FE; id=s1/~97.15:38836
ts=5b80bac7; t=2018-08-25T02:11:19; ll=a; wrote=409; wbps=0; read=0; eof=1; id=s1/~97.15:38836
ts=5b80bac7; t=2018-08-25T02:11:19; ll=b; accept=~97.15:38838; id=s0
ts=5b80bac7; t=2018-08-25T02:11:19; ll=c; debug=No tunnels configured, idling...; id=s2/~97.15:38838
ts=5b80bac8; t=2018-08-25T02:11:20; ll=d; BE=Live; proto=https; domain=c.wot.service.local; add_kites=True; version=0.5.9.3; id=s2/~97.15:38838
ts=5b80baca; t=2018-08-25T02:11:22; ll=e; debug=Not sure which servers to contact, making no changes.
ts=5b80bacf; t=2018-08-25T02:11:27; ll=f; debug=Not sure which servers to contact, making no changes.
ts=5b80bad4; t=2018-08-25T02:11:32; ll=10; debug=Not sure which servers to contact, making no changes.

Now i can access https://c.wot.service.local
$ curl -k https://c.wot.service.local

$ docker logs -f wot

ts=5b80bb33; t=2018-08-25T02:13:07; ll=27; debug=Not sure which servers to contact, making no changes.
ts=5b80bb38; t=2018-08-25T02:13:12; ll=28; debug=Not sure which servers to contact, making no changes.
ts=5b80bb3b; t=2018-08-25T02:13:15; ll=29; accept=~97.15:38846; id=s0
ts=5b80bb3c; t=2018-08-25T02:13:16; ll=2a; domain=c.wot.service.local; on_port=4443; proto=https; is=FE; id=s5/~97.15:38846
ts=5b80bb3c; t=2018-08-25T02:13:16; ll=2b; wrote=5406; wbps=4218; read=269; eof=1; id=s5/~97.15:38846
ts=5b80bb3d; t=2018-08-25T02:13:17; ll=2c; debug=Not sure which servers to contact, making no changes.
ts=5b80bb42; t=2018-08-25T02:13:22; ll=2d; debug=Not sure which servers to contact, making no changes.
* About to connect() to wot.service.local port 80 (#0)
*   Trying x.x.x.x...
* Connected to wot.service.local (x.x.x.x) port 80 (#0)
> GET /subscribe HTTP/1.1
> User-Agent: curl/7.29.0
> Host: wot.service.local
> Accept: */*
> Content-Type: application/json
> Content-Length: 12
>
* upload completely sent off: 12 out of 12 bytes
< HTTP/1.1 500 Internal Server Error
< Server: nginx/1.12.2
< Date: Sat, 25 Aug 2018 05:06:28 GMT
< Transfer-Encoding: chunked
< Connection: keep-alive
<
* Connection #0 to host wot.service.local left intact

$ docker logs -f wot

thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: IoError("entity not found")', libcore/result.rs:945:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
ts=5b80bbc4; t=2018-08-25T02:15:32; ll=4a; debug=Not sure which servers to contact, making no changes.
ts=5b80bbc9; t=2018-08-25T02:15:37; ll=4b; debug=Not sure which servers to contact, making no changes.
* About to connect() to wot.service.local port 80 (#0)
*   Trying x.x.x.x...
* Connected to wot.service.local (x.x.x.x) port 80 (#0)
> GET /reclaim HTTP/1.1
> User-Agent: curl/7.29.0
> Host: wot.service.local
> Accept: */*
> Content-Type: application/json
> Content-Length: 12
>
* upload completely sent off: 12 out of 12 bytes
< HTTP/1.1 400 Bad Request
< Server: nginx/1.12.2
< Date: Sat, 25 Aug 2018 05:01:54 GMT
< Content-Type: application/json
< Content-Length: 23
< Connection: keep-alive
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: accept, authorization, content-type
< Access-Control-Allow-Methods: GET, POST, PUT, DELETE
<
* Connection #0 to host wot.service.local left intact
{"error": "NoSuchName"}

$ docker logs -f wot

ts=5b80bc1e; t=2018-08-25T02:17:02; ll=5e; debug=Not sure which servers to contact, making no changes.
ts=5b80bc23; t=2018-08-25T02:17:07; ll=5f; debug=Not sure which servers to contact, making no changes.
INFO:<unknown>: GET /reclaim {"name": "c"}
ts=5b80bc28; t=2018-08-25T02:17:12; ll=60; debug=Not sure which servers to contact, making no changes.
ts=5b80bc2d; t=2018-08-25T02:17:17; ll=61; debug=Not sure which servers to contact, making no changes.

What is the problem? about registration server configuration or subscribe method.

*Note:
edit 1: add curl command for json data

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.