bludesign / FaxServer

Send and Receive Faxes Using The Twilio Programmable Fax API.
MIT License
108 stars 48 forks source link
fax ios mms nexmo sms twilio twilio-api twilio-fax-api twilio-sms-api

Fax Server

API Documentation Vapor MIT License Swift 4.0


Fax Server is a server for sending and receiving faxes with the Twilio Programmable Fax API. It can also send and receive SMS/MMS messages with the Twilio SMS API as well as receive messages with the Nexmo SMS API.

🏭 Installing

Using Docker

The easiest way to install is with Docker

git clone --depth=1 git@github.com:bludesign/FaxServer.git
cd FaxServer
docker-compose up

After starting the server will be running at http://127.0.0.1:8080

To run the server in the background run docker-compose up -d

Manually

If it is not already installed install MongoDB if you are using authentication or a non-standard port set it with the MONGO_HOST, MONGO_PORT, MONGO_USERNAME, MONGO_PASSWORD environment variables.

Next install Vapor and Swift here for macOS or Ubuntu.

Then build and run the project:

git clone --depth=1 git@github.com:bludesign/FaxServer.git
cd FaxServer
vapor build --release
.build/release/App

The server will now be running at http://127.0.0.1:8080. Note running the server with vapor run serve will not work it must be run directly with the App in .build/release directory.

🚀 Deploy

The server must be reachable from the internet which can be done using Nginx (Recommended) or Apache2.

If using Nginx the client_max_body_size must be increased to allow for larger PDF file uploads.

Example Nginx Config:

server {
    listen 80;
    client_max_body_size 20M;

    location / {
        proxy_set_header   Host $http_host;
        proxy_pass         http://127.0.0.1:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass_header Server;
        proxy_connect_timeout 3s;
        proxy_read_timeout 10s;
    }
}

🔧 Configuration

First visit the Fax Server's address and register a new user account after you create your account you should disable user registration in settings.

Twilio Configuration

Fax Server

Nexmo Configuration (Optional)

SMS messages can only be received from Nexmo so no accounts need to be added in Fax Server to receive messages.

Fax Server Configuration

It is possible to add phone numbers to Fax Server that are not in your Twilio account but have been verified this can be used to add a number such as a regular fax machine allowing you to send faxes from Fax Server and still receive them on a regular fax machine. Note this does not apply to SMS messages, SMS messages can only be sent from Twilio numbers they can not be sent from Twilio verified numbers.

🔒 Important - Securing Fax Server

📱 iOS App Setup

Fax Server

App Store