Installation
Install and Setup all GifGang Services
Manual Installation
NOTE: This guide is written for Ubuntu/Ubuntu Server
Install and Setup MongoDB
- Install
sudo apt update && sudo apt upgrade -y
sudo apt install mongodb -y
sudo systemctl enable mongodb --now
- Run this command and open the config file
sudo nano /etc/mongodb.conf
- Change bind_ip from
127.0.0.1
to0.0.0.0
bind_ip = 0.0.0.0
- 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
- Start MongoDB CLI
mongo
- Switch to the default pre-made admin database
use admin
- 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
- Open the config file
sudo nano /etc/mongodb.conf
- Edit the file content Ctrl+W to search
authorization: enabled
- Restart MongoDB Service
sudo systemctl restart mongod
-
Install MongoDB Compass on your computer and connect to the Database
-
Create a database named GifGang and a collection named torrents inside that database
Install and Setup GifGang
- Install main dependencies
sudo apt update && sudo apt upgrade -y
sudo apt install python3 python3-pip git nano -y
- Create a seperate folder (Optional)
mkdir /GifGang && cd /GifGang
- Clone the Git Repository
git clone "https://github.com/hirusha-adi/GifGang.git" && cd ./Gifang
- Install Python dependencies
python3 -m pip install -r requirements.txt
- Edit the main configuration file
nano ./database/config.json
- Edit the admin settings file
nano ./database/admin/settings.json
- Start the web app
python3 gifgang.py
-
Ctrl+Z
and bg anddisown -h
-
Start the discord bot
python3 discord-bot.py
Ctrl+Z
and bg anddisown -h
Setup Ngrok and setup SSL
- Install and start nginx
apt install nginx
systemctl enable nginx --now
systemctl start nginx
- Open the default config file for the first time before setting up SSL
nano /etc/nginx/sites-enabled/default
- 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;
}
}
- Load the new config
nginx -t
nginx -s reload
- Install certbot
sudo apt install certbot -y
- Stop nginx temporarily to setup certbot
systemctl stop nginx
- Setup cerbot to get the key
certbot certonly --standalone --agree-tos -d gifgang.net,www.gifgang.net
- Open the default config file for the second time with new SSL settings
nano /etc/nginx/sites-enabled/default
- 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;
}
}
- Restart nginx
systemctl start nginx
- 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?
-
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:
-
Enable the developer-mode
- Stop the program if it is already running
- Open the
./database/config.json
file and set"dev_mode"
to true.json "dev_mode": true
- Save the file
- Restart the application
-
Re-create the issue.
-
Copy the log displayed in the console
-
Open an Issue with the copied log