mirror-dedupe 0.1.0__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.
- mirror_dedupe-0.1.0/.github/workflows/build-deb.yml +44 -0
- mirror_dedupe-0.1.0/.github/workflows/publish-pypi.yml +42 -0
- mirror_dedupe-0.1.0/.gitignore +52 -0
- mirror_dedupe-0.1.0/MANIFEST.in +7 -0
- mirror_dedupe-0.1.0/PKG-INFO +137 -0
- mirror_dedupe-0.1.0/PUBLISHING.md +77 -0
- mirror_dedupe-0.1.0/README.md +105 -0
- mirror_dedupe-0.1.0/config/mirror-dedupe.conf +25 -0
- mirror_dedupe-0.1.0/config/repos.d/README.md +61 -0
- mirror_dedupe-0.1.0/config/repos.d/ubuntu-ports.conf.example +23 -0
- mirror_dedupe-0.1.0/config/repos.d/ubuntu.conf.example +19 -0
- mirror_dedupe-0.1.0/debian/changelog +9 -0
- mirror_dedupe-0.1.0/debian/control +28 -0
- mirror_dedupe-0.1.0/debian/copyright +27 -0
- mirror_dedupe-0.1.0/debian/install +5 -0
- mirror_dedupe-0.1.0/debian/mirror-dedupe.1 +171 -0
- mirror_dedupe-0.1.0/debian/rules +4 -0
- mirror_dedupe-0.1.0/install.sh +77 -0
- mirror_dedupe-0.1.0/mirror_dedupe/__init__.py +13 -0
- mirror_dedupe-0.1.0/mirror_dedupe/cli.py +140 -0
- mirror_dedupe-0.1.0/mirror_dedupe/config.py +55 -0
- mirror_dedupe-0.1.0/mirror_dedupe/dedupe.py +107 -0
- mirror_dedupe-0.1.0/mirror_dedupe/download.py +86 -0
- mirror_dedupe-0.1.0/mirror_dedupe/indices.py +189 -0
- mirror_dedupe-0.1.0/mirror_dedupe/orchestrate.py +534 -0
- mirror_dedupe-0.1.0/mirror_dedupe/sync.py +204 -0
- mirror_dedupe-0.1.0/mirror_dedupe/utils.py +132 -0
- mirror_dedupe-0.1.0/mirror_dedupe.egg-info/PKG-INFO +137 -0
- mirror_dedupe-0.1.0/mirror_dedupe.egg-info/SOURCES.txt +41 -0
- mirror_dedupe-0.1.0/mirror_dedupe.egg-info/dependency_links.txt +1 -0
- mirror_dedupe-0.1.0/mirror_dedupe.egg-info/entry_points.txt +2 -0
- mirror_dedupe-0.1.0/mirror_dedupe.egg-info/requires.txt +1 -0
- mirror_dedupe-0.1.0/mirror_dedupe.egg-info/top_level.txt +1 -0
- mirror_dedupe-0.1.0/nginx/assets/mirror-footer.html +15 -0
- mirror_dedupe-0.1.0/nginx/assets/mirror-header.html +17 -0
- mirror_dedupe-0.1.0/nginx/assets/mirror-style.css +66 -0
- mirror_dedupe-0.1.0/nginx/mirror.conf +52 -0
- mirror_dedupe-0.1.0/pyproject.toml +46 -0
- mirror_dedupe-0.1.0/setup.cfg +4 -0
- mirror_dedupe-0.1.0/setup.py +60 -0
- mirror_dedupe-0.1.0/systemd/mirror-dedupe.service +14 -0
- mirror_dedupe-0.1.0/systemd/mirror-dedupe.timer +17 -0
- mirror_dedupe-0.1.0/tests/test_basic.py +224 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#
|
|
2
|
+
# build-deb.yml : Ubuntu mirror synchronisation with global deduplication
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2025 Tim Hosking
|
|
5
|
+
# Email: tim@mungerware.com
|
|
6
|
+
# Website: https://github.com/munger
|
|
7
|
+
# Licence: MIT
|
|
8
|
+
#
|
|
9
|
+
|
|
10
|
+
name: Build Debian Package
|
|
11
|
+
|
|
12
|
+
on:
|
|
13
|
+
release:
|
|
14
|
+
types: [published]
|
|
15
|
+
workflow_dispatch:
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
build-deb:
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
|
|
24
|
+
- name: Install build dependencies
|
|
25
|
+
run: |
|
|
26
|
+
sudo apt-get update
|
|
27
|
+
sudo apt-get install -y debhelper dh-python python3-all python3-setuptools python3-yaml
|
|
28
|
+
|
|
29
|
+
- name: Build Debian package
|
|
30
|
+
run: dpkg-buildpackage -us -uc -b
|
|
31
|
+
|
|
32
|
+
- name: Upload artifact
|
|
33
|
+
uses: actions/upload-artifact@v3
|
|
34
|
+
with:
|
|
35
|
+
name: debian-package
|
|
36
|
+
path: ../mirror-dedupe_*.deb
|
|
37
|
+
|
|
38
|
+
- name: Upload to release
|
|
39
|
+
if: github.event_name == 'release'
|
|
40
|
+
uses: softprops/action-gh-release@v1
|
|
41
|
+
with:
|
|
42
|
+
files: ../mirror-dedupe_*.deb
|
|
43
|
+
env:
|
|
44
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#
|
|
2
|
+
# publish-pypi.yml : Ubuntu mirror synchronisation with global deduplication
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2025 Tim Hosking
|
|
5
|
+
# Email: tim@mungerware.com
|
|
6
|
+
# Website: https://github.com/munger
|
|
7
|
+
# Licence: MIT
|
|
8
|
+
#
|
|
9
|
+
|
|
10
|
+
name: Publish to PyPI
|
|
11
|
+
|
|
12
|
+
on:
|
|
13
|
+
release:
|
|
14
|
+
types: [published]
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
build-and-publish:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
with:
|
|
23
|
+
fetch-depth: 0
|
|
24
|
+
|
|
25
|
+
- name: Set up Python
|
|
26
|
+
uses: actions/setup-python@v4
|
|
27
|
+
with:
|
|
28
|
+
python-version: '3.11'
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: |
|
|
32
|
+
python -m pip install --upgrade pip
|
|
33
|
+
pip install build twine
|
|
34
|
+
|
|
35
|
+
- name: Build package
|
|
36
|
+
run: python -m build
|
|
37
|
+
|
|
38
|
+
- name: Publish to PyPI
|
|
39
|
+
env:
|
|
40
|
+
TWINE_USERNAME: __token__
|
|
41
|
+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
|
42
|
+
run: twine upload dist/*
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
.installed.cfg
|
|
21
|
+
*.egg
|
|
22
|
+
|
|
23
|
+
# Virtual environments
|
|
24
|
+
venv/
|
|
25
|
+
ENV/
|
|
26
|
+
env/
|
|
27
|
+
|
|
28
|
+
# IDE
|
|
29
|
+
.vscode/
|
|
30
|
+
.idea/
|
|
31
|
+
*.swp
|
|
32
|
+
*.swo
|
|
33
|
+
*~
|
|
34
|
+
|
|
35
|
+
# Testing
|
|
36
|
+
.pytest_cache/
|
|
37
|
+
.coverage
|
|
38
|
+
htmlcov/
|
|
39
|
+
tests/test-config/
|
|
40
|
+
|
|
41
|
+
# Debian packaging
|
|
42
|
+
debian/files
|
|
43
|
+
debian/*.debhelper
|
|
44
|
+
debian/*.log
|
|
45
|
+
debian/*.substvars
|
|
46
|
+
debian/mirror-dedupe/
|
|
47
|
+
debian/.debhelper/
|
|
48
|
+
|
|
49
|
+
# Build artifacts
|
|
50
|
+
*.deb
|
|
51
|
+
*.buildinfo
|
|
52
|
+
*.changes
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mirror-dedupe
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Ubuntu mirror synchronisation with global deduplication
|
|
5
|
+
Home-page: https://github.com/munger/mirror-dedupe
|
|
6
|
+
Author: Tim Hosking
|
|
7
|
+
Author-email: Tim Hosking <tim@mungerware.com>
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Homepage, https://github.com/munger/mirror-dedupe
|
|
10
|
+
Project-URL: Bug Tracker, https://github.com/munger/mirror-dedupe/issues
|
|
11
|
+
Project-URL: Source Code, https://github.com/munger/mirror-dedupe
|
|
12
|
+
Keywords: mirror,deduplication,hardlink,ubuntu,repository,apt
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: System Administrators
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Topic :: System :: Archiving :: Mirroring
|
|
25
|
+
Classifier: Topic :: System :: Systems Administration
|
|
26
|
+
Requires-Python: >=3.8
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
Requires-Dist: PyYAML>=6.0
|
|
29
|
+
Dynamic: author
|
|
30
|
+
Dynamic: home-page
|
|
31
|
+
Dynamic: requires-python
|
|
32
|
+
|
|
33
|
+
<!--
|
|
34
|
+
README.md : Ubuntu mirror synchronisation with global deduplication
|
|
35
|
+
|
|
36
|
+
Copyright (c) 2025 Tim Hosking
|
|
37
|
+
Email: tim@mungerware.com
|
|
38
|
+
Website: https://github.com/munger
|
|
39
|
+
Licence: MIT
|
|
40
|
+
-->
|
|
41
|
+
|
|
42
|
+
Ubuntu/Debian mirror synchronisation with intelligent deduplication using hardlinks.
|
|
43
|
+
|
|
44
|
+
## Features
|
|
45
|
+
|
|
46
|
+
- Downloads from upstream and hardlinks duplicate files (same SHA256 hash) to save bandwidth and disk space
|
|
47
|
+
- Supports multiple mirrors with global deduplication across all mirrors
|
|
48
|
+
- Uses curl for duplicate files, rsync for unique files and metadata
|
|
49
|
+
- Configurable via YAML files
|
|
50
|
+
- Systemd timer support for automated synchronisation
|
|
51
|
+
|
|
52
|
+
## Installation
|
|
53
|
+
|
|
54
|
+
### Option 1: Debian/Ubuntu Package (Recommended)
|
|
55
|
+
|
|
56
|
+
Download the latest `.deb` package from [GitHub Releases](https://github.com/munger/mirror-dedupe/releases):
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
wget https://github.com/munger/mirror-dedupe/releases/download/v0.1.0/mirror-dedupe_0.1.0-1_all.deb
|
|
60
|
+
sudo dpkg -i mirror-dedupe_0.1.0-1_all.deb
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
This includes systemd integration, man pages, and proper package management.
|
|
64
|
+
|
|
65
|
+
### Option 2: PyPI (All Linux Distributions)
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
pip install mirror-dedupe
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Then install systemd files manually:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
sudo ./install.sh --pip
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Option 3: From Source
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
git clone https://github.com/munger/mirror-dedupe.git
|
|
81
|
+
cd mirror-dedupe
|
|
82
|
+
sudo ./install.sh
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Configuration
|
|
86
|
+
|
|
87
|
+
Configuration files are located in `/etc/mirror-dedupe/`:
|
|
88
|
+
|
|
89
|
+
- `mirror-dedupe.conf` - Global settings
|
|
90
|
+
- `repos.d/*.conf` - Individual repository definitions
|
|
91
|
+
|
|
92
|
+
See the `config/` directory for examples.
|
|
93
|
+
|
|
94
|
+
## Usage
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# Sync all mirrors
|
|
98
|
+
mirror-dedupe
|
|
99
|
+
|
|
100
|
+
# Sync specific mirror
|
|
101
|
+
mirror-dedupe --mirror ubuntu
|
|
102
|
+
|
|
103
|
+
# Dry run
|
|
104
|
+
mirror-dedupe --dry-run
|
|
105
|
+
|
|
106
|
+
# Dedupe only (no sync)
|
|
107
|
+
mirror-dedupe --dedupe-only
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Systemd Integration
|
|
111
|
+
|
|
112
|
+
If installed via Debian package, systemd is already configured. Otherwise:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
sudo systemctl enable --now mirror-dedupe.timer
|
|
116
|
+
sudo systemctl status mirror-dedupe.timer
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
View logs:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
journalctl -u mirror-dedupe.service
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Nginx Configuration
|
|
126
|
+
|
|
127
|
+
See `nginx/mirror.conf` for an example nginx configuration.
|
|
128
|
+
|
|
129
|
+
## License
|
|
130
|
+
|
|
131
|
+
MIT License - see LICENSE file for details.
|
|
132
|
+
|
|
133
|
+
## Author
|
|
134
|
+
|
|
135
|
+
Tim Hosking <tim@mungerware.com>
|
|
136
|
+
|
|
137
|
+
https://github.com/munger/mirror-dedupe
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
PUBLISHING.md : Ubuntu mirror synchronisation with global deduplication
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2025 Tim Hosking
|
|
5
|
+
Email: tim@mungerware.com
|
|
6
|
+
Website: https://github.com/munger
|
|
7
|
+
Licence: MIT
|
|
8
|
+
-->
|
|
9
|
+
|
|
10
|
+
1. Create account on https://pypi.org
|
|
11
|
+
2. Generate API token at https://pypi.org/manage/account/token/
|
|
12
|
+
3. Add token to GitHub secrets as `PYPI_API_TOKEN`
|
|
13
|
+
|
|
14
|
+
### Manual Publishing
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# Install build tools
|
|
18
|
+
pip install build twine
|
|
19
|
+
|
|
20
|
+
# Build package
|
|
21
|
+
python -m build
|
|
22
|
+
|
|
23
|
+
# Upload to PyPI
|
|
24
|
+
twine upload dist/*
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Automatic Publishing
|
|
28
|
+
|
|
29
|
+
The GitHub Actions workflow will automatically publish to PyPI when you create a release.
|
|
30
|
+
|
|
31
|
+
## Creating a Release
|
|
32
|
+
|
|
33
|
+
1. Update version in `setup.py` and `pyproject.toml`
|
|
34
|
+
2. Update `debian/changelog`:
|
|
35
|
+
```bash
|
|
36
|
+
dch -v 0.1.1-1 "New release"
|
|
37
|
+
```
|
|
38
|
+
3. Commit changes
|
|
39
|
+
4. Create and push tag:
|
|
40
|
+
```bash
|
|
41
|
+
git tag -a v0.1.1 -m "Release v0.1.1"
|
|
42
|
+
git push origin v0.1.1
|
|
43
|
+
```
|
|
44
|
+
5. Create GitHub release from tag
|
|
45
|
+
6. GitHub Actions will:
|
|
46
|
+
- Build and publish to PyPI
|
|
47
|
+
- Build `.deb` package
|
|
48
|
+
- Attach `.deb` to release
|
|
49
|
+
|
|
50
|
+
## Manual Debian Package Build
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
dpkg-buildpackage -us -uc -b
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The package will be created in the parent directory.
|
|
57
|
+
|
|
58
|
+
## Installation Methods for Users
|
|
59
|
+
|
|
60
|
+
### Debian/Ubuntu
|
|
61
|
+
```bash
|
|
62
|
+
wget https://github.com/munger/mirror-dedupe/releases/download/v0.1.0/mirror-dedupe_0.1.0-1_all.deb
|
|
63
|
+
sudo dpkg -i mirror-dedupe_0.1.0-1_all.deb
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### PyPI (any Linux)
|
|
67
|
+
```bash
|
|
68
|
+
pip install mirror-dedupe
|
|
69
|
+
sudo ./install.sh --pip
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### From Source
|
|
73
|
+
```bash
|
|
74
|
+
git clone https://github.com/munger/mirror-dedupe.git
|
|
75
|
+
cd mirror-dedupe
|
|
76
|
+
sudo ./install.sh
|
|
77
|
+
```
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
README.md : Ubuntu mirror synchronisation with global deduplication
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2025 Tim Hosking
|
|
5
|
+
Email: tim@mungerware.com
|
|
6
|
+
Website: https://github.com/munger
|
|
7
|
+
Licence: MIT
|
|
8
|
+
-->
|
|
9
|
+
|
|
10
|
+
Ubuntu/Debian mirror synchronisation with intelligent deduplication using hardlinks.
|
|
11
|
+
|
|
12
|
+
## Features
|
|
13
|
+
|
|
14
|
+
- Downloads from upstream and hardlinks duplicate files (same SHA256 hash) to save bandwidth and disk space
|
|
15
|
+
- Supports multiple mirrors with global deduplication across all mirrors
|
|
16
|
+
- Uses curl for duplicate files, rsync for unique files and metadata
|
|
17
|
+
- Configurable via YAML files
|
|
18
|
+
- Systemd timer support for automated synchronisation
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
### Option 1: Debian/Ubuntu Package (Recommended)
|
|
23
|
+
|
|
24
|
+
Download the latest `.deb` package from [GitHub Releases](https://github.com/munger/mirror-dedupe/releases):
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
wget https://github.com/munger/mirror-dedupe/releases/download/v0.1.0/mirror-dedupe_0.1.0-1_all.deb
|
|
28
|
+
sudo dpkg -i mirror-dedupe_0.1.0-1_all.deb
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
This includes systemd integration, man pages, and proper package management.
|
|
32
|
+
|
|
33
|
+
### Option 2: PyPI (All Linux Distributions)
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pip install mirror-dedupe
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Then install systemd files manually:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
sudo ./install.sh --pip
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Option 3: From Source
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
git clone https://github.com/munger/mirror-dedupe.git
|
|
49
|
+
cd mirror-dedupe
|
|
50
|
+
sudo ./install.sh
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Configuration
|
|
54
|
+
|
|
55
|
+
Configuration files are located in `/etc/mirror-dedupe/`:
|
|
56
|
+
|
|
57
|
+
- `mirror-dedupe.conf` - Global settings
|
|
58
|
+
- `repos.d/*.conf` - Individual repository definitions
|
|
59
|
+
|
|
60
|
+
See the `config/` directory for examples.
|
|
61
|
+
|
|
62
|
+
## Usage
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# Sync all mirrors
|
|
66
|
+
mirror-dedupe
|
|
67
|
+
|
|
68
|
+
# Sync specific mirror
|
|
69
|
+
mirror-dedupe --mirror ubuntu
|
|
70
|
+
|
|
71
|
+
# Dry run
|
|
72
|
+
mirror-dedupe --dry-run
|
|
73
|
+
|
|
74
|
+
# Dedupe only (no sync)
|
|
75
|
+
mirror-dedupe --dedupe-only
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Systemd Integration
|
|
79
|
+
|
|
80
|
+
If installed via Debian package, systemd is already configured. Otherwise:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
sudo systemctl enable --now mirror-dedupe.timer
|
|
84
|
+
sudo systemctl status mirror-dedupe.timer
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
View logs:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
journalctl -u mirror-dedupe.service
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Nginx Configuration
|
|
94
|
+
|
|
95
|
+
See `nginx/mirror.conf` for an example nginx configuration.
|
|
96
|
+
|
|
97
|
+
## License
|
|
98
|
+
|
|
99
|
+
MIT License - see LICENSE file for details.
|
|
100
|
+
|
|
101
|
+
## Author
|
|
102
|
+
|
|
103
|
+
Tim Hosking <tim@mungerware.com>
|
|
104
|
+
|
|
105
|
+
https://github.com/munger/mirror-dedupe
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#
|
|
2
|
+
# mirror-dedupe.conf : Ubuntu mirror synchronisation with global deduplication
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2025 Tim Hosking
|
|
5
|
+
# Email: tim@mungerware.com
|
|
6
|
+
# Website: https://github.com/munger
|
|
7
|
+
# Licence: MIT
|
|
8
|
+
#
|
|
9
|
+
|
|
10
|
+
repo_root: /srv/mirror/repos
|
|
11
|
+
|
|
12
|
+
# Buffer size for SHA256 hashing (default: 1048576 / 1MB)
|
|
13
|
+
buffer_size: 1048576
|
|
14
|
+
|
|
15
|
+
# Number of concurrent downloads (default: 10)
|
|
16
|
+
parallel_downloads: 10
|
|
17
|
+
|
|
18
|
+
# Timeout in seconds for curl downloads (default: 900 / 15 min)
|
|
19
|
+
curl_timeout: 900
|
|
20
|
+
|
|
21
|
+
# Number of retry attempts for failed downloads (default: 3)
|
|
22
|
+
max_retries: 3
|
|
23
|
+
|
|
24
|
+
# Print progress every N files (default: 1000)
|
|
25
|
+
progress_interval: 1000
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
README.md : Ubuntu mirror synchronisation with global deduplication
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2025 Tim Hosking
|
|
5
|
+
Email: tim@mungerware.com
|
|
6
|
+
Website: https://github.com/munger
|
|
7
|
+
Licence: MIT
|
|
8
|
+
-->
|
|
9
|
+
|
|
10
|
+
Place your repository configuration files here. Each file should be named `<name>.conf`.
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
Copy `ubuntu.conf.example` to `ubuntu.conf` and customise:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
cp ubuntu.conf.example ubuntu.conf
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Then edit `ubuntu.conf` to match your requirements:
|
|
21
|
+
- Change `upstream` URL if needed
|
|
22
|
+
- Adjust `dest` path (relative to `repo_root`)
|
|
23
|
+
- Select architectures to mirror
|
|
24
|
+
- Choose components
|
|
25
|
+
- Specify distributions
|
|
26
|
+
|
|
27
|
+
## Configuration Format
|
|
28
|
+
|
|
29
|
+
Each repository config file should contain:
|
|
30
|
+
|
|
31
|
+
```yaml
|
|
32
|
+
name: repository-name
|
|
33
|
+
upstream: http://upstream.example.com/repo
|
|
34
|
+
dest: relative/path/from/repo_root
|
|
35
|
+
sync_method: rsync # or https
|
|
36
|
+
gpg_key_url: http://upstream.example.com/gpg.key
|
|
37
|
+
gpg_key_path: relative/path/to/key
|
|
38
|
+
architectures:
|
|
39
|
+
- amd64
|
|
40
|
+
- arm64
|
|
41
|
+
components:
|
|
42
|
+
- main
|
|
43
|
+
- restricted
|
|
44
|
+
distributions:
|
|
45
|
+
- noble
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Sync Methods
|
|
49
|
+
|
|
50
|
+
- **rsync**: Uses rsync protocol (faster, recommended for official Ubuntu mirrors)
|
|
51
|
+
- **https**: Uses HTTPS with curl (for repositories that don't support rsync)
|
|
52
|
+
|
|
53
|
+
## Distribution Expansion
|
|
54
|
+
|
|
55
|
+
By default, distributions are expanded to include variants:
|
|
56
|
+
- `noble` → `noble`, `noble-updates`, `noble-security`, `noble-backports`, `noble-proposed`
|
|
57
|
+
|
|
58
|
+
To disable expansion, add:
|
|
59
|
+
```yaml
|
|
60
|
+
expand_distributions: false
|
|
61
|
+
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Ubuntu ARM/RISC-V ports mirror example
|
|
2
|
+
# Copy this file to ubuntu-ports.conf and customise
|
|
3
|
+
|
|
4
|
+
name: ubuntu-ports
|
|
5
|
+
upstream: http://ports.ubuntu.com/ubuntu-ports
|
|
6
|
+
dest: ubuntu/ubuntu-ports
|
|
7
|
+
sync_method: rsync
|
|
8
|
+
gpg_key_url: http://ports.ubuntu.com/ubuntu-ports/project/ubuntu-archive-keyring.gpg
|
|
9
|
+
gpg_key_path: project/ubuntu-archive-keyring.gpg
|
|
10
|
+
architectures:
|
|
11
|
+
- arm64
|
|
12
|
+
- armhf
|
|
13
|
+
- ppc64el
|
|
14
|
+
- riscv64
|
|
15
|
+
- s390x
|
|
16
|
+
components:
|
|
17
|
+
- main
|
|
18
|
+
- restricted
|
|
19
|
+
- universe
|
|
20
|
+
- multiverse
|
|
21
|
+
distributions:
|
|
22
|
+
- noble
|
|
23
|
+
# Each distribution auto-expands to include -updates, -security, -backports, -proposed
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Ubuntu amd64 mirror example
|
|
2
|
+
# Copy this file to ubuntu.conf and customise
|
|
3
|
+
|
|
4
|
+
name: ubuntu
|
|
5
|
+
upstream: http://archive.ubuntu.com/ubuntu
|
|
6
|
+
dest: ubuntu/ubuntu
|
|
7
|
+
sync_method: rsync
|
|
8
|
+
gpg_key_url: http://archive.ubuntu.com/ubuntu/project/ubuntu-archive-keyring.gpg
|
|
9
|
+
gpg_key_path: project/ubuntu-archive-keyring.gpg
|
|
10
|
+
architectures:
|
|
11
|
+
- amd64
|
|
12
|
+
components:
|
|
13
|
+
- main
|
|
14
|
+
- restricted
|
|
15
|
+
- universe
|
|
16
|
+
- multiverse
|
|
17
|
+
distributions:
|
|
18
|
+
- noble
|
|
19
|
+
# Each distribution auto-expands to include -updates, -security, -backports, -proposed
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
mirror-dedupe (0.1.0-1) noble; urgency=medium
|
|
2
|
+
|
|
3
|
+
* Initial release
|
|
4
|
+
* Mirror synchronisation with intelligent deduplication
|
|
5
|
+
* Support for multiple mirrors with global deduplication
|
|
6
|
+
* Configurable via YAML files
|
|
7
|
+
* Systemd timer support
|
|
8
|
+
|
|
9
|
+
-- Tim Hosking <tim@mungerware.com> Mon, 28 Oct 2025 19:33:00 +0000
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Source: mirror-dedupe
|
|
2
|
+
Section: admin
|
|
3
|
+
Priority: optional
|
|
4
|
+
Maintainer: Tim Hosking <tim@mungerware.com>
|
|
5
|
+
Build-Depends: debhelper-compat (= 13),
|
|
6
|
+
dh-python,
|
|
7
|
+
python3-all,
|
|
8
|
+
python3-setuptools,
|
|
9
|
+
python3-yaml
|
|
10
|
+
Standards-Version: 4.6.0
|
|
11
|
+
Homepage: https://github.com/munger/mirror-dedupe
|
|
12
|
+
|
|
13
|
+
Package: mirror-dedupe
|
|
14
|
+
Architecture: all
|
|
15
|
+
Depends: ${python3:Depends},
|
|
16
|
+
${misc:Depends},
|
|
17
|
+
python3-yaml,
|
|
18
|
+
curl,
|
|
19
|
+
rsync
|
|
20
|
+
Description: Mirror synchronisation with intelligent deduplication
|
|
21
|
+
Downloads from upstream and hardlinks duplicate files (same SHA256 hash)
|
|
22
|
+
to save bandwidth and disk space. Supports multiple mirrors with global
|
|
23
|
+
deduplication across all mirrors.
|
|
24
|
+
.
|
|
25
|
+
Features:
|
|
26
|
+
- Uses curl for duplicate files, rsync for unique files and metadata
|
|
27
|
+
- Configurable via YAML files
|
|
28
|
+
- Systemd timer support for automated synchronisation
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
|
2
|
+
Upstream-Name: mirror-dedupe
|
|
3
|
+
Upstream-Contact: Tim Hosking <tim@mungerware.com>
|
|
4
|
+
Source: https://github.com/munger/mirror-dedupe
|
|
5
|
+
|
|
6
|
+
Files: *
|
|
7
|
+
Copyright: 2025 Tim Hosking <tim@mungerware.com>
|
|
8
|
+
License: MIT
|
|
9
|
+
|
|
10
|
+
License: MIT
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
|
12
|
+
copy of this software and associated documentation files (the "Software"),
|
|
13
|
+
to deal in the Software without restriction, including without limitation
|
|
14
|
+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
15
|
+
and/or sell copies of the Software, and to permit persons to whom the
|
|
16
|
+
Software is furnished to do so, subject to the following conditions:
|
|
17
|
+
.
|
|
18
|
+
The above copyright notice and this permission notice shall be included
|
|
19
|
+
in all copies or substantial portions of the Software.
|
|
20
|
+
.
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
22
|
+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
24
|
+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
26
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
27
|
+
DEALINGS IN THE SOFTWARE.
|