tangled
alpha
login
or
join now
veryroundbird.house
/
core
forked from
tangled.org/core
0
fork
atom
this repo has no description
0
fork
atom
overview
issues
pulls
pipelines
fix timeline cutoff
oppi.li
1 year ago
fc45876b
7d5263c7
+18
-11
3 changed files
expand all
collapse all
unified
split
appview
db
timeline.go
state
git_http.go
flake.nix
+4
-4
appview/db/timeline.go
···
40
40
})
41
41
}
42
42
43
43
+
sort.Slice(events, func(i, j int) bool {
44
44
+
return events[i].EventAt.After(events[j].EventAt)
45
45
+
})
46
46
+
43
47
// Limit the slice to 100 events
44
48
if len(events) > 50 {
45
49
events = events[:50]
46
50
}
47
47
-
48
48
-
sort.Slice(events, func(i, j int) bool {
49
49
-
return events[i].EventAt.After(events[j].EventAt)
50
50
-
})
51
51
52
52
return events, nil
53
53
}
+9
-4
appview/state/git_http.go
···
14
14
knot := r.Context().Value("knot").(string)
15
15
repo := chi.URLParam(r, "repo")
16
16
17
17
-
uri := "https"
17
17
+
scheme := "https"
18
18
if s.config.Dev {
19
19
-
uri = "http"
19
19
+
scheme = "http"
20
20
}
21
21
-
targetURL := fmt.Sprintf("%s://%s/%s/%s/info/refs?%s", uri, knot, user.DID, repo, r.URL.RawQuery)
21
21
+
targetURL := fmt.Sprintf("%s://%s/%s/%s/info/refs?%s", scheme, knot, user.DID, repo, r.URL.RawQuery)
22
22
resp, err := http.Get(targetURL)
23
23
if err != nil {
24
24
http.Error(w, err.Error(), http.StatusInternalServerError)
···
50
50
}
51
51
knot := r.Context().Value("knot").(string)
52
52
repo := chi.URLParam(r, "repo")
53
53
-
targetURL := fmt.Sprintf("https://%s/%s/%s/git-upload-pack?%s", knot, user.DID, repo, r.URL.RawQuery)
53
53
+
54
54
+
scheme := "https"
55
55
+
if s.config.Dev {
56
56
+
scheme = "http"
57
57
+
}
58
58
+
targetURL := fmt.Sprintf("%s://%s/%s/%s/git-upload-pack?%s", scheme, knot, user.DID, repo, r.URL.RawQuery)
54
59
client := &http.Client{}
55
60
56
61
// Create new request
+5
-3
flake.nix
···
44
44
inherit (gitignore.lib) gitignoreSource;
45
45
in {
46
46
overlays.default = final: prev: let
47
47
-
goModHash = "sha256-ywhhGrv8KNqy9tCMCnA1PU/RQ/+0Xyitej1L48TcFvI=";
47
47
+
goModHash = "sha256-tBhwRT3qnTHoAyasYIDwr9+3V+c7VLPY2LJ6A25l1gA=";
48
48
buildCmdPackage = name:
49
49
final.buildGoModule {
50
50
pname = name;
···
282
282
config = mkIf config.services.tangled-knotserver.enable {
283
283
nixpkgs.overlays = [self.overlays.default];
284
284
285
285
-
environment.systemPackages = with pkgs; [git];
285
285
+
environment.systemPackages = with pkgs; [
286
286
+
git
287
287
+
];
286
288
287
289
users.users.git = {
288
290
isSystemUser = true;
···
300
302
enable = true;
301
303
extraConfig = ''
302
304
Match User git
303
303
-
AuthorizedKeysCommand ${pkgs.keyfetch}/bin/keyfetch -repoguard-path ${pkgs.repoguard}/bin/repoguard
305
305
+
AuthorizedKeysCommand ${pkgs.keyfetch}/bin/keyfetch -repoguard-path ${pkgs.repoguard}/bin/repoguard -log-path /home/git/repoguard.log
304
306
AuthorizedKeysCommandUser nobody
305
307
'';
306
308
};