Compare commits

..

No commits in common. "0b6f7fb60709a499fe4f5d69ff77ed8337e05b8e" and "8981f6d0fc375c75ff5a2c1b6eb9e33c8dbaf722" have entirely different histories.

11 changed files with 26 additions and 99 deletions

View File

@ -22,9 +22,9 @@ import (
"github.com/urfave/cli" "github.com/urfave/cli"
) )
// CmdEmbedded represents the available extract sub-command. // Cmdembedded represents the available extract sub-command.
var ( var (
CmdEmbedded = cli.Command{ Cmdembedded = cli.Command{
Name: "embedded", Name: "embedded",
Usage: "Extract embedded resources", Usage: "Extract embedded resources",
Description: "A command for extracting embedded resources, like templates and images", Description: "A command for extracting embedded resources, like templates and images",

View File

@ -164,23 +164,3 @@ Although we would like to provide more options, our limited manpower means that
However, both Gitea and act runner are completely open source, so anyone can create a new/better implementation. However, both Gitea and act runner are completely open source, so anyone can create a new/better implementation.
We support your choice, no matter how you decide. We support your choice, no matter how you decide.
In case you fork act runner to create your own version: Please contribute the changes back if you can and if you think your changes will help others as well. In case you fork act runner to create your own version: Please contribute the changes back if you can and if you think your changes will help others as well.
## What workflow trigger events does Gitea support?
All events listed in this table are supported events and are compatible with GitHub.
For events supported only by GitHub, see GitHub's [documentation](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows).
| trigger event | activity types |
|-----------------------------|--------------------------------------------------------------------------------------------------------------------------|
| create | not applicable |
| delete | not applicable |
| fork | not applicable |
| gollum | not applicable |
| push | not applicable |
| issues | `opened`, `edited`, `closed`, `reopened`, `assigned`, `unassigned`, `milestoned`, `demilestoned`, `labeled`, `unlabeled` |
| issue_comment | `created`, `edited`, `deleted` |
| pull_request | `opened`, `edited`, `closed`, `reopened`, `assigned`, `unassigned`, `synchronize`, `labeled`, `unlabeled` |
| pull_request_review | `submitted`, `edited` |
| pull_request_review_comment | `created`, `edited` |
| release | `published`, `edited` |
| registry_package | `published` |

View File

@ -164,23 +164,3 @@ defaults:
然而无论您如何决定Gitea 和act runner都是完全开源的所以任何人都可以创建一个新的/更好的实现。 然而无论您如何决定Gitea 和act runner都是完全开源的所以任何人都可以创建一个新的/更好的实现。
我们支持您的选择,无论您如何决定。 我们支持您的选择,无论您如何决定。
如果您选择分支act runner来创建自己的版本请在您认为您的更改对其他人也有帮助的情况下贡献这些更改。 如果您选择分支act runner来创建自己的版本请在您认为您的更改对其他人也有帮助的情况下贡献这些更改。
## Gitea 支持哪些工作流触发事件?
表格中列出的所有事件都是支持的,并且与 GitHub 兼容。
对于仅 GitHub 支持的事件,请参阅 GitHub 的[文档](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows)。
| 触发事件 | 活动类型 |
|-----------------------------|--------------------------------------------------------------------------------------------------------------------------|
| create | 不适用 |
| delete | 不适用 |
| fork | 不适用 |
| gollum | 不适用 |
| push | 不适用 |
| issues | `opened`, `edited`, `closed`, `reopened`, `assigned`, `unassigned`, `milestoned`, `demilestoned`, `labeled`, `unlabeled` |
| issue_comment | `created`, `edited`, `deleted` |
| pull_request | `opened`, `edited`, `closed`, `reopened`, `assigned`, `unassigned`, `synchronize`, `labeled`, `unlabeled` |
| pull_request_review | `submitted`, `edited` |
| pull_request_review_comment | `created`, `edited` |
| release | `published`, `edited` |
| registry_package | `published` |

23
main.go
View File

@ -87,31 +87,25 @@ func main() {
app.Description = `By default, Gitea will start serving using the web-server with no argument, which can alternatively be run by running the subcommand "web".` app.Description = `By default, Gitea will start serving using the web-server with no argument, which can alternatively be run by running the subcommand "web".`
app.Version = Version + formatBuiltWith() app.Version = Version + formatBuiltWith()
app.EnableBashCompletion = true app.EnableBashCompletion = true
app.Commands = []cli.Command{
// these sub-commands need to use config file
subCmdWithIni := []cli.Command{
cmd.CmdWeb, cmd.CmdWeb,
cmd.CmdServ, cmd.CmdServ,
cmd.CmdHook, cmd.CmdHook,
cmd.CmdDump, cmd.CmdDump,
cmd.CmdCert,
cmd.CmdAdmin, cmd.CmdAdmin,
cmd.CmdGenerate,
cmd.CmdMigrate, cmd.CmdMigrate,
cmd.CmdKeys, cmd.CmdKeys,
cmd.CmdConvert, cmd.CmdConvert,
cmd.CmdDoctor, cmd.CmdDoctor,
cmd.CmdManager, cmd.CmdManager,
cmd.CmdEmbedded, cmd.Cmdembedded,
cmd.CmdMigrateStorage, cmd.CmdMigrateStorage,
cmd.CmdDocs,
cmd.CmdDumpRepository, cmd.CmdDumpRepository,
cmd.CmdRestoreRepository, cmd.CmdRestoreRepository,
cmd.CmdActions, cmd.CmdActions,
cmdHelp, // TODO: the "help" sub-command was used to show the more information for "work path" and "custom config", in the future, it should avoid doing so
}
// these sub-commands do not need the config file, and they do not depend on any path or environment variable.
subCmdStandalone := []cli.Command{
cmd.CmdCert,
cmd.CmdGenerate,
cmd.CmdDocs,
} }
// shared configuration flags, they are for global and for each sub-command at the same time // shared configuration flags, they are for global and for each sub-command at the same time
@ -140,11 +134,10 @@ func main() {
app.Action = prepareWorkPathAndCustomConf(cmd.CmdWeb.Action) app.Action = prepareWorkPathAndCustomConf(cmd.CmdWeb.Action)
app.HideHelp = true // use our own help action to show helps (with more information like default config) app.HideHelp = true // use our own help action to show helps (with more information like default config)
app.Before = cmd.PrepareConsoleLoggerLevel(log.INFO) app.Before = cmd.PrepareConsoleLoggerLevel(log.INFO)
for i := range subCmdWithIni { app.Commands = append(app.Commands, cmdHelp)
prepareSubcommands(&subCmdWithIni[i], globalFlags) for i := range app.Commands {
prepareSubcommands(&app.Commands[i], globalFlags)
} }
app.Commands = append(app.Commands, subCmdWithIni...)
app.Commands = append(app.Commands, subCmdStandalone...)
err := app.Run(os.Args) err := app.Run(os.Args)
if err != nil { if err != nil {

View File

@ -116,10 +116,6 @@ func loadOAuth2From(rootCfg ConfigProvider) {
return return
} }
if !OAuth2.Enable {
return
}
if !filepath.IsAbs(OAuth2.JWTSigningPrivateKeyFile) { if !filepath.IsAbs(OAuth2.JWTSigningPrivateKeyFile) {
OAuth2.JWTSigningPrivateKeyFile = filepath.Join(AppDataPath, OAuth2.JWTSigningPrivateKeyFile) OAuth2.JWTSigningPrivateKeyFile = filepath.Join(AppDataPath, OAuth2.JWTSigningPrivateKeyFile)
} }

View File

@ -420,13 +420,7 @@ func PackageSettingsPost(ctx *context.Context) {
ctx.Flash.Success(ctx.Tr("packages.settings.delete.success")) ctx.Flash.Success(ctx.Tr("packages.settings.delete.success"))
} }
redirectURL := ctx.Package.Owner.HomeLink() + "/-/packages" ctx.Redirect(ctx.Package.Owner.HomeLink() + "/-/packages")
// redirect to the package if there are still versions available
if has, _ := packages_model.ExistVersion(ctx, &packages_model.PackageSearchOptions{PackageID: ctx.Package.Descriptor.Package.ID}); has {
redirectURL = ctx.Package.Descriptor.PackageWebLink()
}
ctx.Redirect(redirectURL)
return return
} }
} }

View File

@ -84,17 +84,19 @@
{{end}} {{end}}
</div> </div>
{{end}} {{end}}
<div class="ui divider"></div> {{if .LatestVersions}}
<strong>{{.locale.Tr "packages.versions"}} ({{.TotalVersionCount}})</strong> <div class="ui divider"></div>
<a class="ui right" href="{{$.PackageDescriptor.PackageWebLink}}/versions">{{.locale.Tr "packages.versions.view_all"}}</a> <strong>{{.locale.Tr "packages.versions"}} ({{.TotalVersionCount}})</strong>
<div class="ui relaxed list"> <a class="ui right" href="{{$.PackageDescriptor.PackageWebLink}}/versions">{{.locale.Tr "packages.versions.view_all"}}</a>
{{range .LatestVersions}} <div class="ui relaxed list">
<div class="item gt-df"> {{range .LatestVersions}}
<a class="gt-f1" href="{{$.PackageDescriptor.PackageWebLink}}/{{PathEscape .LowerVersion}}">{{.Version}}</a> <div class="item gt-df">
<span class="text small">{{DateTime "short" .CreatedUnix}}</span> <a class="gt-f1" href="{{$.PackageDescriptor.PackageWebLink}}/{{PathEscape .LowerVersion}}">{{.Version}}</a>
<span class="text small">{{DateTime "short" .CreatedUnix}}</span>
</div>
{{end}}
</div> </div>
{{end}} {{end}}
</div>
{{if or .CanWritePackages .HasRepositoryAccess}} {{if or .CanWritePackages .HasRepositoryAccess}}
<div class="ui divider"></div> <div class="ui divider"></div>
<div class="ui relaxed list"> <div class="ui relaxed list">

View File

@ -114,7 +114,7 @@
{{else}} {{else}}
<a class="link-action flex-text-inline" href data-url="{{$.Link}}/{{.ID}}/close">{{svg "octicon-x" 14}}{{$.locale.Tr "repo.milestones.close"}}</a> <a class="link-action flex-text-inline" href data-url="{{$.Link}}/{{.ID}}/close">{{svg "octicon-x" 14}}{{$.locale.Tr "repo.milestones.close"}}</a>
{{end}} {{end}}
<a class="delete-button flex-text-inline" href="#" data-url="{{$.RepoLink}}/milestones/delete" data-id="{{.ID}}">{{svg "octicon-trash" 14}}{{$.locale.Tr "repo.issues.label_delete"}}</a> <a class="delete-button flex-text-inline" href="#" data-url="{{$.RepoLink}}/milestones/delete">{{svg "octicon-trash" 14}}{{$.locale.Tr "repo.issues.label_delete"}}</a>
</div> </div>
{{end}} {{end}}
</div> </div>

View File

@ -45,8 +45,8 @@
</div> </div>
<div class="inline field"> <div class="inline field">
<label>{{.locale.Tr "repo.visibility"}}</label> <label>{{.locale.Tr "repo.visibility"}}</label>
<div class="ui disabled checkbox"> <div class="ui read-only checkbox">
<input type="checkbox" disabled {{if .IsPrivate}}checked{{end}}> <input type="checkbox" {{if .IsPrivate}}checked{{end}}>
<label>{{.locale.Tr "repo.visibility_helper" | Safe}}</label> <label>{{.locale.Tr "repo.visibility_helper" | Safe}}</label>
</div> </div>
<span class="help">{{.locale.Tr "repo.fork_visibility_helper"}}</span> <span class="help">{{.locale.Tr "repo.fork_visibility_helper"}}</span>

View File

@ -135,7 +135,7 @@
{{else}} {{else}}
<a class="link-action flex-text-inline" href data-url="{{$.Link}}/{{.ID}}/close">{{svg "octicon-x" 14}}{{$.locale.Tr "repo.milestones.close"}}</a> <a class="link-action flex-text-inline" href data-url="{{$.Link}}/{{.ID}}/close">{{svg "octicon-x" 14}}{{$.locale.Tr "repo.milestones.close"}}</a>
{{end}} {{end}}
<a class="delete-button flex-text-inline" href="#" data-url="{{$.RepoLink}}/milestones/delete" data-id="{{.ID}}">{{svg "octicon-trash" 14}}{{$.locale.Tr "repo.issues.label_delete"}}</a> <a class="delete-button flex-text-inline" href="#" data-url="{{$.RepoLink}}/milestones/delete">{{svg "octicon-trash" 14}}{{$.locale.Tr "repo.issues.label_delete"}}</a>
</div> </div>
{{end}} {{end}}
</div> </div>

View File

@ -881,24 +881,6 @@ a.label,
color: var(--color-text); color: var(--color-text);
} }
/* reduce table padding, needed especially for dense admin tables */
.ui.table > thead > tr > th,
.ui.table > tbody > tr > td,
.ui.table > tr > td {
padding: 6px 3px;
}
/* use more horizontal padding on first and last items for visuals */
.ui.table > thead > tr > th:first-of-type,
.ui.table > tbody > tr > td:first-of-type,
.ui.table > tr > td:first-of-type {
padding-left: 10px;
}
.ui.table > thead > tr > th:last-of-type,
.ui.table > tbody > tr > td:last-of-type,
.ui.table > tr > td:last-of-type {
padding-right: 10px;
}
img.ui.avatar, img.ui.avatar,
.ui.avatar img, .ui.avatar img,
.ui.avatar svg { .ui.avatar svg {