No description https://txlog.rda.run
  • Go 57.7%
  • HTML 39.2%
  • Shell 1.7%
  • CSS 0.6%
  • PLpgSQL 0.5%
  • Other 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Rodrigo de Avila 0fe0665a2e
changelog: release 1.39.3 with dependency updates
Bump .version to 1.39.3 and record the x/crypto and kumo updates in the changelog.
2026-11-16 08:57:12 -03:00
.github go: bump toolchain to 1.27.4 2026-11-16 08:53:15 -03:00
.vscode Remove recommendation for the 'continue' extension from VSCode settings 2025-03-24 22:45:45 -03:00
auth refactor: log through slog directly and drop the logger package 2026-09-01 19:35:20 -03:00
controllers api: resend transactions stored without an end time 2026-11-10 12:16:15 -03:00
database osv: store upstream CVEs and add CVE assets endpoint 2026-11-10 09:49:24 -03:00
docs api: resend transactions stored without an end time 2026-11-10 12:16:15 -03:00
images style: update os icon colors to match theme 2026-02-23 19:48:02 -03:00
internal/testdb tests: add make test, running the suite against a Podman PostgreSQL 2026-08-30 10:45:38 -03:00
middleware refactor: log through slog directly and drop the logger package 2026-09-01 19:35:20 -03:00
models refactor: log through slog directly and drop the logger package 2026-09-01 19:35:20 -03:00
scheduler osv: store upstream CVEs and add CVE assets endpoint 2026-11-10 09:49:24 -03:00
scripts docs: consolidate the LDAP guides, drop the unbuilt schema-compare proposal 2026-09-01 19:35:20 -03:00
static/css deps: update Go and npm modules 2026-11-10 10:05:15 -03:00
statistics refactor: log through slog directly and drop the logger package 2026-09-01 19:35:20 -03:00
templates osv: store upstream CVEs and add CVE assets endpoint 2026-11-10 09:49:24 -03:00
tests migrations: require full timestamp prefixes and document the tooling 2026-08-30 10:45:38 -03:00
util osv: store upstream CVEs and add CVE assets endpoint 2026-11-10 09:49:24 -03:00
version feat: change version definition to .version file 2025-12-04 18:46:28 -03:00
.air.toml feat: migrate UI styling to Kumo design system and replace Tailwind configuration with CLI integration 2026-07-21 17:54:17 -03:00
.editorconfig api/v1: accept transaction id lookup via query parameters 2026-08-17 19:13:16 -03:00
.gitignore api/v1: accept transaction id lookup via query parameters 2026-08-17 19:13:16 -03:00
.golangci.yml refactor: coordinate scheduled jobs with PostgreSQL advisory locks 2026-09-01 19:35:20 -03:00
.markdownlint.json feat: Add LDAP authentication support (#79) 2025-10-07 16:33:13 -03:00
.version changelog: release 1.39.3 with dependency updates 2026-11-16 08:57:12 -03:00
CHANGELOG.md changelog: release 1.39.3 with dependency updates 2026-11-16 08:57:12 -03:00
cosign.pub feat: update image signature 2026-01-11 21:40:22 -03:00
Dockerfile Add VERSION and BUILD_DATE build arguments to Docker build workflow 2026-01-11 18:38:03 -03:00
go.mod deps: update x/crypto to 0.59.0 and kumo to 2.18.1 2026-11-16 08:55:59 -03:00
go.sum deps: update x/crypto to 0.59.0 and kumo to 2.18.1 2026-11-16 08:55:59 -03:00
LICENSE chore: bump version to 1.19.1 2026-01-11 18:41:12 -03:00
main.go osv: store upstream CVEs and add CVE assets endpoint 2026-11-10 09:49:24 -03:00
Makefile docs: consolidate the LDAP guides, drop the unbuilt schema-compare proposal 2026-09-01 19:35:20 -03:00
package-lock.json deps: update x/crypto to 0.59.0 and kumo to 2.18.1 2026-11-16 08:55:59 -03:00
package.json refactor: remove dead code and the scheduler trigger indirection 2026-09-01 19:35:20 -03:00
README.md go: bump toolchain to 1.27.4 2026-11-16 08:53:15 -03:00

Transaction Log Server

The Logo

Server to receive data from Txlog Agent

SemVer Format Keep a Changelog Contributor Covenant
NewReleases Ask DeepWiki

This repository contains the code for the Txlog Server.

Alt

Installation

Docker
docker pull ghcr.io/txlog/server:main

docker run -d -p 8080:8080 \
  -e INSTANCE=Datacenter 001 \
  -e LOG_LEVEL=INFO \
  -e PGSQL_HOST=postgres.example.com \
  -e PGSQL_PORT=5432 \
  -e PGSQL_USER=txlog \
  -e PGSQL_DB=txlog \
  -e PGSQL_PASSWORD=your_db_password \
  -e PGSQL_SSLMODE=require \
  -e CRON_RETENTION_DAYS=7 \
  -e CRON_RETENTION_EXPRESSION=0 2 * * * \
  -e CRON_STATS_EXPRESSION=0 * * * * \
  -e CRON_OSV_EXPRESSION=0 4 * * * \
  ghcr.io/txlog/server:main
Kubernetes
apiVersion: apps/v1
kind: Deployment
metadata:
  name: txlog-server
spec:
  replicas: 3
  selector:
    matchLabels:
      app: txlog-server
  template:
    metadata:
      labels:
        app: txlog-server
    spec:
      containers:
      - name: txlog-server
        image: ghcr.io/txlog/server:main
        ports:
        - containerPort: 8080
        livenessProbe:
          httpGet:
            path: /health
            port: 8080
          initialDelaySeconds: 5
          periodSeconds: 10
        readinessProbe:
          httpGet:
            path: /health
            port: 8080
          initialDelaySeconds: 5
          periodSeconds: 10
        env:
        - name: INSTANCE
          value: "Datacenter 001"
        - name: LOG_LEVEL
          value: "INFO"
        - name: PGSQL_HOST
          value: "postgres.example.com"
        - name: PGSQL_PORT
          value: "5432"
        - name: PGSQL_USER
          value: "txlog"
        - name: PGSQL_DB
          value: "txlog"
        - name: PGSQL_PASSWORD
          valueFrom:
            secretKeyRef:
              name: txlog-secrets
              key: db-password
        - name: PGSQL_SSLMODE
          value: "require"
        - name: CRON_RETENTION_DAYS
          value: 7
        - name: CRON_RETENTION_EXPRESSION
          value: 0 2 * * *
        - name: CRON_STATS_EXPRESSION
          value: 0 * * * *
        - name: CRON_OSV_EXPRESSION
          value: 0 4 * * *

Image Signature Verification

All Docker images from v1.19.1 and above published to ghcr.io/txlog/server are digitally signed using Cosign from the Sigstore project. This ensures the authenticity and integrity of the images you pull.

Verifying an Image
cosign verify \
  --key https://raw.githubusercontent.com/txlog/server/main/cosign.pub \
  ghcr.io/txlog/server:latest

Or, if you have cloned this repository:

cosign verify \
  --key cosign.pub \
  ghcr.io/txlog/server:latest

A successful verification will display the image digest and signature details. If the signature is invalid or missing, cosign will return an error.

Development

To make changes on this project, you need:

Golang
wget https://go.dev/dl/go1.27.4.linux-amd64.tar.gz
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf go1.27.4.linux-amd64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc
source ~/.bashrc
rm go1.27.4.linux-amd64.tar.gz
Swaggo
curl -fsSL https://install.rda.run/swaggo/swag@latest! | bash
Air
curl -fsSL https://install.rda.run/air-verse/air@latest! | bash
A `.env` file
INSTANCE=Development environment
LOG_LEVEL=DEBUG
GIN_MODE=debug
PGSQL_HOST=127.0.0.1
PGSQL_PORT=5432
PGSQL_USER=postgres
PGSQL_DB=txlog
PGSQL_PASSWORD=your_db_password
PGSQL_SSLMODE=require
CRON_RETENTION_DAYS=1
CRON_RETENTION_EXPRESSION=0 2 * * *
CRON_STATS_EXPRESSION=0 * * * *
CRON_OSV_EXPRESSION=0 4 * * *

# OIDC Authentication (Optional)
OIDC_ISSUER_URL=https://id.example.com
OIDC_CLIENT_ID=your_oidc_client_id
OIDC_CLIENT_SECRET=your_oidc_client_secret
OIDC_REDIRECT_URL=https://txlog.example.com/auth/callback
OIDC_SKIP_TLS_VERIFY=false

# LDAP Authentication (Optional)
LDAP_HOST=ldap.example.com
LDAP_PORT=389
LDAP_USE_TLS=false
LDAP_BIND_DN=cn=admin,dc=example,dc=com
LDAP_BIND_PASSWORD=your_bind_password
LDAP_BASE_DN=ou=users,dc=example,dc=com
LDAP_USER_FILTER=(uid=%s)
LDAP_ADMIN_GROUP=cn=admins,ou=groups,dc=example,dc=com
LDAP_VIEWER_GROUP=cn=viewers,ou=groups,dc=example,dc=com
LDAP_GROUP_FILTER=(member=%s)
UI & CSS

The UI uses Kumo UI and Tailwind CSS v4 compiled via npm. Ensure you have npm installed, and run:

npm install

The source CSS is in static/css/input.css. The compiled output is static/css/style.css.

Authentication Configuration

Txlog Server supports three authentication modes:

  1. No Authentication (Default): If neither OIDC nor LDAP is configured, the server runs without authentication
  2. OIDC Authentication: Configure OIDC environment variables to enable OpenID Connect authentication
  3. LDAP Authentication: Configure LDAP environment variables to enable LDAP authentication
  4. Both OIDC and LDAP: Both can be enabled simultaneously, allowing users to choose their preferred authentication method
LDAP Configuration Details
  • LDAP_HOST (Required): LDAP server hostname
  • LDAP_PORT: LDAP server port (default: 389 for LDAP, 636 for LDAPS)
  • LDAP_USE_TLS: Enable TLS connection (default: false)
  • LDAP_SKIP_TLS_VERIFY: Skip TLS certificate verification for self-signed certificates (default: false)
  • LDAP_BIND_DN (Optional): Distinguished Name for service account bind
    • Not required if your LDAP allows anonymous searches
    • Recommended for Active Directory and restricted LDAP servers
  • LDAP_BIND_PASSWORD (Optional): Password for service account
  • LDAP_BASE_DN (Required): Base DN for user searches
  • LDAP_USER_FILTER: LDAP filter for finding users (default: (uid=%s), where %s is replaced with username)
  • LDAP_ADMIN_GROUP: DN of the admin group (users in this group have full admin access)
  • LDAP_VIEWER_GROUP: DN of the viewer group (users in this group have read-only access)
  • LDAP_GROUP_FILTER: LDAP filter for checking group membership (default: (member=%s), where %s is replaced with user DN)

Note: At least one of LDAP_ADMIN_GROUP or LDAP_VIEWER_GROUP must be configured. Users must be members of at least one of these groups to authenticate successfully.

Service Account: LDAP_BIND_DN and LDAP_BIND_PASSWORD are optional. If not provided, the server will:

  • Use anonymous bind for user searches (works with OpenLDAP)
  • Use the authenticated user's session for group membership checks
  • Active Directory typically requires a service account

Development commands

The Makefile contains all the necessary commands for development. You can run make to view all options.

  • make run: start the development server with hot-reload (Air)
  • make css: build the Tailwind CSS (minified)
  • make build: build a production-ready binary (rebuilds CSS first)
  • make clean: remove compiled binaries and packages
  • make doc: write the swagger documentation based on method comments

Air is configured to rebuild the Tailwind CSS automatically before each Go build, so make run is all you need — CSS is regenerated whenever you change templates.

The server will run at http://localhost:8080 and the Swagger docs at http://localhost:8080/swagger/index.html.

Contributing

  1. Fork it (https://github.com/txlog/server/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request