Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SNAP Installation instructions #17040

Closed
wants to merge 15 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 61 additions & 2 deletions docs/content/doc/installation/from-package.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,68 @@ pacman -S gitea

There is a [Gitea Snap](https://snapcraft.io/gitea) package which follows the latest stable version.

### This guide was tested with Ubuntu 20.04 and MariaDB:

* Install needed packages:

```sh
sudo snap install gitea
sudo apt install nginx mariadb-server
```
* Improve the security of your MariaDB Installation

``sh
snap install gitea
``
sudo mysql_secure_installation``
More information can be found on this website: https://mariadb.com/kb/en/mysql_secure_installation/

* Create your database and database user:

```sql
sudo mysql -u root -p
CREATE DATABASE gitea;
GRANT ALL PRIVILEGES ON gitea.* TO 'gitea'@'localhost' IDENTIFIED BY 'the same password for gitea config';
FLUSH PRIVILEGES;
QUIT;
```
Detailed information about Database preperation can be found by following this link: https://docs.gitea.io/en-us/database-prep/

* Create nginx config to pass traffic to port 3000:

```sh
sudo nano /etc/nginx/conf.d/gitea.conf
```

* The Nginx config should look something like the following code block.
To use `HTTPS`, you should additionally pass a certificate and redirect all traffic to port 443.
The following link covers some information about a secure setup:
https://docs.gitea.io/en-us/https-setup/

This link may help to create a secure nginx configuration: https://ssl-config.mozilla.org/#server=nginx&version=2.4.41&config=intermediate&openssl=1.1.1d&guideline=5.6

For junior users this blogpost may help to get you started with securing your installation with nginx as reverse proxy and certbot for certificate issuing:
https://www.nginx.com/blog/using-free-ssltls-certificates-from-lets-encrypt-with-nginx/


```nginx
server {
listen 80;
server_name gitea.example.com;

location / {
proxy_pass http://localhost:3000;
}
}
```
More information about reverse proxies can be found here:
https://docs.gitea.io/en-us/reverse-proxies/
* Restart nginx
```sh
sudo systemctl restart nginx
```

* Create correct DNS entry on your DNS Server if not done already
* Configure your gitea settings
The config file for the Snap can be found here if you want to make changes later: /var/snap/gitea/common/conf/app.ini

## SUSE and openSUSE

Expand Down