Skip to content

Commit

Permalink
Quick fix http server resiliency issues
Browse files Browse the repository at this point in the history
  • Loading branch information
AttilaGombosER committed Jul 6, 2024
1 parent 7f22325 commit b824f9f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# apt-server

APT server with dynamic package pool handling. Dynamic behavior is achieved by listening file changes in package pool
directory and
on any .deb file change, the repository is updated and re-signed.
directory and on any .deb file change, the repository is updated and re-signed.

## Table of contents

- [Features](#features)
- [Requirements](#requirements)
- [Installation](#installation)
- [From source](#from-source)
- [From GitHub release](#from-github-release)
Expand All @@ -22,9 +22,9 @@ on any .deb file change, the repository is updated and re-signed.

## Features

- Dynamic package pool handling
- Multiple architectures
- GPG signed repository
- [x] Dynamic package pool handling
- [x] Multiple architectures
- [x] GPG signed repository

## Requirements

Expand Down Expand Up @@ -116,7 +116,7 @@ Output:
The repository can be accessed by adding it to a sources list file, eg:

```commandline
echo "deb [arch=armhf] http://127.0.0.1:9000 stable main" | tee /etc/apt/sources.list.d/effective-range.list
echo "deb http://127.0.0.1:9000 stable main" | tee /etc/apt/sources.list.d/effective-range.list
```
2. Add the public key to the keychain
Expand Down
Empty file removed apt_server/py.typed
Empty file.
4 changes: 2 additions & 2 deletions bin/apt-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import os
import signal
from functools import partial
from http.server import SimpleHTTPRequestHandler, HTTPServer
from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer
from pathlib import Path
from typing import Any

Expand Down Expand Up @@ -48,7 +48,7 @@ def main() -> None:
APPLICATION_NAME, architectures, repository_dir, deb_package_dir, release_template_path)

handler_class = partial(SimpleHTTPRequestHandler, directory=repository_dir)
web_server = HTTPServer(('', arguments.port), handler_class)
web_server = ThreadingHTTPServer(('', arguments.port), handler_class)

apt_server = AptServer(apt_repository, apt_signer, Observer(), web_server, deb_package_dir)

Expand Down
4 changes: 2 additions & 2 deletions tests/aptServerIntegrationTest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import unittest
from functools import partial
from http.server import HTTPServer, SimpleHTTPRequestHandler
from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer, HTTPServer
from importlib.metadata import version
from threading import Thread
from unittest import TestCase
Expand Down Expand Up @@ -114,7 +114,7 @@ def create_components():
apt_repository = LinkedPoolAptRepository(APPLICATION_NAME, [ARCHITECTURE], REPOSITORY_DIR,
PACKAGE_DIR, TEMPLATE_PATH)
handler_class = partial(SimpleHTTPRequestHandler, directory=REPOSITORY_DIR)
web_server = HTTPServer(('', 0), handler_class)
web_server = ThreadingHTTPServer(('', 0), handler_class)

return apt_repository, apt_signer, web_server

Expand Down

0 comments on commit b824f9f

Please sign in to comment.