Skip to content

Commit 015a57a

Browse files
authored
Merge branch 'main' into main
2 parents cf10d77 + e31c616 commit 015a57a

File tree

39 files changed

+425
-200
lines changed

39 files changed

+425
-200
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#Build stage
2-
FROM golang:1.18-alpine3.15 AS build-env
2+
FROM golang:1.18-alpine3.16 AS build-env
33

44
ARG GOPROXY
55
ENV GOPROXY ${GOPROXY:-direct}
@@ -23,7 +23,7 @@ RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
2323
# Begin env-to-ini build
2424
RUN go build contrib/environment-to-ini/environment-to-ini.go
2525

26-
FROM alpine:3.15
26+
FROM alpine:3.16
2727
LABEL maintainer="maintainers@gitea.io"
2828

2929
EXPOSE 22 3000

Dockerfile.rootless

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#Build stage
2-
FROM golang:1.18-alpine3.15 AS build-env
2+
FROM golang:1.18-alpine3.16 AS build-env
33

44
ARG GOPROXY
55
ENV GOPROXY ${GOPROXY:-direct}
@@ -23,7 +23,7 @@ RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
2323
# Begin env-to-ini build
2424
RUN go build contrib/environment-to-ini/environment-to-ini.go
2525

26-
FROM alpine:3.15
26+
FROM alpine:3.16
2727
LABEL maintainer="maintainers@gitea.io"
2828

2929
EXPOSE 2222 3000

Makefile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ help:
195195
@echo " - swagger-validate check if the swagger spec is valid"
196196
@echo " - golangci-lint run golangci-lint linter"
197197
@echo " - vet examines Go source code and reports suspicious constructs"
198+
@echo " - tidy run go mod tidy"
198199
@echo " - test[\#TestSpecificName] run unit test"
199200
@echo " - test-sqlite[\#TestSpecificName] run integration test for sqlite"
200201
@echo " - pr#<index> build and start gitea from a PR with integration test data loaded"
@@ -369,16 +370,20 @@ unit-test-coverage:
369370
@echo "Running unit-test-coverage $(GOTESTFLAGS) -tags '$(TEST_TAGS)'..."
370371
@$(GO) test $(GOTESTFLAGS) -timeout=20m -tags='$(TEST_TAGS)' -cover -coverprofile coverage.out $(GO_PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1
371372

373+
.PHONY: tidy
374+
tidy:
375+
$(eval MIN_GO_VERSION := $(shell grep -Eo '^go\s+[0-9]+\.[0-9.]+' go.mod | cut -d' ' -f2))
376+
$(GO) mod tidy -compat=$(MIN_GO_VERSION)
377+
372378
.PHONY: vendor
373-
vendor:
374-
$(GO) mod tidy && $(GO) mod vendor
379+
vendor: tidy
380+
$(GO) mod vendor
375381

376382
.PHONY: gomod-check
377-
gomod-check:
378-
@$(GO) mod tidy
383+
gomod-check: tidy
379384
@diff=$$(git diff go.sum); \
380385
if [ -n "$$diff" ]; then \
381-
echo "Please run '$(GO) mod tidy' and commit the result:"; \
386+
echo "Please run 'make tidy' and commit the result:"; \
382387
echo "$${diff}"; \
383388
exit 1; \
384389
fi

assets/favicon.svg

Lines changed: 31 additions & 0 deletions
Loading

build/generate-images.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {fileURLToPath} from 'url';
88
const {readFile, writeFile} = fs.promises;
99
const __dirname = dirname(fileURLToPath(import.meta.url));
1010
const logoFile = resolve(__dirname, '../assets/logo.svg');
11+
const faviconFile = resolve(__dirname, '../assets/favicon.svg');
1112

1213
function exit(err) {
1314
if (err) console.error(err);
@@ -68,15 +69,17 @@ async function generate(svg, outputFile, {size, bg}) {
6869

6970
async function main() {
7071
const gitea = process.argv.slice(2).includes('gitea');
71-
const svg = await readFile(logoFile, 'utf8');
72+
const logoSvg = await readFile(logoFile, 'utf8');
73+
const faviconSvg = await readFile(faviconFile, 'utf8');
7274

7375
await Promise.all([
74-
generate(svg, resolve(__dirname, '../public/img/logo.svg'), {size: 32}),
75-
generate(svg, resolve(__dirname, '../public/img/logo.png'), {size: 512}),
76-
generate(svg, resolve(__dirname, '../public/img/favicon.png'), {size: 180}),
77-
generate(svg, resolve(__dirname, '../public/img/avatar_default.png'), {size: 200}),
78-
generate(svg, resolve(__dirname, '../public/img/apple-touch-icon.png'), {size: 180, bg: true}),
79-
gitea && generate(svg, resolve(__dirname, '../public/img/gitea.svg'), {size: 32}),
76+
generate(logoSvg, resolve(__dirname, '../public/img/logo.svg'), {size: 32}),
77+
generate(logoSvg, resolve(__dirname, '../public/img/logo.png'), {size: 512}),
78+
generate(faviconSvg, resolve(__dirname, '../public/img/favicon.svg'), {size: 32}),
79+
generate(faviconSvg, resolve(__dirname, '../public/img/favicon.png'), {size: 180}),
80+
generate(logoSvg, resolve(__dirname, '../public/img/avatar_default.png'), {size: 200}),
81+
generate(logoSvg, resolve(__dirname, '../public/img/apple-touch-icon.png'), {size: 180, bg: true}),
82+
gitea && generate(logoSvg, resolve(__dirname, '../public/img/gitea.svg'), {size: 32}),
8083
]);
8184
}
8285

cmd/serv.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ func runServ(c *cli.Context) error {
302302
if _, err := os.Stat(setting.RepoRootPath); err != nil {
303303
if os.IsNotExist(err) {
304304
return fail("Incorrect configuration.",
305-
"Directory `[repository]` `ROOT` was not found, please check if $GITEA_WORK_DIR is passed to the SSH connection or make `[repository]` `ROOT` an absolute value.")
305+
"Directory `[repository]` `ROOT` %s was not found, please check if $GITEA_WORK_DIR is passed to the SSH connection or make `[repository]` `ROOT` an absolute value.", setting.RepoRootPath)
306306
}
307307
}
308308

custom/conf/app.example.ini

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,8 @@ PATH =
813813
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
814814
;[repository]
815815
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
816-
;; Root path for storing all repository data. It must be an absolute path. By default, it is stored in a sub-directory of `APP_DATA_PATH`.
816+
;; Root path for storing all repository data. By default, it is set to %(APP_DATA_PATH)/gitea-repositories.
817+
;; A relative path is interpreted as %(GITEA_WORK_DIR)/%(ROOT)
817818
;ROOT =
818819
;;
819820
;; The script type this server supports. Usually this is `bash`, but some users report that only `sh` is available.
@@ -938,7 +939,7 @@ PATH =
938939
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
939940
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
940941
;;
941-
;; List of prefixes used in Pull Request title to mark them as Work In Progress
942+
;; List of prefixes used in Pull Request title to mark them as Work In Progress (matched in a case-insensitive manner)
942943
;WORK_IN_PROGRESS_PREFIXES = WIP:,[WIP]
943944
;;
944945
;; List of keywords used in Pull Request comments to automatically close a related issue

docker/root/usr/local/bin/gitea

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,3 @@ CUSTOM_PATH="/data/gitea"
1313

1414
# Provide docker defaults
1515
GITEA_WORK_DIR="${GITEA_WORK_DIR:-$WORK_DIR}" GITEA_CUSTOM="${GITEA_CUSTOM:-$CUSTOM_PATH}" exec -a "$0" "$GITEA" $CONF_ARG "$@"
16-
17-

docs/content/doc/advanced/config-cheat-sheet.en-us.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
4242

4343
## Repository (`repository`)
4444

45-
- `ROOT`: **data/gitea-repositories/**: Root path for storing all repository data. It must be
46-
an absolute path. By default it is stored in a sub-directory of `APP_DATA_PATH`.
45+
- `ROOT`: **%(APP_DATA_PATH)/gitea-repositories**: Root path for storing all repository data.
46+
A relative path is interpreted as **%(GITEA_WORK_DIR)/%(ROOT)**.
4747
- `SCRIPT_TYPE`: **bash**: The script type this server supports. Usually this is `bash`,
4848
but some users report that only `sh` is available.
4949
- `DETECTED_CHARSETS_ORDER`: **UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE, ISO-8859, windows-1252, ISO-8859, windows-1250, ISO-8859, ISO-8859, ISO-8859, windows-1253, ISO-8859, windows-1255, ISO-8859, windows-1251, windows-1256, KOI8-R, ISO-8859, windows-1254, Shift_JIS, GB18030, EUC-JP, EUC-KR, Big5, ISO-2022, ISO-2022, ISO-2022, IBM424_rtl, IBM424_ltr, IBM420_rtl, IBM420_ltr**: Tie-break order of detected charsets - if the detected charsets have equal confidence, charsets earlier in the list will be chosen in preference to those later. Adding `defaults` will place the unnamed charsets at that point.
@@ -87,7 +87,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
8787
### Repository - Pull Request (`repository.pull-request`)
8888

8989
- `WORK_IN_PROGRESS_PREFIXES`: **WIP:,\[WIP\]**: List of prefixes used in Pull Request
90-
title to mark them as Work In Progress
90+
title to mark them as Work In Progress. These are matched in a case-insensitive manner.
9191
- `CLOSE_KEYWORDS`: **close**, **closes**, **closed**, **fix**, **fixes**, **fixed**, **resolve**, **resolves**, **resolved**: List of
9292
keywords used in Pull Request comments to automatically close a related issue
9393
- `REOPEN_KEYWORDS`: **reopen**, **reopens**, **reopened**: List of keywords used in Pull Request comments to automatically reopen

docs/content/doc/advanced/customizing-gitea.en-us.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,15 @@ the url `http://gitea.domain.tld/assets/image.png`.
6060

6161
## Changing the logo
6262

63-
To build a custom logo clone the Gitea source repository, replace `assets/logo.svg` and run
64-
`make generate-images`. This will update below output files which you can then place in `$GITEA_CUSTOM/public/img` on your server:
63+
To build a custom logo and/or favicon clone the Gitea source repository, replace `assets/logo.svg` and/or `assets/favicon.svg` and run
64+
`make generate-images`. `assets/favicon.svg` is used for the favicon only. This will update below output files which you can then place in `$GITEA_CUSTOM/public/img` on your server:
6565

66-
- `public/img/logo.svg` - Used for favicon, site icon, app icon
66+
- `public/img/logo.svg` - Used for site icon, app icon
6767
- `public/img/logo.png` - Used for Open Graph
68-
- `public/img/favicon.png` - Used as fallback for browsers that don't support SVG favicons
6968
- `public/img/avatar_default.png` - Used as the default avatar image
7069
- `public/img/apple-touch-icon.png` - Used on iOS devices for bookmarks
70+
- `public/img/favicon.svg` - Used for favicon
71+
- `public/img/favicon.png` - Used as fallback for browsers that don't support SVG favicons
7172

7273
In case the source image is not in vector format, you can attempt to convert a raster image using tools like [this](https://www.aconvert.com/image/png-to-svg/).
7374

0 commit comments

Comments
 (0)