fix(workspace): stabilise the development stack (#2024)

This commit is contained in:
Hampus authored and GitHub committed 2026-08-26 18:52:53 +02:00
1 parent cf1a7d7a8a
commit 5d2e5932a4
55 files changed
+1848 -3396

No files matched your search

+11 -5
View File
@@ -253,6 +253,16 @@ pub async fn run_cloudflare_tunnel(
return Ok(status.code().unwrap_or(1));
}
if running_inside_devcontainer() {
let container = std::fs::read_to_string("/etc/hostname")
.context("failed to read the current devcontainer hostname")?;
let container = container.trim();
if container.is_empty()
|| !container
.bytes()
.all(|byte| byte.is_ascii_alphanumeric() || matches!(byte, b'_' | b'.' | b'-'))
{
bail!("Current devcontainer hostname is invalid");
}
let docker = docker_command();
let mut command = Command::new(&docker[0]);
command.args(&docker[1..]);
@@ -261,11 +271,7 @@ pub async fn run_cloudflare_tunnel(
"run",
"--rm",
"--network",
&format!(
"container:{}",
std::env::var("HOSTNAME")
.unwrap_or_else(|_| "fluxer-dev-workspace-1".to_owned())
),
&format!("container:{container}"),
"cloudflare/cloudflared:latest",
"tunnel",
"run",