Skip to content

Viaalink CLI v4.0.0

Choose a tag to compare

@kwuite kwuite released this 13 Nov 13:22
· 4 commits to main since this release

Viaalink CLI 4.0 brings Viaalink CI/CD: a live terminal or VS Code on a GitHub Actions runner, published through your relay and started from your laptop with one command, plus temporary addresses for the services your job runs. Project state moves from .asd/ to .via/, Caddy now listens on this machine only, and no command puts a login into a URL any more. This is a major release: read Breaking changes / upgrading before you update.

New: Viaalink CI/CD

  • via ci install adds a short .github/workflows/terminal.yml that calls the Viaalink CI/CD Action (uses: viaalink/cicd@v2; workflows that still say viaalink/ci-terminal@v2 keep working). Installing the CLI on the runner, the login, publishing through the relay and cleanup all live in the Action, so fixes reach your repository without reinstalling the workflow. via ci on its own lists its commands.
  • via ci install --runs-on self-hosted,linux,x64 runs the terminal on your own self-hosted runners. At a terminal, via ci install asks where the terminal runs and offers custom labels.
  • via gh setup installs the workflow and stores its repository secrets for you, after asking (the relay key, its host key pins and the terminal password VIA_TERMINAL_PASSWORD). Values go to gh secret set on stdin and are never printed. --relay <name> picks which enrolled relay's key to store; with several relays and no --relay, it asks.
  • via gh terminal starts a session: "Start terminal.yml in on (runner , terminal)? [Y/n]". It prints Published: https://…/, how to sign in, and via gh stop <run>, then returns. --watch keeps following the run until it ends. --interface codeserver opens VS Code instead of a shell; --show-login also prints the address with the login in it.
  • via gh terminal works with the Action and with the CLI's own terminal.yml, follows the run it started (not a colleague's), and reopens your running session instead of queueing a second one.
  • The version step offers the workflow's default (recommended), the latest release, the latest nightly, or a version you type.
  • via gh active lists running sessions; via gh runs shows terminal runs as a table; via gh stop stops a session.

New: project state in .via/

  • The CLI keeps a project's local state in .via/ (.via/workspace/, .via/state/) and no longer writes .asd/ into a project.
  • When it creates .via/ in a git repository, it adds .via/ to the project's .gitignore once and says so, unless git already ignores it. CRLF line endings are kept. Outside a git repository, or in a repository at your home folder, no .gitignore is touched.

Other additions

  • dial: 5175 in via.yaml (and in net.manifest.yaml) means localhost:5175. host:port keeps working.
  • Databases: a service can declare database: { engine: postgres, … }, and via database start lists it in DbGate as a ready connection (no password stored). tunnelProtocol: tcp with inspect: true shows each Postgres connection's SQL in the network inspector; with public: true the database gets a raw TCP port on your relay through via net apply --tunnel. Only the database's own login stands in front of that port, and via net apply says so.
  • via deps install --binary caddy installs Viaalink's own Caddy 2.11.7 build (DNS-01 providers, authentication and layer4 plugins) on Linux, macOS and Windows, x64 and arm64. Run it with --force to switch an existing install. VIA_CADDY_BASE_URL takes Caddy from your own folder or URL of builds, checked against its SHA256SUMS.txt.
  • After via net apply changes a service's env: values in .env, it names each changed key and the service to restart. Values are not printed.
  • via doctor has an "App listeners" check, and via diagnose checks the relay, device key, DNS and SSH port that the relay client actually uses.

Changed

  • Output leads with the address to share: Published: https://…, then Local route: … (this machine only) and Your app: localhost:<port>, in via expose, via expose list, via files, via net and via net urls. via net urls marks services that need a login.
  • The login in front of a public: true service in via.yaml now follows your preferences.expose_auth choice, as via expose already did. Terminals, code editors, database tools and Mailpit always keep their login. Change it with via config set preferences.expose_auth always|sensitive-only|never.
  • via read-env masks passwords, secrets, tokens, keys and logins inside URLs; --show-secrets prints them. via read-env NAME prints only that value.
  • A refused login shows a short page ("This address needs a login. Ask whoever shared it.") instead of a blank one.
  • The default local host is via.localhost (was asd.localhost), and a service without its own path or host answers on /via/<service> (was /asde/<service>). See upgrading below.

Breaking changes / upgrading

  • via devinci is gone. Use via ci (via ci install).
  • Project state moves from .asd/ to .via/. While services an earlier version started still run from .asd/ (Caddy, and the services and tunnels in its registry), the CLI keeps using .asd/ and names them. To move:
    1. via down
    2. via env init (it shows Workspace: .asd/workspace → .via/workspace)
    3. Delete the old .asd/ folder; it is no longer used.
  • ${{ macro.exposedOriginWithAuth() }} is removed. It wrote https://user:password@… into .env. A via.yaml that uses it now fails with "unknown macro expression". Use ${{ macro.exposedOrigin() }} and pass the login separately, for example curl -u "$ASD_BASIC_AUTH_USERNAME:$ASD_BASIC_AUTH_PASSWORD" "$APP_URL".
  • Caddy listens on this machine only (127.0.0.1, and ::1 where available) instead of every network interface. Relay addresses keep working. To reach a project from other devices on your network, or from the internet when this machine is a server, set network.caddy.lan_access: true in via.yaml; the change takes effect on the next via net apply or via caddy start.
    If you run your own Viaalink Relay that serves HTTPS through Caddy: set network.caddy.lan_access: true in the Relay's config before it runs this CLI, or update the Relay to 1.40.5 or later. Otherwise its public HTTPS listens on loopback only.
  • via gh stop <id> asks before stopping a run someone else started. Without a terminal it does not ask: it stops only your own runs, and for any other run prints "Not stopped: # …" and exits 1. It only cancels terminal sessions, never a CI or release run.
  • A terminal.yml from before 3.2 is refused ("This terminal.yml was installed by a CLI before 3.2; run via gh setup to update it."). Run via gh setup in the repository, let it replace the file, and commit it.
  • GitHub terminal secrets have new names. The workflow reads VIA_TUNNEL_KEY, VIA_TUNNEL_KEY_ID, VIA_TUNNEL_HOST, VIA_TUNNEL_HOST_KEY_FINGERPRINTS, optional VIA_TUNNEL_PORT, and VIA_TERMINAL_PASSWORD. The old ASD_TUNNEL_* secrets are not read. Run via gh setup again in each repository that uses the terminal workflow (it stores the new secrets), then delete the old ones with gh secret delete ASD_TUNNEL_KEY --repo <owner>/<repo> (and _KEY_ID, _HOST, _PORT). via gh terminal names any missing secret. The terminal password is no longer a workflow input, and the default username is now via.
  • via auth export no longer prints the private key. Add --with-key, as in eval $(via auth export --with-key).
  • A via.yaml service without activation checks is only published when its app answers. via net apply --tunnel probes its dial and leaves it unpublished when nothing listens ("web: not published — app down: …"). Start the app first.
  • project.tunnel.protocol: tcp is refused. It published the root service without its login. Give the service itself tunnelProtocol: tcp and public: true.
  • Local addresses: run via net apply once after upgrading. Old asd.localhost and /asde/<service> bookmarks then redirect to via.localhost and /via/<service>. Projects that set project.domain keep their host.
  • via caddy sync-auth with only ASD_BASIC_AUTH_PASSWORD in the environment now uses the login in .env. Set both username and password in the environment, or keep the login in .env.
  • via diagnose --region is removed (it did nothing).
  • Run via net apply once after upgrading to put back logins on services exposed with an earlier version (see Security).

Security

  • No login goes into a URL the CLI writes to a file, prints, copies or opens: via net menus, the service menus (which now offer "Copy username" and "Copy password"), via net open, the registry and ASD_TTYD_URL in .env. Restart the web terminal and code-server once (via ttyd stop && via ttyd start, the same for codeserver) to rewrite an address an older version left.
  • via net apply no longer removes the login via expose put in front of a service's public address. Run via net apply once after upgrading.
  • The studio's files (/asde/hub-config.json, /asde/hub-services.json, /asde/hub-services-public.json) and the dashboard need the studio login on every address, and no longer carry a login. If you published the studio (via terminal tunnel, via hub up or features.hub_visibility), replace its login: cd ~/.local/share/via/projects/personal && via expose auth --rotate.
  • A service deleted from via.yaml is no longer left public: the next via net apply closes its relay address and removes its routes.
  • A hub service id that is not lowercase letters, digits and hyphens is refused wherever it becomes a socket path.
  • The terminal workflow masks the password in its URL-encoded forms, no longer echoes invalid inputs, refuses unusual usernames, and stops the published address as soon as a run is cancelled.
  • The network inspector and DbGate say in their start output what they expose to anyone who can open them.

Fixes

CI/CD

  • The login the laptop shows opens the terminal (no more 401), also for passwords with ", `, \ or $.
  • Linux and macOS runners open the terminal instead of answering 502; via expose ttyd <name> works right after via ttyd start.
  • The runner reaches relays that require host key pins, and no longer fails with Version vX not found for a release that exists.
  • "0) ← Back" in the pickers goes back a step instead of cancelling; a yes/no question only takes y/yes (or Enter where the default is yes).
  • Queued sessions say what they actually wait for; via gh active reads "1 minute", not "1 minutes"; status polling backs off.
  • via gh stop reports only cancels GitHub accepted and exits non-zero when one failed.
  • Windows runners get the CLI's install folder on PATH.

Network and services

  • via net apply --tunnel no longer creates a tunnel for an app that is not running, and --explain says per service why it was or was not published.
  • via expose list says "App down" when only your app stopped, instead of blaming the relay client.
  • via net remove, via net caddy remove and via net expose stop now do what they say and print one clear sentence.
  • via net expose start for a hub service prints the address it really answers on.
  • via net, "Copy Credentials", via codeserver and via mitmproxy find a login kept only in .env.
  • via caddy start no longer hangs when something connects to its ports during startup, and no longer ends silently when Caddy exits: it prints Caddy's error and exits 1. A slow start says which step it is in.
  • A Caddy shared by several projects keeps its pid file and log in one place, so it is not started twice.
  • The network inspector no longer fails on machines where port 8080 is taken, and never reports a database as inspected when it is not.
  • ${{ macro.exposedOrigin() }} keeps the relay's HTTPS port when it is not 443.
  • project_root on a service with neither paths nor host now serves / instead of failing.
  • A package net.manifest.yaml that does not load is reported with a warning.

Studio

  • Ctrl+C on via serve hub stops what that run started and names what keeps running. via hub down also stops the studio's own Caddy.
  • via serve hub, via expose auth and via terminal tunnel say where the login is and what is published.
  • The web terminal shows up again in via net and the studio's service list.

Update and install

  • via update now also updates the module files and the dashboard, puts everything back if a step fails, never installs an older release unless you name it (via update --version <version>), and skips unpublished releases.
  • The installers say why a release lookup failed (not found, rate limit, HTTP status, no connection) and clean up leftover folders safely.
  • Nightly builds contain the same files as a release, including the relay client under the right name.

Other

  • Device keys from via relay add are written in OpenSSH format, so plain ssh accepts them. Older keys keep working; rotate one with via relay rotate-key to use it with ssh.
  • via env sync no longer rewrites your whole .env: comments, blank lines and key order stay.
  • A .env copied between Windows and Linux or macOS no longer sends the project to a stray folder named after a Windows path. Delete any leftover C:\… folders by hand.
  • via relay set without a terminal prints a plain list instead of cursor codes.
  • via doctor no longer reports "ok" while a public service's app is down.
  • Copy actions say when nothing was copied.
  • Usage lines, hints, messages and the studio's actions say via.
  • via schema automation shows via expose <port> [name] in its examples.

Install / update

Update an existing install:

via update

via update replaces the CLI and its module files. To also update the bundled relay client and helpers, re-run the installer:

# Linux / macOS
curl -fsSL https://raw.githubusercontent.com/viaalink/cli/main/install.sh | bash
# Windows
irm https://raw.githubusercontent.com/viaalink/cli/main/install.ps1 | iex