Skip to content

Commit 3be44b5

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Fix broken clone script on an empty archived repo (go-gitea#24339) Improve RSS (go-gitea#24335) Automatically select the org when click create repo from org dashboard (go-gitea#24325) on schedule on schedule switch to use Actions from drone for cron (go-gitea#24314) [skip ci] Updated translations via Crowdin Restore bold on repolist (go-gitea#24337) Fix template function DateTime (go-gitea#24317) Fix incorrect CORS response in Http Git handler (go-gitea#24303) Updated upgrade script that is informing user that Gitea service has to be running in order to upgrade it (go-gitea#24260) Add tags list for repos whose release setting is disabled (go-gitea#23465) Refactor config provider (go-gitea#24245) Add RSS Feeds for branches and files (go-gitea#22719) Make SVG in dropdown menu have the same margin-right as IMG (go-gitea#24316) Respect the REGISTER_MANUAL_CONFIRM setting when registering via OIDC (go-gitea#24035)
2 parents 0a90017 + f2f0fb4 commit 3be44b5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+941
-602
lines changed

.drone.yml

Lines changed: 0 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -773,109 +773,6 @@ steps:
773773
- name: deps
774774
path: /go
775775

776-
---
777-
kind: pipeline
778-
name: update_translations
779-
780-
platform:
781-
os: linux
782-
arch: arm64
783-
784-
trigger:
785-
branch:
786-
- main
787-
event:
788-
- cron
789-
cron:
790-
- update_translations
791-
792-
steps:
793-
- name: download
794-
image: jonasfranz/crowdin
795-
pull: always
796-
settings:
797-
download: true
798-
export_dir: options/locale/
799-
ignore_branch: true
800-
project_identifier: gitea
801-
environment:
802-
CROWDIN_KEY:
803-
from_secret: crowdin_key
804-
805-
- name: update
806-
image: alpine:3.17
807-
pull: always
808-
commands:
809-
- ./build/update-locales.sh
810-
811-
- name: push
812-
image: appleboy/drone-git-push
813-
pull: always
814-
settings:
815-
author_email: "[email protected]"
816-
author_name: GiteaBot
817-
branch: main
818-
commit: true
819-
commit_message: "[skip ci] Updated translations via Crowdin"
820-
remote: "[email protected]:go-gitea/gitea.git"
821-
environment:
822-
DRONE_COMMIT_AUTHOR_EMAIL: "[email protected]"
823-
DRONE_COMMIT_AUTHOR: GiteaBot
824-
GIT_PUSH_SSH_KEY:
825-
from_secret: git_push_ssh_key
826-
827-
- name: upload_translations
828-
image: jonasfranz/crowdin
829-
pull: always
830-
settings:
831-
files:
832-
locale_en-US.ini: options/locale/locale_en-US.ini
833-
ignore_branch: true
834-
project_identifier: gitea
835-
environment:
836-
CROWDIN_KEY:
837-
from_secret: crowdin_key
838-
839-
---
840-
kind: pipeline
841-
type: docker
842-
name: update_gitignore_and_licenses
843-
844-
platform:
845-
os: linux
846-
arch: arm64
847-
848-
trigger:
849-
branch:
850-
- main
851-
event:
852-
- cron
853-
cron:
854-
- update_gitignore_and_licenses
855-
856-
steps:
857-
- name: download
858-
image: gitea/test_env:linux-1.20-amd64
859-
pull: always
860-
commands:
861-
- timeout -s ABRT 40m make generate-license generate-gitignore
862-
863-
- name: push
864-
image: appleboy/drone-git-push
865-
pull: always
866-
settings:
867-
author_email: "[email protected]"
868-
author_name: "GiteaBot"
869-
branch: main
870-
commit: true
871-
commit_message: "[skip ci] Updated licenses and gitignores"
872-
remote: "[email protected]:go-gitea/gitea.git"
873-
environment:
874-
DRONE_COMMIT_AUTHOR_EMAIL: "[email protected]"
875-
DRONE_COMMIT_AUTHOR: "GiteaBot"
876-
GIT_PUSH_SSH_KEY:
877-
from_secret: git_push_ssh_key
878-
879776
---
880777
kind: pipeline
881778
type: docker

.github/workflows/cron-licenses.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
on:
2+
schedule:
3+
# weekly on Monday at 0:07 UTC
4+
- cron: "7 0 * * 1"
5+
6+
name: Update licenses and gitignores
7+
8+
jobs:
9+
cron:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
- uses: actions/setup-go@v3
15+
with:
16+
go-version: '>=1.20.1'
17+
- name: update licenses and gitignores
18+
run: timeout -s ABRT 40m make generate-license generate-gitignore
19+
- name: push translations to repo
20+
uses: appleboy/[email protected]
21+
with:
22+
author_email: "[email protected]"
23+
author_name: GiteaBot
24+
branch: main
25+
commit: true
26+
commit_message: "[skip ci] Updated licenses and gitignores"
27+
remote: "[email protected]:go-gitea/gitea.git"
28+
ssh_key: ${{ secrets.DEPLOY_KEY }}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
on:
2+
schedule:
3+
- cron: "7 0 * * *" # every day at 0:07 UTC
4+
5+
name: Pull translations from Crowdin
6+
7+
jobs:
8+
crowdin_pull:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
- name: download from crowdin
14+
uses: docker://jonasfranz/crowdin
15+
env:
16+
CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }}
17+
PLUGIN_DOWNLOAD: true
18+
PLUGIN_EXPORT_DIR: options/locale/
19+
PLUGIN_IGNORE_BRANCH: true
20+
PLUGIN_PROJECT_IDENTIFIER: gitea
21+
- name: update locales
22+
run: ./build/update-locales.sh
23+
- name: push translations to repo
24+
uses: appleboy/[email protected]
25+
with:
26+
author_email: "[email protected]"
27+
author_name: GiteaBot
28+
branch: main
29+
commit: true
30+
commit_message: "[skip ci] Updated translations via Crowdin"
31+
remote: "[email protected]:go-gitea/gitea.git"
32+
ssh_key: ${{ secrets.DEPLOY_KEY }}
33+
crowdin_push:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v3
38+
- name: push translations to crowdin
39+
uses: docker://jonasfranz/crowdin
40+
env:
41+
CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }}
42+
PLUGIN_UPLOAD: true
43+
PLUGIN_IGNORE_BRANCH: true
44+
PLUGIN_PROJECT_IDENTIFIER: gitea
45+
PLUGIN_FILES: |
46+
locale_en-US.ini: options/locale/locale_en-US.ini
47+
PLUGIN_BRANCH: main

cmd/web.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424

2525
"github.com/felixge/fgprof"
2626
"github.com/urfave/cli"
27-
ini "gopkg.in/ini.v1"
2827
)
2928

3029
// PIDFile could be set from build tag
@@ -223,9 +222,10 @@ func setPort(port string) error {
223222
defaultLocalURL += ":" + setting.HTTPPort + "/"
224223

225224
// Save LOCAL_ROOT_URL if port changed
226-
setting.CreateOrAppendToCustomConf("server.LOCAL_ROOT_URL", func(cfg *ini.File) {
227-
cfg.Section("server").Key("LOCAL_ROOT_URL").SetValue(defaultLocalURL)
228-
})
225+
setting.CfgProvider.Section("server").Key("LOCAL_ROOT_URL").SetValue(defaultLocalURL)
226+
if err := setting.CfgProvider.Save(); err != nil {
227+
return fmt.Errorf("Failed to save config file: %v", err)
228+
}
229229
}
230230
return nil
231231
}

contrib/upgrade.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@
1010
# upgrade.sh 1.15.10
1111
# giteahome=/opt/gitea giteaconf=$giteahome/app.ini upgrade.sh
1212

13+
# Check if gitea service is running
14+
if ! pidof gitea &> /dev/null; then
15+
echo "Error: gitea is not running."
16+
exit 1
17+
fi
18+
19+
# Continue with rest of the script if gitea is running
20+
echo "Gitea is running. Continuing with rest of script..."
21+
1322
# apply variables from environment
1423
: "${giteabin:="/usr/local/bin/gitea"}"
1524
: "${giteahome:="/var/lib/gitea"}"

modules/indexer/issues/indexer_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
_ "code.gitea.io/gitea/models"
1717

1818
"github.com/stretchr/testify/assert"
19-
"gopkg.in/ini.v1"
2019
)
2120

2221
func TestMain(m *testing.M) {
@@ -27,7 +26,7 @@ func TestMain(m *testing.M) {
2726

2827
func TestBleveSearchIssues(t *testing.T) {
2928
assert.NoError(t, unittest.PrepareTestDatabase())
30-
setting.CfgProvider = ini.Empty()
29+
setting.CfgProvider = setting.NewEmptyConfigProvider()
3130

3231
tmpIndexerDir := t.TempDir()
3332

modules/indexer/stats/indexer_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818
_ "code.gitea.io/gitea/models"
1919

2020
"github.com/stretchr/testify/assert"
21-
"gopkg.in/ini.v1"
2221
)
2322

2423
func TestMain(m *testing.M) {
@@ -29,7 +28,7 @@ func TestMain(m *testing.M) {
2928

3029
func TestRepoStatsIndex(t *testing.T) {
3130
assert.NoError(t, unittest.PrepareTestDatabase())
32-
setting.CfgProvider = ini.Empty()
31+
setting.CfgProvider = setting.NewEmptyConfigProvider()
3332

3433
setting.LoadQueueSettings()
3534

0 commit comments

Comments
 (0)