cycls 0.0.2.11__tar.gz → 0.0.2.14__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,64 @@
1
+ Metadata-Version: 2.1
2
+ Name: cycls
3
+ Version: 0.0.2.14
4
+ Summary: Cycls SDK
5
+ Author: Mohammed Jamal
6
+ Author-email: mj@cycls.com
7
+ Requires-Python: >=3.8,<4.0
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.8
10
+ Classifier: Programming Language :: Python :: 3.9
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Requires-Dist: asyncssh (>=2.14.2,<3.0.0)
15
+ Requires-Dist: fastapi (>=0.111.0,<0.112.0)
16
+ Requires-Dist: httpx (>=0.27.0,<0.28.0)
17
+ Description-Content-Type: text/markdown
18
+
19
+ </br></br><p align="center"><img src="https://cycls.com/static/assets/favicon.svg" alt="Cycls"></p></br>
20
+
21
+ <div align="center">
22
+ <a href="https://pypi.org/project/cycls/" target="_blank" rel="noopener noreferrer">
23
+ <img loading="lazy" src="https://img.shields.io/pypi/v/cycls.svg" alt="PyPI" class="img_ev3q" style="display: inline;">
24
+ </a>
25
+ <a href="https://discord.gg/BMnaMatDC7" target="_blank" rel="noopener noreferrer">
26
+ <img loading="lazy" src="https://img.shields.io/discord/1175782747164389466" alt="Discord" class="img_ev3q" style="display: inline;">
27
+ </a>
28
+ </div>
29
+
30
+ </br>
31
+
32
+ ```sh
33
+ pip install cycls
34
+ ```
35
+
36
+ ```py
37
+ from cycls import Cycls, Text
38
+
39
+ cycls = Cycls()
40
+
41
+ # sync app on https://cycls.com/@spark
42
+ @cycls("spark")
43
+ def spark_app(x):
44
+ print("history", x.history)
45
+ print("session id", x.id)
46
+ return Text(x.content+" from spark")
47
+
48
+ # async app on https://cycls.com/@cake
49
+ @cycls("cake")
50
+ async def cake_app(x):
51
+ print("history", x.history)
52
+ print("session id", x.id)
53
+ return Text(x.content+" from cake")
54
+
55
+ # publish to https://cycls.com
56
+ cycls.push()
57
+ ```
58
+
59
+ - `Text` renders markdown
60
+ - `Text` is both streaming/bulk based on input
61
+
62
+
63
+ Try it live https://cycls.com/@groq
64
+
@@ -0,0 +1,45 @@
1
+ </br></br><p align="center"><img src="https://cycls.com/static/assets/favicon.svg" alt="Cycls"></p></br>
2
+
3
+ <div align="center">
4
+ <a href="https://pypi.org/project/cycls/" target="_blank" rel="noopener noreferrer">
5
+ <img loading="lazy" src="https://img.shields.io/pypi/v/cycls.svg" alt="PyPI" class="img_ev3q" style="display: inline;">
6
+ </a>
7
+ <a href="https://discord.gg/BMnaMatDC7" target="_blank" rel="noopener noreferrer">
8
+ <img loading="lazy" src="https://img.shields.io/discord/1175782747164389466" alt="Discord" class="img_ev3q" style="display: inline;">
9
+ </a>
10
+ </div>
11
+
12
+ </br>
13
+
14
+ ```sh
15
+ pip install cycls
16
+ ```
17
+
18
+ ```py
19
+ from cycls import Cycls, Text
20
+
21
+ cycls = Cycls()
22
+
23
+ # sync app on https://cycls.com/@spark
24
+ @cycls("spark")
25
+ def spark_app(x):
26
+ print("history", x.history)
27
+ print("session id", x.id)
28
+ return Text(x.content+" from spark")
29
+
30
+ # async app on https://cycls.com/@cake
31
+ @cycls("cake")
32
+ async def cake_app(x):
33
+ print("history", x.history)
34
+ print("session id", x.id)
35
+ return Text(x.content+" from cake")
36
+
37
+ # publish to https://cycls.com
38
+ cycls.push()
39
+ ```
40
+
41
+ - `Text` renders markdown
42
+ - `Text` is both streaming/bulk based on input
43
+
44
+
45
+ Try it live https://cycls.com/@groq
@@ -0,0 +1,116 @@
1
+ from fastapi import FastAPI, Request
2
+ from fastapi.responses import StreamingResponse
3
+ from pydantic import BaseModel
4
+ from typing import List, Dict, Optional
5
+
6
+ from functools import wraps
7
+ import uvicorn, socket, httpx
8
+ import inspect
9
+
10
+ import logging
11
+ logging.basicConfig(level=logging.ERROR)
12
+
13
+ import os
14
+ current_dir = os.path.dirname(os.path.abspath(__file__))
15
+ key_path = os.path.join(current_dir, 'tuns')
16
+
17
+ class Message(BaseModel):
18
+ handle: str
19
+ content: str
20
+ id: str
21
+ history: Optional[List[Dict[str, str]]] = None
22
+
23
+ def find_available_port(start_port):
24
+ port = start_port
25
+ while True:
26
+ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
27
+ if s.connect_ex(('localhost', port)) != 0:
28
+ return port
29
+ port += 1
30
+
31
+ import asyncssh, asyncio
32
+
33
+ async def create_ssh_tunnel(x,y,z='tuns.sh'):
34
+ try:
35
+ async with asyncssh.connect(z,client_keys=[key_path],known_hosts=None) as conn:
36
+ listener = await conn.forward_remote_port(x, 80, 'localhost', y)
37
+ print("✦/✧","tunnel\n")
38
+ await listener.wait_closed()
39
+ except (OSError, asyncssh.Error) as e:
40
+ print("✦/✧",f"tunnel disconnected: {e}")
41
+
42
+ def register(handles, network, url, mode):
43
+ try:
44
+ with httpx.Client() as client:
45
+ response = client.post(f"{network}/register", json={"handles":handles, "url":url, "mode":mode})
46
+ if response.status_code==200:
47
+ data = (response.json()).get("content")
48
+ for i in data:print(f"✦/✧ {i[0]} / {network}/{i[1]}")
49
+ else:
50
+ print("✦/✧ failed to register ⚠️")
51
+ except Exception as e:
52
+ print(f"An error occurred: {e}")
53
+
54
+ async def run_server(x,y):
55
+ config = uvicorn.Config(x, host="127.0.0.1", port=y, log_level="error")
56
+ server = uvicorn.Server(config)
57
+ await server.serve()
58
+
59
+ class Cycls:
60
+ def __init__(self, url="", network="https://cycls.com", port=find_available_port(8001)):
61
+ import uuid
62
+ self.subdomain = str(uuid.uuid4())[:8]
63
+ self.server = FastAPI()
64
+ self.network = network
65
+ self.port = port
66
+ self.url = url
67
+ self.apps = {}
68
+
69
+ def __call__(self, handle):
70
+ def decorator(func):
71
+ @wraps(func)
72
+ async def async_wrapper(*args, **kwargs):
73
+ return await func(*args, **kwargs)
74
+ @wraps(func)
75
+ def sync_wrapper(*args, **kwargs):
76
+ return func(*args, **kwargs)
77
+ wrapper = async_wrapper if inspect.iscoroutinefunction(func) else sync_wrapper
78
+ self.apps["@"+handle] = wrapper
79
+ return wrapper
80
+ return decorator
81
+
82
+ async def gateway(self, request: Request):
83
+ data = await request.json()
84
+ handle = data.get('handle')
85
+ if handle in self.apps:
86
+ func = self.apps[handle]
87
+ message = Message(**data)
88
+ return await func(message) if inspect.iscoroutinefunction(func) else func(message)
89
+ return {"error": "Handle not found"}
90
+
91
+ def push(self):
92
+ self.server.post("/gateway")(self.gateway)
93
+ asyncio.run(self.publish())
94
+
95
+ async def publish(self):
96
+ prod=False
97
+ if self.url != "":
98
+ prod=True
99
+
100
+ print(f"✦/✧ serving at port: {self.port}")
101
+ if prod:
102
+ print("✦/✧",f"production mode | url: {self.url}")
103
+ register(list(self.apps.keys()), self.network, self.url+"/gateway", "prod")
104
+ else:
105
+ self.url = f"http://{self.subdomain}-cycls.tuns.sh"
106
+ print("✦/✧","development mode")
107
+ # print("✦/✧",f"url {self.url}")
108
+ register(list(self.apps.keys()), self.network, self.url+"/gateway", "dev")
109
+
110
+ t1 = asyncio.create_task(create_ssh_tunnel(f"{self.subdomain}-cycls", self.port))
111
+ t2 = asyncio.create_task(run_server(self.server,self.port))
112
+ await asyncio.gather(t1, t2) if not prod else asyncio.gather(t2)
113
+
114
+ Text = StreamingResponse
115
+
116
+ # poetry publish --build
@@ -0,0 +1,27 @@
1
+ -----BEGIN OPENSSH PRIVATE KEY-----
2
+ b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABFwAAAAdzc2gtcn
3
+ NhAAAAAwEAAQAAAQEAxq9z8nrMUnCRBSDhOcUeAZ//dolIg7RQoXM+Yo6aPACuqRMjo70b
4
+ wzXotyIqFRHe5eLntoa5FLj4n/3/uKVjy+f0xwPxquzTRESJehmUNN7WXaXQt2TX7BmMeo
5
+ vxWiQ69qzcQMQx7FNJNKSsA4Ynw9fIg/NDvEAtnYotmcF37finCJzj3OOxAaAB53bAzfY2
6
+ GD0JL+W8bzuMXpyZaqD+33selRNLqWVbcgNrJW6IDtZXvT1gBRsVsycbNrBrwFuhafnLW1
7
+ KAP/ZLLRP4w+BUgJVJVu9PqTfTrAcnDwspduNJqAtYPMbvuoToip1kYwws3wl8hHpsal67
8
+ U5xZeOn+5QAAA9i3Fmc8txZnPAAAAAdzc2gtcnNhAAABAQDGr3PyesxScJEFIOE5xR4Bn/
9
+ 92iUiDtFChcz5ijpo8AK6pEyOjvRvDNei3IioVEd7l4ue2hrkUuPif/f+4pWPL5/THA/Gq
10
+ 7NNERIl6GZQ03tZdpdC3ZNfsGYx6i/FaJDr2rNxAxDHsU0k0pKwDhifD18iD80O8QC2dii
11
+ 2ZwXft+KcInOPc47EBoAHndsDN9jYYPQkv5bxvO4xenJlqoP7fex6VE0upZVtyA2slbogO
12
+ 1le9PWAFGxWzJxs2sGvAW6Fp+ctbUoA/9kstE/jD4FSAlUlW70+pN9OsBycPCyl240moC1
13
+ g8xu+6hOiKnWRjDCzfCXyEemxqXrtTnFl46f7lAAAAAwEAAQAAAQBFcWl7JMRpRALL4hQW
14
+ VvkH5F4rlgwMTGeqJld1pxXtRufFHHVmc2BSuHLgH0bKGnbnrokCWNAzl/r+II7SgKwCxs
15
+ 3dCVncPe4RfEr4rBwK5p/SF3R9xPdbBAr/gg4XTXZ2ZTCOSoSQbwO1LKEakjcv0im5RLs1
16
+ /tBysasChIZgW9x4gGj7Kv4kz6Ojak/enlylwoz4q/dxaX9wV0op8YbnBubI3PS4gosYyz
17
+ fR9QAQbLrugo79xM9MpH1XjpQmk4UkuJX+OWqtZHq4Q2ZLuCoN4dv/mDcijAa/+lVtzerj
18
+ Ku6XtUREHRfdbKi88j+E7N4CfLW26UmV5xQhRjC8m+b5AAAAgQDoBpIUKoLEVVsWjc6n/e
19
+ TGip/qTlzcakODPELOzFK13GCAb/gj/sPxT6tUa382X9jcotgFSYBnO2TFA8gbBSXovWZv
20
+ zrXsNwfQBnvKih1Wngsq/bk7MYUvNPC0zomX0/dPi+riNb/5jLSEy5uICY4swMnsYb2Eyw
21
+ 5CO+eHC9yiWAAAAIEA6Rx6TvBlMvqt5YbmdOX6LdNi9KNbh4ZmimFJu95IuvYUDol0aDa+
22
+ qc85GPBXt/vU6+mD3A1somE2WI2P0sswdYn+g7pbBdItA3NcCuqBFl735bOU6CQ5mygY2P
23
+ B/AE43+jeQUFfjBM+lDJNB8adffyBOQBhgmGAqGCq/p6GtgvMAAACBANoxpAHC8Q4cm4No
24
+ vsCefODzNUqgsOtgrJXfp3aDVx2pL9Ua71EAh2e5eWvr8YdvmhgU7ophAeEezQqt0nrQYW
25
+ xheJQQd1hgm50DY9ssKNcFHd8BkLwGVRbgDfwhPLDektZZqRlbrVsqIBkDurVI764h2v8M
26
+ G/fyU3Xv57Ed1vzHAAAAHm1vaGFtbWVkYWxydWpheWlATW9oYW1tZWRzLUFpcgECAwQ=
27
+ -----END OPENSSH PRIVATE KEY-----
@@ -1,9 +1,6 @@
1
1
  [tool.poetry]
2
- #name = "cycls-dev"
3
- #version = "0.0.1.3"
4
-
5
2
  name = "cycls"
6
- version = "0.0.2.11"
3
+ version = "0.0.2.14"
7
4
 
8
5
  packages = [{ include = "cycls" }]
9
6
  description = "Cycls SDK"
@@ -14,6 +11,7 @@ readme = "README.md"
14
11
  python = "^3.8"
15
12
  fastapi = "^0.111.0"
16
13
  httpx = "^0.27.0"
14
+ asyncssh = "^2.14.2"
17
15
 
18
16
 
19
17
  [build-system]
cycls-0.0.2.11/PKG-INFO DELETED
@@ -1,132 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: cycls
3
- Version: 0.0.2.11
4
- Summary: Cycls SDK
5
- Author: Mohammed Jamal
6
- Author-email: mj@cycls.com
7
- Requires-Python: >=3.8,<4.0
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: Programming Language :: Python :: 3.8
10
- Classifier: Programming Language :: Python :: 3.9
11
- Classifier: Programming Language :: Python :: 3.10
12
- Classifier: Programming Language :: Python :: 3.11
13
- Classifier: Programming Language :: Python :: 3.12
14
- Requires-Dist: fastapi (>=0.111.0,<0.112.0)
15
- Requires-Dist: httpx (>=0.27.0,<0.28.0)
16
- Description-Content-Type: text/markdown
17
-
18
- </br></br><p align="center"><img src="https://cycls.com/static/assets/favicon.svg" alt="Cycls"></p></br>
19
-
20
- # cycls.py
21
-
22
- ```sh
23
- pip install cycls
24
- ```
25
-
26
- ## sync app
27
- ```py
28
- from cycls import Cycls, Message, Text
29
-
30
- push = Cycls()
31
-
32
- @push("cake")
33
- def app(m: Message):
34
- return Text(m.content)
35
- ```
36
- `https://cycls.com/@cake`
37
-
38
- ## async app
39
- ```py
40
- from cycls import Cycls, Message, Text
41
-
42
- push = Cycls()
43
-
44
- @push("her")
45
- async def app(m: Message):
46
- return Text(m.content)
47
- ```
48
- `https://cycls.com/@her`
49
-
50
- ## debug
51
- ```py
52
- push = Cycls(debug=True)
53
- ```
54
-
55
- ## groq app
56
- ```py
57
- from cycls import Cycls, Message, Text
58
- from groq import AsyncGroq
59
-
60
- push = Cycls()
61
-
62
- groq = AsyncGroq(api_key="YOUR_KEY")
63
-
64
- async def llm(content):
65
- stream = await groq.chat.completions.create(
66
- messages=[
67
- {"role": "system", "content": "you are a helpful assistant."},
68
- {"role": "user", "content": content}
69
- ],
70
- model="llama3-70b-8192",
71
- temperature=0.5, max_tokens=1024, top_p=1, stop=None,
72
- stream=True,
73
- )
74
-
75
- async def event_stream():
76
- async for chunk in stream:
77
- yield f"{chunk.choices[0].delta.content}"
78
-
79
- return event_stream()
80
-
81
- @push("groq-app")
82
- async def app(x:Message):
83
- stream = await llm(x.content)
84
- return Text(stream)
85
- ```
86
- `https://cycls.com/@groq-app`
87
-
88
- ## history
89
- ```py
90
- @push("cake")
91
- def app(m:Message):
92
- print(m.history)
93
- return Text(m.content)
94
- ```
95
- `https://cycls.com/@cake`
96
-
97
- ## groq app with history
98
- ```py
99
- from cycls import Cycls, Message, Text
100
- from groq import AsyncGroq
101
-
102
- push = Cycls()
103
-
104
- groq = AsyncGroq(api_key="YOUR_KEY")
105
-
106
- async def llm(messages):
107
- stream = await groq.chat.completions.create(
108
- messages=messages,
109
- model="llama3-70b-8192",
110
- temperature=0.5, max_tokens=1024, top_p=1, stop=None,
111
- stream=True,
112
- )
113
-
114
- async def event_stream():
115
- async for chunk in stream:
116
- yield f"{chunk.choices[0].delta.content}"
117
-
118
- return event_stream()
119
-
120
- @push("groq-app")
121
- async def app(m:Message):
122
- x = [{"role": "system", "content": "you are a helpful assistant."}]
123
- x += m.history
124
- x += [{"role": "user", "content": m.content}]
125
- stream = await llm(x)
126
- return Text(stream)
127
- ```
128
- `https://cycls.com/@groq-app`
129
-
130
- # Known issues
131
- - Dev mode doesn't work on Windows machines
132
-
cycls-0.0.2.11/README.md DELETED
@@ -1,114 +0,0 @@
1
- </br></br><p align="center"><img src="https://cycls.com/static/assets/favicon.svg" alt="Cycls"></p></br>
2
-
3
- # cycls.py
4
-
5
- ```sh
6
- pip install cycls
7
- ```
8
-
9
- ## sync app
10
- ```py
11
- from cycls import Cycls, Message, Text
12
-
13
- push = Cycls()
14
-
15
- @push("cake")
16
- def app(m: Message):
17
- return Text(m.content)
18
- ```
19
- `https://cycls.com/@cake`
20
-
21
- ## async app
22
- ```py
23
- from cycls import Cycls, Message, Text
24
-
25
- push = Cycls()
26
-
27
- @push("her")
28
- async def app(m: Message):
29
- return Text(m.content)
30
- ```
31
- `https://cycls.com/@her`
32
-
33
- ## debug
34
- ```py
35
- push = Cycls(debug=True)
36
- ```
37
-
38
- ## groq app
39
- ```py
40
- from cycls import Cycls, Message, Text
41
- from groq import AsyncGroq
42
-
43
- push = Cycls()
44
-
45
- groq = AsyncGroq(api_key="YOUR_KEY")
46
-
47
- async def llm(content):
48
- stream = await groq.chat.completions.create(
49
- messages=[
50
- {"role": "system", "content": "you are a helpful assistant."},
51
- {"role": "user", "content": content}
52
- ],
53
- model="llama3-70b-8192",
54
- temperature=0.5, max_tokens=1024, top_p=1, stop=None,
55
- stream=True,
56
- )
57
-
58
- async def event_stream():
59
- async for chunk in stream:
60
- yield f"{chunk.choices[0].delta.content}"
61
-
62
- return event_stream()
63
-
64
- @push("groq-app")
65
- async def app(x:Message):
66
- stream = await llm(x.content)
67
- return Text(stream)
68
- ```
69
- `https://cycls.com/@groq-app`
70
-
71
- ## history
72
- ```py
73
- @push("cake")
74
- def app(m:Message):
75
- print(m.history)
76
- return Text(m.content)
77
- ```
78
- `https://cycls.com/@cake`
79
-
80
- ## groq app with history
81
- ```py
82
- from cycls import Cycls, Message, Text
83
- from groq import AsyncGroq
84
-
85
- push = Cycls()
86
-
87
- groq = AsyncGroq(api_key="YOUR_KEY")
88
-
89
- async def llm(messages):
90
- stream = await groq.chat.completions.create(
91
- messages=messages,
92
- model="llama3-70b-8192",
93
- temperature=0.5, max_tokens=1024, top_p=1, stop=None,
94
- stream=True,
95
- )
96
-
97
- async def event_stream():
98
- async for chunk in stream:
99
- yield f"{chunk.choices[0].delta.content}"
100
-
101
- return event_stream()
102
-
103
- @push("groq-app")
104
- async def app(m:Message):
105
- x = [{"role": "system", "content": "you are a helpful assistant."}]
106
- x += m.history
107
- x += [{"role": "user", "content": m.content}]
108
- stream = await llm(x)
109
- return Text(stream)
110
- ```
111
- `https://cycls.com/@groq-app`
112
-
113
- # Known issues
114
- - Dev mode doesn't work on Windows machines
@@ -1,114 +0,0 @@
1
- from fastapi import FastAPI, Request
2
- from fastapi.responses import StreamingResponse, PlainTextResponse
3
- from pydantic import BaseModel
4
-
5
- from functools import wraps
6
- import uvicorn, socket, httpx
7
- import inspect
8
-
9
- from concurrent.futures import ThreadPoolExecutor
10
- import time, subprocess
11
-
12
- import os
13
- current_dir = os.path.dirname(os.path.abspath(__file__))
14
- key_path = os.path.join(current_dir, 'key.pub')
15
- # print(key_path)
16
-
17
- from typing import List, Dict
18
- class Message(BaseModel):
19
- handle: str
20
- content: str
21
- history: List[Dict[str, str]] = []
22
-
23
- def find_available_port(start_port):
24
- port = start_port
25
- while True:
26
- with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
27
- if s.connect_ex(('localhost', port)) != 0:
28
- return port
29
- port += 1
30
-
31
- class Cycls:
32
- def __init__(self,network="https://cycls.com", port=find_available_port(8001),url="",debug=False):
33
- self.handle = None
34
- self.server = FastAPI()
35
- self.network = network
36
- self.port = port
37
- self.url = url
38
- self.debug = debug
39
-
40
- def __call__(self, handle):
41
- self.handle = handle
42
- def decorator(func):
43
- if inspect.iscoroutinefunction(func):
44
- @wraps(func)
45
- async def async_wrapper(*args, **kwargs):
46
- return await func(*args, **kwargs)
47
- self.server.post('/main')(async_wrapper)
48
- self.publish()
49
- return async_wrapper
50
- else:
51
- @wraps(func)
52
- def sync_wrapper(*args, **kwargs):
53
- return func(*args, **kwargs)
54
- self.server.post('/main')(sync_wrapper)
55
- self.publish()
56
- return sync_wrapper
57
- return decorator
58
-
59
- def publish(self):
60
- prod=False
61
- if self.url != "":
62
- prod=True
63
-
64
- if self.debug: print("✦/✧ debug = True")
65
- if prod:
66
- print("✦/✧","production mode",f"(url: {self.url}, port: {self.port})")
67
- else:
68
- print("✦/✧","development mode",f"(port: {self.port})")
69
- # self.url = f"https://{self.handle}-cycls.tuns.sh"
70
- self.url = f"https://{self.handle}-cycls.serveo.net"
71
-
72
- print("")
73
- print("✦/✧",f"https://cycls.com/@{self.handle}")
74
- print("")
75
-
76
- with ThreadPoolExecutor() as executor:
77
- if not prod:
78
- self.register('dev')
79
- executor.submit(self.tunnel)
80
- else:
81
- self.register('prod')
82
-
83
- if self.debug:
84
- executor.submit(uvicorn.run(self.server, host="127.0.0.1", port=self.port)) # perhaps keep traces?
85
- else:
86
- executor.submit(uvicorn.run(self.server, host="127.0.0.1", port=self.port, log_level="critical")) # perhaps keep traces?
87
-
88
- def register(self, mode):
89
- try:
90
- with httpx.Client() as client:
91
- response = client.post(f"{self.network}/register", json={"handle": f"@{self.handle}", "url": self.url, "mode": mode})
92
- if response.status_code==200:
93
- print(f"✦/✧ published 🎉")
94
- print("")
95
- else:
96
- print("✦/✧ failed to register ⚠️") # exit app
97
- except Exception as e:
98
- print(f"An error occurred: {e}")
99
-
100
- def tunnel(self):
101
- # ssh_command = ['ssh', '-q', '-i', 'tuns', '-o', 'StrictHostKeyChecking=no', '-R', f'{self.handle}-cycls:80:localhost:{self.port}', 'tuns.sh']
102
- # ssh_command = ['ssh', '-q', '-i', 'key.pub', '-o', 'StrictHostKeyChecking=no', '-R', f'{self.handle}-cycls:80:localhost:{self.port}', 'serveo.net']
103
- ssh_command = ['ssh', '-q', '-i', key_path, '-o', 'StrictHostKeyChecking=no', '-R', f'{self.handle}-cycls:80:localhost:{self.port}', 'serveo.net']
104
- try:
105
- if self.debug:
106
- process = subprocess.run(ssh_command,stdin=subprocess.DEVNULL) # very tricky! STDIN is what was messing with me
107
- else:
108
- process = subprocess.run(ssh_command, stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
109
- except Exception as e:
110
- print(f"An error occurred: {e}") # exit app
111
-
112
- Text = StreamingResponse
113
-
114
- # poetry publish --build
@@ -1 +0,0 @@
1
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC022DIsZ11836rKBvsXcd1H7AMbirWyFSZczn3KkwaheLE90DigO/WkYhPMP5XJ9L5MIGM9nemiQhciZdN9f7z9o0xJh72ZI2+tl5Fa77a9r+IsuWbhn8fNGIkzvyYx8zwSTZV/f2nMYr4I7sjTVFVlH2Een6R8RCZpJPe9Q4ph+k2BCp4DeKzCuOrH6t//flm4vZnP8EXXXpSxic0TpbSL+Is7jeRsZdA4/7LrASCxzxnz4e0RCyy61B/TCkOHbSk06SPjoykA9amMMQ3T0OaO72bimiiCbRqEudgX0gNSVTxcRpmPARNJJDk72gAuOwAD3cpvIiW1nPu6Zhgb2VozQhsN+Rmh3ZjlYRvBVsHbwAkGb0iTBrtLA9ghiPLD2oXWdRI6P5XnNvSRyRXcrt59e1w9Z6XmKOmRl94NYciaMqH1qEEVnNCWUZyYKpMWRseL7v95FSNEoIL47+I4OPTF657sxZHlE85Oxei858kS6/b8GUT4yJgCq/PnhjN7UtGYCVRSv6UHGgXGvLMZAtHmbs3RlhEeLsluPvzgsDhmO6XzdKgh/MZIHKMIP/BEU11FT2lh/kB4EP48dqQPJMFNefB1ybEC509RCSdzaDATYIGRi7+FV4B1O15nC3EQTudFJl7io3chsLbkayAbGRInYVUJ0WDA5Et7ekIKRPdfw== m@m
File without changes