Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

working development environment #82

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -82,14 +82,16 @@ to your *supervisord.conf*:
```ini
[eventlistener:multivisor-rpc]
command=multivisor-rpc --bind 0:9002
events=PROCESS_STATE,SUPERVISOR_STATE
events=PROCESS_STATE,SUPERVISOR_STATE_CHANGE
```

If no *bind* is given, it defaults to `*:9002`.

You are free to choose the event listener name. As a convention we propose
`multivisor-rpc`.

NB: Make sure that `multivisor-rpc` command is accessible or provide full PATH.

Repeat the above procedure for every supervisor you have running.


2 changes: 2 additions & 0 deletions multivisor/server/rpc.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import print_function

import sys
import logging
import xmlrpc.client
13 changes: 11 additions & 2 deletions multivisor/server/util.py
Original file line number Diff line number Diff line change
@@ -27,11 +27,11 @@ def constant_time_compare(val1, val2):

Taken from Django Source Code
"""
val1 = hashlib.sha1(val1).hexdigest()
val1 = hashlib.sha1(_safe_encode(val1)).hexdigest()
if val2.startswith("{SHA}"): # password can be specified as SHA-1 hash in config
val2 = val2.split("{SHA}")[1]
else:
val2 = hashlib.sha1(val2).hexdigest()
val2 = hashlib.sha1(_safe_encode(val2)).hexdigest()
if len(val1) != len(val2):
return False
result = 0
@@ -40,6 +40,15 @@ def constant_time_compare(val1, val2):
return result == 0


def _safe_encode(data):
"""Safely encode @data string to utf-8"""
try:
result = data.encode("utf-8")
except (UnicodeDecodeError, UnicodeEncodeError, AttributeError):
result = data
return result


def login_required(app):
"""
Decorator to mark view as requiring being logged in
37,157 changes: 29,827 additions & 7,330 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "multivisor",
"version": "5.1.0",
"version": "6.0.0",
"description": "Manage multiple supervisor instances from a centralized UI",
"author": "Tiago Coutinho <coutinhotiago@gmail.com>",
"private": true,
@@ -60,7 +60,8 @@
"vue-template-compiler": "^2.5.22",
"webpack": "^3.12.0",
"webpack-bundle-analyzer": "^2.13.1",
"webpack-dev-server": "^3.1.14",
"webpack-cli": "^1.4.6",
"webpack-dev-server": "^2.11.1",
"webpack-merge": "^4.2.1"
},
"engines": {
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@

setup(
name="multivisor",
version="5.1.0",
version="6.0.0",
author="Tiago Coutinho",
author_email="coutinhotiago@gmail.com",
description="A centralized supervisor UI (web & CLI)",