Skip to content

Commit c5b3947

Browse files
committed
Merge branch '3007.x'
2 parents 1554e84 + f8ba8c2 commit c5b3947

File tree

135 files changed

+2376
-1848
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+2376
-1848
lines changed

.github/actions/build-onedir-salt/action.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,13 @@ runs:
2929

3030
steps:
3131

32-
- name: Download Cached Deps Onedir Package Directory
33-
id: onedir-bare-cache
34-
uses: ./.github/actions/cache
32+
- name: Install Salt Packaging Dependencies into Relenv Onedir
33+
uses: ./.github/actions/build-onedir-deps
3534
with:
36-
path: artifacts/${{ inputs.package-name }}
37-
key: >
38-
${{ inputs.cache-prefix }}|${{ inputs.python-version }}|deps|${{ inputs.platform }}|${{ inputs.arch }}|${{ inputs.package-name }}|${{
39-
hashFiles(
40-
format('{0}/.relenv/**/*.xz', github.workspace),
41-
'requirements/static/pkg/*/*.txt',
42-
'.github/actions/build-onedir-deps/action.yml',
43-
'.github/workflows/build-deps-onedir-*.yml',
44-
'cicd/shared-gh-workflows-context.yml'
45-
)
46-
}}
35+
platform: ${{ inputs.platform }}
36+
arch: ${{ inputs.arch }}
37+
python-version: "${{ inputs.python-version }}"
38+
cache-prefix: ${{ inputs.cache-seed }}|relenv|${{ inputs.salt-version }}
4739

4840
- name: Download Source Tarball
4941
uses: actions/download-artifact@v4

.github/actions/ssh-tunnel/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,9 @@ OkZFOjhCOjI3OjFDOjFBOkJEOjUxOjQ2OjE4OjBBOjhFOjVBOjI1OjQzOjQzOjZGOkRBXHJcbmE9c2V0
9292
dXA6YWN0aXZlXHJcbiIsICJ0eXBlIjogImFuc3dlciJ9
9393
-- Message received --
9494
```
95+
96+
SSH to your local port.
97+
98+
```
99+
ssh -o StrictHostKeychecking=no -o TCPKeepAlive=no -o StrictHostKeyChecking=no -vv -p 5222 runner@localhost
100+
```

.github/actions/ssh-tunnel/rtcforward.py

Lines changed: 54 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import json
77
import logging
88
import os
9+
import signal
910
import sys
1011
import textwrap
1112
import time
@@ -77,6 +78,42 @@ def print_pastable(data, message="offer"):
7778
sys.stdout.flush()
7879

7980

81+
async def read_from_stdin():
82+
loop = asyncio.get_event_loop()
83+
line = await loop.run_in_executor(
84+
None, input, "-- Please enter a message from remote party --\n"
85+
)
86+
data = line
87+
while line:
88+
try:
89+
line = await loop.run_in_executor(None, input)
90+
except EOFError:
91+
break
92+
data += line
93+
print("-- Message received --")
94+
return data
95+
96+
97+
class Channels:
98+
def __init__(self, channels=None):
99+
if channels is None:
100+
channels = []
101+
self.channels = channels
102+
103+
def add(self, channel):
104+
self.channels.append(channel)
105+
106+
def close(self):
107+
for channel in self.channels:
108+
channel.close()
109+
110+
111+
class ProxyConnection:
112+
def __init__(self, pc, channel):
113+
self.pc = pc
114+
self.channel = channel
115+
116+
80117
class ProxyClient:
81118

82119
def __init__(self, args, channel):
@@ -219,29 +256,7 @@ def on_message(message):
219256
log.exception("WTF")
220257

221258

222-
class ProxyConnection:
223-
def __init__(self, pc, channel):
224-
self.pc = pc
225-
self.channel = channel
226-
227-
228-
async def read_from_stdin():
229-
loop = asyncio.get_event_loop()
230-
line = await loop.run_in_executor(
231-
None, input, "-- Please enter a message from remote party --\n"
232-
)
233-
data = line
234-
while line:
235-
try:
236-
line = await loop.run_in_executor(None, input)
237-
except EOFError:
238-
break
239-
data += line
240-
print("-- Message received --")
241-
return data
242-
243-
244-
async def run_answer(pc, args):
259+
async def run_answer(stop, pc, args):
245260
"""
246261
Top level offer answer server.
247262
"""
@@ -270,11 +285,11 @@ def on_datachannel(channel):
270285
elif obj is BYE:
271286
print("Exiting")
272287

273-
while True:
288+
while not stop.is_set():
274289
await asyncio.sleep(0.3)
275290

276291

277-
async def run_offer(pc, args):
292+
async def run_offer(stop, pc, args):
278293
"""
279294
Top level offer server this will estabilsh a data channel and start a tcp
280295
server on the port provided. New connections to the server will start the
@@ -324,10 +339,14 @@ def on_open():
324339
elif obj is BYE:
325340
print("Exiting")
326341

327-
while True:
342+
while not stop.is_set():
328343
await asyncio.sleep(0.3)
329344

330345

346+
async def signal_handler(stop, pc):
347+
stop.set()
348+
349+
331350
if __name__ == "__main__":
332351
if sys.platform == "win32":
333352
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
@@ -343,16 +362,22 @@ def on_open():
343362
logging.basicConfig(level=logging.DEBUG)
344363
else:
345364
logging.basicConfig(level=logging.INFO)
346-
365+
stop = asyncio.Event()
347366
pc = RTCPeerConnection()
348367
if args.role == "offer":
349-
coro = run_offer(pc, args)
368+
coro = run_offer(stop, pc, args)
350369
else:
351-
coro = run_answer(pc, args)
370+
coro = run_answer(stop, pc, args)
352371

353372
# run event loop
354373
loop = asyncio.new_event_loop()
355374
asyncio.set_event_loop(loop)
375+
for signame in ("SIGINT", "SIGTERM"):
376+
loop.add_signal_handler(
377+
getattr(signal, signame),
378+
lambda: asyncio.create_task(signal_handler(stop, pc)),
379+
)
380+
356381
try:
357382
loop.run_until_complete(coro)
358383
except KeyboardInterrupt:

.github/workflows/build-deps-onedir.yml

Lines changed: 0 additions & 192 deletions
This file was deleted.

0 commit comments

Comments
 (0)