diff options
Diffstat (limited to 'tool')
| -rwxr-xr-x | tool/aio.py | 3 | ||||
| -rw-r--r-- | tool/modules/config.py | 10 | ||||
| -rw-r--r-- | tool/modules/setup.py | 24 | 
3 files changed, 3 insertions, 34 deletions
diff --git a/tool/aio.py b/tool/aio.py index 467b7ca..3d44310 100755 --- a/tool/aio.py +++ b/tool/aio.py @@ -186,6 +186,7 @@ def run():              install_docker()              console.print(                  "Succeeded to install docker. Please re-login to take effect.", style="green") +          case "docker":              docker_action = args.docker_action @@ -226,6 +227,7 @@ def run():              domains = list_domains(domain)              for domain in domains:                  console.print(domain) +          case "nginx":              domain = check_domain_is_defined()              nginx(domain, console) @@ -265,6 +267,7 @@ def run():                      test_crupest_api(console)                  case _:                      console.print("Test action invalid.", style="red") +          case "dns":              domain = check_domain_is_defined()              if domain is not None: diff --git a/tool/modules/config.py b/tool/modules/config.py index 937a870..534ce30 100644 --- a/tool/modules/config.py +++ b/tool/modules/config.py @@ -32,16 +32,6 @@ config_var_list: list = [                "Please input your domain name"),      ConfigVar("CRUPEST_EMAIL", "admin email address",                "Please input your email address"), -    ConfigVar("CRUPEST_USER", "your system account username", -              lambda: pwd.getpwuid(os.getuid()).pw_name), -    ConfigVar("CRUPEST_GROUP", "your system account group name", -              lambda: grp.getgrgid(os.getgid()).gr_name), -    ConfigVar("CRUPEST_UID", "your system account uid", -              lambda: str(os.getuid())), -    ConfigVar("CRUPEST_GID", "your system account gid", -              lambda: str(os.getgid())), -    ConfigVar("CRUPEST_IN_CHINA", -              "set to true if you are in China, some network optimization will be applied", lambda: "false"),      ConfigVar("CRUPEST_AUTO_BACKUP_COS_SECRET_ID",                "access key id for Tencent COS, used for auto backup", "Please input your Tencent COS access key id for backup"),      ConfigVar("CRUPEST_AUTO_BACKUP_COS_SECRET_KEY", diff --git a/tool/modules/setup.py b/tool/modules/setup.py index f9c23f8..0e802c4 100644 --- a/tool/modules/setup.py +++ b/tool/modules/setup.py @@ -22,14 +22,6 @@ def get_template_name_list(console) -> list[str]:  def data_dir_check(domain, console): -    if not exists(data_dir): -        console.print( -            "Looks like you haven't generated data dir. I'll create it for you.", style="green") -        os.mkdir(data_dir) -    elif not isdir(data_dir): -        console.print( -            "ERROR: data dir is not a dir! Everything will be broken! Please delete it manually", style="red") -      if isdir(data_dir):          if not exists(join(data_dir, "certbot")):              print_create_cert_message(domain, console) @@ -39,22 +31,6 @@ def data_dir_check(domain, console):              if to_check:                  check_ssl_cert(domain, console) -    if not exists(join(data_dir, "code-server")): -        os.mkdir(join(data_dir, "code-server")) -        console.print( -            "I also create data dir for code-server. Because letting docker create it would result in permission problem.", style="green") -    else: -        code_server_stat = os.stat( -            join(data_dir, "code-server")) -        if code_server_stat.st_uid == 0 or code_server_stat.st_gid == 0: -            console.print( -                "WARNING: The owner of data dir for code-server is root. This may cause permission problem. You had better change it.", style="yellow") -            to_fix = Confirm.ask( -                "Do you want me to help you fix it?", console=console, default=True) -            if to_fix: -                subprocess.run( -                    ["sudo", "chown", "-R", f"{os.getuid()}:{os.getgid()}", join(data_dir, 'code-server')], check=True) -  def template_generate(console):      template_name_list = get_template_name_list(console)  | 
