Skip to content

Commit

Permalink
feat(app):
Browse files Browse the repository at this point in the history
- local usage with password with redirect to auth login
  • Loading branch information
MorvanZhou committed May 24, 2024
1 parent a3fa88b commit e2aefe4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
os.environ["VUE_APP_API_URL"] = f"http://{args.host}:{args.port}"
if os.environ.get("VUE_APP_MODE") is None:
os.environ["VUE_APP_MODE"] = args.mode

os.environ["RETHINK_LOCAL_STORAGE_PATH"] = os.getcwd()
os.environ["RETHINK_SERVER_HEADLESS"] = "1" if args.headless else "0"
os.environ["RETHINK_SERVER_DEBUG"] = "true" if args.debug else "false"
if args.password is not None:
Expand Down
10 changes: 10 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ Options:
-m, --mode Set mode to local, dev or prod, personal use is restricted to local mode
-r, --reload Reload server on code change
-h, --help Show this help message and exit
--password, Set password for local mode
"

# set mode
mode="local"
reload=""
host="127.0.0.1"
port="8000"
password=""


while [[ $# -gt 0 ]]
Expand Down Expand Up @@ -45,6 +47,11 @@ do
shift
shift
;;
--password)
password="$2"
shift
shift
;;
*)
echo "Unknown option $key"
exit 1
Expand All @@ -58,6 +65,9 @@ export VUE_APP_MODE=$mode
if [ $mode == "local" ]; then
export RETHINK_LOCAL_STORAGE_PATH=.
export RETHINK_SERVER_HEADLESS=1
if [ $password != "" ]; then
export RETHINK_LOCAL_PASSWORD=$password
fi
fi
echo "Running in $mode mode with reload=$reload on $host:$port"
# set working directory to retk
Expand Down
2 changes: 1 addition & 1 deletion src/retk/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


class Settings(BaseSettings):
ONE_USER: bool = Field(default=1, env='ONE_USER')
ONE_USER: bool = Field(default=False, env='ONE_USER')
RETHINK_SERVER_DEBUG: bool = Field(default=False, env='RETHINK_SERVER_DEBUG')
VERIFY_REFERER: bool = Field(default=False, env='VERIFY_REFERER')
PLUGINS: bool = Field(default=False, env='PLUGINS')
Expand Down
Loading

0 comments on commit e2aefe4

Please sign in to comment.