Creeate a fork of Gab with step-by-step remote host deployment instructions

Job ID: 31171741

Budget: $30 – $250 USD

I am looking for a step-by step tutorial to successfully deploy
Gab’s open source code onto a remote ubuntu host machine.

https://code.gab.com/gab/gab-open-source (repo Password: “JesusChristIsKingTrumpWonTheElection“) takes you to the repository which has instructions (readme.md) for deploying everything locally in a virtual box. The repository includes deployment instructions for **Docker and docker-compose**, but also a few specific platforms like **Heroku**, **Scalingo**, and **Nanobox**.

I want these translated into a step-by-step tutorial for deployment on a remote host machine without a virtual box.

Deliverables:


a fork of the source code that has the “gab” button text changed to “post” (This is the button users press when creating a post/ gab/ tweet/toot) as part of the deliverables.
A step-by-step detail on how to properly remotely deploy & configure above fork of gab-open-source to a host machine, based on machine ip and name server address from scratch. Configuration will include proper firewall, ip, dns, and email host deployment instructions.

Gab’s open source code is a fork of Mastodon, a federated social media platform.
here are instructions for how to deploy a Mastodon Server, which may be useful.


Deployment details:

Ubuntu 18.04 x64 (I can provide a remote host machine with test domain if needed)
I can also provide working SMTP email server credentials to send signup emails from if needed

**Tech stack:**

- **Ruby on Rails** powers the REST API and other web pages
- **React.js** and Redux are used for the dynamic parts of the interface
- **Node.js** powers the streaming API

**Requirements:**

- **PostgreSQL** 9.5+
- **Redis**
- **Ruby** 2.4+
- **Node.js** 8+

First few steps in server deployment


Fresh boot

Update and upgrade system packages
apt update && apt upgrade -y

create ssh key, push ssh key to server, login via ssh, and Enable SSHD no pw login

vim /etc/ssh/sshd_config and find PasswordAuthentication. Make sure it’s uncommented and set to no. If you made any changes, restart sshd:




Alias system and journalctl
vim ~/.bashrc
and paste to bottom:

set -o vi

alias s='systemctl'
alias j='journalctl -xe'

source .bashrc
s restart sshd

apt-get install fail2ban -y

vim /etc/fail2ban/jail.local
and put this inside:

[DEFAULT]
destemail = enter.email.here
sendername = Fail2Ban

[sshd]
enabled = true
port = 22

[sshd-ddos]
enabled = true
port = 22
Finally restart fail2ban:

s restart fail2ban

Step 5 firewall setup ( this may requires some modifications to work properly as it is copied from mastodon preconfig instructions )

Install a firewall and only whitelist SSH, HTTP and HTTPS ports

apt install -y iptables-persistent
select no 2x

vim /etc/iptables/rules.v4

and put this inside:

*filter

# Allow all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT

# Accept all established inbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# Allow all outbound traffic - you can modify this to only allow certain traffic
-A OUTPUT -j ACCEPT

# Allow HTTP and HTTPS connections from anywhere (the normal ports for websites and SSL).
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT

# Allow SSH connections
# The -dport number should be the same port number you set in sshd_config
-A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT

# Allow ping
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT

# Log iptables denied calls
-A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7

# Reject all other inbound - default deny unless explicitly allowed policy
-A INPUT -j REJECT
-A FORWARD -j REJECT

COMMIT

With iptables-persistent, that configuration will be loaded at boot time. But since we are not rebooting right now, we need to load it manually for the first time:
iptables-restore < /etc/iptables/rules.v4
Related categories: Ruby on Rails Node.js PostgreSQL Redis React.js