Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoupers committed Jun 4, 2024
2 parents 6cb79e3 + aace3bc commit 107f556
Show file tree
Hide file tree
Showing 37 changed files with 344 additions and 102 deletions.
5 changes: 3 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"ghcr.io/devcontainers-contrib/features/poetry:2": {},
"ghcr.io/devcontainers/features/python:1": {
"version": "3.12"
}
},
"ghcr.io/warrenbuckley/codespace-features/sqlite:1": {}
},
"customizations": {
"vscode": {
Expand All @@ -25,7 +26,7 @@
"Vue.volar",
"ms-azuretools.vscode-docker",
"vitest.explorer",
"qwtel.sqlite-viewer",
"cweijan.vscode-database-client2",
"GitHub.vscode-pull-request-github",
"Azurite.azurite"
]
Expand Down
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ vscode:
- Vue.volar
- ms-azuretools.vscode-docker
- vitest.explorer
- qwtel.sqlite-viewer
- cweijan.vscode-database-client2
- GitHub.vscode-pull-request-github

ports:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ XGO_VERSION := go-1.22.x
AIR_PACKAGE ?= github.com/cosmtrek/air@v1
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/[email protected]
GOFUMPT_PACKAGE ?= mvdan.cc/[email protected]
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.57.2
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.0
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/[email protected]
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/[email protected]
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@db51e79a0e37c572d8b59ae0c58bf2bbbbe53285
Expand Down
10 changes: 10 additions & 0 deletions custom/conf/app.example.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1687,6 +1687,16 @@ LEVEL = Info
;; convert \r\n to \n for Sendmail
;SENDMAIL_CONVERT_CRLF = true

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;[mailer.override_header]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; This is empty by default, use it only if you know what you need it for.
;Reply-To = [email protected], [email protected]
;Content-Type = text/html; charset=utf-8
;In-Reply-To =

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;[email.incoming]
Expand Down
19 changes: 18 additions & 1 deletion docs/content/administration/config-cheat-sheet.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -724,11 +724,13 @@ Define allowed algorithms and their minimum key length (use -1 to disable a type

## Mailer (`mailer`)

⚠️ This section is for Gitea 1.18 and later. If you are using Gitea 1.17 or older,
:::warning
This section is for Gitea 1.18 and later. If you are using Gitea 1.17 or older,
please refer to
[Gitea 1.17 app.ini example](https://github.com/go-gitea/gitea/blob/release/v1.17/custom/conf/app.example.ini)
and
[Gitea 1.17 configuration document](https://github.com/go-gitea/gitea/blob/release/v1.17/docs/content/doc/advanced/config-cheat-sheet.en-us.md)
:::

- `ENABLED`: **false**: Enable to use a mail service.
- `PROTOCOL`: **_empty_**: Mail server protocol. One of "smtp", "smtps", "smtp+starttls", "smtp+unix", "sendmail", "dummy". _Before 1.18, this was inferred from a combination of `MAILER_TYPE` and `IS_TLS_ENABLED`._
Expand Down Expand Up @@ -761,6 +763,21 @@ and
- `SEND_BUFFER_LEN`: **100**: Buffer length of mailing queue. **DEPRECATED** use `LENGTH` in `[queue.mailer]`
- `SEND_AS_PLAIN_TEXT`: **false**: Send mails only in plain text, without HTML alternative.

## Override Email Headers (`mailer.override_header`)

:::warning
This is empty by default, use it only if you know what you need it for.
:::

examples would be:

```ini
[mailer.override_header]
Reply-To = [email protected], [email protected]
Content-Type = text/html; charset=utf-8
In-Reply-To =
```

## Incoming Email (`email.incoming`)

- `ENABLED`: **false**: Enable handling of incoming emails.
Expand Down
4 changes: 3 additions & 1 deletion models/issues/comment_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ func (comments CommentList) LoadPosters(ctx context.Context) error {
}

for _, comment := range comments {
comment.Poster = getPoster(comment.PosterID, posterMaps)
if comment.Poster == nil {
comment.Poster = getPoster(comment.PosterID, posterMaps)
}
}
return nil
}
Expand Down
4 changes: 3 additions & 1 deletion models/issues/issue_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ func (issues IssueList) LoadPosters(ctx context.Context) error {
}

for _, issue := range issues {
issue.Poster = getPoster(issue.PosterID, posterMaps)
if issue.Poster == nil {
issue.Poster = getPoster(issue.PosterID, posterMaps)
}
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion models/migrations/v1_22/v286.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func addObjectFormatNameToRepository(x *xorm.Engine) error {

// Here to catch weird edge-cases where column constraints above are
// not applied by the DB backend
_, err := x.Exec("UPDATE repository set object_format_name = 'sha1' WHERE object_format_name = '' or object_format_name IS NULL")
_, err := x.Exec("UPDATE `repository` set `object_format_name` = 'sha1' WHERE `object_format_name` = '' or `object_format_name` IS NULL")
return err
}

Expand Down
10 changes: 8 additions & 2 deletions models/repo/avatar.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,13 @@ func (repo *Repository) relAvatarLink(ctx context.Context) string {
return setting.AppSubURL + "/repo-avatars/" + url.PathEscape(repo.Avatar)
}

// AvatarLink returns the full avatar url with http host. TODO: refactor it to a relative URL, but it is still used in API response at the moment
// AvatarLink returns the full avatar url with http host or the empty string if the repo doesn't have an avatar.
//
// TODO: refactor it to a relative URL, but it is still used in API response at the moment
func (repo *Repository) AvatarLink(ctx context.Context) string {
return httplib.MakeAbsoluteURL(ctx, repo.relAvatarLink(ctx))
relLink := repo.relAvatarLink(ctx)
if relLink != "" {
return httplib.MakeAbsoluteURL(ctx, relLink)
}
return ""
}
23 changes: 15 additions & 8 deletions modules/setting/mailer.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ import (
// Mailer represents mail service.
type Mailer struct {
// Mailer
Name string `ini:"NAME"`
From string `ini:"FROM"`
EnvelopeFrom string `ini:"ENVELOPE_FROM"`
OverrideEnvelopeFrom bool `ini:"-"`
FromName string `ini:"-"`
FromEmail string `ini:"-"`
SendAsPlainText bool `ini:"SEND_AS_PLAIN_TEXT"`
SubjectPrefix string `ini:"SUBJECT_PREFIX"`
Name string `ini:"NAME"`
From string `ini:"FROM"`
EnvelopeFrom string `ini:"ENVELOPE_FROM"`
OverrideEnvelopeFrom bool `ini:"-"`
FromName string `ini:"-"`
FromEmail string `ini:"-"`
SendAsPlainText bool `ini:"SEND_AS_PLAIN_TEXT"`
SubjectPrefix string `ini:"SUBJECT_PREFIX"`
OverrideHeader map[string][]string `ini:"-"`

// SMTP sender
Protocol string `ini:"PROTOCOL"`
Expand Down Expand Up @@ -151,6 +152,12 @@ func loadMailerFrom(rootCfg ConfigProvider) {
log.Fatal("Unable to map [mailer] section on to MailService. Error: %v", err)
}

overrideHeader := rootCfg.Section("mailer.override_header").Keys()
MailService.OverrideHeader = make(map[string][]string)
for _, key := range overrideHeader {
MailService.OverrideHeader[key.Name()] = key.Strings(",")
}

// Infer SMTPPort if not set
if MailService.SMTPPort == "" {
switch MailService.Protocol {
Expand Down
7 changes: 5 additions & 2 deletions modules/structs/activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ package structs
import "time"

type Activity struct {
ID int64 `json:"id"`
UserID int64 `json:"user_id"` // Receiver user
ID int64 `json:"id"`
UserID int64 `json:"user_id"` // Receiver user
// the type of action
//
// enum: create_repo,rename_repo,star_repo,watch_repo,commit_repo,create_issue,create_pull_request,transfer_repo,push_tag,comment_issue,merge_pull_request,close_issue,reopen_issue,close_pull_request,reopen_pull_request,delete_tag,delete_branch,mirror_sync_push,mirror_sync_create,mirror_sync_delete,approve_pull_request,reject_pull_request,comment_pull,publish_release,pull_review_dismissed,pull_request_ready_for_review,auto_merge_pull_request
OpType string `json:"op_type"`
ActUserID int64 `json:"act_user_id"`
ActUser *User `json:"act_user"`
Expand Down
44 changes: 44 additions & 0 deletions options/gitignore/Alteryx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# gitignore template for Alteryx Designer
# website: https://www.alteryx.com/
# website: https://help.alteryx.com/current/designer/alteryx-file-types

# Alteryx Data Files
*.yxdb
*.cydb
*.cyidx
*.rptx
*.vvf
*.aws

# Alteryx Special Files
*.yxwv
*.yxft
*.yxbe
*.bak
*.pcxml
*.log
*.bin
*.yxlang
CASS.ini

# Alteryx License Files
*.yxlc
*.slc
*.cylc
*.alc
*.gzlc

## gitignore reference sites
# https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#Ignoring-Files
# https://git-scm.com/docs/gitignore
# https://help.github.com/articles/ignoring-files/

## Useful knowledge from stackoverflow
# Even if you haven't tracked the files so far, git seems to be able to "know" about them even after you add them to .gitignore.
# WARNING: First commit your current changes, or you will lose them.
# Then run the following commands from the top folder of your git repo:
# git rm -r --cached .
# git add .
# git commit -m "fixed untracked files"

# author: Kacper Ksieski
2 changes: 2 additions & 0 deletions options/gitignore/Archives
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
*.lzma
*.cab
*.xar
*.zst
*.tzst

# Packing-only formats
*.iso
Expand Down
11 changes: 11 additions & 0 deletions options/gitignore/Ballerina
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# generated files
target/
generated/

# dependencies
Dependencies.toml

# config files
Config.toml
# the config files used for testing, Uncomment the following line if you want to commit the test config files
#!**/tests/Config.toml
1 change: 1 addition & 0 deletions options/gitignore/CMake
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
CMakeUserPresets.json
12 changes: 12 additions & 0 deletions options/gitignore/Delphi
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@
#*.obj
#

# Default Delphi compiler directories
# Content of this directories are generated with each Compile/Construct of a project.
# Most of the time, files here have not there place in a code repository.
#Win32/
#Win64/
#OSX64/
#OSXARM64/
#Android/
#Android64/
#iOSDevice64/
#Linux64/

# Delphi compiler-generated binaries (safe to delete)
*.exe
*.dll
Expand Down
18 changes: 18 additions & 0 deletions options/gitignore/GitHubPages
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This .gitignore is appropriate for repositories deployed to GitHub Pages and using
# a Gemfile as specified at https://github.com/github/pages-gem#conventional

# Basic Jekyll gitignores (synchronize to Jekyll.gitignore)
_site/
.sass-cache/
.jekyll-cache/
.jekyll-metadata

# Additional Ruby/bundler ignore for when you run: bundle install
/vendor

# Specific ignore for GitHub Pages
# GitHub Pages will always use its own deployed version of pages-gem
# This means GitHub Pages will NOT use your Gemfile.lock and therefore it is
# counterproductive to check this file into the repository.
# Details at https://github.com/github/pages-gem/issues/768
Gemfile.lock
3 changes: 3 additions & 0 deletions options/gitignore/Go
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@
# Go workspace file
go.work
go.work.sum

# env file
.env
17 changes: 0 additions & 17 deletions options/gitignore/Objective-C
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,6 @@
## User settings
xcuserdata/

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
*.moved-aside
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3

## Obj-C/Swift specific
*.hmap

Expand Down
7 changes: 7 additions & 0 deletions options/gitignore/Rust
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@ Cargo.lock

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

# RustRover
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
28 changes: 0 additions & 28 deletions options/gitignore/Swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,6 @@
## User settings
xcuserdata/

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
*.moved-aside
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3

## Obj-C/Swift specific
*.hmap

Expand Down Expand Up @@ -66,10 +49,6 @@ playground.xcworkspace

Carthage/Build/

# Accio dependency management
Dependencies/
.accio/

# fastlane
#
# It is recommended to not store the screenshots in the git repo.
Expand All @@ -81,10 +60,3 @@ fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

# Code Injection
#
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/
Loading

0 comments on commit 107f556

Please sign in to comment.