legit

Fork of https://git.icyphox.sh/legit

Commits at 66cdbc5a0f8a6e2f72a4b20ab1b3c4c78b99c05d

  1. 727c9690 Remove unnecessary dot from internal links Browsers will normalize fine, though. Shota FUJI authored at Shota FUJI comitted at
  2. 6450aeff Add tests for internal media source link transformer https://tangled.org/pocka.jp/legit/issues/10 Shota FUJI authored at Shota FUJI comitted at
  3. afe955fa Fix incorrect URL for image src if it has query params Shota FUJI authored at Shota FUJI comitted at
  4. 21b3950e Use monospace for object hash For commit hashes, use of monospace is preferred because that makes the width of commit hash consistent. "Commits for" in log page can be a commit hash but I kept it as-is because most people would browse on branches. Shota FUJI authored at Shota FUJI comitted at
  5. 4c27b217 Don't use system-ui for content texts "system-ui" is for UI texts, not for content texts. From now on, controls and labels use system-ui and content texts use --font-content (sans-serif). Shota FUJI authored at Shota FUJI comitted at
  6. 83c692e6 Fix header and footer not being sticky on wide viewport Regression introduced at somewhere. Shota FUJI authored at Shota FUJI comitted at
  7. c6e0d57a Fix footer partially occlude aside section on short viewport https://tangled.org/pocka.jp/legit/issues/12 Shota FUJI authored at Shota FUJI comitted at
  8. ac5d7349 Fix commit hash on aside overflows horizontally https://tangled.org/pocka.jp/legit/issues/11 Shota FUJI authored at Shota FUJI comitted at
  9. 5fc79883 Add pagination to commits page Rendering all commits in a repo is not a good idea. It's really slow and heavy on an active repository such as Zig the language. https://tangled.org/pocka.jp/legit/issues/9 Shota FUJI authored at Shota FUJI comitted at
  10. 6248d4ed Fix long commit history slowing summary page https://tangled.org/pocka.jp/legit/issues/7#comment-3mqn5xujwoh22 The summary page displays recent up to three commits, but underlying logic reads the whole repo history then subslice the result. The loading of entire commit history is really demanding task and slows the response time of a summary page down a lot. Before this patch, loading a summary page of Zig project took 900ms ~ 1100ms. After this patch, it's 180ms under load. Shota FUJI authored at Shota FUJI comitted at
  11. 62b73d36 Fix directory links in Markdown preview is incorrect README and preview code uses each own rendering logic, caused diverged output. An internal directory link inside preview HTML links to 404 (server returns 500) page. This patch refactors HTML rendering into interface-d one and let both endpoint use that. The original motivation for this refactor was to cache rendered HTML, but turns out refactor alone is significant so I gave this a dedicated commit. Shota FUJI authored at Shota FUJI comitted at
  12. a4dcd129 Compile HTML templates upfront https://tangled.org/pocka.jp/legit/issues/5 Compiling HTML templates on every request is useless on production deployment and slows down response time significantly. This patch makes compile-on-request opt-in and upfront compilation a default. On my dev machine (Intel Core Ultra 9 285H), spam_repo_list 1,000 iterations / 30 VUs gets 6ms avg -> sub 1ms avg and spam_repo_summary 1,000 iterations / 30 VUs gets 8.2ms avg -> 2.5ms avg improvements. Shota FUJI authored at Shota FUJI comitted at
  13. d1cb4494 Delete unused struct Shota FUJI authored at Shota FUJI comitted at
  14. 290981c5 Don't unveil empty paths Both templates dir and static dir are now optional. I'm not sure empty paths will trigger error, though. Shota FUJI authored at Shota FUJI comitted at
  15. 3b77efdc Add test for not following symlink inside repo dir Shota FUJI authored at Shota FUJI comitted at
  16. f4a70d2b Fix occasional git fetch error (gzipped upload-pack) https://tangled.org/pocka.jp/legit/issues/6 https://github.com/icyphox/legit/pull/58 I could not write a test reliably triggers this condition (upload-pack request having gzip body) even with system git. Shota FUJI authored at Shota FUJI comitted at
  17. c9d54abb Deny git clone of ignored repo https://tangled.org/pocka.jp/legit/issues/2 https://github.com/icyphox/legit/issues/56 There were no guard / check for "ignored" config in endpoints git client uses, so everybody could clone ignored repositories. Shota FUJI authored at Shota FUJI comitted at
  18. bbeea586 Add simple tests These are basis for the future tests. Shota FUJI authored at Shota FUJI comitted at
  19. 3a07b138 Upgrade go-git I needed "git.InitWithOptions" function added in v5.7.0. Shota FUJI authored at Shota FUJI comitted at
  20. d224558e Move embedded resources into dedicated module For testing. Child packages cannot access embedded resources. Shota FUJI authored at Shota FUJI comitted at
  21. eac513f5 Embed default templates into the binary https://tangled.org/pocka.jp/legit/issues/3 https://github.com/icyphox/legit/issues/10 Deployment & distribution convenience. Shota FUJI authored at Shota FUJI comitted at
  22. 0e496be9 Embed static files into the binary https://tangled.org/pocka.jp/legit/issues/3 Having to copy the "static/" directories is PITA, and distribution burden. Shota FUJI authored at Shota FUJI comitted at
  23. 208876a9 Don't generate bluemonday policy for each requests https://tangled.org/pocka.jp/legit/issues/4 bluemonday's documentation says the policy creation/editing is not safe to use in multiple goroutines. Now only one policy exists in the entire application and no creation/editing is happening inside HTTP server's goroutine. This also brings performance improvements. On my machine, spamming repo summary page took 10ms~11ms med (avg), but with this patch they are now 7ms~8ms med (avg). k6 run --vus 30 --iterations 1000 ./tests/k6/spam_repo_summary.js Thank Anthony Wang for sending the original patch that brought this topic in. Shota FUJI authored at Shota FUJI comitted at
  24. e39d5a3b Add link to issues page For transparency? Shota FUJI authored at Shota FUJI comitted at
  25. c2244176 Exclude unnecessary files from Nix source To prevent unnecessary rebuilds. Changes to README should not issue a new build. Shota FUJI authored at Shota FUJI comitted at
  26. afb93b77 Set "meta.mainProgram" in Nix derivation Nix outputs warning message when **user** calls "lib.getExe" on this package. --- evaluation warning: getExe: Package legit does not have the meta.mainProgram attribute. We'll assume that the main program has the same name for now, but this behavior is deprecated, because it leads to surprising errors when the assumption does not hold. If the package has a main program, please set `meta.mainProgram` in its definition to make this warning go away. Otherwise, if the package does not have a main program, or if you don't control its definition, use getExe' to specify the name to the program, such as lib.getExe' foo "bar". Shota FUJI authored at Shota FUJI comitted at
  27. 912daf3f Setup load testing It's minimal, but useful for future additions. Considering the current trend of malcious crawlers, I believe this is necessary. Shota FUJI authored at Shota FUJI comitted at
  28. 3ce7ca00 Eliminate boilerplate code from Flake file Shota FUJI authored at Shota FUJI comitted at
  29. 921f987b Migrate "defaultPackage" to "packages.default" (Nix Flakes) "defaultPackage" is deprecated. Shota FUJI authored at Shota FUJI comitted at
  30. 9d070622 Update vendorHash of Nix derivation Shota FUJI authored at Shota FUJI comitted at