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
openzim_uploader-1.2.tar.gz
(9.6 kB
view hashes)
Built Distribution
Close
Hashes for openzim_uploader-1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23ff1b9ff592aeea544c56bbd93bda802769998057155f23d83310b7d805f522 |
|
MD5 | 21cfad46d4372fa362c72ea7b4a02e11 |
|
BLAKE2b-256 | c7b6f8b4d8fe89d772d04d08bd5bd2f62a3c19fe47fdca1b3821a538e7cd3fd3 |