garm/webapp
Gabriel Adrian Samfira 5fdb69ac18 Add the ability to set tools download source (Gitea)
This change adds 2 new options to gitea forge endpoints:

* Tools metadata URL
* Use internal tools URLs

By default, GARM looks in the releases page of the gitea arc_runner
to determine where it can download the runner binary from for a particular
OS/arch. The tools metadata URL option can be set on an endpoint and can point
to a mirror of the upstream repo. The requirement is that the asset names
exactly mirror upstream naming conventions.

The second option disables GARM calling out to the tools metadata URL entirely.
GARM has some hardcoded values for nightly binaries. If this option is checked,
GARM will use those values, without making any kind of outgoing API call to
determine availability. This is useful in air-gapped environments.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2025-09-26 18:59:15 +03:00
..
assets Add the ability to set tools download source (Gitea) 2025-09-26 18:59:15 +03:00
src Add the ability to set tools download source (Gitea) 2025-09-26 18:59:15 +03:00
static Add SPA UI for GARM 2025-08-16 09:09:13 +00:00
.env.development Add SPA UI for GARM 2025-08-16 09:09:13 +00:00
.env.example Add SPA UI for GARM 2025-08-16 09:09:13 +00:00
DEV_SETUP.md Add SPA UI for GARM 2025-08-16 09:09:13 +00:00
openapitools.json Add SPA UI for GARM 2025-08-16 09:09:13 +00:00
package-lock.json Add runner install template management (#525) 2025-09-23 13:46:27 +03:00
package.json Add runner install template management (#525) 2025-09-23 13:46:27 +03:00
postcss.config.js Add SPA UI for GARM 2025-08-16 09:09:13 +00:00
README.md Add SPA UI for GARM 2025-08-16 09:09:13 +00:00
svelte.config.js Add SPA UI for GARM 2025-08-16 09:09:13 +00:00
swagger.yaml Add the ability to set tools download source (Gitea) 2025-09-26 18:59:15 +03:00
tailwind.config.js Add SPA UI for GARM 2025-08-16 09:09:13 +00:00
tsconfig.json Add SPA UI for GARM 2025-08-16 09:09:13 +00:00
vite.config.ts Add SPA UI for GARM 2025-08-16 09:09:13 +00:00
vitest.config.ts Add web UI tests 2025-08-21 20:36:50 +00:00

GARM SPA (SvelteKit)

This is a Single Page Application (SPA) implementation of the GARM web interface using SvelteKit.

Features

  • Lightweight: Uses SvelteKit for minimal bundle size and fast performance
  • Modern: TypeScript-first development with full type safety
  • Responsive: Mobile-first design using Tailwind CSS
  • Real-time: WebSocket integration for live updates
  • API-driven: Uses the existing GARM REST API endpoints

Quick Start

  1. Clone the repository (if not already done)
git clone https://github.com/cloudbase/garm.git
cd garm
  1. Build and test GARM with embedded webapp
# You can skip this command if you made no changes to the webapp.
make build-webui
# builds the binary, with the web UI embedded.
make build

Make sure you enable the webui in the config:

[apiserver.webui]
  enable=true
  1. Access the webapp
    • Navigate to http://localhost:9997/ui/ (or your configured fqdn and port)

Development Workflow

See the DEV_SETUP.md file.

Git Workflow

DO NOT commit the following directories:

  • webapp/node_modules/ - Dependencies (managed by package-lock.json)
  • webapp/.svelte-kit/ - Build cache and generated files
  • webapp/build/ - Production build output

These are already included in .gitignore. Only commit source files in webapp/src/ and configuration files.

API Client Generation

The webapp uses auto-generated TypeScript clients from the GARM OpenAPI spec using go generate. To regenerate the clients, mocks and everything else, run:

go generate ./...

In the root folder of the project.

Note

See DEV_SETUP.md for prerequisites, before you try to generate the files.

Asset Serving

The webapp is embedded using Go's embed package in webapp/assets/assets.go:

//go:embed all:*
var EmbeddedSPA embed.FS

This allows GARM to serve the entire webapp with zero external dependencies. The webapp assets are compiled into the Go binary at build time.

Running GARM behind a reverse proxy

In production, GARM will serve the web UI and assets from the embedded files inside the binary. The web UI also relies on the events API for real-time updates.

To have a fully working experience, you will need to configure your reverse proxy to allow websocket upgrades. For an nginx example, see the sample config in the testdata folder.

Additionally, in production you can also override the default web UI that is embedded in GARM, without updating the garm binary. To do that, build the webapp, place it in the document root of nginx and create a new location /ui config in nginx. Something like the following should work:

    # Place this before the proxy_pass location
    location ~ ^/ui(/.*)?$ {
        root /var/www/html/garm-webui/;
    }

    location / {
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Host $http_host;

        proxy_pass http://garm_backend;
        proxy_set_header        Host    $Host;
        proxy_redirect off;
    }

This should allow you to override the default web UI embedded in GARM without updating the GARM binary.