summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrun-local.sh17
-rwxr-xr-x[-rw-r--r--]src/local/rz_cli_tool.py11
2 files changed, 26 insertions, 2 deletions
diff --git a/run-local.sh b/run-local.sh
index 033b896c..39c1580b 100755
--- a/run-local.sh
+++ b/run-local.sh
@@ -8,6 +8,23 @@ if [ $neo4j_count == "0" ]; then
echo run neo4j please
exit 0
fi
+CONFIG=res/etc/rhizi-server.conf
+EXAMPLE=res/etc/rhizi-server.conf.example
+HTPASSWD=res/etc/htpasswd
+if [ ! -f $CONFIG ]; then
+ echo "copying $EXAMPLE to $CONF"
+ echo "please edit it as you see fit"
+ cp $EXAMPLE $CONFIG
+fi
+if [ `cat $CONFIG | grep access_control | grep True | wc -l` == 1 -a ! -e $HTPASSWD ] ; then
+ echo "missing htpasswd file. Please create an input file containing"
+ echo "username,password"
+ echo "on every line, one line per user"
+ echo "place it in for instance res/etc/htpasswd-init-file"
+ echo "and run"
+ echo "src/local/rz_cli_tool.py --init-htpasswd-db --config-dir res/etc --htpasswd-init-file res/etc/htpasswd-init-file"
+ exit 1
+fi
make # building css relies on Makefile
ant -f build.ant deploy-local
cd deploy-local
diff --git a/src/local/rz_cli_tool.py b/src/local/rz_cli_tool.py
index 93cc132a..6f5ab933 100644..100755
--- a/src/local/rz_cli_tool.py
+++ b/src/local/rz_cli_tool.py
@@ -1,9 +1,16 @@
+#!/bin/env python
+
import argparse
import os
import pickle
import re
+import sys
+
+# access to crypt_util & rz_server
+sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'server'))
+#import pdb; pdb.set_trace()
-import crypt_util
+from crypt_util import hash_pw
from rz_server import init_config
@@ -18,7 +25,7 @@ def init_pw_db(cfg, user_pw_list_file):
pw_db[u] = hash_pw(str(p), salt)
pickle.dump(pw_db, f)
- log.info('htpasswd db: added entry: user: %s, pw: %s...' % (u, pw_db[u][:5]))
+ print('htpasswd db: added entry: user: %s, pw: %s...' % (u, pw_db[u][:5]))
htpasswd_path = cfg.htpasswd_path