Skip to content

Commit

Permalink
Merge pull request #10 from gmemstr/rewrite
Browse files Browse the repository at this point in the history
WIP: Rewrite
  • Loading branch information
gmemstr committed Apr 19, 2019
2 parents 18a64a3 + 3b6a249 commit ad5766b
Show file tree
Hide file tree
Showing 49 changed files with 703 additions and 1,587 deletions.
97 changes: 4 additions & 93 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,93 +1,4 @@
Scripts/aor_output/*
config.json
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject

Scripts/aor_config\.json
.idea/
.secret
stats.json
client/config.yml
17 changes: 0 additions & 17 deletions Dockerfile

This file was deleted.

81 changes: 61 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,70 @@
![https://img.shields.io/badge/Status-v3.0%20In%20Progress-green.svg](https://img.shields.io/badge/Status-v3.0%20In%20Progress-green.svg)

# Platypus
## Simple realtime server monitoring

[![https://img.shields.io/badge/demo-status.gmem.ca-black.svg](https://img.shields.io/badge/demo-status.gmem.ca-black.svg?style=for-the-badge)](https://status.gmem.ca)
[![https://img.shields.io/badge/frontend-gmemstr%2Fplatypus--react-blue.svg](https://img.shields.io/badge/frontend-gmemstr%2Fplatypus--react-blue.svg?style=for-the-badge)](https://github.com/gmemstr/platypus-react)

### Dependencies

```bash
go get github.com/gorilla/mux
go get github.com/gorilla/websocket
go get github.com/go-yaml/yaml
go get github.com/shirou/gopsutil
```

### Usage

Master server:
```bash
go build -o platypus main.go
chmod +x platypus
./platypus
```

Client servers:
```bash
go build -o platypus_client client/client.go
chmod +x platypus_client
nano config.yml
# Input your secret key and master server IP here, secret key found on master server in .secret
# master: example.com
# secret: s3cr3tk3y
# End config
./platypus_client
```

Navigate to your master server and check out the stats.

[Live Stable Branch](https://status.ggserv.xyz)
## Rewrite

Active online and usage monitor using websockets and Python
Rewriting this from the ground up. Why did I do this in Python.

The goal of the rewrite is to move away from using Python for the entire stack
and instead break things up into smaller chunks, maybe moving this to it's own
GitHub / Gitlab org, which will allow it to be much more modular and open ended
when it comes to what kind of information you want to monitor and how.

## Features
- Setup script
- Websocket-based uptime monitoring (**AOR**)
- Auto-post to Slack when server goes offline
- Provide live server usage statistics with web frontend
- Simple JSON API for building apps
- Admin interface for managing servers
### Steps

## Getting Started
1. Rewriting the core functionality, which is a basic stats dashboard
and server management through an admin interface. We also want to rethink how to
handle Active Online Reporting - websockets still _seems_ like the best option
for this but there's got to be a better way. Might opt for Go master server
side as it's something I have experience in and should offer good performance etc.

Please see the wiki page [Getting Started](https://github.com/gmemstr/Platypus/wiki/Getting-Started)
2. Rebuild the client based on the specifications of #1, and deciding the best
way to build and distribute the package w/ configuration - I personally want to
go with something we can compile into a very small package and ship with a
master server-generated configuration file of some sort. Was thinking C++ might
be a good option over Go size wise but there could be additional time overhead.

## Requirements
- Python 3.x (2.x not officially supported)
- pip
- `pip install -r requirements.txt`
- MariaDB or MySQL
3. Write a straightforward API both client (or "node") side, which would allow
applications to construct and send custom messages to the master server, and
master server side, which will handle said customer messages. This should be fairly
straightforward once we have #1 and #2 complete.

## Running
See [Getting Started](https://github.com/gmmemstr/Platypus/wiki/Getting-Started)
4. A plugin system - I don't really know what form this would take since it's pretty
far down the line, but it's something to consider. Some sort of simple scripting
language that we can easily write an interpreter for in Go for the master server and
would expose various variables / functions.
90 changes: 0 additions & 90 deletions Scripts/.dockerignore

This file was deleted.

14 changes: 0 additions & 14 deletions Scripts/Dockerfile

This file was deleted.

37 changes: 0 additions & 37 deletions Scripts/Migration/convert-to-serverhandler.py

This file was deleted.

14 changes: 0 additions & 14 deletions Scripts/Migration/json-to-mysql.py

This file was deleted.

15 changes: 0 additions & 15 deletions Scripts/Migration/register-ips.py

This file was deleted.

Loading

0 comments on commit ad5766b

Please sign in to comment.