Commit Briefs

2959f41846 Omar Polo

gotwebd: add the magic ".git" handling

like gotd, assume an implicit ".git" if the repo doesn't exist. Merge gotweb_init_repo_dir() and gotweb_load_got_path() since the former only sets repo_dir->name, and we don't realistically know the name until we've opened the directory. While here, unbreak the git worktree handling too. Realistically, moving forward, we should issue a redirect to the canonical URL or at least set the correct metadata in the document to avoid having multiple URLs for the same content. ok stsp; tiny change to repo_dir->name handling done after the ok.


26b163a03e Omar Polo

gotwebd: guard against missig folder and file parameter in BLOB and BLAME

ok stsp


e114f3d1c1 Omar Polo

gotwebd: retire max_repos setting

Unlike max_repos_display which limits the number of items per page, max_repos is an hard-limit on the number of repos gotwebd would process. "kill it with fire" tracey@ about the idea ok stsp


8762929a1a Omar Polo

gotwebd: add knob for the number of tags and commits in the summary page

ok jamsek


5d6193d0d0 Omar Polo

gotwebd: remove PAGE handling

The page querystring parameter is long gone and currently unused. It was replaced mith the "more" buttons in all the views, except INDEX that uses `index_page'. ok jamsek


0c6bdfca5b Omar Polo

gotwebd: use nitems() instead of ACTIONS__MAX

I feel safer by using the explicit size of the table rather than an hypothetical maximum value given by the enum. Mostly because in the past I edited a table and forgot to remove the corresponding enum value. ok stsp@


6a1434e3aa Omar Polo

drop unnecessary zeroing after calloc()


723721e290 Omar Polo

gotwebd: use 'more' for the tag listing too

prodded by stsp and jamsek; ok stsp@


4921c182c9 Omar Polo

gotwebd: render less tags in the summary page

suggested / ok stsp


ac15152e21 Omar Polo

gotwebd: render READMEs in the tree view

ok tracey@


7f65bb55b8 Omar Polo

gotwebd: add patch action to serve diffs in plain text

ok tracey@


260fd73e17 Omar Polo

refactor gotweb_load_got_path; no functional change

ok tracey@


1632f50aca Stefan Sperling

remove the gotwebd repository cache

It only had 4 slots so was never quite useful, and sharing of sock->pack_fds across cached repositories seems problematic. with help from + ok op@


7607b8e058 Stefan Sperling

whitespace fix


26678adde2 Omar Polo

gotwebd: get rid of proc.[ch]

proc.c really shines when there's a network of different types of processes, potentially with a various number of instances each, that needs to exchange messages. Gotwebd instead has a much simpler design, and using proc.c causes more overhead (/headaches) than it solves. So, this attempts to provide the same functionalities but with a much simpler implementation that fits gotwebd better. ok stsp@


03e70dd4d4 Omar Polo

gotwebd: improve gotwebd_assign_querystring()

This prevents the issues that we just hit with forgetting to remove PREVID: instead of relying on the enum value to yield the size of a table, use nitems(). Also, quit as soon as the matching key was found, no need to iterate further. ok stsp@


7781b9910f Omar Polo

gotwebd: render all the datetimes in a time tag

fixes an unused variable that should have been dropped in previous commit too. ok stsp@


bf26a63363 Omar Polo

gotwebd: inline the only use of TM_RFC822


62eab86e6a Omar Polo

gotwebd: move the buffering from the fastcgi layer to the template

Reduces the indirection in fcgi.c, starts to make the struct template opaque, simplifies the template usage. All with a net negative :-) reads fine to stsp@ (thanks!)


417c892364 Omar Polo

gotwebd: fix branches modification time with show_repo_age off

If show_repo_age is set to off, got_get_repo_age() returns without setting the timestamp. got_get_repo_age() is also used by the branch listing to show how old they are however, and we end up rendering the stack garbage. Instead, respect `show_repo_age off' one layer above, and always return a timestamp in got_get_repo_age(). While here, initialize the timestamp to zero so it's set also in case of failures. Issue reported on IRC by xs, thanks!


13d9dc7e2e Omar Polo

bubble up got_repo_commits()

now that got_get_repo_commits() doesn't look at `action' we can stop fetching the commits during the rendering and bubble up the call. This yields better error messages and better replies codes on failure.


c8af7691c9 Omar Polo

simplify gotwebd' server matching

Currently, if there is not a match on the server name, it attempts to match the "subdomain" against the server names, and fall back to the first server defined. The server name is taken from the SERVER_NAME fastcgi' parameter, the subdomain extracted from HTTP_HOST. Keep only the SERVER_NAME matching, but still use the first server defined if there's no match. Fix the manpage documenting how matching works and drop the lie about SNI as gotwebd doesn't do TLS but just looks at what the upstream http server decided. ok stsp@


de2b82f3b9 Omar Polo

retire GOT_ERR_QUERYSTRING

it's redundant with GOT_ERR_BAD_QUERYSTRING; convert its only use to the latter.


4448825ab5 Omar Polo

dropping unnecessary strlen()s

ok jamsek, stsp


50f6148a8c Omar Polo

gotwebd: fix some got_error_from_errno2/3 calls

it's not printf-like so %s don't make sense. Tweak the order of the arguments to obtain the intended output.