OpenNeL pyManager is a toolset to handle OpenNeL server systems through python scripts
Find a file
2019-04-07 11:33:54 +02:00
conf adding first version pymanager, include test, coverage, doc[sphinx], generate package 2018-02-02 21:52:32 +01:00
debian adding first version pymanager, include test, coverage, doc[sphinx], generate package 2018-02-02 21:52:32 +01:00
docs adding first version pymanager, include test, coverage, doc[sphinx], generate package 2018-02-02 21:52:32 +01:00
pymanager #88 - ignore BrokenPipeError 2019-04-07 11:33:54 +02:00
tests #5 - Replace class khaganatHTTPServer by OpenNeLHTTPServer 2018-10-13 23:58:36 +02:00
.coveragerc update coverity/test 2018-02-13 20:43:02 +01:00
.gitignore adding status pipeline & coverage, adding xml coverage report 2018-02-07 22:47:06 +01:00
.gitlab-ci.yml update name package 2018-10-14 01:38:57 +02:00
LICENSE.txt adding first version pymanager, include test, coverage, doc[sphinx], generate package 2018-02-02 21:52:32 +01:00
Makefile #4 - Add python dependency 2018-10-13 15:09:59 +02:00
MANIFEST.in adding first version pymanager, include test, coverage, doc[sphinx], generate package 2018-02-02 21:52:32 +01:00
README.md adding example on readme 2018-02-14 23:15:26 +01:00
README.rst adding first version pymanager, include test, coverage, doc[sphinx], generate package 2018-02-02 21:52:32 +01:00
requirements.txt #4 - Add python dependency 2018-10-13 15:09:59 +02:00
setup.cfg update readme, ignore some file to git, and adding python wheel universal 2018-02-05 23:10:00 +01:00
setup.py #4 - Add python dependency 2018-10-13 15:09:59 +02:00

OpenNel pyManager project

This projects does aim to make tools to manipulate the MMORPG Khanat.

Khanat is open source and released under the terms of the GNU Affero General Public License 3.0 (GNU/AGPLv3) for the source code and the Creative Commons Attributions-ShareAlike 3.0 (CC-BY-SA) for the art assets. Which means you can create your own game using Khanat OpenNel, for more information on doing so check out Creating Your Own Game Using Khanat OpenNel.

https://khaganat.net/wikhan/fr:collabo_pymanager

Master: pipeline status coverage report

Develop: pipeline status coverage report

Prepare our environment

Install

apt-get install python3 python3-setuptools python3-virtualenv python3-stdeb python3-all python3-coverage python3-pep8 python3-sphinx python3-pip graphviz python3-bcrypt
apt-get install autogen autoconf automake fakeroot

Check

cd opennel-pymanager
make

Source package

cd opennel-pymanager
make sdist
# result at
ls dist/pymanager-*.tar.gz

Python package

cd opennel-pymanager
make bdist
# result at
ls dist/pymanager-*.tar.gz

Wheel package

cd opennel-pymanager
make bdist_wheel
# result at
ls dist/pymanager-*.whl

Test

cd opennel-pymanager
make test

Coverage

cd opennel-pymanager
make coverage
# result at
ls docs/coverage/

Generate Html Documentation :

cd opennel-pymanager
make htmldoc
# result at 
ls docs/build/

Debian package:

cd opennel-pymanager
make builddeb
# result at 
ls ../python3-opennel-pymanager_*_all.deb

Example:

Clone

    git clone https://git.khaganat.net/khaganat/mmorpg_khanat/opennel-pymanager.git
    cd opennel-pymanager
    git checkout develop

Create workdir

    mkdir temp
    cd temp

Create certificat

    ../pymanager/certificate.py

Server Configuration

Example configuration with TLS1.2. We have two program (one command:sleep -> stop after 10s, command:simulate -> daemon (emulate khanat process)

cat << EOF > server.cfg
[config:server]
port = 8000
keyfile = ca/appli/private/serverkey.pem
certfile = ca/appli/certs/servercert.pem
ca_cert = ca/appli/certs/cachaincert.pem
authentification = no
[command:sleep]
command = sleep 10
[command:simulate]
command = ../tests/simulate_program.py
EOF

Client Configuration

cat << EOF > client.cfg
[config:client]
port = 8000
keyfile = ca/appli/private/clientkey.pem
certfile = ca/appli/certs/clientcert.pem
ca_cert = ca/appli/certs/cachaincert.pem
address = localhost
EOF

Start Manager

../pymanager/manager.py -c server.cfg --log DEBUG

if you want, you can launch like deamon

nohup ../pymanager/manager.py -c server.cfg --log DEBUG &

Launch command (with client)

STATUS

../pymanager/client.py -c client.cfg --log DEBUG --program 'command:simulate' --command STATUS

START

../pymanager/client.py -c client.cfg --log DEBUG --program 'command:simulate' --command START

STATUS

../pymanager/client.py -c client.cfg --log DEBUG --program 'command:simulate' --command STATUS

STDIN

Send command

../pymanager/client.py -c client.cfg --log DEBUG --program 'command:simulate' --command STDIN --stdin="help all"

STDOUT

Read output

../pymanager/client.py -c client.cfg --log DEBUG --program 'command:simulate' --command STDOUT

STOP

../pymanager/client.py -c client.cfg --log DEBUG --program 'command:simulate' --command STOP

STARTALL

../pymanager/client.py -c client.cfg --log DEBUG --program 'command:simulate' --command STARTALL

STATUSALL

../pymanager/client.py -c client.cfg --log DEBUG --program 'command:simulate' --command STATUSALL

STOPALL

../pymanager/client.py -c client.cfg --log DEBUG --program 'command:simulate' --command STOPALL

WITH CURL

curl -k --tlsv1.2 --cacert ca/appli/certs/cachaincert.pem --cert ca/appli/certs/clientcert.pem --key ca/appli/private/clientkey.pem -XGET "https://localhost:8000/STATUSALL"
curl -k --tlsv1.2 --cacert ca/appli/certs/cachaincert.pem --cert ca/appli/certs/clientcert.pem --key ca/appli/private/clientkey.pem --header "content-type: application/json"  -d '{"name": "command:simulate"}' -XGET "https://localhost:8000/STATUS"

SHUTDOWN

../pymanager/client.py -c client.cfg --log DEBUG --program 'command:simulate' --command SHUTDOWN