Re: [fossil-users] Automating a clone - any other way than the URL to pass in password?

2014-07-06 Thread Stephan Beal
On Sat, Jul 5, 2014 at 7:19 PM, Matt Welland estifo...@gmail.com wrote:

 I'd also like to automatically say Y to the question of storing the
 password and I don't see any way to do that either.


For apps which take their input from stdin (like fossil) it's normally
possibly to do that like:

echo Y | ... the app

or:

yes | the app

The first one seems to work for me:

[odroid@host:~/tmp]$ echo Y | fossil clone
http://xxx...@fossil.wanderinghorse.net/repos/cwal/index.cgi foo.fsl
Round-trips: 2   Artifacts sent: 0  received: 5055
Clone finished with 600 bytes sent, 4324286 bytes received
...


-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do. -- Bigby Wolf
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Automating a clone - any other way than the URL to pass in password?

2014-07-06 Thread j. van den hoff
On Sat, 05 Jul 2014 19:19:54 +0200, Matt Welland estifo...@gmail.com  
wrote:


I'd like to automate a clone but I think I'd prefer the password not be  
in

the URL. The concern is that the password in the URL might be visible in
the webserver logs.

First, is this a legit concern? Second, how best to do this? AFAICT there
is no switch for fossil to take the password in on stdin.

I'd also like to automatically say Y to the question of storing the
password and I don't see any way to do that either.


something like this shell script

#---
#!/usr/bin/env expect

set timeout 60
spawn  fossil clone https://user@url_of_repo myclone.fossil

while 1 {
   expect {
  {password for}  {send password_goes_here\r}
  {remember password} {send y\r}
  eof {break}
   }
}
#---

should work (provided you have `expect' installed and provided the file  
`myclone.fossil' does not yet exist)
although you still would have to put the password in clear text in the  
script (which hardly is desirable...).
I only tested it with a small repo on a fast connection. no idea whether  
the chosen timeout value is always sufficient.


j.

ps: question to ML: it seems that doing the above via a shell here  
document (just redirecting user input to the `fossil clone' queries
to the script via `EOF' and putting password and `Y' on the next lines)  
is not recognized by fossil. why not?







--
Using Opera's revolutionary email client: http://www.opera.com/mail/
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Automating a clone - any other way than the URL to pass in password?

2014-07-06 Thread Stephan Beal
On Sun, Jul 6, 2014 at 12:05 PM, j. van den hoff veedeeh...@googlemail.com
wrote:

 ps: question to ML: it seems that doing the above via a shell here
 document (just redirecting user input to the `fossil clone' queries
 to the script via `EOF' and putting password and `Y' on the next lines)
 is not recognized by fossil. why not?


Looking at the code (getpass() in user.c)... i'm not sure. It uses
getc(stdin) to reach char by char, but doesn't seem to do anything unusual
with the stream. Ah... that's the Windows/Android impl. On unix it uses
getpass(3) (unistd.h), which might do something weird to prohibit piping in
input.

NAME
   getpass - get a password

SYNOPSIS
   #include unistd.h

   char *getpass( const char *prompt);
...
DESCRIPTION
   This  function  is  obsolete.   Do not use it.  If you want to read
input without terminal echoing enabled, see the
   description of the ECHO flag in termios(3).


-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do. -- Bigby Wolf
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Automating a clone - any other way than the URL to pass in password?

2014-07-06 Thread Ron Wilson
On Sun, Jul 6, 2014 at 6:12 AM, Stephan Beal sgb...@googlemail.com wrote:

 Looking at the code (getpass() in user.c)... i'm not sure. It uses
 getc(stdin) to reach char by char, but doesn't seem to do anything unusual
 with the stream. Ah... that's the Windows/Android impl. On unix it uses
 getpass(3) (unistd.h), which might do something weird to prohibit piping in
 input.


As I recall, getpass(3) opens its own file descriptor to the controlling
terminal, configures it with some reasonable, non-echo settings, then
reads the user's password.

Expect gets around this by using a pseudo terminal. the child side of the
fork assigns the slave side of the pseudo terminal to STDIN, STDOUT and
STDERR, then execs the command (or the shell to run the command). Then
expect monitors and controls the command via the control side of the pseudo
terminal.

FYI, xterm (and other Unix/Linux/etc command line windows) work the same
way.
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] artifacts received

2014-07-06 Thread Ron Wilson
On Sun, Jul 6, 2014 at 3:54 AM, Stephan Beal sgb...@googlemail.com wrote:


 Can't answer, but i see it only with 'pull', not with 'update'.

 [odroid@host:~/fossil/fossil]$ f pull
 Pull from http://step...@fossil-scm.org/index.html
 Round-trips: 1   Artifacts sent: 0  received: 74
 Pull finished with 453 bytes sent, 2644 bytes received

 [odroid@host:~/fossil/fossil]$ f up
 Autosync:  http://step...@fossil-scm.org/index.html
 Round-trips: 1   Artifacts sent: 0  received: 0
 Pull finished with 438 bytes sent, 612 bytes received


Maybe there was nothing left for update to pull?
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Automating a clone - any other way than the URL to pass in password?

2014-07-06 Thread Matt Welland
Thanks for the replies.

On Linux I'll just use the url password and do:

echo y|fossil clone 

I'm sure Google knows the equivalent magic invocation for windows.
 On Jul 5, 2014 10:19 AM, Matt Welland estifo...@gmail.com wrote:

 I'd like to automate a clone but I think I'd prefer the password not be in
 the URL. The concern is that the password in the URL might be visible in
 the webserver logs.

 First, is this a legit concern? Second, how best to do this? AFAICT there
 is no switch for fossil to take the password in on stdin.

 I'd also like to automatically say Y to the question of storing the
 password and I don't see any way to do that either.

 --
 Matt
 -=-
 90% of the nations wealth is held by 2% of the people. Bummer to be in the
 majority...

___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] remote-url of repo points to itself somehow (did I do this?)

2014-07-06 Thread Michai Ramakers
On 22 June 2014 01:18, Michai Ramakers m.ramak...@gmail.com wrote:
 Hello,

 a pretty vague report/question: I recently had the situation where a
 repo existed on host B, wich remote-url pointing to a repo on host A.

 On host A, somehow the remote-url of the local repo was pointing
 (using 'file:///...') to itself, causing sync to fail. This is no
 surprise really.

 I can't remember having set the remote-url to itself; can anyone
 imagine a workflow where this might have been set? I tried for a
 little while to reproduce this, but failed.

actually... it happened again, and the reason was simply me
forgetting the '-R' option for 'remote-url': e.g. typing fossil
remote-url /the/local/repo.fossil instead of fossil remote-url -R
/the/local/repo.fossil. That will set a remote-url of the form
'file:///'.

I think I have a reasonable feel for what is, should be, and should
not be implemented w.r.t. fool-proofness in fossil by now; I am
guessing the above is too silly to implement a check for. Or not?

Michai
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] artifacts received

2014-07-06 Thread B Harder
myhost$ fossil pull
Pull from http://joeb...@fossil-scm.org
Round-trips: 1   Artifacts sent: 0  received: 74
Pull finished with 439 bytes sent, 2645 bytes received
myhost$ fossil pull http://joeb...@fossil-scm.org --http-trace
Round-trips: 1   Artifacts sent: 0  received: 0
Pull finished with 425 bytes sent, 612 bytes received
myhost$ fossil pull
Pull from http://joeb...@fossil-scm.org
Round-trips: 1   Artifacts sent: 0  received: 74
Pull finished with 441 bytes sent, 2645 bytes received
myhost$ fossil pull
Pull from http://joeb...@fossil-scm.org
Round-trips: 1   Artifacts sent: 0  received: 74
Pull finished with 440 bytes sent, 2645 bytes received
myhost$ fossil pull
Pull from http://joeb...@fossil-scm.org
Round-trips: 1   Artifacts sent: 0  received: 74
Pull finished with 442 bytes sent, 2645 bytes received
myhost$ fossil pull http://joeb...@fossil-scm.org --http-trace
Round-trips: 1   Artifacts sent: 0  received: 0
Pull finished with 424 bytes sent, 612 bytes received



On 7/6/14, Ron Wilson ronw.m...@gmail.com wrote:
 On Sun, Jul 6, 2014 at 3:54 AM, Stephan Beal sgb...@googlemail.com wrote:


 Can't answer, but i see it only with 'pull', not with 'update'.

 [odroid@host:~/fossil/fossil]$ f pull
 Pull from http://step...@fossil-scm.org/index.html
 Round-trips: 1   Artifacts sent: 0  received: 74
 Pull finished with 453 bytes sent, 2644 bytes received

 [odroid@host:~/fossil/fossil]$ f up
 Autosync:  http://step...@fossil-scm.org/index.html
 Round-trips: 1   Artifacts sent: 0  received: 0
 Pull finished with 438 bytes sent, 612 bytes received


 Maybe there was nothing left for update to pull?

___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] artifacts received

2014-07-06 Thread Andy Bradford
Thus said B Harder on Sun, 06 Jul 2014 14:40:58 -0700:

 myhost$ fossil pull
 Pull from http://joeb...@fossil-scm.org
 Round-trips: 1   Artifacts sent: 0  received: 74
 Pull finished with 442 bytes sent, 2645 bytes received
 myhost$ fossil pull http://joeb...@fossil-scm.org --http-trace
 Round-trips: 1   Artifacts sent: 0  received: 0
 Pull finished with 424 bytes sent, 612 bytes received

Foiled!  If you  ever happen  to  get it  to receive  74 artifacts  with
--http-trace,  there  will be  some  files  named http-request*.txt  and
http-reply*.txt that will be useful to show us what was received.

The other alternative is a debugger.

Andy
-- 
TAI64 timestamp: 400053b9c913


___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] artifacts received

2014-07-06 Thread Andy Bradford
Thus said B Harder on Sun, 06 Jul 2014 14:40:58 -0700:

 myhost$ fossil pull http://joeb...@fossil-scm.org --http-trace
 Round-trips: 1   Artifacts sent: 0  received: 0
 Pull finished with 424 bytes sent, 612 bytes received

It seems that I gave you the wrong option. Please try:

fossil pull --httptrace

Andy
-- 
TAI64 timestamp: 400053b9c98a


___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users