Automatic Ngrok port forwarding using Ngrok Mailer

  • Hello guys!


    Here is guide how to enable Ngrok Mailer, which will port forward your server web-gui to internet without port forwarding using router!


    So, let's begin.



    • Your script file configuration should look like this (excluding example emails and SMTP credentials):

    forwarding_ip="" # IP of device, server or whatever, which NGROK will forward, leave blank for localhost

    forwarding_port="80" # Port to forward
    forwarding_connectiontype="http" # Forwarding type http or tcp (See more in ngrok documentation)
    email_addr="youremail@example.com" #Email address for sending Ngrok address in case server or device rebooted
    ssmtp_root="example@gmail.com" #Email address which be used to sent emails
    ssmtp_mailhub="smtp.gmail.com:587" #SMTP address of mail server
    ssmtp_authuser="example@gmail.com" #Authentication for SMTP server
    ssmtp_authpass="passwordforgmail" #Authentication for SMTP server
    ssmtp_usestarttls="YES" # Set YES or NO to enable or disable STARTTLS
    ssmtp_autoconfig=true #true or false to disable overwriting ssmtp.conf
    logging=false #Enables logging to same folder where is script
    ngrok_path="ngrok" # Custom path for Ngrok, leave ngrok if file is in same directory as script. BONUS! NgrokMailer will download file if it is missing
    checkfordependencies=true # Checking for all dependencies on startup


    • If your server processor is not 64bit, download ngrok file manually matching your CPU, and place it in same folder, where is script located
    • As Documentation Says:
    • Make script run on startup:nano /etc/rc.local
    • Then paste this below into rc.local:
    • ./path/to/folder/ngrokmailer.sh
    • Relpale /path/to/folder/ with your path, where is located script.
    • And restart server. If you receive email, it works!
    • If not, check for correct SMTP Settings, and try to run script from ssh, while server is running, so you know if problem was, that script is not starting on boot.


    I hope this tutorial will be useful.



    Developer From Jokela

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!