Skip to content

Commit fd373e7

Browse files
authored
Merge branch 'main' into add-missing-repo-units
2 parents 679c5b8 + 623a539 commit fd373e7

File tree

20 files changed

+450
-153
lines changed

20 files changed

+450
-153
lines changed

.drone.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ trigger:
11291129

11301130
steps:
11311131
- name: build-docs
1132-
image: gitea/test_env:linux-1.20-amd64
1132+
image: gitea/test_env:linux-1.20-arm64
11331133
commands:
11341134
- cd docs
11351135
- make trans-copy clean build

cmd/web.go

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import (
99
"net"
1010
"net/http"
1111
"os"
12+
"path/filepath"
13+
"strconv"
1214
"strings"
1315

1416
_ "net/http/pprof" // Used for debugging if enabled and a web server is running
@@ -25,6 +27,9 @@ import (
2527
ini "gopkg.in/ini.v1"
2628
)
2729

30+
// PIDFile could be set from build tag
31+
var PIDFile = "/run/gitea.pid"
32+
2833
// CmdWeb represents the available web sub-command.
2934
var CmdWeb = cli.Command{
3035
Name: "web",
@@ -45,7 +50,7 @@ and it takes care of all the other things for you`,
4550
},
4651
cli.StringFlag{
4752
Name: "pid, P",
48-
Value: setting.PIDFile,
53+
Value: PIDFile,
4954
Usage: "Custom pid file path",
5055
},
5156
cli.BoolFlag{
@@ -81,6 +86,22 @@ func runHTTPRedirector() {
8186
}
8287
}
8388

89+
func createPIDFile(pidPath string) {
90+
currentPid := os.Getpid()
91+
if err := os.MkdirAll(filepath.Dir(pidPath), os.ModePerm); err != nil {
92+
log.Fatal("Failed to create PID folder: %v", err)
93+
}
94+
95+
file, err := os.Create(pidPath)
96+
if err != nil {
97+
log.Fatal("Failed to create PID file: %v", err)
98+
}
99+
defer file.Close()
100+
if _, err := file.WriteString(strconv.FormatInt(int64(currentPid), 10)); err != nil {
101+
log.Fatal("Failed to write PID information: %v", err)
102+
}
103+
}
104+
84105
func runWeb(ctx *cli.Context) error {
85106
if ctx.Bool("verbose") {
86107
_ = log.DelLogger("console")
@@ -107,8 +128,7 @@ func runWeb(ctx *cli.Context) error {
107128

108129
// Set pid file setting
109130
if ctx.IsSet("pid") {
110-
setting.PIDFile = ctx.String("pid")
111-
setting.WritePIDFile = true
131+
createPIDFile(ctx.String("pid"))
112132
}
113133

114134
// Perform pre-initialization

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
THEME := themes/gitea
22
PUBLIC := public
3-
ARCHIVE := https://dl.gitea.io/theme/master.tar.gz
3+
ARCHIVE := https://dl.gitea.com/theme/main.tar.gz
44

55
HUGO_PACKAGE := github.com/gohugoio/[email protected]
66

docs/content/doc/installation/from-source.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ using the `LDFLAGS` environment variable for `make`. The appropriate settings ar
159159
- For _`CustomConf`_ you should use `-X \"code.gitea.io/gitea/modules/setting.CustomConf=conf.ini\"`
160160
- For _`AppWorkPath`_ you should use `-X \"code.gitea.io/gitea/modules/setting.AppWorkPath=working-path\"`
161161
- For _`StaticRootPath`_ you should use `-X \"code.gitea.io/gitea/modules/setting.StaticRootPath=static-root-path\"`
162-
- To change the default PID file location use `-X \"code.gitea.io/gitea/modules/setting.PIDFile=/run/gitea.pid\"`
162+
- To change the default PID file location use `-X \"code.gitea.io/gitea/cmd.PIDFile=/run/gitea.pid\"`
163163

164164
Add as many of the strings with their preceding `-X` to the `LDFLAGS` variable and run `make build`
165165
with the appropriate `TAGS` as above.

models/fixtures/repository.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
fork_id: 0
2626
is_template: false
2727
template_id: 0
28-
size: 7028
28+
size: 7320
2929
is_fsck_enabled: true
3030
close_issues_via_commit_in_any_branch: false
3131

modules/setting/database.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ var (
5454

5555
// LoadDBSetting loads the database settings
5656
func LoadDBSetting() {
57-
sec := CfgProvider.Section("database")
57+
loadDBSetting(CfgProvider)
58+
}
59+
60+
func loadDBSetting(rootCfg ConfigProvider) {
61+
sec := rootCfg.Section("database")
5862
Database.Type = DatabaseType(sec.Key("DB_TYPE").String())
5963
defaultCharset := "utf8"
6064

modules/setting/setting.go

Lines changed: 13 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"path"
1313
"path/filepath"
1414
"runtime"
15-
"strconv"
1615
"strings"
1716
"time"
1817

@@ -42,15 +41,13 @@ var (
4241
AppWorkPath string
4342

4443
// Global setting objects
45-
CfgProvider ConfigProvider
46-
CustomPath string // Custom directory path
47-
CustomConf string
48-
PIDFile = "/run/gitea.pid"
49-
WritePIDFile bool
50-
RunMode string
51-
RunUser string
52-
IsProd bool
53-
IsWindows bool
44+
CfgProvider ConfigProvider
45+
CustomPath string // Custom directory path
46+
CustomConf string
47+
RunMode string
48+
RunUser string
49+
IsProd bool
50+
IsWindows bool
5451
)
5552

5653
func getAppPath() (string, error) {
@@ -141,22 +138,6 @@ func IsRunUserMatchCurrentUser(runUser string) (string, bool) {
141138
return currentUser, runUser == currentUser
142139
}
143140

144-
func createPIDFile(pidPath string) {
145-
currentPid := os.Getpid()
146-
if err := os.MkdirAll(filepath.Dir(pidPath), os.ModePerm); err != nil {
147-
log.Fatal("Failed to create PID folder: %v", err)
148-
}
149-
150-
file, err := os.Create(pidPath)
151-
if err != nil {
152-
log.Fatal("Failed to create PID file: %v", err)
153-
}
154-
defer file.Close()
155-
if _, err := file.WriteString(strconv.FormatInt(int64(currentPid), 10)); err != nil {
156-
log.Fatal("Failed to write PID information: %v", err)
157-
}
158-
}
159-
160141
// SetCustomPathAndConf will set CustomPath and CustomConf with reference to the
161142
// GITEA_CUSTOM environment variable and with provided overrides before stepping
162143
// back to the default
@@ -218,17 +199,17 @@ func PrepareAppDataPath() error {
218199

219200
// InitProviderFromExistingFile initializes config provider from an existing config file (app.ini)
220201
func InitProviderFromExistingFile() {
221-
CfgProvider = newFileProviderFromConf(CustomConf, WritePIDFile, false, PIDFile, "")
202+
CfgProvider = newFileProviderFromConf(CustomConf, false, "")
222203
}
223204

224205
// InitProviderAllowEmpty initializes config provider from file, it's also fine that if the config file (app.ini) doesn't exist
225206
func InitProviderAllowEmpty() {
226-
CfgProvider = newFileProviderFromConf(CustomConf, WritePIDFile, true, PIDFile, "")
207+
CfgProvider = newFileProviderFromConf(CustomConf, true, "")
227208
}
228209

229210
// InitProviderAndLoadCommonSettingsForTest initializes config provider and load common setttings for tests
230211
func InitProviderAndLoadCommonSettingsForTest(extraConfigs ...string) {
231-
CfgProvider = newFileProviderFromConf(CustomConf, WritePIDFile, true, PIDFile, strings.Join(extraConfigs, "\n"))
212+
CfgProvider = newFileProviderFromConf(CustomConf, true, strings.Join(extraConfigs, "\n"))
232213
loadCommonSettingsFrom(CfgProvider)
233214
if err := PrepareAppDataPath(); err != nil {
234215
log.Fatal("Can not prepare APP_DATA_PATH: %v", err)
@@ -241,13 +222,9 @@ func InitProviderAndLoadCommonSettingsForTest(extraConfigs ...string) {
241222

242223
// newFileProviderFromConf initializes configuration context.
243224
// NOTE: do not print any log except error.
244-
func newFileProviderFromConf(customConf string, writePIDFile, allowEmpty bool, pidFile, extraConfig string) *ini.File {
225+
func newFileProviderFromConf(customConf string, allowEmpty bool, extraConfig string) *ini.File {
245226
cfg := ini.Empty()
246227

247-
if writePIDFile && len(pidFile) > 0 {
248-
createPIDFile(pidFile)
249-
}
250-
251228
isFile, err := util.IsFile(customConf)
252229
if err != nil {
253230
log.Error("Unable to check if %s is a file. Error: %v", customConf, err)
@@ -380,7 +357,7 @@ func CreateOrAppendToCustomConf(purpose string, callback func(cfg *ini.File)) {
380357

381358
// LoadSettings initializes the settings for normal start up
382359
func LoadSettings() {
383-
LoadDBSetting()
360+
loadDBSetting(CfgProvider)
384361
loadServiceFrom(CfgProvider)
385362
loadOAuth2ClientFrom(CfgProvider)
386363
InitLogs(false)
@@ -401,7 +378,7 @@ func LoadSettings() {
401378

402379
// LoadSettingsForInstall initializes the settings for install
403380
func LoadSettingsForInstall() {
404-
LoadDBSetting()
381+
loadDBSetting(CfgProvider)
405382
loadServiceFrom(CfgProvider)
406383
loadMailerFrom(CfgProvider)
407384
}

options/locale/locale_ja-JP.ini

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2418,7 +2418,6 @@ settings.delete_prompt=組織は恒久的に削除され、元に戻すことは
24182418
settings.confirm_delete_account=削除を確認
24192419
settings.delete_org_title=組織の削除
24202420
settings.delete_org_desc=組織を恒久的に削除します。 続行しますか?
2421-
settings.hooks_desc=この組織の<strong>すべてのリポジトリ</strong>に対して発行されるWebhookを追加します。
24222421

24232422
settings.labels_desc=この組織の<strong>すべてのリポジトリ</strong>で使用可能なイシューラベルを追加します。
24242423

@@ -2809,6 +2808,8 @@ auths.still_in_used=この認証ソースはまだ使用中です。 先に、
28092808
auths.deletion_success=認証ソースを削除しました。
28102809
auths.login_source_exist=認証ソース '%s' は既に存在します。
28112810
auths.login_source_of_type_exist=このタイプの認証ソースは既に存在します。
2811+
auths.unable_to_initialize_openid=OpenID Connectプロバイダーを初期化できませんでした: %s
2812+
auths.invalid_openIdConnectAutoDiscoveryURL=無効な自動検出URLです(http://またはhttps://で始まる有効なURLでなければなりません)
28122813

28132814
config.server_config=サーバー設定
28142815
config.app_name=サイトのタイトル
@@ -3350,6 +3351,8 @@ runs.open_tab=%d オープン
33503351
runs.closed_tab=%d クローズ
33513352
runs.commit=コミット
33523353
runs.pushed_by=Pushed by
3354+
runs.valid_workflow_helper=ワークフロー設定ファイルは有効です。
3355+
runs.invalid_workflow_helper=ワークフロー設定ファイルは無効です。あなたの設定ファイルを確認してください: %s
33533356

33543357
need_approval_desc=フォークプルリクエストのワークフローを実行するには承認が必要です。
33553358

options/locale/locale_pt-BR.ini

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2934,6 +2934,8 @@ config.git_disable_diff_highlight=Desabilitar realce de mudanças no diff
29342934
config.git_max_diff_lines=Máximo de linhas mostradas no diff (para um único arquivo)
29352935
config.git_max_diff_line_characters=Máximo de caracteres mostrados no diff (para uma única linha)
29362936
config.git_max_diff_files=Máximo de arquivos a serem mostrados no diff
2937+
config.git_enable_reflogs=Habilitar Reflogs
2938+
config.git_reflog_expiry_time=Tempo de expiração
29372939
config.git_gc_args=Argumentos do GC
29382940
config.git_migrate_timeout=Tempo limite de migração
29392941
config.git_mirror_timeout=Tempo limite de atualização de espelhamento
@@ -3238,6 +3240,9 @@ rubygems.required.ruby=Requer o Ruby versão
32383240
rubygems.required.rubygems=Requer o RubyGem versão
32393241
rubygems.documentation=Para obter mais informações sobre o registro do RubyGems, consulte <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/rubygems/">a documentação</a>.
32403242
swift.registry=Configure este registro pela linha de comando:
3243+
swift.install=Adicione o pacote em seu arquivo <code>Package.swift</code>:
3244+
swift.install2=e execute o seguinte comando:
3245+
swift.documentation=Para obter mais informações sobre o registro Swift, consulte <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/swift/">a documentação</a>.
32413246
vagrant.install=Para adicionar uma Vagrant box, execute o seguinte comando:
32423247
vagrant.documentation=Para obter mais informações sobre o registro do Vagrant, consulte <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/vagrant/">a documentação</a>.
32433248
settings.link=Vincular este pacote a um repositório
@@ -3355,6 +3360,8 @@ runs.open_tab=%d Aberto
33553360
runs.closed_tab=%d Fechado
33563361
runs.commit=Commit
33573362
runs.pushed_by=Push realizado por
3363+
runs.valid_workflow_helper=Arquivo de configuração do workflow é válido.
3364+
runs.invalid_workflow_helper=O arquivo de configuração do workflow é inválido. Por favor, verifique seu arquivo de configuração: %s
33583365

3359-
need_approval_desc=Precisa de aprovação para executar workflowa para pull request do fork.
3366+
need_approval_desc=Precisa de aprovação para executar workflows para pull request do fork.
33603367

options/locale/locale_pt-PT.ini

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1930,7 +1930,7 @@ settings.trust_model.default=Modelo de confiança padrão
19301930
settings.trust_model.default.desc=Usar o modelo de confiança padrão do repositório para esta instalação.
19311931
settings.trust_model.collaborator=Colaborador
19321932
settings.trust_model.collaborator.long=Colaborador: Confiar nas assinaturas dos colaboradores
1933-
settings.trust_model.collaborator.desc=Assinaturas válidas dos colaboradores deste repositório serão marcadas como "fiável" (quer correspondam ou não ao autor do cometimento). Caso contrário, assinaturas válidas serão marcadas como "não fiável" se a assinatura corresponder ao autor do cometimento e "não corresponde", se não corresponder.
1933+
settings.trust_model.collaborator.desc=Assinaturas válidas dos colaboradores deste repositório serão marcadas como "fiável" (independentemente de corresponderem, ou não, ao autor do cometimento). Caso contrário, assinaturas válidas serão marcadas como "não fiável" se a assinatura corresponder ao autor do cometimento e "não corresponde", se não corresponder.
19341934
settings.trust_model.committer=Autor do cometimento
19351935
settings.trust_model.committer.long=Autor do cometimento: Confiar nas assinaturas que correspondam aos autores dos cometimentos (isto corresponde ao funcionamento do GitHub e força a que os cometimentos assinados do Gitea tenham o Gitea como autor do cometimento)
19361936
settings.trust_model.committer.desc=Assinaturas válidas apenas serão marcadas como "fiável" se corresponderem ao autor do cometimento, caso contrário serão marcadas como "não corresponde". Isto irá forçar a que o Gitea seja o autor do cometimento nos cometimentos assinados, ficando o autor real marcado como "Co-autorado-por:" e "Co-cometido-por:" no resumo do cometimento. A chave padrão do Gitea tem que corresponder a um utilizador na base de dados.
@@ -3348,18 +3348,20 @@ runners.delete_runner=Eliminar o executor
33483348
runners.delete_runner_success=O executor foi eliminado com sucesso
33493349
runners.delete_runner_failed=Falhou ao eliminar o executor
33503350
runners.delete_runner_header=Confirme que quer eliminar este executor
3351-
runners.delete_runner_notice=Se uma tarefa estiver a correr sob este executor, será terminada e marcada como tendo falhado. Pode quebrar o fluxo de trabalho de construção.
3351+
runners.delete_runner_notice=Se uma tarefa estiver a correr sob este executor, será terminada e marcada como tendo falhado. Isso poderá quebrar a sequência de trabalho de construção.
33523352
runners.none=Não há executores disponíveis
33533353
runners.status.unspecified=Desconhecido
33543354
runners.status.idle=Parada
33553355
runners.status.active=Em funcionamento
33563356
runners.status.offline=Desconectada
33573357

3358-
runs.all_workflows=Todos os fluxos de trabalho
3358+
runs.all_workflows=Todas as sequências de trabalho
33593359
runs.open_tab=%d abertas
33603360
runs.closed_tab=%d fechadas
33613361
runs.commit=Cometimento
33623362
runs.pushed_by=Enviada por
3363+
runs.valid_workflow_helper=O ficheiro de configuração da sequência de trabalho é válido.
3364+
runs.invalid_workflow_helper=O ficheiro de configuração da sequência de trabalho é inválido. Verifique o seu ficheiro de configuração: %s
33633365

3364-
need_approval_desc=É necessária aprovação para executar fluxos de trabalho para a derivação do pedido de integração.
3366+
need_approval_desc=É necessária aprovação para executar sequências de trabalho para a derivação do pedido de integração.
33653367

options/locale/locale_zh-TW.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2929,6 +2929,7 @@ config.git_disable_diff_highlight=停用比較語法高亮
29292929
config.git_max_diff_lines=差異比較時顯示的最多行數 (單檔)
29302930
config.git_max_diff_line_characters=差異比較時顯示的最多字元數 (單行)
29312931
config.git_max_diff_files=差異比較時顯示的最多檔案數
2932+
config.git_enable_reflogs=啟用 Reflogs
29322933
config.git_gc_args=GC 參數
29332934
config.git_migrate_timeout=遷移逾時
29342935
config.git_mirror_timeout=鏡像更新超時

0 commit comments

Comments
 (0)