From 4cc25bea963c09a1eb0f951bed1eabc75d196446 Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 31 May 2023 23:55:57 +0800 Subject: Add v2ray. --- tool/modules/config.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tool/modules/config.py') diff --git a/tool/modules/config.py b/tool/modules/config.py index 534ce30..40b20d1 100644 --- a/tool/modules/config.py +++ b/tool/modules/config.py @@ -1,10 +1,11 @@ -import pwd -import grp import os import typing +import uuid from rich.prompt import Prompt from .path import config_file_path +def generate_uuid(): + return str(uuid.uuid4()) class ConfigVar: def __init__(self, name: str, description: str, default_value_generator: typing.Callable[[], str] | str, /, default_value_for_ask=str | None): @@ -48,6 +49,12 @@ config_var_list: list = [ "github token for fetching todos", "Please input your github token for fetching todos"), ConfigVar("CRUPEST_GITHUB_TODO_COUNT", "github todo count", "Please input your github todo count", 10), + ConfigVar("CRUPEST_GITHUB_TODO_COUNT", + "github todo count", "Please input your github todo count", 10), + ConfigVar("CRUPEST_V2RAY_TOKEN", + "v2ray user id", generate_uuid), + ConfigVar("CRUPEST_V2RAY_PATH", + "v2ray path, which will be prefixed by _", generate_uuid), ] config_var_name_set = set([config_var.name for config_var in config_var_list]) -- cgit v1.2.3