Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sane usage of owncloudcmd #2211

Closed
6 tasks done
danimo opened this issue Sep 16, 2014 · 23 comments
Closed
6 tasks done

Sane usage of owncloudcmd #2211

danimo opened this issue Sep 16, 2014 · 23 comments
Assignees
Labels
p2-high Escalation, on top of current planning, release blocker

Comments

@danimo
Copy link
Contributor

danimo commented Sep 16, 2014

The current way of using owncloudcmd is flawed, because nobody expects username and password to be encoded in the URL. Furthermore, when doing so, the password gets leaked through debug output.

This is what should be done:

  • Check if username and password are encoded in the URL, if so, extract them and strip the URL
  • Support --user and --password
  • Support -n (netrc)
  • Remove preps for fetching credentials from current configuration (--confdir)
  • If we still miss the URL or password until here, ask interactively
  • Print version number with usage or --version
@danimo danimo self-assigned this Sep 16, 2014
@danimo
Copy link
Contributor Author

danimo commented Sep 16, 2014

@jnweiger @ogoffart Does that make sense?

@jnweiger
Copy link
Contributor

Makes sense. Thanks. On top, I'd like a safe way for non-interactive usage.
E.g. have a command line option to fail when credentials are missing (instead of asking interactily), or have < /dev/null have that effect.

@danimo
Copy link
Contributor Author

danimo commented Sep 16, 2014

Stripping the URL requires changes deep in csync, so we'll not do that for the moment. We should however, make sure that the password is hidden in the debug output csync. Also, the --silent option doesn't seem to do much at all.

@danimo
Copy link
Contributor Author

danimo commented Sep 16, 2014

@jnweiger Added --non-interactive. Thought about making it an implicit result of --silent, but that's probably unexpected for most.

Also, --non-interactive is currently implied whith -n (using netrc (5)).

@jnweiger
Copy link
Contributor

For running unattended test cases we need the --non-interactive mode. This prevents a test-run (or any other batch job) from unexpectedly blocking while waiting for user input that would never come.

@dragotin dragotin added the p2-high Escalation, on top of current planning, release blocker label Sep 17, 2014
danimo added a commit that referenced this issue Sep 17, 2014
@danimo danimo added the ReadyToTest QA, please validate the fix/enhancement label Sep 17, 2014
@luciamaestro
Copy link

When I try to run it in Mac I have this error:

 /  ./Applications/owncloud.app/Contents/MacOS/owncloudcmd --help
dyld: Library not loaded: /Users/builder/Qt/5.2.1/clang_64/lib/QtNetwork.framework/Versions/5/QtNetwork
  Referenced from: //./Applications/owncloud.app/Contents/MacOS/owncloudcmd
  Reason: image not found
[1]    8347 trace trap  ./Applications/owncloud.app/Contents/MacOS/owncloudcmd --help

@luciamaestro luciamaestro removed the ReadyToTest QA, please validate the fix/enhancement label Sep 23, 2014
@jnweiger
Copy link
Contributor

@cdamken this is something for you too!

@cdamken
Copy link
Contributor

cdamken commented Sep 26, 2014

@danimo

Remove preps for fetching credentials from current configuration (--confdir)

how can the users in windows put their credentials now to avoid typing it every time?

Also, --non-interactive is currently implied whith -n (using netrc (5)).

That is a good solution for Linux, how will be in windows?

Could not be possible to have a configuration file in windows (like .netrc) where the url, login, password and directories are stored?

@danimo danimo added the ReadyToTest QA, please validate the fix/enhancement label Sep 30, 2014
@jnweiger
Copy link
Contributor

jnweiger commented Oct 7, 2014

Tested owncloud-client-1.7.0~beta3-1.2.x86_64 on openSUSE Linux

When providing a password with -p it should not prompt for password.
-p appears to be synonymous to -u

$ owncloudcmd -u user1 -p owncloud /tmp/syncdir/user1 http://daily.owncloud.com/stable7/owncloud
Password for user owncloud:

When typing in the credentials as prompted, download of the skeleton files is unsuccessful.
ll /tmp/syncdir/user1
insgesamt 44
drwxr-xr-x 5 testy users 4096 7. Okt 17:02 .
drwxr-xr-x 6 testy users 4096 7. Okt 16:55 ..
-rw-r--r-- 1 testy users 17408 7. Okt 17:02 .csync_journal.db
drwxr-xr-x 2 testy users 4096 7. Okt 17:01 documents
drwxr-xr-x 2 testy users 4096 7. Okt 17:01 music
-rw-r--r-- 1 testy users 318 7. Okt 17:01 .ownCloudUserManual.pdf.~1e23ef54
drwxr-xr-x 2 testy users 4096 7. Okt 17:01 photos

@jnweiger
Copy link
Contributor

jnweiger commented Oct 7, 2014

Typescript:
https://gist.github.com/jnweiger/676bc63ce4f0f2600cda

1.6.3 used to support the http://user:password @ server.... syntax, this no longer works now.

@jnweiger
Copy link
Contributor

jnweiger commented Oct 8, 2014

Speed of owncloudcmd is affected by the rate limiting from the gui client. There should be a command line setting to override this.

@danimo
Copy link
Contributor Author

danimo commented Oct 9, 2014

@jnweiger can you make that a separate issue? otherwise we'll never end this one.

@jnweiger
Copy link
Contributor

done. #2294

@danimo
Copy link
Contributor Author

danimo commented Oct 10, 2014

version is now reported via --version. This ticket is done.

danimo pushed a commit that referenced this issue Oct 10, 2014
@dragotin
Copy link
Contributor

...and it was tested by @jnweiger so we can close this.

@jnweiger
Copy link
Contributor

Wait, I need to re-test that post beta3.

@jnweiger jnweiger reopened this Oct 10, 2014
@jnweiger
Copy link
Contributor

owncloud-client-1.7.0~nightly20141009-5.1.x86_64

<
I am afraid the one important commit is not yet there....

compiled commit 77d2cba:

$ mkdir build; cd build; cmake ..; make
$ ./bin/owncloudcmd -u admin -p admin  /tmp/syncdir http://admin:[email protected]/stable7/owncloud 

no longer prompts for a password. Fine.
But it only syncs down the directory structure. No files created. Typical messages say:

 void Mirall::SyncEngine::slotJobCompleted(const Mirall::SyncFileItem&) "photos/squirrel.jpg" 2 "Error downloading http://admin:[email protected]/stable7/owncloud/remote.php/webdav/remote.php/webdav/photos/squirrel.jpg - server replied: Not Found" 

The repeated remote.php/webdav/remote.php/webdav does not look good to me.

@danimo
Copy link
Contributor Author

danimo commented Oct 10, 2014

@jnweiger the password issue is fixed now, I'm looking into the other issue.

dragotin pushed a commit that referenced this issue Oct 11, 2014
@dragotin
Copy link
Contributor

@jnweiger it should work again.

@jnweiger
Copy link
Contributor

@dragotin it does not. I see no change. Sorry. Please try

git checkout 1.7
git pull
git log
commit 8eaeba6486a30dbbbe474e6425b488ec7d8aa3a1
...
rm -rf build; mkdir build; cd build
cmake ..; make
bin/owncloudcmd -u admin -p admin /tmp/syncdir https://daily.owncloud.com/stable7/owncloud

And watch out for
void Mirall::SyncEngine::slotJobCompleted(const Mirall::SyncFileItem&) "photos/san francisco.jpg" 2 "Error downloading https://admin:[email protected]/stable7/owncloud/remote.php/webdav/remote.php/webdav/photos/san%20francisco.jpg - server replied: Not Found"
Transaction Start "All Finished."

@dragotin
Copy link
Contributor

yes, sorry. I will investigate.

@dragotin
Copy link
Contributor

@jnweiger now we're there, commit d491663 fixes it.

@jnweiger
Copy link
Contributor

PR #2307 for basic functionality of the --version option.
netrc, -u/-p, and user:pass@ syntax works. We are getting there :-)

@luciamaestro luciamaestro removed ReadyToTest QA, please validate the fix/enhancement 2 - Testing labels Nov 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-high Escalation, on top of current planning, release blocker
Projects
None yet
Development

No branches or pull requests

5 participants