- internal/ui/VERSION pins the threshold-ui commit - scripts/uiupdate.sh and scripts/build-ui.sh clone https://repo.anhonesthost.net/CyberCoveLLC/threshold-ui.git; the GitHub artifact download path (hashicorp/boundary-ui) is removed - clone/embed directory renamed .tmp/boundary-ui -> .tmp/threshold-ui (Makefile, assets.go, .github build.yml paths) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
39 lines
673 B
Go
39 lines
673 B
Go
// Copyright IBM Corp. 2020, 2026
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
//go:build ui
|
|
// +build ui
|
|
|
|
package ui
|
|
|
|
import (
|
|
"embed"
|
|
"io/fs"
|
|
"net/http"
|
|
)
|
|
|
|
// Sadly we can't embed this into the embed line, but we use it elsewhere
|
|
const contentDir = ".tmp/threshold-ui/ui/admin/dist"
|
|
|
|
// content is our static web server content.
|
|
//
|
|
//go:embed .tmp/threshold-ui/ui/admin/dist
|
|
var content embed.FS
|
|
|
|
func Handler() http.Handler {
|
|
return http.FileServer(httpFileSystem())
|
|
}
|
|
|
|
func httpFileSystem() http.FileSystem {
|
|
return http.FS(fileSystem())
|
|
}
|
|
|
|
func fileSystem() fs.FS {
|
|
// Remove the root
|
|
f, err := fs.Sub(content, contentDir)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return f
|
|
}
|