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__": if __name__ == "__main__":
# Запускаем главный процесс, чтобы потом легко убить его # Запускаем главный процесс, чтобы потом легко убить его

View File

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

View File

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