gitea-install/README.md

63 lines
2.9 KiB
Markdown
Raw Permalink Normal View History

2024-02-23 09:28:32 +01:00
## Gitea install script for a single instance of Gitea for Ubuntu 22.04 server
### Prerequisites
An Ubuntu 22.04 server with Nginx and MariaDB.\
Nginx can be installed from
[\[Here\]](https://git.x-files.dk/ubuntu-server-apps/nginx-install)
and MariaDB can be install from
[\[Here\]](https://git.x-files.dk/ubuntu-server-apps/mariadb-install)
> **NOTE**
>
> If you in the future plan to install a second or third instance of Gitea I would recomend using the Gitea multiple instance script from
[\[Here\]](https://git.x-files.dk/ubuntu-server-apps/gitea-multi-install)
### Download the script
```
git clone https://git.x-files.dk/ubuntu-server-apps/gitea-install.git
```
### Usage
cd gitea-install
sudo ./giteainstall [-n] <domain name> [-p] <gitea database password>
### Example
sudo ./giteainstall -n git.something.xyz -p giteadatabasepwd
This will create a Gitea site running on port 80 with the domain name you chose under the installation.
Don't worry though this can easily be fixed by modifying the Nginx configuration later.
If you need an example on how to configure Nginx to run this on port 443 I an example
[\[Here\]](https://git.x-files.dk/ubuntu-server-files/nginx-config-examples/src/branch/main/gitea.443.conf). Also make sure that you correct the /etc/gitea/app.ini to reflect the changes as well i.e change http to https in the app.ini file and then restart Nginx and the Gitea instance.
### Configuration
Once the script is done browse to http://<i></i>git.something.xyz and fill out the mandatory fields marked with green.
<p align="center" width="100%">
<img src="https://git.x-files.dk/assets/gitea-configuration.png" alt="Gitea Configuration"/>
</p>
### Post install
This is needed in order to change a few configurations in app.ini which is first created when you are done with the setup screen.
cd gitea-install
sudo ./postinstall
### Custom layout
Gitea takes the favicon in form of a svg file and a png file as fallback for browsers that does not support it. A custom logo can also be used. For all 3 files goes the following. They need to be placed in the folowing directory:\
\/var\/lib\/gitea\/custom\/public\/assets\/img\/
Gitea can also serve a splash page instead of the build in one you will need to create a home.tmpl and place it in the following directory:\
\/var\/lib\/gitea\/custom\/templates\/
### Troubleshooting
Most issues will probably be caused by the fact that we all set up and configure Nginx diffrently. If you encounter problems I would suggest you look at the Nginx configuration I use
[\[Here\]](https://git.x-files.dk/ubuntu-server-apps/nginx-install/src/branch/main/cfg/nginx.conf)
and also the default "sites-enabled" Nginx configurarion I use
[\[Here\]](https://git.x-files.dk/ubuntu-server-apps/nginx-install/src/branch/main/cfg/default)
when you start troubleshooting.
### More guides
More guides can be found on [\[wiki.xfiles.dk\]](https://wiki.x-files.dk)
### Last tested
January 12th 2024 on Ubuntu 22.04.