Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into fix-17477-make-mailer…
Browse files Browse the repository at this point in the history
…-envelope-from-optional
  • Loading branch information
zeripath committed Oct 30, 2021
2 parents 20edfa5 + 76a3190 commit e223dfd
Show file tree
Hide file tree
Showing 11 changed files with 88 additions and 22 deletions.
2 changes: 1 addition & 1 deletion models/consistency.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ func DeleteOrphanedIssues() error {
// CountOrphanedObjects count subjects with have no existing refobject anymore
func CountOrphanedObjects(subject, refobject, joinCond string) (int64, error) {
return db.GetEngine(db.DefaultContext).Table("`"+subject+"`").
Join("LEFT", refobject, joinCond).
Join("LEFT", "`"+refobject+"`", joinCond).
Where(builder.IsNull{"`" + refobject + "`.id"}).
Count("id")
}
Expand Down
25 changes: 22 additions & 3 deletions models/db/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,35 @@ func syncTables() error {
return x.StoreEngine("InnoDB").Sync2(tables...)
}

// NewTestEngine sets a new test xorm.Engine
func NewTestEngine() (err error) {
// NewInstallTestEngine creates a new xorm.Engine for testing during install
//
// This function will cause the basic database schema to be created
func NewInstallTestEngine(ctx context.Context, migrateFunc func(*xorm.Engine) error) (err error) {
x, err = GetNewEngine()
if err != nil {
return fmt.Errorf("Connect to database: %v", err)
return fmt.Errorf("failed to connect to database: %w", err)
}

x.SetMapper(names.GonicMapper{})
x.SetLogger(NewXORMLogger(!setting.IsProd))
x.ShowSQL(!setting.IsProd)

x.SetDefaultContext(ctx)

if err = x.Ping(); err != nil {
return err
}

// We have to run migrateFunc here in case the user is re-running installation on a previously created DB.
// If we do not then table schemas will be changed and there will be conflicts when the migrations run properly.
//
// Installation should only be being re-run if users want to recover an old database.
// However, we should think carefully about should we support re-install on an installed instance,
// as there may be other problems due to secret reinitialization.
if err = migrateFunc(x); err != nil {
return fmt.Errorf("migrate: %v", err)
}

return syncTables()
}

Expand Down
1 change: 0 additions & 1 deletion options/locale/locale_el-GR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2780,7 +2780,6 @@ publish_release=`έκδωσε τη <a href="%s/releases/tag/%s"> "%[4]s" </a> σ
review_dismissed=`ακύρωσε την εξέταση από <b>%[4]s</b> for <a href="%[1]s/pulls/%[2]s">%[3]s#%[2]s</a>`
review_dismissed_reason=Αιτία:
create_branch=δημιούργησε το κλάδο <a href="%[1]s/src/branch/%[2]s">%[3]s</a> στο <a href="%[1]s">%[4]s</a>
stared_repo=έδωσε αστέρι στο <a href="%[1]s">%[2]s</a>
watched_repo=άρχισε να παρακολουθεί το <a href="%[1]s">%[2]s</a>
[tool]
Expand Down
40 changes: 40 additions & 0 deletions options/locale/locale_es-ES.ini
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,7 @@ migrate_items_releases=Lanzamientos
migrate_repo=Migrar Repositorio
migrate.clone_address=Migrar / Clonar desde URL
migrate.clone_address_desc=La URL HTTP(S) o de Git 'clone' de un repositorio existente
migrate.github_token_desc=Puedes poner uno o más tokens con comas separadas aquí para hacer migrar más rápido debido al límite de velocidad de Github API. PRECAUCIÓN: Abusar esta característica puede violar la política del proveedor de servicios y llevar a bloquear la cuenta.
migrate.clone_local_path=o una ruta local del servidor
migrate.permission_denied=No te está permitido importar repositorios locales.
migrate.permission_denied_blocked=No está permitido importar desde hosts bloqueados.
Expand Down Expand Up @@ -924,6 +925,8 @@ star_guest_user=Iniciar sesión para destacar este repositorio.
copy_link=Copiar
copy_link_success=El enlace ha sido copiado
copy_link_error=Use ⌘ + C o Ctrl-C para copiar
copy_branch=Copiar
copy_branch_success=El nombre de la rama ha sido copiado
copied=Copiado OK
unwatch=Dejar de seguir
watch=Seguir
Expand Down Expand Up @@ -977,6 +980,7 @@ commit_graph=Gráfico de commits
commit_graph.select=Seleccionar ramas
commit_graph.hide_pr_refs=Ocultar Pull Requests
commit_graph.monochrome=Mono
commit_graph.color=Color
blame=Blame
normal_view=Vista normal
line=línea
Expand Down Expand Up @@ -1093,6 +1097,7 @@ projects.board.set_default=Establecer como predeterminado
projects.board.set_default_desc=Establecer este tablero como predeterminado para incidencias no categorizadas y pulls
projects.board.delete=Eliminar tablón
projects.board.deletion_desc=Eliminar un tablón de proyecto mueve todas las incidencias relacionadas a 'Sin categorizar'. ¿Continuar?
projects.board.color=Color
projects.open=Abrir
projects.close=Cerrar

Expand Down Expand Up @@ -1196,6 +1201,11 @@ issues.action_milestone_no_select=Sin hito
issues.action_assignee=Asignado a
issues.action_assignee_no_select=Sin asignado
issues.opened_by=abierta %[1]s por <a href="%[2]s">%[3]s</a>
pulls.merged_by=fusionado %[1]s por <a href="%[2]s">%[3]s</a>
pulls.merged_by_fake=fusionado %[1]s por %[2]s
issues.closed_by=cerrada %[1]s por <a href="%[2]s">%[3]s</a>
issues.opened_by_fake=abierta %[1]s por %[2]s
issues.closed_by_fake=cerrada %[1]s por %[2]s
issues.previous=Página Anterior
issues.next=Página Siguiente
issues.open_title=Abierta
Expand Down Expand Up @@ -1370,6 +1380,12 @@ issues.review.un_resolve_conversation=Marcar conversación sin resolver
issues.review.resolved_by=ha marcado esta conversación como resuelta
issues.assignee.error=No todos los asignados fueron añadidos debido a un error inesperado.
issues.reference_issue.body=Cuerpo
issues.content_history.deleted=borrado
issues.content_history.edited=editado
issues.content_history.created=creado
issues.content_history.delete_from_history=Eliminar del historial
issues.content_history.delete_from_history_confirm=¿Eliminar del historial?
issues.content_history.options=Opciones

compare.compare_base=base
compare.compare_head=comparar
Expand All @@ -1380,6 +1396,7 @@ pulls.compare_changes=Nuevo pull request
pulls.compare_changes_desc=Seleccione la rama en la que se fusiona y la rama a recuperar.
pulls.compare_base=fusionar en
pulls.compare_compare=recuperar de
pulls.switch_comparison_type=Cambiar tipo de comparación
pulls.filter_branch=Filtrar rama
pulls.no_results=Sin resultados.
pulls.nothing_to_compare=Estas ramas son iguales. No hay necesidad para crear un pull request.
Expand Down Expand Up @@ -1783,6 +1800,7 @@ settings.content_type=Tipo de contenido POST
settings.secret=Secreto
settings.slack_username=Nombre de usuario
settings.slack_icon_url=URL de icono
settings.slack_color=Color
settings.discord_username=Usuario
settings.discord_icon_url=URL de icono
settings.event_desc=Activar:
Expand Down Expand Up @@ -1974,6 +1992,11 @@ settings.lfs_pointers.inRepo=En repositorio
settings.lfs_pointers.exists=Existe en almacén
settings.lfs_pointers.accessible=Accesible al usuario
settings.lfs_pointers.associateAccessible=Asociar %d OID accesibles
settings.rename_branch_failed_not_exist=No se puede renombrar la rama %s porque no existe.
settings.rename_branch_success=La rama %s se renombró correctamente a %s.
settings.rename_branch_from=nombre de la rama vieja
settings.rename_branch_to=nombre de la rama nueva
settings.rename_branch=Renombrar rama

diff.browse_source=Explorar el Código
diff.parent=padre
Expand Down Expand Up @@ -2003,6 +2026,8 @@ diff.file_image_height=Altura
diff.file_byte_size=Tamaño
diff.file_suppressed=La diferencia del archivo ha sido suprimido porque es demasiado grande
diff.file_suppressed_line_too_long=Las diferiencias del archivo han sido suprimidas porque una o mas lineas son muy largas
diff.too_many_files=Algunos archivos no se mostraron porque demasiados archivos han cambiado en esta diferencia
diff.show_more=Ver más
diff.generated=generado
diff.vendored=vendido
diff.comment.placeholder=Deja un comentario
Expand Down Expand Up @@ -2094,6 +2119,7 @@ branch.create_new_branch=Crear rama desde la rama:
branch.confirm_create_branch=Crear rama
branch.new_branch=Crear nueva rama
branch.new_branch_from=Crear nueva rama desde '%s'
branch.renamed=La rama %s fue renombrada a %s.

tag.create_tag=Crear etiqueta <strong>%s</strong>
tag.create_success=La etiqueta '%s' ha sido creada.
Expand Down Expand Up @@ -2346,6 +2372,17 @@ users.still_own_repo=Este usuario todavía posee uno o más depósitos. Eliminar
users.still_has_org=Este usuario es un miembro de una organización. Primero retire el usuario de cualquier organización.
users.deletion_success=La cuenta de usuario ha sido eliminada.
users.reset_2fa=Reiniciar 2FA
users.list_status_filter.menu_text=Filtro
users.list_status_filter.reset=Reiniciar
users.list_status_filter.is_active=Activo
users.list_status_filter.not_active=Inactivo
users.list_status_filter.is_admin=Administrador
users.list_status_filter.is_restricted=Restringido
users.list_status_filter.not_restricted=No restringido
users.list_status_filter.is_prohibit_login=Prohibido el inicio de sesión
users.list_status_filter.not_prohibit_login=Permitir el inicio de sesión
users.list_status_filter.is_2fa_enabled=2FA habilitado
users.list_status_filter.not_2fa_enabled=2FA deshabilitado

emails.email_manage_panel=Gestion de Correo del Usuario
emails.primary=Principal
Expand Down Expand Up @@ -2411,6 +2448,7 @@ auths.attribute_name=Atributo nombre
auths.attribute_surname=Atributo apellido
auths.attribute_mail=Atributo correo electrónico
auths.attribute_ssh_public_key=Atributo Clave Pública SSH
auths.attribute_avatar=Atributo del avatar
auths.attributes_in_bind=Obtener atributos en el contexto de Bind DN
auths.allow_deactivate_all=Permitir un resultado de búsqueda vacío para desactivar todos los usuarios
auths.use_paged_search=Usar búsqueda paginada
Expand Down Expand Up @@ -2448,6 +2486,7 @@ auths.oauth2_tokenURL=URL del token
auths.oauth2_authURL=URL de Autorización
auths.oauth2_profileURL=URL del perfil
auths.oauth2_emailURL=URL de correo
auths.skip_local_two_fa=Omitir 2FA local
auths.oauth2_tenant=Tenant
auths.enable_auto_register=Hablilitar Auto-Registro
auths.sspi_auto_create_users=Crear usuarios automáticamente
Expand Down Expand Up @@ -2735,6 +2774,7 @@ publish_release=`se lanzó <a href="%s/releases/tag/%s"> "%[4]s" </a> en <a href
review_dismissed=`descartó la revisión de <b>%[4]s</b> para <a href="%[1]s/pulls/%[2]s">%[3]s#%[2]s</a>`
review_dismissed_reason=Motivo:
create_branch=creó rama <a href="%[1]s/src/branch/%[2]s">%[3]s</a> en <a href="%[1]s">%[4]s</a>
watched_repo=comenzó a seguir <a href="%[1]s">%[2]s</a>

[tool]
ago=hace %s
Expand Down
1 change: 0 additions & 1 deletion options/locale/locale_ja-JP.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2783,7 +2783,6 @@ publish_release=`が <a href="%[1]s">%[3]s</a> の <a href="%[1]s/releases/tag/%
review_dismissed=`が <b>%[4]s</b> の <a href="%[1]s/pulls/%[2]s">%[3]s#%[2]s</a> へのレビューを棄却しました`
review_dismissed_reason=理由:
create_branch=が <a href="%[1]s">%[4]s</a> にブランチ <a href="%[1]s/src/branch/%[2]s">%[3]s</a> を作成しました
stared_repo=が <a href="%[1]s">%[2]s</a> にスターをつけました
watched_repo=が <a href="%[1]s">%[2]s</a> のウォッチを開始しました

[tool]
Expand Down
10 changes: 6 additions & 4 deletions options/locale/locale_pt-BR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ form.name_chars_not_allowed=Nome de usuário '%s' contém caracteres inválidos.
[settings]
profile=Perfil
account=Conta
appearance=Aparência
password=Senha
security=Segurança
avatar=Avatar
Expand All @@ -471,7 +472,9 @@ website=Site
location=Localização
update_theme=Atualizar o tema
update_profile=Atualizar o perfil
update_language=Atualizar Idioma
update_language_not_found=Idioma '%s' não está disponível.
update_language_success=O idioma foi atualizado.
update_profile_success=Seu perfil foi atualizado.
change_username=Seu nome de usuário foi alterado.
change_username_prompt=Nota: as alterações de nome de usuário também mudam sua URL da conta.
Expand Down Expand Up @@ -869,7 +872,7 @@ generated_from=gerado a partir de
fork_from_self=Você não pode criar um fork de um repositório que já é seu.
fork_guest_user=Acesse para realizar um fork deste repositório.
watch_guest_user=Entre para observar este repositório.
star_guest_user=Entre para adicionar uma estrela neste repositório.
star_guest_user=Entre para adicionar este repositório aos favoritos.
copy_link=Copiar
copy_link_success=O link foi copiado
copy_link_error=Use ⌘-C ou Ctrl-C para copiar
Expand All @@ -879,8 +882,8 @@ copy_branch_error=Use ⌘C ou Ctrl-C para copiar
copied=Copiado com sucesso
unwatch=Deixar de observar
watch=Observar
unstar=Remover favorito
star=Favorito
unstar=Retirar dos favoritos
star=Juntar aos favoritos
fork=Fork
download_archive=Baixar repositório

Expand Down Expand Up @@ -2469,7 +2472,6 @@ mirror_sync_create=nova referência sincronizada <a href="%s/src/%s">%[2]s</a> p
mirror_sync_delete=referência excluída e sincronizada <code>%[2]s</code> em <a href="%[1]s">%[3]s</a> do espelhamento
approve_pull_request=`aprovado <a href="%s/pulls/%s">%s#%[2]s</a>`
reject_pull_request=`sugerido mudanças para <a href="%s/pulls/%s">%s#%[2]s</a>`
stared_repo=contemplou <a href="%[1]s">%[2]s</a>
watched_repo=começou a observar <a href="%[1]s">%[2]s</a>

[tool]
Expand Down
10 changes: 7 additions & 3 deletions options/locale/locale_pt-PT.ini
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ form.name_chars_not_allowed=O nome de utilizador '%s' contém caracteres inváli
[settings]
profile=Perfil
account=Conta
appearance=Aparência
password=Senha
security=Segurança
avatar=Avatar
Expand All @@ -513,7 +514,9 @@ website=Sítio web
location=Localização
update_theme=Substituir tema
update_profile=Modificar perfil
update_language=Modificar idioma
update_language_not_found=O idioma '%s' não está disponível.
update_language_success=O idioma foi modificado.
update_profile_success=O seu perfil foi modificado.
change_username=O seu nome de utilizador foi modificado.
change_username_prompt=Nota: alterações do nome de utilizador também alteram o URL de sua conta.
Expand Down Expand Up @@ -921,7 +924,7 @@ generated_from=gerado a partir de
fork_from_self=Não pode criar uma derivação de um repositório que já é seu.
fork_guest_user=Inicie a sessão para fazer uma derivação deste repositório.
watch_guest_user=Inicie sessão para começar a vigiar este repositório.
star_guest_user=Inicie sessão para marcar este repositório como favorito.
star_guest_user=Inicie sessão para juntar este repositório aos favoritos.
copy_link=Copiar
copy_link_success=A ligação foi copiada
copy_link_error=Use ⌘C ou Ctrl-C para copiar
Expand All @@ -931,8 +934,8 @@ copy_branch_error=Use ⌘C ou Ctrl-C para copiar
copied=Copiado com sucesso
unwatch=Deixar de vigiar
watch=Vigiar
unstar=Tirar marca de favorito
star=Marcar como favorito
unstar=Tirar dos favoritos
star=Juntar aos favoritos
fork=Derivar
download_archive=Descarregar repositório

Expand Down Expand Up @@ -973,6 +976,7 @@ file_view_rendered=Ver resultado processado
file_view_raw=Ver em bruto
file_permalink=Ligação permanente
file_too_large=O ficheiro é demasiado grande para ser apresentado.
file_copy_permalink=Copiar ligação permanente
video_not_supported_in_browser=O seu navegador não suporta a etiqueta 'video' do HTML5.
audio_not_supported_in_browser=O seu navegador não suporta a etiqueta 'audio' do HTML5.
stored_lfs=Armazenado com Git LFS
Expand Down
12 changes: 6 additions & 6 deletions options/locale/locale_uk-UA.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1088,10 +1088,10 @@ issues.new.no_milestone=Етап відсутній
issues.new.clear_milestone=Очистити етап
issues.new.open_milestone=Активні етапи
issues.new.closed_milestone=Закриті етапи
issues.new.assignees=Виконавеці
issues.new.assignees=Виконавці
issues.new.add_assignees_title=Призначити користувачів
issues.new.clear_assignees=Прибрати виконавеців
issues.new.no_assignees=Немає виконавеця
issues.new.clear_assignees=Прибрати виконавців
issues.new.no_assignees=Немає виконавця
issues.new.no_reviewers=Немає рецензентів
issues.new.add_reviewer_title=Попросити рецензію
issues.choose.get_started=Початок роботи
Expand Down Expand Up @@ -1135,7 +1135,7 @@ issues.filter_label_no_select=Всі мітки
issues.filter_milestone=Етап
issues.filter_milestone_no_select=Всі етапи
issues.filter_assignee=Виконавець
issues.filter_assginee_no_select=Всі виконавеці
issues.filter_assginee_no_select=Всі виконавці
issues.filter_type=Тип
issues.filter_type.all_issues=Всі проблеми
issues.filter_type.assigned_to_you=Призначене вам
Expand All @@ -1161,7 +1161,7 @@ issues.action_label=Мітка
issues.action_milestone=Етап
issues.action_milestone_no_select=Етап відсутній
issues.action_assignee=Виконавець
issues.action_assignee_no_select=Немає виконавеця
issues.action_assignee_no_select=Немає виконавця
issues.opened_by=%[1]s відкрито <a href="%[2]s">%[3]s</a>
issues.previous=Попередній
issues.next=Далі
Expand Down Expand Up @@ -2199,7 +2199,7 @@ dashboard.clean_unbind_oauth_success=Всі незавершені зв'язки
dashboard.task.started=Запущено завдання: %[1]s
dashboard.task.process=Завдання: %[1]s
dashboard.task.cancelled=Завдання: %[1]s скасовано: %[3]s
dashboard.task.error=Помилка у завданні: %[1]:%[3]s
dashboard.task.error=Помилка у завданні: %[1]s:%[3]s
dashboard.task.finished=Завершилося завдання, яке запустив %[2]s: %[1]s
dashboard.task.unknown=Невідоме завдання: %[1]s
dashboard.cron.started=Запущено Cron: %[1]s
Expand Down
1 change: 0 additions & 1 deletion options/locale/locale_zh-CN.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2780,7 +2780,6 @@ publish_release=`发布了 <a href="%s/releases/tag/%s"> "%[4]s" </a> 于 <a hre
review_dismissed=`取消了 <b>%[4]s</b> 对 <a href="%[1]s/pulls/%[2]s">%[3]s#%[2]s</a> 的评审`
review_dismissed_reason=原因:
create_branch=创建分支 <a href="%[1]s/src/branch/%[2]s"> %[3]s</a> 于 <a href="%[1]s">%[4]s</a>
stared_repo=用星号标记了 <a href="%[1]s">%[2]s</a>
watched_repo=开始关注 <a href="%[1]s">%[2]s</a>
[tool]
Expand Down
5 changes: 4 additions & 1 deletion options/locale/locale_zh-TW.ini
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ form.name_chars_not_allowed=使用者名稱「%s」包含無效字元。
[settings]
profile=個人資料
account=帳戶
appearance=外觀
password=修改密碼
security=安全性
avatar=大頭貼
Expand All @@ -514,7 +515,9 @@ website=個人網站
location=所在地區
update_theme=更新佈景主題
update_profile=更新個人資料
update_language=更新語言
update_language_not_found=無法使用語言「%s」。
update_language_success=已更新語言。
update_profile_success=已更新您的個人資料。
change_username=您的帳號已更改。
change_username_prompt=注意:修改帳號也會更改您的帳戶的 URL。
Expand Down Expand Up @@ -2783,7 +2786,7 @@ publish_release=`發佈了 <a href="%[1]s">%[3]s</a> 的<a href="%s/releases/tag
review_dismissed=`取消了 <b>%[4]s</b> 對 <a href="%[1]s/pulls/%[2]s">%[3]s#%[2]s</a> 的審核`
review_dismissed_reason=原因:
create_branch=建立了分支 <a href="%[1]s/src/branch/%[2]s">%[3]s</a> 於 <a href="%[1]s">%[4]s</a>
stared_repo=為 <a href="%[1]s">%[2]s</a> 加上星號
starred_repo=為 <a href="%[1]s">%[2]s</a> 加上星號
watched_repo=開始關注 <a href="%[1]s">%[2]s</a>

[tool]
Expand Down
3 changes: 2 additions & 1 deletion routers/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (

"code.gitea.io/gitea/models"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/migrations"
"code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/generate"
Expand Down Expand Up @@ -208,7 +209,7 @@ func SubmitInstall(ctx *context.Context) {
}

// Set test engine.
if err = db.NewTestEngine(); err != nil {
if err = db.NewInstallTestEngine(ctx, migrations.Migrate); err != nil {
if strings.Contains(err.Error(), `Unknown database type: sqlite3`) {
ctx.Data["Err_DbType"] = true
ctx.RenderWithErr(ctx.Tr("install.sqlite3_not_available", "https://docs.gitea.io/en-us/install-from-binary/"), tplInstall, &form)
Expand Down

0 comments on commit e223dfd

Please sign in to comment.