diff options
author | 6543 <6543@obermui.de> | 2022-05-02 15:35:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-02 21:35:45 +0800 |
commit | e2a3f3d259d230b7d1f62138e789ccdfd8f43b73 (patch) | |
tree | bfb79a507a767f82f0ecf695eea66c2777d2f09d /modules | |
parent | 509d8112432bd90f070e35e03f4cf78a416914fc (diff) | |
download | gitea-e2a3f3d259d230b7d1f62138e789ccdfd8f43b73.tar.gz gitea-e2a3f3d259d230b7d1f62138e789ccdfd8f43b73.zip |
Federation: return useful statistic information for nodeinfo (#19561)
Add statistic information for total user count, active user count, issue count and comment count for `/nodeinfo`
Diffstat (limited to 'modules')
-rw-r--r-- | modules/context/api.go | 2 | ||||
-rw-r--r-- | modules/setting/federation.go | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/modules/context/api.go b/modules/context/api.go index 7d281b998a..20a3e05177 100644 --- a/modules/context/api.go +++ b/modules/context/api.go @@ -14,6 +14,7 @@ import ( "code.gitea.io/gitea/models/auth" repo_model "code.gitea.io/gitea/models/repo" + "code.gitea.io/gitea/modules/cache" "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/setting" @@ -247,6 +248,7 @@ func APIContexter() func(http.Handler) http.Handler { Resp: NewResponse(w), Data: map[string]interface{}{}, Locale: locale, + Cache: cache.GetCache(), Repo: &Repository{ PullRequest: &PullRequest{}, }, diff --git a/modules/setting/federation.go b/modules/setting/federation.go index c300060789..fd39e5c7c2 100644 --- a/modules/setting/federation.go +++ b/modules/setting/federation.go @@ -9,9 +9,11 @@ import "code.gitea.io/gitea/modules/log" // Federation settings var ( Federation = struct { - Enabled bool + Enabled bool + ShareUserStatistics bool }{ - Enabled: true, + Enabled: true, + ShareUserStatistics: true, } ) |