2024-08-13 12:27:10 +00:00
|
|
|
package s3
|
|
|
|
|
|
|
|
|
|
import "github.com/fleetdm/fleet/v4/server/config"
|
|
|
|
|
|
|
|
|
|
const bootstrapPackagePrefix = "bootstrap-packages"
|
|
|
|
|
|
|
|
|
|
type BootstrapPackageStore struct {
|
|
|
|
|
*commonFileStore
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// NewBootstrapPackageStore creates a new instance with the given S3 config.
|
|
|
|
|
func NewBootstrapPackageStore(config config.S3Config) (*BootstrapPackageStore, error) {
|
|
|
|
|
// bootstrap packages use the same S3 config as software installers
|
2025-06-30 20:45:39 +00:00
|
|
|
s3store, err := newS3Store(config.SoftwareInstallersToInternalCfg())
|
2024-08-13 12:27:10 +00:00
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
return &BootstrapPackageStore{
|
|
|
|
|
&commonFileStore{
|
|
|
|
|
s3store: s3store,
|
|
|
|
|
pathPrefix: bootstrapPackagePrefix,
|
|
|
|
|
fileLabel: "bootstrap package",
|
2025-09-09 14:22:04 +00:00
|
|
|
|
|
|
|
|
gcs: isGCS(config.EndpointURL),
|
2024-08-13 12:27:10 +00:00
|
|
|
},
|
|
|
|
|
}, nil
|
|
|
|
|
}
|