Skip to content
This repository was archived by the owner on Jan 19, 2026. It is now read-only.

Commit 180258b

Browse files
author
GitLab CI
committed
Release v1.0.0
0 parents  commit 180258b

26 files changed

Lines changed: 5350 additions & 0 deletions

.dockerignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Git
2+
.git
3+
.gitignore
4+
5+
# IDE and Editor
6+
.vscode
7+
.idea
8+
*.swp
9+
*.swo
10+
*~
11+
12+
# Build outputs
13+
technitium-companion
14+
*.exe
15+
16+
# Test files
17+
*_test.go
18+
coverage.out
19+
coverage.html
20+
21+
# Documentation
22+
*.md
23+
!README.md
24+
docs/
25+
26+
# CI/CD
27+
.gitlab-ci.yml
28+
.github/
29+
30+
# Docker
31+
Dockerfile*
32+
docker-compose*.yml
33+
.docker
34+
35+
# Development
36+
.env
37+
.env.*
38+
secrets/
39+
tmp/

.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Binaries
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
/technitium-companion
8+
9+
# Test binary
10+
*.test
11+
12+
# Output of go coverage
13+
*.out
14+
coverage.html
15+
16+
# Dependency directories
17+
vendor/
18+
19+
# IDE
20+
.idea/
21+
.vscode/
22+
*.swp
23+
*.swo
24+
25+
# Build artifacts
26+
/bin/
27+
/dist/
28+
29+
# Environment files (may contain secrets)
30+
.env
31+
.env.local
32+
*.env
33+
34+
# OS files
35+
.DS_Store
36+
Thumbs.db

CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [1.0.0] - 2026-01-03
9+
10+
Initial stable release.
11+
12+
### Features
13+
14+
- Automatic DNS A record management for Docker containers with Traefik labels
15+
- Docker Swarm support with service label detection
16+
- Real-time event watching for container start/stop events
17+
- Startup reconciliation to sync existing containers
18+
- Include/exclude regex patterns for hostname filtering
19+
- Prometheus metrics endpoint with detailed operational metrics
20+
- Health and readiness endpoints for orchestrator integration
21+
- Docker secrets support via `_FILE` suffix on environment variables
22+
- Dry run mode for testing configuration
23+
- Multi-architecture Docker images (linux/amd64, linux/arm64)
24+
- Docker socket proxy compatibility
25+
26+
### Configuration
27+
28+
- `TECHNITIUM_URL`: Technitium DNS server URL (required)
29+
- `TECHNITIUM_TOKEN`: API token (required, supports `_FILE` suffix)
30+
- `TECHNITIUM_ZONE`: DNS zone to manage (required)
31+
- `TARGET_IP`: IP address for A records (required)
32+
- `TTL`: Record TTL in seconds (default: 300)
33+
- `INCLUDE_PATTERN`: Regex for hostnames to include (default: `.*`)
34+
- `EXCLUDE_PATTERN`: Regex for hostnames to exclude
35+
- `DOCKER_HOST`: Docker socket or TCP address
36+
- `DOCKER_MODE`: `auto`, `swarm`, or `standalone`
37+
- `RECONCILE_ON_STARTUP`: Run full sync at startup (default: true)
38+
- `DRY_RUN`: Log changes without applying (default: false)
39+
- `HEALTH_PORT`: Port for health/metrics endpoints (default: 8080)
40+
- `LOG_LEVEL`: Logging verbosity (default: info)

CONTRIBUTING.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Contributing to technitium-companion
2+
3+
Thank you for your interest in contributing.
4+
5+
## Getting Started
6+
7+
1. Fork the repository
8+
2. Clone your fork locally
9+
3. Create a feature branch from `main`
10+
11+
## Development Setup
12+
13+
```bash
14+
# Clone your fork
15+
git clone https://github.com/YOUR_USERNAME/technitium-companion.git
16+
cd technitium-companion
17+
18+
# Install dependencies
19+
go mod download
20+
21+
# Run tests
22+
go test -v ./...
23+
24+
# Build locally
25+
go build -o technitium-companion ./cmd/technitium-companion
26+
```
27+
28+
## Making Changes
29+
30+
1. Create a feature branch:
31+
```bash
32+
git checkout -b feature/your-feature-name
33+
```
34+
35+
2. Make your changes and add tests where appropriate
36+
37+
3. Run tests and linting:
38+
```bash
39+
go test -v ./...
40+
go vet ./...
41+
```
42+
43+
4. Commit with a descriptive message:
44+
```bash
45+
git commit -m "feat: add support for X"
46+
```
47+
48+
Follow [Conventional Commits](https://www.conventionalcommits.org/) format:
49+
- `feat:` new feature
50+
- `fix:` bug fix
51+
- `docs:` documentation only
52+
- `refactor:` code change that neither fixes a bug nor adds a feature
53+
- `test:` adding or updating tests
54+
- `chore:` maintenance tasks
55+
56+
5. Push to your fork:
57+
```bash
58+
git push origin feature/your-feature-name
59+
```
60+
61+
6. Open a Pull Request against the `main` branch
62+
63+
## Code Style
64+
65+
- Follow standard Go conventions
66+
- Use `gofmt` for formatting
67+
- Add comments for exported functions and types
68+
- Keep functions focused and reasonably sized
69+
70+
## Testing
71+
72+
- Add unit tests for new functionality
73+
- Ensure existing tests pass before submitting
74+
- Test with both standalone Docker and Swarm modes if applicable
75+
76+
## Questions
77+
78+
If you have questions, open an issue for discussion before starting work on large changes.

Dockerfile

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# =============================================================================
2+
# technitium-companion - Multi-Stage Dockerfile
3+
# =============================================================================
4+
#
5+
# Image Strategy:
6+
# :dev - Development/integration testing (develop branch)
7+
# :edge - Bleeding edge from main branch
8+
# :latest - Latest stable release (version tags)
9+
# :vX.Y.Z - Specific version
10+
# :sha-XXX - Specific commit for debugging
11+
#
12+
# Build commands:
13+
# docker build -t technitium-companion:latest .
14+
# docker build --platform linux/amd64,linux/arm64 -t technitium-companion:latest .
15+
#
16+
# Multi-arch support: amd64 + arm64
17+
# =============================================================================
18+
19+
ARG GO_VERSION=1.24
20+
ARG ALPINE_VERSION=3.20
21+
22+
# -----------------------------------------------------------------------------
23+
# Stage 1: Go Builder (Multi-Arch Cross-Compilation)
24+
# -----------------------------------------------------------------------------
25+
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine AS builder
26+
27+
# Build arguments for multi-arch support
28+
ARG TARGETPLATFORM
29+
ARG TARGETOS
30+
ARG TARGETARCH
31+
ARG VERSION=dev
32+
33+
WORKDIR /build
34+
35+
# Install build dependencies
36+
RUN apk add --no-cache git ca-certificates tzdata
37+
38+
# Copy go mod files first for layer caching
39+
COPY go.mod go.sum ./
40+
RUN go mod download
41+
42+
# Copy source
43+
COPY . .
44+
45+
# Build with cross-compilation for target architecture
46+
# CGO_ENABLED=0 ensures pure Go build (no C dependencies)
47+
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH:-amd64} go build \
48+
-ldflags="-s -w -X main.Version=${VERSION} -X main.BuildDate=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
49+
-o technitium-companion \
50+
./cmd/technitium-companion
51+
52+
# Verify binary
53+
RUN ls -la technitium-companion && file technitium-companion || true
54+
55+
# -----------------------------------------------------------------------------
56+
# Stage 2: Runtime (Alpine)
57+
# -----------------------------------------------------------------------------
58+
FROM alpine:${ALPINE_VERSION}
59+
60+
# Labels
61+
LABEL org.opencontainers.image.title="technitium-companion" \
62+
org.opencontainers.image.description="Automatic DNS record management for Docker containers via Technitium" \
63+
org.opencontainers.image.source="https://gitlab.bluewillows.net/root/technitium-companion" \
64+
org.opencontainers.image.vendor="bluewillows.net"
65+
66+
# Install runtime dependencies
67+
RUN apk add --no-cache ca-certificates tzdata wget
68+
69+
# Create non-root user
70+
RUN addgroup -g 1000 companion && \
71+
adduser -u 1000 -G companion -s /bin/sh -D companion
72+
73+
# Copy binary from builder
74+
COPY --from=builder /build/technitium-companion /usr/local/bin/technitium-companion
75+
76+
# Ensure binary is executable
77+
RUN chmod +x /usr/local/bin/technitium-companion
78+
79+
# Default environment variables (can be overridden)
80+
ENV TECHNITIUM_URL="" \
81+
TECHNITIUM_TOKEN="" \
82+
TECHNITIUM_ZONE="" \
83+
TARGET_IP="" \
84+
LOG_LEVEL="info" \
85+
HEALTH_PORT="8080"
86+
87+
# Health check
88+
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
89+
CMD wget -qO- http://localhost:8080/health || exit 1
90+
91+
# Run as non-root user
92+
# Note: When mounting Docker socket, ensure socket has appropriate permissions
93+
# or run as root if needed for Docker API access
94+
USER companion
95+
96+
# Expose health port
97+
EXPOSE 8080
98+
99+
ENTRYPOINT ["/usr/local/bin/technitium-companion"]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 maxfield-allison
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)