Build and serve signed Linux ARM64 agent releases
This commit is contained in:
@@ -103,7 +103,7 @@ impl Observer {
|
|||||||
}
|
}
|
||||||
self.cached()
|
self.cached()
|
||||||
.cloned()
|
.cloned()
|
||||||
.unwrap_or_else(|| Observation::not_configured(Platform::LinuxX64, chrono::Utc::now()))
|
.unwrap_or_else(|| Observation::not_configured(Platform::NATIVE_LINUX, chrono::Utc::now()))
|
||||||
}
|
}
|
||||||
pub fn catalog_record(&self) -> Option<GuardedRecord> {
|
pub fn catalog_record(&self) -> Option<GuardedRecord> {
|
||||||
self.cached()?;
|
self.cached()?;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ use rmm_domain::{
|
|||||||
};
|
};
|
||||||
use rmm_privileged_helper::{Binding, TrustedClock};
|
use rmm_privileged_helper::{Binding, TrustedClock};
|
||||||
use rmm_updater::{
|
use rmm_updater::{
|
||||||
ActiveRelease, Platform as ReleasePlatform, ReleaseRelation, SignedRelease, TrustedContext,
|
ActiveRelease, ReleaseRelation, SignedRelease, TrustedContext,
|
||||||
TrustedUpdateKey, UpdateKeyring, verify_release,
|
TrustedUpdateKey, UpdateKeyring, verify_release,
|
||||||
};
|
};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
@@ -346,12 +346,12 @@ impl Trust {
|
|||||||
.try_into()
|
.try_into()
|
||||||
.map_err(|_| anyhow::anyhow!("UPDATE_CATALOG_KEY_SIZE"))?;
|
.map_err(|_| anyhow::anyhow!("UPDATE_CATALOG_KEY_SIZE"))?;
|
||||||
ensure!(
|
ensure!(
|
||||||
key.platform == Platform::LinuxX64 && key.public_key_hex != binding.public_key_hex,
|
key.platform == Platform::NATIVE_LINUX && key.public_key_hex != binding.public_key_hex,
|
||||||
"UPDATE_CATALOG_KEY_SEPARATION"
|
"UPDATE_CATALOG_KEY_SEPARATION"
|
||||||
);
|
);
|
||||||
trusted.push(TrustedUpdateKey::new(
|
trusted.push(TrustedUpdateKey::new(
|
||||||
public,
|
public,
|
||||||
ReleasePlatform::LinuxX64,
|
Platform::NATIVE_LINUX.into(),
|
||||||
key.first_sequence,
|
key.first_sequence,
|
||||||
key.last_sequence,
|
key.last_sequence,
|
||||||
key.revoked,
|
key.revoked,
|
||||||
@@ -426,7 +426,7 @@ impl Trust {
|
|||||||
},
|
},
|
||||||
&self.keys,
|
&self.keys,
|
||||||
&TrustedContext {
|
&TrustedContext {
|
||||||
platform: ReleasePlatform::LinuxX64,
|
platform: Platform::NATIVE_LINUX.into(),
|
||||||
now_utc_seconds: now,
|
now_utc_seconds: now,
|
||||||
keyring_generation: self.generation,
|
keyring_generation: self.generation,
|
||||||
protocol_major: self.protocol,
|
protocol_major: self.protocol,
|
||||||
@@ -522,9 +522,10 @@ async fn request(
|
|||||||
async fn fetch(client: &reqwest::Client, address: SocketAddr) -> Result<Vec<u8>> {
|
async fn fetch(client: &reqwest::Client, address: SocketAddr) -> Result<Vec<u8>> {
|
||||||
let response = client
|
let response = client
|
||||||
.get(format!(
|
.get(format!(
|
||||||
"https://{}:{}/agent/v1/releases/current?platform=x86_64-unknown-linux-gnu",
|
"https://{}:{}/agent/v1/releases/current?platform={}",
|
||||||
crate::https_channel::server_name()?,
|
crate::https_channel::server_name()?,
|
||||||
address.port()
|
address.port(),
|
||||||
|
Platform::NATIVE_LINUX.target_triple()
|
||||||
))
|
))
|
||||||
.send()
|
.send()
|
||||||
.await?;
|
.await?;
|
||||||
|
|||||||
@@ -319,7 +319,7 @@ pub fn context(
|
|||||||
let scope = match job.action {
|
let scope = match job.action {
|
||||||
rmm_domain::jobs::Action::UpdateAgent { ref update } => {
|
rmm_domain::jobs::Action::UpdateAgent { ref update } => {
|
||||||
match update.manifest().map_err(anyhow::Error::msg)?.platform {
|
match update.manifest().map_err(anyhow::Error::msg)?.platform {
|
||||||
update::Platform::LinuxX64 => "linux.base",
|
update::Platform::LinuxX64 | update::Platform::LinuxArm64 => "linux.base",
|
||||||
update::Platform::WindowsX64 | update::Platform::WindowsGnuX64 => "windows.base",
|
update::Platform::WindowsX64 | update::Platform::WindowsGnuX64 => "windows.base",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -465,6 +465,8 @@ impl<C: reconcile::SyncClock> Agent<C> {
|
|||||||
"heartbeat/1".into(),
|
"heartbeat/1".into(),
|
||||||
"agent.update/1".into(),
|
"agent.update/1".into(),
|
||||||
];
|
];
|
||||||
|
#[cfg(target_arch = "aarch64")]
|
||||||
|
capabilities.push(rmm_domain::agent_update::LINUX_ARM64_RELEASE_CAPABILITY.into());
|
||||||
if self.binding.is_some() {
|
if self.binding.is_some() {
|
||||||
capabilities.push("rmm.sync.v1".into());
|
capabilities.push("rmm.sync.v1".into());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ fn fixture(platform: Platform, full: bool) -> serde_json::Value {
|
|||||||
signature: URL_SAFE_NO_PAD.encode([1_u8; 64]),
|
signature: URL_SAFE_NO_PAD.encode([1_u8; 64]),
|
||||||
};
|
};
|
||||||
let transition = match platform {
|
let transition = match platform {
|
||||||
Platform::LinuxX64 if full => PeerPinTransition::LinuxGeneralFullV1 {
|
Platform::LinuxX64 | Platform::LinuxArm64 if full => PeerPinTransition::LinuxGeneralFullV1 {
|
||||||
general_pin_sha256: "10".repeat(32),
|
general_pin_sha256: "10".repeat(32),
|
||||||
full: LinuxFullTransition {
|
full: LinuxFullTransition {
|
||||||
schema_version: 1,
|
schema_version: 1,
|
||||||
@@ -57,7 +57,7 @@ fn fixture(platform: Platform, full: bool) -> serde_json::Value {
|
|||||||
effective_signing_key_id: "17".repeat(32),
|
effective_signing_key_id: "17".repeat(32),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Platform::LinuxX64 => PeerPinTransition::UnchangedGeneralPinV1 {
|
Platform::LinuxX64 | Platform::LinuxArm64 => PeerPinTransition::UnchangedGeneralPinV1 {
|
||||||
general_pin_sha256: "10".repeat(32),
|
general_pin_sha256: "10".repeat(32),
|
||||||
},
|
},
|
||||||
Platform::WindowsX64 | Platform::WindowsGnuX64 => PeerPinTransition::WindowsCodePairV1 {
|
Platform::WindowsX64 | Platform::WindowsGnuX64 => PeerPinTransition::WindowsCodePairV1 {
|
||||||
@@ -110,7 +110,7 @@ fn fixture(platform: Platform, full: bool) -> serde_json::Value {
|
|||||||
update: Box::new(update),
|
update: Box::new(update),
|
||||||
},
|
},
|
||||||
execution_identity: match platform {
|
execution_identity: match platform {
|
||||||
Platform::LinuxX64 => "root",
|
Platform::LinuxX64 | Platform::LinuxArm64 => "root",
|
||||||
Platform::WindowsX64 | Platform::WindowsGnuX64 => "system",
|
Platform::WindowsX64 | Platform::WindowsGnuX64 => "system",
|
||||||
}
|
}
|
||||||
.into(),
|
.into(),
|
||||||
|
|||||||
@@ -50,11 +50,34 @@ impl UpdateKeyringFile {
|
|||||||
pub enum Platform {
|
pub enum Platform {
|
||||||
#[serde(rename = "x86_64-unknown-linux-gnu")]
|
#[serde(rename = "x86_64-unknown-linux-gnu")]
|
||||||
LinuxX64,
|
LinuxX64,
|
||||||
|
#[serde(rename = "aarch64-unknown-linux-gnu")]
|
||||||
|
LinuxArm64,
|
||||||
#[serde(rename = "x86_64-pc-windows-msvc")]
|
#[serde(rename = "x86_64-pc-windows-msvc")]
|
||||||
WindowsX64,
|
WindowsX64,
|
||||||
#[serde(rename = "x86_64-pc-windows-gnu")]
|
#[serde(rename = "x86_64-pc-windows-gnu")]
|
||||||
WindowsGnuX64,
|
WindowsGnuX64,
|
||||||
}
|
}
|
||||||
|
pub const LINUX_ARM64_RELEASE_CAPABILITY: &str = "agent.release.linux.arm64/1";
|
||||||
|
|
||||||
|
impl Platform {
|
||||||
|
#[cfg(all(target_os = "linux", target_arch = "aarch64"))]
|
||||||
|
pub const NATIVE_LINUX: Self = Self::LinuxArm64;
|
||||||
|
#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
|
||||||
|
pub const NATIVE_LINUX: Self = Self::LinuxX64;
|
||||||
|
|
||||||
|
pub const fn is_linux(self) -> bool {
|
||||||
|
matches!(self, Self::LinuxX64 | Self::LinuxArm64)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const fn target_triple(self) -> &'static str {
|
||||||
|
match self {
|
||||||
|
Self::LinuxX64 => "x86_64-unknown-linux-gnu",
|
||||||
|
Self::LinuxArm64 => "aarch64-unknown-linux-gnu",
|
||||||
|
Self::WindowsX64 => "x86_64-pc-windows-msvc",
|
||||||
|
Self::WindowsGnuX64 => "x86_64-pc-windows-gnu",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
pub enum ArtifactRole {
|
pub enum ArtifactRole {
|
||||||
@@ -708,7 +731,7 @@ impl ResolvedAgentUpdate {
|
|||||||
}
|
}
|
||||||
pub fn execution_identity(&self) -> Option<&'static str> {
|
pub fn execution_identity(&self) -> Option<&'static str> {
|
||||||
self.manifest().ok().map(|m| match m.platform {
|
self.manifest().ok().map(|m| match m.platform {
|
||||||
Platform::LinuxX64 => "root",
|
Platform::LinuxX64 | Platform::LinuxArm64 => "root",
|
||||||
Platform::WindowsX64 | Platform::WindowsGnuX64 => "system",
|
Platform::WindowsX64 | Platform::WindowsGnuX64 => "system",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ pub fn validate_for_scope(
|
|||||||
.map_err(|_| "INVALID_AGENT_UPDATE_OBSERVATION")?
|
.map_err(|_| "INVALID_AGENT_UPDATE_OBSERVATION")?
|
||||||
!= update
|
!= update
|
||||||
|| !typed.agent_update.validate()
|
|| !typed.agent_update.validate()
|
||||||
|| (typed.agent_update.platform == crate::agent_update::Platform::LinuxX64) != (scope == "linux.base")
|
|| typed.agent_update.platform.is_linux() != (scope == "linux.base")
|
||||||
|| typed.agent_update.observed_at - now > chrono::Duration::seconds(45)
|
|| typed.agent_update.observed_at - now > chrono::Duration::seconds(45)
|
||||||
|| now - typed.agent_update.observed_at > chrono::Duration::hours(72)
|
|| now - typed.agent_update.observed_at > chrono::Duration::hours(72)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ pub fn observe_record(
|
|||||||
&& response.ledger_inode != 0
|
&& response.ledger_inode != 0
|
||||||
&& response.lock_inode != 0
|
&& response.lock_inode != 0
|
||||||
&& response.observation.validate()
|
&& response.observation.validate()
|
||||||
&& response.observation.platform == Platform::LinuxX64,
|
&& response.observation.platform == Platform::NATIVE_LINUX,
|
||||||
"UPDATE_OBSERVER_RESPONSE_BINDING"
|
"UPDATE_OBSERVER_RESPONSE_BINDING"
|
||||||
);
|
);
|
||||||
let record = rmm_domain::agent_update_provisioning::InstalledReleaseRecord::from_bytes(
|
let record = rmm_domain::agent_update_provisioning::InstalledReleaseRecord::from_bytes(
|
||||||
@@ -346,7 +346,7 @@ pub fn collect(db: &Connection, local: Local<'_>, request: &Request) -> Result<R
|
|||||||
));
|
));
|
||||||
let observation = AgentUpdateObservation {
|
let observation = AgentUpdateObservation {
|
||||||
schema_version: 1,
|
schema_version: 1,
|
||||||
platform: Platform::LinuxX64,
|
platform: Platform::NATIVE_LINUX,
|
||||||
observed_at,
|
observed_at,
|
||||||
quality: ObservationQuality::Valid,
|
quality: ObservationQuality::Valid,
|
||||||
predecessor: Some(trust.predecessor().clone()),
|
predecessor: Some(trust.predecessor().clone()),
|
||||||
|
|||||||
@@ -418,7 +418,7 @@ async fn issue(
|
|||||||
&& snapshot.sha256 == hex::decode(hash(&snapshot.data)).map_err(|_| denied())?,
|
&& snapshot.sha256 == hex::decode(hash(&snapshot.data)).map_err(|_| denied())?,
|
||||||
)?;
|
)?;
|
||||||
let scope = match action.manifest().map_err(|_| denied())?.platform {
|
let scope = match action.manifest().map_err(|_| denied())?.platform {
|
||||||
update::Platform::LinuxX64 => "linux.base",
|
update::Platform::LinuxX64 | update::Platform::LinuxArm64 => "linux.base",
|
||||||
update::Platform::WindowsX64 | update::Platform::WindowsGnuX64 => "windows.base",
|
update::Platform::WindowsX64 | update::Platform::WindowsGnuX64 => "windows.base",
|
||||||
};
|
};
|
||||||
// Health requires a fresh real base inventory of the restarted platform;
|
// Health requires a fresh real base inventory of the restarted platform;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ use axum::{
|
|||||||
use chrono::{DateTime, Utc};
|
use chrono::{DateTime, Utc};
|
||||||
use futures_util::StreamExt;
|
use futures_util::StreamExt;
|
||||||
use rmm_domain::{
|
use rmm_domain::{
|
||||||
agent_update::{ArtifactDescriptor, Platform, ReleaseEnvelope, ReleaseManifest},
|
agent_update::{ArtifactDescriptor, LINUX_ARM64_RELEASE_CAPABILITY, Platform, ReleaseEnvelope, ReleaseManifest},
|
||||||
jobs::{ArtifactReference, encode, hash},
|
jobs::{ArtifactReference, encode, hash},
|
||||||
};
|
};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
@@ -139,13 +139,6 @@ pub fn store() -> Result<UpdateArtifacts, Error> {
|
|||||||
metadata.uid(),
|
metadata.uid(),
|
||||||
)?)
|
)?)
|
||||||
}
|
}
|
||||||
fn verifier_platform(platform: Platform) -> rmm_updater::Platform {
|
|
||||||
match platform {
|
|
||||||
Platform::LinuxX64 => rmm_updater::Platform::LinuxX64,
|
|
||||||
Platform::WindowsX64 => rmm_updater::Platform::WindowsX64,
|
|
||||||
Platform::WindowsGnuX64 => rmm_updater::Platform::WindowsGnuX64,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// Network input can choose only among statically named protected
|
/// Network input can choose only among statically named protected
|
||||||
/// configuration slots. It never supplies a path or introduces update trust.
|
/// configuration slots. It never supplies a path or introduces update trust.
|
||||||
fn keyring_path_with(
|
fn keyring_path_with(
|
||||||
@@ -154,6 +147,7 @@ fn keyring_path_with(
|
|||||||
) -> Result<std::path::PathBuf, Error> {
|
) -> Result<std::path::PathBuf, Error> {
|
||||||
let name = match platform {
|
let name = match platform {
|
||||||
Platform::LinuxX64 => "RMM_AGENT_UPDATE_LINUX_KEYRING_FILE",
|
Platform::LinuxX64 => "RMM_AGENT_UPDATE_LINUX_KEYRING_FILE",
|
||||||
|
Platform::LinuxArm64 => "RMM_AGENT_UPDATE_LINUX_ARM64_KEYRING_FILE",
|
||||||
Platform::WindowsX64 => "RMM_AGENT_UPDATE_WINDOWS_KEYRING_FILE",
|
Platform::WindowsX64 => "RMM_AGENT_UPDATE_WINDOWS_KEYRING_FILE",
|
||||||
Platform::WindowsGnuX64 => {
|
Platform::WindowsGnuX64 => {
|
||||||
// The shared device gateway and both management APIs must select the same
|
// The shared device gateway and both management APIs must select the same
|
||||||
@@ -177,7 +171,7 @@ fn keyring_path_with(
|
|||||||
}
|
}
|
||||||
// Exact legacy compatibility only when the platform-specific slot is
|
// Exact legacy compatibility only when the platform-specific slot is
|
||||||
// absent. An invalid explicit slot must never silently choose other trust.
|
// absent. An invalid explicit slot must never silently choose other trust.
|
||||||
if platform == Platform::WindowsGnuX64 {
|
if matches!(platform, Platform::LinuxArm64 | Platform::WindowsGnuX64) {
|
||||||
return Err(fail("AGENT_UPDATE_NOT_CONFIGURED"));
|
return Err(fail("AGENT_UPDATE_NOT_CONFIGURED"));
|
||||||
}
|
}
|
||||||
lookup("RMM_AGENT_UPDATE_KEYRING_FILE")?
|
lookup("RMM_AGENT_UPDATE_KEYRING_FILE")?
|
||||||
@@ -239,7 +233,7 @@ fn verify_envelope_with_keyring(
|
|||||||
rmm_updater::TrustedUpdateKey::new(
|
rmm_updater::TrustedUpdateKey::new(
|
||||||
raw.try_into()
|
raw.try_into()
|
||||||
.map_err(|_| fail("AGENT_UPDATE_TRUST_INVALID"))?,
|
.map_err(|_| fail("AGENT_UPDATE_TRUST_INVALID"))?,
|
||||||
verifier_platform(key.platform),
|
key.platform.into(),
|
||||||
key.first_sequence,
|
key.first_sequence,
|
||||||
key.last_sequence,
|
key.last_sequence,
|
||||||
key.revoked,
|
key.revoked,
|
||||||
@@ -250,7 +244,7 @@ fn verify_envelope_with_keyring(
|
|||||||
let keyring = rmm_updater::UpdateKeyring::new(config.generation, keys)
|
let keyring = rmm_updater::UpdateKeyring::new(config.generation, keys)
|
||||||
.map_err(|_| fail("AGENT_UPDATE_TRUST_INVALID"))?;
|
.map_err(|_| fail("AGENT_UPDATE_TRUST_INVALID"))?;
|
||||||
let context = rmm_updater::TrustedContext {
|
let context = rmm_updater::TrustedContext {
|
||||||
platform: verifier_platform(decoded.manifest.platform),
|
platform: decoded.manifest.platform.into(),
|
||||||
now_utc_seconds,
|
now_utc_seconds,
|
||||||
keyring_generation: config.generation,
|
keyring_generation: config.generation,
|
||||||
protocol_major: 1,
|
protocol_major: 1,
|
||||||
@@ -658,18 +652,21 @@ async fn check_device_platform(
|
|||||||
.fetch_one(&mut **tx)
|
.fetch_one(&mut **tx)
|
||||||
.await?;
|
.await?;
|
||||||
let caps: Vec<String> = serde_json::from_value(caps)?;
|
let caps: Vec<String> = serde_json::from_value(caps)?;
|
||||||
let expected = match platform {
|
if device_supports_release(platform, &caps) {
|
||||||
Platform::LinuxX64 => "linux.base/1",
|
Ok(())
|
||||||
Platform::WindowsX64 if caps.iter().any(|c| c == "agent.release.windows.gnu/1") => {
|
} else {
|
||||||
return Err(missing());
|
Err(missing())
|
||||||
}
|
}
|
||||||
Platform::WindowsX64 => "windows.base/1",
|
}
|
||||||
Platform::WindowsGnuX64 => "agent.release.windows.gnu/1",
|
|
||||||
};
|
fn device_supports_release(platform: Platform, caps: &[String]) -> bool {
|
||||||
if !caps.iter().any(|c| c == expected) {
|
let has = |expected: &str| caps.iter().any(|capability| capability == expected);
|
||||||
return Err(missing());
|
match platform {
|
||||||
|
Platform::LinuxX64 => has("linux.base/1") && !has(LINUX_ARM64_RELEASE_CAPABILITY),
|
||||||
|
Platform::LinuxArm64 => has("linux.base/1") && has(LINUX_ARM64_RELEASE_CAPABILITY),
|
||||||
|
Platform::WindowsX64 => has("windows.base/1") && !has("agent.release.windows.gnu/1"),
|
||||||
|
Platform::WindowsGnuX64 => has("agent.release.windows.gnu/1"),
|
||||||
}
|
}
|
||||||
Ok(())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A published release grants access to its two fixed binaries for authenticated
|
/// A published release grants access to its two fixed binaries for authenticated
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Usage: sudo sh linux.sh https://bootstrap.example [--enable-admin-scripts]
|
# Linux x86-64 / ARM64. Usage: sudo sh linux.sh https://bootstrap.example [--enable-admin-scripts]
|
||||||
set -eu
|
set -eu
|
||||||
umask 077
|
umask 077
|
||||||
file=$(mktemp)
|
file=$(mktemp)
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ TIMER = 'rmm-discovery-update.timer'
|
|||||||
HELPER = 'rmm-discovery-managed-script-helper.service'
|
HELPER = 'rmm-discovery-managed-script-helper.service'
|
||||||
HELPER_SOCKET = Path('/run/rmm-discovery-script-helper/control.sock')
|
HELPER_SOCKET = Path('/run/rmm-discovery-script-helper/control.sock')
|
||||||
OLD_HELPER_CONFIG = Path('/etc/rmm-discovery-managed-scripts')
|
OLD_HELPER_CONFIG = Path('/etc/rmm-discovery-managed-scripts')
|
||||||
PLATFORM = 'x86_64-unknown-linux-gnu'
|
|
||||||
MAX_BINARY = 256 * 1024 * 1024
|
MAX_BINARY = 256 * 1024 * 1024
|
||||||
UNIT_DIR = Path('/etc/systemd/system')
|
UNIT_DIR = Path('/etc/systemd/system')
|
||||||
|
|
||||||
@@ -42,6 +41,13 @@ def require(condition, message):
|
|||||||
raise ValueError(message)
|
raise ValueError(message)
|
||||||
|
|
||||||
|
|
||||||
|
def release_platform():
|
||||||
|
machine = platform.machine()
|
||||||
|
require(platform.system() == 'Linux' and machine in ('x86_64', 'aarch64'),
|
||||||
|
'Linux x86-64 or ARM64 required')
|
||||||
|
return machine + '-unknown-linux-gnu'
|
||||||
|
|
||||||
|
|
||||||
def origin(value):
|
def origin(value):
|
||||||
parsed = urlsplit(value)
|
parsed = urlsplit(value)
|
||||||
require(parsed.scheme == 'https' and parsed.hostname and parsed.username is None
|
require(parsed.scheme == 'https' and parsed.hostname and parsed.username is None
|
||||||
@@ -151,7 +157,9 @@ def pair(folder, doc, source, updater):
|
|||||||
manifest = doc['manifest']
|
manifest = doc['manifest']
|
||||||
release_id = canonical_id(manifest['release_id'])
|
release_id = canonical_id(manifest['release_id'])
|
||||||
prefix = '/agent/v1/bootstrap/releases' if source else '/agent/v1/releases'
|
prefix = '/agent/v1/bootstrap/releases' if source else '/agent/v1/releases'
|
||||||
suffix = '?platform=' + PLATFORM if source else ''
|
target = release_platform()
|
||||||
|
require(manifest['platform'] == target, 'release architecture differs from this device')
|
||||||
|
suffix = '?platform=' + target if source else ''
|
||||||
save(folder / 'envelope.json', doc['release_envelope'])
|
save(folder / 'envelope.json', doc['release_envelope'])
|
||||||
for artifact, role in zip(manifest['artifacts'], ('agent', 'helper'), strict=True):
|
for artifact, role in zip(manifest['artifacts'], ('agent', 'helper'), strict=True):
|
||||||
require(artifact['role'] == role, 'incorrect artifact role')
|
require(artifact['role'] == role, 'incorrect artifact role')
|
||||||
@@ -481,7 +489,7 @@ def save_token(base, token, gid):
|
|||||||
|
|
||||||
|
|
||||||
def install(base, token_file, enable_admin_scripts=False):
|
def install(base, token_file, enable_admin_scripts=False):
|
||||||
require(platform.machine() == 'x86_64', 'Linux x86-64 required')
|
target = release_platform()
|
||||||
base = origin(base)
|
base = origin(base)
|
||||||
if ROOT.exists():
|
if ROOT.exists():
|
||||||
config = read(ROOT / 'config.json')
|
config = read(ROOT / 'config.json')
|
||||||
@@ -491,7 +499,7 @@ def install(base, token_file, enable_admin_scripts=False):
|
|||||||
token = enrollment_token(token_file)
|
token = enrollment_token(token_file)
|
||||||
with tempfile.TemporaryDirectory() as work:
|
with tempfile.TemporaryDirectory() as work:
|
||||||
metadata = Path(work) / 'bootstrap.json'
|
metadata = Path(work) / 'bootstrap.json'
|
||||||
remote((base, token), '/agent/v1/bootstrap/current?platform=' + PLATFORM, metadata)
|
remote((base, token), '/agent/v1/bootstrap/current?platform=' + target, metadata)
|
||||||
require(read(metadata)['tenant_id'] == config['tenant'], 'different enrollment tenant')
|
require(read(metadata)['tenant_id'] == config['tenant'], 'different enrollment tenant')
|
||||||
save_token(ROOT, token, pwd.getpwnam('rmm-discovery').pw_gid)
|
save_token(ROOT, token, pwd.getpwnam('rmm-discovery').pw_gid)
|
||||||
# An operator rerunning the HTTPS installer can update the lifecycle
|
# An operator rerunning the HTTPS installer can update the lifecycle
|
||||||
@@ -524,7 +532,7 @@ def install(base, token_file, enable_admin_scripts=False):
|
|||||||
with tempfile.TemporaryDirectory(prefix='.rmm-', dir=ROOT.parent) as work:
|
with tempfile.TemporaryDirectory(prefix='.rmm-', dir=ROOT.parent) as work:
|
||||||
staging = Path(work) / 'installation'
|
staging = Path(work) / 'installation'
|
||||||
staging.mkdir()
|
staging.mkdir()
|
||||||
remote((base, token), '/agent/v1/bootstrap/current?platform=' + PLATFORM, staging / 'bootstrap.json')
|
remote((base, token), '/agent/v1/bootstrap/current?platform=' + target, staging / 'bootstrap.json')
|
||||||
doc = read(staging / 'bootstrap.json')
|
doc = read(staging / 'bootstrap.json')
|
||||||
require(doc['schema_version'] == 1, 'unknown bootstrap profile')
|
require(doc['schema_version'] == 1, 'unknown bootstrap profile')
|
||||||
save(staging / 'keyring.json', doc['keyring'])
|
save(staging / 'keyring.json', doc['keyring'])
|
||||||
@@ -532,7 +540,7 @@ def install(base, token_file, enable_admin_scripts=False):
|
|||||||
save(staging / 'config.json', {'bootstrap': base, 'gateway': origin(doc['gateway_origin']),
|
save(staging / 'config.json', {'bootstrap': base, 'gateway': origin(doc['gateway_origin']),
|
||||||
'tenant': canonical_id(doc['tenant_id'])})
|
'tenant': canonical_id(doc['tenant_id'])})
|
||||||
updater = staging / 'updater'
|
updater = staging / 'updater'
|
||||||
remote((base, token), '/agent/v1/bootstrap/updater?platform=' + PLATFORM + '&sha256=' + doc['updater']['sha256'], updater, doc['updater'])
|
remote((base, token), '/agent/v1/bootstrap/updater?platform=' + target + '&sha256=' + doc['updater']['sha256'], updater, doc['updater'])
|
||||||
updater.chmod(0o755)
|
updater.chmod(0o755)
|
||||||
releases = staging / 'releases'
|
releases = staging / 'releases'
|
||||||
releases.mkdir()
|
releases.mkdir()
|
||||||
@@ -599,6 +607,7 @@ def revert(intent, report_failure=True):
|
|||||||
|
|
||||||
|
|
||||||
def update():
|
def update():
|
||||||
|
target = release_platform()
|
||||||
with (ROOT / 'release.lock').open('rb') as lock:
|
with (ROOT / 'release.lock').open('rb') as lock:
|
||||||
fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||||
pending = ROOT / 'pending.json'
|
pending = ROOT / 'pending.json'
|
||||||
@@ -608,7 +617,7 @@ def update():
|
|||||||
with tempfile.TemporaryDirectory(prefix='.incoming-', dir=ROOT / 'releases') as work:
|
with tempfile.TemporaryDirectory(prefix='.incoming-', dir=ROOT / 'releases') as work:
|
||||||
staging = Path(work) / 'generation'
|
staging = Path(work) / 'generation'
|
||||||
staging.mkdir()
|
staging.mkdir()
|
||||||
remote(None, '/agent/v1/releases/current?platform=' + PLATFORM, staging / 'current.json')
|
remote(None, '/agent/v1/releases/current?platform=' + target, staging / 'current.json')
|
||||||
response = read(staging / 'current.json')
|
response = read(staging / 'current.json')
|
||||||
if response['status'] == 'not_configured':
|
if response['status'] == 'not_configured':
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ fn official_windows(platform: Platform) -> bool {
|
|||||||
async fn config(s: &crate::State, platform: Platform, tenant: Uuid, wanted: Option<&str>) -> Result<Config, Error> {
|
async fn config(s: &crate::State, platform: Platform, tenant: Uuid, wanted: Option<&str>) -> Result<Config, Error> {
|
||||||
let slot = match platform {
|
let slot = match platform {
|
||||||
Platform::LinuxX64 => "RMM_AGENT_BOOTSTRAP_LINUX_FILE",
|
Platform::LinuxX64 => "RMM_AGENT_BOOTSTRAP_LINUX_FILE",
|
||||||
|
Platform::LinuxArm64 => "RMM_AGENT_BOOTSTRAP_LINUX_ARM64_FILE",
|
||||||
Platform::WindowsX64 => "RMM_AGENT_BOOTSTRAP_WINDOWS_FILE",
|
Platform::WindowsX64 => "RMM_AGENT_BOOTSTRAP_WINDOWS_FILE",
|
||||||
Platform::WindowsGnuX64 => "RMM_AGENT_BOOTSTRAP_WINDOWS_GNU_FILE",
|
Platform::WindowsGnuX64 => "RMM_AGENT_BOOTSTRAP_WINDOWS_GNU_FILE",
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,7 +14,9 @@ pub(super) async fn publish_missing(
|
|||||||
tx: &mut Transaction<'_, Postgres>,
|
tx: &mut Transaction<'_, Postgres>,
|
||||||
tenant: Uuid,
|
tenant: Uuid,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
let Some(slot) = std::env::var_os("RMM_AGENT_BOOTSTRAP_LINUX_FILE") else {
|
let Some(slot) = std::env::var_os("RMM_AGENT_BOOTSTRAP_LINUX_FILE")
|
||||||
|
.or_else(|| std::env::var_os("RMM_AGENT_BOOTSTRAP_LINUX_ARM64_FILE"))
|
||||||
|
else {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
};
|
};
|
||||||
let Some(config_dir) = FsPath::new(&slot).parent() else {
|
let Some(config_dir) = FsPath::new(&slot).parent() else {
|
||||||
@@ -29,6 +31,7 @@ pub(super) async fn publish_missing(
|
|||||||
}
|
}
|
||||||
for platform in [
|
for platform in [
|
||||||
Platform::LinuxX64,
|
Platform::LinuxX64,
|
||||||
|
Platform::LinuxArm64,
|
||||||
Platform::WindowsGnuX64,
|
Platform::WindowsGnuX64,
|
||||||
Platform::WindowsX64,
|
Platform::WindowsX64,
|
||||||
] {
|
] {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
use crate::{jobs::Error, root_policy::RootScope, windows_policy::SystemScope};
|
use crate::{jobs::Error, root_policy::RootScope, windows_policy::SystemScope};
|
||||||
use axum::http::StatusCode;
|
use axum::http::StatusCode;
|
||||||
use rmm_domain::{
|
use rmm_domain::{
|
||||||
agent_update::{ArtifactRole, Platform, ReleaseManifest, digest},
|
agent_update::{ArtifactRole, LINUX_ARM64_RELEASE_CAPABILITY, Platform, ReleaseManifest, digest},
|
||||||
jobs::{Action, FULL_MAINTENANCE_CAPABILITY, JobPayload},
|
jobs::{Action, FULL_MAINTENANCE_CAPABILITY, JobPayload},
|
||||||
};
|
};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
@@ -60,7 +60,7 @@ impl ReleaseAnchor {
|
|||||||
};
|
};
|
||||||
let field = |name: &str, value: &str| format!(r#""{name}":"{value}""#);
|
let field = |name: &str, value: &str| format!(r#""{name}":"{value}""#);
|
||||||
match manifest.platform {
|
match manifest.platform {
|
||||||
Platform::LinuxX64 => replace(
|
Platform::LinuxX64 | Platform::LinuxArm64 => replace(
|
||||||
field("helper_binary_sha256", &self.helper_sha256),
|
field("helper_binary_sha256", &self.helper_sha256),
|
||||||
field("helper_binary_sha256", next(ArtifactRole::Helper)?),
|
field("helper_binary_sha256", next(ArtifactRole::Helper)?),
|
||||||
1,
|
1,
|
||||||
@@ -164,6 +164,9 @@ fn check_pair(
|
|||||||
caps: &[String],
|
caps: &[String],
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
let platform = match identity {
|
let platform = match identity {
|
||||||
|
"root" if caps.iter().any(|cap| cap == LINUX_ARM64_RELEASE_CAPABILITY) => {
|
||||||
|
Platform::LinuxArm64
|
||||||
|
}
|
||||||
"root" => Platform::LinuxX64,
|
"root" => Platform::LinuxX64,
|
||||||
"system" => Platform::WindowsGnuX64,
|
"system" => Platform::WindowsGnuX64,
|
||||||
_ => return Err(binding_error()),
|
_ => return Err(binding_error()),
|
||||||
|
|||||||
@@ -218,11 +218,7 @@ fn current_keyring(file: &UpdateKeyringFile) -> Result<UpdateKeyring> {
|
|||||||
.map_err(|_| anyhow::anyhow!("UPDATE_HISTORY_KEY_SIZE"))?;
|
.map_err(|_| anyhow::anyhow!("UPDATE_HISTORY_KEY_SIZE"))?;
|
||||||
keys.push(TrustedUpdateKey::new(
|
keys.push(TrustedUpdateKey::new(
|
||||||
public,
|
public,
|
||||||
match key.platform {
|
key.platform.into(),
|
||||||
Platform::LinuxX64 => ReleasePlatform::LinuxX64,
|
|
||||||
Platform::WindowsX64 => ReleasePlatform::WindowsX64,
|
|
||||||
Platform::WindowsGnuX64 => ReleasePlatform::WindowsGnuX64,
|
|
||||||
},
|
|
||||||
key.first_sequence,
|
key.first_sequence,
|
||||||
key.last_sequence,
|
key.last_sequence,
|
||||||
key.revoked,
|
key.revoked,
|
||||||
@@ -307,11 +303,7 @@ fn verify_record_release(
|
|||||||
.release_envelope
|
.release_envelope
|
||||||
.decode()
|
.decode()
|
||||||
.map_err(anyhow::Error::msg)?;
|
.map_err(anyhow::Error::msg)?;
|
||||||
let platform = match record.platform {
|
let platform = ReleasePlatform::from(record.platform);
|
||||||
Platform::LinuxX64 => ReleasePlatform::LinuxX64,
|
|
||||||
Platform::WindowsX64 => ReleasePlatform::WindowsX64,
|
|
||||||
Platform::WindowsGnuX64 => ReleasePlatform::WindowsGnuX64,
|
|
||||||
};
|
|
||||||
let envelope: &ReleaseEnvelope = &record.release_envelope;
|
let envelope: &ReleaseEnvelope = &record.release_envelope;
|
||||||
verify_release(
|
verify_release(
|
||||||
SignedRelease {
|
SignedRelease {
|
||||||
@@ -403,7 +395,7 @@ fn verify_update(
|
|||||||
ensure!(
|
ensure!(
|
||||||
job.execution_identity
|
job.execution_identity
|
||||||
== match record.platform {
|
== match record.platform {
|
||||||
Platform::LinuxX64 => "root",
|
Platform::LinuxX64 | Platform::LinuxArm64 => "root",
|
||||||
Platform::WindowsX64 | Platform::WindowsGnuX64 => "system",
|
Platform::WindowsX64 | Platform::WindowsGnuX64 => "system",
|
||||||
}
|
}
|
||||||
&& update.release_envelope == record.release_envelope
|
&& update.release_envelope == record.release_envelope
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ mod linux {
|
|||||||
let args: Vec<_> = std::env::args_os().skip(1).collect();
|
let args: Vec<_> = std::env::args_os().skip(1).collect();
|
||||||
if args.first().is_some_and(|arg| arg == "--verify-bootstrap") {
|
if args.first().is_some_and(|arg| arg == "--verify-bootstrap") {
|
||||||
let release =
|
let release =
|
||||||
rmm_updater::verify_bootstrap_files(rmm_updater::Platform::LinuxX64, &args[1..])?;
|
rmm_updater::verify_bootstrap_files(rmm_domain::agent_update::Platform::NATIVE_LINUX.into(), &args[1..])?;
|
||||||
println!("{}", serde_json::to_string(release.manifest())?);
|
println!("{}", serde_json::to_string(release.manifest())?);
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ use crate::{
|
|||||||
VerifiedRelease,
|
VerifiedRelease,
|
||||||
};
|
};
|
||||||
use anyhow::{Context, Result, ensure};
|
use anyhow::{Context, Result, ensure};
|
||||||
use rmm_domain::agent_update::{Platform as WirePlatform, ReleaseEnvelope, UpdateKeyringFile};
|
use rmm_domain::agent_update::{ReleaseEnvelope, UpdateKeyringFile};
|
||||||
use std::{
|
use std::{
|
||||||
ffi::OsString,
|
ffi::OsString,
|
||||||
fs::File,
|
fs::File,
|
||||||
@@ -31,18 +31,13 @@ pub fn verify_bootstrap_files(platform: Platform, args: &[OsString]) -> Result<V
|
|||||||
.keys
|
.keys
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|key| {
|
.map(|key| {
|
||||||
let platform = match key.platform {
|
|
||||||
WirePlatform::LinuxX64 => Platform::LinuxX64,
|
|
||||||
WirePlatform::WindowsX64 => Platform::WindowsX64,
|
|
||||||
WirePlatform::WindowsGnuX64 => Platform::WindowsGnuX64,
|
|
||||||
};
|
|
||||||
let raw = hex::decode(key.public_key_hex)?
|
let raw = hex::decode(key.public_key_hex)?
|
||||||
.try_into()
|
.try_into()
|
||||||
.ok()
|
.ok()
|
||||||
.context("Ed25519 public key length")?;
|
.context("Ed25519 public key length")?;
|
||||||
TrustedUpdateKey::new(
|
TrustedUpdateKey::new(
|
||||||
raw,
|
raw,
|
||||||
platform,
|
key.platform.into(),
|
||||||
key.first_sequence,
|
key.first_sequence,
|
||||||
key.last_sequence,
|
key.last_sequence,
|
||||||
key.revoked,
|
key.revoked,
|
||||||
|
|||||||
@@ -16,12 +16,26 @@ pub const RELEASE_SIGNATURE_DOMAIN: &[u8] = b"rmm.agent-release.v1\0";
|
|||||||
pub enum Platform {
|
pub enum Platform {
|
||||||
#[serde(rename = "x86_64-unknown-linux-gnu")]
|
#[serde(rename = "x86_64-unknown-linux-gnu")]
|
||||||
LinuxX64,
|
LinuxX64,
|
||||||
|
#[serde(rename = "aarch64-unknown-linux-gnu")]
|
||||||
|
LinuxArm64,
|
||||||
#[serde(rename = "x86_64-pc-windows-msvc")]
|
#[serde(rename = "x86_64-pc-windows-msvc")]
|
||||||
WindowsX64,
|
WindowsX64,
|
||||||
#[serde(rename = "x86_64-pc-windows-gnu")]
|
#[serde(rename = "x86_64-pc-windows-gnu")]
|
||||||
WindowsGnuX64,
|
WindowsGnuX64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<rmm_domain::agent_update::Platform> for Platform {
|
||||||
|
fn from(platform: rmm_domain::agent_update::Platform) -> Self {
|
||||||
|
use rmm_domain::agent_update::Platform as WirePlatform;
|
||||||
|
match platform {
|
||||||
|
WirePlatform::LinuxX64 => Self::LinuxX64,
|
||||||
|
WirePlatform::LinuxArm64 => Self::LinuxArm64,
|
||||||
|
WirePlatform::WindowsX64 => Self::WindowsX64,
|
||||||
|
WirePlatform::WindowsGnuX64 => Self::WindowsGnuX64,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
pub enum ArtifactRole {
|
pub enum ArtifactRole {
|
||||||
|
|||||||
@@ -21,9 +21,11 @@ services:
|
|||||||
RMM_BOOTSTRAP_ORIGIN: https://discovery.ease-technologies.de:8443
|
RMM_BOOTSTRAP_ORIGIN: https://discovery.ease-technologies.de:8443
|
||||||
RMM_AGENT_UPDATE_ARTIFACT_DIR: /release-objects
|
RMM_AGENT_UPDATE_ARTIFACT_DIR: /release-objects
|
||||||
RMM_AGENT_UPDATE_LINUX_KEYRING_FILE: /release-config/linux-keyring.json
|
RMM_AGENT_UPDATE_LINUX_KEYRING_FILE: /release-config/linux-keyring.json
|
||||||
|
RMM_AGENT_UPDATE_LINUX_ARM64_KEYRING_FILE: /release-config/linux-arm64-keyring.json
|
||||||
RMM_AGENT_UPDATE_WINDOWS_KEYRING_FILE: /release-config/windows-keyring.json
|
RMM_AGENT_UPDATE_WINDOWS_KEYRING_FILE: /release-config/windows-keyring.json
|
||||||
RMM_AGENT_UPDATE_WINDOWS_GNU_OFFICIAL_KEYRING_FILE: /release-config/windows-gnu-official-keyring.json
|
RMM_AGENT_UPDATE_WINDOWS_GNU_OFFICIAL_KEYRING_FILE: /release-config/windows-gnu-official-keyring.json
|
||||||
RMM_AGENT_BOOTSTRAP_LINUX_FILE: /release-config/linux-bootstrap.json
|
RMM_AGENT_BOOTSTRAP_LINUX_FILE: /release-config/linux-bootstrap.json
|
||||||
|
RMM_AGENT_BOOTSTRAP_LINUX_ARM64_FILE: /release-config/linux-arm64-bootstrap.json
|
||||||
RMM_AGENT_BOOTSTRAP_WINDOWS_FILE: /release-config/windows-bootstrap.json
|
RMM_AGENT_BOOTSTRAP_WINDOWS_FILE: /release-config/windows-bootstrap.json
|
||||||
RMM_AGENT_BOOTSTRAP_WINDOWS_GNU_FILE: /release-config/windows-gnu-official-bootstrap.json
|
RMM_AGENT_BOOTSTRAP_WINDOWS_GNU_FILE: /release-config/windows-gnu-official-bootstrap.json
|
||||||
ports: ["127.0.0.1:18445:18443"]
|
ports: ["127.0.0.1:18445:18443"]
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
x-release-environment: &release-environment
|
x-release-environment: &release-environment
|
||||||
RMM_AGENT_UPDATE_ARTIFACT_DIR: /release-objects
|
RMM_AGENT_UPDATE_ARTIFACT_DIR: /release-objects
|
||||||
RMM_AGENT_UPDATE_LINUX_KEYRING_FILE: /release-config/linux-keyring.json
|
RMM_AGENT_UPDATE_LINUX_KEYRING_FILE: /release-config/linux-keyring.json
|
||||||
|
RMM_AGENT_UPDATE_LINUX_ARM64_KEYRING_FILE: /release-config/linux-arm64-keyring.json
|
||||||
RMM_AGENT_UPDATE_WINDOWS_KEYRING_FILE: /release-config/windows-keyring.json
|
RMM_AGENT_UPDATE_WINDOWS_KEYRING_FILE: /release-config/windows-keyring.json
|
||||||
RMM_AGENT_BOOTSTRAP_LINUX_FILE: /release-config/linux-bootstrap.json
|
RMM_AGENT_BOOTSTRAP_LINUX_FILE: /release-config/linux-bootstrap.json
|
||||||
|
RMM_AGENT_BOOTSTRAP_LINUX_ARM64_FILE: /release-config/linux-arm64-bootstrap.json
|
||||||
RMM_AGENT_BOOTSTRAP_WINDOWS_FILE: /release-config/windows-bootstrap.json
|
RMM_AGENT_BOOTSTRAP_WINDOWS_FILE: /release-config/windows-bootstrap.json
|
||||||
RMM_AGENT_UPDATE_WINDOWS_GNU_OFFICIAL_KEYRING_FILE: /release-config/windows-gnu-official-keyring.json
|
RMM_AGENT_UPDATE_WINDOWS_GNU_OFFICIAL_KEYRING_FILE: /release-config/windows-gnu-official-keyring.json
|
||||||
RMM_AGENT_BOOTSTRAP_WINDOWS_GNU_FILE: /release-config/windows-gnu-official-bootstrap.json
|
RMM_AGENT_BOOTSTRAP_WINDOWS_GNU_FILE: /release-config/windows-gnu-official-bootstrap.json
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
ALTER TABLE agent_update_releases DROP CONSTRAINT agent_update_releases_platform_check;
|
||||||
|
ALTER TABLE agent_update_releases ADD CHECK (platform IN
|
||||||
|
('x86_64-unknown-linux-gnu','aarch64-unknown-linux-gnu','x86_64-pc-windows-msvc','x86_64-pc-windows-gnu'));
|
||||||
@@ -19,9 +19,11 @@ from urllib.parse import urlencode, urlsplit
|
|||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
LINUX = 'x86_64-unknown-linux-gnu'
|
LINUX = 'x86_64-unknown-linux-gnu'
|
||||||
|
LINUX_ARM64 = 'aarch64-unknown-linux-gnu'
|
||||||
WINDOWS = 'x86_64-pc-windows-msvc'
|
WINDOWS = 'x86_64-pc-windows-msvc'
|
||||||
FILES = {LINUX: ('rmm-agent', 'rmm-privileged-helper', 'rmm-agent-updater'),
|
FILES = {LINUX: ('rmm-agent', 'rmm-privileged-helper', 'rmm-agent-updater'),
|
||||||
WINDOWS: ('rmm-agent-windows.exe', 'rmm-helper-windows.exe', 'rmm-updater-windows.exe')}
|
WINDOWS: ('rmm-agent-windows.exe', 'rmm-helper-windows.exe', 'rmm-updater-windows.exe')}
|
||||||
|
FILES[LINUX_ARM64] = FILES[LINUX]
|
||||||
WINDOWS_GNU = 'x86_64-pc-windows-gnu'
|
WINDOWS_GNU = 'x86_64-pc-windows-gnu'
|
||||||
FILES[WINDOWS_GNU] = FILES[WINDOWS]
|
FILES[WINDOWS_GNU] = FILES[WINDOWS]
|
||||||
LIMIT = 256 * 1024 * 1024
|
LIMIT = 256 * 1024 * 1024
|
||||||
@@ -55,9 +57,11 @@ def verify_native_image(path, target, size):
|
|||||||
with path.open('rb') as binary:
|
with path.open('rb') as binary:
|
||||||
header = binary.read(64)
|
header = binary.read(64)
|
||||||
check(len(header) == 64, 'truncated binary header: ' + path.name)
|
check(len(header) == 64, 'truncated binary header: ' + path.name)
|
||||||
if target == LINUX:
|
if target in (LINUX, LINUX_ARM64):
|
||||||
|
machine = 62 if target == LINUX else 183
|
||||||
check(header[:6] == b'\x7fELF\x02\x01' and header[16:18] in (b'\x02\x00', b'\x03\x00')
|
check(header[:6] == b'\x7fELF\x02\x01' and header[16:18] in (b'\x02\x00', b'\x03\x00')
|
||||||
and header[18:20] == b'\x3e\x00', 'Linux x86-64 ELF image required: ' + path.name)
|
and int.from_bytes(header[18:20], 'little') == machine,
|
||||||
|
f'{target} ELF image required: {path.name}')
|
||||||
else:
|
else:
|
||||||
pe = int.from_bytes(header[60:64], 'little')
|
pe = int.from_bytes(header[60:64], 'little')
|
||||||
check(header[:2] == b'MZ' and 64 <= pe <= size - 26, 'Windows PE image required: ' + path.name)
|
check(header[:2] == b'MZ' and 64 <= pe <= size - 26, 'Windows PE image required: ' + path.name)
|
||||||
@@ -130,7 +134,7 @@ def release_label(platform, official_windows):
|
|||||||
if official_windows:
|
if official_windows:
|
||||||
check(platform == WINDOWS_GNU, 'official Windows releases require a GNU x64 build receipt')
|
check(platform == WINDOWS_GNU, 'official Windows releases require a GNU x64 build receipt')
|
||||||
return 'windows-gnu-official'
|
return 'windows-gnu-official'
|
||||||
return {LINUX: 'linux', WINDOWS: 'windows', WINDOWS_GNU: 'windows-gnu'}[platform]
|
return {LINUX: 'linux', LINUX_ARM64: 'linux-arm64', WINDOWS: 'windows', WINDOWS_GNU: 'windows-gnu'}[platform]
|
||||||
|
|
||||||
|
|
||||||
def prepare(args):
|
def prepare(args):
|
||||||
|
|||||||
+18
-11
@@ -22,6 +22,12 @@ TARGETS = {
|
|||||||
"sha256:30ae3d90753bc39b0a98a897784c662aff9598ffab7a98a6298e8aa79145c2ec",
|
"sha256:30ae3d90753bc39b0a98a897784c662aff9598ffab7a98a6298e8aa79145c2ec",
|
||||||
[("rmm-server", "rmm-server"), ("rmm-time-broker-linux", "rmm-time-broker-linux")],
|
[("rmm-server", "rmm-server"), ("rmm-time-broker-linux", "rmm-time-broker-linux")],
|
||||||
),
|
),
|
||||||
|
"linux-arm64": (
|
||||||
|
"linux/arm64", "aarch64-unknown-linux-gnu",
|
||||||
|
"sha256:30ae3d90753bc39b0a98a897784c662aff9598ffab7a98a6298e8aa79145c2ec",
|
||||||
|
[("rmm-agent", "rmm-agent"), ("rmm-privileged-helper", "rmm-privileged-helper"),
|
||||||
|
("rmm-updater-worker", "rmm-agent-updater")],
|
||||||
|
),
|
||||||
"linux-x64": (
|
"linux-x64": (
|
||||||
"linux/amd64", "x86_64-unknown-linux-gnu",
|
"linux/amd64", "x86_64-unknown-linux-gnu",
|
||||||
"sha256:9a76ad3744ebfdddae96ca10001ce8291c1b332fb54c8df5eea0e8e999ac6fc6",
|
"sha256:9a76ad3744ebfdddae96ca10001ce8291c1b332fb54c8df5eea0e8e999ac6fc6",
|
||||||
@@ -34,6 +40,7 @@ TARGETS = {
|
|||||||
[("rmm-agent-windows", "rmm-agent-windows"), ("rmm-agent-windows", "rmm-helper-windows")],
|
[("rmm-agent-windows", "rmm-agent-windows"), ("rmm-agent-windows", "rmm-helper-windows")],
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
REMOTE_TARGETS = ("server-arm64", "linux-arm64")
|
||||||
SOURCE_PATHS = ["Cargo.toml", "Cargo.lock", "rust-toolchain.toml", "crates", "proto",
|
SOURCE_PATHS = ["Cargo.toml", "Cargo.lock", "rust-toolchain.toml", "crates", "proto",
|
||||||
"migrations", "tools/apt-transaction", "deploy/linux", "tests"]
|
"migrations", "tools/apt-transaction", "deploy/linux", "tests"]
|
||||||
|
|
||||||
@@ -140,7 +147,7 @@ def build_archive(work, archive, revision, plan):
|
|||||||
print(f"Artifacts: {destination}\n{json.dumps(hashes, indent=2)}")
|
print(f"Artifacts: {destination}\n{json.dumps(hashes, indent=2)}")
|
||||||
|
|
||||||
|
|
||||||
def remote_build(archive, revision, jobs):
|
def remote_build(archive, revision, jobs, target):
|
||||||
from dev_stage import ssh_prefix
|
from dev_stage import ssh_prefix
|
||||||
|
|
||||||
# The only SSH payload is this build driver and the selected Git sources.
|
# The only SSH payload is this build driver and the selected Git sources.
|
||||||
@@ -154,14 +161,14 @@ trap 'rm -rf -- "$stage"' EXIT
|
|||||||
cd "$stage"
|
cd "$stage"
|
||||||
tar -xf - build.py source.tar.gz
|
tar -xf - build.py source.tar.gz
|
||||||
printf '%s build.py\\n%s source.tar.gz\\n' "$1" "$2" | sha256sum -c - >/dev/null
|
printf '%s build.py\\n%s source.tar.gz\\n' "$1" "$2" | sha256sum -c - >/dev/null
|
||||||
python3 -I build.py _server_worker "$3" "$4"
|
python3 -I build.py _server_worker "$3" "$4" "$5"
|
||||||
"""
|
"""
|
||||||
with tempfile.TemporaryFile() as bundle:
|
with tempfile.TemporaryFile() as bundle:
|
||||||
with tarfile.open(fileobj=bundle, mode="w") as package:
|
with tarfile.open(fileobj=bundle, mode="w") as package:
|
||||||
package.add(worker, arcname="build.py")
|
package.add(worker, arcname="build.py")
|
||||||
package.add(archive, arcname="source.tar.gz")
|
package.add(archive, arcname="source.tar.gz")
|
||||||
bundle.seek(0)
|
bundle.seek(0)
|
||||||
command = shlex.join(["sh", "-c", shell, "build", *checksums, revision, str(jobs)])
|
command = shlex.join(["sh", "-c", shell, "build", *checksums, revision, str(jobs), target])
|
||||||
result = subprocess.run([*ssh_prefix("server"), command], stdin=bundle)
|
result = subprocess.run([*ssh_prefix("server"), command], stdin=bundle)
|
||||||
if result.returncode:
|
if result.returncode:
|
||||||
raise SystemExit(f"ARM64 build via SSH failed (exit {result.returncode}).")
|
raise SystemExit(f"ARM64 build via SSH failed (exit {result.returncode}).")
|
||||||
@@ -176,13 +183,13 @@ def main():
|
|||||||
parser.add_argument("target", choices=TARGETS)
|
parser.add_argument("target", choices=TARGETS)
|
||||||
parser.add_argument("--ref", default="HEAD", help="Git commit or ref (default: HEAD). Uncommitted edits are excluded.")
|
parser.add_argument("--ref", default="HEAD", help="Git commit or ref (default: HEAD). Uncommitted edits are excluded.")
|
||||||
parser.add_argument("--jobs", type=int, default=2, help="Maximum parallel Cargo jobs (default: 2).")
|
parser.add_argument("--jobs", type=int, default=2, help="Maximum parallel Cargo jobs (default: 2).")
|
||||||
parser.add_argument("--ssh", action="store_true", help="Build server-arm64 on the configured server, in ~/rmm-dev-build/.")
|
parser.add_argument("--ssh", action="store_true", help="Build ARM64 binaries on the configured server, in ~/rmm-dev-build/.")
|
||||||
parser.add_argument("--plan", action="store_true", help="Show the build plan without connecting, writing or building.")
|
parser.add_argument("--plan", action="store_true", help="Show the build plan without connecting, writing or building.")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
if args.jobs < 1:
|
if args.jobs < 1:
|
||||||
parser.error("--jobs must be positive")
|
parser.error("--jobs must be positive")
|
||||||
if args.ssh and args.target != "server-arm64":
|
if args.ssh and args.target not in REMOTE_TARGETS:
|
||||||
parser.error("--ssh applies to server-arm64")
|
parser.error("--ssh applies to the ARM64 targets")
|
||||||
revision = git("rev-parse", "--verify", "--end-of-options", args.ref + "^{commit}")
|
revision = git("rev-parse", "--verify", "--end-of-options", args.ref + "^{commit}")
|
||||||
windows_updater = args.target == "windows-gnu-x64" and git(
|
windows_updater = args.target == "windows-gnu-x64" and git(
|
||||||
"ls-tree", "--name-only", revision, "crates/agent-windows/src/bin/rmm-updater-windows.rs")
|
"ls-tree", "--name-only", revision, "crates/agent-windows/src/bin/rmm-updater-windows.rs")
|
||||||
@@ -196,7 +203,7 @@ def main():
|
|||||||
archive = Path(temporary) / "source.tar.gz"
|
archive = Path(temporary) / "source.tar.gz"
|
||||||
subprocess.run(["git", "archive", "-o", archive, revision, "--", *SOURCE_PATHS], cwd=ROOT, check=True)
|
subprocess.run(["git", "archive", "-o", archive, revision, "--", *SOURCE_PATHS], cwd=ROOT, check=True)
|
||||||
if args.ssh:
|
if args.ssh:
|
||||||
remote_build(archive, revision, args.jobs)
|
remote_build(archive, revision, args.jobs, args.target)
|
||||||
else:
|
else:
|
||||||
build_archive(ROOT / "devstate" / "build" / args.target, archive, revision, plan)
|
build_archive(ROOT / "devstate" / "build" / args.target, archive, revision, plan)
|
||||||
|
|
||||||
@@ -204,12 +211,12 @@ def main():
|
|||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
try:
|
try:
|
||||||
if sys.argv[1:2] == ["_server_worker"]:
|
if sys.argv[1:2] == ["_server_worker"]:
|
||||||
revision, jobs_arg = sys.argv[2:]
|
revision, jobs_arg, target = sys.argv[2:]
|
||||||
if (len(revision) not in (40, 64) or any(c not in "0123456789abcdef" for c in revision)
|
if (target not in REMOTE_TARGETS or len(revision) not in (40, 64) or any(c not in "0123456789abcdef" for c in revision)
|
||||||
or not jobs_arg.isascii() or not jobs_arg.isdecimal() or int(jobs_arg) < 1):
|
or not jobs_arg.isascii() or not jobs_arg.isdecimal() or int(jobs_arg) < 1):
|
||||||
raise SystemExit("Invalid packed build request.")
|
raise SystemExit("Invalid packed build request.")
|
||||||
work = Path.home() / "rmm-dev-build" / "server-arm64"
|
work = Path.home() / "rmm-dev-build" / target
|
||||||
build_archive(work, Path("source.tar.gz").resolve(), revision, prepare("server-arm64", int(jobs_arg)))
|
build_archive(work, Path("source.tar.gz").resolve(), revision, prepare(target, int(jobs_arg)))
|
||||||
else:
|
else:
|
||||||
main()
|
main()
|
||||||
except (OSError, subprocess.CalledProcessError) as error:
|
except (OSError, subprocess.CalledProcessError) as error:
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ from dev_stage import ssh_prefix
|
|||||||
|
|
||||||
def publish(tenant, platform, release, official_windows=False, *, root=Path('/opt/rust-discovery/devstate/mvp-releases'),
|
def publish(tenant, platform, release, official_windows=False, *, root=Path('/opt/rust-discovery/devstate/mvp-releases'),
|
||||||
database_container='rust-discovery-server-postgres-1', service_uid=10001):
|
database_container='rust-discovery-server-postgres-1', service_uid=10001):
|
||||||
labels = {'x86_64-pc-windows-gnu': 'windows-gnu', 'x86_64-unknown-linux-gnu': 'linux'}
|
labels = {'x86_64-pc-windows-gnu': 'windows-gnu', 'x86_64-unknown-linux-gnu': 'linux',
|
||||||
|
'aarch64-unknown-linux-gnu': 'linux-arm64'}
|
||||||
label = labels[platform]
|
label = labels[platform]
|
||||||
if official_windows:
|
if official_windows:
|
||||||
if platform != 'x86_64-pc-windows-gnu':
|
if platform != 'x86_64-pc-windows-gnu':
|
||||||
@@ -88,7 +89,7 @@ def publish(tenant, platform, release, official_windows=False, *, root=Path('/op
|
|||||||
def main():
|
def main():
|
||||||
parser=argparse.ArgumentParser(description=__doc__)
|
parser=argparse.ArgumentParser(description=__doc__)
|
||||||
parser.add_argument('--tenant',required=True,type=uuid.UUID)
|
parser.add_argument('--tenant',required=True,type=uuid.UUID)
|
||||||
parser.add_argument('--platform',required=True,choices=['x86_64-unknown-linux-gnu','x86_64-pc-windows-gnu'])
|
parser.add_argument('--platform',required=True,choices=['x86_64-unknown-linux-gnu','aarch64-unknown-linux-gnu','x86_64-pc-windows-gnu'])
|
||||||
parser.add_argument('--official-windows',action='store_true')
|
parser.add_argument('--official-windows',action='store_true')
|
||||||
parser.add_argument('--release',required=True,type=uuid.UUID)
|
parser.add_argument('--release',required=True,type=uuid.UUID)
|
||||||
args=parser.parse_args()
|
args=parser.parse_args()
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export function releaseEnvelope(value: unknown): ReleaseView {
|
|||||||
if (!bytes.length || bytes.length > 16384 || signature.length !== 64) throw new Error('Agentupdate: Manifest-/Signaturlimit');
|
if (!bytes.length || bytes.length > 16384 || signature.length !== 64) throw new Error('Agentupdate: Manifest-/Signaturlimit');
|
||||||
const m = record(JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(bytes)));
|
const m = record(JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(bytes)));
|
||||||
exact(m, ['schema_version', 'release_id', 'release_sequence', 'version', 'platform', 'published_at', 'expires_at', 'protocol_major', 'state_schema', 'minimum_updater_version', 'artifacts']);
|
exact(m, ['schema_version', 'release_id', 'release_sequence', 'version', 'platform', 'published_at', 'expires_at', 'protocol_major', 'state_schema', 'minimum_updater_version', 'artifacts']);
|
||||||
if (m.schema_version !== 1 || !['x86_64-unknown-linux-gnu', 'x86_64-pc-windows-msvc', 'x86_64-pc-windows-gnu'].includes(String(m.platform)) || typeof m.version !== 'string' || !/^[A-Za-z0-9.+_-]{1,64}$/.test(m.version)
|
if (m.schema_version !== 1 || !['x86_64-unknown-linux-gnu', 'aarch64-unknown-linux-gnu', 'x86_64-pc-windows-msvc', 'x86_64-pc-windows-gnu'].includes(String(m.platform)) || typeof m.version !== 'string' || !/^[A-Za-z0-9.+_-]{1,64}$/.test(m.version)
|
||||||
|| !Array.isArray(m.artifacts) || m.artifacts.length !== 2) throw new Error('Agentupdate: festes x64-Codepaar erforderlich');
|
|| !Array.isArray(m.artifacts) || m.artifacts.length !== 2) throw new Error('Agentupdate: festes x64-Codepaar erforderlich');
|
||||||
const artifacts = m.artifacts.map((value, index) => { const a = record(value); exact(a, ['role', 'artifact_id', 'sha256', 'bytes']); if (a.role !== ['agent', 'helper'][index]) throw new Error('Agentupdate: Agent-/Helperreihenfolge'); return { role: a.role, artifact_id: uuid(a.artifact_id), sha256: digest(a.sha256), bytes: integer(a.bytes, 1, 268435456) }; });
|
const artifacts = m.artifacts.map((value, index) => { const a = record(value); exact(a, ['role', 'artifact_id', 'sha256', 'bytes']); if (a.role !== ['agent', 'helper'][index]) throw new Error('Agentupdate: Agent-/Helperreihenfolge'); return { role: a.role, artifact_id: uuid(a.artifact_id), sha256: digest(a.sha256), bytes: integer(a.bytes, 1, 268435456) }; });
|
||||||
if (artifacts[0]!.artifact_id === artifacts[1]!.artifact_id) throw new Error('Agentupdate: doppelte Artefakt-ID');
|
if (artifacts[0]!.artifact_id === artifacts[1]!.artifact_id) throw new Error('Agentupdate: doppelte Artefakt-ID');
|
||||||
@@ -55,7 +55,7 @@ export function validateAgentUpdateAction(value: unknown, identity: unknown): Re
|
|||||||
const action = record(value); exact(action, ['action', 'update']); if (action.action !== 'update_agent') throw new Error('Agentupdate: typisierte Aktion erforderlich');
|
const action = record(value); exact(action, ['action', 'update']); if (action.action !== 'update_agent') throw new Error('Agentupdate: typisierte Aktion erforderlich');
|
||||||
const u = record(action.update); exact(u, ['schema_version', 'profile', 'release_envelope', 'release_envelope_sha256', 'manifest_sha256', 'predecessor', 'updater', 'peer_pin_transition', 'recovery', 'health_profile', 'health_timeout_seconds', 'no_reboot']);
|
const u = record(action.update); exact(u, ['schema_version', 'profile', 'release_envelope', 'release_envelope_sha256', 'manifest_sha256', 'predecessor', 'updater', 'peer_pin_transition', 'recovery', 'health_profile', 'health_timeout_seconds', 'no_reboot']);
|
||||||
if (u.schema_version !== 1 || u.profile !== 'fixed_code_pair_v1' || u.recovery !== 'restore_exact_predecessor_once' || u.health_profile !== 'mtls_inventory_sync_v1' || u.health_timeout_seconds !== 180 || u.no_reboot !== true) throw new Error('Agentupdate: fester Apply-/Health-/No-Reboot-Vertrag erforderlich');
|
if (u.schema_version !== 1 || u.profile !== 'fixed_code_pair_v1' || u.recovery !== 'restore_exact_predecessor_once' || u.health_profile !== 'mtls_inventory_sync_v1' || u.health_timeout_seconds !== 180 || u.no_reboot !== true) throw new Error('Agentupdate: fester Apply-/Health-/No-Reboot-Vertrag erforderlich');
|
||||||
const release = releaseEnvelope(u.release_envelope), linux = release.manifest.platform === 'x86_64-unknown-linux-gnu';
|
const release = releaseEnvelope(u.release_envelope), linux = release.manifest.platform.endsWith('-unknown-linux-gnu');
|
||||||
if (identity !== (linux ? 'root' : 'system')) throw new Error('Agentupdate: Plattform und Root-/SYSTEM-Identität widersprechen sich');
|
if (identity !== (linux ? 'root' : 'system')) throw new Error('Agentupdate: Plattform und Root-/SYSTEM-Identität widersprechen sich');
|
||||||
const old = record(u.predecessor); exact(old, ['release_id', 'release_sequence', 'manifest_sha256', 'installed_record_sha256', 'agent_sha256', 'helper_sha256']);
|
const old = record(u.predecessor); exact(old, ['release_id', 'release_sequence', 'manifest_sha256', 'installed_record_sha256', 'agent_sha256', 'helper_sha256']);
|
||||||
const predecessor = { release_id: uuid(old.release_id), release_sequence: integer(old.release_sequence), manifest_sha256: digest(old.manifest_sha256), installed_record_sha256: digest(old.installed_record_sha256), agent_sha256: digest(old.agent_sha256), helper_sha256: digest(old.helper_sha256) };
|
const predecessor = { release_id: uuid(old.release_id), release_sequence: integer(old.release_sequence), manifest_sha256: digest(old.manifest_sha256), installed_record_sha256: digest(old.installed_record_sha256), agent_sha256: digest(old.agent_sha256), helper_sha256: digest(old.helper_sha256) };
|
||||||
|
|||||||
+6
-2
@@ -200,7 +200,11 @@ function DeviceEnrollment({ tenantId, auth, customerName }: { tenantId: string;
|
|||||||
const [copied, setCopied] = useState(false);
|
const [copied, setCopied] = useState(false);
|
||||||
const [adminScripts, setAdminScripts] = useState(false);
|
const [adminScripts, setAdminScripts] = useState(false);
|
||||||
const origin = enrollment?.origin;
|
const origin = enrollment?.origin;
|
||||||
const linuxInstaller = origin && enrollment.platforms.includes('x86_64-unknown-linux-gnu') ? `${origin}/install/linux.sh` : null;
|
const linuxArchitectures = [
|
||||||
|
['x86_64-unknown-linux-gnu', 'x86-64'],
|
||||||
|
['aarch64-unknown-linux-gnu', 'ARM64'],
|
||||||
|
].filter(([target]) => enrollment?.platforms.includes(target)).map(([, label]) => label);
|
||||||
|
const linuxInstaller = origin && linuxArchitectures.length > 0 ? `${origin}/install/linux.sh` : null;
|
||||||
const windowsPlatforms = ['x86_64-pc-windows-gnu', 'x86_64-pc-windows-msvc'].filter(platform => enrollment?.platforms.includes(platform));
|
const windowsPlatforms = ['x86_64-pc-windows-gnu', 'x86_64-pc-windows-msvc'].filter(platform => enrollment?.platforms.includes(platform));
|
||||||
const windowsInstaller = origin && windowsPlatforms.length > 0 ? `${origin}/install/windows.ps1` : null;
|
const windowsInstaller = origin && windowsPlatforms.length > 0 ? `${origin}/install/windows.ps1` : null;
|
||||||
return <section aria-label="Gerät aufnehmen"><h2>Gerät aufnehmen</h2>
|
return <section aria-label="Gerät aufnehmen"><h2>Gerät aufnehmen</h2>
|
||||||
@@ -241,7 +245,7 @@ function DeviceEnrollment({ tenantId, auth, customerName }: { tenantId: string;
|
|||||||
{enrollment && !origin && <p role="status">Für die Geräteaufnahme ist keine HTTPS-Downloadadresse konfiguriert.</p>}
|
{enrollment && !origin && <p role="status">Für die Geräteaufnahme ist keine HTTPS-Downloadadresse konfiguriert.</p>}
|
||||||
{origin && !linuxInstaller && !windowsInstaller && <p role="status">Für diesen Kunden ist derzeit kein Linux- oder Windows-Installer verfügbar.</p>}
|
{origin && !linuxInstaller && !windowsInstaller && <p role="status">Für diesen Kunden ist derzeit kein Linux- oder Windows-Installer verfügbar.</p>}
|
||||||
{linuxInstaller && <>
|
{linuxInstaller && <>
|
||||||
<h4>Linux (x86-64)</h4>
|
<h4>Linux ({linuxArchitectures.join(' und ')})</h4>
|
||||||
<p>Installationsskript <a href={linuxInstaller} target="_blank" rel="noopener noreferrer">linux.sh</a></p>
|
<p>Installationsskript <a href={linuxInstaller} target="_blank" rel="noopener noreferrer">linux.sh</a></p>
|
||||||
<pre>{`curl --fail --show-error --silent '${linuxInstaller}' -o linux.sh && sudo sh linux.sh '${origin}'${adminScripts ? ' --enable-admin-scripts' : ''}`}</pre>
|
<pre>{`curl --fail --show-error --silent '${linuxInstaller}' -o linux.sh && sudo sh linux.sh '${origin}'${adminScripts ? ' --enable-admin-scripts' : ''}`}</pre>
|
||||||
</>}
|
</>}
|
||||||
|
|||||||
Reference in New Issue
Block a user