sunet-cdn-manager

command module
v0.0.0-...-a048ba5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2025 License: BSD-2-Clause-Views Imports: 7 Imported by: 0

README

sunet-cdn-manager

This is the SUNET CDN manager server which serves an API and UI for configuring the CDN service.

Development

Running tests

Running tests require a local PostgreSQL 15 or newer. The need for at least version 15 is because the database setup expects the "Constrain ordinary users to user-private schemas" schema usage pattern as described at https://www.postgresql.org/docs/current/ddl-schemas.html#DDL-SCHEMAS-PATTERNS

If running macOS the following can be done prior to running tests:

brew install postgresql@17
export PATH="/opt/homebrew/opt/postgresql@17/bin:$PATH"

Some tests utilize Testcontainers for Go (specifically for running sunet-vcl-validator). This means you also need to be able to run containers for these tests to work.

Setting up a local dev enviroment

Start database, keycloak and sunet-vcl-validator:

docker compose -p sunet-cdn-manager -f local-dev/docker-compose.yml up

Initialize the sunet-cdn-manager realm in keycloak:

local-dev/keycloak/setup.sh

Create a config file for connecting insecurely to the local PostgreSQL database:

sed -e 's/"verify-full"/"disable"/' -e 's/"password"/"cdn"/' sunet-cdn-manager.toml.sample > sunet-cdn-manager-dev.toml

Initialize the sunet-cdn-manager database (this will print out a superuser username and password):

go run . --config sunet-cdn-manager-dev.toml init

Start the server in development mode (disables cookie requirements for HTTPS):

go run . --config sunet-cdn-manager-dev.toml server --dev
Formatting and linting

When working with this code at least the following tools are expected to be run at the top level directory prior to commiting:

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
components
templ: version: v0.3.833
templ: version: v0.3.833

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL