Merci, Qoolbox, je suis prêt à le tester !
EDIT:
Pour info: Stéphane a préparé une web interface accessible à la porte suivante: 27308
Pour utiliser NGrok il faut aller sur cette page (https://dashboard.ngrok.com) et créer un compte utilisateur.
Une fois crée on aura accès à une page de contrôle interne et on pourra visualiser son propre Tunnel Authtoken qui doit être la première fois installé sur le NAS en SSH avec le commande suivant:
Code:
[~] # cd /opt/NGrok
[/opt/NGrok] # ./ngrok authtoken [Tunnel Authtoken]
Authtoken saved to configuration file: /share/homes/admin/.ngrok2/ngrok.yml
Une fois cela fait, on a deux options:
1. passer les commandes directement sur le terminal (SSH or Telnet) avec les commande décrites ci dessous (en tenant compte qu'il faut toujours lancer ces commandes dans le folder /opt/NGrok/ en utilisant ./ngrock):
Code:
usage:
ngrok --help
NAME:
ngrok - tunnel local ports to public URLs and inspect traffic
DESCRIPTION:
ngrok exposes local networked services behinds NATs and firewalls to the
public internet over a secure tunnel. Share local websites, build/test
webhook consumers and self-host personal services.
Detailed help for each command is available with 'ngrok help <command>'.
Open http://localhost:4040 for ngrok's web interface to inspect traffic.
EXAMPLES:
ngrok http 80 # secure public URL for port 80 web server
ngrok http -subdomain=baz 8080 # port 8080 available at baz.ngrok.io
ngrok http foo.dev:80 # tunnel to host:port instead of localhost
ngrok tcp 22 # tunnel arbitrary TCP traffic to port 22
ngrok tls -hostname=foo.com 443 # TLS traffic for foo.com to port 443
ngrok start foo bar baz # start tunnels from the configuration file
VERSION:
2.0.19
AUTHOR:
inconshreveable - <alan@ngrok.com>
COMMANDS:
authtoken save authtoken to configuration file
credits prints author and licensing information
http start an HTTP tunnel
start start tunnels by name from the configuration file
tcp start a TCP tunnel
test test ngrok service end-to-end
tls start a TLS tunnel
update update to the latest version
version print the version string
help Shows a list of commands or help for one command
Par exemple, si on veut créer un tunnel pour un service qui marche sur la porte 58000 il suffit de lancer sur SSH:
Code:
[/opt/NGrok] # ./ngrok http 58000
2. aller sur http://[NAS]:27308 et insérer les commandes qui seront lancés au démarrage.
À savoir que NGrok offre différents services, le plus basique est gratuit, mais les autres (bcp plus intéressants, comme le sub-domain reservation, https, etc.) sont payants.
Une option assez important, mas pas décrite dans la décrite dans le bloc avant est la possibilité de créer un accès avec authentication:
By default, ngrok tunnels do not require any username or password to access them. This means anyone who knows or guesses the URL or your tunnel can make requests to it. You can secure your tunnels with a username and password by specifying the -httpauth option when creating your tunnel. This will force HTTP basic authentication on all incoming requests to your tunnels and require that the credentials match those you specify on the command line.
Example: Add a username and password to your tunnel
Code:
$ ngrok -httpauth="helmet:12345" 80
Code:
$ curl -u "helmet:12345" https://3a4bfceb.ngrok.com
giopas