Documentation ¶
Overview ¶
Copyright 2020 Northern.tech AS
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2019 Northern.tech AS
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
View Source
const (
BrokenArtifactSuffix = "_INCONSISTENT"
)
Variables ¶
View Source
var ( // needed so that we can override it when testing DefaultPathDataDir = "/usr/share/mender" DefaultDataStore = "/var/lib/mender" DefaultKeyFile = "mender-agent.pem" DefaultConfFile = path.Join(GetConfDirPath(), "mender.conf") DefaultFallbackConfFile = path.Join(GetStateDirPath(), "mender.conf") )
View Source
var ( // device specific paths DefaultArtifactInfoFile = path.Join(GetConfDirPath(), "artifact_info") DefaultDeviceTypeFile = path.Join(GetStateDirPath(), "device_type") DefaultArtScriptsPath = path.Join(GetStateDirPath(), "scripts") DefaultRootfsScriptsPath = path.Join(GetConfDirPath(), "scripts") DefaultModulesPath = path.Join(GetDataDirPath(), "modules", "v3") DefaultModulesWorkPath = path.Join(GetStateDirPath(), "modules", "v3") )
View Source
var ( // Version information of current build Version string )
Functions ¶
func GetConfDirPath ¶
func GetConfDirPath() string
func GetDataDirPath ¶
func GetDataDirPath() string
func GetStateDirPath ¶
func GetStateDirPath() string
func SaveConfigFile ¶
func SaveConfigFile(config *MenderConfigFromFile, filename string) error
func ShowVersion ¶
func ShowVersion() string
func VersionString ¶
func VersionString() string
Types ¶
type MenderConfig ¶
type MenderConfig struct { MenderConfigFromFile // Additional fields that are in our config struct for convenience, but // not actually configurable via the config file. ModulesPath string ModulesWorkPath string ArtifactInfoFile string ArtifactScriptsPath string RootfsScriptsPath string }
func LoadConfig ¶
func LoadConfig(mainConfigFile string, fallbackConfigFile string) (*MenderConfig, error)
LoadConfig parses the mender configuration json-files (/etc/mender/mender.conf and /var/lib/mender/mender.conf) and loads the values into the MenderConfig structure defining high level client configurations.
func NewMenderConfig ¶
func NewMenderConfig() *MenderConfig
func (*MenderConfig) GetDeploymentLogLocation ¶
func (c *MenderConfig) GetDeploymentLogLocation() string
func (*MenderConfig) GetDeviceConfig ¶
func (c *MenderConfig) GetDeviceConfig() installer.DualRootfsDeviceConfig
func (*MenderConfig) GetHttpConfig ¶
func (c *MenderConfig) GetHttpConfig() client.Config
func (*MenderConfig) GetTenantToken ¶
func (c *MenderConfig) GetTenantToken() []byte
GetTenantToken returns a default tenant-token if no custom token is set in local.conf
func (*MenderConfig) GetVerificationKey ¶
func (c *MenderConfig) GetVerificationKey() []byte
type MenderConfigFromFile ¶
type MenderConfigFromFile struct { // ClientProtocol "https" ClientProtocol string // Path to the public key used to verify signed updates ArtifactVerifyKey string // HTTPS client parameters HttpsClient struct { Certificate string Key string SkipVerify bool } // Rootfs device path RootfsPartA string RootfsPartB string // Path to the device type file DeviceTypeFile string // Poll interval for checking for new updates UpdatePollIntervalSeconds int // Poll interval for periodically sending inventory data InventoryPollIntervalSeconds int // Global retry polling max interval for fetching update, authorize wait and update status RetryPollIntervalSeconds int // State script parameters StateScriptTimeoutSeconds int StateScriptRetryTimeoutSeconds int // Poll interval for checking for update (check-update) StateScriptRetryIntervalSeconds int // The timeout for the execution of the update module, after which it // will be killed. ModuleTimeoutSeconds int // Path to server SSL certificate ServerCertificate string // Server URL (For single server conf) ServerURL string // Path to deployment log file UpdateLogPath string // Server JWT TenantToken TenantToken string // List of available servers, to which client can fall over Servers []client.MenderServer }
Click to show internal directories.
Click to hide internal directories.