forked from tangled.org/core
this repo has no description

fix timeline cutoff

Changed files
+18 -11
appview
+4 -4
appview/db/timeline.go
···
})
}
+
sort.Slice(events, func(i, j int) bool {
+
return events[i].EventAt.After(events[j].EventAt)
+
})
+
// Limit the slice to 100 events
if len(events) > 50 {
events = events[:50]
}
-
-
sort.Slice(events, func(i, j int) bool {
-
return events[i].EventAt.After(events[j].EventAt)
-
})
return events, nil
}
+9 -4
appview/state/git_http.go
···
knot := r.Context().Value("knot").(string)
repo := chi.URLParam(r, "repo")
-
uri := "https"
+
scheme := "https"
if s.config.Dev {
-
uri = "http"
+
scheme = "http"
}
-
targetURL := fmt.Sprintf("%s://%s/%s/%s/info/refs?%s", uri, knot, user.DID, repo, r.URL.RawQuery)
+
targetURL := fmt.Sprintf("%s://%s/%s/%s/info/refs?%s", scheme, knot, user.DID, repo, r.URL.RawQuery)
resp, err := http.Get(targetURL)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
···
}
knot := r.Context().Value("knot").(string)
repo := chi.URLParam(r, "repo")
-
targetURL := fmt.Sprintf("https://%s/%s/%s/git-upload-pack?%s", knot, user.DID, repo, r.URL.RawQuery)
+
+
scheme := "https"
+
if s.config.Dev {
+
scheme = "http"
+
}
+
targetURL := fmt.Sprintf("%s://%s/%s/%s/git-upload-pack?%s", scheme, knot, user.DID, repo, r.URL.RawQuery)
client := &http.Client{}
// Create new request
+5 -3
flake.nix
···
inherit (gitignore.lib) gitignoreSource;
in {
overlays.default = final: prev: let
-
goModHash = "sha256-ywhhGrv8KNqy9tCMCnA1PU/RQ/+0Xyitej1L48TcFvI=";
+
goModHash = "sha256-tBhwRT3qnTHoAyasYIDwr9+3V+c7VLPY2LJ6A25l1gA=";
buildCmdPackage = name:
final.buildGoModule {
pname = name;
···
config = mkIf config.services.tangled-knotserver.enable {
nixpkgs.overlays = [self.overlays.default];
-
environment.systemPackages = with pkgs; [git];
+
environment.systemPackages = with pkgs; [
+
git
+
];
users.users.git = {
isSystemUser = true;
···
enable = true;
extraConfig = ''
Match User git
-
AuthorizedKeysCommand ${pkgs.keyfetch}/bin/keyfetch -repoguard-path ${pkgs.repoguard}/bin/repoguard
+
AuthorizedKeysCommand ${pkgs.keyfetch}/bin/keyfetch -repoguard-path ${pkgs.repoguard}/bin/repoguard -log-path /home/git/repoguard.log
AuthorizedKeysCommandUser nobody
'';
};