-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Integrate Let's Encrypt with Gitea #1167
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
Comments
I think most people are using Gitea anyway behind a revers proxy. But with |
This was just updated and looks interesting for let's encrypt integration: |
Even without the latest change it have been damn easy to integrate |
It is extremely easy when using something like nginx as a proxy in front of gitea
|
There are still enough people that don't use a reverse proxy in front of the application. The autocert lib makes it damn easy to integrate. We are using traefik in front of our services |
@plessbd how is that easier than a single flag in gitea config saying "use letsencrypt"? |
Beside the let's encrypt integration itself we should also add an automated redirect to https like mentioned at harness/harness#1921 (comment) |
@tboerger I try the solution from harness/harness#1921 (comment) it can't work for me. see the source: https://github.com/go-training/training/blob/master/example10-simple-http-server/server/server07.go package main
import (
"log"
"net/http"
"github.com/gin-gonic/gin"
"golang.org/x/crypto/acme/autocert"
"golang.org/x/sync/errgroup"
)
func main() {
r := gin.Default()
// Ping handler
r.GET("/ping", func(c *gin.Context) {
c.String(200, "pong")
})
var g errgroup.Group
g.Go(func() error {
return http.ListenAndServe(":http", http.RedirectHandler("https://example.com", 303))
})
g.Go(func() error {
return http.Serve(autocert.NewListener("example.com"), r)
})
if err := g.Wait(); err != nil {
log.Fatal(err)
}
} |
@ptman Guess it depends on setup. Personally I think a lets encrypt library is just adding dependencies to something that doesn't need it. Isolation of responsibilities and all. All lets encrypt does is give you a certificate, all gitea should do in my opinion is let you specify an ssl cert and use it. |
We did have |
@bkcsoft great idea and we could use a new command name, for example |
No need for a new command IMO. There should be a background worker to check the cert every X interval and update is necessary |
+1 for this being built in; I'd rather not have to set up nginx if the only service my cheap VPS is running is gitea. Would much rather gitea be the only service running. |
@bkcsoft no background worker required, the autocert lib handles everything automatically. This is also used within drone and some of my projects. |
Yeah, the hardest part of setting up Lets Encrypt with a single service like this is setting up the way for LE to verify the domain is yours. |
The mentioned autocert lib handles that, it just doesn't support the DNS retrieval. |
Any update on this? As @tboerger is pointing out, this should be a ~5 LOC change to read a new config option and use the |
@egtann I've created a pull for this. It's a couple more than 5 LOC, but if reviewed successfully then perhaps it could be in 1.6 release 🤞 |
It would be useful and encourage more people to use SSL if there is built in support for let's Encrypt.
The text was updated successfully, but these errors were encountered: