Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Added documentation, and other info, Licence and Contibuting
  • Loading branch information
developerfromjokela authored Nov 13, 2018
1 parent e2eb7df commit 9e8f2ac
Showing 1 changed file with 89 additions and 2 deletions.
91 changes: 89 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,89 @@
# ngrok-mailer
This script starts ngrok forwarding with preset IP address or localhost, and sends its public url to email. Usecases for example: Servers, IoT devices, other devices without port forwarding.
# Ngrok Mailer


This script starts ngrok forwarding with configured IP address or default localhost, and sends its public url to email. Usecases for example: Servers/NASes without port forwarding, IoT devices, other devices without port forwarding.

## Installation

Download or install Git command [git](https://git-scm.com/downloads) to install ngrok-mailer.

Clone repository master or download archived master

```bash
git clone https://github.com/developerfromjokela/ngrok-mailer.git
```
OR

```bash
wget https://github.com/developerfromjokela/ngrok-mailer/archive/master.zip
unzip master.zip
```
## Usage
Run script as root or using sudo
```bash
./ngrokmailer.sh
```
OR
```bash
sudo ./ngrokmailer.sh
```
Make script run on startup:
```bash
nano /etc/rc.local
# Then paste this below into rc.local:
./path/to/folder/ngrokmailer.sh
```

## Configuring
This script is configurable for your suites and usecases.
All parameters and usage:

``` forwarding_ip="192.168.100.69"```
- Set device IP, for ngrok to forward. Blank is locahost

``` forwarding_port="80"```
- Set device's port, for ngrok to forward using that exact protocol port.

``` forwarding_connectiontype="http"```
- Configure forwarding type, if your device is running http server, change parameter http, tcp, etc. More info in ngrok [documentation](https://ngrok.com/docs#websockets).

``` email_addr="[email protected]"```
- Email address where public url should be sent


``` ssmtp_root="[email protected]"```
- Email address which is used to send emails

``` ssmtp_mailhub="smtp.gmail.com:587"```
- SMTP address of mail server

```
ssmtp_authuser="[email protected]"
ssmtp_authpass="passwordforgmail"
```
- Authentication for SMTP Server

``` ssmtp_usestarttls="YES"```
- Use STARTTLS for SMTP Communications (NO disables it)

``` ssmtp_autoconfig=true```
- This parameter enables or disables ssmtp.conf overwrite using ssmtp_* parameters (false disables it, and file ssmtp.conf will not be overwrote)


``` logging=false```
- This parameter enables or disables logging activities in script to file ngrokmailer.log (false disables logging, and file msg.txt, which are created for email sending, will be deleted after mail is sent)

``` ngrok_path="ngrok"```
- You can set custom ngrok path, and default is ngrok. By default, if file was not found, it will be downloaded and extracted.

```checkfordependencies=true```
- Disable or Enable dependencies check on script startup, if some packages are missing. (If checking is leading to problems, try to disable this, if you set script to run on startup)


## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License
[MIT](https://choosealicense.com/licenses/mit/)

0 comments on commit 9e8f2ac

Please sign in to comment.