The registration server for WebThings Gateway.

Overview

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.

Comments
  • "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"
    bug 
    opened by benfrancis 10
  • Need list of registered subdomain from Registration server

    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

    opened by viren-moradiya 5
  • Email confirmation link didn't work

    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.

    bug 
    opened by benfrancis 5
  • Internal server error when trying to subscribe a subdomain for the second time

    Internal server error when trying to subscribe a subdomain for the second time

    After I run the server for the first time with a clean database, the first call to /subscription works fine, but the subsequent ones returns with an Internal server error. If I remove the database and starts again, the same behavior repeats.

    opened by andrenatal 4
  • registration_server entered FATAL state, too many start retries too quickly

    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,

    opened by jcherrabi 3
  • To make registration-server work without exposing port 53 to the internet

    To make registration-server work without exposing port 53 to the internet

    Hi Team,

    Can the registration and tunnelling process work without exposing the port 53 to the public internet? And if this is not possible, can we separate out DNS server from the registration server?

    Thanks, Viren

    opened by viren-moradiya 3
  • Error issuing certificate

    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

    bug 
    opened by benfrancis 3
  • Implement GeoIP-based DNS resolution.

    Implement GeoIP-based DNS resolution.

    • When the API domain is looked up, respond with the server closest to the user.
    • When a hosted subdomain is looked up, respond with the server on the continent stored in the database for that domain.
    opened by mrstegeman 2
  • Unable to reclaim domain in Webthings

    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.

    bug 
    opened by edwingoh22 1
  • Error issuing certificate - 400

    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

    opened by RichardWhitfieldTTW 1
  • Cannot /subscribe to Registration Server: dbtype=sqlite

    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.
    
    • try to /subscribe $ curl -v "http://wot.service.local/subscribe?name=c" or $ curl -v "http://c.wot.service.local/subscribe?name=c" or curl -v --header "Content-Type: application/json" -X GET -d '{"name":"c"}' http://wot.service.local/subscribe
    * 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.
    
    • try to /reclaim $ curl -v --header "Content-Type: application/json" -X GET -d '{"name":"c"}' http://wot.service.local/reclaim or $ curl -v "http://wot.service.local/reclaim?name=c"
    * 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

    opened by napat1412 1
  • SMTP protocol

    SMTP protocol

    as discuss in this thread: https://discourse.mozilla.org/t/mozilla-webthings-registration-server/95025/20

    it would be nice to have the option to specify the smtp port not just use 25 so we could use gmail as e-mail senders.

    enhancement 
    opened by arist0v 2
  • TypeError: Cannot redefine property: registration_endpoint

    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?

    opened by hrithik098 0
Owner
WebThings
(formerly Mozilla WebThings)
WebThings
Drop-in proxy for Discord gateway connections and sessions allowing for zero downtime deploys

gateway-proxy This is a very hacky project, so it might stop working if Discord changes their API core. This is unlikely, but keep that in mind while

Jens Reidel 39 Nov 26, 2022
A Prometheus Aggregation Gateway for FAAS applications

Gravel Gateway Gravel Gateway is a Prometheus Push Gateway for FAAS applications. In particular it allows aggregation to be controlled by the incoming

Colin Douch 85 Nov 23, 2022
A rust-based command line tool to serve as a gateway for a Internet Computer replica.

icx-proxy A command line tool to serve as a gateway for a Internet Computer replica. Contributing Please follow the guidelines in the CONTRIBUTING.md

DFINITY 25 Sep 6, 2022
WireGuard gateway with SNI for portable connectivity.

Gateway This is a daemon that controls gateway servers. Gateway servers are servers that fulfil three major purposes: facilitating connectivity betwee

Fractal Networks 5 Aug 9, 2022
A simple API gateway written in Rust, using the Hyper and Reqwest libraries.

API Gateway A simple API gateway written in Rust, using the Hyper and Reqwest libraries. This gateway can be used to forward requests to different bac

Adão Raul 3 Apr 24, 2023
A library-first, lightweight, high-performance, cloud-native supported API gateway🪐 by RUST

Preview version, will not guarantee the stability of the API! Do NOT use in production environment! A library-first, lightweight, high-performance, cl

Ideal World 4 May 7, 2023
Bring the power of pre-signed URLs to your apps. Signway is a gateway for redirecting authentic signed URLs to the requested API

A gateway that proxies signed requests to other APIs. Check the docs for more info. If you are looking for the managed version checkout this link http

Gabriel 37 Jun 24, 2023
User-space Wireguard gateway allowing sharing network connection from environment where usual routing rules are inaccessible.

wgslirpy A command line tool (and a Rust library) for accepting incoming connections within a Wireguard link and routing them to external network usin

Vitaly Shukela 4 Aug 21, 2023
A sample API Gateway built in Rust (work in progress) for learning purposes

rust-api-gateway A sample API Gateway built in Rust (work in progress) for learning purposes. You can follow along by reading the tutorial articles: P

Luis Soares 4 Oct 29, 2023
axum-server is a hyper server implementation designed to be used with axum framework.

axum-server axum-server is a hyper server implementation designed to be used with axum framework. Features Conveniently bind to any number of addresse

null 79 Jan 4, 2023
Jex Compiler Server - Server that runs Jex code

Server that compiles and runs Jex code.

furetur 3 Nov 18, 2021
Dav-server-rs - Rust WebDAV server library. A fork of the webdav-handler crate.

dav-server-rs A fork of the webdav-handler-rs project. Generic async HTTP/Webdav handler Webdav (RFC4918) is defined as HTTP (GET/HEAD/PUT/DELETE) plu

messense 30 Dec 29, 2022
A simple web server(and library) to display server stats over HTTP and Websockets/SSE or stream it to other systems.

x-server-stats A simple web server(and library) to display server stats over HTTP and Websockets/SSE or stream it to other systems. x-server(in x-serv

Pratyaksh 11 Oct 17, 2022
DNS Server written in Rust for fun, see https://dev.to/xfbs/writing-a-dns-server-in-rust-1gpn

DNS Fun Ever wondered how you can write a DNS server in Rust? No? Well, too bad, I'm telling you anyways. But don't worry, this is going to be a fun o

Patrick Elsen 26 Jan 13, 2023
QUIC proxy that allows to use QUIC to connect to an SSH server without needing to patch the client or the server.

quicssh-rs ?? quicssh-rs is a QUIC proxy that allows to use QUIC to connect to an SSH server without needing to patch the client or the server. quicss

Jun Ouyang 18 May 5, 2023
A telnet chat server written in Rust, running on Lunatic.

Lunatic.chat A telnet chat server written in Rust, running on Lunatic. If you just would like to try it out, join the hosted version with: # US server

Lunatic 101 Jan 2, 2023
server security proxy write by Rust

server-security-proxy server security proxy write by Rust how to use config toml file

baoyachi. Aka Rust Hairy crabs 3 May 24, 2021
Imagine your SSH server only listens on an IPv6 address, and where the last 6 digits are changing every 30 seconds as a TOTP code...

tosh Imagine your SSH server only listens on an IPv6 address, and where the last 6 digits are changing every 30 seconds as a TOTP code... Inspired fro

Mark Vainomaa 409 Oct 23, 2022
A working demo of RustDesk server implementation

A working demo of RustDesk server implementation This is a super simple working demo implementation with only one relay connection allowed, without NA

RustDesk 461 Jan 1, 2023