SCP/SFTP helper for openZIM uploads to our dropbox
Project description
uploader
Dedicated container/script to upload files to openzim/kiwix warehouses and S3
Files are uploaded via SFTP (pubkey authentication) or SCP using OpenSSH.
Usage
- Specify file to upload with
--file
. - Mount the RSA private key onto
/etc/ssh/keys/id_rsa
or use--private_key
- Use an
scp://
orsftp://
URI 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 \
openzim/uploader \
uploader \
--file /path/my_file.zim \
--upload-uri sftp://uploader@warehouse.farm.openzim.org/zim/ \
--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>.complete
file 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 openzim_uploader[all]
openzim-uploader --help
from openzim_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)
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file openzim_uploader-1.0.1.tar.gz
.
File metadata
- Download URL: openzim_uploader-1.0.1.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fae045f1248de87f42bc0736a5841f63c2c1888bc2689b9834d9212d3f8e968e |
|
MD5 | 94a004a7dda48ebe231b1aaf987842b0 |
|
BLAKE2b-256 | e0aa227ca6f419dbe93b7a29c63291e89dcd744602f8c11029e568c07279e0f7 |
File details
Details for the file openzim_uploader-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: openzim_uploader-1.0.1-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f5701fc9cede681a374714ac1a765ecea5ef8ed6d44e2a3a247ea80271c0367 |
|
MD5 | ee993ff7842947fe2d494f67129d9db8 |
|
BLAKE2b-256 | d79d18f755cb4ac60be822f0c962e142a0a9864d88d340ec1aa216881bba2ad0 |