SCP/SFTP helper for Kiwix, openZIM and offspot uploads to our dropbox
Project description
uploader
Dedicated container/script to upload files to openzim/kiwix warehouses
Files are uploaded via SFTP or SCP using OpenSSH and (pubkey authentication).
Files are uploaded to S3 assuming bucketName, keyId and secretAccessKey in query string.
Usage
- Specify file to upload with
--file. - Mount the RSA private key onto
/etc/ssh/keys/id_rsaor use--private_key - Use an
scp://,sftp://,s3://URLs to specify target. - Specify a full path (with filename) to upload to a specific name or end with a
/for uploading inside a folder
docker run \
-v ~/.ssh/id_rsa:/etc/ssh/keys/id_rsa:ro \
-v /path/:/path:rw \
ghcr.io/openzim/uploader \
uploader \
--file /path/my_file.zim \
--upload-uri sftp://uploader@warehouse.farm.openzim.org/zim/ \
--upload-uri "s3://s3.us-west-1.wasabisys.com/?bucketName=my-bucket&keyId=my-key&secretAccessKey=my-secret" \
--move \
--delete
Parameters
--username: if your URI has no username, you can specify it here.--move: upload to a temporary filename (<fname>.tmp) and rename it upon completion. Note that SCP is not able to do it so it uploads an<fname>.completefile upon completion instead.--delete: delete source file once uploaded successfuly.--compress: enable transfer compression.--bandwidth: enable bandwidth limit. Set it in Kbps.--cipher: change default cipher (aes128-ctr).--resume: resume partially uploaded file (SFTP only)
Python
pip3 install kiwix_uploader[all]
uploader --help
from kiwix_uploader import check_and_upload_file
check_and_upload_file(
src_path="/path/my_file.zim",
upload_uri="sftp://uploader@warehouse.farm.openzim.org/zim/",
private_key="~/.ssh/id_rsa",
)
Note: check_and_upload_file returns an unix-like returncode (0 on success)
from kiwix_uploader import multi_file_upload
multi_file_upload(
src_path="/path/my_file.zim",
upload_uris=["sftp://uploader@warehouse.farm.openzim.org/zim/"],
private_key="~/.ssh/id_rsa",
)
Note: multi_file_upload returns an UploadResults (see upload module)
remove_file_retrying(
upload_url="sftp://uploader@warehouse.farm.openzim.org/zim/my_file.zim",
private_key=Path("~/.ssh/id_ed25519").expanduser()
)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kiwix_uploader-1.7.3.tar.gz.
File metadata
- Download URL: kiwix_uploader-1.7.3.tar.gz
- Upload date:
- Size: 27.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ff431316994b54f9c66bf95759185c241c305b287aa8ec14b60e8f27c3e3f2a
|
|
| MD5 |
2cbe3373375f7b639d5acd84f79c298e
|
|
| BLAKE2b-256 |
b196db5d1dc3bd2c7fc2e74aea71b452cb70cc4531bc354ed0969a6abecea578
|
Provenance
The following attestation bundles were made for kiwix_uploader-1.7.3.tar.gz:
Publisher:
Publish.yaml on kiwix/uploader
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kiwix_uploader-1.7.3.tar.gz -
Subject digest:
2ff431316994b54f9c66bf95759185c241c305b287aa8ec14b60e8f27c3e3f2a - Sigstore transparency entry: 1318300712
- Sigstore integration time:
-
Permalink:
kiwix/uploader@16a240b2811ff0c9882606015f2b8365bfcc067d -
Branch / Tag:
refs/tags/1.7.3 - Owner: https://github.com/kiwix
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
Publish.yaml@16a240b2811ff0c9882606015f2b8365bfcc067d -
Trigger Event:
release
-
Statement type:
File details
Details for the file kiwix_uploader-1.7.3-py3-none-any.whl.
File metadata
- Download URL: kiwix_uploader-1.7.3-py3-none-any.whl
- Upload date:
- Size: 30.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cbb3d792eb0025d5cb70ca0791edf2378a0ad548b4fe2301c23568ebf252c4a5
|
|
| MD5 |
05323d63528fa31ea8122979fc0b1f1e
|
|
| BLAKE2b-256 |
bac7b68e39b9605e3fcbb953ad02deddda8482b8e7dd81115681326efcfe9e3a
|
Provenance
The following attestation bundles were made for kiwix_uploader-1.7.3-py3-none-any.whl:
Publisher:
Publish.yaml on kiwix/uploader
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kiwix_uploader-1.7.3-py3-none-any.whl -
Subject digest:
cbb3d792eb0025d5cb70ca0791edf2378a0ad548b4fe2301c23568ebf252c4a5 - Sigstore transparency entry: 1318300980
- Sigstore integration time:
-
Permalink:
kiwix/uploader@16a240b2811ff0c9882606015f2b8365bfcc067d -
Branch / Tag:
refs/tags/1.7.3 - Owner: https://github.com/kiwix
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
Publish.yaml@16a240b2811ff0c9882606015f2b8365bfcc067d -
Trigger Event:
release
-
Statement type: