[announce] cloud-cli 1.26 - command line script to perform file, share and user operations

URL: https://lightaffaire.com/code

Changelog:
1.26 2023.01.11
- fixed --create-share to use --share-with (reported by danielhainich@gmail.com)
1.25 2022.12.13
- fixed --list-shares to correctly display Upload parameter
1.24 2022.11.30
- changed --list-users and --list-user to display quota as 'used[T|G|M|K|B]/total[T|G|M|K|B]'
- fixed verbose option call messages to use \"$AdminUser:********\" for easier cut&paste usage
1.23 2022.11.29
- changed --list-shares to also list Path
1.22 2022.11.14
- added --sync-src sync source path on localhost or rclone host option
- added --sync-dst sync destination path on rclone host option
- added --rclone-checkers number of rclone parallel checkers (default: $RcloneNumCheckers) option
- added --rclone-transfers number of rclone parallel transfers (default: $RcloneNumTransfers) option
- added --rclone-bwlimit bandwidth limit rclone in KiB/s or [B|K|M|G|T|P] (default: $RcloneBwLimit) option
1.21 2022.10.09
- changed --delete-expire to require --yes confirmation
- fixed --share-expire to accept YYYY-MM-DD and YYYYMMDD
- fixed Help() for --share-expire

Constructive feedback always appreciated.

Iain

5 Likes

What does it mean:
command ending in: --list /Documents/
OK
failed to load external entity ā€œ/tmp/cloud-cli.list-xml.307072ā€

I just tried that here and this is what I get:

$ cloud-cli --list /Documents/

2022-11-18 10:59:21       DIR  Documents/
2022-11-18 10:59:21      1095  Documents/Example.md
2022-11-13 19:04:33   1083339  Documents/Nextcloud%20flyer.pdf
2022-11-13 19:04:33       136  Documents/Readme.md
2022-11-13 19:04:33     24295  Documents/Welcome%20to%20Nextcloud%20Hub.docx

I would re-check the values you have used for:

 --host|-H url         cloud host url https://[fqdn|ip][:port]
 --user|-U user        cloud username (for file operations)
 --pass|-P pass        cloud password (for file operations)
 --admin-user user     admin username (for user operations)
 --admin-pass pass     admin password (for user operations)
 --insecure|-I         ignore self signed SSL certs

Iain

Is the program ā€˜xmlstarlet’ installed on your system as it is a dependency?

I just created a v1.27 which actually automatically checks for this when running cloud-cli.

You can download it from https://lightaffaire.com/code

Yes I installed it.
It was wrong username.
Thanx

Glad I could help you. Have fun!

How to upload a file to a folder?
Can you upload a file as ā€œadminā€ to a user folder?
Can you download a preview?

cloud-cli --local-file src-file --upload dst-folder/dst-file

If you can the preview file you can download it…

cloud-cli --list folder

Currently not possible to add a file as admin to a users folder structure.

Iain

Thanks for the quick reply

Sorry, didn’t get this one, could you elaborate a bit more?

if you can see the preview file using the --list folder command then you can download it.

Hello, nice work! Found it while evaluating possibilities to handle shares via cmd.
It works so far but only with ā€œlocalā€ accounts. If I want to connect as a user who was imported from an ldap dircectory, it sadly does not work.
Users logged into NC/ldap get kind of a user-id, e.g. ā€œ841e3532-54d9-1d3d-8fea-d312ceeef81dā€, a local admin would get ā€œadminā€ instead. In the data/ dir, the folder of that ldap user is like the name ā€œ841e35ā€
To log into NC a user uses its ldap username, e.g. jdoe (for John Doe). If I use ā€œjdoeā€ then, it fails: user unknown. If I use ā€œ841e35ā€¦ā€ it says: No access, username/password wrong.

I replicated it with the curl command to get more information back.

Any idea? Thank you!

thanks for your feedback. I developed the script as a piece of glue to connect my photography workflow on a synology NAS to nextcloud running in a docker image on the same NAS. Has worked perfectly since I implemented it.

That was my itch and I scratched it with the current scripts functionality.

LDAP and remote user support is outside the scope of what i require and my time is limited.

However if you can cleanly add the LDAP/remote user functionality to my script I will update the master copy here.

Just send me the whole modified script or a patch diff against the latest 1.30 version available here:

https://lightaffaire.com/code/cloud/cloud-cli

Thanks

Iain

1 Like

Hi Iain
thank you for the answer. For the moment, I solved it with a local user. I’ll take a deeper look into it some time later because we have to have a solution quickly. If I have to implement changes or have to add functionality I’ll let you know. Let’s see how it works for the staff first.
Cheers! -jan

Hi
I’m trying to use cloud-cli but can’t succeed

Our login is checked through LDAP. It is not our email address.

I tried the following using the curl command line showed with -v option :

  • User/Password ==> Principal with name xxx not found
  • Email/Password ==> password login forbidden
  • Emaill/AppPassword ==> No public access to this resource., Username or password was incorrect, No ā€˜Authorization: Bearer’ header found. Either the client didn’t send one, or the server is mis-configured, Username or password was incorrect

What shall I try ?

Thx

Hi,

i currently do not have time to add functionality we would not use on our projects.

Two possibilities:

  1. add new functionality and send me the changes which i will add into the next release

  2. pay me to implement the changes you require. If interested mail me at code@lightaffaire.com

Iain