Compare commits

...

2 commits

Author SHA1 Message Date
1cc206a753 Add tudbut-rebuild.sh
Some checks failed
testing / backend-checks (push) Has been skipped
testing / frontend-checks (push) Has been skipped
testing / test-unit (push) Has been skipped
testing / test-remote-cacher (map[image:docker.io/bitnami/redis:7.2 port:6379]) (push) Has been skipped
testing / test-remote-cacher (map[image:docker.io/bitnami/valkey:7.2 port:6379]) (push) Has been skipped
testing / test-remote-cacher (map[image:ghcr.io/microsoft/garnet-alpine:1.0.14 port:6379]) (push) Has been skipped
testing / test-remote-cacher (map[image:registry.redict.io/redict:7.3.0-scratch port:6379]) (push) Has been skipped
testing / test-mysql (push) Has been skipped
testing / test-pgsql (push) Has been skipped
testing / test-sqlite (push) Has been skipped
testing / security-check (push) Has been skipped
Integration tests for the release process / release-simulation (push) Has been cancelled
/ release (push) Has been cancelled
2024-09-29 22:47:47 +02:00
537e6f83c0 allow everyone to see full heatmap 2024-09-29 22:47:47 +02:00
4 changed files with 15 additions and 1 deletions

6
FORK.md Normal file
View file

@ -0,0 +1,6 @@
# TudbuT FORK
## Changes:
- Allow anyone to see the activity heatmap in full

View file

@ -440,6 +440,7 @@ type GetFeedsOptions struct {
OnlyPerformedByActor bool // only actions performed by the original actor
IncludeDeleted bool // include deleted actions
Date string // the day we want activity for: YYYY-MM-DD
IncludeInaccessible bool // if inaccessible activities should be included
}
// GetFeeds returns actions according to the provided options
@ -526,7 +527,7 @@ func activityQueryCondition(ctx context.Context, opts GetFeedsOptions) (builder.
}
// check readable repositories by doer/actor
if opts.Actor == nil || !opts.Actor.IsAdmin {
if !opts.IncludeInaccessible && (opts.Actor == nil || !opts.Actor.IsAdmin) {
cond = cond.And(builder.In("repo_id", repo_model.AccessibleRepoIDsQuery(opts.Actor)))
}

View file

@ -53,6 +53,7 @@ func getUserHeatmapData(ctx context.Context, user *user_model.User, team *organi
// * For organizations actions by all users that were made in owned
// repositories are counted.
OnlyPerformedBy: !user.IsOrganization(),
IncludeInaccessible: true,
})
if err != nil {
return nil, err

6
tudbut-rebuild.sh Normal file
View file

@ -0,0 +1,6 @@
#!/bin/bash
# this is supposed to be run on a server with forgejo of some kind already installed.
FORGEJO_VERSION="tudbut-$(git log --oneline | head -n1 | sed -E 's/(\w+) (.*)/\1/g')" TAGS="bindata timetzdata sqlite sqlite_unlock_notify" make build || exit 1
sudo cp gitea /usr/local/bin/forgejo || exit 1