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

Gitea setup using HTTPS #4094

Closed
Mauladen opened this issue Jun 1, 2018 · 6 comments · Fixed by #4101
Closed

Gitea setup using HTTPS #4094

Mauladen opened this issue Jun 1, 2018 · 6 comments · Fixed by #4101
Labels
type/docs This PR mainly updates/creates documentation type/question Issue needs no code to be fixed, only a description on how to fix it yourself.
Milestone

Comments

@Mauladen
Copy link

Mauladen commented Jun 1, 2018

To force Gitea to use HTTPS I had to use Google as such an item I did not see in the documentation, it can be there and you will tell me where it is, and so I think it needs to be created

@techknowlogick techknowlogick added the type/question Issue needs no code to be fixed, only a description on how to fix it yourself. label Jun 1, 2018
@techknowlogick
Copy link
Member

Hi @Mauladen,

This feature was added in #3262, the two config options you'll need are REDIRECT_OTHER_PORT and PORT_TO_REDIRECT. You can read more about the options here: https://docs.gitea.io/en-us/config-cheat-sheet/

I'll leave this issue open for the next bit of time in case you need any additional help.

Thanks,
@techknowlogick

@Mauladen
Copy link
Author

Mauladen commented Jun 1, 2018

@techknowlogick

#968
gogs/gogs#235

I made as here

@techknowlogick
Copy link
Member

techknowlogick commented Jun 2, 2018

Ah I'm sorry I mis-understood the question. I thought you already had HTTPS and were trying to have the redirect happen.

If you want Gitea to run HTTPS without a reverse proxy (nginx, apache, caddy, etc..), you will need a certificate, and a private key. Gitea can generate self-signed versions of these files with a command line call gitea cert -host=git.example.com, this will output to cert.pem and key.pem in the current directory and will overwrite any existing files.

Next in your configuration you'll need to add a path to the files in your configuration

[server]
PROTOCOL=https
ROOT_URL = `https://git.example.com:3000/`
HTTP_PORT = 3000
CERT_FILE = path/to/cert.pem
KEY_FILE = path/to/key.pem

@Mauladen
Copy link
Author

Mauladen commented Jun 2, 2018

Yes, I did, but that's not the point, you need to add it to the documentation

@techknowlogick techknowlogick added the type/docs This PR mainly updates/creates documentation label Jun 2, 2018
@lafriks
Copy link
Member

lafriks commented Jun 2, 2018

@Mauladen feel free to submit PR for docs, we really need help on that

@ghost
Copy link

ghost commented Jun 2, 2018

I had the same question, have not tried again yet though

so seems like running gitea cert --host [HOST] instead of openssl req -newkey rsa:2048 -new -nodes -keyout key.pem -out cert.pem is the key to get this working ?

@lunny lunny added this to the 1.5.0 milestone Jun 3, 2018
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/docs This PR mainly updates/creates documentation type/question Issue needs no code to be fixed, only a description on how to fix it yourself.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants