Skip to content

Commit 4b7237b

Browse files
jolheiserlunny
authored andcommitted
Doc updates for customization and installation. (#6176)
* Doc updates and changing default sqlite DB path Signed-off-by: jolheiser <[email protected]> * Update customizing locales and THEMES Signed-off-by: jolheiser <[email protected]> * Add link to templates directory Signed-off-by: jolheiser <[email protected]> * Add portion for final step of running Gitea Signed-off-by: jolheiser <[email protected]> * Add recommended to service file usage Signed-off-by: jolheiser <[email protected]> * Removed DB path change, moving to another PR Updated doc sentence structure Signed-off-by: jolheiser <[email protected]> * Revert change to template wording Signed-off-by: jolheiser <[email protected]> * Move recommended run-type to top
1 parent 1cf3fc3 commit 4b7237b

File tree

2 files changed

+62
-6
lines changed

2 files changed

+62
-6
lines changed

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

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Place the png image at the following path: `custom/public/img/avatar\_default.pn
5555
## Customizing Gitea pages
5656

5757
The `custom/templates` folder allows changing every single page of Gitea. Templates
58-
to override can be found in the `templates` directory of Gitea source. Override by
58+
to override can be found in the [`templates`](https://github.com/go-gitea/gitea/tree/master/templates) directory of Gitea source. Override by
5959
making a copy of the file under `custom/templates` using a full path structure
6060
matching source.
6161

@@ -96,6 +96,42 @@ Google Analytics, Matomo (previously Piwik), and other analytics services can be
9696

9797
Place custom files in corresponding sub-folder under `custom/options`.
9898

99+
**NOTE:** The files should not have a file extension, e.g. `Labels` rather than `Labels.txt`
100+
101+
### gitignores
102+
103+
To add custom .gitignore, add a file with existing [.gitignore rules](https://git-scm.com/docs/gitignore) in it to `custom/options/gitignore`
104+
105+
### Labels
106+
107+
To add a custom label set, add a file that follows the [label format](https://github.com/go-gitea/gitea/blob/master/options/label/Default) to `custom/options/label`
108+
`#hex-color label name ; label description`
109+
110+
### Licenses
111+
112+
To add a custom license, add a file with the license text to `custom/options/license`
113+
114+
### Locales
115+
116+
Locales are managed via our [crowdin](https://crowdin.com/project/gitea).
117+
You can override a locale by placing an altered locale file in `custom/options/locale`.
118+
Gitea's default locale files can be found in the [`options/locale`](https://github.com/go-gitea/gitea/tree/master/options/locale) source folder and these should be used as examples for your changes.
119+
120+
To add a completely new locale, as well as placing the file in the above location, you will need to add the new lang and name to the `[i18n]` section in your `app.ini`. Keep in mind that Gitea will use those settings as **overrides**, so if you want to keep the other languages as well you will need to copy/paste the default values and add your own to them.
121+
122+
```
123+
[i18n]
124+
LANGS = en-US,foo-BAR
125+
NAMES = English,FooBar
126+
```
127+
128+
Locales may change between versions, so keeping track of your customized locales is highly encouraged.
129+
130+
### Readmes
131+
132+
To add a custom Readme, add a markdown formatted file (without an `.md` extension) to `custom/options/readme`
133+
99134
## Customizing the look of Gitea
100135

101-
As of version 1.6.0 Gitea has built-in themes. The two built-in themes are, the default theme `gitea`, and a dark theme `arc-green`. To change the look of your Gitea install change the value of `DEFAULT_THEME` in the [ui](https://docs.gitea.io/en-us/config-cheat-sheet/#ui-ui) section of `app.ini` to another one of the available options.
136+
As of version 1.6.0 Gitea has built-in themes. The two built-in themes are, the default theme `gitea`, and a dark theme `arc-green`. To change the look of your Gitea install change the value of `DEFAULT_THEME` in the [ui](https://docs.gitea.io/en-us/config-cheat-sheet/#ui-ui) section of `app.ini` to another one of the available options.
137+
As of version 1.8.0 Gitea also has per-user themes. The list of themes a user can choose from can be configured with the `THEMES` value in the [ui](https://docs.gitea.io/en-us/config-cheat-sheet/#ui-ui) section of `app.ini` (defaults to `gitea` and `arc-green`, light and dark respectively)

docs/content/doc/installation/from-binary.en-us.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ location. When launched manually, Gitea can be killed using `Ctrl+C`.
4444

4545
## Recommended server configuration
4646

47+
**NOTE:** Many of the following directories can be configured using [Environment Variables]({{< relref "doc/advanced/specific-variables.en-us.md" >}}) as well!
48+
Of note, configuring `GITEA_WORK_DIR` will tell Gitea where to base its working directory, as well as ease installation.
49+
4750
### Prepare environment
4851

4952
Check that git is installed on the server, if it is not install it first.
@@ -66,9 +69,9 @@ adduser \
6669
### Create required directory structure
6770

6871
```sh
69-
mkdir -p /var/lib/gitea/{custom,data,indexers,public,log}
70-
chown git:git /var/lib/gitea/{data,indexers,log}
71-
chmod 750 /var/lib/gitea/{data,indexers,log}
72+
mkdir -p /var/lib/gitea/{custom,data,log}
73+
chown -R git:git /var/lib/gitea/
74+
chmod -R 750 /var/lib/gitea/
7275
mkdir /etc/gitea
7376
chown root:git /etc/gitea
7477
chmod 770 /etc/gitea
@@ -80,16 +83,33 @@ chmod 750 /etc/gitea
8083
chmod 644 /etc/gitea/app.ini
8184
```
8285

86+
### Configure Gitea's working directory
87+
88+
**NOTE:** If you plan on running Gitea as a Linux service, you can skip this step as the service file allows you to set `WorkingDirectory`. Otherwise, consider setting this environment variable (semi-)permanently so that Gitea consistently uses the correct working directory.
89+
```
90+
export GITEA_WORK_DIR=/var/lib/gitea/
91+
```
92+
8393
### Copy gitea binary to global location
8494

8595
```
8696
cp gitea /usr/local/bin/gitea
8797
```
8898

89-
### Create service file to start gitea automatically
99+
## Running Gitea
100+
101+
After the above steps, two options to run Gitea are:
102+
103+
### 1. Creating a service file to start Gitea automatically (recommended)
90104

91105
See how to create [Linux service]({{< relref "run-as-service-in-ubuntu.en-us.md" >}})
92106

107+
### 2. Running from command-line/terminal
108+
109+
```
110+
GITEA_WORK_DIR=/var/lib/gitea/ /usr/local/bin/gitea web -c /etc/gitea/app.ini
111+
```
112+
93113
## Updating to a new version
94114

95115
You can update to a new version of gitea by stopping gitea, replacing the binary at `/usr/local/bin/gitea` and restarting the instance.

0 commit comments

Comments
 (0)