A web-hosting control panel written in Go.
Find a file
2018-02-07 16:40:49 -06:00
account front end interface for adding/removing/listing subdomains for accounts is in place 2018-01-23 15:35:48 -06:00
bundles restructured to serve out of /home/[bundle_name]/document_root/ and also store logs in /home/[bundle_name]/logs, removing the need to keep track of anything other than .db files within the program for each bundle. the log read/write/truncate api's need fixed though 2018-01-18 15:33:21 -06:00
pkg fixed issue where multiple bundles used the same instance of http.Server 2018-02-07 16:39:59 -06:00
server made add user form erase password fields after submission 2018-01-09 14:12:59 -06:00
vendor update dep to remove gorilla/sessions and gorilla/context 2018-01-22 17:08:12 -06:00
.gitignore restructured to serve out of /home/[bundle_name]/document_root/ and also store logs in /home/[bundle_name]/logs, removing the need to keep track of anything other than .db files within the program for each bundle. the log read/write/truncate api's need fixed though 2018-01-18 15:33:21 -06:00
.travis.yml Update .travis.yml 2017-10-25 13:36:36 -05:00
CODE_OF_CONDUCT.md init CONDUCT 2017-10-17 14:59:41 -05:00
CONTRIBUTING.md Update CONTRIBUTING.md 2018-01-30 14:59:04 -06:00
Gopkg.lock update dep to remove gorilla/sessions and gorilla/context 2018-01-22 17:08:12 -06:00
Gopkg.toml this should have definitely been several commits... I did a lot of things, added deps for boltdb, init boltdb, built out a way to handle APIs (don't know how good it is haha), and did some minor authentication that half-way works for the webhost 2017-10-24 17:07:40 -05:00
gpanel.go fixed issue where multiple bundles used the same instance of http.Server 2018-02-07 16:39:59 -06:00
ISSUE_TEMPLATE.md updated contributing for better contributing instructions and issue_template style 2017-10-18 17:41:03 -05:00
LICENSE init LICENSE 2017-10-17 14:57:45 -05:00
README.md updated readme to include installation guide 2018-01-24 14:17:19 -06:00

gPanel TravisCI gPanel Build

A web-hosting control panel written in Go.

Note: This software currently only runs on Linux systems.

Stack

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

Contribution Set-up & Deployment

To get the repo...

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

# Navigate to the directory (replace $GOPATH with your actual $GOPATH)
cd $GOPATH/github.com/Ennovar/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

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)
  • 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

Installing and Running gPanel

  1. go get github.com/Ennovar/gPanel
  2. cd ~/go/src/github.com/Ennovar/gPanel
  3. go build gpanel.go
  4. sudo ./gpanel