From fdb1acdaef656cfd36575c885b1a98584f073810 Mon Sep 17 00:00:00 2001 From: quackerd Date: Mon, 21 Aug 2023 09:22:57 -0400 Subject: [PATCH] refactor --- .env | 5 ----- docker-compose.yml | 10 +++++----- opt/init.py | 9 --------- 3 files changed, 5 insertions(+), 19 deletions(-) delete mode 100644 .env diff --git a/.env b/.env deleted file mode 100644 index c556b0f..0000000 --- a/.env +++ /dev/null @@ -1,5 +0,0 @@ -PORT=443 -TARGET_URL=example.com -TARGET_PORT=443 -USERS=exampleuser1,exampleuser2 -LOG_LEVEL=warn \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 879b137..ecd3f77 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,12 +7,12 @@ services: image: quackerd/d2ray container_name: d2ray ports: - - ${PORT}:${PORT} + - 8443:8443 environment: - - PORT=${PORT} - - TARGET_URL=${TARGET_URL} - - TARGET_PORT=${TARGET_PORT} - - USERS=${USERS} + - PORT=8443 + - TARGET_URL=example.com + - TARGET_PORT=443 + - USERS=exampleuser1,exampleuser2 - LOG_LEVEL=${LOG_LEVEL} restart: unless-stopped networks: diff --git a/opt/init.py b/opt/init.py index c741cf5..7d2d0d3 100644 --- a/opt/init.py +++ b/opt/init.py @@ -1,5 +1,4 @@ import os -import sys import subprocess import jinja2 import random @@ -55,14 +54,6 @@ class d2args: ) return ret - def get_users_json(self) -> str: - ret : str= "" - for i in range(len(users)): - if (i > 0): - ret = ret + "," - ret = ret + "{\"id\": \"" + users[i][0] + "\",\"flow\": \"" + users[i][1] + "\"}" - return ret - def process_directory(path : str, vars : dict[str, str], delete_template : bool = True) -> None: for f in os.listdir(path):