Skip to main content

Installation

Install and Setup all GifGang Services

Manual Installation

info

NOTE: This guide is written for Ubuntu/Ubuntu Server

Install and Setup MongoDB

  1. Install
sudo apt update && sudo apt upgrade -y
sudo apt install mongodb -y
sudo systemctl enable mongodb --now
  1. Run this command and open the config file
sudo nano /etc/mongodb.conf
  1. Change bind_ip from 127.0.0.1 to 0.0.0.0
bind_ip = 0.0.0.0
  1. run this command to restart mongo
sudo systemctl restart mongodb

MongoDB is now publicly accessible by the default Port and the Server IP. Now, create an account and enable authorization for security

  1. Start MongoDB CLI
mongo
  1. Switch to the default pre-made admin database
use admin
  1. Create a new user
db.createUser(
{
user: "AdminUserName",
pwd: "SuperSecretPassword",
roles: [ { role: "userAdminAnyDatabase", db: "admin" }, "readWriteAnyDatabase" ]
}
)

The new user is created, Now, You have to make logging-in required

  1. Open the config file
sudo nano /etc/mongodb.conf
  1. Edit the file content Ctrl+W to search
authorization: enabled
  1. Restart MongoDB Service
sudo systemctl restart mongod
  1. Install MongoDB Compass on your computer and connect to the Database

  2. Create a database named GifGang and a collection named torrents inside that database

Install and Setup GifGang

  1. Install main dependencies
sudo apt update && sudo apt upgrade -y
sudo apt install python3 python3-pip git nano -y
  1. Create a seperate folder (Optional)
mkdir /GifGang && cd /GifGang
  1. Clone the Git Repository
git clone "https://github.com/hirusha-adi/GifGang.git" && cd ./Gifang
  1. Install Python dependencies
python3 -m pip install -r requirements.txt
  1. Edit the main configuration file
nano ./database/config.json
  1. Edit the admin settings file
nano ./database/admin/settings.json
  1. Start the web app
python3 gifgang.py
  1. Ctrl+Z and bg and disown -h

  2. Start the discord bot

python3 discord-bot.py
  1. Ctrl+Z and bg and disown -h

Setup Ngrok and setup SSL

  1. Install and start nginx
apt install nginx
systemctl enable nginx --now
systemctl start nginx
  1. Open the default config file for the first time before setting up SSL
nano /etc/nginx/sites-enabled/default
  1. Edit the default config file for the first time before setting up SSL
server {
listen 80 default_server;
listen [::]:80 default_server;

server_name gifgang.net;

location / {
proxy_pass http://localhost:8080;
}
}
  1. Load the new config
nginx -t
nginx -s reload
  1. Install certbot
sudo apt install certbot -y
  1. Stop nginx temporarily to setup certbot
systemctl stop nginx
  1. Setup cerbot to get the key
certbot certonly --standalone --agree-tos -d gifgang.net,www.gifgang.net
  1. Open the default config file for the second time with new SSL settings
nano /etc/nginx/sites-enabled/default
  1. Open the default config file for the second time with new SSL settings
server {
listen 80 default_server;
listen [::]:80 default_server;

location / {
return 301 https://$host$request_uri;
}
}

server {
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate /etc/letsencrypt/live/gifgang.net/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/gifgang.net/privkey.pem;

location / {
proxy_pass http://localhost: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_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
}
}
  1. Restart nginx
systemctl start nginx
  1. Reload the new nginx configuration
nginx -t
nginx -s reload

Automated Installer

This cannot be 100% automated therefore user interaction is required

Ubuntu

wget "https://raw.githubusercontent.com/hirusha-adi/GifGang/installer/ubuntu/install.py" && python3 ./install.py

Arch Linux

wget "https://raw.githubusercontent.com/hirusha-adi/GifGang/installer/arch/install.py" && python ./install.py

Error?

  • I have an error while Installing. What should I do?
  1. Check if your issue in this list of most commonly encountable error list (Click to open the guide to fixing it) or use your common sense:

  2. Enable the developer-mode

    1. Stop the program if it is already running
    2. Open the ./database/config.json file and set "dev_mode" to true.
      • json "dev_mode": true
    3. Save the file
    4. Restart the application
  3. Re-create the issue.

  4. Copy the log displayed in the console

  5. Open an Issue with the copied log