mirror of
https://github.com/fleetdm/fleet
synced 2026-05-22 08:28:52 +00:00
* Add safe mkdirall and open * Use secure as much as possible and merge gomodules for orbit to fleet * Improve openfile and mkdirall to check for permissiveness instead of equality * Don't shift * Fix links * Address review comments
31 lines
784 B
Go
31 lines
784 B
Go
package update
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
|
|
"github.com/fleetdm/fleet/v4/orbit/pkg/constant"
|
|
"github.com/theupdateframework/go-tuf/client"
|
|
)
|
|
|
|
var (
|
|
// DefaultOptions are the default options to use when creating an update
|
|
// client.
|
|
DefaultOptions = Options{
|
|
RootDirectory: `C:\Program Files\Orbit`,
|
|
ServerURL: defaultURL,
|
|
RootKeys: defaultRootKeys,
|
|
LocalStore: client.MemoryLocalStore(),
|
|
InsecureTransport: false,
|
|
Platform: constant.PlatformName,
|
|
OrbitChannel: "stable",
|
|
OsquerydChannel: "stable",
|
|
}
|
|
)
|
|
|
|
func init() {
|
|
// Set root directory to value of ProgramFiles environment variable if not set
|
|
if dir := os.Getenv("ProgramFiles"); dir != "" {
|
|
DefaultOptions.RootDirectory = filepath.Join(dir, "Orbit")
|
|
}
|
|
}
|