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

Add env variable ADD_TEMPLATE & set LOG_FORMAT to json be default #295

Merged
merged 1 commit into from
Jul 6, 2024

Conversation

tarampampam
Copy link
Owner

Description

Fixes #294

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 changed the title Add env variable ADD_TEMPLATE Add env variable ADD_TEMPLATE & set LOG_FORMAT to json be default Jul 6, 2024
@tarampampam tarampampam self-assigned this Jul 6, 2024
@tarampampam tarampampam added the type:feature New feature label Jul 6, 2024
@tarampampam tarampampam marked this pull request as ready for review July 6, 2024 10:01
@tarampampam tarampampam merged commit c159914 into master Jul 6, 2024
11 checks passed
@tarampampam tarampampam deleted the add-template-env branch July 6, 2024 10:01
spiceratops referenced this pull request in spiceratops/k8s-gitops Jul 6, 2024
…839)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[ghcr.io/tarampampam/error-pages](https://togithub.com/tarampampam/error-pages)
| major | `2.27.0` -> `3.2.0` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>tarampampam/error-pages
(ghcr.io/tarampampam/error-pages)</summary>

###
[`v3.2.0`](https://togithub.com/tarampampam/error-pages/releases/tag/v3.2.0)

[Compare
Source](https://togithub.com/tarampampam/error-pages/compare/v3.1.0...v3.2.0)

<!-- Release notes generated using configuration in .github/release.yml
at master -->

#### What's Changed

##### 🚀 Features

- Added support for the environment variable `ADD_TEMPLATE` (replacing
the `--add-template` flag)
([https://github.com/tarampampam/error-pages/pull/295](https://togithub.com/tarampampam/error-pages/pull/295))
- Set the log format to `json` by default in the Docker image
([https://github.com/tarampampam/error-pages/pull/295](https://togithub.com/tarampampam/error-pages/pull/295))

**Full Changelog**:
tarampampam/error-pages@v3.1.0...v3.2.0

###
[`v3.1.0`](https://togithub.com/tarampampam/error-pages/releases/tag/v3.1.0)

[Compare
Source](https://togithub.com/tarampampam/error-pages/compare/v3.0.1...v3.1.0)

<!-- Release notes generated using configuration in .github/release.yml
at master -->

#### What's Changed

##### 🚀 Features

- Added HTML/CSS/JS minification on the fly in
[https://github.com/tarampampam/error-pages/pull/293](https://togithub.com/tarampampam/error-pages/pull/293)
(the HTML output size was reduced by ~25%, with performance decreasing
by ~4% - from 196k RPS to 188k)

Before | After
\---|---

![image](https://togithub.com/tarampampam/error-pages/assets/7326800/c2e2bc2b-ebe9-4ef1-975a-28feda607a78)
|
![image](https://togithub.com/tarampampam/error-pages/assets/7326800/b17d52dd-cabb-48aa-a56d-3c2110768ae9)

**Full Changelog**:
tarampampam/error-pages@v3.0.1...v3.1.0

###
[`v3.0.1`](https://togithub.com/tarampampam/error-pages/releases/tag/v3.0.1)

[Compare
Source](https://togithub.com/tarampampam/error-pages/compare/v3.0.0...v3.0.1)

<!-- Release notes generated using configuration in .github/release.yml
at master -->

#### What's Changed

##### 🛠 Fixes

- Forgot to include the SSL certificates in the Docker image in
[https://github.com/tarampampam/error-pages/pull/292](https://togithub.com/tarampampam/error-pages/pull/292)

**Full Changelog**:
tarampampam/error-pages@v3.0.0...v3.0.1

###
[`v3.0.0`](https://togithub.com/tarampampam/error-pages/releases/tag/v3.0.0)

[Compare
Source](https://togithub.com/tarampampam/error-pages/compare/v2.27.0...v3.0.0)

#### What's Changed

> \[!WARNING]
> This is a major update! Please read the notes below and a
[readme](https://togithub.com/tarampampam/error-pages#readme) file to
identify what changes you need to make to your current charts for the
upgrade.

##### 🚀 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`)

**Full Changelog**:
tarampampam/error-pages@v2.27.0...v3.0.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjQuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQyNC4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL21ham9yIl19-->
coolguy1771 referenced this pull request in coolguy1771/home-ops Jul 20, 2024
….2.0 ) (#5004)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[ghcr.io/tarampampam/error-pages](https://togithub.com/tarampampam/error-pages)
| major | `2.27.0` -> `3.2.0` |

---

### Release Notes

<details>
<summary>tarampampam/error-pages
(ghcr.io/tarampampam/error-pages)</summary>

###
[`v3.2.0`](https://togithub.com/tarampampam/error-pages/releases/tag/v3.2.0)

[Compare
Source](https://togithub.com/tarampampam/error-pages/compare/v3.1.0...v3.2.0)

<!-- Release notes generated using configuration in .github/release.yml
at master -->

#### What's Changed

##### 🚀 Features

- Added support for the environment variable `ADD_TEMPLATE` (replacing
the `--add-template` flag)
([https://github.com/tarampampam/error-pages/pull/295](https://togithub.com/tarampampam/error-pages/pull/295))
- Set the log format to `json` by default in the Docker image
([https://github.com/tarampampam/error-pages/pull/295](https://togithub.com/tarampampam/error-pages/pull/295))

**Full Changelog**:
tarampampam/error-pages@v3.1.0...v3.2.0

###
[`v3.1.0`](https://togithub.com/tarampampam/error-pages/releases/tag/v3.1.0)

[Compare
Source](https://togithub.com/tarampampam/error-pages/compare/v3.0.1...v3.1.0)

<!-- Release notes generated using configuration in .github/release.yml
at master -->

#### What's Changed

##### 🚀 Features

- Added HTML/CSS/JS minification on the fly in
[https://github.com/tarampampam/error-pages/pull/293](https://togithub.com/tarampampam/error-pages/pull/293)
(the HTML output size was reduced by ~25%, with performance decreasing
by ~4% - from 196k RPS to 188k)

Before | After
\---|---

![image](https://togithub.com/tarampampam/error-pages/assets/7326800/c2e2bc2b-ebe9-4ef1-975a-28feda607a78)
|
![image](https://togithub.com/tarampampam/error-pages/assets/7326800/b17d52dd-cabb-48aa-a56d-3c2110768ae9)

**Full Changelog**:
tarampampam/error-pages@v3.0.1...v3.1.0

###
[`v3.0.1`](https://togithub.com/tarampampam/error-pages/releases/tag/v3.0.1)

[Compare
Source](https://togithub.com/tarampampam/error-pages/compare/v3.0.0...v3.0.1)

<!-- Release notes generated using configuration in .github/release.yml
at master -->

#### What's Changed

##### 🛠 Fixes

- Forgot to include the SSL certificates in the Docker image in
[https://github.com/tarampampam/error-pages/pull/292](https://togithub.com/tarampampam/error-pages/pull/292)

**Full Changelog**:
tarampampam/error-pages@v3.0.0...v3.0.1

###
[`v3.0.0`](https://togithub.com/tarampampam/error-pages/releases/tag/v3.0.0)

[Compare
Source](https://togithub.com/tarampampam/error-pages/compare/v2.27.0...v3.0.0)

#### What's Changed

> \[!WARNING]
> This is a major update! Please read the notes below and a
[readme](https://togithub.com/tarampampam/error-pages#readme) file to
identify what changes you need to make to your current charts for the
upgrade.

##### 🚀 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`)

**Full Changelog**:
tarampampam/error-pages@v2.27.0...v3.0.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjQuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQyNC4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL21ham9yIl19-->

Co-authored-by: lumiere-bot[bot] <98047013+lumiere-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ADD_TEMPLATE env var
1 participant