Skip to content

Repository files navigation

CoLink Server

Backend API server, WebSocket relay, and update service for CoLink.

Tech stack: Go 1.24 · Gin · GORM · PostgreSQL 16 · Gorilla WebSocket · golang-jwt · Docker

Development

docker compose -f docker-compose.dev.yml up -d --build

The server container serves the production console. For frontend development, run the Vite development server from another terminal:

pnpm --dir web/console install --frozen-lockfile
pnpm --dir web/console dev

To use a specific .env file:

docker compose --env-file .env -f docker-compose.dev.yml up -d --build

Note: when the same variable exists in both the terminal environment and the .env file, the terminal value takes precedence. Use --env-file to force file values.

Production

# Get a Github token at https://github.com/settings/personal-access-tokens, remember to enable the read:packages permission for this token
# `docker login ghcr.io` via this token

mkdir -p colink-server/deploy/nginx
cd colink-server

curl -fsSLO https://raw.githubusercontent.com/CoLinkDev/colink-server/master/.env.example
curl -fsSLO https://raw.githubusercontent.com/CoLinkDev/colink-server/master/docker-compose.yml
curl -fsSLo deploy/nginx/default.conf https://raw.githubusercontent.com/CoLinkDev/colink-server/master/deploy/nginx/default.conf

cp .env.example .env

# Edit .env and fill in required variables

docker compose pull
docker compose up -d

The Docker image builds the Vue console from web/console and embeds its dist output into the server binary.

Environment Variables

See .env.example. CoLink binaries read COLINK_* variables directly, and Docker Compose passes the same names into containers.

Services

Service Responsibility
nginx Public entrypoint and path routing
server Auth, account, device API, WebSocket tickets, WebSocket relay, frontend fallback
update GitHub release checks, cached update metadata, update asset downloads
postgres PostgreSQL storage

The server does not persist messages, files, or clipboard content — it only relays WebSocket frames between authenticated devices belonging to the same user.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages