mirror of
https://github.com/harivansh-afk/betterNAS.git
synced 2026-04-15 09:01:13 +00:00
Protect the control-plane API with explicit bearer auth, add node-scoped registration/heartbeat credentials, and make export mount paths an explicit contract field so mount profiles stay correct across runtimes. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
23 lines
435 B
Go
23 lines
435 B
Go
package main
|
|
|
|
import (
|
|
"net/url"
|
|
"strings"
|
|
)
|
|
|
|
const (
|
|
defaultWebDAVPath = "/dav/"
|
|
nextcloudExportPagePrefix = "/apps/betternascontrolplane/exports/"
|
|
)
|
|
|
|
func mountProfilePathForExport(mountPath string) string {
|
|
if strings.TrimSpace(mountPath) == "" {
|
|
return defaultWebDAVPath
|
|
}
|
|
|
|
return mountPath
|
|
}
|
|
|
|
func cloudProfilePathForExport(exportID string) string {
|
|
return nextcloudExportPagePrefix + url.PathEscape(exportID)
|
|
}
|