Skip to content

Replace dotenv (.env) Configuration with Fixed Configuration Files#19

Merged
yulmwu merged 2 commits into
mainfrom
feat/config-file
Jun 7, 2026
Merged

Replace dotenv (.env) Configuration with Fixed Configuration Files#19
yulmwu merged 2 commits into
mainfrom
feat/config-file

Conversation

@yulmwu

@yulmwu yulmwu commented Jun 7, 2026

Copy link
Copy Markdown
Member

Previously, configuration values for sbxlet, sbxorch, and sbxctl were managed using dotenv (.env) environment variables.

However, these components are not typical web servers or microservices, and it was determined that this approach introduced unnecessary operational overhead.

As a result, configuration is now managed through JSON configuration files located at the following paths by default:

  • /var/lib/sandboxd/sbxlet_config.json
  • /var/lib/sandboxd/sbxorch_config.json
  • /var/lib/sandboxd/sbxctl_config.json

Each configuration file preserves the existing dotenv-style key-value settings. An example is shown below.

{
    "app_env": "dev",
    "http_addr": ":8081",
    "log_dir": "/logs/sbxlet",
    "log_file_prefix": "sandboxd",
    "containerd_address": "/run/containerd/containerd.sock",
    "state_base_dir": "/var/lib/sandboxd/sandboxes",
    "lock_dir": "/var/lib/sandboxd/locks",
    "cgroup_parent": "",
    "bridge_interface": "sbx-br0",
    "subnet_cidr": "10.89.0.0/16",
    "cni_conf_path": "/etc/cni/sandboxd.d/20-sbxnet.conflist",
    "forward_hook_chains": ["FORWARD", "DOCKER-USER"],
    "reconcile_interval": "15s",
    "reconcile_grace": "5s",
    "reconcile_hits": 2,
    "runtime_binary": "runsc",
    "default_ephemeral_storage": "128Mi",
    "rootfs_ratio_percent": 80,
    "tmpfs_ratio_percent": 20,
    "max_alloc_percent": 90,
    "provision_timeout": "4m",
    "container_create_timeout": "2m",
    "image_pull_timeout": "8m"
}
{
    "app_env": "dev",
    "http_addr": ":8082",
    "log_dir": "/logs/sbxorch",
    "log_file_prefix": "orchestrator",
    "sqlite_path": "/var/lib/sandboxd/orchestrator.db",
    "heartbeat_interval": "10s",
    "probe_timeout": "3s",
    "sandbox_op_timeout": "60s",
    "heartbeat_parallel": false,
    "heartbeat_max_parallel": 4,
    "resource_sync_interval": "30s",
    "resource_persist_min_interval": "30s",
    "resource_persist_max_interval": "5m",
    "ready_success_threshold": 2,
    "notready_failure_threshold": 2,
    "shutdown_timeout": "5s",
    "scheduler_interval": "3s",
    "reconcile_interval": "5s",
    "status_sync_interval": "20s",
    "status_sync_timeout": "5s",
    "status_sync_batch_size": 50,
    "status_sync_max_parallel": 4,
    "host_port_min": 10000,
    "host_port_max": 32767,
    "create_rps": 20,
    "create_burst": 40
}
{
    "server": "http://10.10.0.1:8082",
    "timeout": "10s",
    "output": "",
    "limit": 100
}

The configuration file path can be overridden using the -c or --config option for each component.

While the dotenv-based configuration mechanism has been removed, environment variable overrides remain supported and continue to take precedence over values defined in the configuration files.

For more details, please refer to the updated source code.

@yulmwu yulmwu added the enhancement New feature or request label Jun 7, 2026
Copilot finished work on behalf of yulmwu June 7, 2026 12:30
@yulmwu

yulmwu commented Jun 7, 2026

Copy link
Copy Markdown
Member Author

I also regenerated and updated the Codecov upload token, but the issue still persists.

This is likely a Codecov server-side error.

@codecov

codecov Bot commented Jun 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.15768% with 43 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
sandboxd-orch/config/config.go 80.91% 14 Missing and 11 partials ⚠️
sandboxd-let/config/config.go 83.63% 11 Missing and 7 partials ⚠️

📢 Thoughts on this report? Let us know!

Comment thread cmd/sbxlet/main.go
Comment thread scripts/build-ami-sbx-install.sh
@yulmwu yulmwu merged commit ce20445 into main Jun 7, 2026
2 checks passed
@yulmwu yulmwu deleted the feat/config-file branch June 7, 2026 13:39
kim6wol0 added a commit to nullforu/smctf-infra-v2 that referenced this pull request Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants