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

Automatic TLS #12

Closed
DoctorRyner opened this issue Apr 1, 2025 · 4 comments
Closed

Automatic TLS #12

DoctorRyner opened this issue Apr 1, 2025 · 4 comments
Labels
question Further information is requested

Comments

@DoctorRyner
Copy link

How about a truly automatic TLS? Like in Caddy. The reason why I daily drive Caddy is it's simplicity, you can start with your application with just ~3 lines in your config and you don't even really need to think about SSL

@DorianNiemiecSVRJS
Copy link
Member

Currently, automatic TLS in Ferron needs to be explicitly enabled to use it. Also, HTTPS needs to be explicitly enabled to use it.

This is what example configuration for automatic TLS (copied from Ferron's documentation) currently looks like:

global:
  secure: true
  enableHTTP2: true # Enable HTTP/2 for improved performance
  enableAutomaticTLS: true
  automaticTLSContactEmail: "[email protected]" # Replace "[email protected]" with actual email address
  automaticTLSContactCacheDirectory: "/path/to/letsencrypt-cache" # Replace "/path/to/letsencrypt-cache" with actual cache directory. Optional property, but recommended
  automaticTLSLetsEncryptProduction: true

hosts:
  - domain: "example.com" # Replace "example.com" with your website's domain name
    wwwroot: "/var/www/html"

You can read the reference at https://www.ferronweb.org/docs/automatic-tls/.

@DoctorRyner
Copy link
Author

@DorianNiemiecSVRJS thanks, yes I read the docs :)

I was just wondering about doing more out of the box for the user

@DorianNiemiecSVRJS DorianNiemiecSVRJS added the question Further information is requested label Apr 1, 2025
@DorianNiemiecSVRJS
Copy link
Member

DorianNiemiecSVRJS commented Apr 1, 2025

The minimal Ferron configuration for automatic TLS (without specifying additional parameters for it) would look like this:

global:
  secure: true # Enable HTTPS
  enableAutomaticTLS: true # Enable automatic TLS, without any email notifications or cache

hosts:
  - domain: "example.com" # Replace "example.com" with your website's domain name
    wwwroot: "/var/www/html"

The equivalent Caddyfile would look like this:

# HTTPS and automatic TLS are both enabled by default in Caddy
# Replace "example.com" with your website's domain name
example.com {
  root * /var/www/html
  encode gzip zstd # Enable HTTP compression
  file_server # Serve static files
}

@DoctorRyner
Copy link
Author

@DorianNiemiecSVRJS okay, maybe it's good enough, thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants