QUESTIONS
How can I use https with gitea?
Can I serve https with the server?
How do I secure the connection of the gitea server?
LINKS What is Gitea HTTP SeupLogin
Login on the remote server via sshyou@local:$ssh root@{server-adress}
Or if you use a custom key:
you@local:$ssh-i{fullpath/to/private/key} root@{server-adress} Change User root@server:$su{gitea-user} Create Certificate
Create a directory where you want to save the certificates for https.
{gitea-user}@server:$mkdir{path/for/https}
Enter the directory
{gitea-user}@server:$cd{path/for/https}
Create certificates with your address.
{gitea-user}@server:{path/for/https}$giteacert--host{your-host-address}
Remember the path for the certificates, once for key.pem, it is the same for cert.pem.
{gitea-user}@server:{path/for/https}$realpathkey.pem{/complete/path/for/https/key.pem} Exit User {gitea-user}@server:{path/for/https}$exitroot@server:$ Find App.ini
You need to change gitea's app.ini-file, so search for the location of the file.
root@server:$find-nameapp.ini
This should output something like this:
etc/gitea/app.ini Edit App.ini
Open the text editor "nano" to edit the file.
root@server:$nano{path/to/app.ini}
PROTOCOL = https
ROOT_URL = https://git.example.com:3000/
HTTP_PORT = 3000
CERT_FILE = {/complete/path/for/https/cert.pem}
KEY_FILE = {/complete/path/for/https/key.pem}
Save by pressing CTRL + X and afterward ENTER.
Restart Gitea
If you are using gitea as service, you can restart it with:
root@server:$systemctlrestartgitea
To check if everything is right, call:
root@server:$systemctlstatusgiteaAPP | VERSION gitea 1.19 | git 2.39 | Linux/Ubuntu 22
RELATED TAGS gitea, git, create repository
QUESTIONS
How can I use https with gitea?
Can I serve https with the server?
How do I secure the connection of the gitea server?