Pavonian / superadmin

Manage your Linux servers and Total.js applications easily. Free and open-source.

Home Page:https://www.totaljs.com/superadmin/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MIT License

Support

Installation

  • SuperAdmin (v9.0.0) needs latest Total.js v4 from NPM $ npm install total4
  • License: MIT
  • Documentation

IMPORTANT

  • SuperAdmin is running on port 9999 which can be changed in run.sh script in /www/superadmin/run.sh
  • SuperAdmin is auto-generating port numbers for new applications starting from 8000. So for 100 apps you need to make sure ports 8000-8099 are free.
  • SuperAdmin must be run as root

Install requirements:

  • Ubuntu Server +v14
  • curl
  • openssl Version +1.1.1 (for TLSv1.3)
  • nginx

SuperAdmin requirements:

  • awk
  • bash
  • cat
  • cp
  • df
  • du
  • free
  • ftp
  • grep
  • ifconfig
  • last
  • lsof
  • mkdir
  • netstat
  • npm
  • ps
  • tail
  • tar
  • unzip
  • uptime
  • wc
  • zip

To install SuperAdmin run commands bellow:

# UBUNTU
$ wget https://cdn.totaljs.com/superadmin.sh && sudo bash superadmin.sh
# CENTOS
$ wget https://cdn.totaljs.com/superadmin-centos.sh && sudo bash superadmin-centos.sh
# ALPINE
$ wget https://cdn.totaljs.com/superadmin-alpine.sh && sudo bash superadmin-alpine.sh
  • login user: admin, password: admin (credentials are stored in /www/superadmin/config)
  • manually run (if you didn't register cron in the installation) $ cd /www/superadmin/ and $ bash run.sh

To install and run SuperAdmin with Docker:

# CLONE this repository to the current folder
git clone https://github.com/totaljs/superadmin.git .

# BUILD with tag superadmin
docker build -t superadmin .

# RUN tag superadmin (you can also map any of the exposed ports)
docker run -p 8080:80 -it superadmin

Where does SuperAdmin store data?

All data are stored in /superadmin/databases/ directory. Applications are stored in application.json.

IMPORTANT: NGINX access logs are stored as /www/logs/[appname]--access.log


How to upload my application?

SuperAdmin uses a Total.js package mechanism. The mechanism creates a package file with a complete directory structure and all files. IMPORTANT the latest version supports uploading of .zip files.

  • first you have to install Total.js framework as a global module $ npm install -g total.js
  • then perform a command below:
$ cd myapplication
$ tpm create myapp.package
  • tpm creates a package file
  • and this file you can upload via SuperAdmin

Upload a new application


How to upgrade my older SuperAdmin version?

Don't worry, it's very easy.

  • back up file /databases/applications.json
  • back up your credentials in /config file (only credentials, nothing more)
  • copy all directories and files from a new version of SuperAdmin to your server
  • restore your backup file /databases/applications.json
  • restore your credentials in /config
  • install ftp helper via $ apt-get install -y ftp
  • you have to update SSL generator to latest version via bash /www/superadmin/ssl.sh --update
  • restart SuperAdmin bash run.sh
  • clear cache in your web browser

IMPORTANT: if you have lower version than v7.0.0 then replace /etc/nginx/nginx.conf for /superadmin/nginx.conf.

Nice to know

Bash script superadmin/ssl.sh can create or renew certificate manually:

# CREATE:
$ bash ssl.sh superadmin.mydomain.com

# RENEW:
$ bash ssl.sh superadmin.mydomain.com --renew

Bash script superadmin/reconfigure.sh can reconfigure SuperAdmin from/to HTTPS:

# SET TO HTTPS AND GENERATE SSL:
$ bash reconfigure.sh y superadmin.mydomain.com y

# SET TO HTTPS WITHOUT GENERATING SSL:
$ bash reconfigure.sh y superadmin.mydomain.com

# SET TO HTTP:
$ bash reconfigure.sh n superadmin.mydomain.com

Uninstall SuperAdmin

  • stop all apps in SuperAdmin
  • kill SuperAdmin using this command $ kill -9 $(lsof -i :9999 | grep "total" | awk {'print $2'}) > /dev/null
  • to replace nginx.conf with backed up file use this command $ cp /etc/nginx/nginx.conf.backup /etc/nginx/nginx.conf
  • reload nginx service nginx reload and/or just stop it $ service nginx stop
  • if you added a cron job to start apps at system startup then remove this line @reboot /bin/bash /www/superadmin/run.sh from crontab using $ crontab -e command
  • remove /www/ folder, this will remove all ssl certificates, nginx conf files, all applications, etc.
  • to remove node.js run $ apt-get remove -y nodejs
  • to remove nginx run $ apt-get remove -y nginx
  • to remove graphicsmagick run $ apt-get remove -y graphicsmagick

Contributors

About

Manage your Linux servers and Total.js applications easily. Free and open-source.

https://www.totaljs.com/superadmin/

License:MIT License


Languages

Language:JavaScript 61.5%Language:HTML 19.0%Language:CSS 15.0%Language:Shell 4.6%