Skip to content

Commit 5581a51

Browse files
Integration with the Tailscale network (#34)
1 parent fd9df1d commit 5581a51

File tree

379 files changed

+4627
-2322
lines changed

Some content is hidden

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

379 files changed

+4627
-2322
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ If applicable, add screenshots and/or the application's log to help explain your
2727
**Environment**
2828
- OS (e.g. Linux, macOS)
2929
- Execution mode (e.g. Docker, local installation)
30-
- Version (e.g. 2.10.0)
30+
- nginx ignition version (e.g. 2.10.0)
3131

3232
**Additional context and information**
3333
Add any other context about the problem here.

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
node-version: 22
1717
- uses: actions/setup-go@v5
1818
with:
19-
go-version: 1.25.3
19+
go-version: 1.25.4
2020
- name: Install nfpm
2121
run: |
2222
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
@@ -19,7 +19,7 @@ jobs:
1919
node-version: 22
2020
- uses: actions/setup-go@v5
2121
with:
22-
go-version: 1.25.3
22+
go-version: 1.25.4
2323
- name: npm cache download
2424
uses: actions/cache/restore@v4
2525
with:
@@ -49,7 +49,7 @@ jobs:
4949
node-version: 22
5050
- uses: actions/setup-go@v5
5151
with:
52-
go-version: 1.25.3
52+
go-version: 1.25.4
5353
- name: Install nfpm
5454
run: |
5555
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
DOCKER_IMAGE ?= dillmann/nginx-ignition
22
VERSION ?= 0.0.0
33
PR_ID ?= 0
4-
SNAPSHOT_TAG_SUFFIX := $(if $(or $(filter 0,$(PR_ID)),$(filter ,$(PR_ID))),snapshot,pr-$(PR_ID)-snapshot)
4+
SNAPSHOT_TAG_SUFFIX := $(if $(filter-out ,$(PR_ID)),$(if $(filter-out 0,$(PR_ID)),pr-$(PR_ID)-snapshot,snapshot),snapshot)
55

66
.prerequisites:
77
go work sync
@@ -20,8 +20,9 @@ SNAPSHOT_TAG_SUFFIX := $(if $(or $(filter 0,$(PR_ID)),$(filter ,$(PR_ID))),snaps
2020
./certificate/selfsigned \
2121
./core \
2222
./database \
23+
./integration/docker \
2324
./integration/truenas \
24-
./integration/docker
25+
./vpn/tailscale
2526

2627
.build-frontend:
2728
cd frontend/ && npm run build

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ Some of the available features include:
2222
- SSL certificates (Let's Encrypt, self-signed or bring your custom one) with automatic renew (when applicable)
2323
- Server and virtual hosts access and error logs with automatic log rotation
2424
- Multiple users with attribute-based access control (ABAC)
25-
- Native integration with TrueNAS, allowing to easily configure to proxy to an app hosted in your NAS
25+
- Support for TrueNAS, allowing to easily configure to proxy to an app hosted in your NAS
2626
- Native integration with Docker for easy pick of a container as the proxy target
27+
- Built-in support for Tailscale VPNs, enabling easy exposure of hosts in your Tailnet networks as virtual machines
2728
- Access lists for easy control of who can access what using basic authentication and/or source IP address checks
2829

2930
## Getting started

api/access_list/dto.go

Lines changed: 0 additions & 39 deletions
This file was deleted.
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
package access_list
1+
package accesslist
22

33
import (
44
"github.com/google/uuid"
55

6-
"dillmann.com.br/nginx-ignition/core/access_list"
6+
"dillmann.com.br/nginx-ignition/core/accesslist"
77
)
88

9-
func toDto(accessList *access_list.AccessList) *accessListResponseDto {
9+
func toDto(accessList *accesslist.AccessList) *accessListResponseDto {
1010
if accessList == nil {
1111
return nil
1212
}
@@ -40,33 +40,33 @@ func toDto(accessList *access_list.AccessList) *accessListResponseDto {
4040
}
4141
}
4242

43-
func toDomain(request *accessListRequestDto) *access_list.AccessList {
43+
func toDomain(request *accessListRequestDto) *accesslist.AccessList {
4444
if request == nil {
4545
return nil
4646
}
4747

48-
var entries []access_list.AccessListEntry
48+
var entries []accesslist.AccessListEntry
4949
if request.Entries != nil {
5050
for _, entry := range request.Entries {
51-
entries = append(entries, access_list.AccessListEntry{
51+
entries = append(entries, accesslist.AccessListEntry{
5252
Priority: *entry.Priority,
5353
Outcome: *entry.Outcome,
5454
SourceAddress: entry.SourceAddresses,
5555
})
5656
}
5757
}
5858

59-
var credentials []access_list.AccessListCredentials
59+
var credentials []accesslist.AccessListCredentials
6060
if request.Credentials != nil {
6161
for _, credential := range request.Credentials {
62-
credentials = append(credentials, access_list.AccessListCredentials{
62+
credentials = append(credentials, accesslist.AccessListCredentials{
6363
Username: *credential.Username,
6464
Password: *credential.Password,
6565
})
6666
}
6767
}
6868

69-
return &access_list.AccessList{
69+
return &accesslist.AccessList{
7070
ID: uuid.New(),
7171
Name: *request.Name,
7272
Realm: *request.Realm,
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
package access_list
1+
package accesslist
22

33
import (
44
"net/http"
55

66
"github.com/gin-gonic/gin"
7-
"github.com/go-playground/validator/v10"
87
"github.com/google/uuid"
98

10-
"dillmann.com.br/nginx-ignition/core/access_list"
9+
"dillmann.com.br/nginx-ignition/core/accesslist"
1110
)
1211

1312
type createHandler struct {
14-
commands *access_list.Commands
13+
commands *accesslist.Commands
1514
}
1615

1716
func (h createHandler) handle(ctx *gin.Context) {
@@ -20,10 +19,6 @@ func (h createHandler) handle(ctx *gin.Context) {
2019
panic(err)
2120
}
2221

23-
if err := validator.New().Struct(payload); err != nil {
24-
panic(err)
25-
}
26-
2722
domainModel := toDomain(payload)
2823
domainModel.ID = uuid.New()
2924

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
package access_list
1+
package accesslist
22

33
import (
44
"net/http"
55

66
"github.com/gin-gonic/gin"
77
"github.com/google/uuid"
88

9-
"dillmann.com.br/nginx-ignition/core/access_list"
9+
"dillmann.com.br/nginx-ignition/core/accesslist"
1010
)
1111

1212
type deleteHandler struct {
13-
commands *access_list.Commands
13+
commands *accesslist.Commands
1414
}
1515

1616
func (h deleteHandler) handle(ctx *gin.Context) {

api/accesslist/dto.go

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package accesslist
2+
3+
import (
4+
"github.com/google/uuid"
5+
6+
"dillmann.com.br/nginx-ignition/core/accesslist"
7+
)
8+
9+
type accessListRequestDto struct {
10+
Name *string `json:"name"`
11+
Realm *string `json:"realm"`
12+
SatisfyAll *bool `json:"satisfyAll"`
13+
DefaultOutcome *accesslist.Outcome `json:"defaultOutcome"`
14+
Entries []*entrySetDto `json:"entries"`
15+
ForwardAuthenticationHeader *bool `json:"forwardAuthenticationHeader"`
16+
Credentials []*credentialsDto `json:"credentials"`
17+
}
18+
19+
type accessListResponseDto struct {
20+
ID uuid.UUID `json:"id"`
21+
Name string `json:"name"`
22+
Realm *string `json:"realm"`
23+
SatisfyAll bool `json:"satisfyAll"`
24+
DefaultOutcome accesslist.Outcome `json:"defaultOutcome"`
25+
Entries []entrySetDto `json:"entries"`
26+
ForwardAuthenticationHeader bool `json:"forwardAuthenticationHeader"`
27+
Credentials []credentialsDto `json:"credentials"`
28+
}
29+
30+
type entrySetDto struct {
31+
Priority *int `json:"priority"`
32+
Outcome *accesslist.Outcome `json:"outcome"`
33+
SourceAddresses []*string `json:"sourceAddresses"`
34+
}
35+
36+
type credentialsDto struct {
37+
Username *string `json:"username"`
38+
Password *string `json:"password"`
39+
}

0 commit comments

Comments
 (0)