mirror of
https://gitea.com/gitea/docs.git
synced 2026-11-16 06:43:45 +00:00
Reformat docs (#13897)
Co-authored-by: 6543 <[email protected]> Co-authored-by: Lauris BH <[email protected]>
This commit is contained in:
1 parent
3bfa053c3e
commit
9ccfa03d94
86 files changed
+728
-570
No files matched your search
@@ -3,7 +3,7 @@ date: "2020-01-25T21:00:00-03:00"
|
|||||||
title: "Embedded data extraction tool"
|
title: "Embedded data extraction tool"
|
||||||
slug: "cmd-embedded"
|
slug: "cmd-embedded"
|
||||||
weight: 40
|
weight: 40
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
@@ -15,6 +15,10 @@ menu:
|
|||||||
|
|
||||||
# Embedded data extraction tool
|
# Embedded data extraction tool
|
||||||
|
|
||||||
|
**Table of Contents**
|
||||||
|
|
||||||
|
{{< toc >}}
|
||||||
|
|
||||||
Gitea's executable contains all the resources required to run: templates, images, style-sheets
|
Gitea's executable contains all the resources required to run: templates, images, style-sheets
|
||||||
and translations. Any of them can be overridden by placing a replacement in a matching path
|
and translations. Any of them can be overridden by placing a replacement in a matching path
|
||||||
inside the `custom` directory (see [Customizing Gitea]({{< relref "doc/advanced/customizing-gitea.en-us.md" >}})).
|
inside the `custom` directory (see [Customizing Gitea]({{< relref "doc/advanced/customizing-gitea.en-us.md" >}})).
|
||||||
@@ -28,7 +32,7 @@ can be used from the OS shell interface.
|
|||||||
|
|
||||||
To list resources embedded in Gitea's executable, use the following syntax:
|
To list resources embedded in Gitea's executable, use the following syntax:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
gitea embedded list [--include-vendored] [patterns...]
|
gitea embedded list [--include-vendored] [patterns...]
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -48,11 +52,11 @@ a special meaning for your command shell.
|
|||||||
|
|
||||||
If no pattern is provided, all files are listed.
|
If no pattern is provided, all files are listed.
|
||||||
|
|
||||||
#### Example
|
### Example
|
||||||
|
|
||||||
Listing all embedded files with `openid` in their path:
|
Listing all embedded files with `openid` in their path:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
$ gitea embedded list '**openid**'
|
$ gitea embedded list '**openid**'
|
||||||
public/img/auth/openid_connect.svg
|
public/img/auth/openid_connect.svg
|
||||||
public/img/openid-16x16.png
|
public/img/openid-16x16.png
|
||||||
@@ -68,7 +72,7 @@ templates/user/settings/security_openid.tmpl
|
|||||||
|
|
||||||
To extract resources embedded in Gitea's executable, use the following syntax:
|
To extract resources embedded in Gitea's executable, use the following syntax:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
gitea [--config {file}] embedded extract [--destination {dir}|--custom] [--overwrite|--rename] [--include-vendored] {patterns...}
|
gitea [--config {file}] embedded extract [--destination {dir}|--custom] [--overwrite|--rename] [--include-vendored] {patterns...}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -91,7 +95,7 @@ as `filename.bak`. Previous `.bak` files are overwritten.
|
|||||||
At least one file search pattern must be provided; see `list` subcomand above for pattern
|
At least one file search pattern must be provided; see `list` subcomand above for pattern
|
||||||
syntax and examples.
|
syntax and examples.
|
||||||
|
|
||||||
#### Important notice
|
### Important notice
|
||||||
|
|
||||||
Make sure to **only extract those files that require customization**. Files that
|
Make sure to **only extract those files that require customization**. Files that
|
||||||
are present in the `custom` directory are not upgraded by Gitea's upgrade process.
|
are present in the `custom` directory are not upgraded by Gitea's upgrade process.
|
||||||
@@ -99,11 +103,11 @@ When Gitea is upgraded to a new version (by replacing the executable), many of t
|
|||||||
embedded files will suffer changes. Gitea will honor and use any files found
|
embedded files will suffer changes. Gitea will honor and use any files found
|
||||||
in the `custom` directory, even if they are old and incompatible.
|
in the `custom` directory, even if they are old and incompatible.
|
||||||
|
|
||||||
#### Example
|
### Example
|
||||||
|
|
||||||
Extracting mail templates to a temporary directory:
|
Extracting mail templates to a temporary directory:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
$ mkdir tempdir
|
$ mkdir tempdir
|
||||||
$ gitea embedded extract --destination tempdir 'templates/mail/**.tmpl'
|
$ gitea embedded extract --destination tempdir 'templates/mail/**.tmpl'
|
||||||
Extracting to tempdir:
|
Extracting to tempdir:
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ environment variable; this can be used to override the default path to something
|
|||||||
|
|
||||||
**Note:** Gitea must perform a full restart to see configuration changes.
|
**Note:** Gitea must perform a full restart to see configuration changes.
|
||||||
|
|
||||||
# Table of Contents
|
**Table of Contents**
|
||||||
|
|
||||||
{{< toc >}}
|
{{< toc >}}
|
||||||
|
|
||||||
@@ -127,8 +127,8 @@ copy javascript files from https://gitea.com/davidsvantesson/plantuml-code-highl
|
|||||||
<script src="https://your-server.com/encode.js"></script>
|
<script src="https://your-server.com/encode.js"></script>
|
||||||
<script src="https://your-server.com/plantuml_codeblock_parse.js"></script>
|
<script src="https://your-server.com/plantuml_codeblock_parse.js"></script>
|
||||||
<script>
|
<script>
|
||||||
<!-- Replace call with address to your plantuml server-->
|
<!-- Replace call with address to your plantuml server-->
|
||||||
parsePlantumlCodeBlocks("http://www.plantuml..com/plantuml")
|
parsePlantumlCodeBlocks("http://www.plantuml..com/plantuml");
|
||||||
</script>
|
</script>
|
||||||
{{end}}
|
{{end}}
|
||||||
```
|
```
|
||||||
@@ -148,38 +148,50 @@ The script will detect tags with `class="language-plantuml"`, but you can change
|
|||||||
#### Example: STL Preview
|
#### Example: STL Preview
|
||||||
|
|
||||||
You can display STL file directly in Gitea by adding:
|
You can display STL file directly in Gitea by adding:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script>
|
<script>
|
||||||
function lS(src){
|
function lS(src) {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
let s = document.createElement('script')
|
let s = document.createElement("script");
|
||||||
s.src = src
|
s.src = src;
|
||||||
s.addEventListener('load', () => {
|
s.addEventListener("load", () => {
|
||||||
resolve()
|
resolve();
|
||||||
})
|
|
||||||
document.body.appendChild(s)
|
|
||||||
});
|
});
|
||||||
}
|
document.body.appendChild(s);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if($('.view-raw>a[href$=".stl" i]').length){
|
if ($('.view-raw>a[href$=".stl" i]').length) {
|
||||||
$('body').append('<link href="/Madeleine.js/src/css/Madeleine.css" rel="stylesheet">');
|
$("body").append(
|
||||||
Promise.all([lS("/Madeleine.js/src/lib/stats.js"),lS("/Madeleine.js/src/lib/detector.js"), lS("/Madeleine.js/src/lib/three.min.js"), lS("/Madeleine.js/src/Madeleine.js")]).then(function() {
|
'<link href="/Madeleine.js/src/css/Madeleine.css" rel="stylesheet">'
|
||||||
$('.view-raw').attr('id', 'view-raw').attr('style', 'padding: 0;margin-bottom: -10px;');
|
);
|
||||||
|
Promise.all([
|
||||||
|
lS("/Madeleine.js/src/lib/stats.js"),
|
||||||
|
lS("/Madeleine.js/src/lib/detector.js"),
|
||||||
|
lS("/Madeleine.js/src/lib/three.min.js"),
|
||||||
|
lS("/Madeleine.js/src/Madeleine.js"),
|
||||||
|
]).then(function () {
|
||||||
|
$(".view-raw")
|
||||||
|
.attr("id", "view-raw")
|
||||||
|
.attr("style", "padding: 0;margin-bottom: -10px;");
|
||||||
new Madeleine({
|
new Madeleine({
|
||||||
target: 'view-raw',
|
target: "view-raw",
|
||||||
data: $('.view-raw>a[href$=".stl" i]').attr('href'),
|
data: $('.view-raw>a[href$=".stl" i]').attr("href"),
|
||||||
path: '/Madeleine.js/src'
|
path: "/Madeleine.js/src",
|
||||||
});
|
});
|
||||||
$('.view-raw>a[href$=".stl"]').remove()
|
$('.view-raw>a[href$=".stl"]').remove();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
```
|
```
|
||||||
|
|
||||||
to the file `templates/custom/footer.tmpl`
|
to the file `templates/custom/footer.tmpl`
|
||||||
|
|
||||||
You also need to download the content of the library [Madeleine.js](https://jinjunho.github.io/Madeleine.js/) and place it under `custom/public/` folder.
|
You also need to download the content of the library [Madeleine.js](https://jinjunho.github.io/Madeleine.js/) and place it under `custom/public/` folder.
|
||||||
|
|
||||||
You should end-up with a folder structucture similar to:
|
You should end-up with a folder structucture similar to:
|
||||||
|
|
||||||
```
|
```
|
||||||
custom/templates
|
custom/templates
|
||||||
-- custom
|
-- custom
|
||||||
@@ -289,10 +301,12 @@ currently there are `{Name}` (name of repository), `{Description}`, `{CloneURL.S
|
|||||||
### Reactions
|
### Reactions
|
||||||
|
|
||||||
To change reaction emoji's you can set allowed reactions at app.ini
|
To change reaction emoji's you can set allowed reactions at app.ini
|
||||||
|
|
||||||
```
|
```
|
||||||
[ui]
|
[ui]
|
||||||
REACTIONS = +1, -1, laugh, confused, heart, hooray, eyes
|
REACTIONS = +1, -1, laugh, confused, heart, hooray, eyes
|
||||||
```
|
```
|
||||||
|
|
||||||
A full list of supported emoji's is at [emoji list](https://gitea.com/gitea/gitea.com/issues/8)
|
A full list of supported emoji's is at [emoji list](https://gitea.com/gitea/gitea.com/issues/8)
|
||||||
|
|
||||||
## Customizing the look of Gitea
|
## Customizing the look of Gitea
|
||||||
|
|||||||
@@ -15,11 +15,15 @@ menu:
|
|||||||
|
|
||||||
# Environment variables
|
# Environment variables
|
||||||
|
|
||||||
|
**Table of Contents**
|
||||||
|
|
||||||
|
{{< toc >}}
|
||||||
|
|
||||||
This is an inventory of Gitea environment variables. They change Gitea behaviour.
|
This is an inventory of Gitea environment variables. They change Gitea behaviour.
|
||||||
|
|
||||||
Initialize them before Gitea command to be effective, for example:
|
Initialize them before Gitea command to be effective, for example:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
GITEA_CUSTOM=/home/gitea/custom ./gitea web
|
GITEA_CUSTOM=/home/gitea/custom ./gitea web
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -27,42 +31,42 @@ GITEA_CUSTOM=/home/gitea/custom ./gitea web
|
|||||||
|
|
||||||
As Gitea is written in Go, it uses some Go variables, such as:
|
As Gitea is written in Go, it uses some Go variables, such as:
|
||||||
|
|
||||||
* `GOOS`
|
- `GOOS`
|
||||||
* `GOARCH`
|
- `GOARCH`
|
||||||
* [`GOPATH`](https://golang.org/cmd/go/#hdr-GOPATH_environment_variable)
|
- [`GOPATH`](https://golang.org/cmd/go/#hdr-GOPATH_environment_variable)
|
||||||
|
|
||||||
For documentation about each of the variables available, refer to the
|
For documentation about each of the variables available, refer to the
|
||||||
[official Go documentation](https://golang.org/cmd/go/#hdr-Environment_variables).
|
[official Go documentation](https://golang.org/cmd/go/#hdr-Environment_variables).
|
||||||
|
|
||||||
## Gitea files
|
## Gitea files
|
||||||
|
|
||||||
* `GITEA_WORK_DIR`: Absolute path of working directory.
|
- `GITEA_WORK_DIR`: Absolute path of working directory.
|
||||||
* `GITEA_CUSTOM`: Gitea uses `GITEA_WORK_DIR`/custom folder by default. Use this variable
|
- `GITEA_CUSTOM`: Gitea uses `GITEA_WORK_DIR`/custom folder by default. Use this variable
|
||||||
to change *custom* directory.
|
to change _custom_ directory.
|
||||||
* `GOGS_WORK_DIR`: Deprecated, use `GITEA_WORK_DIR`
|
- `GOGS_WORK_DIR`: Deprecated, use `GITEA_WORK_DIR`
|
||||||
* `GOGS_CUSTOM`: Deprecated, use `GITEA_CUSTOM`
|
- `GOGS_CUSTOM`: Deprecated, use `GITEA_CUSTOM`
|
||||||
|
|
||||||
## Operating system specifics
|
## Operating system specifics
|
||||||
|
|
||||||
* `USER`: System user that Gitea will run as. Used for some repository access strings.
|
- `USER`: System user that Gitea will run as. Used for some repository access strings.
|
||||||
* `USERNAME`: if no `USER` found, Gitea will use `USERNAME`
|
- `USERNAME`: if no `USER` found, Gitea will use `USERNAME`
|
||||||
* `HOME`: User home directory path. The `USERPROFILE` environment variable is used in Windows.
|
- `HOME`: User home directory path. The `USERPROFILE` environment variable is used in Windows.
|
||||||
|
|
||||||
### Only on Windows
|
### Only on Windows
|
||||||
|
|
||||||
* `USERPROFILE`: User home directory path. If empty, uses `HOMEDRIVE` + `HOMEPATH`
|
- `USERPROFILE`: User home directory path. If empty, uses `HOMEDRIVE` + `HOMEPATH`
|
||||||
* `HOMEDRIVE`: Main drive path used to access the home directory (C:)
|
- `HOMEDRIVE`: Main drive path used to access the home directory (C:)
|
||||||
* `HOMEPATH`: Home relative path in the given home drive path
|
- `HOMEPATH`: Home relative path in the given home drive path
|
||||||
|
|
||||||
## Macaron (framework used by Gitea)
|
## Macaron (framework used by Gitea)
|
||||||
|
|
||||||
* `HOST`: Host Macaron will listen on
|
- `HOST`: Host Macaron will listen on
|
||||||
* `PORT`: Port Macaron will listen on
|
- `PORT`: Port Macaron will listen on
|
||||||
* `MACARON_ENV`: global variable to provide special functionality for development environments
|
- `MACARON_ENV`: global variable to provide special functionality for development environments
|
||||||
vs. production environments. If MACARON_ENV is set to "" or "development", then templates will
|
vs. production environments. If MACARON_ENV is set to "" or "development", then templates will
|
||||||
be recompiled on every request. For more performance, set the MACARON_ENV environment variable
|
be recompiled on every request. For more performance, set the MACARON_ENV environment variable
|
||||||
to "production".
|
to "production".
|
||||||
|
|
||||||
## Miscellaneous
|
## Miscellaneous
|
||||||
|
|
||||||
* `SKIP_MINWINSVC`: If set to 1, do not run as a service on Windows.
|
- `SKIP_MINWINSVC`: If set to 1, do not run as a service on Windows.
|
||||||
@@ -3,7 +3,7 @@ date: "2018-11-23:00:00+02:00"
|
|||||||
title: "External renderers"
|
title: "External renderers"
|
||||||
slug: "external-renderers"
|
slug: "external-renderers"
|
||||||
weight: 40
|
weight: 40
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
@@ -15,12 +15,16 @@ menu:
|
|||||||
|
|
||||||
# Custom files rendering configuration
|
# Custom files rendering configuration
|
||||||
|
|
||||||
|
**Table of Contents**
|
||||||
|
|
||||||
|
{{< toc >}}
|
||||||
|
|
||||||
Gitea supports custom file renderings (i.e., Jupyter notebooks, asciidoc, etc.) through external binaries,
|
Gitea supports custom file renderings (i.e., Jupyter notebooks, asciidoc, etc.) through external binaries,
|
||||||
it is just a matter of:
|
it is just a matter of:
|
||||||
|
|
||||||
* installing external binaries
|
- installing external binaries
|
||||||
* add some configuration to your `app.ini` file
|
- add some configuration to your `app.ini` file
|
||||||
* restart your Gitea instance
|
- restart your Gitea instance
|
||||||
|
|
||||||
This supports rendering of whole files. If you want to render code blocks in markdown you would need to do something with javascript. See some examples on the [Customizing Gitea](../customizing-gitea) page.
|
This supports rendering of whole files. If you want to render code blocks in markdown you would need to do something with javascript. See some examples on the [Customizing Gitea](../customizing-gitea) page.
|
||||||
|
|
||||||
@@ -29,7 +33,7 @@ This supports rendering of whole files. If you want to render code blocks in mar
|
|||||||
In order to get file rendering through external binaries, their associated packages must be installed.
|
In order to get file rendering through external binaries, their associated packages must be installed.
|
||||||
If you're using a Docker image, your `Dockerfile` should contain something along this lines:
|
If you're using a Docker image, your `Dockerfile` should contain something along this lines:
|
||||||
|
|
||||||
```
|
```docker
|
||||||
FROM gitea/gitea:{{< version >}}
|
FROM gitea/gitea:{{< version >}}
|
||||||
[...]
|
[...]
|
||||||
|
|
||||||
@@ -49,7 +53,7 @@ RUN pip3 install jupyter docutils
|
|||||||
|
|
||||||
add one `[markup.XXXXX]` section per external renderer on your custom `app.ini`:
|
add one `[markup.XXXXX]` section per external renderer on your custom `app.ini`:
|
||||||
|
|
||||||
```
|
```ini
|
||||||
[markup.asciidoc]
|
[markup.asciidoc]
|
||||||
ENABLED = true
|
ENABLED = true
|
||||||
FILE_EXTENSIONS = .adoc,.asciidoc
|
FILE_EXTENSIONS = .adoc,.asciidoc
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2019-04-02T17:06:00+01:00"
|
|||||||
title: "Advanced: Logging Configuration"
|
title: "Advanced: Logging Configuration"
|
||||||
slug: "logging-configuration"
|
slug: "logging-configuration"
|
||||||
weight: 55
|
weight: 55
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
@@ -17,6 +17,8 @@ menu:
|
|||||||
|
|
||||||
The logging framework has been revamped in Gitea 1.9.0.
|
The logging framework has been revamped in Gitea 1.9.0.
|
||||||
|
|
||||||
|
**Table of Contents**
|
||||||
|
|
||||||
{{< toc >}}
|
{{< toc >}}
|
||||||
|
|
||||||
## Log Groups
|
## Log Groups
|
||||||
@@ -24,11 +26,11 @@ The logging framework has been revamped in Gitea 1.9.0.
|
|||||||
The fundamental thing to be aware of in Gitea is that there are several
|
The fundamental thing to be aware of in Gitea is that there are several
|
||||||
log groups:
|
log groups:
|
||||||
|
|
||||||
* The "Default" logger
|
- The "Default" logger
|
||||||
* The Macaron logger
|
- The Macaron logger
|
||||||
* The Router logger
|
- The Router logger
|
||||||
* The Access logger
|
- The Access logger
|
||||||
* The XORM logger
|
- The XORM logger
|
||||||
|
|
||||||
There is also the go log logger.
|
There is also the go log logger.
|
||||||
|
|
||||||
@@ -55,11 +57,11 @@ which inherits from the sublogger `[log.sublogger]` section and from the
|
|||||||
generic `[log]` section, but there are certain default values. These will
|
generic `[log]` section, but there are certain default values. These will
|
||||||
not be inherited from the `[log]` section:
|
not be inherited from the `[log]` section:
|
||||||
|
|
||||||
* `FLAGS` is `stdflags` (Equal to
|
- `FLAGS` is `stdflags` (Equal to
|
||||||
`date,time,medfile,shortfuncname,levelinitial`)
|
`date,time,medfile,shortfuncname,levelinitial`)
|
||||||
* `FILE_NAME` will default to `%(ROOT_PATH)/gitea.log`
|
- `FILE_NAME` will default to `%(ROOT_PATH)/gitea.log`
|
||||||
* `EXPRESSION` will default to `""`
|
- `EXPRESSION` will default to `""`
|
||||||
* `PREFIX` will default to `""`
|
- `PREFIX` will default to `""`
|
||||||
|
|
||||||
The provider type of the sublogger can be set using the `MODE` value in
|
The provider type of the sublogger can be set using the `MODE` value in
|
||||||
its subsection, but will default to the name. This allows you to have
|
its subsection, but will default to the name. This allows you to have
|
||||||
@@ -82,11 +84,11 @@ Each output sublogger for this logger is configured in
|
|||||||
which will not be inherited from the `[log]` or relevant
|
which will not be inherited from the `[log]` or relevant
|
||||||
`[log.sublogger]` sections:
|
`[log.sublogger]` sections:
|
||||||
|
|
||||||
* `FLAGS` is `stdflags` (Equal to
|
- `FLAGS` is `stdflags` (Equal to
|
||||||
`date,time,medfile,shortfuncname,levelinitial`)
|
`date,time,medfile,shortfuncname,levelinitial`)
|
||||||
* `FILE_NAME` will default to `%(ROOT_PATH)/macaron.log`
|
- `FILE_NAME` will default to `%(ROOT_PATH)/macaron.log`
|
||||||
* `EXPRESSION` will default to `""`
|
- `EXPRESSION` will default to `""`
|
||||||
* `PREFIX` will default to `""`
|
- `PREFIX` will default to `""`
|
||||||
|
|
||||||
NB: You can redirect the macaron logger to send its events to the gitea
|
NB: You can redirect the macaron logger to send its events to the gitea
|
||||||
log using the value: `MACARON = ,`
|
log using the value: `MACARON = ,`
|
||||||
@@ -113,10 +115,10 @@ Each output sublogger for this logger is configured in
|
|||||||
which will not be inherited from the `[log]` or relevant
|
which will not be inherited from the `[log]` or relevant
|
||||||
`[log.sublogger]` sections:
|
`[log.sublogger]` sections:
|
||||||
|
|
||||||
* `FILE_NAME` will default to `%(ROOT_PATH)/router.log`
|
- `FILE_NAME` will default to `%(ROOT_PATH)/router.log`
|
||||||
* `FLAGS` defaults to `date,time`
|
- `FLAGS` defaults to `date,time`
|
||||||
* `EXPRESSION` will default to `""`
|
- `EXPRESSION` will default to `""`
|
||||||
* `PREFIX` will default to `""`
|
- `PREFIX` will default to `""`
|
||||||
|
|
||||||
NB: You can redirect the router logger to send its events to the Gitea
|
NB: You can redirect the router logger to send its events to the Gitea
|
||||||
log using the value: `ROUTER = ,`
|
log using the value: `ROUTER = ,`
|
||||||
@@ -138,10 +140,10 @@ Each output sublogger for this logger is configured in
|
|||||||
which will not be inherited from the `[log]` or relevant
|
which will not be inherited from the `[log]` or relevant
|
||||||
`[log.sublogger]` sections:
|
`[log.sublogger]` sections:
|
||||||
|
|
||||||
* `FILE_NAME` will default to `%(ROOT_PATH)/access.log`
|
- `FILE_NAME` will default to `%(ROOT_PATH)/access.log`
|
||||||
* `FLAGS` defaults to `` or None
|
- `FLAGS` defaults to `` or None
|
||||||
* `EXPRESSION` will default to `""`
|
- `EXPRESSION` will default to `""`
|
||||||
* `PREFIX` will default to `""`
|
- `PREFIX` will default to `""`
|
||||||
|
|
||||||
If desired the format of the Access logger can be changed by changing
|
If desired the format of the Access logger can be changed by changing
|
||||||
the value of the `ACCESS_LOG_TEMPLATE`.
|
the value of the `ACCESS_LOG_TEMPLATE`.
|
||||||
@@ -160,11 +162,11 @@ This value represent a go template. It's default value is:
|
|||||||
|
|
||||||
The template is passed following options:
|
The template is passed following options:
|
||||||
|
|
||||||
* `Ctx` is the `macaron.Context`
|
- `Ctx` is the `macaron.Context`
|
||||||
* `Identity` is the `SignedUserName` or `"-"` if the user is not logged
|
- `Identity` is the `SignedUserName` or `"-"` if the user is not logged
|
||||||
in
|
in
|
||||||
* `Start` is the start time of the request
|
- `Start` is the start time of the request
|
||||||
* `ResponseWriter` is the `macaron.ResponseWriter`
|
- `ResponseWriter` is the `macaron.ResponseWriter`
|
||||||
|
|
||||||
Caution must be taken when changing this template as it runs outside of
|
Caution must be taken when changing this template as it runs outside of
|
||||||
the standard panic recovery trap. The template should also be as simple
|
the standard panic recovery trap. The template should also be as simple
|
||||||
@@ -187,31 +189,31 @@ Each output sublogger for this logger is configured in
|
|||||||
which will not be inherited from the `[log]` or relevant
|
which will not be inherited from the `[log]` or relevant
|
||||||
`[log.sublogger]` sections:
|
`[log.sublogger]` sections:
|
||||||
|
|
||||||
* `FILE_NAME` will default to `%(ROOT_PATH)/xorm.log`
|
- `FILE_NAME` will default to `%(ROOT_PATH)/xorm.log`
|
||||||
* `FLAGS` defaults to `date,time`
|
- `FLAGS` defaults to `date,time`
|
||||||
* `EXPRESSION` will default to `""`
|
- `EXPRESSION` will default to `""`
|
||||||
* `PREFIX` will default to `""`
|
- `PREFIX` will default to `""`
|
||||||
|
|
||||||
## Log outputs
|
## Log outputs
|
||||||
|
|
||||||
Gitea provides 4 possible log outputs:
|
Gitea provides 4 possible log outputs:
|
||||||
|
|
||||||
* `console` - Log to `os.Stdout` or `os.Stderr`
|
- `console` - Log to `os.Stdout` or `os.Stderr`
|
||||||
* `file` - Log to a file
|
- `file` - Log to a file
|
||||||
* `conn` - Log to a keep-alive TCP connection
|
- `conn` - Log to a keep-alive TCP connection
|
||||||
* `smtp` - Log via email
|
- `smtp` - Log via email
|
||||||
|
|
||||||
Certain configuration is common to all modes of log output:
|
Certain configuration is common to all modes of log output:
|
||||||
|
|
||||||
* `LEVEL` is the lowest level that this output will log. This value
|
- `LEVEL` is the lowest level that this output will log. This value
|
||||||
is inherited from `[log]` and in the case of the non-default loggers
|
is inherited from `[log]` and in the case of the non-default loggers
|
||||||
from `[log.sublogger]`.
|
from `[log.sublogger]`.
|
||||||
* `STACKTRACE_LEVEL` is the lowest level that this output will print
|
- `STACKTRACE_LEVEL` is the lowest level that this output will print
|
||||||
a stacktrace. This value is inherited.
|
a stacktrace. This value is inherited.
|
||||||
* `MODE` is the mode of the log output. It will default to the sublogger
|
- `MODE` is the mode of the log output. It will default to the sublogger
|
||||||
name. Thus `[log.console.macaron]` will default to `MODE = console`.
|
name. Thus `[log.console.macaron]` will default to `MODE = console`.
|
||||||
* `COLORIZE` will default to `true` for `console` as
|
- `COLORIZE` will default to `true` for `console` as
|
||||||
described, otherwise it will default to `false`.
|
described, otherwise it will default to `false`.
|
||||||
|
|
||||||
### Non-inherited default values
|
### Non-inherited default values
|
||||||
|
|
||||||
@@ -233,23 +235,23 @@ printed before each message. It is a comma-separated string set. The order of va
|
|||||||
|
|
||||||
Possible values are:
|
Possible values are:
|
||||||
|
|
||||||
* `none` or `,` - No flags.
|
- `none` or `,` - No flags.
|
||||||
* `date` - the date in the local time zone: `2009/01/23`.
|
- `date` - the date in the local time zone: `2009/01/23`.
|
||||||
* `time` - the time in the local time zone: `01:23:23`.
|
- `time` - the time in the local time zone: `01:23:23`.
|
||||||
* `microseconds` - microsecond resolution: `01:23:23.123123`. Assumes
|
- `microseconds` - microsecond resolution: `01:23:23.123123`. Assumes
|
||||||
time.
|
time.
|
||||||
* `longfile` - full file name and line number: `/a/b/c/d.go:23`.
|
- `longfile` - full file name and line number: `/a/b/c/d.go:23`.
|
||||||
* `shortfile` - final file name element and line number: `d.go:23`.
|
- `shortfile` - final file name element and line number: `d.go:23`.
|
||||||
* `funcname` - function name of the caller: `runtime.Caller()`.
|
- `funcname` - function name of the caller: `runtime.Caller()`.
|
||||||
* `shortfuncname` - last part of the function name. Overrides
|
- `shortfuncname` - last part of the function name. Overrides
|
||||||
`funcname`.
|
`funcname`.
|
||||||
* `utc` - if date or time is set, use UTC rather than the local time
|
- `utc` - if date or time is set, use UTC rather than the local time
|
||||||
zone.
|
zone.
|
||||||
* `levelinitial` - Initial character of the provided level in brackets eg. `[I]` for info.
|
- `levelinitial` - Initial character of the provided level in brackets eg. `[I]` for info.
|
||||||
* `level` - Provided level in brackets `[INFO]`
|
- `level` - Provided level in brackets `[INFO]`
|
||||||
* `medfile` - Last 20 characters of the filename - equivalent to
|
- `medfile` - Last 20 characters of the filename - equivalent to
|
||||||
`shortfile,longfile`.
|
`shortfile,longfile`.
|
||||||
* `stdflags` - Equivalent to `date,time,medfile,shortfuncname,levelinitial`
|
- `stdflags` - Equivalent to `date,time,medfile,shortfuncname,levelinitial`
|
||||||
|
|
||||||
### Console mode
|
### Console mode
|
||||||
|
|
||||||
@@ -267,30 +269,30 @@ to the provided `ROOT_PATH` in the master `[log]` section.
|
|||||||
|
|
||||||
Other values:
|
Other values:
|
||||||
|
|
||||||
* `LOG_ROTATE`: **true**: Rotate the log files.
|
- `LOG_ROTATE`: **true**: Rotate the log files.
|
||||||
* `MAX_SIZE_SHIFT`: **28**: Maximum size shift of a single file, 28 represents 256Mb.
|
- `MAX_SIZE_SHIFT`: **28**: Maximum size shift of a single file, 28 represents 256Mb.
|
||||||
* `DAILY_ROTATE`: **true**: Rotate logs daily.
|
- `DAILY_ROTATE`: **true**: Rotate logs daily.
|
||||||
* `MAX_DAYS`: **7**: Delete the log file after n days
|
- `MAX_DAYS`: **7**: Delete the log file after n days
|
||||||
* `COMPRESS`: **true**: Compress old log files by default with gzip
|
- `COMPRESS`: **true**: Compress old log files by default with gzip
|
||||||
* `COMPRESSION_LEVEL`: **-1**: Compression level
|
- `COMPRESSION_LEVEL`: **-1**: Compression level
|
||||||
|
|
||||||
### Conn mode
|
### Conn mode
|
||||||
|
|
||||||
* `RECONNECT_ON_MSG`: **false**: Reconnect host for every single message.
|
- `RECONNECT_ON_MSG`: **false**: Reconnect host for every single message.
|
||||||
* `RECONNECT`: **false**: Try to reconnect when connection is lost.
|
- `RECONNECT`: **false**: Try to reconnect when connection is lost.
|
||||||
* `PROTOCOL`: **tcp**: Set the protocol, either "tcp", "unix" or "udp".
|
- `PROTOCOL`: **tcp**: Set the protocol, either "tcp", "unix" or "udp".
|
||||||
* `ADDR`: **:7020**: Sets the address to connect to.
|
- `ADDR`: **:7020**: Sets the address to connect to.
|
||||||
|
|
||||||
### SMTP mode
|
### SMTP mode
|
||||||
|
|
||||||
It is not recommended to use this logger to send general logging
|
It is not recommended to use this logger to send general logging
|
||||||
messages. However, you could perhaps set this logger to work on `FATAL`.
|
messages. However, you could perhaps set this logger to work on `FATAL`.
|
||||||
|
|
||||||
* `USER`: User email address to send from.
|
- `USER`: User email address to send from.
|
||||||
* `PASSWD`: Password for the smtp server.
|
- `PASSWD`: Password for the smtp server.
|
||||||
* `HOST`: **127.0.0.1:25**: The SMTP host to connect to.
|
- `HOST`: **127.0.0.1:25**: The SMTP host to connect to.
|
||||||
* `RECEIVERS`: Email addresses to send to.
|
- `RECEIVERS`: Email addresses to send to.
|
||||||
* `SUBJECT`: **Diagnostic message from Gitea**
|
- `SUBJECT`: **Diagnostic message from Gitea**
|
||||||
|
|
||||||
## Debugging problems
|
## Debugging problems
|
||||||
|
|
||||||
@@ -386,7 +388,7 @@ Windows. Terminal sniffing will occur on Windows and if it is
|
|||||||
determined that we are running on a terminal capable of color we will
|
determined that we are running on a terminal capable of color we will
|
||||||
colorize.
|
colorize.
|
||||||
|
|
||||||
Further, on *nix it is becoming common to have file logs that are
|
Further, on \*nix it is becoming common to have file logs that are
|
||||||
colored by default. Therefore file logs will be colorised by default
|
colored by default. Therefore file logs will be colorised by default
|
||||||
when not running on Windows.
|
when not running on Windows.
|
||||||
|
|
||||||
@@ -404,14 +406,14 @@ string of bytes which should represent a color and second set of reset
|
|||||||
bytes. Pointers were chosen to prevent copying of large numbers of
|
bytes. Pointers were chosen to prevent copying of large numbers of
|
||||||
values. There are several helper methods:
|
values. There are several helper methods:
|
||||||
|
|
||||||
* `log.NewColoredValue` takes a value and 0 or more color attributes
|
- `log.NewColoredValue` takes a value and 0 or more color attributes
|
||||||
that represent the color. If 0 are provided it will default to a cached
|
that represent the color. If 0 are provided it will default to a cached
|
||||||
bold. Note, it is recommended that color bytes constructed from
|
bold. Note, it is recommended that color bytes constructed from
|
||||||
attributes should be cached if this is a commonly used log message.
|
attributes should be cached if this is a commonly used log message.
|
||||||
* `log.NewColoredValuePointer` takes a pointer to a value, and
|
- `log.NewColoredValuePointer` takes a pointer to a value, and
|
||||||
0 or more color attributes that represent the color.
|
0 or more color attributes that represent the color.
|
||||||
* `log.NewColoredValueBytes` takes a value and a pointer to an array
|
- `log.NewColoredValueBytes` takes a value and a pointer to an array
|
||||||
of bytes representing the color.
|
of bytes representing the color.
|
||||||
|
|
||||||
These functions will not double wrap a `log.ColoredValue`. They will
|
These functions will not double wrap a `log.ColoredValue`. They will
|
||||||
also set the `resetBytes` to the cached `resetBytes`.
|
also set the `resetBytes` to the cached `resetBytes`.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2019-10-23T17:00:00-03:00"
|
|||||||
title: "Mail templates"
|
title: "Mail templates"
|
||||||
slug: "mail-templates"
|
slug: "mail-templates"
|
||||||
weight: 45
|
weight: 45
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
@@ -15,20 +15,22 @@ menu:
|
|||||||
|
|
||||||
# Mail templates
|
# Mail templates
|
||||||
|
|
||||||
|
**Table of Contents**
|
||||||
|
|
||||||
|
{{< toc >}}
|
||||||
|
|
||||||
To craft the e-mail subject and contents for certain operations, Gitea can be customized by using templates. The templates
|
To craft the e-mail subject and contents for certain operations, Gitea can be customized by using templates. The templates
|
||||||
for these functions are located under the [`custom` directory](https://docs.gitea.io/en-us/customizing-gitea/).
|
for these functions are located under the [`custom` directory](https://docs.gitea.io/en-us/customizing-gitea/).
|
||||||
Gitea has an internal template that serves as default in case there's no custom alternative.
|
Gitea has an internal template that serves as default in case there's no custom alternative.
|
||||||
|
|
||||||
Custom templates are loaded when Gitea starts. Changes made to them are not recognized until Gitea is restarted again.
|
Custom templates are loaded when Gitea starts. Changes made to them are not recognized until Gitea is restarted again.
|
||||||
|
|
||||||
{{< toc >}}
|
|
||||||
|
|
||||||
## Mail notifications supporting templates
|
## Mail notifications supporting templates
|
||||||
|
|
||||||
Currently, the following notification events make use of templates:
|
Currently, the following notification events make use of templates:
|
||||||
|
|
||||||
| Action name | Usage |
|
| Action name | Usage |
|
||||||
|---------------|--------------------------------------------------------------------------------------------------------------|
|
| ----------- | ------------------------------------------------------------------------------------------------------------ |
|
||||||
| `new` | A new issue or pull request was created. |
|
| `new` | A new issue or pull request was created. |
|
||||||
| `comment` | A new comment was created in an existing issue or pull request. |
|
| `comment` | A new comment was created in an existing issue or pull request. |
|
||||||
| `close` | An issue or pull request was closed. |
|
| `close` | An issue or pull request was closed. |
|
||||||
@@ -42,14 +44,15 @@ Currently, the following notification events make use of templates:
|
|||||||
|
|
||||||
The path for the template of a particular message type is:
|
The path for the template of a particular message type is:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
custom/templates/mail/{action type}/{action name}.tmpl
|
custom/templates/mail/{action type}/{action name}.tmpl
|
||||||
```
|
```
|
||||||
|
|
||||||
Where `{action type}` is one of `issue` or `pull` (for pull requests), and `{action name}` is one of the names listed above.
|
Where `{action type}` is one of `issue` or `pull` (for pull requests), and `{action name}` is one of the names listed above.
|
||||||
|
|
||||||
For example, the specific template for a mail regarding a comment in a pull request is:
|
For example, the specific template for a mail regarding a comment in a pull request is:
|
||||||
```
|
|
||||||
|
```sh
|
||||||
custom/templates/mail/pull/comment.tmpl
|
custom/templates/mail/pull/comment.tmpl
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -57,10 +60,10 @@ However, creating templates for each and every action type/name combination is n
|
|||||||
A fallback system is used to choose the appropriate template for an event. The _first existing_
|
A fallback system is used to choose the appropriate template for an event. The _first existing_
|
||||||
template on this list is used:
|
template on this list is used:
|
||||||
|
|
||||||
* The specific template for the desired **action type** and **action name**.
|
- The specific template for the desired **action type** and **action name**.
|
||||||
* The template for action type `issue` and the desired **action name**.
|
- The template for action type `issue` and the desired **action name**.
|
||||||
* The template for the desired **action type**, action name `default`.
|
- The template for the desired **action type**, action name `default`.
|
||||||
* The template for action type `issue`, action name `default`.
|
- The template for action type `issue`, action name `default`.
|
||||||
|
|
||||||
The only mandatory template is action type `issue`, action name `default`, which is already embedded in Gitea
|
The only mandatory template is action type `issue`, action name `default`, which is already embedded in Gitea
|
||||||
unless it's overridden by the user in the `custom` directory.
|
unless it's overridden by the user in the `custom` directory.
|
||||||
@@ -84,17 +87,16 @@ Text and macros for the mail body
|
|||||||
Specifying a _subject_ section is optional (and therefore also the dash line separator). When used, the separator between
|
Specifying a _subject_ section is optional (and therefore also the dash line separator). When used, the separator between
|
||||||
_subject_ and _mail body_ templates requires at least three dashes; no other characters are allowed in the separator line.
|
_subject_ and _mail body_ templates requires at least three dashes; no other characters are allowed in the separator line.
|
||||||
|
|
||||||
|
|
||||||
_Subject_ and _mail body_ are parsed by [Golang's template engine](https://golang.org/pkg/text/template/) and
|
_Subject_ and _mail body_ are parsed by [Golang's template engine](https://golang.org/pkg/text/template/) and
|
||||||
are provided with a _metadata context_ assembled for each notification. The context contains the following elements:
|
are provided with a _metadata context_ assembled for each notification. The context contains the following elements:
|
||||||
|
|
||||||
| Name | Type | Available | Usage |
|
| Name | Type | Available | Usage |
|
||||||
|--------------------|------------------|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------|
|
| ------------------ | ---------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `.FallbackSubject` | string | Always | A default subject line. See Below. |
|
| `.FallbackSubject` | string | Always | A default subject line. See Below. |
|
||||||
| `.Subject` | string | Only in body | The _subject_, once resolved. |
|
| `.Subject` | string | Only in body | The _subject_, once resolved. |
|
||||||
| `.Body` | string | Always | The message of the issue, pull request or comment, parsed from Markdown into HTML and sanitized. Do not confuse with the _mail body_. |
|
| `.Body` | string | Always | The message of the issue, pull request or comment, parsed from Markdown into HTML and sanitized. Do not confuse with the _mail body_. |
|
||||||
| `.Link` | string | Always | The address of the originating issue, pull request or comment. |
|
| `.Link` | string | Always | The address of the originating issue, pull request or comment. |
|
||||||
| `.Issue` | models.Issue | Always | The issue (or pull request) originating the notification. To get data specific to a pull request (e.g. `HasMerged`), `.Issue.PullRequest` can be used, but care should be taken as this field will be `nil` if the issue is *not* a pull request. |
|
| `.Issue` | models.Issue | Always | The issue (or pull request) originating the notification. To get data specific to a pull request (e.g. `HasMerged`), `.Issue.PullRequest` can be used, but care should be taken as this field will be `nil` if the issue is _not_ a pull request. |
|
||||||
| `.Comment` | models.Comment | If applicable | If the notification is from a comment added to an issue or pull request, this will contain the information about the comment. |
|
| `.Comment` | models.Comment | If applicable | If the notification is from a comment added to an issue or pull request, this will contain the information about the comment. |
|
||||||
| `.IsPull` | bool | Always | `true` if the mail notification is associated with a pull request (i.e. `.Issue.PullRequest` is not `nil`). |
|
| `.IsPull` | bool | Always | `true` if the mail notification is associated with a pull request (i.e. `.Issue.PullRequest` is not `nil`). |
|
||||||
| `.Repo` | string | Always | Name of the repository, including owner name (e.g. `mike/stuff`) |
|
| `.Repo` | string | Always | Name of the repository, including owner name (e.g. `mike/stuff`) |
|
||||||
@@ -115,19 +117,19 @@ Please refer to the linked documentation for details about its syntax.
|
|||||||
|
|
||||||
The _subject_ is built using the following steps:
|
The _subject_ is built using the following steps:
|
||||||
|
|
||||||
* A template is selected according to the type of notification and to what templates are present.
|
- A template is selected according to the type of notification and to what templates are present.
|
||||||
* The template is parsed and resolved (e.g. `{{.Issue.Index}}` is converted to the number of the issue
|
- The template is parsed and resolved (e.g. `{{.Issue.Index}}` is converted to the number of the issue
|
||||||
or pull request).
|
or pull request).
|
||||||
* All space-like characters (e.g. `TAB`, `LF`, etc.) are converted to normal spaces.
|
- All space-like characters (e.g. `TAB`, `LF`, etc.) are converted to normal spaces.
|
||||||
* All leading, trailing and redundant spaces are removed.
|
- All leading, trailing and redundant spaces are removed.
|
||||||
* The string is truncated to its first 256 runes (characters).
|
- The string is truncated to its first 256 runes (characters).
|
||||||
|
|
||||||
If the end result is an empty string, **or** no subject template was available (i.e. the selected template
|
If the end result is an empty string, **or** no subject template was available (i.e. the selected template
|
||||||
did not include a subject part), Gitea's **internal default** will be used.
|
did not include a subject part), Gitea's **internal default** will be used.
|
||||||
|
|
||||||
The internal default (fallback) subject is the equivalent of:
|
The internal default (fallback) subject is the equivalent of:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
{{.SubjectPrefix}}[{{.Repo}}] {{.Issue.Title}} (#.Issue.Index)
|
{{.SubjectPrefix}}[{{.Repo}}] {{.Issue.Title}} (#.Issue.Index)
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -171,7 +173,7 @@ Please check [Gitea's logs](https://docs.gitea.io/en-us/logging-configuration/)
|
|||||||
|
|
||||||
`custom/templates/mail/issue/default.tmpl`:
|
`custom/templates/mail/issue/default.tmpl`:
|
||||||
|
|
||||||
```
|
```html
|
||||||
[{{.Repo}}] @{{.Doer.Name}}
|
[{{.Repo}}] @{{.Doer.Name}}
|
||||||
{{if eq .ActionName "new"}}
|
{{if eq .ActionName "new"}}
|
||||||
created
|
created
|
||||||
@@ -247,10 +249,10 @@ This template produces something along these lines:
|
|||||||
>
|
>
|
||||||
> #### Message content:
|
> #### Message content:
|
||||||
>
|
>
|
||||||
> \__________________________________________________________________
|
> \_********************************\_********************************
|
||||||
>
|
>
|
||||||
> Mike, I think we should tone down the blues a little.
|
> Mike, I think we should tone down the blues a little.
|
||||||
> \__________________________________________________________________
|
> \_********************************\_********************************
|
||||||
>
|
>
|
||||||
> [View it on Gitea](#).
|
> [View it on Gitea](#).
|
||||||
|
|
||||||
@@ -260,7 +262,7 @@ The template system contains several functions that can be used to further proce
|
|||||||
the messages. Here's a list of some of them:
|
the messages. Here's a list of some of them:
|
||||||
|
|
||||||
| Name | Parameters | Available | Usage |
|
| Name | Parameters | Available | Usage |
|
||||||
|----------------------|-------------|-----------|------------------------------------------------------------------------------|
|
| ---------------- | ----------- | --------- | --------------------------------------------------------------------------- |
|
||||||
| `AppUrl` | - | Any | Gitea's URL |
|
| `AppUrl` | - | Any | Gitea's URL |
|
||||||
| `AppName` | - | Any | Set from `app.ini`, usually "Gitea" |
|
| `AppName` | - | Any | Set from `app.ini`, usually "Gitea" |
|
||||||
| `AppDomain` | - | Any | Gitea's host name |
|
| `AppDomain` | - | Any | Gitea's host name |
|
||||||
@@ -270,7 +272,7 @@ the messages. Here's a list of some of them:
|
|||||||
|
|
||||||
These are _functions_, not metadata, so they have to be used:
|
These are _functions_, not metadata, so they have to be used:
|
||||||
|
|
||||||
```
|
```html
|
||||||
Like this: {{Str2html "Escape<my>text"}}
|
Like this: {{Str2html "Escape<my>text"}}
|
||||||
Or this: {{"Escape<my>text" | Str2html}}
|
Or this: {{"Escape<my>text" | Str2html}}
|
||||||
Or this: {{AppUrl}}
|
Or this: {{AppUrl}}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2017-08-23T09:00:00+02:00"
|
|||||||
title: "Make"
|
title: "Make"
|
||||||
slug: "make"
|
slug: "make"
|
||||||
weight: 10
|
weight: 10
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2017-01-14T11:00:00-02:00"
|
|||||||
title: "Make 安装"
|
title: "Make 安装"
|
||||||
slug: "make"
|
slug: "make"
|
||||||
weight: 10
|
weight: 10
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2019-09-06T01:35:00-03:00"
|
|||||||
title: "Repository indexer"
|
title: "Repository indexer"
|
||||||
slug: "repo-indexer"
|
slug: "repo-indexer"
|
||||||
weight: 45
|
weight: 45
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
@@ -15,11 +15,15 @@ menu:
|
|||||||
|
|
||||||
# Repository indexer
|
# Repository indexer
|
||||||
|
|
||||||
|
**Table of Contents**
|
||||||
|
|
||||||
|
{{< toc >}}
|
||||||
|
|
||||||
## Setting up the repository indexer
|
## Setting up the repository indexer
|
||||||
|
|
||||||
Gitea can search through the files of the repositories by enabling this function in your [`app.ini`](https://docs.gitea.io/en-us/config-cheat-sheet/):
|
Gitea can search through the files of the repositories by enabling this function in your [`app.ini`](https://docs.gitea.io/en-us/config-cheat-sheet/):
|
||||||
|
|
||||||
```
|
```ini
|
||||||
[indexer]
|
[indexer]
|
||||||
; ...
|
; ...
|
||||||
REPO_INDEXER_ENABLED = true
|
REPO_INDEXER_ENABLED = true
|
||||||
@@ -49,10 +53,10 @@ Limiting the list of files prevents the indexes from becoming polluted with deri
|
|||||||
|
|
||||||
Pattern matching works as follows:
|
Pattern matching works as follows:
|
||||||
|
|
||||||
* To match all files with a `.txt` extension no matter what directory, use `**.txt`.
|
- To match all files with a `.txt` extension no matter what directory, use `**.txt`.
|
||||||
* To match all files with a `.txt` extension _only at the root level of the repository_, use `*.txt`.
|
- To match all files with a `.txt` extension _only at the root level of the repository_, use `*.txt`.
|
||||||
* To match all files inside `resources/bin` and below, use `resources/bin/**`.
|
- To match all files inside `resources/bin` and below, use `resources/bin/**`.
|
||||||
* To match all files _immediately inside_ `resources/bin`, use `resources/bin/*`.
|
- To match all files _immediately inside_ `resources/bin`, use `resources/bin/*`.
|
||||||
* To match all files named `Makefile`, use `**Makefile`.
|
- To match all files named `Makefile`, use `**Makefile`.
|
||||||
* Matching a directory has no effect; the pattern `resources/bin` will not include/exclude files inside that directory; `resources/bin/**` will.
|
- Matching a directory has no effect; the pattern `resources/bin` will not include/exclude files inside that directory; `resources/bin/**` will.
|
||||||
* All files and patterns are normalized to lower case, so `**Makefile`, `**makefile` and `**MAKEFILE` are equivalent.
|
- All files and patterns are normalized to lower case, so `**Makefile`, `**makefile` and `**MAKEFILE` are equivalent.
|
||||||
@@ -3,7 +3,7 @@ date: "2019-12-31T13:55:00+05:00"
|
|||||||
title: "Advanced: Search Engines Indexation"
|
title: "Advanced: Search Engines Indexation"
|
||||||
slug: "search-engines-indexation"
|
slug: "search-engines-indexation"
|
||||||
weight: 30
|
weight: 30
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -15,6 +15,10 @@ menu:
|
|||||||
|
|
||||||
# GPG Commit Signatures
|
# GPG Commit Signatures
|
||||||
|
|
||||||
|
**Table of Contents**
|
||||||
|
|
||||||
|
{{< toc >}}
|
||||||
|
|
||||||
Gitea will verify GPG commit signatures in the provided tree by
|
Gitea will verify GPG commit signatures in the provided tree by
|
||||||
checking if the commits are signed by a key within the gitea database,
|
checking if the commits are signed by a key within the gitea database,
|
||||||
or if the commit matches the default key for git.
|
or if the commit matches the default key for git.
|
||||||
@@ -36,10 +40,10 @@ this requires git >= 2.0.0.
|
|||||||
|
|
||||||
There are a number of places where Gitea will generate commits itself:
|
There are a number of places where Gitea will generate commits itself:
|
||||||
|
|
||||||
* Repository Initialisation
|
- Repository Initialisation
|
||||||
* Wiki Changes
|
- Wiki Changes
|
||||||
* CRUD actions using the editor or the API
|
- CRUD actions using the editor or the API
|
||||||
* Merges from Pull Requests
|
- Merges from Pull Requests
|
||||||
|
|
||||||
Depending on configuration and server trust you may want Gitea to
|
Depending on configuration and server trust you may want Gitea to
|
||||||
sign these commits.
|
sign these commits.
|
||||||
@@ -78,12 +82,12 @@ MERGES = pubkey, twofa, basesigned, commitssigned
|
|||||||
The first option to discuss is the `SIGNING_KEY`. There are three main
|
The first option to discuss is the `SIGNING_KEY`. There are three main
|
||||||
options:
|
options:
|
||||||
|
|
||||||
* `none` - this prevents Gitea from signing any commits
|
- `none` - this prevents Gitea from signing any commits
|
||||||
* `default` - Gitea will default to the key configured within
|
- `default` - Gitea will default to the key configured within
|
||||||
`git config`
|
`git config`
|
||||||
* `KEYID` - Gitea will sign commits with the gpg key with the ID
|
- `KEYID` - Gitea will sign commits with the gpg key with the ID
|
||||||
`KEYID`. In this case you should provide a `SIGNING_NAME` and
|
`KEYID`. In this case you should provide a `SIGNING_NAME` and
|
||||||
`SIGNING_EMAIL` to be displayed for this key.
|
`SIGNING_EMAIL` to be displayed for this key.
|
||||||
|
|
||||||
The `default` option will interrogate `git config` for
|
The `default` option will interrogate `git config` for
|
||||||
`commit.gpgsign` option - if this is set, then it will use the results
|
`commit.gpgsign` option - if this is set, then it will use the results
|
||||||
@@ -99,10 +103,10 @@ ideal UI and therefore subject to change.
|
|||||||
This option determines whether Gitea should sign the initial commit
|
This option determines whether Gitea should sign the initial commit
|
||||||
when creating a repository. The possible values are:
|
when creating a repository. The possible values are:
|
||||||
|
|
||||||
* `never`: Never sign
|
- `never`: Never sign
|
||||||
* `pubkey`: Only sign if the user has a public key
|
- `pubkey`: Only sign if the user has a public key
|
||||||
* `twofa`: Only sign if the user logs in with two factor authentication
|
- `twofa`: Only sign if the user logs in with two factor authentication
|
||||||
* `always`: Always sign
|
- `always`: Always sign
|
||||||
|
|
||||||
Options other than `never` and `always` can be combined as a comma
|
Options other than `never` and `always` can be combined as a comma
|
||||||
separated list.
|
separated list.
|
||||||
@@ -112,11 +116,11 @@ separated list.
|
|||||||
This options determines if Gitea should sign commits to the Wiki.
|
This options determines if Gitea should sign commits to the Wiki.
|
||||||
The possible values are:
|
The possible values are:
|
||||||
|
|
||||||
* `never`: Never sign
|
- `never`: Never sign
|
||||||
* `pubkey`: Only sign if the user has a public key
|
- `pubkey`: Only sign if the user has a public key
|
||||||
* `twofa`: Only sign if the user logs in with two factor authentication
|
- `twofa`: Only sign if the user logs in with two factor authentication
|
||||||
* `parentsigned`: Only sign if the parent commit is signed.
|
- `parentsigned`: Only sign if the parent commit is signed.
|
||||||
* `always`: Always sign
|
- `always`: Always sign
|
||||||
|
|
||||||
Options other than `never` and `always` can be combined as a comma
|
Options other than `never` and `always` can be combined as a comma
|
||||||
separated list.
|
separated list.
|
||||||
@@ -126,11 +130,11 @@ separated list.
|
|||||||
This option determines if Gitea should sign commits from the web
|
This option determines if Gitea should sign commits from the web
|
||||||
editor or API CRUD actions. The possible values are:
|
editor or API CRUD actions. The possible values are:
|
||||||
|
|
||||||
* `never`: Never sign
|
- `never`: Never sign
|
||||||
* `pubkey`: Only sign if the user has a public key
|
- `pubkey`: Only sign if the user has a public key
|
||||||
* `twofa`: Only sign if the user logs in with two factor authentication
|
- `twofa`: Only sign if the user logs in with two factor authentication
|
||||||
* `parentsigned`: Only sign if the parent commit is signed.
|
- `parentsigned`: Only sign if the parent commit is signed.
|
||||||
* `always`: Always sign
|
- `always`: Always sign
|
||||||
|
|
||||||
Options other than `never` and `always` can be combined as a comma
|
Options other than `never` and `always` can be combined as a comma
|
||||||
separated list.
|
separated list.
|
||||||
@@ -140,14 +144,14 @@ separated list.
|
|||||||
This option determines if Gitea should sign merge commits from PRs.
|
This option determines if Gitea should sign merge commits from PRs.
|
||||||
The possible options are:
|
The possible options are:
|
||||||
|
|
||||||
* `never`: Never sign
|
- `never`: Never sign
|
||||||
* `pubkey`: Only sign if the user has a public key
|
- `pubkey`: Only sign if the user has a public key
|
||||||
* `twofa`: Only sign if the user logs in with two factor authentication
|
- `twofa`: Only sign if the user logs in with two factor authentication
|
||||||
* `basesigned`: Only sign if the parent commit in the base repo is signed.
|
- `basesigned`: Only sign if the parent commit in the base repo is signed.
|
||||||
* `headsigned`: Only sign if the head commit in the head branch is signed.
|
- `headsigned`: Only sign if the head commit in the head branch is signed.
|
||||||
* `commitssigned`: Only sign if all the commits in the head branch to the merge point are signed.
|
- `commitssigned`: Only sign if all the commits in the head branch to the merge point are signed.
|
||||||
* `approved`: Only sign approved merges to a protected branch.
|
- `approved`: Only sign approved merges to a protected branch.
|
||||||
* `always`: Always sign
|
- `always`: Always sign
|
||||||
|
|
||||||
Options other than `never` and `always` can be combined as a comma
|
Options other than `never` and `always` can be combined as a comma
|
||||||
separated list.
|
separated list.
|
||||||
@@ -156,12 +160,12 @@ separated list.
|
|||||||
|
|
||||||
The public key used to sign Gitea's commits can be obtained from the API at:
|
The public key used to sign Gitea's commits can be obtained from the API at:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
/api/v1/signing-key.gpg
|
/api/v1/signing-key.gpg
|
||||||
```
|
```
|
||||||
|
|
||||||
In cases where there is a repository specific key this can be obtained from:
|
In cases where there is a repository specific key this can be obtained from:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
/api/v1/repos/:username/:reponame/signing-key.gpg
|
/api/v1/repos/:username/:reponame/signing-key.gpg
|
||||||
```
|
```
|
||||||
@@ -3,7 +3,7 @@ date: "2019-03-11T21:45:00+00:00"
|
|||||||
title: "高级: 第三方工具"
|
title: "高级: 第三方工具"
|
||||||
slug: "third-party-tools"
|
slug: "third-party-tools"
|
||||||
weight: 50
|
weight: 50
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2018-06-24:00:00+02:00"
|
|||||||
title: "API Usage"
|
title: "API Usage"
|
||||||
slug: "api-usage"
|
slug: "api-usage"
|
||||||
weight: 40
|
weight: 40
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
@@ -15,6 +15,8 @@ menu:
|
|||||||
|
|
||||||
# API Usage
|
# API Usage
|
||||||
|
|
||||||
|
**Table of Contents**
|
||||||
|
|
||||||
{{< toc >}}
|
{{< toc >}}
|
||||||
|
|
||||||
## Enabling/configuring API access
|
## Enabling/configuring API access
|
||||||
@@ -54,13 +56,13 @@ Access tokens obtained from Gitea's [OAuth2 provider](https://docs.gitea.io/en-u
|
|||||||
For historical reasons, Gitea needs the word `token` included before
|
For historical reasons, Gitea needs the word `token` included before
|
||||||
the API key token in an authorization header, like this:
|
the API key token in an authorization header, like this:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
Authorization: token 65eaa9c8ef52460d22a93307fe0aee76289dc675
|
Authorization: token 65eaa9c8ef52460d22a93307fe0aee76289dc675
|
||||||
```
|
```
|
||||||
|
|
||||||
In a `curl` command, for instance, this would look like:
|
In a `curl` command, for instance, this would look like:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
curl -X POST "http://localhost:4000/api/v1/repos/test1/test1/issues" \
|
curl -X POST "http://localhost:4000/api/v1/repos/test1/test1/issues" \
|
||||||
-H "accept: application/json" \
|
-H "accept: application/json" \
|
||||||
-H "Authorization: token 65eaa9c8ef52460d22a93307fe0aee76289dc675" \
|
-H "Authorization: token 65eaa9c8ef52460d22a93307fe0aee76289dc675" \
|
||||||
@@ -73,10 +75,9 @@ the `token=` string in a GET request.
|
|||||||
## API Guide:
|
## API Guide:
|
||||||
|
|
||||||
API Reference guide is auto-generated by swagger and available on:
|
API Reference guide is auto-generated by swagger and available on:
|
||||||
`https://gitea.your.host/api/swagger`
|
`https://gitea.your.host/api/swagger`
|
||||||
or on
|
or on
|
||||||
[gitea demo instance](https://try.gitea.io/api/swagger)
|
[gitea demo instance](https://try.gitea.io/api/swagger)
|
||||||
|
|
||||||
|
|
||||||
## Listing your issued tokens via the API
|
## Listing your issued tokens via the API
|
||||||
|
|
||||||
@@ -87,14 +88,14 @@ using BasicAuth, as follows:
|
|||||||
|
|
||||||
### Using basic authentication:
|
### Using basic authentication:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
$ curl --request GET --url https://yourusername:[email protected]/api/v1/users/yourusername/tokens
|
$ curl --request GET --url https://yourusername:[email protected]/api/v1/users/yourusername/tokens
|
||||||
[{"name":"test","sha1":"..."},{"name":"dev","sha1":"..."}]
|
[{"name":"test","sha1":"..."},{"name":"dev","sha1":"..."}]
|
||||||
```
|
```
|
||||||
|
|
||||||
As of v1.8.0 of Gitea, if using basic authentication with the API and your user has two factor authentication enabled, you'll need to send an additional header that contains the one time password (6 digit rotating token). An example of the header is `X-Gitea-OTP: 123456` where `123456` is where you'd place the code from your authenticator. Here is how the request would look like in curl:
|
As of v1.8.0 of Gitea, if using basic authentication with the API and your user has two factor authentication enabled, you'll need to send an additional header that contains the one time password (6 digit rotating token). An example of the header is `X-Gitea-OTP: 123456` where `123456` is where you'd place the code from your authenticator. Here is how the request would look like in curl:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
$ curl -H "X-Gitea-OTP: 123456" --request GET --url https://yourusername:[email protected]/api/v1/users/yourusername/tokens
|
$ curl -H "X-Gitea-OTP: 123456" --request GET --url https://yourusername:[email protected]/api/v1/users/yourusername/tokens
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -104,5 +105,5 @@ The API allows admin users to sudo API requests as another user. Simply add eith
|
|||||||
|
|
||||||
## SDKs
|
## SDKs
|
||||||
|
|
||||||
* [Official go-sdk](https://gitea.com/gitea/go-sdk)
|
- [Official go-sdk](https://gitea.com/gitea/go-sdk)
|
||||||
* [more](https://gitea.com/gitea/awesome-gitea#user-content-sdk)
|
- [more](https://gitea.com/gitea/awesome-gitea#user-content-sdk)
|
||||||
@@ -3,7 +3,7 @@ date: "2018-06-24:00:00+02:00"
|
|||||||
title: "API 使用指南"
|
title: "API 使用指南"
|
||||||
slug: "api-usage"
|
slug: "api-usage"
|
||||||
weight: 40
|
weight: 40
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ menu:
|
|||||||
|
|
||||||
# Hacking on Gitea
|
# Hacking on Gitea
|
||||||
|
|
||||||
|
**Table of Contents**
|
||||||
|
|
||||||
{{< toc >}}
|
{{< toc >}}
|
||||||
|
|
||||||
## Installing go
|
## Installing go
|
||||||
@@ -127,9 +129,9 @@ See `make help` for all available `make` targets. Also see [`.drone.yml`](https:
|
|||||||
|
|
||||||
To run and continously rebuild when source files change:
|
To run and continously rebuild when source files change:
|
||||||
|
|
||||||
````bash
|
```bash
|
||||||
make watch
|
make watch
|
||||||
````
|
```
|
||||||
|
|
||||||
On macOS, watching all backend source files may hit the default open files limit which can be increased via `ulimit -n 12288` for the current shell or in your shell startup file for all future shells.
|
On macOS, watching all backend source files may hit the default open files limit which can be increased via `ulimit -n 12288` for the current shell or in your shell startup file for all future shells.
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2019-04-15T17:29:00+08:00"
|
|||||||
title: "Integrations"
|
title: "Integrations"
|
||||||
slug: "integrations"
|
slug: "integrations"
|
||||||
weight: 40
|
weight: 40
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2019-04-15T17:29:00+08:00"
|
|||||||
title: "Migrations Interfaces"
|
title: "Migrations Interfaces"
|
||||||
slug: "migrations-interfaces"
|
slug: "migrations-interfaces"
|
||||||
weight: 30
|
weight: 30
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2019-04-19:44:00+01:00"
|
|||||||
title: "OAuth2 provider"
|
title: "OAuth2 provider"
|
||||||
slug: "oauth2-provider"
|
slug: "oauth2-provider"
|
||||||
weight: 41
|
weight: 41
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
@@ -13,25 +13,25 @@ menu:
|
|||||||
identifier: "oauth2-provider"
|
identifier: "oauth2-provider"
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
# OAuth2 provider
|
# OAuth2 provider
|
||||||
|
|
||||||
|
**Table of Contents**
|
||||||
|
|
||||||
|
{{< toc >}}
|
||||||
|
|
||||||
Gitea supports acting as an OAuth2 provider to allow third party applications to access its resources with the user's consent. This feature is available since release 1.8.0.
|
Gitea supports acting as an OAuth2 provider to allow third party applications to access its resources with the user's consent. This feature is available since release 1.8.0.
|
||||||
|
|
||||||
## Endpoints
|
## Endpoints
|
||||||
|
|
||||||
|
| Endpoint | URL |
|
||||||
Endpoint | URL
|
| ---------------------- | --------------------------- |
|
||||||
-----------------------|----------------------------
|
| Authorization Endpoint | `/login/oauth/authorize` |
|
||||||
Authorization Endpoint | `/login/oauth/authorize`
|
| Access Token Endpoint | `/login/oauth/access_token` |
|
||||||
Access Token Endpoint | `/login/oauth/access_token`
|
|
||||||
|
|
||||||
|
|
||||||
## Supported OAuth2 Grants
|
## Supported OAuth2 Grants
|
||||||
|
|
||||||
At the moment Gitea only supports the [**Authorization Code Grant**](https://tools.ietf.org/html/rfc6749#section-1.3.1) standard with additional support of the [Proof Key for Code Exchange (PKCE)](https://tools.ietf.org/html/rfc7636) extension.
|
At the moment Gitea only supports the [**Authorization Code Grant**](https://tools.ietf.org/html/rfc6749#section-1.3.1) standard with additional support of the [Proof Key for Code Exchange (PKCE)](https://tools.ietf.org/html/rfc7636) extension.
|
||||||
|
|
||||||
|
|
||||||
To use the Authorization Code Grant as a third party application it is required to register a new application via the "Settings" (`/user/settings/applications`) section of the settings.
|
To use the Authorization Code Grant as a third party application it is required to register a new application via the "Settings" (`/user/settings/applications`) section of the settings.
|
||||||
|
|
||||||
## Scopes
|
## Scopes
|
||||||
@@ -44,49 +44,49 @@ Currently Gitea does not support scopes (see [#4300](https://github.com/go-gitea
|
|||||||
|
|
||||||
1. Redirect to user to the authorization endpoint in order to get his/her consent for accessing the resources:
|
1. Redirect to user to the authorization endpoint in order to get his/her consent for accessing the resources:
|
||||||
|
|
||||||
```curl
|
```curl
|
||||||
https://[YOUR-GITEA-URL]/login/oauth/authorize?client_id=CLIENT_ID&redirect_uri=REDIRECT_URI& response_type=code&state=STATE
|
https://[YOUR-GITEA-URL]/login/oauth/authorize?client_id=CLIENT_ID&redirect_uri=REDIRECT_URI& response_type=code&state=STATE
|
||||||
```
|
```
|
||||||
|
|
||||||
The `CLIENT_ID` can be obtained by registering an application in the settings. The `STATE` is a random string that will be send back to your application after the user authorizes. The `state` parameter is optional but should be used to prevent CSRF attacks.
|
The `CLIENT_ID` can be obtained by registering an application in the settings. The `STATE` is a random string that will be send back to your application after the user authorizes. The `state` parameter is optional but should be used to prevent CSRF attacks.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||

|
The user will now be asked to authorize your application. If they authorize it, the user will be redirected to the `REDIRECT_URL`, for example:
|
||||||
|
|
||||||
The user will now be asked to authorize your application. If they authorize it, the user will be redirected to the `REDIRECT_URL`, for example:
|
```curl
|
||||||
|
https://[REDIRECT_URI]?code=RETURNED_CODE&state=STATE
|
||||||
```curl
|
```
|
||||||
https://[REDIRECT_URI]?code=RETURNED_CODE&state=STATE
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Using the provided `code` from the redirect, you can request a new application and refresh token. The access token endpoints accepts POST requests with `application/json` and `application/x-www-form-urlencoded` body, for example:
|
2. Using the provided `code` from the redirect, you can request a new application and refresh token. The access token endpoints accepts POST requests with `application/json` and `application/x-www-form-urlencoded` body, for example:
|
||||||
|
|
||||||
```curl
|
```curl
|
||||||
POST https://[YOUR-GITEA-URL]/login/oauth/access_token
|
POST https://[YOUR-GITEA-URL]/login/oauth/access_token
|
||||||
```
|
```
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"client_id": "YOUR_CLIENT_ID",
|
"client_id": "YOUR_CLIENT_ID",
|
||||||
"client_secret": "YOUR_CLIENT_SECRET",
|
"client_secret": "YOUR_CLIENT_SECRET",
|
||||||
"code": "RETURNED_CODE",
|
"code": "RETURNED_CODE",
|
||||||
"grant_type": "authorization_code",
|
"grant_type": "authorization_code",
|
||||||
"redirect_uri": "REDIRECT_URI"
|
"redirect_uri": "REDIRECT_URI"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
```json
|
|
||||||
{
|
|
||||||
"access_token":"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJnbnQiOjIsInR0IjowLCJleHAiOjE1NTUxNzk5MTIsImlhdCI6MTU1NTE3NjMxMn0.0-iFsAwBtxuckA0sNZ6QpBQmywVPz129u75vOM7wPJecw5wqGyBkmstfJHAjEOqrAf_V5Z-1QYeCh_Cz4RiKug",
|
|
||||||
"token_type":"bearer",
|
|
||||||
"expires_in":3600,
|
|
||||||
"refresh_token":"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJnbnQiOjIsInR0IjoxLCJjbnQiOjEsImV4cCI6MTU1NzgwNDMxMiwiaWF0IjoxNTU1MTc2MzEyfQ.S_HZQBy4q9r5SEzNGNIoFClT43HPNDbUdHH-GYNYYdkRfft6XptJBkUQscZsGxOW975Yk6RbgtGvq1nkEcklOw"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
The `CLIENT_SECRET` is the unique secret code generated for this application. Please note that the secret will only be visible after you created/registered the application with Gitea and cannot be recovered. If you lose the secret you must regenerate the secret via the application's settings.
|
```json
|
||||||
|
{
|
||||||
|
"access_token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJnbnQiOjIsInR0IjowLCJleHAiOjE1NTUxNzk5MTIsImlhdCI6MTU1NTE3NjMxMn0.0-iFsAwBtxuckA0sNZ6QpBQmywVPz129u75vOM7wPJecw5wqGyBkmstfJHAjEOqrAf_V5Z-1QYeCh_Cz4RiKug",
|
||||||
|
"token_type": "bearer",
|
||||||
|
"expires_in": 3600,
|
||||||
|
"refresh_token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJnbnQiOjIsInR0IjoxLCJjbnQiOjEsImV4cCI6MTU1NzgwNDMxMiwiaWF0IjoxNTU1MTc2MzEyfQ.S_HZQBy4q9r5SEzNGNIoFClT43HPNDbUdHH-GYNYYdkRfft6XptJBkUQscZsGxOW975Yk6RbgtGvq1nkEcklOw"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
The `REDIRECT_URI` in the `access_token` request must match the `REDIRECT_URI` in the `authorize` request.
|
The `CLIENT_SECRET` is the unique secret code generated for this application. Please note that the secret will only be visible after you created/registered the application with Gitea and cannot be recovered. If you lose the secret you must regenerate the secret via the application's settings.
|
||||||
|
|
||||||
|
The `REDIRECT_URI` in the `access_token` request must match the `REDIRECT_URI` in the `authorize` request.
|
||||||
|
|
||||||
3. Use the `access_token` to make [API requests](https://docs.gitea.io/en-us/api-usage#oauth2) to access the user's resources.
|
3. Use the `access_token` to make [API requests](https://docs.gitea.io/en-us/api-usage#oauth2) to access the user's resources.
|
||||||
@@ -3,7 +3,7 @@ date: "2016-12-01T16:00:00+02:00"
|
|||||||
title: "Authentication"
|
title: "Authentication"
|
||||||
slug: "authentication"
|
slug: "authentication"
|
||||||
weight: 10
|
weight: 10
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
@@ -22,20 +22,25 @@ menu:
|
|||||||
Both the LDAP via BindDN and the simple auth LDAP share the following fields:
|
Both the LDAP via BindDN and the simple auth LDAP share the following fields:
|
||||||
|
|
||||||
- Authorization Name **(required)**
|
- Authorization Name **(required)**
|
||||||
|
|
||||||
- A name to assign to the new method of authorization.
|
- A name to assign to the new method of authorization.
|
||||||
|
|
||||||
- Host **(required)**
|
- Host **(required)**
|
||||||
|
|
||||||
- The address where the LDAP server can be reached.
|
- The address where the LDAP server can be reached.
|
||||||
- Example: `mydomain.com`
|
- Example: `mydomain.com`
|
||||||
|
|
||||||
- Port **(required)**
|
- Port **(required)**
|
||||||
|
|
||||||
- The port to use when connecting to the server.
|
- The port to use when connecting to the server.
|
||||||
- Example: `389` for LDAP or `636` for LDAP SSL
|
- Example: `389` for LDAP or `636` for LDAP SSL
|
||||||
|
|
||||||
- Enable TLS Encryption (optional)
|
- Enable TLS Encryption (optional)
|
||||||
|
|
||||||
- Whether to use TLS when connecting to the LDAP server.
|
- Whether to use TLS when connecting to the LDAP server.
|
||||||
|
|
||||||
- Admin Filter (optional)
|
- Admin Filter (optional)
|
||||||
|
|
||||||
- An LDAP filter specifying if a user should be given administrator
|
- An LDAP filter specifying if a user should be given administrator
|
||||||
privileges. If a user account passes the filter, the user will be
|
privileges. If a user account passes the filter, the user will be
|
||||||
privileged as an administrator.
|
privileged as an administrator.
|
||||||
@@ -43,6 +48,7 @@ Both the LDAP via BindDN and the simple auth LDAP share the following fields:
|
|||||||
- Example for Microsoft Active Directory (AD): `(memberOf=CN=admin-group,OU=example,DC=example,DC=org)`
|
- Example for Microsoft Active Directory (AD): `(memberOf=CN=admin-group,OU=example,DC=example,DC=org)`
|
||||||
|
|
||||||
- Username attribute (optional)
|
- Username attribute (optional)
|
||||||
|
|
||||||
- The attribute of the user's LDAP record containing the user name. Given
|
- The attribute of the user's LDAP record containing the user name. Given
|
||||||
attribute value will be used for new Gitea account user name after first
|
attribute value will be used for new Gitea account user name after first
|
||||||
successful sign-in. Leave empty to use login name given on sign-in form.
|
successful sign-in. Leave empty to use login name given on sign-in form.
|
||||||
@@ -53,11 +59,13 @@ Both the LDAP via BindDN and the simple auth LDAP share the following fields:
|
|||||||
- Example for Microsoft Active Directory (AD): `sAMAccountName`
|
- Example for Microsoft Active Directory (AD): `sAMAccountName`
|
||||||
|
|
||||||
- First name attribute (optional)
|
- First name attribute (optional)
|
||||||
|
|
||||||
- The attribute of the user's LDAP record containing the user's first name.
|
- The attribute of the user's LDAP record containing the user's first name.
|
||||||
This will be used to populate their account information.
|
This will be used to populate their account information.
|
||||||
- Example: `givenName`
|
- Example: `givenName`
|
||||||
|
|
||||||
- Surname attribute (optional)
|
- Surname attribute (optional)
|
||||||
|
|
||||||
- The attribute of the user's LDAP record containing the user's surname.
|
- The attribute of the user's LDAP record containing the user's surname.
|
||||||
This will be used to populate their account information.
|
This will be used to populate their account information.
|
||||||
- Example: `sn`
|
- Example: `sn`
|
||||||
@@ -67,19 +75,24 @@ Both the LDAP via BindDN and the simple auth LDAP share the following fields:
|
|||||||
address. This will be used to populate their account information.
|
address. This will be used to populate their account information.
|
||||||
- Example: `mail`
|
- Example: `mail`
|
||||||
|
|
||||||
**LDAP via BindDN** adds the following fields:
|
### LDAP via BindDN
|
||||||
|
|
||||||
|
Adds the following fields:
|
||||||
|
|
||||||
- Bind DN (optional)
|
- Bind DN (optional)
|
||||||
|
|
||||||
- The DN to bind to the LDAP server with when searching for the user. This
|
- The DN to bind to the LDAP server with when searching for the user. This
|
||||||
may be left blank to perform an anonymous search.
|
may be left blank to perform an anonymous search.
|
||||||
- Example: `cn=Search,dc=mydomain,dc=com`
|
- Example: `cn=Search,dc=mydomain,dc=com`
|
||||||
|
|
||||||
- Bind Password (optional)
|
- Bind Password (optional)
|
||||||
|
|
||||||
- The password for the Bind DN specified above, if any. _Note: The password
|
- The password for the Bind DN specified above, if any. _Note: The password
|
||||||
is stored in plaintext at the server. As such, ensure that the Bind DN
|
is stored in plaintext at the server. As such, ensure that the Bind DN
|
||||||
has as few privileges as possible._
|
has as few privileges as possible._
|
||||||
|
|
||||||
- User Search Base **(required)**
|
- User Search Base **(required)**
|
||||||
|
|
||||||
- The LDAP base at which user accounts will be searched for.
|
- The LDAP base at which user accounts will be searched for.
|
||||||
- Example: `ou=Users,dc=mydomain,dc=com`
|
- Example: `ou=Users,dc=mydomain,dc=com`
|
||||||
|
|
||||||
@@ -96,24 +109,28 @@ Both the LDAP via BindDN and the simple auth LDAP share the following fields:
|
|||||||
- Enable user synchronization
|
- Enable user synchronization
|
||||||
- This option enables a periodic task that synchronizes the Gitea users with
|
- This option enables a periodic task that synchronizes the Gitea users with
|
||||||
the LDAP server. The default period is every 24 hours but that can be
|
the LDAP server. The default period is every 24 hours but that can be
|
||||||
changed in the app.ini file. See the *cron.sync_external_users* section in
|
changed in the app.ini file. See the _cron.sync_external_users_ section in
|
||||||
the [sample
|
the [sample
|
||||||
app.ini](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.example.ini)
|
app.ini](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.example.ini)
|
||||||
for detailed comments about that section. The *User Search Base* and *User
|
for detailed comments about that section. The _User Search Base_ and _User
|
||||||
Filter* settings described above will limit which users can use Gitea and
|
Filter_ settings described above will limit which users can use Gitea and
|
||||||
which users will be synchronized. When initially run the task will create
|
which users will be synchronized. When initially run the task will create
|
||||||
all LDAP users that match the given settings so take care if working with
|
all LDAP users that match the given settings so take care if working with
|
||||||
large Enterprise LDAP directories.
|
large Enterprise LDAP directories.
|
||||||
|
|
||||||
**LDAP using simple auth** adds the following fields:
|
### LDAP using simple auth
|
||||||
|
|
||||||
|
Adds the following fields:
|
||||||
|
|
||||||
- User DN **(required)**
|
- User DN **(required)**
|
||||||
|
|
||||||
- A template to use as the user's DN. The `%s` matching parameter will be
|
- A template to use as the user's DN. The `%s` matching parameter will be
|
||||||
substituted with login name given on sign-in form.
|
substituted with login name given on sign-in form.
|
||||||
- Example: `cn=%s,ou=Users,dc=mydomain,dc=com`
|
- Example: `cn=%s,ou=Users,dc=mydomain,dc=com`
|
||||||
- Example: `uid=%s,ou=Users,dc=mydomain,dc=com`
|
- Example: `uid=%s,ou=Users,dc=mydomain,dc=com`
|
||||||
|
|
||||||
- User Search Base (optional)
|
- User Search Base (optional)
|
||||||
|
|
||||||
- The LDAP base at which user accounts will be searched for.
|
- The LDAP base at which user accounts will be searched for.
|
||||||
- Example: `ou=Users,dc=mydomain,dc=com`
|
- Example: `ou=Users,dc=mydomain,dc=com`
|
||||||
|
|
||||||
@@ -124,23 +141,28 @@ Both the LDAP via BindDN and the simple auth LDAP share the following fields:
|
|||||||
- Example: `(&(objectClass=posixAccount)(cn=%s))`
|
- Example: `(&(objectClass=posixAccount)(cn=%s))`
|
||||||
- Example: `(&(objectClass=posixAccount)(uid=%s))`
|
- Example: `(&(objectClass=posixAccount)(uid=%s))`
|
||||||
|
|
||||||
**Verify group membership in LDAP** uses the following fields:
|
### Verify group membership in LDAP
|
||||||
|
|
||||||
* Group Search Base (optional)
|
Uses the following fields:
|
||||||
* The LDAP DN used for groups.
|
|
||||||
* Example: `ou=group,dc=mydomain,dc=com`
|
|
||||||
|
|
||||||
* Group Name Filter (optional)
|
- Group Search Base (optional)
|
||||||
* An LDAP filter declaring how to find valid groups in the above DN.
|
|
||||||
* Example: `(|(cn=gitea_users)(cn=admins))`
|
|
||||||
|
|
||||||
* User Attribute in Group (optional)
|
- The LDAP DN used for groups.
|
||||||
* Which user LDAP attribute is listed in the group.
|
- Example: `ou=group,dc=mydomain,dc=com`
|
||||||
* Example: `uid`
|
|
||||||
|
|
||||||
* Group Attribute for User (optional)
|
- Group Name Filter (optional)
|
||||||
* Which group LDAP attribute contains an array above user attribute names.
|
|
||||||
* Example: `memberUid`
|
- An LDAP filter declaring how to find valid groups in the above DN.
|
||||||
|
- Example: `(|(cn=gitea_users)(cn=admins))`
|
||||||
|
|
||||||
|
- User Attribute in Group (optional)
|
||||||
|
|
||||||
|
- Which user LDAP attribute is listed in the group.
|
||||||
|
- Example: `uid`
|
||||||
|
|
||||||
|
- Group Attribute for User (optional)
|
||||||
|
- Which group LDAP attribute contains an array above user attribute names.
|
||||||
|
- Example: `memberUid`
|
||||||
|
|
||||||
## PAM (Pluggable Authentication Module)
|
## PAM (Pluggable Authentication Module)
|
||||||
|
|
||||||
@@ -154,28 +176,35 @@ This option allows Gitea to log in to an SMTP host as a Gitea user. To
|
|||||||
configure this, set the fields below:
|
configure this, set the fields below:
|
||||||
|
|
||||||
- Authentication Name **(required)**
|
- Authentication Name **(required)**
|
||||||
|
|
||||||
- A name to assign to the new method of authorization.
|
- A name to assign to the new method of authorization.
|
||||||
|
|
||||||
- SMTP Authentication Type **(required)**
|
- SMTP Authentication Type **(required)**
|
||||||
|
|
||||||
- Type of authentication to use to connect to SMTP host, PLAIN or LOGIN.
|
- Type of authentication to use to connect to SMTP host, PLAIN or LOGIN.
|
||||||
|
|
||||||
- Host **(required)**
|
- Host **(required)**
|
||||||
|
|
||||||
- The address where the SMTP host can be reached.
|
- The address where the SMTP host can be reached.
|
||||||
- Example: `smtp.mydomain.com`
|
- Example: `smtp.mydomain.com`
|
||||||
|
|
||||||
- Port **(required)**
|
- Port **(required)**
|
||||||
|
|
||||||
- The port to use when connecting to the server.
|
- The port to use when connecting to the server.
|
||||||
- Example: `587`
|
- Example: `587`
|
||||||
|
|
||||||
- Allowed Domains
|
- Allowed Domains
|
||||||
|
|
||||||
- Restrict what domains can log in if using a public SMTP host or SMTP host
|
- Restrict what domains can log in if using a public SMTP host or SMTP host
|
||||||
with multiple domains.
|
with multiple domains.
|
||||||
- Example: `gitea.io,mydomain.com,mydomain2.com`
|
- Example: `gitea.io,mydomain.com,mydomain2.com`
|
||||||
|
|
||||||
- Enable TLS Encryption
|
- Enable TLS Encryption
|
||||||
|
|
||||||
- Enable TLS encryption on authentication.
|
- Enable TLS encryption on authentication.
|
||||||
|
|
||||||
- Skip TLS Verify
|
- Skip TLS Verify
|
||||||
|
|
||||||
- Disable TLS verify on authentication.
|
- Disable TLS verify on authentication.
|
||||||
|
|
||||||
- This authentication is activate
|
- This authentication is activate
|
||||||
@@ -188,7 +217,8 @@ configure this, set the fields below:
|
|||||||
|
|
||||||
- On the FreeIPA server, create a `gitea.ldif` file, replacing `dc=example,dc=com`
|
- On the FreeIPA server, create a `gitea.ldif` file, replacing `dc=example,dc=com`
|
||||||
with your DN, and provide an appropriately secure password:
|
with your DN, and provide an appropriately secure password:
|
||||||
```
|
|
||||||
|
```sh
|
||||||
dn: uid=gitea,cn=sysaccounts,cn=etc,dc=example,dc=com
|
dn: uid=gitea,cn=sysaccounts,cn=etc,dc=example,dc=com
|
||||||
changetype: add
|
changetype: add
|
||||||
objectclass: account
|
objectclass: account
|
||||||
@@ -197,18 +227,22 @@ configure this, set the fields below:
|
|||||||
userPassword: secure password
|
userPassword: secure password
|
||||||
passwordExpirationTime: 20380119031407Z
|
passwordExpirationTime: 20380119031407Z
|
||||||
nsIdleTimeout: 0
|
nsIdleTimeout: 0
|
||||||
```
|
```
|
||||||
|
|
||||||
- Import the LDIF (change localhost to an IPA server if needed). A prompt for
|
- Import the LDIF (change localhost to an IPA server if needed). A prompt for
|
||||||
Directory Manager password will be presented:
|
Directory Manager password will be presented:
|
||||||
```
|
|
||||||
|
```sh
|
||||||
ldapmodify -h localhost -p 389 -x -D \
|
ldapmodify -h localhost -p 389 -x -D \
|
||||||
"cn=Directory Manager" -W -f gitea.ldif
|
"cn=Directory Manager" -W -f gitea.ldif
|
||||||
```
|
```
|
||||||
- Add an IPA group for gitea\_users :
|
|
||||||
```
|
- Add an IPA group for gitea_users :
|
||||||
|
|
||||||
|
```sh
|
||||||
ipa group-add --desc="Gitea Users" gitea_users
|
ipa group-add --desc="Gitea Users" gitea_users
|
||||||
```
|
```
|
||||||
|
|
||||||
- Note: For errors about IPA credentials, run `kinit admin` and provide the
|
- Note: For errors about IPA credentials, run `kinit admin` and provide the
|
||||||
domain admin account password.
|
domain admin account password.
|
||||||
|
|
||||||
@@ -224,13 +258,15 @@ Before activating SSPI single sign-on authentication (SSO) you have to prepare y
|
|||||||
- Create a separate user account in active directory, under which the `gitea.exe` process will be running (eg. `user` under domain `domain.local`):
|
- Create a separate user account in active directory, under which the `gitea.exe` process will be running (eg. `user` under domain `domain.local`):
|
||||||
|
|
||||||
- Create a service principal name for the host where `gitea.exe` is running with class `HTTP`:
|
- Create a service principal name for the host where `gitea.exe` is running with class `HTTP`:
|
||||||
|
|
||||||
- Start `Command Prompt` or `PowerShell` as a priviledged domain user (eg. Domain Administrator)
|
- Start `Command Prompt` or `PowerShell` as a priviledged domain user (eg. Domain Administrator)
|
||||||
- Run the command below, replacing `host.domain.local` with the fully qualified domain name (FQDN) of the server where the web application will be running, and `domain\user` with the name of the account created in the previous step:
|
- Run the command below, replacing `host.domain.local` with the fully qualified domain name (FQDN) of the server where the web application will be running, and `domain\user` with the name of the account created in the previous step:
|
||||||
```
|
|
||||||
|
```sh
|
||||||
setspn -A HTTP/host.domain.local domain\user
|
setspn -A HTTP/host.domain.local domain\user
|
||||||
```
|
```
|
||||||
|
|
||||||
- Sign in (*sign out if you were already signed in*) with the user created
|
- Sign in (_sign out if you were already signed in_) with the user created
|
||||||
|
|
||||||
- Make sure that `ROOT_URL` in the `[server]` section of `custom/conf/app.ini` is the fully qualified domain name of the server where the web application will be running - the same you used when creating the service principal name (eg. `host.domain.local`)
|
- Make sure that `ROOT_URL` in the `[server]` section of `custom/conf/app.ini` is the fully qualified domain name of the server where the web application will be running - the same you used when creating the service principal name (eg. `host.domain.local`)
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2016-12-01T16:00:00+02:00"
|
|||||||
title: "认证"
|
title: "认证"
|
||||||
slug: "authentication"
|
slug: "authentication"
|
||||||
weight: 10
|
weight: 10
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2016-12-01T16:00:00+02:00"
|
|||||||
title: "認證"
|
title: "認證"
|
||||||
slug: "authentication"
|
slug: "authentication"
|
||||||
weight: 10
|
weight: 10
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2018-05-07T13:00:00+02:00"
|
|||||||
title: "Gitea compared to other Git hosting options"
|
title: "Gitea compared to other Git hosting options"
|
||||||
slug: "comparison"
|
slug: "comparison"
|
||||||
weight: 5
|
weight: 5
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
@@ -15,23 +15,27 @@ menu:
|
|||||||
|
|
||||||
# Gitea compared to other Git hosting options
|
# Gitea compared to other Git hosting options
|
||||||
|
|
||||||
|
**Table of Contents**
|
||||||
|
|
||||||
|
{{< toc >}}
|
||||||
|
|
||||||
To help decide if Gitea is suited for your needs, here is how it compares to other Git self hosted options.
|
To help decide if Gitea is suited for your needs, here is how it compares to other Git self hosted options.
|
||||||
|
|
||||||
Be warned that we don't regularly check for feature changes in other products, so this list may be outdated. If you find anything that needs to be updated in the table below, please report it in an [issue on GitHub](https://github.com/go-gitea/gitea/issues).
|
Be warned that we don't regularly check for feature changes in other products, so this list may be outdated. If you find anything that needs to be updated in the table below, please report it in an [issue on GitHub](https://github.com/go-gitea/gitea/issues).
|
||||||
|
|
||||||
_Symbols used in table:_
|
_Symbols used in table:_
|
||||||
|
|
||||||
* _✓ - supported_
|
- _✓ - supported_
|
||||||
|
|
||||||
* _⁄ - supported with limited functionality_
|
- _⁄ - supported with limited functionality_
|
||||||
|
|
||||||
* _✘ - unsupported_
|
- _✘ - unsupported_
|
||||||
|
|
||||||
#### General Features
|
## General Features
|
||||||
|
|
||||||
| Feature | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE |
|
| Feature | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE |
|
||||||
|---------|-------|------|-----------|-----------|-----------|-----------|--------------|
|
| ----------------------------------- | -------------------------------------------------- | ---- | --------- | --------- | --------- | --------- | ------------ |
|
||||||
| Open source and free | ✓ | ✓ | ✘| ✓ | ✘ | ✘ | ✓ |
|
| Open source and free | ✓ | ✓ | ✘ | ✓ | ✘ | ✘ | ✓ |
|
||||||
| Low resource usage (RAM/CPU) | ✓ | ✓ | ✘ | ✘ | ✘ | ✘ | ✘ |
|
| Low resource usage (RAM/CPU) | ✓ | ✓ | ✘ | ✘ | ✘ | ✘ | ✘ |
|
||||||
| Multiple database support | ✓ | ✓ | ✘ | ⁄ | ⁄ | ✓ | ✓ |
|
| Multiple database support | ✓ | ✓ | ✘ | ⁄ | ⁄ | ✓ | ✓ |
|
||||||
| Multiple OS support | ✓ | ✓ | ✘ | ✘ | ✘ | ✘ | ✓ |
|
| Multiple OS support | ✓ | ✓ | ✘ | ✘ | ✘ | ✘ | ✓ |
|
||||||
@@ -50,10 +54,10 @@ _Symbols used in table:_
|
|||||||
| Built-in CI/CD | ✘ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
| Built-in CI/CD | ✘ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||||
| Subgroups: groups within groups | ✘ | ✘ | ✘ | ✓ | ✓ | ✘ | ✓ |
|
| Subgroups: groups within groups | ✘ | ✘ | ✘ | ✓ | ✓ | ✘ | ✓ |
|
||||||
|
|
||||||
#### Code management
|
## Code management
|
||||||
|
|
||||||
| Feature | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE |
|
| Feature | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE |
|
||||||
|---------|-------|------|-----------|-----------|-----------|-----------|--------------|
|
| -------------------------------------------- | ------------------------------------------------ | ---- | --------- | --------- | --------- | --------- | ------------ |
|
||||||
| Repository topics | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
| Repository topics | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||||
| Repository code search | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
| Repository code search | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||||
| Global code search | ✓ | ✘ | ✓ | ✘ | ✓ | ✓ | ✓ |
|
| Global code search | ✓ | ✘ | ✓ | ✘ | ✓ | ✓ | ✓ |
|
||||||
@@ -70,10 +74,10 @@ _Symbols used in table:_
|
|||||||
| Commit graph | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
| Commit graph | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||||
| Template Repositories | [✓](https://github.com/go-gitea/gitea/pull/8768) | ✘ | ✓ | ✘ | ✓ | ✓ | ✘ |
|
| Template Repositories | [✓](https://github.com/go-gitea/gitea/pull/8768) | ✘ | ✓ | ✘ | ✓ | ✓ | ✘ |
|
||||||
|
|
||||||
#### Issue Tracker
|
## Issue Tracker
|
||||||
|
|
||||||
| Feature | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE |
|
| Feature | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE |
|
||||||
|---------|-------|------|-----------|-----------|-----------|-----------|--------------|
|
| ------------------------------- | -------------------------------------------------- | --------------------------------------------- | --------- | ----------------------------------------------------------------------- | --------- | --------- | ------------ |
|
||||||
| Issue tracker | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ |
|
| Issue tracker | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ |
|
||||||
| Issue templates | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
| Issue templates | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||||
| Labels | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
| Labels | ✓ | ✓ | ✓ | ✓ | ✓ | ✘ | ✘ |
|
||||||
@@ -92,10 +96,10 @@ _Symbols used in table:_
|
|||||||
| Create issue via email | [✘](https://github.com/go-gitea/gitea/issues/6226) | [✘](https://github.com/gogs/gogs/issues/2602) | ✘ | ✘ | ✓ | ✓ | ✘ |
|
| Create issue via email | [✘](https://github.com/go-gitea/gitea/issues/6226) | [✘](https://github.com/gogs/gogs/issues/2602) | ✘ | ✘ | ✓ | ✓ | ✘ |
|
||||||
| Service Desk | [✘](https://github.com/go-gitea/gitea/issues/6219) | ✘ | ✘ | [✓](https://gitlab.com/groups/gitlab-org/-/epics/3103) | ✓ | ✘ | ✘ |
|
| Service Desk | [✘](https://github.com/go-gitea/gitea/issues/6219) | ✘ | ✘ | [✓](https://gitlab.com/groups/gitlab-org/-/epics/3103) | ✓ | ✘ | ✘ |
|
||||||
|
|
||||||
#### Pull/Merge requests
|
## Pull/Merge requests
|
||||||
|
|
||||||
| Feature | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE |
|
| Feature | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE |
|
||||||
|---------|-------|------|-----------|-----------|-----------|-----------|--------------|
|
| ----------------------------------------------- | -------------------------------------------------- | ---- | --------- | --------------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------------ | ------------ |
|
||||||
| Pull/Merge requests | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
| Pull/Merge requests | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||||
| Squash merging | ✓ | ✘ | ✓ | [✓](https://docs.gitlab.com/ce/user/project/merge_requests/squash_and_merge.html) | ✓ | ✓ | ✓ |
|
| Squash merging | ✓ | ✘ | ✓ | [✓](https://docs.gitlab.com/ce/user/project/merge_requests/squash_and_merge.html) | ✓ | ✓ | ✓ |
|
||||||
| Rebase merging | ✓ | ✓ | ✓ | ✘ | ⁄ | ✘ | ✓ |
|
| Rebase merging | ✓ | ✓ | ✓ | ✘ | ⁄ | ✘ | ✓ |
|
||||||
@@ -108,11 +112,10 @@ _Symbols used in table:_
|
|||||||
| Cherry-picking changes | [✘](https://github.com/go-gitea/gitea/issues/5158) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
|
| Cherry-picking changes | [✘](https://github.com/go-gitea/gitea/issues/5158) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
|
||||||
| Download Patch | ✓ | ✘ | ✓ | ✓ | ✓ | [/](https://jira.atlassian.com/plugins/servlet/mobile#issue/BCLOUD-8323) | ✘ |
|
| Download Patch | ✓ | ✘ | ✓ | ✓ | ✓ | [/](https://jira.atlassian.com/plugins/servlet/mobile#issue/BCLOUD-8323) | ✘ |
|
||||||
|
|
||||||
|
## 3rd-party integrations
|
||||||
#### 3rd-party integrations
|
|
||||||
|
|
||||||
| Feature | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE |
|
| Feature | Gitea | Gogs | GitHub EE | GitLab CE | GitLab EE | BitBucket | RhodeCode CE |
|
||||||
|---------|-------|------|-----------|-----------|-----------|-----------|--------------|
|
| ---------------------------------------------- | ------------------------------------------------ | ---- | --------- | --------- | --------- | --------- | ------------ |
|
||||||
| Webhook support | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
| Webhook support | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||||
| Custom Git Hooks | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
| Custom Git Hooks | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||||
| AD / LDAP integration | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
| AD / LDAP integration | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2019-02-14T11:51:04+08:00"
|
|||||||
title: "横向对比 Gitea 与其它 Git 托管工具"
|
title: "横向对比 Gitea 与其它 Git 托管工具"
|
||||||
slug: "comparison"
|
slug: "comparison"
|
||||||
weight: 5
|
weight: 5
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2016-12-01T16:00:00+02:00"
|
|||||||
title: "Localization"
|
title: "Localization"
|
||||||
slug: "localization"
|
slug: "localization"
|
||||||
weight: 10
|
weight: 10
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2016-12-01T16:00:00+02:00"
|
|||||||
title: "本地化"
|
title: "本地化"
|
||||||
slug: "localization"
|
slug: "localization"
|
||||||
weight: 10
|
weight: 10
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2016-12-01T16:00:00+02:00"
|
|||||||
title: "在地化"
|
title: "在地化"
|
||||||
slug: "localization"
|
slug: "localization"
|
||||||
weight: 10
|
weight: 10
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2016-12-01T16:00:00+02:00"
|
|||||||
title: "Webhooks"
|
title: "Webhooks"
|
||||||
slug: "webhooks"
|
slug: "webhooks"
|
||||||
weight: 10
|
weight: 10
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2016-12-01T16:00:00+02:00"
|
|||||||
title: "Webhooks"
|
title: "Webhooks"
|
||||||
slug: "webhooks"
|
slug: "webhooks"
|
||||||
weight: 10
|
weight: 10
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2016-12-01T16:00:00+02:00"
|
|||||||
title: "Webhooks"
|
title: "Webhooks"
|
||||||
slug: "webhooks"
|
slug: "webhooks"
|
||||||
weight: 10
|
weight: 10
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
+83
-53
@@ -3,7 +3,7 @@ date: "2019-04-05T16:00:00+02:00"
|
|||||||
title: "FAQ"
|
title: "FAQ"
|
||||||
slug: "faq"
|
slug: "faq"
|
||||||
weight: 5
|
weight: 5
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
@@ -16,11 +16,14 @@ menu:
|
|||||||
# Frequently Asked Questions <!-- omit in toc -->
|
# Frequently Asked Questions <!-- omit in toc -->
|
||||||
|
|
||||||
This page contains some common questions and answers.
|
This page contains some common questions and answers.
|
||||||
Also see [Support Options]({{< relref "doc/help/seek-help.en-us.md" >}})
|
For more help resources, check all [Support Options]({{< relref "doc/help/seek-help.en-us.md" >}}).
|
||||||
|
|
||||||
|
**Table of Contents**
|
||||||
|
|
||||||
{{< toc >}}
|
{{< toc >}}
|
||||||
|
|
||||||
## Difference between 1.x and 1.x.x downloads
|
## Difference between 1.x and 1.x.x downloads
|
||||||
|
|
||||||
Version 1.7.x will be used for this example.
|
Version 1.7.x will be used for this example.
|
||||||
**NOTE:** this example applies to Docker images as well!
|
**NOTE:** this example applies to Docker images as well!
|
||||||
|
|
||||||
@@ -32,10 +35,11 @@ This means that 1.x downloads will change as commits are merged to their respect
|
|||||||
On the other hand, 1.x.x downloads should never change.
|
On the other hand, 1.x.x downloads should never change.
|
||||||
|
|
||||||
## How to migrate from Gogs/GitHub/etc. to Gitea
|
## How to migrate from Gogs/GitHub/etc. to Gitea
|
||||||
|
|
||||||
To migrate from Gogs to Gitea:
|
To migrate from Gogs to Gitea:
|
||||||
|
|
||||||
* [Gogs version 0.9.146 or less]({{< relref "doc/upgrade/from-gogs.en-us.md" >}})
|
- [Gogs version 0.9.146 or less]({{< relref "doc/upgrade/from-gogs.en-us.md" >}})
|
||||||
* [Gogs version 0.11.46.0418](https://github.com/go-gitea/gitea/issues/4286)
|
- [Gogs version 0.11.46.0418](https://github.com/go-gitea/gitea/issues/4286)
|
||||||
|
|
||||||
To migrate from GitHub to Gitea, you can use Gitea's built-in migration form.
|
To migrate from GitHub to Gitea, you can use Gitea's built-in migration form.
|
||||||
In order to migrate items such as issues, pull requests, etc. you will need to input at least your username.
|
In order to migrate items such as issues, pull requests, etc. you will need to input at least your username.
|
||||||
@@ -45,29 +49,31 @@ To migrate from Gitlab to Gitea, you can use this non-affiliated tool:
|
|||||||
https://github.com/loganinak/MigrateGitlabToGogs
|
https://github.com/loganinak/MigrateGitlabToGogs
|
||||||
|
|
||||||
## Where does Gitea store what file
|
## Where does Gitea store what file
|
||||||
* WorkPath
|
|
||||||
* Environment variable `GITEA_WORK_DIR`
|
- WorkPath
|
||||||
* Else binary location
|
- Environment variable `GITEA_WORK_DIR`
|
||||||
* AppDataPath (default for database, indexers, etc.)
|
- Else binary location
|
||||||
* `APP_DATA_PATH` from `app.ini`
|
- AppDataPath (default for database, indexers, etc.)
|
||||||
* Else `%(WorkPath)/data`
|
- `APP_DATA_PATH` from `app.ini`
|
||||||
* CustomPath (custom templates)
|
- Else `%(WorkPath)/data`
|
||||||
* Environment variable `GITEA_CUSTOM`
|
- CustomPath (custom templates)
|
||||||
* Else `%(WorkPath)/custom`
|
- Environment variable `GITEA_CUSTOM`
|
||||||
* HomeDir
|
- Else `%(WorkPath)/custom`
|
||||||
* Unix: Environment variable `HOME`
|
- HomeDir
|
||||||
* Windows: Environment variable `USERPROFILE`, else environment variables `HOMEDRIVE`+`HOMEPATH`
|
- Unix: Environment variable `HOME`
|
||||||
* RepoRootPath
|
- Windows: Environment variable `USERPROFILE`, else environment variables `HOMEDRIVE`+`HOMEPATH`
|
||||||
* `ROOT` in `app.ini`
|
- RepoRootPath
|
||||||
* Else `%(HomeDir)/gitea-repositories`
|
- `ROOT` in `app.ini`
|
||||||
* INI (config file)
|
- Else `%(HomeDir)/gitea-repositories`
|
||||||
* `-c` flag
|
- INI (config file)
|
||||||
* Else `%(CustomPath)/conf/app.ini`
|
- `-c` flag
|
||||||
* SQLite Database
|
- Else `%(CustomPath)/conf/app.ini`
|
||||||
* `PATH` in `database` section of `app.ini`
|
- SQLite Database
|
||||||
* Else `%(AppDataPath)/gitea.db`
|
- `PATH` in `database` section of `app.ini`
|
||||||
|
- Else `%(AppDataPath)/gitea.db`
|
||||||
|
|
||||||
## Not seeing a clone URL or the clone URL being incorrect
|
## Not seeing a clone URL or the clone URL being incorrect
|
||||||
|
|
||||||
There are a few places that could make this show incorrectly.
|
There are a few places that could make this show incorrectly.
|
||||||
|
|
||||||
1. If using a reverse proxy, make sure you have followed the correction directions in the [reverse proxy guide]({{< relref "doc/usage/reverse-proxies.en-us.md" >}})
|
1. If using a reverse proxy, make sure you have followed the correction directions in the [reverse proxy guide]({{< relref "doc/usage/reverse-proxies.en-us.md" >}})
|
||||||
@@ -79,24 +85,29 @@ If certain clone options aren't showing up (HTTP/S or SSH), the following option
|
|||||||
`DISABLE_SSH`: if set to true, there will be no SSH link
|
`DISABLE_SSH`: if set to true, there will be no SSH link
|
||||||
`SSH_EXPOSE_ANONYMOUS`: if set to false, SSH links will be hidden for anonymous users
|
`SSH_EXPOSE_ANONYMOUS`: if set to false, SSH links will be hidden for anonymous users
|
||||||
|
|
||||||
|
|
||||||
## Custom Templates not loading or working incorrectly
|
## Custom Templates not loading or working incorrectly
|
||||||
|
|
||||||
Gitea's custom templates must be added to the correct location or Gitea will not find and use them.
|
Gitea's custom templates must be added to the correct location or Gitea will not find and use them.
|
||||||
The correct path for the template(s) will be relative to the `CustomPath`
|
The correct path for the template(s) will be relative to the `CustomPath`
|
||||||
|
|
||||||
1. To find `CustomPath`, look for Custom File Root Path in Site Administration -> Configuration
|
1. To find `CustomPath`, look for Custom File Root Path in Site Administration -> Configuration
|
||||||
* If that doesn't exist, you can try `echo $GITEA_CUSTOM`
|
|
||||||
|
- If that doesn't exist, you can try `echo $GITEA_CUSTOM`
|
||||||
|
|
||||||
2. If you are still unable to find a path, the default can be [calculated above](#where-does-gitea-store-x-file)
|
2. If you are still unable to find a path, the default can be [calculated above](#where-does-gitea-store-x-file)
|
||||||
3. Once you have figured out the correct custom path, you can refer to the [customizing Gitea]({{< relref "doc/advanced/customizing-gitea.en-us.md" >}}) page to add your template to the correct location.
|
3. Once you have figured out the correct custom path, you can refer to the [customizing Gitea]({{< relref "doc/advanced/customizing-gitea.en-us.md" >}}) page to add your template to the correct location.
|
||||||
|
|
||||||
## Active user vs login prohibited user
|
## Active user vs login prohibited user
|
||||||
|
|
||||||
In Gitea, an "active" user refers to a user that has activated their account via email.
|
In Gitea, an "active" user refers to a user that has activated their account via email.
|
||||||
A "login prohibited" user is a user that is not allowed to log in to Gitea anymore
|
A "login prohibited" user is a user that is not allowed to log in to Gitea anymore
|
||||||
|
|
||||||
## Setting up logging
|
## Setting up logging
|
||||||
* [Official Docs]({{< relref "doc/advanced/logging-documentation.en-us.md" >}})
|
|
||||||
|
- [Official Docs]({{< relref "doc/advanced/logging-documentation.en-us.md" >}})
|
||||||
|
|
||||||
## What is Swagger?
|
## What is Swagger?
|
||||||
|
|
||||||
[Swagger](https://swagger.io/) is what Gitea uses for its API.
|
[Swagger](https://swagger.io/) is what Gitea uses for its API.
|
||||||
All Gitea instances have the built-in API, though it can be disabled by setting `ENABLE_SWAGGER` to `false` in the `api` section of your `app.ini`
|
All Gitea instances have the built-in API, though it can be disabled by setting `ENABLE_SWAGGER` to `false` in the `api` section of your `app.ini`
|
||||||
For more information, refer to Gitea's [API docs]({{< relref "doc/developers/api-usage.en-us.md" >}})
|
For more information, refer to Gitea's [API docs]({{< relref "doc/developers/api-usage.en-us.md" >}})
|
||||||
@@ -106,6 +117,7 @@ For more information, refer to Gitea's [API docs]({{< relref "doc/developers/api
|
|||||||
## Adjusting your server for public/private use
|
## Adjusting your server for public/private use
|
||||||
|
|
||||||
### Preventing spammers
|
### Preventing spammers
|
||||||
|
|
||||||
There are multiple things you can combine to prevent spammers.
|
There are multiple things you can combine to prevent spammers.
|
||||||
|
|
||||||
1. By only whitelisting certain domains with OpenID (see below)
|
1. By only whitelisting certain domains with OpenID (see below)
|
||||||
@@ -113,28 +125,32 @@ There are multiple things you can combine to prevent spammers.
|
|||||||
3. Settings `DISABLE_REGISTRATION` to `true` and creating new users via the [CLI]({{< relref "doc/usage/command-line.en-us.md" >}}), [API]({{< relref "doc/developers/api-usage.en-us.md" >}}), or Gitea's Admin UI
|
3. Settings `DISABLE_REGISTRATION` to `true` and creating new users via the [CLI]({{< relref "doc/usage/command-line.en-us.md" >}}), [API]({{< relref "doc/developers/api-usage.en-us.md" >}}), or Gitea's Admin UI
|
||||||
|
|
||||||
### Only allow certain email domains
|
### Only allow certain email domains
|
||||||
|
|
||||||
You can configure `EMAIL_DOMAIN_WHITELIST` in your app.ini under `[service]`
|
You can configure `EMAIL_DOMAIN_WHITELIST` in your app.ini under `[service]`
|
||||||
|
|
||||||
### Only allow/block certain OpenID providers
|
### Only allow/block certain OpenID providers
|
||||||
|
|
||||||
You can configure `WHITELISTED_URIS` or `BLACKLISTED_URIS` under `[openid]` in your `app.ini`
|
You can configure `WHITELISTED_URIS` or `BLACKLISTED_URIS` under `[openid]` in your `app.ini`
|
||||||
**NOTE:** whitelisted takes precedence, so if it is non-blank then blacklisted is ignored
|
**NOTE:** whitelisted takes precedence, so if it is non-blank then blacklisted is ignored
|
||||||
|
|
||||||
### Issue only users
|
### Issue only users
|
||||||
|
|
||||||
The current way to achieve this is to create/modify a user with a max repo creation limit of 0.
|
The current way to achieve this is to create/modify a user with a max repo creation limit of 0.
|
||||||
|
|
||||||
### Restricted users
|
### Restricted users
|
||||||
Restricted users are limited to a subset of the content based on their organization/team memberships and collaborations, ignoring the public flag on organizations/repos etc.__
|
|
||||||
|
Restricted users are limited to a subset of the content based on their organization/team memberships and collaborations, ignoring the public flag on organizations/repos etc.\_\_
|
||||||
|
|
||||||
Example use case: A company runs a Gitea instance that requires login. Most repos are public (accessible/browseable by all co-workers).
|
Example use case: A company runs a Gitea instance that requires login. Most repos are public (accessible/browseable by all co-workers).
|
||||||
|
|
||||||
At some point, a customer or third party needs access to a specific repo and only that repo. Making such a customer account restricted and granting any needed access using team membership(s) and/or collaboration(s) is a simple way to achieve that without the need to make everything private.
|
At some point, a customer or third party needs access to a specific repo and only that repo. Making such a customer account restricted and granting any needed access using team membership(s) and/or collaboration(s) is a simple way to achieve that without the need to make everything private.
|
||||||
|
|
||||||
|
|
||||||
### Enable Fail2ban
|
### Enable Fail2ban
|
||||||
|
|
||||||
Use [Fail2Ban]({{< relref "doc/usage/fail2ban-setup.en-us.md" >}}) to monitor and stop automated login attempts or other malicious behavior based on log patterns
|
Use [Fail2Ban]({{< relref "doc/usage/fail2ban-setup.en-us.md" >}}) to monitor and stop automated login attempts or other malicious behavior based on log patterns
|
||||||
|
|
||||||
## How to add/use custom themes
|
## How to add/use custom themes
|
||||||
|
|
||||||
Gitea supports two official themes right now, `gitea` and `arc-green` (`light` and `dark` respectively)
|
Gitea supports two official themes right now, `gitea` and `arc-green` (`light` and `dark` respectively)
|
||||||
To add your own theme, currently the only way is to provide a complete theme (not just color overrides)
|
To add your own theme, currently the only way is to provide a complete theme (not just color overrides)
|
||||||
|
|
||||||
@@ -143,15 +159,18 @@ Name the `.css` file `theme-arc-blue.css` and add it to your custom folder in `c
|
|||||||
Allow users to use it by adding `arc-blue` to the list of `THEMES` in your `app.ini`
|
Allow users to use it by adding `arc-blue` to the list of `THEMES` in your `app.ini`
|
||||||
|
|
||||||
## SSHD vs built-in SSH
|
## SSHD vs built-in SSH
|
||||||
|
|
||||||
SSHD is the built-in SSH server on most Unix systems.
|
SSHD is the built-in SSH server on most Unix systems.
|
||||||
Gitea also provides its own SSH server, for usage when SSHD is not available.
|
Gitea also provides its own SSH server, for usage when SSHD is not available.
|
||||||
|
|
||||||
## Gitea is running slow
|
## Gitea is running slow
|
||||||
|
|
||||||
The most common culprit for this is loading federated avatars.
|
The most common culprit for this is loading federated avatars.
|
||||||
This can be turned off by setting `ENABLE_FEDERATED_AVATAR` to `false` in your `app.ini`
|
This can be turned off by setting `ENABLE_FEDERATED_AVATAR` to `false` in your `app.ini`
|
||||||
Another option that may need to be changed is setting `DISABLE_GRAVATAR` to `true` in your `app.ini`
|
Another option that may need to be changed is setting `DISABLE_GRAVATAR` to `true` in your `app.ini`
|
||||||
|
|
||||||
## Can't create repositories/files
|
## Can't create repositories/files
|
||||||
|
|
||||||
Make sure that Gitea has sufficient permissions to write to its home directory and data directory.
|
Make sure that Gitea has sufficient permissions to write to its home directory and data directory.
|
||||||
See [AppDataPath and RepoRootPath](#where-does-gitea-store-x-file)
|
See [AppDataPath and RepoRootPath](#where-does-gitea-store-x-file)
|
||||||
|
|
||||||
@@ -160,22 +179,26 @@ See [AppDataPath and RepoRootPath](#where-does-gitea-store-x-file)
|
|||||||
Which makes all other paths non-writeable to Gitea.
|
Which makes all other paths non-writeable to Gitea.
|
||||||
|
|
||||||
## Translation is incorrect/how to add more translations
|
## Translation is incorrect/how to add more translations
|
||||||
|
|
||||||
Our translations are currently crowd-sourced on our [Crowdin project](https://crowdin.com/project/gitea)
|
Our translations are currently crowd-sourced on our [Crowdin project](https://crowdin.com/project/gitea)
|
||||||
Whether you want to change a translation or add a new one, it will need to be there as all translations are overwritten in our CI via the Crowdin integration.
|
Whether you want to change a translation or add a new one, it will need to be there as all translations are overwritten in our CI via the Crowdin integration.
|
||||||
|
|
||||||
## Hooks aren't running
|
## Hooks aren't running
|
||||||
|
|
||||||
If Gitea is not running hooks, a common cause is incorrect setup of SSH keys.
|
If Gitea is not running hooks, a common cause is incorrect setup of SSH keys.
|
||||||
See [SSH Issues](#ssh-issues) for more information.
|
See [SSH Issues](#ssh-issues) for more information.
|
||||||
|
|
||||||
You can also try logging into the administration panel and running the `Resynchronize pre-receive, update and post-receive hooks of all repositories.` option.
|
You can also try logging into the administration panel and running the `Resynchronize pre-receive, update and post-receive hooks of all repositories.` option.
|
||||||
|
|
||||||
## SSH issues
|
## SSH issues
|
||||||
|
|
||||||
If you cannot reach repositories over `ssh`, but `https` works fine, consider looking into the following.
|
If you cannot reach repositories over `ssh`, but `https` works fine, consider looking into the following.
|
||||||
|
|
||||||
First, make sure you can access Gitea via SSH.
|
First, make sure you can access Gitea via SSH.
|
||||||
`ssh [email protected]`
|
`ssh [email protected]`
|
||||||
|
|
||||||
If the connection is successful, you should receive an error message like the following:
|
If the connection is successful, you should receive an error message like the following:
|
||||||
|
|
||||||
```
|
```
|
||||||
Hi there, You've successfully authenticated, but Gitea does not provide shell access.
|
Hi there, You've successfully authenticated, but Gitea does not provide shell access.
|
||||||
If this is unexpected, please log in with password and setup Gitea under another user.
|
If this is unexpected, please log in with password and setup Gitea under another user.
|
||||||
@@ -196,20 +219,20 @@ fatal: Could not read from remote repository.
|
|||||||
This error signifies that the server rejected a log in attempt, check the
|
This error signifies that the server rejected a log in attempt, check the
|
||||||
following things:
|
following things:
|
||||||
|
|
||||||
* On the client:
|
- On the client:
|
||||||
* Ensure the public and private ssh keys are added to the correct Gitea user.
|
- Ensure the public and private ssh keys are added to the correct Gitea user.
|
||||||
* Make sure there are no issues in the remote url. In particular, ensure the name of the
|
- Make sure there are no issues in the remote url. In particular, ensure the name of the
|
||||||
git user (before the `@`) is spelled correctly.
|
git user (before the `@`) is spelled correctly.
|
||||||
* Ensure public and private ssh keys are correct on client machine.
|
- Ensure public and private ssh keys are correct on client machine.
|
||||||
* On the server:
|
- On the server:
|
||||||
* Make sure the repository exists and is correctly named.
|
- Make sure the repository exists and is correctly named.
|
||||||
* Check the permissions of the `.ssh` directory in the system user's home directory.
|
- Check the permissions of the `.ssh` directory in the system user's home directory.
|
||||||
* Verify that the correct public keys are added to `.ssh/authorized_keys`.
|
- Verify that the correct public keys are added to `.ssh/authorized_keys`.
|
||||||
Try to run `Rewrite '.ssh/authorized_keys' file (for Gitea SSH keys)` on the
|
Try to run `Rewrite '.ssh/authorized_keys' file (for Gitea SSH keys)` on the
|
||||||
Gitea admin panel.
|
Gitea admin panel.
|
||||||
* Read Gitea logs.
|
- Read Gitea logs.
|
||||||
* Read /var/log/auth (or similar).
|
- Read /var/log/auth (or similar).
|
||||||
* Check permissions of repositories.
|
- Check permissions of repositories.
|
||||||
|
|
||||||
The following is an example of a missing public SSH key where authentication
|
The following is an example of a missing public SSH key where authentication
|
||||||
succeeded, but some other setting is preventing SSH from reaching the correct
|
succeeded, but some other setting is preventing SSH from reaching the correct
|
||||||
@@ -224,26 +247,28 @@ and the repository exists.
|
|||||||
|
|
||||||
In this case, look into the following settings:
|
In this case, look into the following settings:
|
||||||
|
|
||||||
* On the server:
|
- On the server:
|
||||||
* Make sure that the `git` system user has a usable shell set
|
- Make sure that the `git` system user has a usable shell set
|
||||||
* Verify this with `getent passwd git | cut -d: -f7`
|
- Verify this with `getent passwd git | cut -d: -f7`
|
||||||
* `usermod` or `chsh` can be used to modify this.
|
- `usermod` or `chsh` can be used to modify this.
|
||||||
* Ensure that the `gitea serv` command in `.ssh/authorized_keys` uses the
|
- Ensure that the `gitea serv` command in `.ssh/authorized_keys` uses the
|
||||||
correct configuration file.
|
correct configuration file.
|
||||||
|
|
||||||
## Missing releases after migrating repository with tags
|
## Missing releases after migrating repository with tags
|
||||||
|
|
||||||
To migrate an repository *with* all tags, you need to do two things:
|
To migrate an repository _with_ all tags, you need to do two things:
|
||||||
|
|
||||||
|
- Push tags to the repository:
|
||||||
|
|
||||||
* Push tags to the repository:
|
|
||||||
```
|
```
|
||||||
git push --tags
|
git push --tags
|
||||||
```
|
```
|
||||||
|
|
||||||
* (Re-)sync tags of all repositories within Gitea:
|
- (Re-)sync tags of all repositories within Gitea:
|
||||||
```
|
|
||||||
gitea admin repo-sync-releases
|
```
|
||||||
```
|
gitea admin repo-sync-releases
|
||||||
|
```
|
||||||
|
|
||||||
## LFS Issues
|
## LFS Issues
|
||||||
|
|
||||||
@@ -254,18 +279,22 @@ batch response: Authentication required: Authorization error: <GITEA_LFS_URL>/in
|
|||||||
Check that you have proper access to the repository
|
Check that you have proper access to the repository
|
||||||
error: failed to push some refs to '<GIT_REPO_URL>'
|
error: failed to push some refs to '<GIT_REPO_URL>'
|
||||||
```
|
```
|
||||||
|
|
||||||
Check the value of `LFS_HTTP_AUTH_EXPIRY` in your `app.ini` file.
|
Check the value of `LFS_HTTP_AUTH_EXPIRY` in your `app.ini` file.
|
||||||
By default, your LFS token will expire after 20 minutes. If you have a slow connection or a large file (or both), it may not finish uploading within the time limit.
|
By default, your LFS token will expire after 20 minutes. If you have a slow connection or a large file (or both), it may not finish uploading within the time limit.
|
||||||
|
|
||||||
You may want to set this value to `60m` or `120m`.
|
You may want to set this value to `60m` or `120m`.
|
||||||
|
|
||||||
## How can I create users before starting Gitea
|
## How can I create users before starting Gitea
|
||||||
|
|
||||||
Gitea provides a sub-command `gitea migrate` to initialize the database, after which you can use the [admin CLI commands]({{< relref "doc/usage/command-line.en-us.md#admin" >}}) to add users like normal.
|
Gitea provides a sub-command `gitea migrate` to initialize the database, after which you can use the [admin CLI commands]({{< relref "doc/usage/command-line.en-us.md#admin" >}}) to add users like normal.
|
||||||
|
|
||||||
## How can I enable password reset
|
## How can I enable password reset
|
||||||
|
|
||||||
There is no setting for password resets. It is enabled when a [mail service]({{< relref "doc/usage/email-setup.en-us.md" >}}) is configured, and disabled otherwise.
|
There is no setting for password resets. It is enabled when a [mail service]({{< relref "doc/usage/email-setup.en-us.md" >}}) is configured, and disabled otherwise.
|
||||||
|
|
||||||
## How can a user's password be changed
|
## How can a user's password be changed
|
||||||
|
|
||||||
- As an **admin**, you can change any user's password (and optionally force them to change it on next login)...
|
- As an **admin**, you can change any user's password (and optionally force them to change it on next login)...
|
||||||
- By navigating to your `Site Administration -> User Accounts` page and editing a user.
|
- By navigating to your `Site Administration -> User Accounts` page and editing a user.
|
||||||
- By using the [admin CLI commands]({{< relref "doc/usage/command-line.en-us.md#admin" >}}).
|
- By using the [admin CLI commands]({{< relref "doc/usage/command-line.en-us.md#admin" >}}).
|
||||||
@@ -276,6 +305,7 @@ There is no setting for password resets. It is enabled when a [mail service]({{<
|
|||||||
If the `Forgot Password/Account Recovery` page is disabled, please contact your administrator to configure a [mail service]({{< relref "doc/usage/email-setup.en-us.md" >}}).
|
If the `Forgot Password/Account Recovery` page is disabled, please contact your administrator to configure a [mail service]({{< relref "doc/usage/email-setup.en-us.md" >}}).
|
||||||
|
|
||||||
## Why is my markdown broken
|
## Why is my markdown broken
|
||||||
|
|
||||||
In Gitea version `1.11` we moved to [goldmark](https://github.com/yuin/goldmark) for markdown rendering, which is [CommonMark](https://commonmark.org/) compliant.
|
In Gitea version `1.11` we moved to [goldmark](https://github.com/yuin/goldmark) for markdown rendering, which is [CommonMark](https://commonmark.org/) compliant.
|
||||||
If you have markdown that worked as you expected prior to version `1.11` and after upgrading it's not working anymore, please look through the CommonMark spec to see whether the problem is due to a bug or non-compliant syntax.
|
If you have markdown that worked as you expected prior to version `1.11` and after upgrading it's not working anymore, please look through the CommonMark spec to see whether the problem is due to a bug or non-compliant syntax.
|
||||||
If it is the latter, _usually_ there is a compliant alternative listed in the spec.
|
If it is the latter, _usually_ there is a compliant alternative listed in the spec.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2019-11-12T16:00:00+02:00"
|
|||||||
title: "Search"
|
title: "Search"
|
||||||
slug: "search"
|
slug: "search"
|
||||||
weight: 4
|
weight: 4
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2019-11-12T16:00:00+02:00"
|
|||||||
title: "Chercher"
|
title: "Chercher"
|
||||||
slug: "search"
|
slug: "search"
|
||||||
weight: 4
|
weight: 4
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2019-11-12T16:00:00+02:00"
|
|||||||
title: "搜索"
|
title: "搜索"
|
||||||
slug: "search"
|
slug: "search"
|
||||||
weight: 4
|
weight: 4
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2019-11-12T16:00:00+02:00"
|
|||||||
title: "搜索"
|
title: "搜索"
|
||||||
slug: "search"
|
slug: "search"
|
||||||
weight: 4
|
weight: 4
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2018-05-21T15:00:00+00:00"
|
|||||||
title: "Support Options"
|
title: "Support Options"
|
||||||
slug: "seek-help"
|
slug: "seek-help"
|
||||||
weight: 10
|
weight: 10
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2017-01-20T15:00:00+08:00"
|
|||||||
title: "需要帮助"
|
title: "需要帮助"
|
||||||
slug: "seek-help"
|
slug: "seek-help"
|
||||||
weight: 10
|
weight: 10
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2020-01-16"
|
|||||||
title: "Database Preparation"
|
title: "Database Preparation"
|
||||||
slug: "database-prep"
|
slug: "database-prep"
|
||||||
weight: 10
|
weight: 10
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
@@ -21,6 +21,8 @@ Database instance can be on same machine as Gitea (local database setup), or on
|
|||||||
|
|
||||||
Note: All steps below requires that the database engine of your choice is installed on your system. For remote database setup, install the server part on database instance and client part on your Gitea server. In addition, make sure you use same engine version for both server and client for some engine features to work. For security reason, protect `root` (MySQL) or `postgres` (PostgreSQL) database superuser with secure password. The steps assumes that you run Linux for both database and Gitea servers.
|
Note: All steps below requires that the database engine of your choice is installed on your system. For remote database setup, install the server part on database instance and client part on your Gitea server. In addition, make sure you use same engine version for both server and client for some engine features to work. For security reason, protect `root` (MySQL) or `postgres` (PostgreSQL) database superuser with secure password. The steps assumes that you run Linux for both database and Gitea servers.
|
||||||
|
|
||||||
|
**Table of Contents**
|
||||||
|
|
||||||
{{< toc >}}
|
{{< toc >}}
|
||||||
|
|
||||||
## MySQL
|
## MySQL
|
||||||
@@ -30,6 +32,7 @@ Note: All steps below requires that the database engine of your choice is instal
|
|||||||
```ini
|
```ini
|
||||||
bind-address = 203.0.113.3
|
bind-address = 203.0.113.3
|
||||||
```
|
```
|
||||||
|
|
||||||
2. On database instance, login to database console as root:
|
2. On database instance, login to database console as root:
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -58,7 +61,7 @@ Note: All steps below requires that the database engine of your choice is instal
|
|||||||
|
|
||||||
Replace username and password above as appropriate.
|
Replace username and password above as appropriate.
|
||||||
|
|
||||||
4. Create database with UTF-8 charset and collation. Make sure to use `utf8mb4` charset instead of `utf8` as the former supports all Unicode characters (including emojis) beyond *Basic Multilingual Plane*. Also, collation chosen depending on your expected content. When in doubt, use either `unicode_ci` or `general_ci`.
|
4. Create database with UTF-8 charset and collation. Make sure to use `utf8mb4` charset instead of `utf8` as the former supports all Unicode characters (including emojis) beyond _Basic Multilingual Plane_. Also, collation chosen depending on your expected content. When in doubt, use either `unicode_ci` or `general_ci`.
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
CREATE DATABASE giteadb CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_unicode_ci';
|
CREATE DATABASE giteadb CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_unicode_ci';
|
||||||
@@ -249,14 +252,12 @@ The PostgreSQL driver used by Gitea supports two-way TLS. In two-way TLS, both d
|
|||||||
|
|
||||||
You should be prompted to enter password for the database user, and then be connected to the database.
|
You should be prompted to enter password for the database user, and then be connected to the database.
|
||||||
|
|
||||||
|
|
||||||
### MySQL
|
### MySQL
|
||||||
|
|
||||||
While the MySQL driver used by Gitea also supports two-way TLS, Gitea currently supports only one-way TLS. See issue #10828 for details.
|
While the MySQL driver used by Gitea also supports two-way TLS, Gitea currently supports only one-way TLS. See issue #10828 for details.
|
||||||
|
|
||||||
In one-way TLS, the database client verifies the certificate sent from server during the connection handshake, and the server assumes that the connected client is legitimate, since client certificate verification doesn't take place.
|
In one-way TLS, the database client verifies the certificate sent from server during the connection handshake, and the server assumes that the connected client is legitimate, since client certificate verification doesn't take place.
|
||||||
|
|
||||||
|
|
||||||
1. On the database instance, place the following credentials:
|
1. On the database instance, place the following credentials:
|
||||||
|
|
||||||
- `/path/to/mysql.crt`: Database instance certificate
|
- `/path/to/mysql.crt`: Database instance certificate
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2017-06-19T12:00:00+02:00"
|
|||||||
title: "Installation from binary"
|
title: "Installation from binary"
|
||||||
slug: "install-from-binary"
|
slug: "install-from-binary"
|
||||||
weight: 10
|
weight: 10
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
@@ -18,6 +18,8 @@ menu:
|
|||||||
All downloads come with SQLite, MySQL and PostgreSQL support, and are built with
|
All downloads come with SQLite, MySQL and PostgreSQL support, and are built with
|
||||||
embedded assets. This can be different for older releases.
|
embedded assets. This can be different for older releases.
|
||||||
|
|
||||||
|
**Table of Contents**
|
||||||
|
|
||||||
{{< toc >}}
|
{{< toc >}}
|
||||||
|
|
||||||
## Download
|
## Download
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2017-08-23T09:00:00+02:00"
|
|||||||
title: "Installation avec le binaire pré-compilé"
|
title: "Installation avec le binaire pré-compilé"
|
||||||
slug: "install-from-binary"
|
slug: "install-from-binary"
|
||||||
weight: 10
|
weight: 10
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2016-12-01T16:00:00+02:00"
|
|||||||
title: "从二进制安装"
|
title: "从二进制安装"
|
||||||
slug: "install-from-binary"
|
slug: "install-from-binary"
|
||||||
weight: 10
|
weight: 10
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2016-12-01T16:00:00+02:00"
|
|||||||
title: "執行檔安裝"
|
title: "執行檔安裝"
|
||||||
slug: "install-from-binary"
|
slug: "install-from-binary"
|
||||||
weight: 10
|
weight: 10
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2016-12-01T16:00:00+02:00"
|
|||||||
title: "Installation from package"
|
title: "Installation from package"
|
||||||
slug: "install-from-package"
|
slug: "install-from-package"
|
||||||
weight: 10
|
weight: 10
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
@@ -15,6 +15,8 @@ menu:
|
|||||||
|
|
||||||
# Installation from package
|
# Installation from package
|
||||||
|
|
||||||
|
**Table of Contents**
|
||||||
|
|
||||||
{{< toc >}}
|
{{< toc >}}
|
||||||
|
|
||||||
## Alpine Linux
|
## Alpine Linux
|
||||||
@@ -50,6 +52,7 @@ choco install gitea
|
|||||||
```
|
```
|
||||||
|
|
||||||
Or follow the [deployment from binary]({{< relref "from-binary.en-us.md" >}}) guide.
|
Or follow the [deployment from binary]({{< relref "from-binary.en-us.md" >}}) guide.
|
||||||
|
|
||||||
## macOS
|
## macOS
|
||||||
|
|
||||||
Currently, the only supported method of installation on MacOS is [Homebrew](http://brew.sh/).
|
Currently, the only supported method of installation on MacOS is [Homebrew](http://brew.sh/).
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2016-12-01T16:00:00+02:00"
|
|||||||
title: "Installation depuis le gestionnaire de paquets"
|
title: "Installation depuis le gestionnaire de paquets"
|
||||||
slug: "install-from-package"
|
slug: "install-from-package"
|
||||||
weight: 10
|
weight: 10
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2016-12-01T16:00:00+02:00"
|
|||||||
title: "选择包安装"
|
title: "选择包安装"
|
||||||
slug: "install-from-package"
|
slug: "install-from-package"
|
||||||
weight: 10
|
weight: 10
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2016-12-01T16:00:00+02:00"
|
|||||||
title: "套件安裝"
|
title: "套件安裝"
|
||||||
slug: "install-from-package"
|
slug: "install-from-package"
|
||||||
weight: 10
|
weight: 10
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2016-12-01T16:00:00+02:00"
|
|||||||
title: "Installation from source"
|
title: "Installation from source"
|
||||||
slug: "install-from-source"
|
slug: "install-from-source"
|
||||||
weight: 10
|
weight: 10
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
@@ -36,6 +36,8 @@ obtain the same version as our continuous integration, see the advice given in
|
|||||||
<a href='{{< relref "doc/developers/hacking-on-gitea.en-us.md" >}}'>Hacking on
|
<a href='{{< relref "doc/developers/hacking-on-gitea.en-us.md" >}}'>Hacking on
|
||||||
Gitea</a>
|
Gitea</a>
|
||||||
|
|
||||||
|
**Table of Contents**
|
||||||
|
|
||||||
{{< toc >}}
|
{{< toc >}}
|
||||||
|
|
||||||
## Download
|
## Download
|
||||||
@@ -92,11 +94,11 @@ are provided to keep the build process as simple as possible.
|
|||||||
|
|
||||||
Depending on requirements, the following build tags can be included.
|
Depending on requirements, the following build tags can be included.
|
||||||
|
|
||||||
* `bindata`: Build a single monolithic binary, with all assets included.
|
- `bindata`: Build a single monolithic binary, with all assets included.
|
||||||
* `sqlite sqlite_unlock_notify`: Enable support for a
|
- `sqlite sqlite_unlock_notify`: Enable support for a
|
||||||
[SQLite3](https://sqlite.org/) database. Suggested only for tiny
|
[SQLite3](https://sqlite.org/) database. Suggested only for tiny
|
||||||
installations.
|
installations.
|
||||||
* `pam`: Enable support for PAM (Linux Pluggable Authentication Modules). Can
|
- `pam`: Enable support for PAM (Linux Pluggable Authentication Modules). Can
|
||||||
be used to authenticate local users or extend authentication to methods
|
be used to authenticate local users or extend authentication to methods
|
||||||
available to PAM.
|
available to PAM.
|
||||||
|
|
||||||
@@ -153,11 +155,11 @@ One option is to use a script file to shadow the `gitea` binary and create an ap
|
|||||||
environment before running Gitea. However, when building you can change these defaults
|
environment before running Gitea. However, when building you can change these defaults
|
||||||
using the `LDFLAGS` environment variable for `make`. The appropriate settings are as follows
|
using the `LDFLAGS` environment variable for `make`. The appropriate settings are as follows
|
||||||
|
|
||||||
* To set the `CustomPath` use `LDFLAGS="-X \"code.gitea.io/gitea/modules/setting.CustomPath=custom-path\""`
|
- To set the `CustomPath` use `LDFLAGS="-X \"code.gitea.io/gitea/modules/setting.CustomPath=custom-path\""`
|
||||||
* For `CustomConf` you should use `-X \"code.gitea.io/gitea/modules/setting.CustomConf=conf.ini\"`
|
- For `CustomConf` you should use `-X \"code.gitea.io/gitea/modules/setting.CustomConf=conf.ini\"`
|
||||||
* For `AppWorkPath` you should use `-X \"code.gitea.io/gitea/modules/setting.AppWorkPath=working-path\"`
|
- For `AppWorkPath` you should use `-X \"code.gitea.io/gitea/modules/setting.AppWorkPath=working-path\"`
|
||||||
* For `StaticRootPath` you should use `-X \"code.gitea.io/gitea/modules/setting.StaticRootPath=static-root-path\"`
|
- For `StaticRootPath` you should use `-X \"code.gitea.io/gitea/modules/setting.StaticRootPath=static-root-path\"`
|
||||||
* To change the default PID file location use `-X \"code.gitea.io/gitea/modules/setting.PIDFile=/run/gitea.pid\"`
|
- To change the default PID file location use `-X \"code.gitea.io/gitea/modules/setting.PIDFile=/run/gitea.pid\"`
|
||||||
|
|
||||||
Add as many of the strings with their preceding `-X` to the `LDFLAGS` variable and run `make build`
|
Add as many of the strings with their preceding `-X` to the `LDFLAGS` variable and run `make build`
|
||||||
with the appropriate `TAGS` as above.
|
with the appropriate `TAGS` as above.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2017-08-23T09:00:00+02:00"
|
|||||||
title: "Installation depuis le code source"
|
title: "Installation depuis le code source"
|
||||||
slug: "install-from-source"
|
slug: "install-from-source"
|
||||||
weight: 10
|
weight: 10
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2016-12-01T16:00:00+02:00"
|
|||||||
title: "从源代码安装"
|
title: "从源代码安装"
|
||||||
slug: "install-from-source"
|
slug: "install-from-source"
|
||||||
weight: 10
|
weight: 10
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2016-12-01T16:00:00+02:00"
|
|||||||
title: "原始碼安裝"
|
title: "原始碼安裝"
|
||||||
slug: "install-from-source"
|
slug: "install-from-source"
|
||||||
weight: 10
|
weight: 10
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ date: "2020-03-19T19:27:00+02:00"
|
|||||||
title: "Install on Kubernetes"
|
title: "Install on Kubernetes"
|
||||||
slug: "install-on-kubernetes"
|
slug: "install-on-kubernetes"
|
||||||
weight: 10
|
weight: 10
|
||||||
toc: true
|
toc: false
|
||||||
draft: false
|
draft: false
|
||||||
menu:
|
menu:
|
||||||
sidebar:
|
sidebar:
|
||||||
|
|||||||
Loaded 50 of 86 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user