Skip to content

Repository files navigation

GoACS

GoACS is an Auto Configuration Server (ACS) implementing the TR-069/CWMP protocol for remote management of customer-premises equipment (routers, ONTs, and similar devices). It includes a REST API and a Vue 3 admin panel for managing devices, parameters, provisioning rules, firmware, and users.

This is a Go rewrite of an original Laravel/Vue 2 implementation, with its own REST API contract (see AGENTS.md for details — it is not wire-compatible with the original).

Features

  • TR-069/CWMP session handling: Inform, GetParameterValues/Names, SetParameterValues, AddObject/DeleteObject, Reboot, FactoryReset, Download, transfer complete, faults
  • Task queue per device (reboot, factory reset, firmware upload, add/delete object, run script) and global tasks
  • Provisioning rules engine: match CWMP events/requests/parameter conditions, run Lua scripts against the device automatically
  • Parameter templates, assignable to devices with priority
  • On-demand parameter lookup and forced re-provisioning via Connection Request
  • Firmware/file storage with upload/download
  • Live device log streaming over Socket.IO, plus paginated log/fault history
  • JWT-authenticated REST API and a Vue 3 admin panel (PrimeVue, Pinia)

Architecture

goacs-go/
├── acs/          TR-069/CWMP protocol engine
├── http/         Gin REST API + Socket.IO
├── repository/   MySQL/MariaDB data access
├── models/       Domain types
├── contrib/      SQL migrations + DB config
└── frontend/     Vue 3 admin panel (separate app, own deployment)

The backend and frontend are deployed independently (separate processes/origins) and talk over HTTP + CORS + Socket.IO. See AGENTS.md for a full tour of the codebase, conventions, and known gotchas.

Prerequisites

  • Go 1.23+
  • Node.js 20+ and npm
  • Docker (for the bundled MariaDB), or your own MySQL/MariaDB 10.4+ instance

Quick start

Backend:

cp .env.example .env
# edit .env if you need to change ports/credentials — defaults work out of the box
docker compose up -d goacs-db     # starts MariaDB (schema is not auto-applied, see below)
go run main.go migrate            # applies contrib/database/*.sql, tracked in schema_migrations
go run main.go                    # ACS + API server on :8085

Frontend:

cd frontend
npm install
npm run dev                       # dev server on :5173

Open http://localhost:5173 and log in with the seeded admin / admin account.

Configuration

Key environment variables (see .env.example for the full list):

Variable Purpose
HTTP_PORT Port for both the CWMP (/acs) and REST (/api) endpoints
JWT_SECRET Signing secret for API auth tokens — change this for anything beyond local dev
CORS_ALLOWED_ORIGINS Comma-separated origins allowed to call the API / connect over Socket.IO (must include the frontend's dev/prod origin)
MYSQL_* Database connection
FILESTORE_PATH Where uploaded firmware/files are stored (local driver)
FILESTORE_DRIVER local (default) or s3 — see .env.example for the S3_* variables the s3 driver reads
REDIS_ADDR Optional; only needed when running multiple backend replicas, see examples/high-availability/

Production deployment

docker-compose.prod.yml runs the full stack (DB + backend + frontend) from published GHCR images (ghcr.io/goacs/goacs-go-backend, ghcr.io/goacs/goacs-go-frontend) — no local build required:

cp .env.example .env   # fill in MYSQL_*, JWT_SECRET, etc.
docker compose -f docker-compose.prod.yml up -d

This runs a single backend instance — the frontend's own nginx proxies /api, /socket.io and /file straight to it. It's the right starting point for most deployments.

Multiple backend replicas (high availability)

Need to handle more CPE devices than one backend process can? See examples/high-availability/ for a variant that runs several backend replicas behind Traefik sharing one database. CWMP sessions and Socket.IO connections live in a single backend process's memory (see AGENTS.md), so this needs two extra pieces the single-instance stack doesn't: a sticky cookie (Traefik pins each client to one replica) and a Redis relay (fans device.logged events out to every replica so the admin panel gets live updates regardless of which replica handled a given device). See that directory's README for the full rundown, including known gotchas found while building it.

Testing

go build ./...
go test ./...
cd frontend
npx vue-tsc -b --noEmit
npm run build

Manual API testing: .http request files are in testrequests/ (compatible with the VS Code REST Client extension or JetBrains' HTTP Client).

Contributing

See AGENTS.md for codebase conventions, the REST response envelope shape, and a list of known gotchas worth reading before you change the ACS engine or the repository layer.

Sponsors

GRUPA MULTIPLAY

About

Old repository written in Go

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages