Commit 97c8491b authored by JackV's avatar JackV
Browse files

Revert uus management split

This reverts commit 805d4729.
parent d2ab8626
......@@ -9,7 +9,8 @@ RUN apk add -U python3 py3-gunicorn && \
COPY uus_mng /
COPY /uus
COPY admin /uus/admin
......@@ -8,9 +8,9 @@ Also, `FLASK_APP=uus` must be set when not running in Docker (the Dockerfile alr
Run `flask` to get the list of commands.
In the docker container you can run `uus_mng` directly to get to the CLI, for example
In the docker container you can run `uus` directly to get to the CLI, for example
$ docker exec -it uus_uus_1 /uus_mng adduser admin
$ docker exec -it uus_uus_1 uus adduser admin
\ No newline at end of file
#!/usr/bin/env python3
import crypt
import click
import redis
import os
redis_store = None
default_redis_url = os.environ.get('REDIS_URL', 'redis://')
import click
@click.option("--redisurl", "-u", help="Redis DB url", default=default_redis_url)
def cli(redisurl):
global redis_store
redis_store = redis.from_url(redisurl)
from . import app, redis_store, redis_key_for_user
@click.option("--passwd", "-p", prompt="Password", help="Password", hide_input=True)
def adduser(username, passwd):
"""Add UUS admin user"""
cryptpwd = crypt.crypt(passwd)
redis_store.set('usr.' + username, cryptpwd)
redis_store.set(redis_key_for_user(username), cryptpwd)
@click.option("--passwd", "-p", prompt="Password", help="Password", hide_input=True)
def passwd(username, passwd):
......@@ -32,12 +22,8 @@ def passwd(username, passwd):
adduser(username, passwd)
def deluser(username):
"""Delete UUS admin user"""
redis_store.delete('usr.' + username)
if __name__ == '__main__':
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment