pydeb-s3 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.
- pydeb_s3-0.1.0/.gitignore +44 -0
- pydeb_s3-0.1.0/LICENSE +20 -0
- pydeb_s3-0.1.0/PKG-INFO +254 -0
- pydeb_s3-0.1.0/README.md +224 -0
- pydeb_s3-0.1.0/pyproject.toml +86 -0
- pydeb_s3-0.1.0/src/pydeb_s3/__init__.py +6 -0
- pydeb_s3-0.1.0/src/pydeb_s3/__main__.py +12 -0
- pydeb_s3-0.1.0/src/pydeb_s3/_version.py +24 -0
- pydeb_s3-0.1.0/src/pydeb_s3/cli.py +632 -0
- pydeb_s3-0.1.0/src/pydeb_s3/lock.py +187 -0
- pydeb_s3-0.1.0/src/pydeb_s3/manifest.py +249 -0
- pydeb_s3-0.1.0/src/pydeb_s3/package.py +333 -0
- pydeb_s3-0.1.0/src/pydeb_s3/release.py +369 -0
- pydeb_s3-0.1.0/src/pydeb_s3/s3_utils.py +288 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
|
|
7
|
+
# C extensions
|
|
8
|
+
*.egg-info/
|
|
9
|
+
dist/
|
|
10
|
+
build/
|
|
11
|
+
|
|
12
|
+
# Virtual environments
|
|
13
|
+
.venv/
|
|
14
|
+
venv/
|
|
15
|
+
ENV/
|
|
16
|
+
env/
|
|
17
|
+
|
|
18
|
+
# IDE
|
|
19
|
+
.idea/
|
|
20
|
+
.vscode/
|
|
21
|
+
*.swp
|
|
22
|
+
*.swo
|
|
23
|
+
|
|
24
|
+
# Testing
|
|
25
|
+
.pytest_cache/
|
|
26
|
+
.coverage
|
|
27
|
+
htmlcov/
|
|
28
|
+
.tox/
|
|
29
|
+
|
|
30
|
+
# hatch
|
|
31
|
+
.hatch/
|
|
32
|
+
|
|
33
|
+
# hatch-vcs
|
|
34
|
+
src/pydeb_s3/_version.py
|
|
35
|
+
|
|
36
|
+
# Distribution / packaging
|
|
37
|
+
*.egg
|
|
38
|
+
MANIFEST
|
|
39
|
+
|
|
40
|
+
# MyPy
|
|
41
|
+
.mypy_cache/
|
|
42
|
+
|
|
43
|
+
# pyright
|
|
44
|
+
.pyright/
|
pydeb_s3-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright (c) 2013 Ken Robertson
|
|
2
|
+
Copyright (c) 2026 pydeb-s3 team
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
5
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
6
|
+
the Software without restriction, including without limitation the rights to
|
|
7
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
8
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
9
|
+
so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
pydeb_s3-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pydeb-s3
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A simple utility to make creating and managing APT repositories on S3
|
|
5
|
+
Author-email: deb-s3 team <deb-s3@github.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Keywords: apt,debian,package,repository,s3
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: System :: Software Distribution
|
|
20
|
+
Classifier: Topic :: System :: Systems Administration
|
|
21
|
+
Requires-Python: >=3.8
|
|
22
|
+
Requires-Dist: boto3>=1.34.0
|
|
23
|
+
Requires-Dist: jinja2>=3.1.0
|
|
24
|
+
Requires-Dist: loguru>=0.7.0
|
|
25
|
+
Requires-Dist: python-debian>=1.0.0
|
|
26
|
+
Requires-Dist: setuptools-scm>=8.2.0
|
|
27
|
+
Requires-Dist: typer>=0.12.0
|
|
28
|
+
Requires-Dist: typing-extensions>=4.0.0
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
|
|
31
|
+
# pydeb-s3
|
|
32
|
+
|
|
33
|
+
**pydeb-s3** is a Python port of [deb-s3](https://github.com/deb-s3/deb-s3), a simple utility to make creating and managing APT repositories on S3.
|
|
34
|
+
|
|
35
|
+
Most existing guides on using S3 to host an APT repository have you using something like [reprepro](http://mirrorer.alioth.debian.org/) to generate the repository file structure, and then [s3cmd](http://s3tools.org/s3cmd) to sync the files to S3.
|
|
36
|
+
|
|
37
|
+
The annoying thing about this process is it requires you to maintain a local copy of the file tree for regenerating and syncing the next time. Personally, my process is to use one-off virtual machines with [Vagrant](http://vagrantup.com), script out the build process, and then would prefer to just upload the final `.deb` from my Mac.
|
|
38
|
+
|
|
39
|
+
With **pydeb-s3**, there is no need for this. pydeb-s3 features:
|
|
40
|
+
|
|
41
|
+
- Downloads the existing package manifest and parses it.
|
|
42
|
+
- Updates it with the new package, replacing the existing entry if already there or adding a new one if not.
|
|
43
|
+
- Uploads the package itself, the Packages manifest, and the Packages.gz manifest. It will skip the uploading if the package is already there.
|
|
44
|
+
- Updates the Release file with the new hashes and file sizes.
|
|
45
|
+
|
|
46
|
+
## Getting Started
|
|
47
|
+
|
|
48
|
+
Install the package via pip:
|
|
49
|
+
|
|
50
|
+
```console
|
|
51
|
+
$ pip install pydeb-s3
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Now to upload a package, simply use:
|
|
55
|
+
|
|
56
|
+
```console
|
|
57
|
+
$ pydeb-s3 upload --bucket my-bucket my-deb-package-1.0.0_amd64.deb
|
|
58
|
+
>> Examining package file my-deb-package-1.0.0_amd64.deb
|
|
59
|
+
>> Retrieving existing package manifest
|
|
60
|
+
>> Uploading package and new manifests to S3
|
|
61
|
+
-- Transferring pool/m/my/my-deb-package-1.0.0_amd64.deb
|
|
62
|
+
-- Transferring dists/stable/main/binary-amd64/Packages
|
|
63
|
+
-- Transferring dists/stable/main/binary-amd64/Packages.gz
|
|
64
|
+
-- Transferring dists/stable/Release
|
|
65
|
+
>> Update complete.
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
For Google Cloud Storage (or other S3-compatible endpoints) you need to disable SDK checksum negotiation headers and set visibility settings to nil:
|
|
69
|
+
|
|
70
|
+
```console
|
|
71
|
+
$ pydeb-s3 upload --bucket my-bucket --endpoint https://storage.googleapis.com --checksum-when-required --visibility nil my-deb-package-1.0.0_amd64.deb
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Usage
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
Usage:
|
|
78
|
+
pydeb-s3 upload FILES
|
|
79
|
+
pydeb-s3 list
|
|
80
|
+
pydeb-s3 show PACKAGE VERSION ARCH
|
|
81
|
+
pydeb-s3 exists PACKAGE VERSION ARCH [PACKAGE VERSION ARCH ...]
|
|
82
|
+
pydeb-s3 copy PACKAGE TO_CODENAME TO_COMPONENT
|
|
83
|
+
pydeb-s3 delete PACKAGE
|
|
84
|
+
pydeb-s3 verify
|
|
85
|
+
pydeb-s3 clean
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Commands
|
|
89
|
+
|
|
90
|
+
### upload
|
|
91
|
+
|
|
92
|
+
Uploads the given files to a S3 bucket as an APT repository.
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
pydeb-s3 upload [--arch=ARCH] [--preserve-versions] [--lock] [--fail-if-exists]
|
|
96
|
+
[--skip-package-upload] [--bucket=BUCKET] [--prefix=PREFIX]
|
|
97
|
+
[--origin=ORIGIN] [--suite=SUITE] [--codename=CODENAME]
|
|
98
|
+
[--component=COMPONENT] [--access-key-id=KEY] [--secret-access-key=KEY]
|
|
99
|
+
[--s3-region=REGION] [--force-path-style] [--proxy-uri=URI]
|
|
100
|
+
[--visibility=VISIBILITY] [--sign=KEY] [--gpg-options=OPTIONS]
|
|
101
|
+
[--encryption] [--quiet] [--cache-control=CONTROL]
|
|
102
|
+
FILES
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### list
|
|
106
|
+
|
|
107
|
+
Lists packages in given codename, component, and optionally architecture.
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
pydeb-s3 list [--long] [--arch=ARCH] [--bucket=BUCKET] [--prefix=PREFIX]
|
|
111
|
+
[--codename=CODENAME] [--component=COMPONENT]
|
|
112
|
+
[--s3-region=REGION] [--quiet]
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### show
|
|
116
|
+
|
|
117
|
+
Shows information about a package.
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
pydeb-s3 show PACKAGE VERSION ARCH [--bucket=BUCKET] [--prefix=PREFIX]
|
|
121
|
+
[--codename=CODENAME] [--component=COMPONENT]
|
|
122
|
+
[--s3-region=REGION] [--quiet]
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### exists
|
|
126
|
+
|
|
127
|
+
Check if packages exist in the repository.
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
pydeb-s3 exists PACKAGE VERSION ARCH [PACKAGE VERSION ARCH ...]
|
|
131
|
+
[--bucket=BUCKET] [--prefix=PREFIX]
|
|
132
|
+
[--codename=CODENAME] [--component=COMPONENT]
|
|
133
|
+
[--s3-region=REGION] [--quiet]
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### copy
|
|
137
|
+
|
|
138
|
+
Copy the package named PACKAGE to given codename and component.
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
pydeb-s3 copy PACKAGE TO_CODENAME TO_COMPONENT
|
|
142
|
+
[--arch=ARCH] [--lock] [--versions=VERSIONS]
|
|
143
|
+
[--preserve-versions] [--fail-if-exists]
|
|
144
|
+
[--bucket=BUCKET] [--prefix=PREFIX]
|
|
145
|
+
[--codename=CODENAME] [--component=COMPONENT]
|
|
146
|
+
[--s3-region=REGION] [--quiet]
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### delete
|
|
150
|
+
|
|
151
|
+
Remove the package named PACKAGE.
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
pydeb-s3 delete PACKAGE [--arch=ARCH] [--lock] [--versions=VERSIONS]
|
|
155
|
+
[--bucket=BUCKET] [--prefix=PREFIX]
|
|
156
|
+
[--origin=ORIGIN] [--suite=SUITE]
|
|
157
|
+
[--codename=CODENAME] [--component=COMPONENT]
|
|
158
|
+
[--s3-region=REGION] [--visibility=VISIBILITY]
|
|
159
|
+
[--sign=KEY] [--gpg-options=OPTIONS]
|
|
160
|
+
[--encryption] [--quiet] [--cache-control=CONTROL]
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### verify
|
|
164
|
+
|
|
165
|
+
Verifies that the files in the package manifests exist.
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
pydeb-s3 verify [--fix-manifests] [--bucket=BUCKET] [--prefix=PREFIX]
|
|
169
|
+
[--origin=ORIGIN] [--suite=SUITE]
|
|
170
|
+
[--codename=CODENAME] [--component=COMPONENT]
|
|
171
|
+
[--s3-region=REGION] [--visibility=VISIBILITY]
|
|
172
|
+
[--sign=KEY] [--gpg-options=OPTIONS]
|
|
173
|
+
[--encryption] [--quiet] [--cache-control=CONTROL]
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### clean
|
|
177
|
+
|
|
178
|
+
Delete packages from the pool which are no longer referenced.
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
pydeb-s3 clean [--lock] [--bucket=BUCKET] [--prefix=PREFIX]
|
|
182
|
+
[--origin=ORIGIN] [--suite=SUITE]
|
|
183
|
+
[--codename=CODENAME] [--component=COMPONENT]
|
|
184
|
+
[--s3-region=REGION] [--visibility=VISIBILITY]
|
|
185
|
+
[--sign=KEY] [--gpg-options=OPTIONS]
|
|
186
|
+
[--encryption] [--quiet] [--cache-control=CONTROL]
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Configuration
|
|
190
|
+
|
|
191
|
+
### AWS Credentials
|
|
192
|
+
|
|
193
|
+
pydeb-s3 supports multiple methods for AWS credentials:
|
|
194
|
+
|
|
195
|
+
1. **Command-line options**:
|
|
196
|
+
- `--access-key-id` and `--secret-access-key`
|
|
197
|
+
- `--session-token` (for temporary credentials)
|
|
198
|
+
|
|
199
|
+
2. **Environment variables**:
|
|
200
|
+
- `AWS_ACCESS_KEY_ID`
|
|
201
|
+
- `AWS_SECRET_ACCESS_KEY`
|
|
202
|
+
- `AWS_DEFAULT_REGION`
|
|
203
|
+
|
|
204
|
+
3. **AWS Config file**: Uses standard boto3 credential resolution
|
|
205
|
+
|
|
206
|
+
### S3 Bucket
|
|
207
|
+
|
|
208
|
+
The `--bucket` option is required for all commands.
|
|
209
|
+
|
|
210
|
+
### Visibility
|
|
211
|
+
|
|
212
|
+
The `--visibility` option controls ACL on uploaded files:
|
|
213
|
+
- `public` (default) - public-read
|
|
214
|
+
- `private` - private
|
|
215
|
+
- `authenticated` - authenticated-read
|
|
216
|
+
- `nil` - do not set ACL (for buckets without ACL support)
|
|
217
|
+
|
|
218
|
+
## Example S3 IAM Policy
|
|
219
|
+
|
|
220
|
+
```json
|
|
221
|
+
{
|
|
222
|
+
"Version": "2012-10-17",
|
|
223
|
+
"Statement": [
|
|
224
|
+
{
|
|
225
|
+
"Effect": "Allow",
|
|
226
|
+
"Action": ["s3:ListBucket"],
|
|
227
|
+
"Resource": ["arn:aws:s3:::BUCKETNAME"]
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"Effect": "Allow",
|
|
231
|
+
"Action": [
|
|
232
|
+
"s3:PutObject",
|
|
233
|
+
"s3:GetObject",
|
|
234
|
+
"s3:DeleteObject",
|
|
235
|
+
"s3:DeleteObjectVersion",
|
|
236
|
+
"s3:GetObjectAcl",
|
|
237
|
+
"s3:GetObjectVersionAcl",
|
|
238
|
+
"s3:PutObjectAcl",
|
|
239
|
+
"s3:PutObjectVersionAcl"
|
|
240
|
+
],
|
|
241
|
+
"Resource": ["arn:aws:s3:::BUCKETNAME/*"]
|
|
242
|
+
}
|
|
243
|
+
]
|
|
244
|
+
}
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
## License
|
|
248
|
+
|
|
249
|
+
MIT License - see LICENSE file for details.
|
|
250
|
+
|
|
251
|
+
## Credits
|
|
252
|
+
|
|
253
|
+
- Original [deb-s3](https://github.com/deb-s3/deb-s3) by [Ken Robertson](https://github.com/krobertson)
|
|
254
|
+
- Python port by pydeb-s3 team
|
pydeb_s3-0.1.0/README.md
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# pydeb-s3
|
|
2
|
+
|
|
3
|
+
**pydeb-s3** is a Python port of [deb-s3](https://github.com/deb-s3/deb-s3), a simple utility to make creating and managing APT repositories on S3.
|
|
4
|
+
|
|
5
|
+
Most existing guides on using S3 to host an APT repository have you using something like [reprepro](http://mirrorer.alioth.debian.org/) to generate the repository file structure, and then [s3cmd](http://s3tools.org/s3cmd) to sync the files to S3.
|
|
6
|
+
|
|
7
|
+
The annoying thing about this process is it requires you to maintain a local copy of the file tree for regenerating and syncing the next time. Personally, my process is to use one-off virtual machines with [Vagrant](http://vagrantup.com), script out the build process, and then would prefer to just upload the final `.deb` from my Mac.
|
|
8
|
+
|
|
9
|
+
With **pydeb-s3**, there is no need for this. pydeb-s3 features:
|
|
10
|
+
|
|
11
|
+
- Downloads the existing package manifest and parses it.
|
|
12
|
+
- Updates it with the new package, replacing the existing entry if already there or adding a new one if not.
|
|
13
|
+
- Uploads the package itself, the Packages manifest, and the Packages.gz manifest. It will skip the uploading if the package is already there.
|
|
14
|
+
- Updates the Release file with the new hashes and file sizes.
|
|
15
|
+
|
|
16
|
+
## Getting Started
|
|
17
|
+
|
|
18
|
+
Install the package via pip:
|
|
19
|
+
|
|
20
|
+
```console
|
|
21
|
+
$ pip install pydeb-s3
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Now to upload a package, simply use:
|
|
25
|
+
|
|
26
|
+
```console
|
|
27
|
+
$ pydeb-s3 upload --bucket my-bucket my-deb-package-1.0.0_amd64.deb
|
|
28
|
+
>> Examining package file my-deb-package-1.0.0_amd64.deb
|
|
29
|
+
>> Retrieving existing package manifest
|
|
30
|
+
>> Uploading package and new manifests to S3
|
|
31
|
+
-- Transferring pool/m/my/my-deb-package-1.0.0_amd64.deb
|
|
32
|
+
-- Transferring dists/stable/main/binary-amd64/Packages
|
|
33
|
+
-- Transferring dists/stable/main/binary-amd64/Packages.gz
|
|
34
|
+
-- Transferring dists/stable/Release
|
|
35
|
+
>> Update complete.
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
For Google Cloud Storage (or other S3-compatible endpoints) you need to disable SDK checksum negotiation headers and set visibility settings to nil:
|
|
39
|
+
|
|
40
|
+
```console
|
|
41
|
+
$ pydeb-s3 upload --bucket my-bucket --endpoint https://storage.googleapis.com --checksum-when-required --visibility nil my-deb-package-1.0.0_amd64.deb
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Usage
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
Usage:
|
|
48
|
+
pydeb-s3 upload FILES
|
|
49
|
+
pydeb-s3 list
|
|
50
|
+
pydeb-s3 show PACKAGE VERSION ARCH
|
|
51
|
+
pydeb-s3 exists PACKAGE VERSION ARCH [PACKAGE VERSION ARCH ...]
|
|
52
|
+
pydeb-s3 copy PACKAGE TO_CODENAME TO_COMPONENT
|
|
53
|
+
pydeb-s3 delete PACKAGE
|
|
54
|
+
pydeb-s3 verify
|
|
55
|
+
pydeb-s3 clean
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Commands
|
|
59
|
+
|
|
60
|
+
### upload
|
|
61
|
+
|
|
62
|
+
Uploads the given files to a S3 bucket as an APT repository.
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
pydeb-s3 upload [--arch=ARCH] [--preserve-versions] [--lock] [--fail-if-exists]
|
|
66
|
+
[--skip-package-upload] [--bucket=BUCKET] [--prefix=PREFIX]
|
|
67
|
+
[--origin=ORIGIN] [--suite=SUITE] [--codename=CODENAME]
|
|
68
|
+
[--component=COMPONENT] [--access-key-id=KEY] [--secret-access-key=KEY]
|
|
69
|
+
[--s3-region=REGION] [--force-path-style] [--proxy-uri=URI]
|
|
70
|
+
[--visibility=VISIBILITY] [--sign=KEY] [--gpg-options=OPTIONS]
|
|
71
|
+
[--encryption] [--quiet] [--cache-control=CONTROL]
|
|
72
|
+
FILES
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### list
|
|
76
|
+
|
|
77
|
+
Lists packages in given codename, component, and optionally architecture.
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
pydeb-s3 list [--long] [--arch=ARCH] [--bucket=BUCKET] [--prefix=PREFIX]
|
|
81
|
+
[--codename=CODENAME] [--component=COMPONENT]
|
|
82
|
+
[--s3-region=REGION] [--quiet]
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### show
|
|
86
|
+
|
|
87
|
+
Shows information about a package.
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
pydeb-s3 show PACKAGE VERSION ARCH [--bucket=BUCKET] [--prefix=PREFIX]
|
|
91
|
+
[--codename=CODENAME] [--component=COMPONENT]
|
|
92
|
+
[--s3-region=REGION] [--quiet]
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### exists
|
|
96
|
+
|
|
97
|
+
Check if packages exist in the repository.
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
pydeb-s3 exists PACKAGE VERSION ARCH [PACKAGE VERSION ARCH ...]
|
|
101
|
+
[--bucket=BUCKET] [--prefix=PREFIX]
|
|
102
|
+
[--codename=CODENAME] [--component=COMPONENT]
|
|
103
|
+
[--s3-region=REGION] [--quiet]
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### copy
|
|
107
|
+
|
|
108
|
+
Copy the package named PACKAGE to given codename and component.
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
pydeb-s3 copy PACKAGE TO_CODENAME TO_COMPONENT
|
|
112
|
+
[--arch=ARCH] [--lock] [--versions=VERSIONS]
|
|
113
|
+
[--preserve-versions] [--fail-if-exists]
|
|
114
|
+
[--bucket=BUCKET] [--prefix=PREFIX]
|
|
115
|
+
[--codename=CODENAME] [--component=COMPONENT]
|
|
116
|
+
[--s3-region=REGION] [--quiet]
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### delete
|
|
120
|
+
|
|
121
|
+
Remove the package named PACKAGE.
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
pydeb-s3 delete PACKAGE [--arch=ARCH] [--lock] [--versions=VERSIONS]
|
|
125
|
+
[--bucket=BUCKET] [--prefix=PREFIX]
|
|
126
|
+
[--origin=ORIGIN] [--suite=SUITE]
|
|
127
|
+
[--codename=CODENAME] [--component=COMPONENT]
|
|
128
|
+
[--s3-region=REGION] [--visibility=VISIBILITY]
|
|
129
|
+
[--sign=KEY] [--gpg-options=OPTIONS]
|
|
130
|
+
[--encryption] [--quiet] [--cache-control=CONTROL]
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### verify
|
|
134
|
+
|
|
135
|
+
Verifies that the files in the package manifests exist.
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
pydeb-s3 verify [--fix-manifests] [--bucket=BUCKET] [--prefix=PREFIX]
|
|
139
|
+
[--origin=ORIGIN] [--suite=SUITE]
|
|
140
|
+
[--codename=CODENAME] [--component=COMPONENT]
|
|
141
|
+
[--s3-region=REGION] [--visibility=VISIBILITY]
|
|
142
|
+
[--sign=KEY] [--gpg-options=OPTIONS]
|
|
143
|
+
[--encryption] [--quiet] [--cache-control=CONTROL]
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### clean
|
|
147
|
+
|
|
148
|
+
Delete packages from the pool which are no longer referenced.
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
pydeb-s3 clean [--lock] [--bucket=BUCKET] [--prefix=PREFIX]
|
|
152
|
+
[--origin=ORIGIN] [--suite=SUITE]
|
|
153
|
+
[--codename=CODENAME] [--component=COMPONENT]
|
|
154
|
+
[--s3-region=REGION] [--visibility=VISIBILITY]
|
|
155
|
+
[--sign=KEY] [--gpg-options=OPTIONS]
|
|
156
|
+
[--encryption] [--quiet] [--cache-control=CONTROL]
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Configuration
|
|
160
|
+
|
|
161
|
+
### AWS Credentials
|
|
162
|
+
|
|
163
|
+
pydeb-s3 supports multiple methods for AWS credentials:
|
|
164
|
+
|
|
165
|
+
1. **Command-line options**:
|
|
166
|
+
- `--access-key-id` and `--secret-access-key`
|
|
167
|
+
- `--session-token` (for temporary credentials)
|
|
168
|
+
|
|
169
|
+
2. **Environment variables**:
|
|
170
|
+
- `AWS_ACCESS_KEY_ID`
|
|
171
|
+
- `AWS_SECRET_ACCESS_KEY`
|
|
172
|
+
- `AWS_DEFAULT_REGION`
|
|
173
|
+
|
|
174
|
+
3. **AWS Config file**: Uses standard boto3 credential resolution
|
|
175
|
+
|
|
176
|
+
### S3 Bucket
|
|
177
|
+
|
|
178
|
+
The `--bucket` option is required for all commands.
|
|
179
|
+
|
|
180
|
+
### Visibility
|
|
181
|
+
|
|
182
|
+
The `--visibility` option controls ACL on uploaded files:
|
|
183
|
+
- `public` (default) - public-read
|
|
184
|
+
- `private` - private
|
|
185
|
+
- `authenticated` - authenticated-read
|
|
186
|
+
- `nil` - do not set ACL (for buckets without ACL support)
|
|
187
|
+
|
|
188
|
+
## Example S3 IAM Policy
|
|
189
|
+
|
|
190
|
+
```json
|
|
191
|
+
{
|
|
192
|
+
"Version": "2012-10-17",
|
|
193
|
+
"Statement": [
|
|
194
|
+
{
|
|
195
|
+
"Effect": "Allow",
|
|
196
|
+
"Action": ["s3:ListBucket"],
|
|
197
|
+
"Resource": ["arn:aws:s3:::BUCKETNAME"]
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"Effect": "Allow",
|
|
201
|
+
"Action": [
|
|
202
|
+
"s3:PutObject",
|
|
203
|
+
"s3:GetObject",
|
|
204
|
+
"s3:DeleteObject",
|
|
205
|
+
"s3:DeleteObjectVersion",
|
|
206
|
+
"s3:GetObjectAcl",
|
|
207
|
+
"s3:GetObjectVersionAcl",
|
|
208
|
+
"s3:PutObjectAcl",
|
|
209
|
+
"s3:PutObjectVersionAcl"
|
|
210
|
+
],
|
|
211
|
+
"Resource": ["arn:aws:s3:::BUCKETNAME/*"]
|
|
212
|
+
}
|
|
213
|
+
]
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## License
|
|
218
|
+
|
|
219
|
+
MIT License - see LICENSE file for details.
|
|
220
|
+
|
|
221
|
+
## Credits
|
|
222
|
+
|
|
223
|
+
- Original [deb-s3](https://github.com/deb-s3/deb-s3) by [Ken Robertson](https://github.com/krobertson)
|
|
224
|
+
- Python port by pydeb-s3 team
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling", "hatch-vcs"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "pydeb-s3"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "A simple utility to make creating and managing APT repositories on S3"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.8"
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "deb-s3 team", email = "deb-s3@github.com" },
|
|
14
|
+
]
|
|
15
|
+
keywords = ["apt", "debian", "s3", "repository", "package"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"License :: OSI Approved :: MIT License",
|
|
20
|
+
"Operating System :: OS Independent",
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"Programming Language :: Python :: 3.8",
|
|
23
|
+
"Programming Language :: Python :: 3.9",
|
|
24
|
+
"Programming Language :: Python :: 3.10",
|
|
25
|
+
"Programming Language :: Python :: 3.11",
|
|
26
|
+
"Programming Language :: Python :: 3.12",
|
|
27
|
+
"Topic :: System :: Software Distribution",
|
|
28
|
+
"Topic :: System :: Systems Administration",
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
dependencies = [
|
|
32
|
+
"boto3>=1.34.0",
|
|
33
|
+
"typer>=0.12.0",
|
|
34
|
+
"python-debian>=1.0.0",
|
|
35
|
+
"jinja2>=3.1.0",
|
|
36
|
+
"loguru>=0.7.0",
|
|
37
|
+
"typing-extensions>=4.0.0",
|
|
38
|
+
"setuptools-scm>=8.2.0",
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
[tool.hatch.envs.default]
|
|
42
|
+
dependencies = [
|
|
43
|
+
"pytest>=7.0.0",
|
|
44
|
+
"pytest-cov>=4.0.0",
|
|
45
|
+
"moto>=5.0.0",
|
|
46
|
+
"requests-mock>=1.11.0",
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
[tool.hatch.envs.lint]
|
|
50
|
+
dependencies = [
|
|
51
|
+
"ruff>=0.1.0",
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
[tool.hatch.envs.type]
|
|
55
|
+
dependencies = [
|
|
56
|
+
"mypy>=1.0.0",
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
[project.scripts]
|
|
60
|
+
pydeb-s3 = "pydeb_s3.cli:app"
|
|
61
|
+
|
|
62
|
+
[tool.hatch.version]
|
|
63
|
+
source = "vcs"
|
|
64
|
+
|
|
65
|
+
[tool.hatch.build.targets.sdist]
|
|
66
|
+
only-packages = true
|
|
67
|
+
|
|
68
|
+
[tool.hatch.build.hooks.vcs]
|
|
69
|
+
version-file = "src/pydeb_s3/_version.py"
|
|
70
|
+
|
|
71
|
+
[tool.ruff]
|
|
72
|
+
line-length = 100
|
|
73
|
+
|
|
74
|
+
[tool.mypy]
|
|
75
|
+
python_version = "3.8"
|
|
76
|
+
strict = true
|
|
77
|
+
warn_return_any = true
|
|
78
|
+
warn_unused_configs = true
|
|
79
|
+
disallow_untyped_defs = false
|
|
80
|
+
|
|
81
|
+
[tool.pytest.ini_options]
|
|
82
|
+
testpaths = ["tests"]
|
|
83
|
+
python_files = ["test_*.py"]
|
|
84
|
+
python_functions = ["test_*"]
|
|
85
|
+
addopts = "-v --tb=short"
|
|
86
|
+
pythonpath = "src"
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# file generated by vcs-versioning
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"__version__",
|
|
7
|
+
"__version_tuple__",
|
|
8
|
+
"version",
|
|
9
|
+
"version_tuple",
|
|
10
|
+
"__commit_id__",
|
|
11
|
+
"commit_id",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
version: str
|
|
15
|
+
__version__: str
|
|
16
|
+
__version_tuple__: tuple[int | str, ...]
|
|
17
|
+
version_tuple: tuple[int | str, ...]
|
|
18
|
+
commit_id: str | None
|
|
19
|
+
__commit_id__: str | None
|
|
20
|
+
|
|
21
|
+
__version__ = version = '0.1.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 1, 0)
|
|
23
|
+
|
|
24
|
+
__commit_id__ = commit_id = None
|