Skip to content

Commit dbcb896

Browse files
Traffic stats (lucasdillmann#91)
1 parent effe777 commit dbcb896

129 files changed

Lines changed: 10911 additions & 2939 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
node-version: 24
2222
- uses: actions/setup-go@v5
2323
with:
24-
go-version: 1.25.6
24+
go-version: 1.25.7
2525
- name: Install nfpm
2626
run: |
2727
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list

.github/workflows/snapshot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
node-version: 24
3939
- uses: actions/setup-go@v5
4040
with:
41-
go-version: 1.25.6
41+
go-version: 1.25.7
4242
- name: Unit tests
4343
env:
4444
TEST_POSTGRES_HOST: runner.local
@@ -64,7 +64,7 @@ jobs:
6464
node-version: 24
6565
- uses: actions/setup-go@v5
6666
with:
67-
go-version: 1.25.6
67+
go-version: 1.25.7
6868
- name: Install nfpm
6969
run: |
7070
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ RUN apk update && \
3535
nginx \
3636
nginx-mod-http-js \
3737
nginx-mod-http-lua \
38+
nginx-mod-http-vts \
39+
nginx-mod-http-geoip2 \
3840
nginx-mod-stream \
3941
ca-certificates \
4042
curl && \

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ LDFLAGS := -X 'dillmann.com.br/nginx-ignition/core/common/version.Number=$(VERSI
1313
.frontend-lint: .frontend-prerequisites
1414
cd frontend/ && npm run check
1515

16-
.backend-lint: .backend-prerequisites
16+
.backend-lint: .backend-prerequisites .backend-test-mocks
1717
go tool golangci-lint run \
1818
./api/... \
1919
./application/... \
@@ -93,7 +93,7 @@ LDFLAGS := -X 'dillmann.com.br/nginx-ignition/core/common/version.Number=$(VERSI
9393
.frontend-format: .frontend-prerequisites
9494
cd frontend/ && npx prettier --write .
9595

96-
.backend-format: .backend-prerequisites
96+
.backend-format: .backend-prerequisites .backend-test-mocks
9797
go tool fieldalignment -fix \
9898
./api/... \
9999
./application/... \

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
authentication and source IP checks.
2727
- 📋 **Logging:** Detailed access and error logs for the server and each virtual host, with built-in automatic log
2828
rotation.
29-
- 🚀 **Performance:** Built-in nginx caching configuration to speed up your content delivery.
29+
- 📊 **Traffic statistics:** Real-time insights into server performance, including request rates, response times, and
30+
traffic breakdown by host, domain, and upstream servers.
31+
- 🚀 **Caching:** Built-in nginx caching configuration to speed up your content delivery.
3032
- 🏗️ **Flexible execution:** nginx ignition can run nginx for you, or just generate the configuration files for you.
3133

3234
<br />
@@ -38,13 +40,14 @@ nginx ignition supports multiple languages, including:
3840
- 🇧🇷 Brazilian Portuguese
3941
- 🇺🇸 English
4042
- 🇨🇳 Chinese (Simplified)
43+
- 🇩🇪 German
44+
- 🇫🇷 French
4145
- 🇮🇳 Hindi
4246
- 🇪🇸 Spanish
4347
- 🇻🇳 Vietnamese
4448
- 🇷🇺 Russian
4549
- 🇧🇩 Bengali
4650
- 🇯🇵 Japanese
47-
- 🇮🇳 Western Punjabi
4851

4952
<br />
5053

api/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module dillmann.com.br/nginx-ignition/api
22

3-
go 1.25.6
3+
go 1.25.7
44

55
require (
66
github.com/gin-gonic/gin v1.11.0
@@ -38,10 +38,10 @@ require (
3838
github.com/rogpeppe/go-internal v1.14.1 // indirect
3939
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
4040
github.com/ugorji/go/codec v1.3.1 // indirect
41-
golang.org/x/arch v0.23.0 // indirect
41+
golang.org/x/arch v0.24.0 // indirect
4242
golang.org/x/crypto v0.47.0 // indirect
4343
golang.org/x/net v0.49.0 // indirect
44-
golang.org/x/sys v0.40.0 // indirect
44+
golang.org/x/sys v0.41.0 // indirect
4545
google.golang.org/protobuf v1.36.11 // indirect
4646
gopkg.in/yaml.v3 v3.0.1 // indirect
4747
)

api/host/artifacts_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ func newHostRequestDTO() hostRequestDTO {
1818
WebsocketsSupport: ptr.Of(true),
1919
HTTP2Support: ptr.Of(true),
2020
RedirectHTTPToHTTPS: ptr.Of(true),
21+
StatsEnabled: ptr.Of(true),
2122
},
2223
Routes: []routeDTO{
2324
{
@@ -48,6 +49,7 @@ func newHost() *host.Host {
4849
WebsocketSupport: true,
4950
HTTP2Support: true,
5051
RedirectHTTPToHTTPS: true,
52+
StatsEnabled: true,
5153
},
5254
Routes: []host.Route{
5355
{

api/host/converter.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ func toFeatureSetDTO(featureSet *host.FeatureSet) *featureSetDTO {
122122
WebsocketsSupport: &featureSet.WebsocketSupport,
123123
HTTP2Support: &featureSet.HTTP2Support,
124124
RedirectHTTPToHTTPS: &featureSet.RedirectHTTPToHTTPS,
125+
StatsEnabled: &featureSet.StatsEnabled,
125126
}
126127
}
127128

@@ -286,6 +287,7 @@ func toFeatureSet(input *featureSetDTO) *host.FeatureSet {
286287
WebsocketSupport: getBoolValue(input.WebsocketsSupport),
287288
HTTP2Support: getBoolValue(input.HTTP2Support),
288289
RedirectHTTPToHTTPS: getBoolValue(input.RedirectHTTPToHTTPS),
290+
StatsEnabled: getBoolValue(input.StatsEnabled),
289291
}
290292
}
291293

api/host/converter_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ func Test_toDTO(t *testing.T) {
3131
assert.Equal(t, input.DomainNames, result.DomainNames)
3232
assert.Len(t, result.GlobalBindings, 1)
3333
assert.True(t, *result.FeatureSet.WebsocketsSupport)
34+
assert.True(t, *result.FeatureSet.StatsEnabled)
3435
assert.Equal(t, "index.html", *result.Routes[0].Settings.IndexFile)
3536
})
3637

@@ -51,6 +52,7 @@ func Test_toDomain(t *testing.T) {
5152
assert.True(t, result.UseGlobalBindings)
5253
assert.Equal(t, input.DomainNames, result.DomainNames)
5354
assert.True(t, result.FeatureSet.WebsocketSupport)
55+
assert.True(t, result.FeatureSet.StatsEnabled)
5456
assert.Equal(t, "index.html", *result.Routes[0].Settings.IndexFile)
5557
})
5658

api/host/dto.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ type featureSetDTO struct {
6565
WebsocketsSupport *bool `json:"websocketsSupport"`
6666
HTTP2Support *bool `json:"http2Support"`
6767
RedirectHTTPToHTTPS *bool `json:"redirectHttpToHttps"`
68+
StatsEnabled *bool `json:"statsEnabled"`
6869
}
6970

7071
type bindingDTO struct {

0 commit comments

Comments
 (0)