Merge branch 'main' into add-issue-planned-time

This commit is contained in:
silverwind 2023-06-18 20:43:42 +02:00 committed by GitHub
commit b211b9e66d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 24 additions and 29 deletions

View File

@ -58,3 +58,4 @@ jobs:
templates:
- "templates/**/*.tmpl"
- "poetry.lock"

View File

@ -30,7 +30,7 @@ func loadMirrorFrom(rootCfg ConfigProvider) {
// DEPRECATED should not be removed because users maybe upgrade from lower version to the latest version
// if these are removed, the warning will not be shown
deprecatedSetting(rootCfg, "repository", "DISABLE_MIRRORS", "mirror", "ENABLED", "v1.19.0")
if rootCfg.Section("repository").Key("DISABLE_MIRRORS").MustBool(false) {
if ConfigSectionKeyBool(rootCfg.Section("repository"), "DISABLE_MIRRORS") {
Mirror.DisableNewPull = true
}

View File

@ -120,18 +120,20 @@ func loadOAuth2From(rootCfg ConfigProvider) {
OAuth2.JWTSigningPrivateKeyFile = filepath.Join(AppDataPath, OAuth2.JWTSigningPrivateKeyFile)
}
key := make([]byte, 32)
n, err := base64.RawURLEncoding.Decode(key, []byte(OAuth2.JWTSecretBase64))
if err != nil || n != 32 {
key, err = generate.NewJwtSecret()
if err != nil {
log.Fatal("error generating JWT secret: %v", err)
}
if InstallLock {
key := make([]byte, 32)
n, err := base64.RawURLEncoding.Decode(key, []byte(OAuth2.JWTSecretBase64))
if err != nil || n != 32 {
key, err = generate.NewJwtSecret()
if err != nil {
log.Fatal("error generating JWT secret: %v", err)
}
secretBase64 := base64.RawURLEncoding.EncodeToString(key)
rootCfg.Section("oauth2").Key("JWT_SECRET").SetValue(secretBase64)
if err := rootCfg.Save(); err != nil {
log.Fatal("save oauth2.JWT_SECRET failed: %v", err)
secretBase64 := base64.RawURLEncoding.EncodeToString(key)
rootCfg.Section("oauth2").Key("JWT_SECRET").SetValue(secretBase64)
if err := rootCfg.Save(); err != nil {
log.Fatal("save oauth2.JWT_SECRET failed: %v", err)
}
}
}
}

View File

@ -262,7 +262,7 @@ func loadRunModeFrom(rootCfg ConfigProvider) {
RunUser = rootSec.Key("RUN_USER").MustString(user.CurrentUsername())
// The following is a purposefully undocumented option. Please do not run Gitea as root. It will only cause future headaches.
// Please don't use root as a bandaid to "fix" something that is broken, instead the broken thing should instead be fixed properly.
unsafeAllowRunAsRoot := rootSec.Key("I_AM_BEING_UNSAFE_RUNNING_AS_ROOT").MustBool(false)
unsafeAllowRunAsRoot := ConfigSectionKeyBool(rootSec, "I_AM_BEING_UNSAFE_RUNNING_AS_ROOT")
RunMode = os.Getenv("GITEA_RUN_MODE")
if RunMode == "" {
RunMode = rootSec.Key("RUN_MODE").MustString("prod")

2
package-lock.json generated
View File

@ -4,8 +4,6 @@
"requires": true,
"packages": {
"": {
"name": "gitea",
"license": "MIT",
"dependencies": {
"@citation-js/core": "0.6.8",
"@citation-js/plugin-bibtex": "0.6.8",

View File

@ -1,7 +1,4 @@
{
"name": "gitea",
"license": "MIT",
"private": true,
"type": "module",
"engines": {
"node": ">= 16.0.0"

View File

@ -1,4 +1,4 @@
[virtualenvs]
in-project = true
no-pip = true
no-setuptools = true
options.no-pip = true
options.no-setuptools = true

View File

@ -13,7 +13,3 @@ djlint = "1.31.0"
[tool.djlint]
profile="golang"
ignore="H005,H006,H008,H013,H014,H016,H020,H021,H023,H026,H030,H031,T027"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

View File

@ -102,12 +102,13 @@
<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_label"}}">
</div>
<span class="info">{{.locale.Tr "repo.issues.filter_label_exclude" | Safe}}</span>
<div class="ui divider"></div>
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels=0&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_label_select_no_label"}}</a>
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_label_no_select"}}</a>
{{$previousExclusiveScope := "_no_scope"}}
{{range .Labels}}
{{$exclusiveScope := .ExclusiveScope}}
{{if and (ne $previousExclusiveScope "_no_scope") (ne $previousExclusiveScope $exclusiveScope)}}
{{if and (ne $previousExclusiveScope $exclusiveScope)}}
<div class="ui divider"></div>
{{end}}
{{$previousExclusiveScope = $exclusiveScope}}

View File

@ -149,7 +149,6 @@
.repository .filter.menu.labels .label-filter .menu .info {
display: inline-block;
padding: 0.5rem 0.25rem;
border-bottom: 1px solid var(--color-secondary);
font-size: 12px;
width: 100%;
white-space: nowrap;

View File

@ -268,10 +268,10 @@ function linkAction(e) {
e.preventDefault();
// A "link-action" can post AJAX request to its "data-url"
// Then the browser is redirect to: the "redirect" in response, or "data-redirect" attribute, or current URL by reloading.
// If the "link-action" has "data-modal-confirm(-html)" attribute, a confirm modal dialog will be shown before taking action.
// Then the browser is redirected to: the "redirect" in response, or "data-redirect" attribute, or current URL by reloading.
// If the "link-action" has "data-modal-confirm" attribute, a confirm modal dialog will be shown before taking action.
const $this = $(e.target);
const $this = $(this);
const redirect = $this.attr('data-redirect');
const doRequest = () => {

View File

@ -149,6 +149,7 @@ export function initRepoIssueSidebarList() {
}
}
});
$('.ui.dropdown.label-filter').dropdown('setting', {'hideDividers': 'empty'}).dropdown('refreshItems');
}
export function initRepoIssueCommentDelete() {