git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 3/3] daemon: Support a --user-path option.

From
Junio C Hamano <junkio@cox.net>
Date
Feb 4, 2006, 12:40 UTC
Message-ID
<7v8xsrz49e.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<slrndu8utr.2i8.mdw@metalzone.distorted.org.uk>
Mark Wooding <mdw@distorted.org.uk> writes:
Show 6 quoted lines
> This is what I'm after, yes.  The above can be achieved
> straightforwardly with --user-path=. if that's what you actually wanted.
> (Indeed, --user-path= works too, but this is harder to explain.)
>
> I think I'd probably either run with --user-path=public-git or
> --user-path=public_html/git -- I've not made my mind up.

I made that conditional to --strict, but come to think of it, an independent option like --user-path makes more sense, whether that option does the public_html-like path munging or not.

I think for personal repositories public_html-like limiting may be simpler to manage than the current approach of using git-daemon-export-ok flag file (the latter is more flexible but most people probably do not need that flexibility).

In my simplistic view, --base-path serves something like /pub hierarchy of an ftp server or /var/www of an http server. It goes hand-in-hand with the whitelist and everything under it are exported without having to mark individual directories with git-daemon-export-ok (or having a name like public_html to mark it exportable). For ~user/ based paths, it is natural to wish to limit the parts of home directories but there currently is not a good way to do so. We could probably extend the whitelist to take path glob patterns and say "~*/public-git/" or something silly like that, but that still means the request must be in the form "git://host/~alice/public-git/frotz.git/" (which may not be such a bad thing); "git://host/~alice/frotz.git/" might look nicer. Your path munging idea is one way to do so. Another would be for alice to have $HOME/frotz.git/git-daemon-export-ok. Personally I do not think either would make too much of a difference from usability point of view.

So I am not dismissing what you are trying to achieve here. However, I am not happy about having <pwd.h> there and majorly duplicating what enter_repo() does in that part of the code.

Previous: Mark WoodingNext: Mark Wooding
Message 11 of 13 in “git-daemon hacking”
  1. 0/3 git-daemon hackingMark Wooding, Feb 3, 2006
  2. 1/3 daemon: Provide missing argument for logerror() call.Mark Wooding, Feb 3, 2006
  3. 2/3 daemon: Set SO_REUSEADDR on listening sockets.Mark Wooding, Feb 3, 2006
  4. Junio C HamanoFeb 3, 2006
  5. Junio C HamanoFeb 4, 2006
  6. Mark WoodingFeb 4, 2006
  7. 3/3 daemon: Support a --user-path option.Mark Wooding, Feb 3, 2006
  8. Junio C HamanoFeb 3, 2006
  9. Junio C HamanoFeb 4, 2006
  10. Mark WoodingFeb 4, 2006
  11. Junio C HamanoFeb 4, 2006
  12. Mark WoodingFeb 4, 2006
  13. Junio C HamanoFeb 4, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.