mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-02 01:18:08 +01:00
Modify GH actions to support mirror
This commit is contained in:
parent
7d50a224c6
commit
ba89224641
2 changed files with 28 additions and 27 deletions
|
|
@ -1,13 +1,22 @@
|
|||
#!/usr/bin/env python3
|
||||
"""
|
||||
This creates a simple "mirror" from a directory
|
||||
"""
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# SPDX-FileCopyrightText: 2025 fosslinux <fosslinux@aussies.space>
|
||||
|
||||
import http.server
|
||||
import socketserver
|
||||
|
||||
class SimpleMirror(socketserver.TCPServer):
|
||||
"""Simple HTTP mirror from a directory"""
|
||||
def __init__(self, directory: str):
|
||||
self.directory = directory
|
||||
super().__init__(("localhost", 0), self._handler)
|
||||
|
||||
@property
|
||||
def port(self):
|
||||
"""Port the HTTP server of the mirror is running on"""
|
||||
return self.server_address[1]
|
||||
|
||||
def _handler(self, *args, **kwargs):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue