refactor
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
quackerd 2023-08-21 09:22:57 -04:00
parent 050cecc84f
commit fdb1acdaef
3 changed files with 5 additions and 19 deletions

5
.env
View File

@ -1,5 +0,0 @@
PORT=443
TARGET_URL=example.com
TARGET_PORT=443
USERS=exampleuser1,exampleuser2
LOG_LEVEL=warn

View File

@ -7,12 +7,12 @@ services:
image: quackerd/d2ray image: quackerd/d2ray
container_name: d2ray container_name: d2ray
ports: ports:
- ${PORT}:${PORT} - 8443:8443
environment: environment:
- PORT=${PORT} - PORT=8443
- TARGET_URL=${TARGET_URL} - TARGET_URL=example.com
- TARGET_PORT=${TARGET_PORT} - TARGET_PORT=443
- USERS=${USERS} - USERS=exampleuser1,exampleuser2
- LOG_LEVEL=${LOG_LEVEL} - LOG_LEVEL=${LOG_LEVEL}
restart: unless-stopped restart: unless-stopped
networks: networks:

View File

@ -1,5 +1,4 @@
import os import os
import sys
import subprocess import subprocess
import jinja2 import jinja2
import random import random
@ -55,14 +54,6 @@ class d2args:
) )
return ret 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: def process_directory(path : str, vars : dict[str, str], delete_template : bool = True) -> None:
for f in os.listdir(path): for f in os.listdir(path):