Commit graph

327 commits

Author SHA1 Message Date
Sitaram Chamarty 8a4bb453a0 document that @all doesnt work as expected in deny rules
@all in a deny rule doesnt work as it might look in the config file,
because @all rights are checked last.  This is fine if you dont have any
DENYs (and so rule order doesn't matter), but with DENY it causes some
problems.

I never bothered to document it because I did not expect that any repo
that is "serious" enough to have deny rules *at all* should then allow
*any* kind of "write* access to @all.  That's a very big contradiction
in terms of paranoia!

Translation: this will not be supported.  Don't bother asking.  You know
who you are :)
2009-12-05 14:57:21 +05:30
Sitaram Chamarty e6da853082 auth, compile, pm: good bit of refactoring
all of this is prep for the upcoming, all-new, chrome-plated,
"wildrepos" branch :)

  - many variables go to gitolite.pm now, and are "our"d into the other
    files as needed
  - new functions parse_acl, report_basic to replace inlined code
2009-12-05 14:14:37 +05:30
Sitaram Chamarty c3dbdae134 easy install tail message was apparently too confusing 2009-12-02 11:49:58 +05:30
Sitaram Chamarty a283b8ad49 compile: kill preceding space when killing comments
consider:

    repo = "some desc" # some comment

(and note that the regex for recognising a description expects that
dblquote to be the *last* character on the line)
2009-12-01 22:13:13 +05:30
Sitaram Chamarty e7e6085351 compile: fix description and export-ok problem
part of comment on b78a720cee:
    The only reason it's getting into master is because it looks cool!

I hate it when something that looks cool doesn't work right :(

creating a repo on gitolite-admin push is *needed* in order to get
descriptions and export-ok files to work right
2009-12-01 21:54:23 +05:30
Sitaram Chamarty d71720d050 fold rebel into master :) [please read]
Well, something even more outrageous than deny rules and path-based
limits came along, so I decided that "rebel" was actually quite
"conformist" in comparision ;-)

Jokes apart, the fact is that the access control rules, even when using
deny rules and path-limits, are still *auditable*.  Which means it is
good enough for "corporate use".

[The stuff that I'm working on now takes away the auditability aspect --
individual users can "own" repos, create rules for themselves, etc.

So let's just say that is the basis of distinguishing "master" now.]
2009-12-01 07:15:05 +05:30
Sitaram Chamarty 498e62c2f3 update hook: allow multiple "refs" to be checked 2009-12-01 05:55:59 +05:30
Sitaram Chamarty e922dfb939 compile: allow PATH/foo and populate the hash correctly 2009-12-01 05:55:59 +05:30
Sitaram Chamarty 601eaf8ea1 tips doc: add pointer to later section on excludes 2009-12-01 05:55:59 +05:30
Sitaram Chamarty 604669ca02 rebel edition -- cos when you need it, you need it bad :-)
Summary: much as I did not want to use "excludes", I guess if we don't put the
code in "master" it's OK to at least *write* (and test) the code!

See the example config file for how to use it.

See "design choices" section in the "faq, tips, etc" document for how it
works.
2009-12-01 05:55:58 +05:30
Sitaram Chamarty bfc3b6cd58 example conf: clarify group name parsing 2009-11-30 07:00:31 +05:30
Sitaram Chamarty 81911b77cc new repo autovivified now
Merge branch 'pu'
2009-11-28 17:42:55 +05:30
Sitaram Chamarty 6576e82e33 easy install: needs a minor fix to accommodate auto-vivification 2009-11-27 23:57:03 +05:30
Sitaram Chamarty b78a720cee auth/compile: auto-vivify is default now, so:
the "create a new repo" code moves from compile to auth.

Only someone who has W access can create it, but he can do so even on a
"R" operation (like clone or ls-remote).

This is a pre-requisite for rebel's wildcard repos, where
autovivification is the only way you can create arbitrary repos matching
a pattern.

The only reason it's getting into master is because it looks cool!

----

OK that's a lie; the real reason is to keep the two branches as similar
as possible, though they;ve diverged quite a bit since the "only
one-line difference" days where "rebel" just meant "deny/exclude"
rules!)
2009-11-27 23:06:48 +05:30
Sitaram Chamarty c3b5e3b1af compile, pm: factor out new repo creation
...also wrap_chdir, wrap_open, $ABRT, and $WARN
2009-11-27 23:06:47 +05:30
Sitaram Chamarty 5696b13f62 Merge branch 'gitweb-owner' 2009-11-27 13:52:34 +05:30
Sitaram Chamarty d8cb62934f docs: document how to specify "owner" for gitweb 2009-11-27 13:47:33 +05:30
Sitaram Chamarty d2a053ba3c compile: add owner field in the same line as the gitweb descriptions
this goes into the project list
2009-11-27 13:23:48 +05:30
Sitaram Chamarty 6e0855eb4d compile: gitweb/daemon writes are unconditional now
writing the export_ok files and the gitweb project list are now
unconditional.  They're idempotent anyway, and I doubt anyone cared
about all the fancy logic to detect and report *just* the new ones on
each compile.

This paves the way for gitweb ownership to be added later; that code was
becoming too complex otherwise...
2009-11-26 19:30:40 +05:30
Sitaram Chamarty a02a48e8f5 easy install: dont allow root, plus warn about shell access using the given key
- refuse to install to root
  - when a pubkey is being used that was not freshly created by
    ourselves, warn the user that this key can not be used to get shell
    access to the server.  Prevents some corner cases of people being
    locked out...

Also, change the final message to be even more clear that this is all on
the workstation, not the server
2009-11-26 12:13:42 +05:30
Sitaram Chamarty 9a85f5d0d6 auth: print permissions for @all also
I don't have a use for "@all" at all (pun not intended!) other than the
"testing" repo, but <teemu dot matilainen at iki dot fi> sent in a patch
to mark those repos with "R" and "W" in the permissions list, and I
started thinking about it.

This could actually be useful if we *differentiated* such access from
normal (explicit username) access.  From the "corporate environment"
angle, it would be nice if a project manager could quickly check if any
of his projects have erroneously been made accessible by @all.

So what we do now is print "@" in the corresponding column if "@all" has
the corresponding access.

Also, when someone has access both as himself *and* via @all, we print
the "@"; printing the "R" or "W" would hide the "@", and wouldn't
correctly satisfy the use case described above.
2009-11-25 09:15:36 +05:30
Sitaram Chamarty 1c786d880a doc/3: $repo_base -> $projectroot; honor @all in perm check
- it appears that what we call $repo_base, gitweb already needs as
    $projectroot
  - allow read of repos defined as readable by @all

plus some minor declaration changes to make the sample code work as is

(thanks to teemu dot matilainen at iki dot fi)
2009-11-25 08:46:21 +05:30
Sitaram Chamarty ad6d46fab9 easy install: when the first install doesn't go right...
We detect an upgrade situation by the presence of
$GL_ADMINDIR/conf/gitolite.conf -- if it exists, we reason, this is not
a fresh install.  And if so we skip setting up PTA, and the initial
clone.

Well, turns out this is not always true.  I've had a few cases where the
first install didn't go right, but left enough stuff in to make the
subsequent attempt think this is an upgrade.

[This mostly happened to me when I was testing the "oldgits" branch, and
also when I was making it work from msysgit I think... regardless of
why, it'd be good to fix]

So this changes the flow somewhat.  Now the *only* difference between a
fresh install and an ugrade is the "initial_conf_key" function call (you
don't want to overwrite an existing conf file or keydir!)
2009-11-24 09:16:29 +05:30
Sitaram Chamarty de2e38c372 minor doc/message updates/clarifications 2009-11-24 09:16:29 +05:30
Sitaram Chamarty 516c028b81 compile: (oopsies...) plug security hole in delegation feature
I was trying to determine how close gitolite can come to the ACL model
of a proprietary product called codebeamer, and one of the items was how
to make a "role" (like QA_Lead) have different "members" in different
projects.

I then realised delegation already does that!  Which is great, but as I
thought about it more, I realised...  well, we'll let the in-code
comments speak for themselves :-)

Anyway, all it needed was a 1-line fix, luckily... <phew>  And it would
have only affected people who use delegation.
2009-11-23 22:45:00 +05:30
Sitaram Chamarty cba66c6e5a compile: make compiled config be key-sorted
makes debugging access changes much easier

(doh!  why didn't I do this earlier!)
2009-11-23 18:04:18 +05:30
Sitaram Chamarty d332b1537d serverside install/ga-hook: solaris compat 2009-11-19 17:40:46 +05:30
Sitaram Chamarty 23be2b6240 easy install (+doc): make it run from msys. Here's how:
- all $HOME/blah becomes "$HOME/blah" (bl**dy "Documents and Settings" crap)
  - replace bash regex with perl, and in one case replace the check with
    something else
  - rsync changed to appropriate scp
  - since we no longer insist on running from a specific directory, create
    tmpgli dir *after* you cd to the right place
2009-11-19 17:39:14 +05:30
Sitaram Chamarty 0bdf1f360f all src/ and conf/: force crlf=input via gitattributes
msysgit needs this on the initial clone, so it has to be on master.  It
doesn't seem to "apply" the gitattributes if you checkout a different branch
later that has that setting; didn't investigate why
2009-11-18 15:40:37 +05:30
Sitaram Chamarty c727d68caa install doc: server and client requirements spelled out 2009-11-18 15:40:37 +05:30
Sitaram Chamarty 05a06a2c75 README, doc/3: gitweb "description" feature 2009-11-18 07:18:05 +05:30
Sitaram Chamarty e8270e9b72 update hook: 'sub check_ref' to prepare for rebel+
factor out the code to check $ref into a sub; will help rebel+, which
wants (horrors!) to restrict based on PATH names too!
2009-11-17 09:21:45 +05:30
Sitaram Chamarty c54d3eabbc all src: (please read full commit message): allow local admin-defined hooks
You can now add your own hooks into src/hooks/ and they get propagated
along with the update hook that is present there now.  Please read the
new section in the admin document, and make sure you understand the
security implications of accidentally fiddling with the "update" script.

This also prompted a major rename spree of all the files to be
consistent, etc.  Plus people said that the .sh and .pl suffixes should
be avoided (and I was feeling the same way).  I've also been
inconsistent with that "gl-" prefix, so I cleaned that up, and the 00-
and 99- were also funny animals.

Time to get all this cleaned up before we get 1.0 :)

So these are the changes, in case you're looking at just the commit
message and not the diffstat:

    src/pta-hook.sh -> src/ga-post-update-hook
    src/conf-convert.pl -> src/gl-conf-convert
    src/00-easy-install.sh -> src/gl-easy-install
    src/99-emergency-addkey.sh -> src/gl-emergency-addkey
    src/install.pl -> src/gl-install
    src/update-hook.pl -> src/hooks/update
2009-11-13 18:37:46 +05:30
Sitaram Chamarty 3838be2b50 Merge branch 'gitweb-descriptions' 2009-11-13 13:45:47 +05:30
Sitaram Chamarty 448c0d37ba compile: writing description file should be conditional 2009-11-12 20:45:49 +05:30
Sitaram Chamarty 012d4b1fb6 example conf: total reformat/refactor, include gitweb description 2009-11-12 18:54:22 +05:30
Sitaram Chamarty 76520693a3 doc/2: add docs for gitweb description, plus some minor cleanup 2009-11-12 18:54:16 +05:30
Sitaram Chamarty e81264d100 compile: added repo descriptions
example line in config file:

gitolite = "fast, secure, access control for git in a corporate environment"
2009-11-12 14:49:39 +05:30
Sitaram Chamarty be972d04d0 doc/6: added two keys explanation and workaround 2009-11-12 10:28:23 +05:30
Sitaram Chamarty 4d9c064a7a new program for emergency addkey; run without args for usage 2009-11-07 10:47:20 +05:30
Sitaram Chamarty c4069dd85f (please read full commit message) upgrade behaviour changed
**upgrades no longer touch the config or the keydir**

When you first install gitolite, the easy install script has to do two
*distinct* things:

  * install the software
  * create and seed the gitolite-admin repo with a minimum config file
    and the newly created pubkey

That's fine for an install, because nothing exists yet anyway.

Subsequent invocations of the script should only do the first task (so
that gitolite itself can be upgraded), and not attempt to fiddle with
the config file and pubkeys.

Unfortunately, until now I had not been separating these two activities
cleanly enough.  For instance, the commit message for 8e47e01 said:

    IMPORTANT: we assume that $admin_name remains the same in an upgrade
    -- that's how we detect it is an upgrade!  Change that name or his
    pubkey, and you're toast!

Ouch!

So now I decided to clean things up.  The "Usage" message tells you
clearly what to do for an upgrade.

Should have been like this from the beginning, but hey we got there
eventually :)

----

Code-wise, this is a major refactor of the easy install script.  It uses
an old forgotten trick to get forward refs for bash functions ;-) and in
the process cleans up the flow quite a bit.
2009-11-06 15:37:03 +05:30
Sitaram Chamarty 130478ed93 easy install: handle upgrades specially
- "it's an upgrade" is decided by presence of gitolite.conf (not a pubkey)
  - admin_name optional (and will be ignored if given) for upgrades

plus a lot of comments and some minor text changes
2009-11-06 12:36:40 +05:30
Sitaram Chamarty 31fd24a76c compile: death should be a little louder and clearer :) 2009-11-05 23:13:39 +05:30
Sitaram Chamarty 8aecaa2da2 doc/6: rename the file, change focus completely 2009-11-05 23:13:39 +05:30
Sitaram Chamarty 33305ed8e7 doc/1: fix formatting problem on github
(local mkd worked fine... weird!)
2009-11-05 23:13:38 +05:30
Sitaram Chamarty 92d5062ad0 doc/src: major doc/help text revamp
also removed some dead code from compile (pre PTA days)
2009-10-31 00:21:37 +05:30
Sitaram Chamarty 5108aedd48 Merge branch 'gh-issue-2' into pu 2009-10-30 18:02:32 +05:30
Sitaram Chamarty 7907213316 easy install: clean up after yourself :) 2009-10-30 17:43:26 +05:30
Sitaram Chamarty b94ff910d1 doc/6: explain that all this is *only* for the admin 2009-10-30 17:42:26 +05:30
Sitaram Chamarty 26b4992162 compile: (gh issue 2) apparently pubkeys don't always end in a newline
I've never encountered this but it's an easy fix
2009-10-30 10:39:05 +05:30