Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion agent/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ impl ApiClient {
});

if let Some(ref cert_pem) = self.cert_pem {
req = req.header("X-Client-Cert", cert_pem.as_str());
let encoded = cert_pem.replace('\n', "\\n");
req = req.header("X-Client-Cert", encoded);
}

let resp = req.send().await.context("Failed to send heartbeat")?;
Expand Down
3 changes: 2 additions & 1 deletion control-plane/registry/src/db/certificates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,11 @@ pub async fn verify_client_cert(
agent_id: Uuid,
cert_pem: &str,
) -> Result<bool> {
let normalized = cert_pem.replace("\\n", "\n");
let cert = agent_certificates::Entity::find()
.filter(agent_certificates::Column::AgentId.eq(agent_id))
.filter(agent_certificates::Column::IsActive.eq(true))
.filter(agent_certificates::Column::CertificatePem.eq(cert_pem))
.filter(agent_certificates::Column::CertificatePem.eq(normalized))
.one(db)
.await?;

Expand Down
3 changes: 2 additions & 1 deletion nixos-node/modules/csf-daemon.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ in

systemd.services.csf-daemon = {
description = "CSF Local Daemon Agent";
after = [ "network-online.target" ];
after = [ "network-online.target" "csf-control-plane.service" ];
wants = [ "network-online.target" ];
requires = [ "csf-control-plane.service" ];
wantedBy = [ "multi-user.target" ];

environment = {
Expand Down
13 changes: 6 additions & 7 deletions nixos-node/modules/server-configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ in
enable = true;
package = csf.agentPackage;
apiGateway = "http://localhost:8000";
registrationToken = "csf-bootstrap.change_me";
heartbeatInterval = 60;
logLevel = "info";
};
Expand Down Expand Up @@ -158,7 +157,7 @@ services:
restart: unless-stopped

api-gateway:
image: ghcr.io/cs-foundry/csf-ce-api-gateway:0.2.2-alpha.361
image: ghcr.io/cs-foundry/csf-ce-api-gateway:0.2.2-alpha.367
container_name: csf-api-gateway
environment:
DATABASE_URL: postgres://csf:csfpassword@patroni:5432/csf_core
Expand Down Expand Up @@ -186,7 +185,7 @@ services:
start_period: 30s

registry:
image: ghcr.io/cs-foundry/csf-ce-registry:0.2.2-alpha.361
image: ghcr.io/cs-foundry/csf-ce-registry:0.2.2-alpha.367
container_name: csf-registry
environment:
DATABASE_URL: postgres://csf:csfpassword@patroni:5432/csf_core
Expand All @@ -202,7 +201,7 @@ services:
restart: unless-stopped

scheduler:
image: ghcr.io/cs-foundry/csf-ce-scheduler:0.2.2-alpha.361
image: ghcr.io/cs-foundry/csf-ce-scheduler:0.2.2-alpha.367
container_name: csf-scheduler
environment:
DATABASE_URL: postgres://csf:csfpassword@patroni:5432/csf_core
Expand All @@ -217,7 +216,7 @@ services:
restart: unless-stopped

volume-manager:
image: ghcr.io/cs-foundry/csf-ce-volume-manager:0.2.2-alpha.361
image: ghcr.io/cs-foundry/csf-ce-volume-manager:0.2.2-alpha.367
container_name: csf-volume-manager
environment:
DATABASE_URL: postgres://csf:csfpassword@patroni:5432/csf_core
Expand All @@ -234,7 +233,7 @@ services:
restart: unless-stopped

failover-controller:
image: ghcr.io/cs-foundry/csf-ce-failover-controller:0.2.2-alpha.361
image: ghcr.io/cs-foundry/csf-ce-failover-controller:0.2.2-alpha.367
container_name: csf-failover-controller
environment:
DATABASE_URL: postgres://csf:csfpassword@patroni:5432/csf_core
Expand All @@ -250,7 +249,7 @@ services:
restart: unless-stopped

sdn-controller:
image: ghcr.io/cs-foundry/csf-ce-sdn-controller:0.2.2-alpha.361
image: ghcr.io/cs-foundry/csf-ce-sdn-controller:0.2.2-alpha.367
container_name: csf-sdn-controller
environment:
DATABASE_URL: postgres://csf:csfpassword@patroni:5432/csf_core
Expand Down
Loading