mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-02-03 00:33:57 +03:00
update
This commit is contained in:
parent
c01b7331b5
commit
7adfe74ffd
@ -86,6 +86,7 @@ def setupArgParser():
|
|||||||
parser.add_argument("--httpsKey", type=str, default="ssl.key", help="path for the key of https")
|
parser.add_argument("--httpsKey", type=str, default="ssl.key", help="path for the key of https")
|
||||||
parser.add_argument("--httpsCert", type=str, default="ssl.cert", help="path for the cert of https")
|
parser.add_argument("--httpsCert", type=str, default="ssl.cert", help="path for the cert of https")
|
||||||
parser.add_argument("--httpsSelfSigned", type=strtobool, default=True, help="generate self-signed certificate")
|
parser.add_argument("--httpsSelfSigned", type=strtobool, default=True, help="generate self-signed certificate")
|
||||||
|
parser.add_argument("--colab", type=strtobool, default=False, help="run on colab")
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
def printMessage(message, level=0):
|
def printMessage(message, level=0):
|
||||||
@ -136,7 +137,7 @@ if __name__ == thisFilename:
|
|||||||
return {"result": "Index"}
|
return {"result": "Index"}
|
||||||
|
|
||||||
|
|
||||||
@app_fastapi.post("/api/uploadfile/model")
|
@app_fastapi.post("/upload_model_file")
|
||||||
async def upload_file(configFile:UploadFile = File(...), modelFile: UploadFile = File(...)):
|
async def upload_file(configFile:UploadFile = File(...), modelFile: UploadFile = File(...)):
|
||||||
if configFile and modelFile:
|
if configFile and modelFile:
|
||||||
for file in [modelFile, configFile]:
|
for file in [modelFile, configFile]:
|
||||||
@ -205,55 +206,56 @@ if __name__ == '__main__':
|
|||||||
printMessage(f"Start MMVC SocketIO Server", level=0)
|
printMessage(f"Start MMVC SocketIO Server", level=0)
|
||||||
printMessage(f"CONFIG:{CONFIG}, MODEL:{MODEL}", level=1)
|
printMessage(f"CONFIG:{CONFIG}, MODEL:{MODEL}", level=1)
|
||||||
|
|
||||||
if os.environ["EX_PORT"]:
|
if args.colab == False:
|
||||||
EX_PORT = os.environ["EX_PORT"]
|
if os.getenv("EX_PORT"):
|
||||||
printMessage(f"External_Port:{EX_PORT} Internal_Port:{PORT}", level=1)
|
EX_PORT = os.environ["EX_PORT"]
|
||||||
else:
|
printMessage(f"External_Port:{EX_PORT} Internal_Port:{PORT}", level=1)
|
||||||
printMessage(f"Internal_Port:{PORT}", level=1)
|
else:
|
||||||
|
printMessage(f"Internal_Port:{PORT}", level=1)
|
||||||
|
|
||||||
if os.environ["EX_IP"]:
|
if os.getenv("EX_IP"):
|
||||||
EX_IP = os.environ["EX_IP"]
|
EX_IP = os.environ["EX_IP"]
|
||||||
printMessage(f"External_IP:{EX_IP}", level=1)
|
printMessage(f"External_IP:{EX_IP}", level=1)
|
||||||
|
|
||||||
# HTTPS key/cert作成
|
# HTTPS key/cert作成
|
||||||
if args.https and args.httpsSelfSigned == 1:
|
if args.https and args.httpsSelfSigned == 1:
|
||||||
# HTTPS(おれおれ証明書生成)
|
# HTTPS(おれおれ証明書生成)
|
||||||
os.makedirs("./key", exist_ok=True)
|
os.makedirs("./key", exist_ok=True)
|
||||||
key_base_name = f"{datetime.now().strftime('%Y%m%d_%H%M%S')}"
|
key_base_name = f"{datetime.now().strftime('%Y%m%d_%H%M%S')}"
|
||||||
keyname = f"{key_base_name}.key"
|
keyname = f"{key_base_name}.key"
|
||||||
certname = f"{key_base_name}.cert"
|
certname = f"{key_base_name}.cert"
|
||||||
create_self_signed_cert(certname, keyname, certargs=
|
create_self_signed_cert(certname, keyname, certargs=
|
||||||
{"Country": "JP",
|
{"Country": "JP",
|
||||||
"State": "Tokyo",
|
"State": "Tokyo",
|
||||||
"City": "Chuo-ku",
|
"City": "Chuo-ku",
|
||||||
"Organization": "F",
|
"Organization": "F",
|
||||||
"Org. Unit": "F"}, cert_dir="./key")
|
"Org. Unit": "F"}, cert_dir="./key")
|
||||||
key_path = os.path.join("./key", keyname)
|
key_path = os.path.join("./key", keyname)
|
||||||
cert_path = os.path.join("./key", certname)
|
cert_path = os.path.join("./key", certname)
|
||||||
printMessage(f"protocol: HTTPS(self-signed), key:{key_path}, cert:{cert_path}", level=1)
|
printMessage(f"protocol: HTTPS(self-signed), key:{key_path}, cert:{cert_path}", level=1)
|
||||||
elif args.https and args.httpsSelfSigned == 0:
|
elif args.https and args.httpsSelfSigned == 0:
|
||||||
# HTTPS
|
# HTTPS
|
||||||
key_path = args.httpsKey
|
key_path = args.httpsKey
|
||||||
cert_path = args.httpsCert
|
cert_path = args.httpsCert
|
||||||
printMessage(f"protocol: HTTPS, key:{key_path}, cert:{cert_path}", level=1)
|
printMessage(f"protocol: HTTPS, key:{key_path}, cert:{cert_path}", level=1)
|
||||||
else:
|
else:
|
||||||
# HTTP
|
# HTTP
|
||||||
printMessage(f"protocol: HTTP", level=1)
|
printMessage(f"protocol: HTTP", level=1)
|
||||||
|
|
||||||
# アドレス表示
|
# アドレス表示
|
||||||
if args.https == 1:
|
if args.https == 1:
|
||||||
printMessage(f"open https://<IP>:<PORT>/ with your browser.", level=0)
|
printMessage(f"open https://<IP>:<PORT>/ with your browser.", level=0)
|
||||||
else:
|
else:
|
||||||
printMessage(f"open http://<IP>:<PORT>/ with your browser.", level=0)
|
printMessage(f"open http://<IP>:<PORT>/ with your browser.", level=0)
|
||||||
|
|
||||||
if EX_PORT and EX_IP and args.https == 1:
|
if EX_PORT and EX_IP and args.https == 1:
|
||||||
printMessage(f"In many cases it is one of the following", level=1)
|
printMessage(f"In many cases it is one of the following", level=1)
|
||||||
printMessage(f"https://localhost:{EX_PORT}/", level=1)
|
printMessage(f"https://localhost:{EX_PORT}/", level=1)
|
||||||
for ip in EX_IP.strip().split(" "):
|
for ip in EX_IP.strip().split(" "):
|
||||||
printMessage(f"https://{ip}:{EX_PORT}/", level=1)
|
printMessage(f"https://{ip}:{EX_PORT}/", level=1)
|
||||||
elif EX_PORT and EX_IP and args.https == 0:
|
elif EX_PORT and EX_IP and args.https == 0:
|
||||||
printMessage(f"In many cases it is one of the following", level=1)
|
printMessage(f"In many cases it is one of the following", level=1)
|
||||||
printMessage(f"http://localhost:{EX_PORT}/", level=1)
|
printMessage(f"http://localhost:{EX_PORT}/", level=1)
|
||||||
|
|
||||||
|
|
||||||
# サーバ起動
|
# サーバ起動
|
||||||
@ -277,4 +279,3 @@ if __name__ == '__main__':
|
|||||||
reload=True,
|
reload=True,
|
||||||
log_level="critical"
|
log_level="critical"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
2
frontend/dist/index.js
vendored
2
frontend/dist/index.js
vendored
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
|||||||
FROM dannadori/voice-changer-internal:20221029_231527 as front
|
FROM dannadori/voice-changer-internal:20221030_013959 as front
|
||||||
FROM debian:bullseye-slim as base
|
FROM debian:bullseye-slim as base
|
||||||
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
Loading…
Reference in New Issue
Block a user