Compare commits

...

55 Commits

Author SHA1 Message Date
8b18d02666 Update CHANGELOG.md 2023-11-20 12:28:22 +04:00
8e7570eee3 fix: "Too big request header" (#244)
* Added environment variable and CLI parameter for adjusting the read buffer size

* Changed readBufferSize to int and some bugfixing

* Small fixes

* ci: 👷 CI system updated

* ci: 👷 CI system updated

---------

Co-authored-by: Paramtamtam <7326800+tarampampam@users.noreply.github.com>
2023-11-20 12:27:40 +04:00
2c8ba9c0f3 build(deps): bump github.com/prometheus/client_model (#241) 2023-11-02 05:14:07 +00:00
1ab0973011 build(deps): bump github.com/fasthttp/router from 1.4.20 to 1.4.21 (#242) 2023-11-02 05:13:41 +00:00
540139db3a chore(deps): update golangci/golangci-lint docker tag to v1.55 (#239)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-02 09:13:02 +04:00
ff3d16d294 Merge pull request #243 from tarampampam/dependabot/github_actions/aquasecurity/trivy-action-0.13.1
build(deps): bump aquasecurity/trivy-action from 0.12.0 to 0.13.1
2023-11-01 22:55:13 +00:00
ebbded51bf build(deps): bump aquasecurity/trivy-action from 0.12.0 to 0.13.1
Bumps [aquasecurity/trivy-action](https://github.com/aquasecurity/trivy-action) from 0.12.0 to 0.13.1.
- [Release notes](https://github.com/aquasecurity/trivy-action/releases)
- [Commits](https://github.com/aquasecurity/trivy-action/compare/0.12.0...0.13.1)

---
updated-dependencies:
- dependency-name: aquasecurity/trivy-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-01 22:54:59 +00:00
384e45ce7f Merge pull request #240 from tarampampam/dependabot/go_modules/go.uber.org/goleak-1.3.0
build(deps): bump go.uber.org/goleak from 1.2.1 to 1.3.0
2023-11-01 22:19:14 +00:00
cdac8665de build(deps): bump go.uber.org/goleak from 1.2.1 to 1.3.0
Bumps [go.uber.org/goleak](https://github.com/uber-go/goleak) from 1.2.1 to 1.3.0.
- [Release notes](https://github.com/uber-go/goleak/releases)
- [Changelog](https://github.com/uber-go/goleak/blob/master/CHANGELOG.md)
- [Commits](https://github.com/uber-go/goleak/compare/v1.2.1...v1.3.0)

---
updated-dependencies:
- dependency-name: go.uber.org/goleak
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-01 22:18:58 +00:00
fac512bd74 Fix spanish translated tags (#237) 2023-10-10 15:10:11 +04:00
ea85191d9e build(deps): bump actions/checkout from 3 to 4 (#232) 2023-10-09 12:46:36 +00:00
38ce1f9cf3 build(deps): bump docker/build-push-action from 4 to 5 (#234) 2023-10-09 12:46:25 +00:00
9e4a1451f5 build(deps): bump docker/setup-qemu-action from 2 to 3 (#235) 2023-10-09 12:42:41 +00:00
9feca1f509 Update dependabot.yml 2023-10-05 11:15:01 +04:00
38bf4abc1e Update dependabot.yml 2023-10-02 12:30:56 +04:00
ffc2af1c27 Update dependabot.yml 2023-10-02 11:35:41 +04:00
763c4ad109 build(deps): bump github.com/valyala/fasthttp from 1.49.0 to 1.50.0 (#227) 2023-10-02 07:07:00 +00:00
dcfd8ab3a7 build(deps): bump go.uber.org/zap from 1.25.0 to 1.26.0 (#229) 2023-10-02 06:54:19 +00:00
62f309cefd build(deps): bump docker/login-action from 2 to 3 (#233) 2023-10-02 06:53:40 +00:00
b5504de6d8 build(deps): bump github.com/prometheus/client_golang (#228) 2023-10-02 06:49:50 +00:00
4d91e17273 build(deps): bump aquasecurity/trivy-action from 0.11.2 to 0.12.0 (#230) 2023-10-02 06:49:03 +00:00
86e182c25d build(deps): bump docker/setup-buildx-action from 2 to 3 (#231) 2023-10-02 06:48:39 +00:00
8006cce4b0 Polish translation added. (#226)
* Polish translation added.

* Update CHANGELOG.md

* Update CHANGELOG.md

---------

Co-authored-by: Pаramtamtām <7326800+tarampampam@users.noreply.github.com>
2023-09-28 10:51:55 +04:00
caf4e33193 Update l10n.js (#225) 2023-09-24 21:11:49 -07:00
7ab0fa6f23 chore: The docker environment is refactored 2023-09-03 20:17:07 +04:00
81570b42c0 chore: The docker environment is refactored 2023-09-03 20:16:50 +04:00
4c3ebc055d Update CHANGELOG.md 2023-09-02 07:17:47 -07:00
61c1958717 build(deps): bump golang from 1.20-alpine to 1.21-alpine (#222)
* build(deps): bump golang from 1.20-alpine to 1.21-alpine

Bumps golang from 1.20-alpine to 1.21-alpine.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* wip: 🔕 temporary commit

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Paramtamtam <7326800+tarampampam@users.noreply.github.com>
2023-09-02 07:17:15 -07:00
3ab1a23ac5 Create dependabot.yml 2023-09-02 06:46:02 -07:00
a81c780e1e build(deps): bump go.uber.org/zap from 1.24.0 to 1.25.0 (#221) 2023-09-02 12:59:52 +00:00
2baeb2eb5b build(deps): bump github.com/valyala/fasthttp from 1.48.0 to 1.49.0 (#220) 2023-09-02 12:54:58 +00:00
e6b011b41b Add Indonesian translation (#218)
* Add Indonesian

Add all strings in bahasa indonesia.

* Update README.md

Add Indonesian flag emoji

* Add Indonesian language credit

* Update CHANGELOG.md (add 🇮🇩  language)

* Update l10n/l10n.js

---------

Co-authored-by: Pаramtamtām <7326800+tarampampam@users.noreply.github.com>
2023-09-01 10:25:17 +04:00
308467006b Add CatchAll functionality (#217)
* Add CatchAll functionality

* Added link to PR to changelog
2023-09-01 10:17:11 +04:00
ecf1359336 chore(deps): update golangci/golangci-lint docker tag to v1.54 (#215)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-09 21:09:41 +04:00
a12dc4882e build(deps): bump github.com/fasthttp/router from 1.4.19 to 1.4.20 (#213) 2023-08-02 06:39:59 +00:00
980d0a5810 build(deps): bump go.uber.org/automaxprocs from 1.5.2 to 1.5.3 (#214) 2023-08-02 06:38:58 +00:00
eb3d84ee9d Change Ukrainian translation (#211)
* Update l10n.js

* Update l10n.js
2023-07-24 17:16:52 +04:00
6b43057333 build(deps): bump github.com/valyala/fasthttp from 1.47.0 to 1.48.0 (#208) 2023-07-01 23:48:11 +00:00
071ded0eac build(deps): bump github.com/prometheus/client_golang (#210) 2023-07-01 23:47:44 +00:00
47c4338c9e build(deps): bump aquasecurity/trivy-action from 0.10.0 to 0.11.2 (#207) 2023-07-01 23:43:11 +00:00
dfdeea4b6c build(deps): bump github.com/urfave/cli/v2 from 2.25.5 to 2.25.7 (#209) 2023-07-01 23:42:31 +00:00
cbb7936149 chore(deps): update golangci/golangci-lint docker tag to v1.53 (#200)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-04 01:32:57 -07:00
c08e1307e8 build(deps): bump github.com/urfave/cli/v2 from 2.25.3 to 2.25.5 (#201) 2023-06-04 08:29:11 +00:00
25b86a057f build(deps): bump github.com/prometheus/client_model from 0.3.0 to 0.4.0 (#203) 2023-06-04 08:24:31 +00:00
ef72fa405d build(deps): bump github.com/fasthttp/router from 1.4.18 to 1.4.19 (#202) 2023-06-04 08:24:25 +00:00
1eb773fb57 depguard disabled 2023-06-04 01:18:45 -07:00
439b6d0326 build(deps): bump github.com/prometheus/client_golang (#199) 2023-06-02 06:35:01 +00:00
ef0081f711 build(deps): bump github.com/stretchr/testify from 1.8.2 to 1.8.4 (#198) 2023-06-02 06:34:58 +00:00
8c7a24b3d7 build(deps): bump github.com/urfave/cli/v2 from 2.25.1 to 2.25.3 (#197) 2023-05-04 11:20:25 +00:00
c76026c9f1 build(deps): bump github.com/prometheus/client_golang (#196) 2023-05-02 03:46:37 +00:00
37e4ecbf47 build(deps): bump aquasecurity/trivy-action from 0.9.2 to 0.10.0 (#194) 2023-05-02 03:46:24 +00:00
58dc38f72e build(deps): bump github.com/valyala/fasthttp from 1.45.0 to 1.47.0 (#195) 2023-05-02 03:46:09 +00:00
36c5472987 feat: IPv6 support (#192)
* 🐛 fix(server.go): validate IP address before starting server
 feat(server.go): add support for IPv6 addresses

*  feat(cli): add support for IPv6 addresses in the `--listen` flag

* 🐛 fix(server.go): add nolint comment to ignore magic number warning in ipv6 check

* 🐛 fix(server.go): use fmt.Sprintf to format IP and port instead of strconv.Itoa and string concatenation
2023-04-21 16:33:33 +04:00
717542e045 Update README.md 2023-04-18 10:48:55 +04:00
940bd0405f New template orient added (#190)
* added orient theme

* added creation test for orient theme

* Added new Orient theme to CHANGELOG.md

* fix: Template fixed a bit

---------

Co-authored-by: Paramtamtam <7326800+tarampampam@users.noreply.github.com>
2023-04-17 15:06:28 +04:00
22 changed files with 696 additions and 156 deletions

View File

@ -6,17 +6,14 @@ updates:
- package-ecosystem: gomod - package-ecosystem: gomod
directory: / directory: /
schedule: {interval: monthly} schedule: {interval: monthly}
reviewers: [tarampampam]
assignees: [tarampampam] assignees: [tarampampam]
- package-ecosystem: github-actions - package-ecosystem: github-actions
directory: / directory: /
schedule: {interval: monthly} schedule: {interval: monthly}
reviewers: [tarampampam]
assignees: [tarampampam] assignees: [tarampampam]
- package-ecosystem: docker - package-ecosystem: docker
directory: / directory: /
schedule: {interval: monthly} schedule: {interval: monthly}
reviewers: [tarampampam]
assignees: [tarampampam] assignees: [tarampampam]

25
.github/workflows/dependabot.yml vendored Normal file
View File

@ -0,0 +1,25 @@
name: dependabot
on:
pull_request: {}
permissions:
contents: write
pull-requests: write
jobs:
dependabot: # https://tinyurl.com/e69djmen
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- uses: dependabot/fetch-metadata@v1
id: metadata
with: {github-token: "${{ secrets.GITHUB_TOKEN }}"}
- name: Enable auto-merge for Dependabot PRs
if: ${{ contains(fromJSON('["version-update:semver-minor", "version-update:semver-patch"]'), steps.metadata.outputs.update-type) }}
run: gh pr merge --auto --merge "$PR_URL"
continue-on-error: true
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -10,7 +10,7 @@ jobs:
name: Docker Hub Description name: Docker Hub Description
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: peter-evans/dockerhub-description@v3 # Action page: <https://github.com/peter-evans/dockerhub-description> - uses: peter-evans/dockerhub-description@v3 # Action page: <https://github.com/peter-evans/dockerhub-description>
with: with:

View File

@ -26,7 +26,7 @@ jobs:
os: [linux, darwin] # linux, freebsd, darwin, windows os: [linux, darwin] # linux, freebsd, darwin, windows
arch: [amd64] # amd64, 386 arch: [amd64] # amd64, 386
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: gacts/setup-go-with-cache@v1 - uses: gacts/setup-go-with-cache@v1
with: {go-version-file: go.mod} with: {go-version-file: go.mod}
@ -57,26 +57,26 @@ jobs:
name: Build docker image name: Build docker image
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- {uses: gacts/github-slug@v1, id: slug} - {uses: gacts/github-slug@v1, id: slug}
- uses: docker/setup-qemu-action@v2 # Action page: <https://github.com/docker/setup-qemu-action> - uses: docker/setup-qemu-action@v3 # Action page: <https://github.com/docker/setup-qemu-action>
- uses: docker/setup-buildx-action@v2 # Action page: <https://github.com/docker/setup-buildx-action> - uses: docker/setup-buildx-action@v3 # Action page: <https://github.com/docker/setup-buildx-action>
- uses: docker/login-action@v2 # Action page: <https://github.com/docker/login-action> - uses: docker/login-action@v3 # Action page: <https://github.com/docker/login-action>
with: with:
username: ${{ secrets.DOCKER_LOGIN }} username: ${{ secrets.DOCKER_LOGIN }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
- uses: docker/login-action@v2 # Action page: <https://github.com/docker/login-action> - uses: docker/login-action@v3 # Action page: <https://github.com/docker/login-action>
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v4 # Action page: <https://github.com/docker/build-push-action> - uses: docker/build-push-action@v5 # Action page: <https://github.com/docker/build-push-action>
with: with:
context: . context: .
file: Dockerfile file: Dockerfile

View File

@ -17,7 +17,7 @@ jobs: # Docs: <https://git.io/JvxXE>
name: Gitleaks name: Gitleaks
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: {fetch-depth: 0} with: {fetch-depth: 0}
- name: Check for GitLeaks - name: Check for GitLeaks
@ -27,10 +27,10 @@ jobs: # Docs: <https://git.io/JvxXE>
name: Golang-CI (lint) name: Golang-CI (lint)
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: gacts/setup-go-with-cache@v1 - uses: gacts/setup-go-with-cache@v1
with: {go-version: 1.19} with: {go-version-file: go.mod}
- uses: golangci/golangci-lint-action@v3 - uses: golangci/golangci-lint-action@v3
with: {skip-pkg-cache: true, skip-build-cache: true} with: {skip-pkg-cache: true, skip-build-cache: true}
@ -39,7 +39,7 @@ jobs: # Docs: <https://git.io/JvxXE>
name: Validate config file name: Validate config file
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: gacts/setup-node-with-cache@v1 - uses: gacts/setup-node-with-cache@v1
with: {node-version: 16} with: {node-version: 16}
@ -54,7 +54,7 @@ jobs: # Docs: <https://git.io/JvxXE>
name: Lint l10n file(s) name: Lint l10n file(s)
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: gacts/setup-node-with-cache@v1 - uses: gacts/setup-node-with-cache@v1
with: {node-version: 16} with: {node-version: 16}
@ -70,7 +70,7 @@ jobs: # Docs: <https://git.io/JvxXE>
name: Unit tests name: Unit tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: {fetch-depth: 2} # Fixes codecov error 'Issue detecting commit SHA' with: {fetch-depth: 2} # Fixes codecov error 'Issue detecting commit SHA'
- uses: gacts/setup-go-with-cache@v1 - uses: gacts/setup-go-with-cache@v1
@ -95,7 +95,7 @@ jobs: # Docs: <https://git.io/JvxXE>
arch: [amd64] # amd64, 386 arch: [amd64] # amd64, 386
needs: [golangci-lint, go-test, validate-config-file] needs: [golangci-lint, go-test, validate-config-file]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: gacts/setup-go-with-cache@v1 - uses: gacts/setup-go-with-cache@v1
with: {go-version-file: go.mod} with: {go-version-file: go.mod}
@ -126,7 +126,7 @@ jobs: # Docs: <https://git.io/JvxXE>
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [build] needs: [build]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: actions/download-artifact@v3 - uses: actions/download-artifact@v3
with: with:
@ -154,17 +154,18 @@ jobs: # Docs: <https://git.io/JvxXE>
test -f ./out/app-down/404.html test -f ./out/app-down/404.html
test -f ./out/connection/404.html test -f ./out/connection/404.html
test -f ./out/matrix/404.html test -f ./out/matrix/404.html
test -f ./out/orient/404.html
docker-image: docker-image:
name: Build docker image name: Build docker image
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [golangci-lint, go-test, validate-config-file] needs: [golangci-lint, go-test, validate-config-file]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- {uses: gacts/github-slug@v1, id: slug} - {uses: gacts/github-slug@v1, id: slug}
- uses: docker/build-push-action@v4 # Action page: <https://github.com/docker/build-push-action> - uses: docker/build-push-action@v5 # Action page: <https://github.com/docker/build-push-action>
with: with:
context: . context: .
file: Dockerfile file: Dockerfile
@ -185,14 +186,14 @@ jobs: # Docs: <https://git.io/JvxXE>
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [docker-image] needs: [docker-image]
steps: steps:
- uses: actions/checkout@v3 # is needed for `upload-sarif` action - uses: actions/checkout@v4 # is needed for `upload-sarif` action
- uses: actions/download-artifact@v3 - uses: actions/download-artifact@v3
with: with:
name: docker-image name: docker-image
path: .artifact path: .artifact
- uses: aquasecurity/trivy-action@0.9.2 # action page: <https://github.com/aquasecurity/trivy-action> - uses: aquasecurity/trivy-action@0.13.1 # action page: <https://github.com/aquasecurity/trivy-action>
with: with:
input: .artifact/docker-image.tar input: .artifact/docker-image.tar
format: sarif format: sarif
@ -211,7 +212,7 @@ jobs: # Docs: <https://git.io/JvxXE>
needs: [docker-image] needs: [docker-image]
timeout-minutes: 2 timeout-minutes: 2
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: actions/download-artifact@v3 - uses: actions/download-artifact@v3
with: with:

View File

@ -43,7 +43,6 @@ linters: # All available linters list: <https://golangci-lint.run/usage/linters/
enable: enable:
- asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers - asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers
- bidichk # Checks for dangerous unicode character sequences - bidichk # Checks for dangerous unicode character sequences
- depguard # Go linter that checks if package imports are in a list of acceptable packages
- dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()) - dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f())
- dupl # Tool for code clone detection - dupl # Tool for code clone detection
- errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases - errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases

View File

@ -4,6 +4,44 @@ All notable changes to this package will be documented in this file.
The format is based on [Keep a Changelog][keepachangelog] and this project adheres to [Semantic Versioning][semver]. The format is based on [Keep a Changelog][keepachangelog] and this project adheres to [Semantic Versioning][semver].
## v2.26.0
### Added
- Error pages now translated into 🇵🇱 [#226]
- Possibility to set custom read buffer size (using `--read-buffer-size` flag or environment variable `READ_BUFFER_SIZE`) [#238], [#244]
[#226]:https://github.com/tarampampam/error-pages/pull/226
[#238]:https://github.com/tarampampam/error-pages/issues/238
[#244]:https://github.com/tarampampam/error-pages/pull/244
## v2.25.0
### Added
- Go updated from `1.20` up to `1.21`
- Error pages now translated into 🇮🇩 [#218]
- Possibility catch all paths with error page 404 (using `--catch-all` flag for the `serve` or environment variable `CATCH_ALL=true`) [#217]
[#218]:https://github.com/tarampampam/error-pages/pull/218
[#217]:https://github.com/tarampampam/error-pages/issues/217
## v2.24.0
### Added
- Support for IPv6 addresses in the `--listen` flag [#191]
[#191]:https://github.com/tarampampam/error-pages/issues/191
## v2.23.0
### Added
- Template `orient` [#190]
[#190]:https://github.com/tarampampam/error-pages/pull/190
## v2.22.0 ## v2.22.0
### Changed ### Changed

View File

@ -1,7 +1,17 @@
# syntax=docker/dockerfile:1.2 # syntax=docker/dockerfile:1
# Image page: <https://hub.docker.com/_/golang> # this stage is used to build the application
FROM golang:1.20-alpine as builder FROM golang:1.21-bullseye AS builder
COPY ./go.* /src/
WORKDIR /src
# burn the modules cache
RUN go mod download
# this stage is used to compile the application
FROM builder AS compiler
# can be passed with any prefix (like `v1.2.3@GITHASH`), e.g.: `docker build --build-arg "APP_VERSION=v1.2.3@GITHASH" .` # can be passed with any prefix (like `v1.2.3@GITHASH`), e.g.: `docker build --build-arg "APP_VERSION=v1.2.3@GITHASH" .`
ARG APP_VERSION="undefined@docker" ARG APP_VERSION="undefined@docker"
@ -13,8 +23,8 @@ COPY . .
# arguments to pass on each go tool link invocation # arguments to pass on each go tool link invocation
ENV LDFLAGS="-s -w -X gh.tarampamp.am/error-pages/internal/version.version=$APP_VERSION" ENV LDFLAGS="-s -w -X gh.tarampamp.am/error-pages/internal/version.version=$APP_VERSION"
# build the application
RUN set -x \ RUN set -x \
&& go version \
&& CGO_ENABLED=0 go build -trimpath -ldflags "$LDFLAGS" -o ./error-pages ./cmd/error-pages/ \ && CGO_ENABLED=0 go build -trimpath -ldflags "$LDFLAGS" -o ./error-pages ./cmd/error-pages/ \
&& ./error-pages --version \ && ./error-pages --version \
&& ./error-pages -h && ./error-pages -h
@ -42,7 +52,7 @@ RUN set -x \
&& ls -l ./html && ls -l ./html
# use empty filesystem # use empty filesystem
FROM scratch as runtime FROM scratch AS runtime
ARG APP_VERSION="undefined@docker" ARG APP_VERSION="undefined@docker"
@ -57,7 +67,7 @@ LABEL \
org.opencontainers.image.licenses="MIT" org.opencontainers.image.licenses="MIT"
# Import from builder # Import from builder
COPY --from=builder /tmp/rootfs / COPY --from=compiler /tmp/rootfs /
# Use an unprivileged user # Use an unprivileged user
USER 10001:10001 USER 10001:10001
@ -69,7 +79,8 @@ ENV LISTEN_PORT="8080" \
DEFAULT_ERROR_PAGE="404" \ DEFAULT_ERROR_PAGE="404" \
DEFAULT_HTTP_CODE="404" \ DEFAULT_HTTP_CODE="404" \
SHOW_DETAILS="false" \ SHOW_DETAILS="false" \
DISABLE_L10N="false" DISABLE_L10N="false" \
READ_BUFFER_SIZE="2048"
# Docs: <https://docs.docker.com/engine/reference/builder/#healthcheck> # Docs: <https://docs.docker.com/engine/reference/builder/#healthcheck>
HEALTHCHECK --interval=7s --timeout=2s CMD ["/bin/error-pages", "--log-json", "healthcheck"] HEALTHCHECK --interval=7s --timeout=2s CMD ["/bin/error-pages", "--log-json", "healthcheck"]

View File

@ -12,7 +12,10 @@
<a href="https://github.com/tarampampam/error-pages/blob/master/LICENSE"><img src="https://img.shields.io/github/license/tarampampam/error-pages.svg?maxAge=30&style=flat-square" alt="" /></a> <a href="https://github.com/tarampampam/error-pages/blob/master/LICENSE"><img src="https://img.shields.io/github/license/tarampampam/error-pages.svg?maxAge=30&style=flat-square" alt="" /></a>
</p> </p>
<p align="center"><sup>22 feb. 2022 - ⚡ Our Docker image was downloaded <strong>one MILLION times</strong> from the docker hub! ⚡</sup></p> <p align="center"><sup>
22 feb. 2022 - ⚡ Our Docker image was downloaded <strong>one MILLION times</strong> from the docker hub! ⚡<br/>
10 apr. 2023 - ⚡ <strong>Two million times</strong> from the docker hub and <strong>one million</strong> from the ghcr! ⚡
</sup></p>
One day you may want to replace the standard error pages of your HTTP server with something more original and pretty. That's what this repository was created for :) It contains: One day you may want to replace the standard error pages of your HTTP server with something more original and pretty. That's what this repository was created for :) It contains:
@ -34,7 +37,7 @@ One day you may want to replace the standard error pages of your HTTP server wit
- Error pages can be [embedded into your own `nginx`][wiki-usage-with-nginx] docker image - Error pages can be [embedded into your own `nginx`][wiki-usage-with-nginx] docker image
- Fully configurable (take a look at the [configuration file](https://github.com/tarampampam/error-pages/blob/master/error-pages.yml) and [project Wiki][wiki]) - Fully configurable (take a look at the [configuration file](https://github.com/tarampampam/error-pages/blob/master/error-pages.yml) and [project Wiki][wiki])
- Distributed using docker image and compiled binary files - Distributed using docker image and compiled binary files
- Localized (🇺🇸, 🇫🇷, 🇺🇦, 🇷🇺, 🇵🇹, 🇳🇱, 🇩🇪, 🇪🇸, 🇨🇳) HTML error pages (translation process [described here](https://github.com/tarampampam/error-pages/tree/master/l10n) - other translations are welcome!) - Localized (🇺🇸, 🇫🇷, 🇺🇦, 🇷🇺, 🇵🇹, 🇳🇱, 🇩🇪, 🇪🇸, 🇨🇳, 🇮🇩, 🇵🇱) HTML error pages (translation process [described here](https://github.com/tarampampam/error-pages/tree/master/l10n) - other translations are welcome!)
## 🧩 Install ## 🧩 Install
@ -123,6 +126,7 @@ Transfer/sec: 140.23MB
| `app-down` | [![app-down][app-down-screen]][app-down-link] | | `app-down` | [![app-down][app-down-screen]][app-down-link] |
| `connection` | [![connection][connection-screen]][connection-link] | | `connection` | [![connection][connection-screen]][connection-link] |
| `matrix` | [![matrix][matrix-screen]][matrix-link] | | `matrix` | [![matrix][matrix-screen]][matrix-link] |
| `orient` | [![orient][orient-screen]][orient-link] |
> Note: `noise` template highly uses the CPU, be careful > Note: `noise` template highly uses the CPU, be careful
@ -148,6 +152,8 @@ Transfer/sec: 140.23MB
[connection-link]:https://tarampampam.github.io/error-pages/connection/404.html [connection-link]:https://tarampampam.github.io/error-pages/connection/404.html
[matrix-screen]:https://hsto.org/webt/ng/tf/oi/ngtfoiolvmq6hf15kimcxmhprhk.gif [matrix-screen]:https://hsto.org/webt/ng/tf/oi/ngtfoiolvmq6hf15kimcxmhprhk.gif
[matrix-link]:https://tarampampam.github.io/error-pages/matrix/404.html [matrix-link]:https://tarampampam.github.io/error-pages/matrix/404.html
[orient-screen]:https://hsto.org/webt/pz/eu/v_/pzeuv_lyeqr0xpusa4zfrtgk7sa.png
[orient-link]:https://tarampampam.github.io/error-pages/orient/404.html
## 🦾 Contributors ## 🦾 Contributors

View File

@ -8,9 +8,8 @@ volumes:
golint-cache: {} golint-cache: {}
services: services:
app: &app-service app: &go
image: golang:1.20-buster # Image page: <https://hub.docker.com/_/golang> build: {target: builder}
working_dir: /src
environment: environment:
HOME: /tmp HOME: /tmp
GOPATH: /tmp GOPATH: /tmp
@ -22,10 +21,10 @@ services:
security_opt: [no-new-privileges:true] security_opt: [no-new-privileges:true]
web: web:
<<: *app-service <<: *go
ports: ports:
- "8080:8080/tcp" # Open <http://127.0.0.1:8080> - "8080:8080/tcp" # Open <http://127.0.0.1:8080>
command: sh -c "go build -buildvcs=false -o /tmp/app ./cmd/error-pages && /tmp/app serve --show-details --proxy-headers=X-Foo,Bar,Baz_blah" command: sh -c "go build -buildvcs=false -o /tmp/app ./cmd/error-pages && /tmp/app serve --show-details --proxy-headers=X-Foo,Bar,Baz_blah --catch-all"
healthcheck: healthcheck:
test: ['CMD', '/tmp/app', '--log-json', 'healthcheck'] test: ['CMD', '/tmp/app', '--log-json', 'healthcheck']
interval: 4s interval: 4s
@ -33,7 +32,7 @@ services:
retries: 5 retries: 5
golint: golint:
image: golangci/golangci-lint:v1.52-alpine # Image page: <https://hub.docker.com/r/golangci/golangci-lint> image: golangci/golangci-lint:v1.55-alpine # Image page: <https://hub.docker.com/r/golangci/golangci-lint>
environment: environment:
GOLANGCI_LINT_CACHE: /tmp/golint # <https://github.com/golangci/golangci-lint/blob/v1.42.0/internal/cache/default.go#L68> GOLANGCI_LINT_CACHE: /tmp/golint # <https://github.com/golangci/golangci-lint/blob/v1.42.0/internal/cache/default.go#L68>
volumes: volumes:

View File

@ -15,6 +15,7 @@ templates:
- path: ./templates/app-down.html - path: ./templates/app-down.html
- path: ./templates/connection.html - path: ./templates/connection.html
- path: ./templates/matrix.html - path: ./templates/matrix.html
- path: ./templates/orient.html
formats: formats:
json: json:

37
go.mod
View File

@ -1,21 +1,21 @@
module gh.tarampamp.am/error-pages module gh.tarampamp.am/error-pages
go 1.20 go 1.21
require ( require (
github.com/a8m/envsubst v1.4.2 github.com/a8m/envsubst v1.4.2
github.com/fasthttp/router v1.4.18 github.com/fasthttp/router v1.4.21
github.com/fatih/color v1.15.0 github.com/fatih/color v1.15.0
github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d
github.com/pkg/errors v0.9.1 github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.14.0 github.com/prometheus/client_golang v1.17.0
github.com/prometheus/client_model v0.3.0 github.com/prometheus/client_model v0.5.0
github.com/stretchr/testify v1.8.2 github.com/stretchr/testify v1.8.4
github.com/urfave/cli/v2 v2.25.1 github.com/urfave/cli/v2 v2.25.7
github.com/valyala/fasthttp v1.45.0 github.com/valyala/fasthttp v1.50.0
go.uber.org/automaxprocs v1.5.2 go.uber.org/automaxprocs v1.5.3
go.uber.org/goleak v1.2.1 go.uber.org/goleak v1.3.0
go.uber.org/zap v1.24.0 go.uber.org/zap v1.26.0
gopkg.in/yaml.v3 v3.0.1 gopkg.in/yaml.v3 v3.0.1
) )
@ -25,24 +25,19 @@ require (
github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect
github.com/golang/protobuf v1.5.2 // indirect github.com/golang/protobuf v1.5.3 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.16.3 // indirect github.com/klauspost/compress v1.16.3 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect github.com/mattn/go-isatty v0.0.17 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/common v0.40.0 // indirect github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect github.com/prometheus/procfs v0.11.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee // indirect github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.10.0 // indirect
go.uber.org/multierr v1.9.0 // indirect golang.org/x/sys v0.11.0 // indirect
golang.org/x/sys v0.6.0 // indirect google.golang.org/protobuf v1.31.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
) )

89
go.sum
View File

@ -2,36 +2,31 @@ github.com/a8m/envsubst v1.4.2 h1:4yWIHXOLEJHQEFd4UjrWDrYeYlV7ncFWJOCBRLOZHQg=
github.com/a8m/envsubst v1.4.2/go.mod h1:MVUTQNGQ3tsjOOtKCNd+fl8RzhsXcDvvAEzkhGtlsbY= github.com/a8m/envsubst v1.4.2/go.mod h1:MVUTQNGQ3tsjOOtKCNd+fl8RzhsXcDvvAEzkhGtlsbY=
github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs=
github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fasthttp/router v1.4.18 h1:elMnlFq527oZd8MHsuUpO6uLDup1exv8rXPfIjClDHk= github.com/fasthttp/router v1.4.21 h1:Ysgck9aZwaovqxsfhv7nPx9EgsYvB7t3nthrBMQoeIg=
github.com/fasthttp/router v1.4.18/go.mod h1:ZmC20Mn0VgCBbUWFDmnYzFbQYRfdGeKgpkBy0+JioKA= github.com/fasthttp/router v1.4.21/go.mod h1:wtOlZHmOSGD048li7Nkuhw+ov40rr0tY2+IjT+mN9p4=
github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d h1:cVtBfNW5XTHiKQe7jDaDBSh/EVM4XLPutLAGboIXuM0= github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d h1:cVtBfNW5XTHiKQe7jDaDBSh/EVM4XLPutLAGboIXuM0=
github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d/go.mod h1:P2viExyCEfeWGU259JnaQ34Inuec4R38JCyBx2edgD0= github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d/go.mod h1:P2viExyCEfeWGU259JnaQ34Inuec4R38JCyBx2edgD0=
github.com/klauspost/compress v1.16.3 h1:XuJt9zzcnaz6a16/OU53ZjWp/v7/42WcR5t2a0PcNQY= github.com/klauspost/compress v1.16.3 h1:XuJt9zzcnaz6a16/OU53ZjWp/v7/42WcR5t2a0PcNQY=
github.com/klauspost/compress v1.16.3/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/compress v1.16.3/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
@ -41,65 +36,55 @@ github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPn
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U=
github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q=
github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY=
github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
github.com/prometheus/common v0.40.0 h1:Afz7EVRqGg2Mqqf4JuF9vdvp1pi220m55Pi9T2JnO4Q= github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
github.com/prometheus/common v0.40.0/go.mod h1:L65ZJPSmfn/UBWLQIHV7dBrKFidB/wPlF1y5TlSt9OE= github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY=
github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY=
github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI=
github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee h1:8Iv5m6xEo1NR1AvpV+7XmhI4r39LGNzwUL4YpMuL5vk= github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee h1:8Iv5m6xEo1NR1AvpV+7XmhI4r39LGNzwUL4YpMuL5vk=
github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee/go.mod h1:qwtSXrKuJh/zsFQ12yEE89xfCrGKK63Rr7ctU/uCo4g= github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee/go.mod h1:qwtSXrKuJh/zsFQ12yEE89xfCrGKK63Rr7ctU/uCo4g=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/urfave/cli/v2 v2.25.1 h1:zw8dSP7ghX0Gmm8vugrs6q9Ku0wzweqPyshy+syu9Gw=
github.com/urfave/cli/v2 v2.25.1/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasthttp v1.45.0 h1:zPkkzpIn8tdHZUrVa6PzYd0i5verqiPSkgTd3bSUcpA= github.com/valyala/fasthttp v1.50.0 h1:H7fweIlBm0rXLs2q0XbalvJ6r0CUPFWK3/bB4N13e9M=
github.com/valyala/fasthttp v1.45.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= github.com/valyala/fasthttp v1.50.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8=
go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0=
go.uber.org/automaxprocs v1.5.2 h1:2LxUOGiR3O6tw8ui5sZa2LAaHnsviZdVOUZw4fvbnME= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/automaxprocs v1.5.2/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ=
go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60=
go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

View File

@ -32,6 +32,8 @@ const (
showDetailsFlagName = "show-details" showDetailsFlagName = "show-details"
proxyHTTPHeadersFlagName = "proxy-headers" proxyHTTPHeadersFlagName = "proxy-headers"
disableL10nFlagName = "disable-l10n" disableL10nFlagName = "disable-l10n"
catchAllFlagName = "catch-all"
readBufferSizeFlagName = "read-buffer-size"
) )
const ( const (
@ -76,6 +78,7 @@ func NewCommand(log *zap.Logger) *cli.Command { //nolint:funlen
o.Default.PageCode = c.String(defaultErrorPageFlagName) o.Default.PageCode = c.String(defaultErrorPageFlagName)
o.Default.HTTPCode = uint16(c.Uint(defaultHTTPCodeFlagName)) o.Default.HTTPCode = uint16(c.Uint(defaultHTTPCodeFlagName))
o.ShowDetails = c.Bool(showDetailsFlagName) o.ShowDetails = c.Bool(showDetailsFlagName)
o.CatchAll = c.Bool(catchAllFlagName)
if headers := c.String(proxyHTTPHeadersFlagName); headers != "" { //nolint:nestif if headers := c.String(proxyHTTPHeadersFlagName); headers != "" { //nolint:nestif
var m = make(map[string]struct{}) var m = make(map[string]struct{})
@ -105,7 +108,7 @@ func NewCommand(log *zap.Logger) *cli.Command { //nolint:funlen
return fmt.Errorf("wrong default HTTP response code [%d]", o.Default.HTTPCode) return fmt.Errorf("wrong default HTTP response code [%d]", o.Default.HTTPCode)
} }
return cmd.Run(c.Context, log, cfg, ip, port, o) return cmd.Run(c.Context, log, cfg, ip, port, c.Uint(readBufferSizeFlagName), o)
}, },
Flags: []cli.Flag{ Flags: []cli.Flag{
shared.ConfigFileFlag, shared.ConfigFileFlag,
@ -151,6 +154,16 @@ func NewCommand(log *zap.Logger) *cli.Command { //nolint:funlen
Usage: "disable error pages localization", Usage: "disable error pages localization",
EnvVars: []string{env.DisableL10n.String()}, EnvVars: []string{env.DisableL10n.String()},
}, },
&cli.BoolFlag{
Name: catchAllFlagName,
Usage: "catch all pages",
EnvVars: []string{env.CatchAll.String()},
},
&cli.UintFlag{
Name: readBufferSizeFlagName,
Usage: "read buffer size (0 = use default value)",
EnvVars: []string{env.ReadBufferSize.String()},
},
}, },
} }
@ -159,7 +172,13 @@ func NewCommand(log *zap.Logger) *cli.Command { //nolint:funlen
// Run current command. // Run current command.
func (cmd *command) Run( //nolint:funlen func (cmd *command) Run( //nolint:funlen
parentCtx context.Context, log *zap.Logger, cfg *config.Config, ip string, port uint16, opt options.ErrorPage, parentCtx context.Context,
log *zap.Logger,
cfg *config.Config,
ip string,
port uint16,
readBufferSize uint,
opt options.ErrorPage,
) error { ) error {
var ( var (
ctx, cancel = context.WithCancel(parentCtx) // serve context creation ctx, cancel = context.WithCancel(parentCtx) // serve context creation
@ -219,7 +238,7 @@ func (cmd *command) Run( //nolint:funlen
} }
// create HTTP server // create HTTP server
server := appHttp.NewServer(log) server := appHttp.NewServer(log, readBufferSize)
// register server routes, middlewares, etc. // register server routes, middlewares, etc.
if err := server.Register(cfg, picker, opt); err != nil { if err := server.Register(cfg, picker, opt); err != nil {
@ -232,7 +251,7 @@ func (cmd *command) Run( //nolint:funlen
go func(errCh chan<- error) { go func(errCh chan<- error) {
defer close(errCh) defer close(errCh)
log.Info("Server starting", var fields = []zap.Field{
zap.String("addr", ip), zap.String("addr", ip),
zap.Uint16("port", port), zap.Uint16("port", port),
zap.String("default error page", opt.Default.PageCode), zap.String("default error page", opt.Default.PageCode),
@ -240,7 +259,14 @@ func (cmd *command) Run( //nolint:funlen
zap.Strings("proxy headers", opt.ProxyHTTPHeaders), zap.Strings("proxy headers", opt.ProxyHTTPHeaders),
zap.Bool("show request details", opt.ShowDetails), zap.Bool("show request details", opt.ShowDetails),
zap.Bool("localization disabled", opt.L10n.Disabled), zap.Bool("localization disabled", opt.L10n.Disabled),
) zap.Bool("catch all enabled", opt.CatchAll),
}
if readBufferSize > 0 {
fields = append(fields, zap.Uint("read buffer size", readBufferSize))
}
log.Info("Server starting", fields...)
if err := server.Start(ip, port); err != nil { if err := server.Start(ip, port); err != nil {
errCh <- err errCh <- err

View File

@ -17,7 +17,7 @@ var ConfigFileFlag = &cli.StringFlag{ //nolint:gochecknoglobals
var ListenAddrFlag = &cli.StringFlag{ //nolint:gochecknoglobals var ListenAddrFlag = &cli.StringFlag{ //nolint:gochecknoglobals
Name: "listen", Name: "listen",
Aliases: []string{"l"}, Aliases: []string{"l"},
Usage: "IP address to Listen on", Usage: "IP (v4 or v6) address to Listen on",
Value: "0.0.0.0", Value: "0.0.0.0",
EnvVars: []string{env.ListenAddr.String()}, EnvVars: []string{env.ListenAddr.String()},
} }

2
internal/env/env.go vendored
View File

@ -18,6 +18,8 @@ const (
ShowDetails envVariable = "SHOW_DETAILS" // show request details in response ShowDetails envVariable = "SHOW_DETAILS" // show request details in response
ProxyHTTPHeaders envVariable = "PROXY_HTTP_HEADERS" // proxy HTTP request headers list (request -> response) ProxyHTTPHeaders envVariable = "PROXY_HTTP_HEADERS" // proxy HTTP request headers list (request -> response)
DisableL10n envVariable = "DISABLE_L10N" // disable pages localization DisableL10n envVariable = "DISABLE_L10N" // disable pages localization
CatchAll envVariable = "CATCH_ALL" // catch all pages
ReadBufferSize envVariable = "READ_BUFFER_SIZE" // https://github.com/tarampampam/error-pages/issues/238
) )
// String returns environment variable name in the string representation. // String returns environment variable name in the string representation.

View File

@ -17,6 +17,8 @@ func TestConstants(t *testing.T) {
assert.Equal(t, "SHOW_DETAILS", string(ShowDetails)) assert.Equal(t, "SHOW_DETAILS", string(ShowDetails))
assert.Equal(t, "PROXY_HTTP_HEADERS", string(ProxyHTTPHeaders)) assert.Equal(t, "PROXY_HTTP_HEADERS", string(ProxyHTTPHeaders))
assert.Equal(t, "DISABLE_L10N", string(DisableL10n)) assert.Equal(t, "DISABLE_L10N", string(DisableL10n))
assert.Equal(t, "CATCH_ALL", string(CatchAll))
assert.Equal(t, "READ_BUFFER_SIZE", string(ReadBufferSize))
} }
func TestEnvVariable_Lookup(t *testing.T) { func TestEnvVariable_Lookup(t *testing.T) {
@ -32,6 +34,8 @@ func TestEnvVariable_Lookup(t *testing.T) {
{giveEnv: ShowDetails}, {giveEnv: ShowDetails},
{giveEnv: ProxyHTTPHeaders}, {giveEnv: ProxyHTTPHeaders},
{giveEnv: DisableL10n}, {giveEnv: DisableL10n},
{giveEnv: CatchAll},
{giveEnv: ReadBufferSize},
} }
for _, tt := range cases { for _, tt := range cases {

View File

@ -1,7 +1,10 @@
package http package http
import ( import (
"strconv" "errors"
"fmt"
"net"
"strings"
"time" "time"
"github.com/fasthttp/router" "github.com/fasthttp/router"
@ -36,13 +39,14 @@ const (
defaultIdleTimeout = time.Second * 6 defaultIdleTimeout = time.Second * 6
) )
func NewServer(log *zap.Logger) Server { func NewServer(log *zap.Logger, readBufferSize uint) Server {
rdr := tpl.NewTemplateRenderer() rdr := tpl.NewTemplateRenderer()
return Server{ return Server{
// fasthttp docs: <https://github.com/valyala/fasthttp> // fasthttp docs: <https://github.com/valyala/fasthttp>
fast: &fasthttp.Server{ fast: &fasthttp.Server{
WriteTimeout: defaultWriteTimeout, WriteTimeout: defaultWriteTimeout,
ReadBufferSize: int(readBufferSize),
ReadTimeout: defaultReadTimeout, ReadTimeout: defaultReadTimeout,
IdleTimeout: defaultIdleTimeout, IdleTimeout: defaultIdleTimeout,
NoDefaultServerHeader: true, NoDefaultServerHeader: true,
@ -57,8 +61,24 @@ func NewServer(log *zap.Logger) Server {
} }
// Start server. // Start server.
func (s *Server) Start(ip string, port uint16) error { func (s *Server) Start(ip string, port uint16) (err error) {
return s.fast.ListenAndServe(ip + ":" + strconv.Itoa(int(port))) if net.ParseIP(ip) == nil {
return errors.New("invalid IP address")
}
var ln net.Listener
if strings.Count(ip, ":") >= 2 { //nolint:gomnd // ipv6
if ln, err = net.Listen("tcp6", fmt.Sprintf("[%s]:%d", ip, port)); err != nil {
return err
}
} else { // ipv4
if ln, err = net.Listen("tcp4", fmt.Sprintf("%s:%d", ip, port)); err != nil {
return err
}
}
return s.fast.Serve(ln)
} }
type templatePicker interface { type templatePicker interface {
@ -88,7 +108,13 @@ func (s *Server) Register(cfg *config.Config, templatePicker templatePicker, opt
s.router.GET("/metrics", metricsHandler.NewHandler(reg)) s.router.GET("/metrics", metricsHandler.NewHandler(reg))
s.router.NotFound = notfoundHandler.NewHandler(cfg, templatePicker, s.rdr, opt) // use index handler to catch all paths? Uses DEFAULT_ERROR_PAGE
if opt.CatchAll {
s.router.NotFound = indexHandler.NewHandler(cfg, templatePicker, s.rdr, opt)
} else {
// use default not found handler
s.router.NotFound = notfoundHandler.NewHandler(cfg, templatePicker, s.rdr, opt)
}
return nil return nil
} }

View File

@ -13,4 +13,5 @@ type ErrorPage struct {
} }
ShowDetails bool // show request details in response ShowDetails bool // show request details in response
ProxyHTTPHeaders []string // proxy HTTP request headers list ProxyHTTPHeaders []string // proxy HTTP request headers list
CatchAll bool // catch all pages
} }

View File

@ -11,6 +11,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Fehler', de: 'Fehler',
es: 'Error', es: 'Error',
zh: '错误', zh: '错误',
id: 'Kesalahan',
pl: 'Błąd',
}, },
'Good luck': { 'Good luck': {
fr: 'Bonne chance', fr: 'Bonne chance',
@ -21,16 +23,20 @@ Object.defineProperty(window, 'l10n', {
de: 'Viel Glück', de: 'Viel Glück',
es: 'Buena Suerte', es: 'Buena Suerte',
zh: '祝好运', zh: '祝好运',
id: 'Semoga berhasil!',
pl: 'Powodzenia',
}, },
'UH OH': { 'UH OH': {
fr: 'Oups', fr: 'Oups',
ru: 'Ох', ru: 'Ох',
uk: 'Ох', uk: 'Упс',
pt: 'Ops', pt: 'Ops',
nl: 'Oeps', nl: 'Oeps',
de: 'Hoppla', de: 'Hoppla',
es: 'Oups', es: 'Uy',
zh: '哎呀', zh: '哎呀',
id: 'Ups',
pl: 'Ojej',
}, },
'Request details': { 'Request details': {
fr: 'Détails de la requête', fr: 'Détails de la requête',
@ -41,6 +47,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Details der Anfrage', de: 'Details der Anfrage',
es: 'Detalles de la petición', es: 'Detalles de la petición',
zh: '请求详情', zh: '请求详情',
id: 'Rincian permintaan',
pl: 'Poproś o szczegóły',
}, },
'Double-check the URL': { 'Double-check the URL': {
fr: 'Vérifiez lURL', fr: 'Vérifiez lURL',
@ -51,36 +59,44 @@ Object.defineProperty(window, 'l10n', {
de: 'Überprüfen Sie die URL', de: 'Überprüfen Sie die URL',
es: 'Verifique la url', es: 'Verifique la url',
zh: '请再次检查地址', zh: '请再次检查地址',
id: 'Periksa URL',
pl: 'Sprawdź adres URL',
}, },
'Alternatively, go back': { 'Alternatively, go back': {
fr: 'Essayer de revenir en arrière', fr: 'Essayer de revenir en arrière',
ru: 'Или можете вернуться назад', ru: 'Или можете вернуться назад',
uk: 'Або ви можете повернутися', uk: 'Або можете повернутися назад',
pt: "Como alternativa, tente voltar", pt: "Como alternativa, tente voltar",
nl: 'Of ga terug', nl: 'Of ga terug',
de: 'Alternativ gehen Sie zurück', de: 'Alternativ gehen Sie zurück',
es: 'Como alternativa, vuelva atrás', es: 'Como alternativa, vuelva atrás',
zh: '或返回上一页', zh: '或返回上一页',
id: 'Atau, kembali',
pl: 'Alternatywnie wróć',
}, },
'Here\'s what might have happened': { 'Here\'s what might have happened': {
fr: 'Voici ce qui aurait pu se passer', fr: 'Voici ce qui aurait pu se passer',
ru: 'Из-за чего это могло случиться', ru: 'Из-за чего это могло случиться',
uk: 'Що це може статися', uk: 'Ось що могло трапитися',
pt: 'Aqui está o que pode ter acontecido', pt: 'Aqui está o que pode ter acontecido',
nl: 'Wat er gebeurd kan zijn', nl: 'Wat er gebeurd kan zijn',
de: 'Folgendes könnte passiert sein', de: 'Folgendes könnte passiert sein',
es: 'Esto es lo que ha podido pasar', es: 'Esto es lo que ha podido pasar',
zh: '可能原因有', zh: '可能原因有',
id: 'Inilah yang bisa saja terjadi',
pl: 'Oto, co mogło się wydarzyć',
}, },
'You may have mistyped the URL': { 'You may have mistyped the URL': {
fr: 'Vous avez peut-être mal tapé lURL', fr: 'Vous avez peut-être mal tapé lURL',
ru: 'Вы могли ошибиться в URL', ru: 'Вы могли ошибиться в URL',
uk: 'Ви можете зробити помилку в URL-адресі', uk: 'Ви могли помилитися в URL-адресі',
pt: 'Você pode ter digitado incorretamente a URL', pt: 'Você pode ter digitado incorretamente a URL',
nl: 'De URL bevat een typefout', nl: 'De URL bevat een typefout',
de: 'Möglicherweise haben Sie die URL falsch eingegeben', de: 'Möglicherweise haben Sie die URL falsch eingegeben',
es: 'Igual ha escrito mal la URL', es: 'Quizá ha escrito mal la URL',
zh: '您可能输入了错误的地址', zh: '您可能输入了错误的地址',
id: 'Anda mungkin tersalah memasukkan URL',
pl: 'Być może błędnie wpisałeś adres URL',
}, },
'The site was moved': { 'The site was moved': {
fr: 'Le site a été déplacé', fr: 'Le site a été déplacé',
@ -89,8 +105,10 @@ Object.defineProperty(window, 'l10n', {
pt: 'O site foi movido', pt: 'O site foi movido',
nl: 'De site is verplaatst', nl: 'De site is verplaatst',
de: 'Die Seite wurde verschoben', de: 'Die Seite wurde verschoben',
es: 'El sitio se ha movido', es: 'El sitio se ha trasladado',
zh: '站点已被转移', zh: '站点已被转移',
id: 'Halaman dipindahkan',
pl: 'Witryna została przeniesiona',
}, },
'It was never here': { 'It was never here': {
fr: 'Il na jamais été ici', fr: 'Il na jamais été ici',
@ -101,26 +119,32 @@ Object.defineProperty(window, 'l10n', {
de: 'Es war nie hier', de: 'Es war nie hier',
es: 'Nunca ha estado aquí', es: 'Nunca ha estado aquí',
zh: '站点从未存在', zh: '站点从未存在',
id: 'Itu Tidak pernah di sini',
pl: 'Nigdy jej nie było',
}, },
'Bad Request': { 'Bad Request': {
fr: 'Mauvaise requête', fr: 'Mauvaise requête',
ru: 'Некорректный запрос', ru: 'Некорректный запрос',
uk: 'Неправильний запит', uk: 'Хибний запит',
pt: 'Requisição inválida', pt: 'Requisição inválida',
nl: 'Foutieve anvraag', nl: 'Foutieve anvraag',
de: 'Fehlerhafte Anfrage', de: 'Fehlerhafte Anfrage',
es: 'Petición inválida', es: 'Petición inválida',
zh: '错误请求', zh: '错误请求',
id: 'Permintaan yang salah',
pl: 'Nieprawidłowe żądanie',
}, },
'The server did not understand the request': { 'The server did not understand the request': {
fr: 'Le serveur ne comprend pas la requête', fr: 'Le serveur ne comprend pas la requête',
ru: 'Сервер не смог обработать запрос из-за ошибки в нём', ru: 'Сервер не смог обработать запрос из-за ошибки в нём',
uk: 'Сервер не міг обробити запит через помилку в ньому', uk: 'Сервер не зміг обробити запит через помилку в ньому',
pt: 'O servidor não entendeu a solicitação', pt: 'O servidor não entendeu a solicitação',
nl: 'De server begreep het verzoek niet', nl: 'De server begreep het verzoek niet',
de: 'Der Server hat die Anfrage nicht verstanden', de: 'Der Server hat die Anfrage nicht verstanden',
es: 'El servidor no entendió la petición', es: 'El servidor no entendió la petición',
zh: '服务器不理解该请求', zh: '服务器不理解该请求',
id: 'Server tidak memahami permintaan',
pl: 'Serwer nie zrozumiał żądania',
}, },
'Unauthorized': { 'Unauthorized': {
fr: 'Non autorisé', fr: 'Non autorisé',
@ -131,6 +155,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Nicht autorisiert', de: 'Nicht autorisiert',
es: 'No autorizado', es: 'No autorizado',
zh: '未经授权', zh: '未经授权',
id: 'Tidak diotorisasi',
pl: 'Nieautoryzowany',
}, },
'The requested page needs a username and a password': { 'The requested page needs a username and a password': {
fr: 'La page demandée nécessite un nom dutilisateur et un mot de passe', fr: 'La page demandée nécessite un nom dutilisateur et un mot de passe',
@ -141,6 +167,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Die angeforderte Seite benötigt einen Benutzernamen und ein Passwort', de: 'Die angeforderte Seite benötigt einen Benutzernamen und ein Passwort',
es: 'La página solicitada necesita un usuario y una contraseña', es: 'La página solicitada necesita un usuario y una contraseña',
zh: '请求的页面需要用户名和密码', zh: '请求的页面需要用户名和密码',
id: 'Halaman yang diminta membutuhkan nama pengguna dan kata sandi',
pl: 'Żądana strona wymaga podania nazwy użytkownika i hasła',
}, },
'Forbidden': { 'Forbidden': {
fr: 'Interdit', fr: 'Interdit',
@ -151,6 +179,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Verboten', de: 'Verboten',
es: 'Prohibido', es: 'Prohibido',
zh: '禁止访问', zh: '禁止访问',
id: 'Dilarang',
pl: 'Zabroniony',
}, },
'Access is forbidden to the requested page': { 'Access is forbidden to the requested page': {
fr: 'Accès interdit à la page demandée', fr: 'Accès interdit à la page demandée',
@ -161,26 +191,32 @@ Object.defineProperty(window, 'l10n', {
de: 'Der Zugriff auf die angeforderte Seite ist verboten', de: 'Der Zugriff auf die angeforderte Seite ist verboten',
es: 'El acceso está prohibido para la página solicitada', es: 'El acceso está prohibido para la página solicitada',
zh: '禁止访问请求的页面', zh: '禁止访问请求的页面',
id: 'Akses dilarang ke halaman yang diminta',
pl: 'Dostęp do żądanej strony jest zabroniony',
}, },
'Not Found': { 'Not Found': {
fr: 'Introuvable', fr: 'Introuvable',
ru: 'Страница не найдена', ru: 'Страница не найдена',
uk: 'Сторінка не знайдена', uk: 'Сторінку не знайдено',
pt: 'Não encontrado', pt: 'Não encontrado',
nl: 'Niet gevonden', nl: 'Niet gevonden',
de: 'Nicht gefunden', de: 'Nicht gefunden',
es: 'No encontrado', es: 'No encontrado',
zh: '未找到', zh: '未找到',
id: 'Tidak ditemukan',
pl: 'Nie znaleziono',
}, },
'The server can not find the requested page': { 'The server can not find the requested page': {
fr: 'Le serveur ne peut trouver la page demandée', fr: 'Le serveur ne peut trouver la page demandée',
ru: 'Сервер не смог найти запрашиваемую страницу', ru: 'Сервер не смог найти запрашиваемую страницу',
uk: 'Сервер не міг знайти запитану сторінку', uk: 'Сервер не зміг знайти запитану сторінку',
pt: 'O servidor não consegue encontrar a página solicitada', pt: 'O servidor não consegue encontrar a página solicitada',
nl: 'De server kan de pagina niet vinden', nl: 'De server kan de pagina niet vinden',
de: 'Der Server kann die angeforderte Seite nicht finden', de: 'Der Server kann die angeforderte Seite nicht finden',
es: 'El servidor no puede encontrar la página solicitada', es: 'El servidor no puede encontrar la página solicitada',
zh: '服务器找不到请求的页面', zh: '服务器找不到请求的页面',
id: 'Server tidak dapat menemukan halaman yang diminta',
pl: 'Serwer nie może znaleźć żądanej strony',
}, },
'Method Not Allowed': { 'Method Not Allowed': {
fr: 'Méthode Non Autorisée', fr: 'Méthode Non Autorisée',
@ -191,6 +227,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Methode nicht erlaubt', de: 'Methode nicht erlaubt',
es: 'Método no permitido', es: 'Método no permitido',
zh: '方法不被允许', zh: '方法不被允许',
id: 'Metode tidak diizinkan',
pl: 'Niedozwolona metoda',
}, },
'The method specified in the request is not allowed': { 'The method specified in the request is not allowed': {
fr: 'La méthode spécifiée dans la requête nest pas autorisée', fr: 'La méthode spécifiée dans la requête nest pas autorisée',
@ -201,6 +239,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Die in der Anfrage angegebene Methode ist nicht zulässig', de: 'Die in der Anfrage angegebene Methode ist nicht zulässig',
es: 'El método especificado en la petición no está permitido', es: 'El método especificado en la petición no está permitido',
zh: '请求指定的方法不被允许', zh: '请求指定的方法不被允许',
id: 'Metode dalam permintaan tidak diizinkan',
pl: 'Metoda określona w żądaniu jest niedozwolona',
}, },
'Proxy Authentication Required': { 'Proxy Authentication Required': {
fr: 'Authentification proxy requise', fr: 'Authentification proxy requise',
@ -211,6 +251,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Proxy-Authentifizierung benötigt', de: 'Proxy-Authentifizierung benötigt',
es: 'Autenticación de proxy requerida', es: 'Autenticación de proxy requerida',
zh: '需要代理服务器身份验证', zh: '需要代理服务器身份验证',
id: 'Diperlukan otentikasi proxy',
pl: 'Wymagane uwierzytelnianie proxy',
}, },
'You must authenticate with a proxy server before this request can be served': { 'You must authenticate with a proxy server before this request can be served': {
fr: 'Vous devez vous authentifier avec un serveur proxy avant que cette requête puisse être servie', fr: 'Vous devez vous authentifier avec un serveur proxy avant que cette requête puisse être servie',
@ -221,26 +263,32 @@ Object.defineProperty(window, 'l10n', {
de: 'Sie müssen sich bei einem Proxy-Server authentifizieren, bevor diese Anfrage bedient werden kann', de: 'Sie müssen sich bei einem Proxy-Server authentifizieren, bevor diese Anfrage bedient werden kann',
es: 'Debes autentificarte con un servidor proxy antes de que esta petición pueda ser atendida', es: 'Debes autentificarte con un servidor proxy antes de que esta petición pueda ser atendida',
zh: '您必须对代理服务器进行身份验证,然后才能让请求得到处理', zh: '您必须对代理服务器进行身份验证,然后才能让请求得到处理',
id: 'Anda harus mengautentikasi dengan server proxy sebelum permintaan ini dapat dilayani',
pl: 'Musisz uwierzytelnić się na serwerze proxy, zanim to żądanie będzie mogło zostać obsłużone',
}, },
'Request Timeout': { 'Request Timeout': {
fr: 'Requête expiré', fr: 'Requête expiré',
ru: 'Истекло время ожидания', ru: 'Истекло время ожидания',
uk: 'Час запиту закінчився', uk: 'Вичерпано час очікування',
pt: 'Tempo limite de solicitação excedido', pt: 'Tempo limite de solicitação excedido',
nl: 'Aanvraagtijd verstreken', nl: 'Aanvraagtijd verstreken',
de: 'Zeitüberschreitung der Anforderung', de: 'Zeitüberschreitung der Anforderung',
es: 'Tiempo límite de la petición excedido', es: 'Tiempo límite de la petición excedido',
zh: '请求超时', zh: '请求超时',
id: 'Meminta batas waktu',
pl: 'Przekroczenie limitu czasu żądania',
}, },
'The request took longer than the server was prepared to wait': { 'The request took longer than the server was prepared to wait': {
fr: 'La requête prend plus de temps que prévu', fr: 'La requête prend plus de temps que prévu',
ru: 'Отправка запроса заняла слишком много времени', ru: 'Отправка запроса заняла слишком много времени',
uk: 'Надсилання запиту зайняв занадто багато часу', uk: 'Надсилання запиту зайняло надто багато часу',
pt: 'A solicitação demorou mais do que o servidor estava preparado para esperar', pt: 'A solicitação demorou mais do que o servidor estava preparado para esperar',
nl: 'Het verzoek duurde langer dan de server wilde wachten', nl: 'Het verzoek duurde langer dan de server wilde wachten',
de: 'Die Anfrage hat länger gedauert, als der Server bereit war zu warten', de: 'Die Anfrage hat länger gedauert, als der Server bereit war zu warten',
es: 'La petición esta tardando más de lo que el servidor estaba preparado para esperar', es: 'La petición esta tardando más de lo que el servidor estaba preparado para esperar',
zh: '请求用时超过了服务器设置的最长等待时间', zh: '请求用时超过了服务器设置的最长等待时间',
id: 'Permintaan memakan waktu lebih lama dari yang bisa ditunggu oleh server',
pl: 'Żądanie trwało dłużej niż serwer był gotowy czekać',
}, },
'Conflict': { 'Conflict': {
fr: 'Conflit', fr: 'Conflit',
@ -251,6 +299,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Konflikt', de: 'Konflikt',
es: 'Conflicto', es: 'Conflicto',
zh: '冲突', zh: '冲突',
id: 'Konflik',
pl: 'Konflikt',
}, },
'The request could not be completed because of a conflict': { 'The request could not be completed because of a conflict': {
fr: 'La requête na pas pu être complétée à cause dun conflit', fr: 'La requête na pas pu être complétée à cause dun conflit',
@ -261,6 +311,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Die Anfrage konnte aufgrund eines Konflikts nicht abgeschlossen werden', de: 'Die Anfrage konnte aufgrund eines Konflikts nicht abgeschlossen werden',
es: 'La petición no ha podido ser completada por un conflicto', es: 'La petición no ha podido ser completada por un conflicto',
zh: '由于冲突,请求无法完成', zh: '由于冲突,请求无法完成',
id: 'Permintaan tidak dapat diselesaikan karena adanya konflik',
pl: 'Żądanie nie mogło zostać wykonane z powodu konfliktu',
}, },
'Gone': { 'Gone': {
fr: 'Supprimé', fr: 'Supprimé',
@ -271,26 +323,32 @@ Object.defineProperty(window, 'l10n', {
de: 'Verschwunden', de: 'Verschwunden',
es: 'Eliminado', es: 'Eliminado',
zh: '已移除', zh: '已移除',
id: 'Menghilang',
pl: 'Usunięto',
}, },
'The requested page is no longer available': { 'The requested page is no longer available': {
fr: 'La page demandée nest plus disponible', fr: 'La page demandée nest plus disponible',
ru: 'Запрошенная страница была удалена', ru: 'Запрошенная страница была удалена',
uk: 'Запитана сторінка була видалена', uk: 'Запитувана сторінка більше не доступна',
pt: 'A página solicitada não está mais disponível', pt: 'A página solicitada não está mais disponível',
nl: 'De pagina is niet langer beschikbaar', nl: 'De pagina is niet langer beschikbaar',
de: 'Die angeforderte Seite ist nicht mehr verfügbar', de: 'Die angeforderte Seite ist nicht mehr verfügbar',
es: 'La página solicitada no está ya disponible', es: 'La página solicitada no está ya disponible',
zh: '请求的页面不再可用', zh: '请求的页面不再可用',
id: 'Halaman yang diminta tidak lagi tersedia',
pl: 'Żądana strona nie jest już dostępna',
}, },
'Length Required': { 'Length Required': {
fr: 'Longueur requise', fr: 'Longueur requise',
ru: 'Необходима длина', ru: 'Необходима длина',
uk: 'Потрібно вказати розмір', uk: 'Потрібно вказати довжину',
pt: 'Content-Length necessário', pt: 'Content-Length necessário',
nl: 'Lengte benodigd', nl: 'Lengte benodigd',
de: 'Länge benötigt', de: 'Länge benötigt',
es: 'Longitud requerida', es: 'Longitud requerida',
zh: '需要长度', zh: '需要长度',
id: 'Panjang yang diperlukan',
pl: 'Wymagana długość',
}, },
'The "Content-Length" is not defined. The server will not accept the request without it': { 'The "Content-Length" is not defined. The server will not accept the request without it': {
fr: 'Le "Content-Length" nest pas défini. Le serveur ne prendra pas en compte la requête', fr: 'Le "Content-Length" nest pas défini. Le serveur ne prendra pas en compte la requête',
@ -301,6 +359,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Die "Content-Length" ist nicht definiert. Ohne sie akzeptiert der Server die Anfrage nicht', de: 'Die "Content-Length" ist nicht definiert. Ohne sie akzeptiert der Server die Anfrage nicht',
es: 'El "Content-Legth" no eta definido. Este servidor no aceptará la petición sin él', es: 'El "Content-Legth" no eta definido. Este servidor no aceptará la petición sin él',
zh: '未指定Content-Length(内容长度)。服务器将不接受不包含此头信息的请求', zh: '未指定Content-Length(内容长度)。服务器将不接受不包含此头信息的请求',
id: '"Content-Length" tidak ditentukan. Server tidak akan menerima permintaan tanpa itu',
pl: 'Wartość "Content-Length" nie jest zdefiniowana. Serwer nie zaakceptuje żądania bez tego parametru',
}, },
'Precondition Failed': { 'Precondition Failed': {
fr: 'Échec de la condition préalable', fr: 'Échec de la condition préalable',
@ -311,16 +371,19 @@ Object.defineProperty(window, 'l10n', {
de: 'Vorbedingung fehlgeschlagen', de: 'Vorbedingung fehlgeschlagen',
es: 'Precondición fallida', es: 'Precondición fallida',
zh: '前置条件判定失败', zh: '前置条件判定失败',
pl: 'Niespełnienie warunku wstępnego',
}, },
'The pre condition given in the request evaluated to false by the server': { 'The pre condition given in the request evaluated to false by the server': {
fr: 'La précondition donnée dans la requête a été évaluée comme étant fausse par le serveur', fr: 'La précondition donnée dans la requête a été évaluée comme étant fausse par le serveur',
ru: 'Ни одно из условных полей заголовка запроса не было выполнено', ru: 'Ни одно из условных полей заголовка запроса не было выполнено',
uk: 'Жодна з умовних полів заголовка запиту не була виконана', uk: 'Жодна з передумов запиту не була виконана',
pt: 'A pré-condição dada na solicitação avaliada como falsa pelo servidor', pt: 'A pré-condição dada na solicitação avaliada como falsa pelo servidor',
nl: 'De vooraf gestelde voorwaarde is afgewezen door de server', nl: 'De vooraf gestelde voorwaarde is afgewezen door de server',
de: 'Die in der Anfrage angegebene Vorbedingung wird vom Server als falsch bewertet', de: 'Die in der Anfrage angegebene Vorbedingung wird vom Server als falsch bewertet',
es: 'La precondición ha sido evaluada como negativa para esta petición por el servidor', es: 'La precondición ha sido evaluada como negativa para esta petición por el servidor',
zh: '服务器评估请求中给出的前置条件的结果为false(假)', zh: '服务器评估请求中给出的前置条件的结果为false(假)',
id: 'Prakondisi gagal',
pl: 'Warunek wstępny podany w żądaniu został oceniony przez serwer jako nieprawidłowy',
}, },
'Payload Too Large': { 'Payload Too Large': {
fr: 'Charge trop volumineuse', fr: 'Charge trop volumineuse',
@ -329,8 +392,10 @@ Object.defineProperty(window, 'l10n', {
pt: 'Payload muito grande', pt: 'Payload muito grande',
nl: 'Aanvraag te grood', nl: 'Aanvraag te grood',
de: 'Anfrage zu groß', de: 'Anfrage zu groß',
es: 'Carga muy grande', es: 'Carga demasiado grande',
zh: '请求体过大', zh: '请求体过大',
id: 'Muatan terlalu besar',
pl: 'Żądanie jest zbyt duże',
}, },
'The server will not accept the request, because the request entity is too large': { 'The server will not accept the request, because the request entity is too large': {
fr: 'Le serveur ne prendra pas en compte la requête, car lentité de la requête est trop volumineuse', fr: 'Le serveur ne prendra pas en compte la requête, car lentité de la requête est trop volumineuse',
@ -341,6 +406,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Der Server akzeptiert die Anfrage nicht, da die Datenmenge zu groß ist', de: 'Der Server akzeptiert die Anfrage nicht, da die Datenmenge zu groß ist',
es: 'El servidor no aceptará esta petición, porque la carga es demasiado grande', es: 'El servidor no aceptará esta petición, porque la carga es demasiado grande',
zh: '请求体过大,服务器将不接受该请求', zh: '请求体过大,服务器将不接受该请求',
id: 'Server tidak akan menerima permintaan, karena entitas permintaan terlalu besar',
pl: 'Serwer nie zaakceptuje żądania, ponieważ żądanie jest zbyt duże',
}, },
'Requested Range Not Satisfiable': { 'Requested Range Not Satisfiable': {
fr: 'Requête non satisfaisante', fr: 'Requête non satisfaisante',
@ -351,16 +418,20 @@ Object.defineProperty(window, 'l10n', {
de: 'Anfrage-Bereich nicht erfüllbar', de: 'Anfrage-Bereich nicht erfüllbar',
es: 'Intervalo solicitado no satisfactorio', es: 'Intervalo solicitado no satisfactorio',
zh: '不满足请求范围', zh: '不满足请求范围',
id: 'Rentang yang diminta tidak dapat dipenuhi',
pl: 'Żądany zakres nie jest satysfakcjonujący',
}, },
'The requested byte range is not available and is out of bounds': { 'The requested byte range is not available and is out of bounds': {
fr: 'Le byte range demandé nest pas disponible et est hors des limites', fr: 'Le byte range demandé nest pas disponible et est hors des limites',
ru: 'Запрошенный диапазон данных недоступен или вне допустимых пределов', ru: 'Запрошенный диапазон данных недоступен или вне допустимых пределов',
uk: 'Описаний діапазон даних недоступний або з допустимих меж', uk: 'Описаний діапазон даних недоступний або поза допустимими межами',
pt: 'O intervalo de bytes solicitado não está disponível e está fora dos limites', pt: 'O intervalo de bytes solicitado não está disponível e está fora dos limites',
nl: 'De aangevraagde bytes zijn buiten het limiet', nl: 'De aangevraagde bytes zijn buiten het limiet',
de: 'Der angefragte Teilbereich der Ressource existiert nicht oder ist ungültig', de: 'Der angefragte Teilbereich der Ressource existiert nicht oder ist ungültig',
es: 'El intervalo de bytes requerido no está disponible o se encuentra fuera de los límites', es: 'El intervalo de bytes requerido no está disponible o se encuentra fuera de los límites',
zh: '请求的字节范围不可用,超出边界', zh: '请求的字节范围不可用,超出边界',
id: 'Rentang byte yang diminta tidak tersedia dan di luar batas',
pl: 'Żądany zakres bajtów nie jest dostępny i znajduje się poza zakresem',
}, },
'I\'m a teapot': { 'I\'m a teapot': {
fr: 'Je suis une théière', fr: 'Je suis une théière',
@ -371,16 +442,20 @@ Object.defineProperty(window, 'l10n', {
de: 'Ich bin eine Teekanne', de: 'Ich bin eine Teekanne',
es: 'Soy una tetera', es: 'Soy una tetera',
zh: '我是一只茶壶', zh: '我是一只茶壶',
id: 'Saya adalah teko',
pl: 'Jestem czajniczkiem',
}, },
'Attempt to brew coffee with a teapot is not supported': { 'Attempt to brew coffee with a teapot is not supported': {
fr: 'Tenter de préparer du café avec une théière nest pas pris en charge', fr: 'Tenter de préparer du café avec une théière nest pas pris en charge',
ru: 'Попытка заварить кофе в чайнике обречена на фиаско', ru: 'Попытка заварить кофе в чайнике обречена на фиаско',
uk: 'Спроба виварити каву в чайник приречена на фіаско', uk: 'Спроба заварити каву в чайнику приречена на фіаско',
pt: 'A tentativa de preparar café com um bule não é suportada', pt: 'A tentativa de preparar café com um bule não é suportada',
nl: 'Koffie maken met een theepot is niet ondersteund', nl: 'Koffie maken met een theepot is niet ondersteund',
de: 'Der Versuch, Kaffee mit einer Teekanne zuzubereiten, wird nicht unterstützt', de: 'Der Versuch, Kaffee mit einer Teekanne zuzubereiten, wird nicht unterstützt',
es: 'Intentar hacer un café en una tetera no está soportado', es: 'Intentar hacer un café en una tetera no está soportado',
zh: '用茶壶泡咖啡不受支持', zh: '用茶壶泡咖啡不受支持',
id: 'Upaya menyeduh kopi dengan teko tidak didukung',
pl: 'Próba zaparzenia kawy za pomocą czajniczka nie jest obsługiwana',
}, },
'Too Many Requests': { 'Too Many Requests': {
fr: 'Trop de requêtes', fr: 'Trop de requêtes',
@ -391,16 +466,20 @@ Object.defineProperty(window, 'l10n', {
de: 'Zu viele Anfragen', de: 'Zu viele Anfragen',
es: 'Demasiadas peticiones', es: 'Demasiadas peticiones',
zh: '请求过多', zh: '请求过多',
id: 'Terlalu banyak permintaan',
pl: 'Zbyt wiele żądań',
}, },
'Too many requests in a given amount of time': { 'Too many requests in a given amount of time': {
fr: 'Trop de requêtes dans un délai donné', fr: 'Trop de requêtes dans un délai donné',
ru: 'Отправлено слишком много запросов за короткое время', ru: 'Отправлено слишком много запросов за короткое время',
uk: 'Надіслано занадто багато запитів на короткий час', uk: 'Надіслано занадто багато запитів за короткий проміжок час',
pt: 'Excesso de solicitações em um determinado período de tempo', pt: 'Excesso de solicitações em um determinado período de tempo',
nl: 'Te veel verzoeken binnen een bepaalde tijd', nl: 'Te veel verzoeken binnen een bepaalde tijd',
de: 'Der Client hat zu viele Anfragen in einem bestimmten Zeitraum gesendet', de: 'Der Client hat zu viele Anfragen in einem bestimmten Zeitraum gesendet',
es: 'Demasiadas peticiones en un determinado periodo de tiempo', es: 'Demasiadas peticiones en un determinado periodo de tiempo',
zh: '在给定的时间内发送了过多请求', zh: '在给定的时间内发送了过多请求',
id: 'Terlalu banyak permintaan dalam waktu tertentu',
pl: 'Zbyt wiele żądań w określonym czasie',
}, },
'Internal Server Error': { 'Internal Server Error': {
fr: 'Erreur interne du serveur', fr: 'Erreur interne du serveur',
@ -411,16 +490,20 @@ Object.defineProperty(window, 'l10n', {
de: 'Interner Server-Fehler', de: 'Interner Server-Fehler',
es: 'Error Interno', es: 'Error Interno',
zh: '内部服务器错误', zh: '内部服务器错误',
id: 'Kesalahan server internal',
pl: 'Wewnętrzny błąd serwera',
}, },
'The server met an unexpected condition': { 'The server met an unexpected condition': {
fr: 'Le serveur a rencontré une condition inattendue', fr: 'Le serveur a rencontré une condition inattendue',
ru: 'Произошло что-то неожиданное на сервере', ru: 'Произошло что-то неожиданное на сервере',
uk: 'На сервері було щось несподіване', uk: 'На сервері відбулось щось неочікуване',
pt: 'O servidor encontrou uma condição inesperada', pt: 'O servidor encontrou uma condição inesperada',
nl: 'De server ondervond een onverwachte conditie', nl: 'De server ondervond een onverwachte conditie',
de: 'Der Server hat einen internen Fehler festgestellt', de: 'Der Server hat einen internen Fehler festgestellt',
es: 'El servidor ha encontrado una condición no esperada', es: 'El servidor ha encontrado una condición no esperada',
zh: '服务器遇到了意外情况', zh: '服务器遇到了意外情况',
id: 'Server mengalami kondisi yang tidak terduga',
pl: 'Serwer napotkał nieoczekiwany stan',
}, },
'Bad Gateway': { 'Bad Gateway': {
fr: 'Mauvaise passerelle', fr: 'Mauvaise passerelle',
@ -428,19 +511,23 @@ Object.defineProperty(window, 'l10n', {
uk: 'Помилка шлюзу', uk: 'Помилка шлюзу',
pt: 'Gateway inválido', pt: 'Gateway inválido',
nl: 'Ongeldige Gateway', nl: 'Ongeldige Gateway',
de: 'Fehlerhafter Gateway', de: 'Fehlerhaftes Gateway',
es: 'Puerta de enlace no valida', es: 'Puerta de enlace no valida',
zh: '无效网关', zh: '无效网关',
id: 'Gateway yang buruk',
pl: 'Błąd bramki',
}, },
'The server received an invalid response from the upstream server': { 'The server received an invalid response from the upstream server': {
fr: 'Le serveur a reçu une réponse invalide du serveur distant', fr: 'Le serveur a reçu une réponse invalide du serveur distant',
ru: 'Сервер получил некорректный ответ от вышестоящего сервера', ru: 'Сервер получил некорректный ответ от вышестоящего сервера',
uk: 'Сервер отримав неправильну відповідь з сервера Upstream', uk: 'Сервер отримав невірну відповідь від попереднього сервера',
pt: 'O servidor recebeu uma resposta inválida do servidor upstream', pt: 'O servidor recebeu uma resposta inválida do servidor upstream',
nl: 'De server ontving een ongeldig antwoord van een bovenliggende server', nl: 'De server ontving een ongeldig antwoord van een bovenliggende server',
de: 'Der Server hat eine ungültige Antwort vom Upstream-Server erhalten', de: 'Der Server hat eine ungültige Antwort vom Upstream-Server erhalten',
es: 'El servidor ha recibido una respuesta no válida del servidor de origen', es: 'El servidor ha recibido una respuesta no válida del servidor de origen',
zh: '服务器从上游服务器收到了无效的响应', zh: '服务器从上游服务器收到了无效的响应',
id: 'Server menerima respons yang tidak valid dari server induk',
pl: 'Serwer otrzymał nieprawidłową odpowiedź od serwera nadrzędnego',
}, },
'Service Unavailable': { 'Service Unavailable': {
fr: 'Service indisponible', fr: 'Service indisponible',
@ -451,6 +538,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Dienst nicht verfügbar', de: 'Dienst nicht verfügbar',
es: 'Servicio no disponible', es: 'Servicio no disponible',
zh: '服务不可用', zh: '服务不可用',
id: 'Layanan tidak tersedia',
pl: 'Serwis niedostępny',
}, },
'The server is temporarily overloading or down': { 'The server is temporarily overloading or down': {
fr: 'Le serveur est temporairement en surcharge ou indisponible', fr: 'Le serveur est temporairement en surcharge ou indisponible',
@ -461,6 +550,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Der Server ist vorübergehend überlastet oder ausgefallen', de: 'Der Server ist vorübergehend überlastet oder ausgefallen',
es: 'El servidor está temporalmente sobrecargado o inactivo', es: 'El servidor está temporalmente sobrecargado o inactivo',
zh: '服务器暂时过载或不可用', zh: '服务器暂时过载或不可用',
id: 'Server untuk sementara kelebihan beban atau tidak tersedia',
pl: 'Serwer jest tymczasowo przeciążony lub wyłączony',
}, },
'Gateway Timeout': { 'Gateway Timeout': {
fr: 'Expiration Passerelle', fr: 'Expiration Passerelle',
@ -471,16 +562,20 @@ Object.defineProperty(window, 'l10n', {
de: 'Gateway Zeitüberschreitung', de: 'Gateway Zeitüberschreitung',
es: 'Tiempo límite de puerta de enlace excedido', es: 'Tiempo límite de puerta de enlace excedido',
zh: '网关超时', zh: '网关超时',
id: 'Batas waktu gateway',
pl: 'Przekroczenie limitu czasu bramki',
}, },
'The gateway has timed out': { 'The gateway has timed out': {
fr: 'Le temps dattente de la passerelle est dépassé', fr: 'Le temps dattente de la passerelle est dépassé',
ru: 'Сервер не дождался ответа от вышестоящего сервера', ru: 'Сервер не дождался ответа от вышестоящего сервера',
uk: 'Сервер не чекав відповіді від сервера Upstream', uk: 'У шлюзу закінчився час очікування',
pt: 'O gateway esgotou o tempo limite', pt: 'O gateway esgotou o tempo limite',
nl: 'De verbinding naar de bovenliggende server is verlopen', nl: 'De verbinding naar de bovenliggende server is verlopen',
de: 'Das Zeitlimit für den Verbindungsaufbau mit dem Upstream-Server ist abgelaufen', de: 'Das Zeitlimit für den Verbindungsaufbau mit dem Upstream-Server ist abgelaufen',
es: 'La puerta de enlace ha sobrepasado el tiempo límite', es: 'La puerta de enlace ha sobrepasado el tiempo límite',
zh: '网关响应已经超时', zh: '网关响应已经超时',
id: 'Sambungan ke server induk telah kedaluwarsa',
pl: 'Bramka przekroczyła limit czasu',
}, },
'HTTP Version Not Supported': { 'HTTP Version Not Supported': {
fr: 'Version HTTP non prise en charge', fr: 'Version HTTP non prise en charge',
@ -491,6 +586,8 @@ Object.defineProperty(window, 'l10n', {
de: 'HTTP-Version wird nicht unterstützt', de: 'HTTP-Version wird nicht unterstützt',
es: 'Versión de HTTP no soportada', es: 'Versión de HTTP no soportada',
zh: 'HTTP版本不受支持', zh: 'HTTP版本不受支持',
id: 'Versi HTTP tidak didukung',
pl: 'Wersja HTTP nie jest obsługiwana',
}, },
'The server does not support the "http protocol" version': { 'The server does not support the "http protocol" version': {
fr: 'Le serveur ne supporte pas la version du protocole HTTP', fr: 'Le serveur ne supporte pas la version du protocole HTTP',
@ -501,6 +598,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Der Server unterstützt die HTTP-Protokoll-Version nicht', de: 'Der Server unterstützt die HTTP-Protokoll-Version nicht',
es: 'El servidor no soporta la versión del protocolo HTTP', es: 'El servidor no soporta la versión del protocolo HTTP',
zh: '服务器不支持该HTTP协议版本', zh: '服务器不支持该HTTP协议版本',
id: 'Server tidak mendukung versi HTTP ini',
pl: 'Serwer nie obsługuje wersji "protokołu http"',
}, },
'Host': { 'Host': {
@ -512,6 +611,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Host', de: 'Host',
es: 'Host', es: 'Host',
zh: '主机', zh: '主机',
id: 'Host',
pl: 'Host',
}, },
'Original URI': { 'Original URI': {
fr: 'URI dorigine', fr: 'URI dorigine',
@ -522,6 +623,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Originale URI', de: 'Originale URI',
es: 'URI original', es: 'URI original',
zh: '原始URI', zh: '原始URI',
id: 'URL asli',
pl: 'Oryginalny URI',
}, },
'Forwarded for': { 'Forwarded for': {
fr: 'Transmis pour', fr: 'Transmis pour',
@ -530,8 +633,10 @@ Object.defineProperty(window, 'l10n', {
pt: 'Encaminhado para', pt: 'Encaminhado para',
nl: 'Doorgestuurd voor', nl: 'Doorgestuurd voor',
de: 'Weitergeleitet für', de: 'Weitergeleitet für',
es: 'Remitido por', es: 'Remitido para',
zh: '转发自', zh: '转发自',
id: 'Diteruskan untuk',
pl: 'Przekazane do',
}, },
'Namespace': { 'Namespace': {
fr: 'Espace de noms', fr: 'Espace de noms',
@ -542,16 +647,20 @@ Object.defineProperty(window, 'l10n', {
de: 'Namensraum', de: 'Namensraum',
es: 'Namespace', es: 'Namespace',
zh: '命名空间', zh: '命名空间',
id: 'Ruang nama',
pl: 'Przestrzeń nazw',
}, },
'Ingress name': { 'Ingress name': {
fr: 'Nom ingress', fr: 'Nom ingress',
ru: 'Имя Ingress', ru: 'Имя Ingress',
uk: 'Ім\'я Ingress', uk: 'Ім\'я входу',
pt: 'Nome Ingress', pt: 'Nome Ingress',
nl: 'Ingress naam', nl: 'Ingress naam',
de: 'Ingress Name', de: 'Ingress Name',
es: 'Nombre Ingress', es: 'Nombre Ingress',
zh: '入口名', zh: '入口名',
id: 'Nama ingress',
pl: 'Nazwa wejścia',
}, },
'Service name': { 'Service name': {
fr: 'Nom du service', fr: 'Nom du service',
@ -562,6 +671,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Service Name', de: 'Service Name',
es: 'Nombre del servicio', es: 'Nombre del servicio',
zh: '服务名', zh: '服务名',
id: 'Nama layanan',
pl: 'Nazwa usługi',
}, },
'Service port': { 'Service port': {
fr: 'Port du service', fr: 'Port du service',
@ -572,6 +683,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Service Port', de: 'Service Port',
es: 'Puerto del servicio', es: 'Puerto del servicio',
zh: '服务端口', zh: '服务端口',
id: 'Port layanan',
pl: 'Port usługi',
}, },
'Request ID': { 'Request ID': {
fr: 'Identifiant de la requête', fr: 'Identifiant de la requête',
@ -582,16 +695,20 @@ Object.defineProperty(window, 'l10n', {
de: 'Anfrage ID', de: 'Anfrage ID',
es: 'ID de la petición', es: 'ID de la petición',
zh: '请求ID', zh: '请求ID',
id: 'ID permintaan',
pl: 'Identyfikator żądania',
}, },
'Timestamp': { 'Timestamp': {
fr: 'Horodatage', fr: 'Horodatage',
ru: 'Временная метка', ru: 'Временная метка',
uk: 'Тимчасова мітка', uk: 'Мітка часу',
pt: 'Timestamp', pt: 'Timestamp',
nl: 'Tijdstempel', nl: 'Tijdstempel',
de: 'Zeitstempel', de: 'Zeitstempel',
es: 'Timestamp', es: 'Timestamp',
zh: '时间戳', zh: '时间戳',
id: 'Cap waktu',
pl: 'Sygnatura czasowa',
}, },
'client-side error': { 'client-side error': {
@ -603,6 +720,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Clientseitiger Fehler', de: 'Clientseitiger Fehler',
es: 'Error del lado del cliente', es: 'Error del lado del cliente',
zh: '客户端错误', zh: '客户端错误',
id: 'Kesalahan sisi klien',
pl: 'błąd po stronie klienta',
}, },
'server-side error': { 'server-side error': {
fr: 'Erreur Serveur', fr: 'Erreur Serveur',
@ -613,6 +732,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Serverseitiger Fehler', de: 'Serverseitiger Fehler',
es: 'Error del lado del servidor', es: 'Error del lado del servidor',
zh: '服务端错误', zh: '服务端错误',
id: 'Kesalahan sisi server',
pl: 'błąd po stronie serwera',
}, },
'Your Client': { 'Your Client': {
@ -622,28 +743,34 @@ Object.defineProperty(window, 'l10n', {
pt: 'Seu Cliente', pt: 'Seu Cliente',
nl: 'Jouw Client', nl: 'Jouw Client',
de: 'Ihr Client', de: 'Ihr Client',
es: 'Tu cliente', es: 'Tu Cliente',
zh: '您的客户端', zh: '您的客户端',
id: 'Klien Anda',
pl: 'Klient',
}, },
'Network': { 'Network': {
fr: 'Réseau', fr: 'Réseau',
ru: 'Сеть', ru: 'Сеть',
uk: 'Сіть', uk: 'Мережа',
pt: 'Rede', pt: 'Rede',
nl: 'Netwerk', nl: 'Netwerk',
de: 'Netzwerk', de: 'Netzwerk',
es: 'Red', es: 'Red',
zh: '网络', zh: '网络',
id: 'Jaringan',
pl: 'Sieć',
}, },
'Web Server': { 'Web Server': {
fr: 'Serveur Web', fr: 'Serveur Web',
ru: 'Web Сервер', ru: 'Web Сервер',
uk: 'Web Сервер', uk: 'Web-сервер',
pt: 'Servidor web', pt: 'Servidor web',
nl: 'Web Server', nl: 'Web Server',
de: 'Webserver', de: 'Webserver',
es: 'Servidor web', es: 'Servidor Web',
zh: 'Web服务器', zh: 'Web服务器',
id: 'Server web',
pl: 'Serwer WWW',
}, },
'What happened?': { 'What happened?': {
fr: 'Que sest-il passé ?', fr: 'Que sest-il passé ?',
@ -654,6 +781,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Was ist passiert?', de: 'Was ist passiert?',
es: '¿Que ha pasado?', es: '¿Que ha pasado?',
zh: '发生了什么?', zh: '发生了什么?',
id: 'Apa yang terjadi?',
pl: 'Co się stało?',
}, },
'What can i do?': { 'What can i do?': {
fr: 'Que puis-je faire ?', fr: 'Que puis-je faire ?',
@ -664,6 +793,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Was kann ich machen?', de: 'Was kann ich machen?',
es: '¿Que puedo hacer?', es: '¿Que puedo hacer?',
zh: '我能做什么?', zh: '我能做什么?',
id: 'Apa yang bisa saya lakukan?',
pl: 'Co mogę zrobić?',
}, },
'Please try again in a few minutes': { 'Please try again in a few minutes': {
fr: 'Veuillez réessayer dans quelques minutes', fr: 'Veuillez réessayer dans quelques minutes',
@ -674,6 +805,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Bitte versuchen Sie es in ein paar Minuten erneut', de: 'Bitte versuchen Sie es in ein paar Minuten erneut',
es: 'Por favor, intente nuevamente en unos minutos', es: 'Por favor, intente nuevamente en unos minutos',
zh: '请在几分钟后重试', zh: '请在几分钟后重试',
id: 'Silakan coba lagi dalam beberapa menit',
pl: 'Spróbuj ponownie za kilka minut',
}, },
'Working': { 'Working': {
fr: 'Opérationnel', fr: 'Opérationnel',
@ -682,8 +815,10 @@ Object.defineProperty(window, 'l10n', {
pt: 'Funcionando', pt: 'Funcionando',
nl: 'Functioneel', nl: 'Functioneel',
de: 'Funktioniert', de: 'Funktioniert',
es: 'Trabajando', es: 'Funcionando',
zh: '正常运行', zh: '正常运行',
id: 'Fungsi',
pl: 'Działa',
}, },
'Unknown': { 'Unknown': {
fr: 'Inconnu', fr: 'Inconnu',
@ -694,6 +829,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Unbekannt', de: 'Unbekannt',
es: 'Desconocido', es: 'Desconocido',
zh: '未知', zh: '未知',
id: 'Tidak diketahui',
pl: 'Nieznany',
}, },
'Please try to change the request method, headers, payload, or URL': { 'Please try to change the request method, headers, payload, or URL': {
fr: 'Veuillez essayer de changer la méthode de requête, les en-têtes, le contenu ou lURL', fr: 'Veuillez essayer de changer la méthode de requête, les en-têtes, le contenu ou lURL',
@ -704,6 +841,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Bitte versuchen Sie, die Anfragemethode, Header, Payload oder URL zu ändern', de: 'Bitte versuchen Sie, die Anfragemethode, Header, Payload oder URL zu ändern',
es: 'Por favor intente cambiar el método de la petición, cabeceras, carga o URL', es: 'Por favor intente cambiar el método de la petición, cabeceras, carga o URL',
zh: '请尝试更改请求方法、标头、有效负载或URL', zh: '请尝试更改请求方法、标头、有效负载或URL',
id: 'Coba lagi dengan metode, header, muatan, atau URL yang berbeda',
pl: 'Spróbuj zmienić metodę żądania, nagłówki, żądanie lub adres URL',
}, },
'Please check your authorization data': { 'Please check your authorization data': {
fr: 'Veuillez vérifier vos données dautorisation', fr: 'Veuillez vérifier vos données dautorisation',
@ -714,6 +853,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Bitte überprüfen Sie Ihre Zugangsdaten', de: 'Bitte überprüfen Sie Ihre Zugangsdaten',
es: 'Verifique sus datos de autorización', es: 'Verifique sus datos de autorización',
zh: '请检查您的授权数据', zh: '请检查您的授权数据',
id: 'Memeriksa detail autentikasi',
pl: 'Sprawdź swoje dane autoryzacyjne',
}, },
'Please double-check the URL and try again': { 'Please double-check the URL and try again': {
fr: 'Veuillez vérifier lURL et réessayer', fr: 'Veuillez vérifier lURL et réessayer',
@ -724,6 +865,8 @@ Object.defineProperty(window, 'l10n', {
de: 'Bitte überprüfen Sie die URL und versuchen Sie es erneut', de: 'Bitte überprüfen Sie die URL und versuchen Sie es erneut',
es: 'Verifique de nuevo la URL y vuelva a probar', es: 'Verifique de nuevo la URL y vuelva a probar',
zh: '请再次检查URL并重试', zh: '请再次检查URL并重试',
id: 'Periksa URL dan coba lagi',
pl: 'Sprawdź adres URL i spróbuj ponownie',
}, },
}; };

View File

@ -19,3 +19,5 @@ By default, pages markup contains strings in English (`en` locale). If you want
- 🇩🇪 German by [@mschoeffmann](https://github.com/mschoeffmann) - 🇩🇪 German by [@mschoeffmann](https://github.com/mschoeffmann)
- 🇪🇸 Spanish by [@Runig006](https://github.com/Runig006) - 🇪🇸 Spanish by [@Runig006](https://github.com/Runig006)
- 🇨🇳 Chinese by [@CDN18](https://github.com/CDN18) - 🇨🇳 Chinese by [@CDN18](https://github.com/CDN18)
- 🇮🇩 Indonesian by [@getwisp](https://github.com/getwisp)
- 🇵🇱 Polish by [@wielorzeczownik](https://github.com/wielorzeczownik)

279
templates/orient.html Normal file

File diff suppressed because one or more lines are too long