This commit is contained in:
justuser 2024-06-18 10:36:19 +03:00
parent b559b7b659
commit dbaded283b
14 changed files with 34 additions and 17 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
bore Executable file

Binary file not shown.

5
config.json Normal file
View File

@ -0,0 +1,5 @@
{
"ports": [
25128
]
}

View File

@ -51,7 +51,7 @@ def main():
# !!! ИДЁТ ПЕРЕРАБОТКА !!!
# Стартуем интерфейс
#system(f"python -m streamlit run --server.address=127.0.0.1 interface.py {serv_port}")
system(f"python -m streamlit run --server.address=127.0.0.1 interface.py {serv_port}")
if __name__ == "__main__":
# Запускаем главный процесс, чтобы потом легко убить его

View File

@ -36,9 +36,12 @@ def port_gen(st = 25000, end = 25200):
return port
def server_http():
while True:
run = True
while run == True:
try:
os.system("python -m http.server --directory cached")
except KeyboardInterrupt:
run = False
except Exception as e:
print("SERVER_HTTP FALLED")
logging.critical(e, exc_info=True)
@ -122,7 +125,7 @@ def recv(s, data_out):
data_out.put(data)
# op = operation
def client(port, op = "ping", host = 'jetwork.404.mn'):
def client(port, op = "ping", host = 'bore.pub'):
# Если порт не определён
if not port:
return None

View File

@ -16,20 +16,20 @@ if name == "posix":
import getpass
user = getpass.getuser()
system("mkdir ~/.streamlit")
with open(f"/home/{user}/.streamlit/credentials.toml", "w") as f:
f.write('[general]\nemail = "a@a.a"')
f.close()
#system("mkdir ~/.streamlit")
#with open(f"/home/{user}/.streamlit/credentials.toml", "w") as f:
# f.write('[general]\nemail = "a@a.a"')
#f.close()
elif name == "nt":
from shutil import unpack_archive as unpack
download("https://github.com/ekzhang/bore/releases/download/v0.5.0/bore-v0.5.0-x86_64-pc-windows-msvc.zip", "bore.zip")
unpack("bore.zip")
system("del bore.zip")
system("mkdir C:\\Users\\windows\\.streamlit")
with open("C:\\Users\\windows\\.streamlit\\credentials.toml", "w") as f:
f.write('[general]\nemail = "a@a.a"')
f.close()
#system("mkdir C:\\Users\\windows\\.streamlit")
#with open("C:\\Users\\windows\\.streamlit\\credentials.toml", "w") as f:
# f.write('[general]\nemail = "a@a.a"')
#f.close()
else:
print("Увы, вероятно Ваша ОС не поддерживается.")
print("Завершение работы...")
@ -40,12 +40,12 @@ system("mkdir cached")
system("mkdir verify")
system("mkdir mysites")
print("Максимальный размер для кэшированных файлов. (в гигабайтах)")
print("Укажите 0 для отключения ограничения.")
max = input(">> ")
# TODO
#print("Максимальный размер для кэшированных файлов. (в гигабайтах)")
#print("Укажите 0 для отключения ограничения.")
#max = input(">> ")
# Записываем в конфиг
config["max"] = max
write(config)
#config["max"] = max
#write(config)
print("\nЧтобы подключится к jetwork выполните: python main.py")

1
status Normal file
View File

@ -0,0 +1 @@
work

8
stop.py.save Normal file
View File

@ -0,0 +1,8 @@
#
# Установка/проверка статуса завершения
#
import os
if not os.path.exists('status'):