Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6085616
make send_at int
CodeShellDev Feb 24, 2026
88ea793
added options to disable templating / injection
CodeShellDev Feb 24, 2026
d4b36de
enable templating by default
CodeShellDev Feb 24, 2026
a1d6c7d
add breaking for struct tags
CodeShellDev Feb 24, 2026
0b5483c
add breaking error for message templates
CodeShellDev Feb 24, 2026
d2247f4
allow for using body/header.var instead of @/#var
CodeShellDev Feb 12, 2026
86d56e8
fix endpoints not redirecting back to middleware chain
CodeShellDev Feb 27, 2026
67ff62a
make sure maps are not nil before copying to
CodeShellDev Feb 27, 2026
7901f9d
added global redact transform and improved stdlog for httpserver, etc.
CodeShellDev Feb 27, 2026
af6b50d
feat: Improved Regex handling and Custom type compilers (#268)
CodeShellDev Mar 1, 2026
e6fe072
feat: Improved Placeholders in Configs (#278)
CodeShellDev Mar 5, 2026
61b9d30
semver + note for pre-releases
CodeShellDev Mar 5, 2026
7c485d9
update report link
CodeShellDev Mar 6, 2026
5f93879
return timestamps as integers
CodeShellDev Mar 6, 2026
fd98250
enable scheduling by default
CodeShellDev Mar 6, 2026
2dca1ec
fix url string conversion loop
CodeShellDev Mar 6, 2026
9fb2159
feat: custom response headers (#295)
CodeShellDev Mar 17, 2026
b25e13a
feat: CORS (#296)
CodeShellDev Mar 19, 2026
91f788e
improved cors handling
CodeShellDev Mar 20, 2026
cb43986
added `/not-found` to mockserver
CodeShellDev Mar 20, 2026
fbbe975
add nil-checks
CodeShellDev Mar 21, 2026
c370572
update deps
CodeShellDev Mar 21, 2026
c7ce31b
only add auth require headers after auth requirement middleware
CodeShellDev Mar 21, 2026
c65d6e6
.
CodeShellDev Mar 21, 2026
21f8dd1
fixed nil panic in isCORSOriginAllowed
CodeShellDev Mar 21, 2026
217dd36
improved CORS
CodeShellDev Mar 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
# Ignore all
*
# Env files
**/*.env

# env file
*.env
# Editor/IDE
# .idea/
.vscode/

# Git folders
.git*
.github
!.github

# Docusaurus
.docusaurus
node_modules

# Dev folders
.dev
dev-env.sh
*.local.*

# Ignore yml files
*.yaml
*.yml
# Editor config
.editorconfig

# Markdown files
*.md
**/*.md

!LICENSE

# Include data/
!data/*

# Ignore source files
*.go
go.mod
go.sum

# Include build
!app
!dist/*
# Include source files
!*.go
7 changes: 4 additions & 3 deletions .github/workflows/docker-image-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ on:
- beta
- alpha
- dev
- feat

env:
TYPES: "rc,beta,alpha,dev"
TYPES: "rc,beta,alpha,dev,feat"

TYPE: ${{ inputs.type }}
BASE_TAG: ${{ inputs.base-tag }}
Expand Down Expand Up @@ -113,7 +114,7 @@ jobs:
echo "COUNT=$COUNT" >> "$GITHUB_ENV"

- name: Login to Registry
uses: docker/login-action@v3
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand Down Expand Up @@ -181,7 +182,7 @@ jobs:

update:
needs: resolve-tag
uses: codeshelldev/gh-actions/.github/workflows/docker-image-go.yml@main
uses: codeshelldev/gh-actions/.github/workflows/docker-image.yml@main
name: Development Image
with:
registry: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
update:
needs: check
if: needs.check.outputs.continue == 'true'
uses: codeshelldev/gh-actions/.github/workflows/docker-image-go.yml@main
uses: codeshelldev/gh-actions/.github/workflows/docker-image.yml@main
name: Stable Image
with:
registry: ghcr.io
Expand Down
27 changes: 2 additions & 25 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,5 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Code coverage profiles and other test artifacts
*.out
coverage.*
*.coverprofile
profile.cov

# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace file
go.work
go.work.sum

# env file
*.env
# Env files
**/*.env

# Editor/IDE
# .idea/
Expand Down
29 changes: 19 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.26-alpine AS builder

ARG TARGETOS
ARG TARGETARCH

WORKDIR /app

COPY go.mod go.sum ./
RUN go mod download

COPY . .

RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
go build -ldflags="-s -w" -o /app/app .

FROM alpine:3.22

RUN apk --no-cache add ca-certificates

ARG IMAGE_TAG
ENV IMAGE_TAG=$IMAGE_TAG
LABEL org.opencontainers.image.version=$IMAGE_TAG

ENV SERVICE__PORT=8880

ENV DEFAULTS_PATH=/app/data/defaults.yml
ENV FAVICON_PATH=/app/data/favicon.ico

Expand All @@ -15,17 +29,12 @@ ENV TOKENS_DIR=/config/tokens

ENV DB_PATH=/db/db.sqlite3

ENV CGO_ENABLED=1

ARG TARGETOS
ARG TARGETARCH
ENV REDACT_TOKENS=true

WORKDIR /app

COPY . .

COPY dist/${TARGETOS}/${TARGETARCH}/app .
COPY --from=builder /app/app .

RUN rm dist/ -r
COPY data/ /app/data/

CMD ["./app"]
48 changes: 38 additions & 10 deletions data/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,44 @@ settings:
{ field: data, score: 1 },
]

variables:
recipients: ${RECIPIENTS}
number: ${NUMBER}
scheduling:
enabled: true

templating:
body: true
path: true
query: true

injecting:
urlToBody:
query: true
path: true

access:
endpoints:
- "!/v1/configuration"
- "!/v1/devices"
- "!/v1/register"
- "!/v1/unregister"
- "!/v1/qrcodelink"
- "!/v1/accounts"
- "!/v1/contacts"
blocked:
- pattern: /v1/configuration
matchType: prefix
- pattern: /v1/devices
matchType: prefix
- pattern: /v1/register
matchType: prefix
- pattern: /v1/unregister
matchType: prefix
- pattern: /v1/qrcodelink
matchType: prefix
- pattern: /v1/accounts
matchType: prefix
- pattern: /v1/contacts
matchType: prefix

cors:
methods: [GET, POST, PUT, PATCH, DELETE, OPTIONS]
headers:
[
"Content-Type",
"Content-Language",
"Authorization",
"Accept",
"Accept-Language",
]
2 changes: 0 additions & 2 deletions dev-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ export CONFIG_PATH=$DIR/.dev/config.yml
export TOKENS_DIR=$DIR/.dev/tokens
export DB_PATH=$DIR/.dev/db/db.sqlite3

export CGO_ENABLED=1

export API_URL=http://127.0.0.1:8881

export LOG_LEVEL=dev
Expand Down
35 changes: 22 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,43 +1,52 @@
module github.com/codeshelldev/secured-signal-api

go 1.25.6
go 1.26.1

require (
github.com/codeshelldev/gotl/pkg/configutils v0.0.16
github.com/codeshelldev/gotl/pkg/configutils v0.0.22
github.com/codeshelldev/gotl/pkg/docker v0.0.2
github.com/codeshelldev/gotl/pkg/ioutils v0.0.2
github.com/codeshelldev/gotl/pkg/jsonutils v0.0.2
github.com/codeshelldev/gotl/pkg/logger v0.0.8
github.com/codeshelldev/gotl/pkg/logger v0.0.18
github.com/codeshelldev/gotl/pkg/pretty v0.0.10
github.com/codeshelldev/gotl/pkg/query v0.0.4
github.com/codeshelldev/gotl/pkg/request v0.0.8
github.com/codeshelldev/gotl/pkg/request v0.0.10
github.com/codeshelldev/gotl/pkg/scheduler v0.0.9
github.com/codeshelldev/gotl/pkg/server/http v0.0.3
github.com/codeshelldev/gotl/pkg/stringutils v0.0.8
github.com/codeshelldev/gotl/pkg/templating v0.0.4
github.com/codeshelldev/gotl/pkg/templating v0.0.16
)

require (
github.com/go-viper/mapstructure/v2 v2.5.0
github.com/knadh/koanf/parsers/yaml v1.1.0
golang.org/x/time v0.14.0
golang.org/x/time v0.15.0
modernc.org/sqlite v1.47.0
)

require (
github.com/clipperhouse/uax29/v2 v2.6.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/ncruces/go-strftime v1.0.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
modernc.org/libc v1.70.0 // indirect
modernc.org/mathutil v1.7.1 // indirect
modernc.org/memory v1.11.0 // indirect
)

require (
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
github.com/google/uuid v1.6.0
github.com/knadh/koanf/maps v0.1.2 // indirect
github.com/knadh/koanf/providers/confmap v1.0.0 // indirect
github.com/knadh/koanf/providers/env/v2 v2.0.0 // indirect
github.com/knadh/koanf/providers/file v1.2.1 // indirect
github.com/knadh/koanf/v2 v2.3.2 // indirect
github.com/mattn/go-runewidth v0.0.19 // indirect
github.com/mattn/go-sqlite3 v1.14.34
github.com/knadh/koanf/v2 v2.3.4 // indirect
github.com/mattn/go-runewidth v0.0.21 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.1 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/sys v0.41.0 // indirect
golang.org/x/sys v0.42.0 // indirect
)
Loading
Loading