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

V3 #287

Merged
merged 14 commits into from
Jul 3, 2024
Merged

V3 #287

merged 14 commits into from
Jul 3, 2024

Conversation

tarampampam
Copy link
Owner

@tarampampam tarampampam commented Jun 29, 2024

Description

Whew, there's been a lot of work done, and I'm finding it challenging to describe all the changes made while working on v3.

Added

  • You can override the default XML, JSON, or PlainText response formats using the flags --xml-format, --json-format, or --plaintext-format respectively (or their environment variables)
  • Support for any HTTP request method to get the error page (previously limited to the GET method only)
  • The CLI flag --send-same-http-code to respond with the same HTTP code as the requested error page code
  • The CLI flag --disable-template to disable certain templates (useful when using automatic template rotation to exclude some from the available templates list)
  • Ability to define custom HTTP codes using placeholders like 4**. Refer to the documentation for more information about --add-http-code

Changed

  • Users can provide custom templates (themes) using the flag --add-template
  • Templates are now built into the binary file
  • To change the template automatically, use the new flag --rotation-mode instead of the previous "magic" template names like i-said-random or random-hourly
  • Error pages can now be accessed using the following URLs: /{code}, /{code}.html, and /{code}.htm
  • The default content type is now PlainText. This means that when you curl an error page, you will receive more readable content without tons of HTML tags
  • Merged the l7-dark and l7-light templates (themes) into a single l7 theme
  • Templates no longer download resources from external sources; everything is now embedded, including the localization script, which is now inlined into the page. Custom fonts have also been removed
  • The default value for --proxy-headers is now X-Request-Id,X-Trace-Id,X-Amzn-Trace-Id
  • CLI flags and environment variables are now well documented, and the readme file automatically syncs with them
  • The default logs level is warn for Docker image (due to performance reasons), set it to info to get the access logs, if you need

Removed

  • Configuration file is no longer needed or used. Everything is now managed using CLI flags and environment variables (the --config-file flag was removed)
  • The matrix template (theme)
  • The /metrics endpoint
  • The --default-http-code flag (+ env variable DEFAULT_HTTP_CODE)
  • The --catch-all flag (+env variable CATCH_ALL)

Closes #156 #176 #219 #274 #285

Checklist

  • My code adheres to the style guidelines of this project
  • I have conducted a self-review of my code
  • I have added comments to my code, especially in areas that may be difficult to understand
  • I have written unit tests for my code (if tests are required for my changes)

@tarampampam tarampampam marked this pull request as ready for review July 3, 2024 13:43
@tarampampam tarampampam self-assigned this Jul 3, 2024
@tarampampam tarampampam merged commit 6b3be0d into master Jul 3, 2024
11 checks passed
@tarampampam tarampampam deleted the v3 branch July 3, 2024 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can we add the possibility of inline translation using Accept-Language header?
2 participants