mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-14 00:01:44 -04:00
Compare commits
No commits in common. "371520d7ab5c018c380f8f7981a8be7d40a01f72" and "30668e0047d684feec83b0e316c001c6e2332986" have entirely different histories.
371520d7ab
...
30668e0047
@ -1848,7 +1848,7 @@ ROUTER = console
|
||||
;ENABLED = true
|
||||
;;
|
||||
;; Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
|
||||
;ALLOWED_TYPES = .csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip
|
||||
;ALLOWED_TYPES = .csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip
|
||||
;;
|
||||
;; Max size of each file. Defaults to 4MB
|
||||
;MAX_SIZE = 4
|
||||
|
@ -841,7 +841,7 @@ Default templates for project boards:
|
||||
## Issue and pull request attachments (`attachment`)
|
||||
|
||||
- `ENABLED`: **true**: Whether issue and pull request attachments are enabled.
|
||||
- `ALLOWED_TYPES`: **.csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip**: Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
|
||||
- `ALLOWED_TYPES`: **.csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip**: Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
|
||||
- `MAX_SIZE`: **4**: Maximum size (MB).
|
||||
- `MAX_FILES`: **5**: Maximum number of attachments that can be uploaded at once.
|
||||
- `STORAGE_TYPE`: **local**: Storage type for attachments, `local` for local disk or `minio` for s3 compatible object storage service, default is `local` or other name defined with `[storage.xxx]`
|
||||
|
@ -25,7 +25,6 @@ type ActionRunner struct {
|
||||
ID int64
|
||||
UUID string `xorm:"CHAR(36) UNIQUE"`
|
||||
Name string `xorm:"VARCHAR(255)"`
|
||||
Version string `xorm:"VARCHAR(64)"`
|
||||
OwnerID int64 `xorm:"index"` // org level runner, 0 means system
|
||||
Owner *user_model.User `xorm:"-"`
|
||||
RepoID int64 `xorm:"index"` // repo level runner, if orgid also is zero, then it's a global
|
||||
|
@ -473,8 +473,6 @@ var migrations = []Migration{
|
||||
NewMigration("Add missed column owner_id for project table", v1_20.AddNewColumnForProject),
|
||||
// v247 -> v248
|
||||
NewMigration("Fix incorrect project type", v1_20.FixIncorrectProjectType),
|
||||
// v248 -> v249
|
||||
NewMigration("Add version column to action_runner table", v1_20.AddVersionToActionRunner),
|
||||
}
|
||||
|
||||
// GetCurrentDBVersion returns the current db version
|
||||
|
@ -1,14 +0,0 @@
|
||||
// Copyright 2023 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package v1_20 //nolint
|
||||
|
||||
import "xorm.io/xorm"
|
||||
|
||||
func AddVersionToActionRunner(x *xorm.Engine) error {
|
||||
type ActionRunner struct {
|
||||
Version string `xorm:"VARCHAR(64)"` // the version of act_runner
|
||||
}
|
||||
|
||||
return x.Sync(new(ActionRunner))
|
||||
}
|
@ -144,21 +144,10 @@ func (p *Project) Link() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (p *Project) IconName() string {
|
||||
if p.IsRepositoryProject() {
|
||||
return "octicon-project"
|
||||
}
|
||||
return "octicon-project-symlink"
|
||||
}
|
||||
|
||||
func (p *Project) IsOrganizationProject() bool {
|
||||
return p.Type == TypeOrganization
|
||||
}
|
||||
|
||||
func (p *Project) IsRepositoryProject() bool {
|
||||
return p.Type == TypeRepository
|
||||
}
|
||||
|
||||
func init() {
|
||||
db.RegisterModel(new(Project))
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ func loadAttachmentFrom(rootCfg ConfigProvider) {
|
||||
|
||||
Attachment.Storage = getStorage(rootCfg, "attachments", storageType, sec)
|
||||
|
||||
Attachment.AllowedTypes = sec.Key("ALLOWED_TYPES").MustString(".csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip")
|
||||
Attachment.AllowedTypes = sec.Key("ALLOWED_TYPES").MustString(".csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip")
|
||||
Attachment.MaxSize = sec.Key("MAX_SIZE").MustInt64(4)
|
||||
Attachment.MaxFiles = sec.Key("MAX_FILES").MustInt(5)
|
||||
Attachment.Enabled = sec.Key("ENABLED").MustBool(true)
|
||||
|
@ -3355,7 +3355,6 @@ runners.status.unspecified = Unknown
|
||||
runners.status.idle = Idle
|
||||
runners.status.active = Active
|
||||
runners.status.offline = Offline
|
||||
runners.version = Version
|
||||
|
||||
runs.all_workflows = All Workflows
|
||||
runs.open_tab = %d Open
|
||||
|
@ -21,11 +21,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
uuidHeaderKey = "x-runner-uuid"
|
||||
tokenHeaderKey = "x-runner-token"
|
||||
versionHeaderKey = "x-runner-version"
|
||||
|
||||
versionUnknown = "Unknown"
|
||||
uuidHeaderKey = "x-runner-uuid"
|
||||
tokenHeaderKey = "x-runner-token"
|
||||
)
|
||||
|
||||
var withRunner = connect.WithInterceptors(connect.UnaryInterceptorFunc(func(unaryFunc connect.UnaryFunc) connect.UnaryFunc {
|
||||
@ -36,12 +33,6 @@ var withRunner = connect.WithInterceptors(connect.UnaryInterceptorFunc(func(unar
|
||||
}
|
||||
uuid := request.Header().Get(uuidHeaderKey)
|
||||
token := request.Header().Get(tokenHeaderKey)
|
||||
version := request.Header().Get(versionHeaderKey)
|
||||
if util.IsEmptyString(version) {
|
||||
version = versionUnknown
|
||||
}
|
||||
version, _ = util.SplitStringAtByteN(version, 64)
|
||||
|
||||
runner, err := actions_model.GetRunnerByUUID(ctx, uuid)
|
||||
if err != nil {
|
||||
if errors.Is(err, util.ErrNotExist) {
|
||||
@ -54,10 +45,6 @@ var withRunner = connect.WithInterceptors(connect.UnaryInterceptorFunc(func(unar
|
||||
}
|
||||
|
||||
cols := []string{"last_online"}
|
||||
if runner.Version != version {
|
||||
runner.Version = version
|
||||
cols = append(cols, "version")
|
||||
}
|
||||
runner.LastOnline = timeutil.TimeStampNow()
|
||||
if methodName == "UpdateTask" || methodName == "UpdateLog" {
|
||||
runner.LastActive = timeutil.TimeStampNow()
|
||||
|
@ -8,7 +8,6 @@ import (
|
||||
"io"
|
||||
"net/http"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
packages_model "code.gitea.io/gitea/models/packages"
|
||||
@ -63,11 +62,6 @@ func PackageMetadata(ctx *context.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
// sort package descriptors by version to mimic PyPI format
|
||||
sort.Slice(pds, func(i, j int) bool {
|
||||
return strings.Compare(pds[i].Version.Version, pds[j].Version.Version) < 0
|
||||
})
|
||||
|
||||
ctx.Data["RegistryURL"] = setting.AppURL + "api/packages/" + ctx.Package.Owner.Name + "/pypi"
|
||||
ctx.Data["PackageDescriptor"] = pds[0]
|
||||
ctx.Data["PackageDescriptors"] = pds
|
||||
|
@ -154,7 +154,7 @@ func Migrate(ctx *context.APIContext) {
|
||||
Issues: form.Issues,
|
||||
Milestones: form.Milestones,
|
||||
Labels: form.Labels,
|
||||
Comments: form.Issues || form.PullRequests,
|
||||
Comments: true,
|
||||
PullRequests: form.PullRequests,
|
||||
Releases: form.Releases,
|
||||
GitServiceType: gitServiceType,
|
||||
|
@ -38,7 +38,7 @@
|
||||
<div class="milestone list">
|
||||
{{range .Projects}}
|
||||
<li class="item">
|
||||
{{svg .IconName}} <a href="{{.Link}}">{{.Title}}</a>
|
||||
{{svg "octicon-project-symlink"}} <a href="{{.Link}}">{{.Title}}</a>
|
||||
<div class="meta">
|
||||
{{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}}
|
||||
{{if .IsClosed}}
|
||||
|
@ -100,7 +100,8 @@
|
||||
</div>
|
||||
{{range .OpenProjects}}
|
||||
<a class="{{if $.ProjectID}}{{if eq $.ProjectID .ID}}active selected{{end}}{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{.ID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">
|
||||
{{svg .IconName 18 "gt-mr-3"}}{{.Title}}
|
||||
{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
|
||||
{{.Title}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
@ -111,7 +112,8 @@
|
||||
</div>
|
||||
{{range .ClosedProjects}}
|
||||
<a class="{{if $.ProjectID}}{{if eq $.ProjectID .ID}}active selected{{end}}{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{.ID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">
|
||||
{{svg .IconName 18 "gt-mr-3"}}{{.Title}}
|
||||
{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
|
||||
{{.Title}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
@ -271,7 +273,8 @@
|
||||
</div>
|
||||
{{range .OpenProjects}}
|
||||
<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/projects">
|
||||
{{svg .IconName 18 "gt-mr-3"}}{{.Title}}
|
||||
{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
|
||||
{{.Title}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
@ -282,7 +285,8 @@
|
||||
</div>
|
||||
{{range .ClosedProjects}}
|
||||
<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/projects">
|
||||
{{svg .IconName 18 "gt-mr-3"}}{{.Title}}
|
||||
{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
|
||||
{{.Title}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
@ -134,7 +134,8 @@
|
||||
</div>
|
||||
{{range .OpenProjects}}
|
||||
<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}">
|
||||
{{svg .IconName 18 "gt-mr-3"}}{{.Title}}
|
||||
{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
|
||||
{{.Title}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
@ -145,7 +146,8 @@
|
||||
</div>
|
||||
{{range .ClosedProjects}}
|
||||
<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}">
|
||||
{{svg .IconName 18 "gt-mr-3"}}{{.Title}}
|
||||
{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
|
||||
{{.Title}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
@ -157,7 +159,8 @@
|
||||
<div class="selected">
|
||||
{{if .Project}}
|
||||
<a class="item muted sidebar-item-link" href="{{.Project.Link}}">
|
||||
{{svg .Project.IconName 18 "gt-mr-3"}}{{.Project.Title}}
|
||||
{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
|
||||
{{.Project.Title}}
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
|
@ -196,7 +196,8 @@
|
||||
</div>
|
||||
{{range .OpenProjects}}
|
||||
<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}">
|
||||
{{svg .IconName 18 "gt-mr-3"}}{{.Title}}
|
||||
{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
|
||||
{{.Title}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
@ -207,7 +208,8 @@
|
||||
</div>
|
||||
{{range .ClosedProjects}}
|
||||
<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}">
|
||||
{{svg .IconName 18 "gt-mr-3"}}{{.Title}}
|
||||
{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
|
||||
{{.Title}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
@ -218,7 +220,8 @@
|
||||
<div class="selected">
|
||||
{{if .Issue.ProjectID}}
|
||||
<a class="item muted sidebar-item-link" href="{{.Issue.Project.Link}}">
|
||||
{{svg .Issue.Project.IconName 18 "gt-mr-3"}}{{.Issue.Project.Title}}
|
||||
{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
|
||||
{{.Issue.Project.Title}}
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
|
@ -40,7 +40,7 @@
|
||||
<div class="milestone list">
|
||||
{{range .Projects}}
|
||||
<li class="item">
|
||||
{{svg .IconName}} <a href="{{.Link}}">{{.Title}}</a>
|
||||
{{svg "octicon-project"}} <a href="{{.Link}}">{{.Title}}</a>
|
||||
<div class="meta">
|
||||
{{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}}
|
||||
{{if .IsClosed}}
|
||||
|
@ -49,7 +49,6 @@
|
||||
<th data-sortt-asc="online" data-sortt-desc="offline">{{.locale.Tr "actions.runners.status"}}</th>
|
||||
<th data-sortt-asc="alphabetically">{{.locale.Tr "actions.runners.id"}}</th>
|
||||
<th>{{.locale.Tr "actions.runners.name"}}</th>
|
||||
<th>{{.locale.Tr "actions.runners.version"}}</th>
|
||||
<th>{{.locale.Tr "actions.runners.owner_type"}}</th>
|
||||
<th>{{.locale.Tr "actions.runners.labels"}}</th>
|
||||
<th>{{.locale.Tr "actions.runners.last_online"}}</th>
|
||||
@ -65,7 +64,6 @@
|
||||
</td>
|
||||
<td>{{.ID}}</td>
|
||||
<td><p class="tooltip" data-content="{{.Description}}">{{.Name}}</p></td>
|
||||
<td>{{.Version}}</td>
|
||||
<td>{{.OwnType}}</td>
|
||||
<td class="runner-tags">
|
||||
{{range .AllLabels}}<span class="ui label">{{.}}</span>{{end}}
|
||||
|
@ -88,7 +88,7 @@
|
||||
{{end}}
|
||||
{{if .Project}}
|
||||
<a class="project" href="{{.Project.Link}}">
|
||||
{{svg .Project.IconName 14 "gt-mr-2"}}{{.Project.Title}}
|
||||
{{if .Project.IsOrganizationProject}}{{svg "octicon-project-symlink" 14 "gt-mr-2"}}{{else}}{{svg "octicon-project" 14 "gt-mr-2"}}{{end}}{{.Project.Title}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{if .Ref}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user