Skip to content

Commit 9b3674e

Browse files
committed
Merge remote-tracking branch 'upstream/main'
* upstream/main: (25 commits) [skip ci] Updated translations via Crowdin Respect user's locale when rendering the date range in the repo activity page (go-gitea#21410) Consolidate more CSS colors into variables (go-gitea#21402) Add HEAD fix to gitea doctor (go-gitea#21352) Contribution guidelines (go-gitea#21425) Refactor Gitpod configuration to improve quick spin up of automated dev environments (go-gitea#21411) Support instance-wide OAuth2 applications (go-gitea#21335) Case-insensitive NuGet symbol file GUID (go-gitea#21409) Add generic set type (go-gitea#21408) Improve OAuth integration tests (go-gitea#21390) Make e-mail sanity check more precise (go-gitea#20991) Fix broken link to frontend guidelines in hacking guidelines (go-gitea#21382) Use Name instead of DisplayName in LFS Lock (go-gitea#21415) [skip ci] Updated translations via Crowdin feat(pr review): add more space on mobile (go-gitea#21326) Bump `golang.org/x/text` (go-gitea#21412) Update gitea.service (go-gitea#21399) Do DB update after merge in hammer context (go-gitea#21401) add gitpod config (go-gitea#20995) Remove cancel button in repo creation page (go-gitea#21381) ...
2 parents 63c503f + cda2c38 commit 9b3674e

File tree

82 files changed

+920
-515
lines changed

Some content is hidden

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

82 files changed

+920
-515
lines changed

.gitpod.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
tasks:
2+
- name: Setup
3+
init: |
4+
make deps
5+
make build
6+
command: |
7+
gp sync-done setup
8+
exit 0
9+
- name: Run frontend
10+
command: |
11+
gp sync-await setup
12+
make watch-frontend
13+
- name: Run backend
14+
command: |
15+
gp sync-await setup
16+
mkdir -p custom/conf/
17+
echo -e "[server]\nROOT_URL=$(gp url 3000)/" > custom/conf/app.ini
18+
echo -e "\n[database]\nDB_TYPE = sqlite3\nPATH = $GITPOD_REPO_ROOT/data/gitea.db" >> custom/conf/app.ini
19+
export TAGS="sqlite sqlite_unlock_notify"
20+
make watch-backend
21+
- name: Run docs
22+
before: sudo bash -c "$(grep 'https://github.com/gohugoio/hugo/releases/download' Makefile | tr -d '\')" # install hugo
23+
command: cd docs && make clean update && hugo server -D -F --baseUrl $(gp url 1313) --liveReloadPort=443 --appendPort=false --bind=0.0.0.0
24+
25+
vscode:
26+
extensions:
27+
- editorconfig.editorconfig
28+
- dbaeumer.vscode-eslint
29+
- golang.go
30+
- stylelint.vscode-stylelint
31+
- DavidAnson.vscode-markdownlint
32+
- johnsoncodehk.volar
33+
- ms-azuretools.vscode-docker
34+
35+
ports:
36+
- name: Gitea
37+
port: 3000
38+
- name: Docs
39+
port: 1313

CONTRIBUTING.md

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -170,17 +170,22 @@ import (
170170

171171
To maintain understandable code and avoid circular dependencies it is important to have a good structure of the code. The Gitea code is divided into the following parts:
172172

173-
- **integration:** Integration tests
174173
- **models:** Contains the data structures used by xorm to construct database tables. It also contains supporting functions to query and update the database. Dependencies to other code in Gitea should be avoided although some modules might be needed (for example for logging).
175174
- **models/fixtures:** Sample model data used in integration tests.
176175
- **models/migrations:** Handling of database migrations between versions. PRs that changes a database structure shall also have a migration step.
177-
- **modules:** Different modules to handle specific functionality in Gitea.
176+
- **modules:** Different modules to handle specific functionality in Gitea. Shall only depend on other modules but not other packages (models, services).
178177
- **public:** Frontend files (javascript, images, css, etc.)
179-
- **routers:** Handling of server requests. As it uses other Gitea packages to serve the request, other packages (models, modules or services) shall not depend on routers
178+
- **routers:** Handling of server requests. As it uses other Gitea packages to serve the request, other packages (models, modules or services) shall not depend on routers.
180179
- **services:** Support functions for common routing operations. Uses models and modules to handle the request.
181180
- **templates:** Golang templates for generating the html output.
181+
- **tests/e2e:** End to end tests
182+
- **tests/integration:** Integration tests
182183
- **vendor:** External code that Gitea depends on.
183184

185+
## Documentation
186+
187+
If you add a new feature or change an existing aspect of Gitea, the documentation for that feature must be created or updated.
188+
184189
## API v1
185190

186191
The API is documented by [swagger](http://try.gitea.io/api/swagger) and is based on [GitHub API v3](https://developer.github.com/v3/).
@@ -229,27 +234,6 @@ An endpoint which changes/edits an object expects all fields to be optional (exc
229234
- support pagination (`page` & `limit` options in query)
230235
- set `X-Total-Count` header via **SetTotalCountHeader** ([example](https://github.com/go-gitea/gitea/blob/7aae98cc5d4113f1e9918b7ee7dd09f67c189e3e/routers/api/v1/repo/issue.go#L444))
231236

232-
## Large Character Comments
233-
234-
Throughout the codebase there are large-text comments for sections of code, e.g.:
235-
236-
```go
237-
// __________ .__
238-
// \______ \ _______ _|__| ______ _ __
239-
// | _// __ \ \/ / |/ __ \ \/ \/ /
240-
// | | \ ___/\ /| \ ___/\ /
241-
// |____|_ /\___ >\_/ |__|\___ >\/\_/
242-
// \/ \/ \/
243-
```
244-
245-
These were created using the `figlet` tool with the `graffiti` font.
246-
247-
A simple way of creating these is to use the following:
248-
249-
```bash
250-
figlet -f graffiti Review | sed -e's+^+// +' - | xclip -sel clip -in
251-
```
252-
253237
## Backports and Frontports
254238

255239
Occasionally backports of PRs are required.

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
<a href="https://opensource.org/licenses/MIT" title="License: MIT">
3434
<img src="https://img.shields.io/badge/License-MIT-blue.svg">
3535
</a>
36+
<a href="https://gitpod.io/#https://github.com/go-gitea/gitea">
37+
<img
38+
src="https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod"
39+
alt="Contribute with Gitpod"
40+
/>
41+
</a>
3642
<a href="https://crowdin.com/project/gitea" title="Crowdin">
3743
<img src="https://badges.crowdin.net/gitea/localized.svg">
3844
</a>

README_ZH.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
<a href="https://opensource.org/licenses/MIT" title="License: MIT">
3434
<img src="https://img.shields.io/badge/License-MIT-blue.svg">
3535
</a>
36+
<a href="https://gitpod.io/#https://github.com/go-gitea/gitea">
37+
<img
38+
src="https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod"
39+
alt="Contribute with Gitpod"
40+
/>
41+
</a>
3642
<a href="https://crowdin.com/project/gitea" title="Crowdin">
3743
<img src="https://badges.crowdin.net/gitea/localized.svg">
3844
</a>

contrib/systemd/gitea.service

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,8 @@ After=network.target
4949
###
5050

5151
[Service]
52-
# Modify these two values and uncomment them if you have
53-
# repos with lots of files and get an HTTP error 500 because
54-
# of that
55-
###
56-
#LimitMEMLOCK=infinity
57-
#LimitNOFILE=65535
52+
# Uncomment the next line if you have repos with lots of files and get a HTTP 500 error because of that
53+
# LimitNOFILE=524288:524288
5854
RestartSec=2s
5955
Type=simple
6056
User=git

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -537,9 +537,9 @@ Certain queues have defaults that override the defaults set in `[queue]` (this o
537537
## Camo (`camo`)
538538

539539
- `ENABLED`: **false**: Enable media proxy, we support images only at the moment.
540-
- `SERVER_URL`: **<empty>**: url of camo server, it **is required** if camo is enabled.
541-
- `HMAC_KEY`: **<empty>**: Provide the HMAC key for encoding urls, it **is required** if camo is enabled.
542-
- `ALLWAYS`: **false**: Set to true to use camo for https too lese only non https urls are proxyed
540+
- `SERVER_URL`: **<empty>**: URL of camo server, it **is required** if camo is enabled.
541+
- `HMAC_KEY`: **<empty>**: Provide the HMAC key for encoding URLs, it **is required** if camo is enabled.
542+
- `ALLWAYS`: **false**: Set to true to use camo for both HTTP and HTTPS content, otherwise only non-HTTPS URLs are proxied
543543

544544
## OpenID (`openid`)
545545

File renamed without changes.

docs/content/doc/developers/hacking-on-gitea.en-us.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ menu:
1919

2020
{{< toc >}}
2121

22+
## Quickstart
23+
24+
To get a quick working development environment you could use Gitpod.
25+
26+
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/go-gitea/gitea)
27+
2228
## Installing go
2329

2430
You should [install go](https://golang.org/doc/install) and set up your go
@@ -171,7 +177,7 @@ server as mentioned above.
171177

172178
### Working on JS and CSS
173179

174-
Frontend development should follow [Guidelines for Frontend Development](./guidelines-frontend.md)
180+
Frontend development should follow [Guidelines for Frontend Development]({{< relref "doc/developers/guidelines-frontend.en-us.md" >}})
175181

176182
To build with frontend resources, either use the `watch-frontend` target mentioned above or just build once:
177183

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ require (
9898
golang.org/x/net v0.0.0-20220927171203-f486391704dc
9999
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1
100100
golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec
101-
golang.org/x/text v0.3.7
101+
golang.org/x/text v0.3.8
102102
golang.org/x/tools v0.1.12
103103
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
104104
gopkg.in/ini.v1 v1.67.0

go.sum

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1891,8 +1891,9 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
18911891
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
18921892
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
18931893
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
1894-
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
18951894
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
1895+
golang.org/x/text v0.3.8 h1:nAL+RVCQ9uMn3vJZbV+MRnydTJFPf8qqY42YiA6MrqY=
1896+
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
18961897
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
18971898
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
18981899
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=

0 commit comments

Comments
 (0)