From 5c55793e0e76e0a878f001ad98a34099983d4cda Mon Sep 17 00:00:00 2001 From: Gary Kim Date: Sun, 24 May 2020 22:38:34 +0800 Subject: [PATCH 1/7] Fix wrong milestone in webhook message (#11596) Fixes #11295 Signed-off-by: Gary Kim gary@garykim.dev --- models/issue.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/issue.go b/models/issue.go index d9f8e929c7..157ad48dee 100644 --- a/models/issue.go +++ b/models/issue.go @@ -249,7 +249,7 @@ func (issue *Issue) loadReactions(e Engine) (err error) { } func (issue *Issue) loadMilestone(e Engine) (err error) { - if issue.Milestone == nil && issue.MilestoneID > 0 { + if (issue.Milestone == nil || issue.Milestone.ID != issue.MilestoneID) && issue.MilestoneID > 0 { issue.Milestone, err = getMilestoneByRepoID(e, issue.RepoID, issue.MilestoneID) if err != nil && !IsErrMilestoneNotExist(err) { return fmt.Errorf("getMilestoneByRepoID [repo_id: %d, milestone_id: %d]: %v", issue.RepoID, issue.MilestoneID, err) From e25348da889718f2116f23e25aacb10ca8aee2a3 Mon Sep 17 00:00:00 2001 From: GiteaBot Date: Sun, 24 May 2020 14:40:08 +0000 Subject: [PATCH 2/7] [skip ci] Updated translations via Crowdin --- options/locale/locale_pt-PT.ini | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/options/locale/locale_pt-PT.ini b/options/locale/locale_pt-PT.ini index 07a485b30f..026a42d11b 100644 --- a/options/locale/locale_pt-PT.ini +++ b/options/locale/locale_pt-PT.ini @@ -863,7 +863,7 @@ issues.new.add_assignees_title=Definir responsáveis issues.new.clear_assignees=Limpar responsáveis issues.new.no_assignees=Sem responsáveis issues.new.no_reviewers=Sem revisores -issues.new.add_reviewer_title=Solicitar avaliação +issues.new.add_reviewer_title=Solicitar revisão issues.no_ref=Sem ramo ou etiqueta especificados issues.create=Criar questão issues.new_label=Nova etiqueta @@ -921,7 +921,7 @@ issues.action_milestone=Etapa issues.action_milestone_no_select=Sem etapa issues.action_assignee=Responsável issues.action_assignee_no_select=Sem responsável -issues.opened_by=abertas %[1]s por %[3]s +issues.opened_by=aberta %[1]s por %[3]s pulls.merged_by=integrados %[1]s por %[3]s pulls.merged_by_fake=integrados %[1]s por %[2]s issues.closed_by=de %[3]s fechada %[1]s @@ -958,9 +958,9 @@ issues.ref_from=`de %[1]s` issues.poster=Autor issues.collaborator=Colaborador(a) issues.owner=Proprietário(a) -issues.re_request_review=Voltar a solicitar avaliação -issues.remove_request_review=Remover solicitação de avaliação -issues.remove_request_review_block=Não é possível remover a solicitação de avaliação +issues.re_request_review=Voltar a solicitar revisão +issues.remove_request_review=Remover solicitação de revisão +issues.remove_request_review_block=Não é possível remover a solicitação de revisão issues.sign_in_require_desc=Inicie a sessão para participar neste diálogo. issues.edit=Editar issues.cancel=Cancelar @@ -1074,8 +1074,8 @@ issues.review.left_comment=deixou um comentário issues.review.content.empty=Tem que deixar um comentário indicando a(s) alteração(ões) solicitada(s). issues.review.reject=alterações solicitadas %s issues.review.wait=foi solicitada para avaliação %s -issues.review.add_review_request=solicitou avaliação de %s %s -issues.review.remove_review_request=removeu a solicitação de avaliação para %s %s +issues.review.add_review_request=solicitou revisão de %s %s +issues.review.remove_review_request=removeu a solicitação de revisão para %s %s issues.review.remove_review_request_self=recusou-se a avaliar %s issues.review.pending=Pendente issues.review.review=Revisão @@ -1541,7 +1541,7 @@ settings.protect_required_approvals_desc=Permitir somente a integração constan settings.protect_approvals_whitelist_enabled=Restringir aprovações a utilizadores ou equipas da lista de permissão settings.protect_approvals_whitelist_enabled_desc=Somente as avaliações dos utilizadores ou equipas da lista de permissão irão contar para as aprovações necessárias. Se não houver uma lista de permissão de aprovações, avaliações de qualquer pessoa com acesso de escrita contam para as aprovações necessárias. settings.protect_approvals_whitelist_users=Avaliadores com permissão: -settings.protect_approvals_whitelist_teams=Equipas com permissão para avaliar: +settings.protect_approvals_whitelist_teams=Equipas com permissão para rever: settings.dismiss_stale_approvals=Descartar aprovações obsoletas settings.dismiss_stale_approvals_desc=Quando novos cometimentos que mudam o conteúdo do pedido de integração são enviados para o ramo, as aprovações antigas serão descartadas. settings.require_signed_commits=Exigir cometimentos assinados @@ -1640,7 +1640,7 @@ diff.comment.add_single_comment=Adicionar um único comentário diff.comment.add_review_comment=Adicionar comentário diff.comment.start_review=Iniciar revisão diff.comment.reply=Responder -diff.review=Avaliar +diff.review=Revisão diff.review.header=Submeter avaliação diff.review.placeholder=Comentário da avaliação diff.review.comment=Comentar From 3547e84a050ab5a32c1616bdb95d1fdee2cbd006 Mon Sep 17 00:00:00 2001 From: zeripath Date: Sun, 24 May 2020 18:12:40 +0100 Subject: [PATCH 3/7] When initialising repositories ensure that the user doing the creation is the initializer (#11601) Fix #10760 Signed-off-by: Andrew Thornton --- modules/repository/create.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/repository/create.go b/modules/repository/create.go index 5c0aae30da..2f7d10f0d1 100644 --- a/modules/repository/create.go +++ b/modules/repository/create.go @@ -47,7 +47,7 @@ func CreateRepository(doer, u *models.User, opts models.CreateRepoOptions) (_ *m // No need for init mirror. if !opts.IsMirror { repoPath := models.RepoPath(u.Name, repo.Name) - if err = initRepository(ctx, repoPath, u, repo, opts); err != nil { + if err = initRepository(ctx, repoPath, doer, repo, opts); err != nil { if err2 := os.RemoveAll(repoPath); err2 != nil { log.Error("initRepository: %v", err) return fmt.Errorf( From 04afd9d1e2399d61978fdeeab7e7ac8ff9057a93 Mon Sep 17 00:00:00 2001 From: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com> Date: Sun, 24 May 2020 19:53:37 +0200 Subject: [PATCH 4/7] Fix inconsistent font size for markdown preview on new PR view (#11565) We use same method for new issue form and issue view, but was missing from new PR view making it one place where markdown preview is inconsistent in font size. --- web_src/less/_repository.less | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index 0d18962a19..5371436eaf 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -1318,6 +1318,10 @@ } } } + + .markdown { + font-size: 14px; + } } .filter.dropdown .menu { From 7305b555d355f9443f73e03995159b5c190e376b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Will=20=E4=BF=9D=E5=93=A5?= Date: Mon, 25 May 2020 03:17:33 +0800 Subject: [PATCH 5/7] Add chocolatey package install instructions (#11586) * Update from-package.en-us.md https://github.com/go-gitea/gitea/issues/10800 * Update docs/content/doc/installation/from-package.en-us.md Co-authored-by: zeripath Co-authored-by: zeripath Co-authored-by: techknowlogick --- docs/content/doc/installation/from-package.en-us.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/content/doc/installation/from-package.en-us.md b/docs/content/doc/installation/from-package.en-us.md index b9d101d3a0..dbf4631275 100644 --- a/docs/content/doc/installation/from-package.en-us.md +++ b/docs/content/doc/installation/from-package.en-us.md @@ -38,10 +38,13 @@ config is found in **/etc/gitea/app.ini** ## Windows -There are no published packages for Windows. This page will change when packages are published, -in the form of `MSI` installers or via [Chocolatey](https://chocolatey.org/). In the meantime, follow -the [deployment from binary]({{< relref "from-binary.en-us.md" >}}) guide. +There is a [Gitea](https://chocolatey.org/packages/gitea) package for Windows by [Chocolatey](https://chocolatey.org/). +```sh +choco install gitea +``` + +Or follow the [deployment from binary]({{< relref "from-binary.en-us.md" >}}) guide. ## macOS Currently, the only supported method of installation on MacOS is [Homebrew](http://brew.sh/). From 39b792f42498cb43e2f7fd4faced08bc90a93489 Mon Sep 17 00:00:00 2001 From: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com> Date: Sun, 24 May 2020 22:26:03 +0200 Subject: [PATCH 6/7] Do not show avatar for "{{user}} added X commits" (#11591) Co-authored-by: techknowlogick --- templates/repo/issue/view_content/comments.tmpl | 3 --- 1 file changed, 3 deletions(-) diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 78e38e4ca2..fcec8f6bae 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -598,9 +598,6 @@ {{else if and (eq .Type 29) (or (gt .CommitsNum 0) .IsForcePush)}}
{{svg "octicon-repo-force-push" 16}} - - - {{.Poster.GetDisplayName}} {{ if .IsForcePush }} From 02a52d683b32e2670f746d898bd0041954390e7b Mon Sep 17 00:00:00 2001 From: zeripath Date: Sun, 24 May 2020 23:56:18 +0100 Subject: [PATCH 7/7] Add warning to mailer documentation about authentication (#11563) * Add warning to mailer documentation about authentication References #7966 Signed-off-by: Andrew Thornton * As per @guillep2k and @mrsdizzie * as per @mrsdizzie Signed-off-by: Andrew Thornton Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> --- custom/conf/app.ini.sample | 7 +++++-- docs/content/doc/advanced/config-cheat-sheet.en-us.md | 6 +++++- docs/content/doc/usage/email-setup.en-us.md | 6 ++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/custom/conf/app.ini.sample b/custom/conf/app.ini.sample index c50dd68f1f..5e150172d5 100644 --- a/custom/conf/app.ini.sample +++ b/custom/conf/app.ini.sample @@ -627,7 +627,8 @@ SUBJECT_PREFIX = ; Mail server ; Gmail: smtp.gmail.com:587 ; QQ: smtp.qq.com:465 -; Note, if the port ends with "465", SMTPS will be used. Using STARTTLS on port 587 is recommended per RFC 6409. If the server supports STARTTLS it will always be used. +; Using STARTTLS on port 587 is recommended per RFC 6409. +; Note, if the port ends with "465", SMTPS will be used. HOST = ; Disable HELO operation when hostnames are different. DISABLE_HELO = @@ -639,11 +640,13 @@ SKIP_VERIFY = USE_CERTIFICATE = false CERT_FILE = custom/mailer/cert.pem KEY_FILE = custom/mailer/key.pem -; Should SMTP connection use TLS +; Should SMTP connect with TLS, (if port ends with 465 TLS will always be used.) +; If this is false but STARTTLS is supported the connection will be upgraded to TLS opportunistically. IS_TLS_ENABLED = false ; Mail from address, RFC 5322. This can be just an email address, or the `"Name" ` format FROM = ; Mailer user name and password +; Please Note: Authentication is only supported when the SMTP server communication is encrypted with TLS (this can be via STARTTLS) or `HOST=localhost`. USER = ; Use PASSWD = `your password` for quoting if you use special characters in the password. PASSWD = diff --git a/docs/content/doc/advanced/config-cheat-sheet.en-us.md b/docs/content/doc/advanced/config-cheat-sheet.en-us.md index e3ff2deb37..f0908c22a3 100644 --- a/docs/content/doc/advanced/config-cheat-sheet.en-us.md +++ b/docs/content/doc/advanced/config-cheat-sheet.en-us.md @@ -397,10 +397,15 @@ set name for unique queues. Individual queues will default to - `DISABLE_HELO`: **\**: Disable HELO operation. - `HELO_HOSTNAME`: **\**: Custom hostname for HELO operation. - `HOST`: **\**: SMTP mail host address and port (example: smtp.gitea.io:587). + - Using opportunistic TLS via STARTTLS on port 587 is recommended per RFC 6409. +- `IS_TLS_ENABLED` : **false** : Forcibly use TLS to connect even if not on a default SMTPS port. + - Note, if the port ends with `465` SMTPS/SMTP over TLS will be used despite this setting. + - Otherwise if `IS_TLS_ENABLED=false` and the server supports `STARTTLS` this will be used. Thus if `STARTTLS` is preferred you should set `IS_TLS_ENABLED=false`. - `FROM`: **\**: Mail from address, RFC 5322. This can be just an email address, or the "Name" \ format. - `USER`: **\**: Username of mailing user (usually the sender's e-mail address). - `PASSWD`: **\**: Password of mailing user. Use \`your password\` for quoting if you use special characters in the password. + - Please note: authentication is only supported when the SMTP server communication is encrypted with TLS (this can be via `STARTTLS`) or `HOST=localhost`. See [Email Setup]({{< relref "doc/usage/email-setup.en-us.md" >}}) for more information. - `SKIP_VERIFY`: **\**: Do not verify the self-signed certificates. - **Note:** Gitea only supports SMTP with STARTTLS. - `SUBJECT_PREFIX`: **\**: Prefix to be placed before e-mail subject lines. @@ -415,7 +420,6 @@ set name for unique queues. Individual queues will default to - `SENDMAIL_PATH`: **sendmail**: The location of sendmail on the operating system (can be command or full path). - `SENDMAIL_TIMEOUT`: **5m**: default timeout for sending email through sendmail -- ``IS_TLS_ENABLED`` : **false** : Decide if SMTP connections should use TLS. ## Cache (`cache`) diff --git a/docs/content/doc/usage/email-setup.en-us.md b/docs/content/doc/usage/email-setup.en-us.md index 68351d096d..2f46b5d6c1 100644 --- a/docs/content/doc/usage/email-setup.en-us.md +++ b/docs/content/doc/usage/email-setup.en-us.md @@ -46,6 +46,12 @@ PASSWD = `password` For the full list of options check the [Config Cheat Sheet]({{< relref "doc/advanced/config-cheat-sheet.en-us.md" >}}) +- Please note: authentication is only supported when the SMTP server communication is encrypted with TLS or `HOST=localhost`. TLS encryption can be through: + - Via the server supporting TLS through STARTTLS - usually provided on port 587. (Also known as Opportunistic TLS.) + - SMTPS connection (SMTP over transport layer security) via the default port 465. + - Forced SMTPS connection with `IS_TLS_ENABLED=true`. (These are both known as Implicit TLS.) +- This is due to protections imposed by the Go internal libraries against STRIPTLS attacks. + ### Gmail The following configuration should work with GMail's SMTP server: