gPanel

command module
v0.0.0-...-c683906 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2018 License: MIT Imports: 5 Imported by: 0

README

gPanel

A web-hosting control panel written in Go.

Note: This software currently only runs on Linux systems.

Table of Contents

  1. Technology Stack
  2. Preview Images
  3. Contribution Set-up & Deployment
  4. Installation for Use

Technology Stack

Backend: Go (1.9.2+)
Database: Bolt
CSS Toolkit(s): Bootstrap 4 & Font Awesome
JS Toolkit(s): jQuery

Preview Images

gPanel Structure Image of gPanel Structure

gPanel Server Image of gPanel Server

gPanel Account Image of gPanel Account

Contribution Set-up & Deployment

To get the repo...

# Go get the repo and append it to your $GOPATH
go get github.com/kentonh/gPanel

# Navigate to the directory (replace $GOPATH with your actual $GOPATH)
cd $GOPATH/github.com/kentonh/gPanel

To set your repo up to contribute...

# Fork the repo and add it to the list of remotes (replace your-username with your github username)
git remote add fork https://github.com/your-username/gPanel.git

# OPTIONAL: Change the names of the remotes
git remote rename origin upstream
git remote rename fork origin

To deploy...

# Build the binary
go build gpanel.go

# Execute binary as root (root access is needed for functions within the system package)
sudo ./gpanel

Installation for Use

System Requirements
  • Linux
    • adduser command (already installed on most debian-based Linux systems)
    • deluser command (already installed on most debian-based linux systems)
    • ssh-keygen command (already installed on most debian-based linux systems)
    • openssh-server installed (installation guide below)
    • golang (installation guide below)
    • php-cgi IF you want to be able to serve .php files
  • OSX
    • Currently there is no support for OSX, but it is planned for the future.

Installing Golang
  1. sudo apt-get purge golang*
  2. Download latest version from https://www.golang.org/dl/
  3. sudo tar -C /usr/local -xzf go[VERSION].[OS]-[ARCH].tar.gz
  4. For system-wide installation (reccommended) a. vim /etc/profile b. Add "export PATH=$PATH:/usr/local/go/bin"
  5. For local installation a. If ~/.profile doesn't exist then create it (touch ~/.profile) b. Add "export PATH=$PATH:/usr/local/go/bin" to said file
  6. Logout and login for changes to /etc/profile or ~/.profile to take effect
  7. mkdir ~/go && mkdir ~/go/bin && mkdir ~/go/src && mkdir ~/go/pkg
  8. GOROOT=~/go
Installing openssh-server
  1. sudo apt-get install openssh-server
  2. sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.default
  3. sudo vim /etc/ssh/sshd_config
  4. Uncomment (no # before line) and/or set the following lines in /etc/ssh/sshd_config
    • PermitRootLogin no
    • AuthorizedKeysFile %h/.ssh/authorized_keys
    • PasswordAuthentication no
    • PermitEmptyPasswords no
    • RSAAuthentication yes
    • PubkeyAuthentication yes
  5. sudo systemctl restart ssh
Creating the Host Key-pair
  1. ssh-keygen -t rsa -N "PASSWORD" -f ~/.ssh/id_rsa [change PASSWORD]
.ssh Folder and Files Permissions Reference
  1. To check permissions a. cd ~/.ssh b. ls -l -a (look at ls -l -a dump below)
  2. To change permissions a. chmod [PERMISSIONS NUMBER] [FILE]
  3. To change ownership a. chown [USER]: [FILE]

.ssh [700 && owned by correct user]
    id_rsa [600 && owned by correct user]
    id_rsa.pub [644 && owned by correct user]
    authorized_keys [644 && owned by correct user]
    known_hosts [644 && owned by the correct user]

Correct output of ls -l -a of ~/.ssh

drwx------ 2 root root 4096 Jan 17 14:49 .  
drwx------ 7 root root 4096 Jan 17 14:42 ..  
-rw-r--r-- 1 root root    0 Jan 17 14:49 authorized_keys  
-rw------- 1 root root 1766 Jan 17 14:43 id_rsa  
-rw-r--r-- 1 root root  401 Jan 17 14:43 id_rsa.pub  
-rw-r--r-- 1 root root  444 Oct 10  2016 known_hosts
Getting the Repository and Running
  1. go get github.com/kentonh/gPanel
  2. cd ~/go/src/github.com/kentonh/gPanel
  3. go build gpanel.go
  4. sudo ./gpanel

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
api/ip
Package ip is an API that deals with the blocking and unblocking of IPs on public servers
Package ip is an API that deals with the blocking and unblocking of IPs on public servers
api/log
Package log is a child of package api to handle api calls concerning log files
Package log is a child of package api to handle api calls concerning log files
api/server
Package server is a child of package api to handle api calls concerning the server
Package server is a child of package api to handle api calls concerning the server
api/user
Package user is a child of package api to handle api calls concerning users
Package user is a child of package api to handle api calls concerning users
database
Package database handles all communication between software and the database
Package database handles all communication between software and the database
encryption
Encryption package has functions inside of it that utilize various encypting and hashing techniques
Encryption package has functions inside of it that utilize various encypting and hashing techniques
file
Package file handles various file operations
Package file handles various file operations
gpaccount
Package gpaccount handles the logic of the gPanel account server
Package gpaccount handles the logic of the gPanel account server
gpserver
Package gpserver handles the logic of the gPanel server
Package gpserver handles the logic of the gPanel server
networking
Package networking contains various functions used to communicate between networks and draw data from the client network.
Package networking contains various functions used to communicate between networks and draw data from the client network.
public
Package public handles the logic of the public facing website
Package public handles the logic of the public facing website
routing
Package routing contains various functions related to HTTP routing
Package routing contains various functions related to HTTP routing

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL