Skip to content

Commit 84f3626

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: [skip ci] Updated translations via Crowdin Fix commit status color on dashboard repolist (go-gitea#25993) Improve profile readme rendering (go-gitea#25988) avoid hard-coding height in language dropdown menu (go-gitea#25986) parseScope with owner/repo always sets owner to zero (go-gitea#25987) Bump github.com/golang-jwt/jwt to v5 (go-gitea#25975) Update path related documents (go-gitea#25417) Update djlint, enable H026 and T027 (go-gitea#25980) [skip ci] Updated translations via Crowdin Show the mismatched ROOT_URL warning on the sign-in page if OAuth2 is enabled (go-gitea#25947) Refactor "Content" for file uploading (go-gitea#25851) Fix SSPI auth panic (go-gitea#25955) Make pending commit status yellow again (go-gitea#25935) Move public asset files to the proper directory (go-gitea#25907) Disallow dangerous url schemes (go-gitea#25960) Avoid creating directories when loading config (go-gitea#25944)
2 parents 1880269 + cf46711 commit 84f3626

File tree

469 files changed

+663
-443
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

469 files changed

+663
-443
lines changed

.dockerignore

+4-4
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ cpu.out
7575
/yarn.lock
7676
/yarn-error.log
7777
/npm-debug.log*
78-
/public/js
79-
/public/css
80-
/public/fonts
81-
/public/img/webpack
78+
/public/assets/js
79+
/public/assets/css
80+
/public/assets/fonts
81+
/public/assets/img/webpack
8282
/vendor
8383
/web_src/fomantic/node_modules
8484
/web_src/fomantic/build/*

.gitattributes

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
* text=auto eol=lf
22
*.tmpl linguist-language=Handlebars
33
/assets/*.json linguist-generated
4-
/public/img/svg/*.svg linguist-generated
4+
/public/assets/img/svg/*.svg linguist-generated
55
/templates/swagger/v1_json.tmpl linguist-generated
66
/vendor/** -text -eol linguist-vendored
77
/web_src/fomantic/build/** linguist-generated

.gitignore

+4-4
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ cpu.out
7272
/yarn.lock
7373
/yarn-error.log
7474
/npm-debug.log*
75-
/public/js
76-
/public/css
77-
/public/fonts
78-
/public/img/webpack
75+
/public/assets/js
76+
/public/assets/css
77+
/public/assets/fonts
78+
/public/assets/img/webpack
7979
/vendor
8080
/web_src/fomantic/node_modules
8181
/web_src/fomantic/build/*

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,15 @@ FOMANTIC_WORK_DIR := web_src/fomantic
116116

117117
WEBPACK_SOURCES := $(shell find web_src/js web_src/css -type f)
118118
WEBPACK_CONFIGS := webpack.config.js
119-
WEBPACK_DEST := public/js/index.js public/css/index.css
120-
WEBPACK_DEST_ENTRIES := public/js public/css public/fonts public/img/webpack
119+
WEBPACK_DEST := public/assets/js/index.js public/assets/css/index.css
120+
WEBPACK_DEST_ENTRIES := public/assets/js public/assets/css public/assets/fonts public/assets/img/webpack
121121

122122
BINDATA_DEST := modules/public/bindata.go modules/options/bindata.go modules/templates/bindata.go
123123
BINDATA_HASH := $(addsuffix .hash,$(BINDATA_DEST))
124124

125125
GENERATED_GO_DEST := modules/charset/invisible_gen.go modules/charset/ambiguous_gen.go
126126

127-
SVG_DEST_DIR := public/img/svg
127+
SVG_DEST_DIR := public/assets/img/svg
128128

129129
AIR_TMP_DIR := .air
130130

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p align="center">
22
<a href="https://gitea.io/">
3-
<img alt="Gitea" src="https://raw.githubusercontent.com/go-gitea/gitea/main/public/img/gitea.svg" width="220"/>
3+
<img alt="Gitea" src="https://raw.githubusercontent.com/go-gitea/gitea/main/public/assets/img/gitea.svg" width="220"/>
44
</a>
55
</p>
66
<h1 align="center">Gitea - Git with a cup of tea</h1>

README_ZH.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p align="center">
22
<a href="https://gitea.io/">
3-
<img alt="Gitea" src="https://raw.githubusercontent.com/go-gitea/gitea/main/public/img/gitea.svg" width="220"/>
3+
<img alt="Gitea" src="https://raw.githubusercontent.com/go-gitea/gitea/main/public/assets/img/gitea.svg" width="220"/>
44
</a>
55
</p>
66
<h1 align="center">Gitea - Git with a cup of tea</h1>

assets/go-licenses.json

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/generate-images.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ async function main() {
6969
const faviconSvg = await readFile(new URL('../assets/favicon.svg', import.meta.url), 'utf8');
7070

7171
await Promise.all([
72-
generate(logoSvg, '../public/img/logo.svg', {size: 32}),
73-
generate(logoSvg, '../public/img/logo.png', {size: 512}),
74-
generate(faviconSvg, '../public/img/favicon.svg', {size: 32}),
75-
generate(faviconSvg, '../public/img/favicon.png', {size: 180}),
76-
generate(logoSvg, '../public/img/avatar_default.png', {size: 200}),
77-
generate(logoSvg, '../public/img/apple-touch-icon.png', {size: 180, bg: true}),
78-
gitea && generate(logoSvg, '../public/img/gitea.svg', {size: 32}),
72+
generate(logoSvg, '../public/assets/img/logo.svg', {size: 32}),
73+
generate(logoSvg, '../public/assets/img/logo.png', {size: 512}),
74+
generate(faviconSvg, '../public/assets/img/favicon.svg', {size: 32}),
75+
generate(faviconSvg, '../public/assets/img/favicon.png', {size: 180}),
76+
generate(logoSvg, '../public/assets/img/avatar_default.png', {size: 200}),
77+
generate(logoSvg, '../public/assets/img/apple-touch-icon.png', {size: 180, bg: true}),
78+
gitea && generate(logoSvg, '../public/assets/img/gitea.svg', {size: 32}),
7979
]);
8080
}
8181

build/generate-svg.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async function processFile(file, {prefix, fullName} = {}) {
4444
],
4545
});
4646

47-
await writeFile(fileURLToPath(new URL(`../public/img/svg/${name}.svg`, import.meta.url)), data);
47+
await writeFile(fileURLToPath(new URL(`../public/assets/img/svg/${name}.svg`, import.meta.url)), data);
4848
}
4949

5050
function processFiles(pattern, opts) {
@@ -53,13 +53,13 @@ function processFiles(pattern, opts) {
5353

5454
async function main() {
5555
try {
56-
await mkdir(fileURLToPath(new URL('../public/img/svg', import.meta.url)), {recursive: true});
56+
await mkdir(fileURLToPath(new URL('../public/assets/img/svg', import.meta.url)), {recursive: true});
5757
} catch {}
5858

5959
await Promise.all([
6060
...processFiles('node_modules/@primer/octicons/build/svg/*-16.svg', {prefix: 'octicon'}),
6161
...processFiles('web_src/svg/*.svg'),
62-
...processFiles('public/img/gitea.svg', {fullName: 'gitea-gitea'}),
62+
...processFiles('public/assets/img/gitea.svg', {fullName: 'gitea-gitea'}),
6363
]);
6464
}
6565

cmd/serv.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030
"code.gitea.io/gitea/modules/setting"
3131
"code.gitea.io/gitea/services/lfs"
3232

33-
"github.com/golang-jwt/jwt/v4"
33+
"github.com/golang-jwt/jwt/v5"
3434
"github.com/kballard/go-shellquote"
3535
"github.com/urfave/cli"
3636
)

custom/conf/app.example.ini

+10-10
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,23 @@
1616
;;
1717
;; - _`AppPath`_: This is the absolute path of the running gitea binary.
1818
;; - _`AppWorkPath`_: This refers to "working path" of the `gitea` binary. It is determined by using the first set thing in the following hierarchy:
19+
;; - The "WORK_PATH" option in "app.ini" file
1920
;; - The `--work-path` flag passed to the binary
2021
;; - The environment variable `$GITEA_WORK_DIR`
2122
;; - A built-in value set at build time (see building from source)
2223
;; - Otherwise it defaults to the directory of the _`AppPath`_
23-
;; - If any of the above are relative paths then they are made absolute against
24-
;; the directory of the _`AppPath`_
25-
;; - _`CustomPath`_: This is the base directory for custom templates and other options.
26-
;; It is determined by using the first set thing in the following hierarchy:
24+
;; - If any of the above are relative paths then they are made absolute against the directory of the _`AppPath`_
25+
;; - _`CustomPath`_: This is the base directory for custom templates and other options. It is determined by using the first set thing in the following hierarchy:
2726
;; - The `--custom-path` flag passed to the binary
2827
;; - The environment variable `$GITEA_CUSTOM`
2928
;; - A built-in value set at build time (see building from source)
3029
;; - Otherwise it defaults to _`AppWorkPath`_`/custom`
31-
;; - If any of the above are relative paths then they are made absolute against the
32-
;; the directory of the _`AppWorkPath`_
30+
;; - If any of the above are relative paths then they are made absolute against the directory of the _`AppWorkPath`_
3331
;; - _`CustomConf`_: This is the path to the `app.ini` file.
3432
;; - The `--config` flag passed to the binary
3533
;; - A built-in value set at build time (see building from source)
3634
;; - Otherwise it defaults to _`CustomPath`_`/conf/app.ini`
37-
;; - If any of the above are relative paths then they are made absolute against the
38-
;; the directory of the _`CustomPath`_
35+
;; - If any of the above are relative paths then they are made absolute against the directory of the _`CustomPath`_
3936
;;
4037
;; In addition there is _`StaticRootPath`_ which can be set as a built-in at build time, but will otherwise default to _`AppWorkPath`_
4138

@@ -52,6 +49,9 @@ RUN_USER = ; git
5249
;; Application run mode, affects performance and debugging: "dev" or "prod", default is "prod"
5350
;; Mode "dev" makes Gitea easier to develop and debug, values other than "dev" are treated as "prod" which is for production use.
5451
;RUN_MODE = prod
52+
;;
53+
;; The working directory, see the comment of AppWorkPath above
54+
;WORK_PATH =
5555

5656
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5757
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1200,11 +1200,11 @@ LEVEL = Info
12001200
;;
12011201
;; All available reactions users can choose on issues/prs and comments.
12021202
;; Values can be emoji alias (:smile:) or a unicode emoji.
1203-
;; For custom reactions, add a tightly cropped square image to public/img/emoji/reaction_name.png
1203+
;; For custom reactions, add a tightly cropped square image to public/assets/img/emoji/reaction_name.png
12041204
;REACTIONS = +1, -1, laugh, hooray, confused, heart, rocket, eyes
12051205
;;
12061206
;; Additional Emojis not defined in the utf8 standard
1207-
;; By default we support gitea (:gitea:), to add more copy them to public/img/emoji/emoji_name.png and add it to this config.
1207+
;; By default we support gitea (:gitea:), to add more copy them to public/assets/img/emoji/emoji_name.png and add it to this config.
12081208
;; Dont mistake it for Reactions.
12091209
;CUSTOM_EMOJIS = gitea, codeberg, gitlab, git, github, gogs
12101210
;;

docs/content/doc/administration/backup-and-restore.en-us.md

+2-12
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ directory. There should be some output similar to the following:
4646

4747
Inside the `gitea-dump-1482906742.zip` file, will be the following:
4848

49-
- `app.ini` - Optional copy of configuration file if originally stored outside of the default `custom/` directory
49+
- `app.ini` - Optional copy of configuration file if originally stored outside the default `custom/` directory
5050
- `custom` - All config or customization files in `custom/`.
51-
- `data` - Data directory in <GITEA_WORK_DIR>, except sessions if you are using file session. This directory includes `attachments`, `avatars`, `lfs`, `indexers`, SQLite file if you are using SQLite.
51+
- `data` - Data directory (APP_DATA_PATH), except sessions if you are using file session. This directory includes `attachments`, `avatars`, `lfs`, `indexers`, SQLite file if you are using SQLite.
5252
- `gitea-db.sql` - SQL dump of database
5353
- `gitea-repo.zip` - Complete copy of the repository directory.
5454
- `log/` - Various logs. They are not needed for a recovery or migration.
@@ -139,16 +139,6 @@ chown -R git:git /data
139139

140140
The default user in the gitea container is `git` (1000:1000). Please replace `2a83b293548e` with your gitea container id or name.
141141

142-
These are the default paths used in the container:
143-
144-
```text
145-
DEFAULT CONFIGURATION:
146-
CustomPath: /data/gitea (GITEA_CUSTOM)
147-
CustomConf: /data/gitea/conf/app.ini
148-
AppPath: /usr/local/bin/gitea
149-
AppWorkPath: /usr/local/bin
150-
```
151-
152142
### Using Docker-rootless (`restore`)
153143

154144
The restore workflow in Docker-rootless containers differs only in the directories to be used:

docs/content/doc/administration/cmd-embedded.en-us.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ for its glob syntax. Here are some examples:
4747

4848
- List all template files, in any virtual directory: `**.tmpl`
4949
- List all mail template files: `templates/mail/**.tmpl`
50-
- List all files inside `public/img`: `public/img/**`
50+
- List all files inside `public/assets/img`: `public/assets/img/**`
5151

5252
Don't forget to use quotes for the patterns, as spaces, `*` and other characters might have
5353
a special meaning for your command shell.
@@ -60,8 +60,8 @@ Listing all embedded files with `openid` in their path:
6060

6161
```sh
6262
$ gitea embedded list '**openid**'
63-
public/img/auth/openid_connect.svg
64-
public/img/openid-16x16.png
63+
public/assets/img/auth/openid_connect.svg
64+
public/assets/img/openid-16x16.png
6565
templates/user/auth/finalize_openid.tmpl
6666
templates/user/auth/signin_openid.tmpl
6767
templates/user/auth/signup_openid_connect.tmpl

docs/content/doc/administration/command-line.en-us.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ All global options can be placed at the command level.
3131

3232
- `--help`, `-h`: Show help text and exit. Optional.
3333
- `--version`, `-v`: Show version and exit. Optional. (example: `Gitea version 1.1.0+218-g7b907ed built with: bindata, sqlite`).
34-
- `--custom-path path`, `-C path`: Location of the Gitea custom folder. Optional. (default: `AppWorkPath`/custom or `$GITEA_CUSTOM`).
35-
- `--config path`, `-c path`: Gitea configuration file path. Optional. (default: `custom`/conf/app.ini).
36-
- `--work-path path`, `-w path`: Gitea `AppWorkPath`. Optional. (default: LOCATION_OF_GITEA_BINARY or `$GITEA_WORK_DIR`)
34+
- `--work-path path`, `-w path`: Gitea's work path. Optional. (default: the binary's path or `$GITEA_WORK_DIR`)
35+
- `--custom-path path`, `-C path`: Gitea's custom folder path. Optional. (default: `WorkPath`/custom or `$GITEA_CUSTOM`).
36+
- `--config path`, `-c path`: Gitea configuration file path. Optional. (default: `CustomPath`/conf/app.ini).
3737

3838
NB: The defaults custom-path, config and work-path can also be
3939
changed at build time (if preferred).

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

+10-10
Original file line numberDiff line numberDiff line change
@@ -44,28 +44,27 @@ reported as part of the default configuration when running `gitea --help` or on
4444

4545
- _`AppPath`_: This is the absolute path of the running gitea binary.
4646
- _`AppWorkPath`_: This refers to "working path" of the `gitea` binary. It is determined by using the first set thing in the following hierarchy:
47+
- The `WORK_PATH` option in `app.ini`
4748
- The `--work-path` flag passed to the binary
4849
- The environment variable `$GITEA_WORK_DIR`
4950
- A built-in value set at build time (see building from source)
50-
- Otherwise it defaults to the directory of the _`AppPath`_
51-
- If any of the above are relative paths then they are made absolute against
52-
the directory of the _`AppPath`_
51+
- Otherwise, it defaults to the directory of the _`AppPath`_
52+
- If any of the above are relative paths then they are made absolute against the directory of the _`AppPath`_
5353
- _`CustomPath`_: This is the base directory for custom templates and other options.
5454
It is determined by using the first set thing in the following hierarchy:
5555
- The `--custom-path` flag passed to the binary
5656
- The environment variable `$GITEA_CUSTOM`
5757
- A built-in value set at build time (see building from source)
58-
- Otherwise it defaults to _`AppWorkPath`_`/custom`
58+
- Otherwise, it defaults to _`AppWorkPath`_`/custom`
5959
- If any of the above are relative paths then they are made absolute against the
6060
the directory of the _`AppWorkPath`_
6161
- _`CustomConf`_: This is the path to the `app.ini` file.
6262
- The `--config` flag passed to the binary
6363
- A built-in value set at build time (see building from source)
64-
- Otherwise it defaults to _`CustomPath`_`/conf/app.ini`
65-
- If any of the above are relative paths then they are made absolute against the
66-
the directory of the _`CustomPath`_
64+
- Otherwise, it defaults to _`CustomPath`_`/conf/app.ini`
65+
- If any of the above are relative paths then they are made absolute against the directory of the _`CustomPath`_
6766

68-
In addition there is _`StaticRootPath`_ which can be set as a built-in at build time, but will otherwise default to _`AppWorkPath`_
67+
In addition, there is _`StaticRootPath`_ which can be set as a built-in at build time, but will otherwise default to _`AppWorkPath`_
6968

7069
## Overall (`DEFAULT`)
7170

@@ -74,6 +73,7 @@ In addition there is _`StaticRootPath`_ which can be set as a built-in at build
7473
This should be a dedicated system (non-user) account. Setting this incorrectly will cause Gitea
7574
to not start.
7675
- `RUN_MODE`: **prod**: Application run mode, affects performance and debugging: `dev` or `prod`, default is `prod`. Mode `dev` makes Gitea easier to develop and debug, values other than `dev` are treated as `prod` which is for production use.
76+
- `WORK_PATH`: **_the-work-path_**: The working directory, see the comment of AppWorkPath above.
7777

7878
## Repository (`repository`)
7979

@@ -224,9 +224,9 @@ The following configuration set `Content-Type: application/vnd.android.package-a
224224
- `MAX_DISPLAY_FILE_SIZE`: **8388608**: Max size of files to be displayed (default is 8MiB)
225225
- `REACTIONS`: All available reactions users can choose on issues/prs and comments
226226
Values can be emoji alias (:smile:) or a unicode emoji.
227-
For custom reactions, add a tightly cropped square image to public/img/emoji/reaction_name.png
227+
For custom reactions, add a tightly cropped square image to public/assets/img/emoji/reaction_name.png
228228
- `CUSTOM_EMOJIS`: **gitea, codeberg, gitlab, git, github, gogs**: Additional Emojis not defined in the utf8 standard.
229-
By default, we support Gitea (:gitea:), to add more copy them to public/img/emoji/emoji_name.png and
229+
By default, we support Gitea (:gitea:), to add more copy them to public/assets/img/emoji/emoji_name.png and
230230
add it to this config.
231231
- `DEFAULT_SHOW_FULL_NAME`: **false**: Whether the full name of the users should be shown where possible. If the full name isn't set, the username will be used.
232232
- `SEARCH_REPO_DESCRIPTION`: **true**: Whether to search within description at repository search on explore page.

0 commit comments

Comments
 (0)