Commit graph

421 commits

Author SHA1 Message Date
Sitaram Chamarty 5858ecb56e puppet wants to send in keys with comment lines 2011-11-08 12:05:44 +05:30
Sitaram Chamarty f0cedeb04f gl-system-install now tries to catch PATH issues for gl-setup
any sane system should have $HOME/bin in $PATH, but apparently there are
quite a few insane systems around ;-)

(also changes the usage message etc a bit)
2011-10-21 17:18:38 +05:30
Sitaram Chamarty 7682543385 silently disable URI escaping if CGI::Util is not found
e5c3b0e on a machine without CGI::Util makes gitolite unusable.  I
checked that it was part of perl core, since `corelist CGI::Util`
returns `CGI::Util was first released with perl 5.006001`.

But apparently Fedora (at least) splits out core perl itself into
smaller chunks.  And on my devbox I never noticed because I had gitweb
installed, which pulled it in as a dep.

I found this out when I tried to upgrade my own prod server!
2011-10-21 11:59:58 +05:30
Sitaram Chamarty 5a125fac96 It's official now; Solaris sh is brain dead...
For example, this program

    #!/bin/sh

    die() { echo die called with $1; exit 1; } >&2

    die foo
    die bar

will print *both* those messages!

I honestly don't care if this is posix or not, but it is BRAIN DEAD for
the ">&2" to change the meaning from {} to ()

Oh and the grep thing is even worse.

    echo foo | grep ^/

works fine in an interactive shell but in a script it attempts to
*execute* "/", complains, while simultaneously complaining about usage
of grep.

It's almost like it's treating ^ like |
2011-10-20 16:39:18 +05:30
Sitaram Chamarty c553e393c3 make all the DENIED messages consistent
how did I not notice this before?
2011-10-18 08:03:05 +05:30
Sitaram Chamarty 85da5572b2 some nice ADC changes... (warning: minor backward compat breakage)
- support for ADCs with unchecked arguments
  - rsync, htpasswd, and svnserve gone from core; turned into ADCs

Backward compat breakage and fix: Please see documentation for details,
but if you're using gitolite to control rsync you will now need to setup
ADCs (admin defined commands), and install at least the new "rsync" ADC.

----

Thanks to Joey Hess (see commit prior to this) for forcing me to stop
being lazy and get this out of my long term todo list.
2011-10-17 18:42:57 +05:30
Sitaram Chamarty fd0e229054 some more bashisms fixed... 2011-10-16 17:32:30 +05:30
Sitaram Chamarty 09f57beea6 (next round of minor changes) 2011-10-10 14:21:38 +05:30
Sitaram Chamarty 5e3a051a95 "deny" rules for entire repo
- strictly speaking, this should be phrased: "deny" rules for the
    first level access check

  - requires a gitolite option to be set, like so:

        config gitolite-options.deny-repo = 1
2011-10-10 14:18:49 +05:30
Sitaram Chamarty a1270ba778 allow defining and checking 'config gitolite-options.foo = bar' type keys 2011-10-07 19:27:28 +05:30
Sitaram Chamarty 77f0b2da0e the rarely-useful "@all users can access @all repos" thing... 2011-10-07 13:53:10 +05:30
Svend Sorensen 696bffe605 Use sed instead of bashism (pattern substitution) in gl-mirror-push
gl-mirror-push fails with dash as /bin/sh due to the use of bash pattern
substition (${parameter/pattern/string}). Use sed instead.
2011-10-06 21:09:55 +05:30
Sitaram Chamarty eabbffb564 mirroring log entries need the *date* also in the timestamp!
(Not sure how I missed this earlier, but if you can't upgrade yet, a
mitigation is to note the job number that gets printed on your terminal
when a mirror push starts, and look a log file entries beginning with
that number.)
2011-10-06 21:09:55 +05:30
Sitaram Chamarty de9ece4735 (minor) error message clarity in mirror-push 2011-10-06 21:09:55 +05:30
Sitaram Chamarty 70010ba56e put single quotes around bad user/repo names etc 2011-10-06 21:09:55 +05:30
Sitaram Chamarty e5c3b0e5dc (projects.list changes) allow escaping the names...
requires setting GITWEB_URI_ESCAPE in the rc file
2011-10-06 19:55:46 +05:30
Sitaram Chamarty 22bd3c8e72 (projects.list changes) collect gitweb-specific stuff in one place
also
  - new "WEB_INTERFACE" variable (defaults to 'gitweb')
  - setup_web_access (write a plain list of repos out)
  - add_del_web_access (add/delete a single repo from projects.list)
2011-10-06 19:32:09 +05:30
Sitaram Chamarty 550982f69e I forgot I still have Solaris users...
change some obvious bashisms.  There may be more, however, so if you
find them, let me know.
2011-10-04 13:31:44 +05:30
Sitaram Chamarty 909bc43e70 don't allow newlines in ssh command
(again, thanks to Dan Carpenter for catching this)
2011-10-01 15:19:50 +05:30
Sitaram Chamarty a07e0d6b5c tighten up ref/file names (warning: possible backward compat breakage)
The backward compat breakage is for people who already have all kinds of
arbitrary characters in filenames *and* use `NAME/` rules.  See the doc
change in this commit for details and mitigation.  See this link for
background:

    http://groups.google.com/group/gitolite/browse_thread/thread/8dc5242052b16d0f

Thanks to Dan Carpenter for the audit.
2011-10-01 15:19:50 +05:30
Sitaram Chamarty 2056c95917 from-client (gl-easy-install) is now obsolete 2011-09-29 07:31:43 +05:30
Sitaram Chamarty a6668b90c3 (minor) error message clarity...
'should not happen' was appropriate before I added --dirty, but now it's
more likely to be due to an old git version
2011-09-28 04:12:36 +05:30
Sitaram Chamarty 63f18a5adf fix a rather large typo/thinko in 1006eba
If you look at this change, and the same lines in 1006eba, you can
easily see what I missed...
2011-09-10 19:46:37 +05:30
Sitaram Chamarty fcb41f06f0 new program gl-dryrun; run without arguments for usage/WARNINGS 2011-09-10 11:41:51 +05:30
Sitaram Chamarty d2c10e87d8 (minor) change to version reporting 2011-09-10 11:08:54 +05:30
Sitaram Chamarty 37584908eb sshkeys-lint upgraded (may need testing)
upgraded to recognise host (mirroring peer) keys and shell keys
2011-09-03 07:50:13 +05:30
Sitaram Chamarty e3bc6e7c48 lotsa doca fixa uppa
major changes
  - (src) one error message got more detail
  - long overdue fixup to developer notes doc

plus many minor changes that have been piling up

PS: to dig into the "alliterative animal" comment, check the channel
logs around aug 23rd ;-)
2011-09-03 07:50:13 +05:30
Behan Webster 330bed0dcf Rewrite of gl-conf-convert to support more complex gitosis.conf files
comments from contributor via email:

  * Translates all repos from gitosis to gitolite, even if their are not
    associated with any groups
  * Transfers gitweb settings (gitweb, description and owner)
  * Transfers git-dameon settings
  * Maintains comments for groups and repos

  As far as I can tell, the results from this filter are working fine
  for our transfer from gitosis to gitolite.
2011-09-02 22:41:27 +05:30
Sitaram Chamarty 6a3cd5d6b1 Merge pull request #32 from ebfe/bump_requirements
git >= 1.6.6 is required since 49f5361
2011-09-02 05:09:06 -07:00
Sitaram Chamarty 6863dca73a retain old file's permissions in wrap_print()
wrap_print() was written to create a new file and rename the old one to
avoid a partially written file being read by other processes.  This has
only been reported for the 'projects.list' file, but I just did it for
all files as a matter of course.

list of files currently written via this function:
gl-creater, gl-perms, description, git-daemon-export-ok, projects.list

However, some people want to do the following:

  - set REPO_UMASK tight (0077, default)
  - manually change the perms to something looser (typically g+rX) for
    specific repos
  - set core.sharedRepository to 0750 (git is documented to honor that
    config if available and to override umask)

Except that core.sharedRepository does not apply to files written by
gitolite and not git itself.  So they would open up their description
files and the next compile would close them again!

This patch prevents this from happening.  If the file already exists, it
maintains the same permissions after the rename.
2011-09-02 16:45:27 +05:30
Sitaram Chamarty e139be927a new 'subconf' feature to explicitly do delegation
(includes HOSTNAME substitution feature also...)
2011-08-30 20:50:34 +05:30
Sitaram Chamarty 0ec3d77761 delegation: allow includes in fragments, fixup doc
I could not think why we disallowed includes in subconfs, since an
include is the same as inserting all those lines inline anyway.
2011-08-30 11:42:03 +05:30
Sitaram Chamarty d01f6b1dbb config variables should not be restricted to double quoted strings
previously, these two would produce different results

    config aa.bb = 'true'   # config file line includes single quotes
    config aa.bb = "true"   # config file line does not include any quotes

Now the former will also behave like the latter.
2011-08-29 14:20:34 +05:30
Sitaram Chamarty 2eee4d627a Merge 'mirroring-revamp' into pu 2011-08-29 13:57:38 +05:30
Sitaram Chamarty 52cb3e1b8d gl-setup-authkeys had an obsolete usage message 2011-08-26 07:10:56 +05:30
Michael Gehring d4570cc340 git >= 1.6.6 is required since 49f5361 2011-08-25 15:35:29 +02:00
Sitaram Chamarty e970327cc1 rc: get rid of GL_GITCONFIG_WILD
was only for efficiency even when it was relevant, and now it's just in
the way, making useless noises.
2011-08-17 21:53:06 +05:30
Sitaram Chamarty 056459aeda fix sequencing for repo config statements
Without this, complex mirroring scenarios will be unpredictable.  For
example (abbreviating "gitolite.mirror." to "gimo.") something as simple
as this will not give "foo" his different mirror setup

    repo @all
        config gimo.master = "frodo"
        config gimo.slaves = "sam"

    repo foo
        config gimo.master = "sam"
        config gimo.slaves = "frodo gollum"

    repo foo bar
        RW  =   u1

Even worse things happen when you have wild cards.

Now, however, they all come in the right sequence and the most recent
one takes effect (unlike ACL rules, where the first match wins, because
there you're trying to just find a match and get out, while here you're
just mindlessly applying config lines in the right order).
2011-08-17 21:03:14 +05:30
Sitaram Chamarty 4b9bf222e5 (mirroring) make bg push errors more visible/easier to grep 2011-08-16 14:28:01 +05:30
Sitaram Chamarty fabfcb5c19 default remote command should be 'info' if none given 2011-08-15 07:02:43 +05:30
Sitaram Chamarty ae20d5c6a7 log_it(): GL_USER may be undefined...
with gl-mirror-shell being a command you can just type on the server,
GL_USER may be undefined, so we now avoid those unsightly warnings
2011-08-15 07:02:43 +05:30
Sitaram Chamarty b11d44e036 (mirroring) make cron jobs easier to write
gl-mirror-shell will now take a list of slaves and/or keys, expanding
the keys in place.  See doc for even more improvements and conveniences.
2011-08-15 07:02:42 +05:30
Sitaram Chamarty aa7ff8ac27 (mirroring) some more error checking 2011-08-14 22:22:31 +05:30
Sitaram Chamarty a3ffc9d8fd (mirroring) reject non-local pushes if GL_HOSTNAME not set
We previously said all mirroring features are disabled if GL_HOSTNAME is
not set.

But what if, after mirroring has been setup, and master/slaves defined
for a repo, a slave admin fat-fingers the RC file and accidentally
comments out GL_HOSTNAME?  We might end up violating RULE NUMBER ONE!
2011-08-13 14:32:38 +05:30
Sitaram Chamarty 5143cc890f (new mirroring) enhance gl-tool
...it now does the mirroring peer key setup, unlike the kludgy manual way in the old setup
2011-08-12 22:51:44 +05:30
Sitaram Chamarty 68b45e1616 (new mirroring) bulk of the changes are here:
- post-receive now just calls mirror-push
  - mirror-push is a medium complex shell script (all that backgrounding
    etc., can't be done so easily in God's first language!)
  - mirror-shell is now a perl program that does a few different things
    (receive mirror-pushes, command line re-sync, re-sync requests from a
    slave, etc)
  - auth-command changes to reject/redirect non-native pushes
2011-08-12 22:51:44 +05:30
Sitaram Chamarty 15db108e45 (new mirroring) helpers, hostname, detect use of older RC variables, delete mirror-sync 2011-08-12 22:51:44 +05:30
Sitaram Chamarty b70cf05b43 (minor) allow a comma in regex pattern for wild repos
This was an oversight.  We already allow { and } anyway...
2011-08-12 21:45:23 +05:30
Sitaram Chamarty 0b68365860 fix accumulation of 'config' (git config) lines
If a repo matches multiple patterns, 'config' lines were being picked up
only from one of the 'repo' paras, instead of from all applicable ones.
2011-08-08 09:47:56 +05:30
Sitaram Chamarty 66f2065098 deal with a perl 5.14 deprecation on qw()
Apparently 5.14 deprecates using qw() as parentheses

(thanks to Benjamin Severs)
2011-08-04 22:01:13 +05:30