feat: expand companion platform, device controls, and memoir workflows
ci / verify (push) Canceled after 0s
ci / verify (push) Canceled after 0s
Add customer and operator login, BLE provisioning, device fleet controls, call memory, memoir generation, and refreshed family and maintenance portals. Include API contracts, migrations, firmware sources, tests, assets, and deployment documentation.
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"data-terminal-cloud/internal/workflowbridge"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
func secret(name string) string {
|
||||
if p := os.Getenv(name + "_FILE"); p != "" {
|
||||
b, err := os.ReadFile(p)
|
||||
if err != nil {
|
||||
log.Fatal("secret file unavailable")
|
||||
}
|
||||
return strings.TrimSpace(string(b))
|
||||
}
|
||||
return strings.TrimSpace(os.Getenv(name))
|
||||
}
|
||||
func main() {
|
||||
key, admin := secret("ARK_API_KEY"), secret("DIFY_BRIDGE_SECRET")
|
||||
if key == "" || admin == "" {
|
||||
log.Fatal("bridge credentials missing")
|
||||
}
|
||||
base := os.Getenv("ARK_BASE_URL")
|
||||
if base == "" {
|
||||
base = "https://ark.cn-beijing.volces.com/api/v3"
|
||||
}
|
||||
service, err := workflowbridge.NewArkService(admin, base, key)
|
||||
if err != nil {
|
||||
log.Fatal("model configuration invalid")
|
||||
}
|
||||
server := &http.Server{Addr: ":8188", Handler: service, ReadHeaderTimeout: 10 * time.Second, IdleTimeout: 30 * time.Second}
|
||||
log.Fatal(server.ListenAndServe())
|
||||
}
|
||||
Reference in New Issue
Block a user