-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for funding config #26125
base: main
Are you sure you want to change the base?
Conversation
Funding for Users is now supported! It uses the data from the |
Looking really good! I didn't expect it to be worked on so quickly 😀
Would it be worth me creating a feature request for an organisation |
I'm currently using the code to get the Profile Readme to also get the funding config. I can add a new function, which just load the funding config for Organisations, but I wait for Feedback from the Maintainers. |
Nice, would it work for |
Yes, it would work too |
Is this PR still being worked on? Any way I could help? Would really love to see this feature implemented. |
I'm currently waiting for some feedback from the Maintainers before continuing working |
And now we have a chicken-egg problem as maintainers are waiting for this PR to leave the draft status to review it. |
I consider the code now as ready, so I remove the draft status. The documentation and the other providers will be added after the Code is reviewed. Organisations are currently not supported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stale?
@@ -650,6 +651,9 @@ func RepoAssignment(ctx *Context) context.CancelFunc { | |||
} | |||
ctx.Repo.GitRepo = gitRepo | |||
|
|||
ctx.Data["Funding"], _ = funding_service.GetFundingFromDefaultBranch(ctx, ctx.Repo.Repository) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why skip error? looks at least need a error log.
var FundingProviders []*api.FundingProvider | ||
|
||
func loadBuiltinFundingProviders() { | ||
FundingProviders = append(FundingProviders, &api.FundingProvider{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggest uing option method like lable templates. see https://github.com/go-gitea/gitea/blob/main/modules/options/base.go
return nil, nil | ||
} | ||
|
||
gitRepo, err := git.OpenRepository(ctx, r.RepoPath()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
close?
"gopkg.in/yaml.v3" | ||
) | ||
|
||
var FundingCandidates = []string{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var FundingCandidates = []string{ | |
var fundingCandidates = []string{ |
|
||
reader, err := treeEntry.Blob().DataAsync() | ||
if err != nil { | ||
log.Debug("DataAsync: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log.Debug("DataAsync: %v", err) | |
log.Error("DataAsync: %v", err) |
This adds support for a funding config. This does not mean, Gitea can handle Sponsors. It only mean, that you can add links to you Funding Websites. Take a look at the GitHub Documentation for more Information. It is currently already working, but needs a lot polishing. The backend code is almost finished, so you can comment n that. You can also comment on implementation details. The frontend is not ready at the Moment.
This is currently WIP.
You can view the Funding Site only by visiting{RepoURL}/funding
. It is not linked anywhere. maybe I transform this Site into a Pop-up like GitHub.At the moment, only support for
custom
andko_fi
has been added. This Implementation is designed to be customizable, so Admins can add new Sites too. If you want to add support for Patroen, you can add this to youapp.ini
:To-do:
custom
strings and list of strings as valueScreenshot:

It looks boring at the moment. Needs a bit more polishing.
Implements #26073