Commit graph

76 commits

Author SHA1 Message Date
Stephen Palmer d2214b06b5 Fixed bug in lock script
the unlock command was not checking the correct hash key to match
the user name
2012-11-27 08:09:46 +05:30
Sitaram Chamarty 96cc2eaf41 new features relating to creating wild repos:
- new 'create' command for explicit creation
  - new 'AutoCreate' trigger to prevent auto-creation on read operations
    or both read and write operations
  - a few related fixups to the perms command
2012-11-22 20:50:20 +05:30
Sebastian Koslowski 96be9503ef sudo command: CLI fix: 2 non-empty args required 2012-11-22 20:50:20 +05:30
Sitaram Chamarty cd838411fa 'gitolite mirror' needs to set exit code on push failure 2012-11-21 21:16:01 +05:30
Sitaram Chamarty 2018267a45 (minor) fixes to lint program, mainly usage message 2012-11-21 19:55:12 +05:30
Sitaram Chamarty be61cd2d66 make sure gl-perms exists, even if it is empty...
I expect this to help if we optimise the rule generation by caching.
2012-11-06 09:15:55 +05:30
Sitaram Chamarty 3eefc06551 (minor) clarify that D only works on wild repos 2012-10-10 13:43:17 +05:30
Sitaram Chamarty aec8c71890 'help' command barfage fix
should not barf if LOCAL_CODE is defined but it doesn't contain a
"commands" subdirectory.
2012-08-30 18:40:24 +05:30
Nate Jones 31166e1e1c find symlinked commands when generating help list 2012-08-03 13:48:19 -07:00
Sitaram Chamarty f4eb6dcb53 'rsync' command to create and send bundles (manual smoke test only)
run 'ssh git@host rsync -h' for usage, as usual
2012-07-19 14:40:41 +05:30
Sitaram Chamarty 8ad1eee220 migrated 'who-pushed' command (manual smoke test only) 2012-07-17 16:52:56 +05:30
Sitaram Chamarty c9d5a13194 help command learns to deal with LOCAL_CODE 2012-06-19 21:00:53 +05:30
Sitaram Chamarty fbd745958e PRE_ and POST_CREATE triggers get an extra argument...
...when invoked by single-repo operations like auto-creating a wild
repo, or running perms or fork.
2012-06-14 19:22:12 +05:30
Sitaram Chamarty 57f82ee044 new 'list-dangling-repos' command 2012-06-14 19:22:12 +05:30
Sitaram Chamarty 17c41ce63b new 'sudo' command 2012-06-03 14:20:27 +05:30
Sitaram Chamarty 78866f6f28 (experimental code) push wild repos across a master slave connection
It creates the repo on the remote side (getting the creator name from
the gl-creator file and sending it across), as well as sending gl-perms
on subsequent connections.

This has only been minimally tested.  E.g., complex setups or asymmetric
configs on master and slave, etc. have NOT been tested.

This has also not been tested with redirected pushes.
2012-06-01 17:28:14 +05:30
Sitaram Chamarty 42e0bac48c 'perms' command learns to create repo if needed 2012-06-01 16:01:36 +05:30
Sitaram Chamarty 06d3398fb0 lock binary files... (manually tested)
Remember that true locking is not possible in a DVCS; see
doc/locking.mkd for details and limitations of what is offered here.
2012-05-27 19:06:46 +05:30
Sitaram Chamarty 8595303c82 migrated symbolic-ref command 2012-05-27 05:58:43 +05:30
Sitaram Chamarty dd083085cf (fix bugly) info -ld should handle missing description files more gracefully
bugly = bug that makes the output ugly :)
2012-05-23 03:37:52 +05:30
Sitaram Chamarty 2907561529 (minor) solaris doesn't like "shift" when there are no arguments remaining 2012-05-22 13:17:10 +05:30
Sitaram Chamarty e76be7ff11 move repo/user validity check deeper
(but change repo check to allow repoPATT instead of just repoNAME)

This is because there are/will be some situations where access() is
called without those two checks being done (i.e., it is not only from
src/commands/access that it is called).
2012-05-06 19:02:42 +05:30
Sitaram Chamarty 6d057fb84c allow info to print description also 2012-05-04 18:13:42 +05:30
Andreas Stenius 47a0c44540 migrated htpasswd command from g2.
(with some fixups by committer)
2012-05-03 11:04:22 +05:30
Sitaram Chamarty 49d132a969 minor fix to info command output under httpd...
when running under httpd, $ENV{USER} is not set, so we use a (hopefully
informative) default to print.

Thanks to Thomas Hager (duke at sigsegv dot at) for catching this.
2012-05-01 15:06:06 +05:30
Sitaram Chamarty e919a0b7ca solaris doesn't like 'hostname -s'...
(luckily, unlike linux, it doesn't spew a usage message to STDOUT!)
2012-04-28 12:04:51 +05:30
Sitaram Chamarty 198dcfd4c8 POST_CREATE efficiency... (please read below if you care)
The POST_CREATE trigger is called when

  * a user creates a new "wild" repo,
  * a user uses the "perms" command, and
  * a user uses the "fork" command.

The trigger calls 3 programs (see rc file):

    post-compile/update-git-configs
    post-compile/update-gitweb-access-list
    post-compile/update-git-daemon-access-list

(They are also called by the POST_COMPILE trigger, by the way.)

However, the 3 programs shown are a bit wasteful -- they run through
*all* the repos when really only *one* repo has been affected.

This patch

  * passes the repo name to the 3 programs (duh!)

  * adds the optimisation to the first of the 3 programs listed above
    (the one dealing with 'git config').

For the other two programs (gitweb and git-daemon), you have 3 choices:

  * if you don't have too many repos, ignore the problem.

  * take out the 2nd and 3rd lines from the POST_CREATE list in the rc
    file, so they don't run.

    Then run 'gitolite trigger POST_COMPILE' from cron at regular
    intervals.  (Note that is POST_COMPILE not POST_CREATE!)  However,
    this means that gitweb and daemon permissions won't be current
    immediately after someone adds a new repo or sets perms etc.; they
    get updated only on the next cron run.

  * patch the programs to add this optimisation (and send me the
    patches).  The optimisation would check if arg-1 ($1 in shell,
    $ARGV[0] in perl) is 'POST_CREATE', and if it is, take the *next*
    argument as a repo name that may have changed.
2012-04-22 22:44:39 +05:30
Sitaram Chamarty 895b3614ed (minor) add a bit more detail on usage text for 'info' 2012-04-22 22:43:45 +05:30
Sitaram Chamarty c3ec518cef fork command, and some core changes to make it work...
- access command allows checking ^C
  - ^C check will fail when the repo exists
2012-04-22 16:56:21 +05:30
Sitaram Chamarty 1c15b4cc2d (perltidy) 2012-04-18 06:26:53 +05:30
Sitaram Chamarty 581e79d745 logging die and warn messages
- change a few important die()s to _die()s
  - setup SIGs for both die and warn so any others will get caught
2012-04-18 06:23:21 +05:30
Sitaram Chamarty 67327ebfb4 (minor) add svnserve command 2012-04-18 06:23:21 +05:30
Sitaram Chamarty 720729e4b4 (minor) do not run gitolite query-rc from *perl* programs!
I must have blindly converted from some shell-thinking/shell-code for
these to have slipped through!

(found when doing an audit of all system, exec, ``, qx, and tsh_)
2012-04-13 15:35:13 +05:30
Sitaram Chamarty 8c28fd2241 D...
(manually tested, no test script)

the whimsically named "D" command deletes repos, and is the opposite of
the "C" permission that enables the user to create one in the first
place.  See the usage message for user info, and look in the comments of
the code itself for admin info.
2012-04-11 07:06:45 +05:30
Sitaram Chamarty c5e0e929a7 sskm: minimum changes, minimally smoke tested!
(thanks to fabian@hirschm.net for testing more thoroughly as well)
2012-04-10 04:23:57 +05:30
Sitaram Chamarty 48f1e7c781 'gitolite git-config' should print only value when regex not used...
not repo<tab>key<tab>value.  Also, honor '-n' (no newline)
2012-04-08 11:31:04 +05:30
Sitaram Chamarty d3610191d3 supporting DOS and fake Unix...
I was very, very, tempted to say "sorry; not supported".  Sadly,
prudence won over juvenile glee...

PS: DOS == dominant operating system
2012-04-06 21:13:56 +05:30
Sitaram Chamarty 7c6728af89 (some minor changes)
- whitespace change to t/reset
  - remove dbg line accidentally left in in Load.pm
  - add a bit more explanation to 'writable'
2012-04-05 21:31:59 +05:30
Sitaram Chamarty 495390926d added sshkeys-lint as a command 2012-04-03 17:15:13 +05:30
Sitaram Chamarty 35953a5bd3 added 'gitolite push' to make server side pushes easier...
also force the update hook to log SHAs of bypassed pushes
2012-04-03 16:40:06 +05:30
gitolite tester 25bb1c00db mirroring without sausages
(or at least without showing the making of said sausages)
2012-04-02 13:18:30 +05:30
Sitaram Chamarty 906ed4cbe2 logging, tracing, and perltidy, ...
...plus renamed a couple of log events for consistency
2012-03-30 23:07:46 +05:30
Sitaram Chamarty dfb9844dfb info command simplified
(thanks to Eli for the back-and-forth that led to this)
2012-03-30 22:57:06 +05:30
Sitaram Chamarty 5db29062f5 try: info command header enhanced 2012-03-28 15:31:31 +05:30
Sitaram Chamarty 2bec551009 'writes' -> 'writable', order of arguments changed 2012-03-27 19:42:30 +05:30
Sitaram Chamarty 61f6967f67 partial-copy fixed...
...there was one real bug, plus I had forgotten to put a comented out
line in the rc file, but most of the rest of the effort was moving the
test script over.

oh and I'd also forgotten to move this from 'commands' to 'triggers' :-)
2012-03-26 21:27:49 +05:30
Sitaram Chamarty 07cf7fedfe move triggers into their own subdir...
...otherwise 'gitolite help' was getting too confusing, mixing up stuff
that users should not be running directly (even on the server)

----

implementation notes:

those who are worried about the '../triggers/' in various parts of the
code here, remember you can only do that from a command line on the
server.  Remote users can only use commands that have been explicitly
listed in the COMMANDS hash in the rc file.  This means they can't even
access other commands in the same directory as, say, the 'info' command,
so a '../' is definitely not going to work.
2012-03-26 11:02:57 +05:30
Sitaram Chamarty 2139099706 arguments in rc for triggered programs...
...using 'renice' as example and first user

(also had to re-arrange rc file to a more sensible order)
2012-03-25 12:17:37 +05:30
Sitaram Chamarty c14e01d6c0 new 'gitolite print-default-rc' command 2012-03-25 09:19:38 +05:30
Sitaram Chamarty 329d757167 partial-copy: manually spot-tested (i.e., no test in suite). PW. 2012-03-24 10:30:46 +05:30