{
    "version": "0.2.0",
    "configurations": [
          {
            "type": "lldb",
            "request": "launch",
            "name": "Debug(only) executable 'rustfs'",
            "env": {
              "RUST_LOG": "rustfs=info,ecstore=info,s3s=info,iam=info",
              "RUSTFS_SKIP_BACKGROUND_TASK": "on"
              //"RUSTFS_OBS_LOG_DIRECTORY": "./deploy/logs",
              // "RUSTFS_POLICY_PLUGIN_URL":"http://localhost:8181/v1/data/rustfs/authz/allow",
              // "RUSTFS_POLICY_PLUGIN_AUTH_TOKEN":"your-opa-token"
            },
            "program": "${workspaceFolder}/target/debug/rustfs",
            "args": [
              "--access-key",
              "rustfsadmin",
              "--secret-key",
              "rustfsadmin",
              "--address",
              "0.0.0.0:9010",
              "--server-domains",
              "127.0.0.1:9010",
              "./target/volume/test{1...4}"
            ],
            "cwd": "${workspaceFolder}"
        },
        {
            "type": "lldb",
            "request": "launch",
            "name": "Debug executable 'rustfs'",
            "cargo": {
                "args": [
                    "build",
                    "--bin=rustfs",
                    "--package=rustfs"
                ],
                "filter": {
                    "name": "rustfs",
                    "kind": "bin"
                }
            },
            "env": {
                "RUST_LOG": "rustfs=debug,ecstore=info,s3s=debug,iam=debug",
                "RUSTFS_SKIP_BACKGROUND_TASK": "on",
                //"RUSTFS_OBS_LOG_DIRECTORY": "./deploy/logs",
                // "RUSTFS_POLICY_PLUGIN_URL":"http://localhost:8181/v1/data/rustfs/authz/allow",
                // "RUSTFS_POLICY_PLUGIN_AUTH_TOKEN":"your-opa-token" 
            },
            "args": [
                "--access-key",
                "rustfsadmin",
                "--secret-key",
                "rustfsadmin",
                "--address",
                "0.0.0.0:9010",
                "--server-domains",
                "127.0.0.1:9010",
                "./target/volume/test{1...4}"
            ],
            "cwd": "${workspaceFolder}"
        },
        {
            "type": "lldb",
            "request": "launch",
            "name": "Debug unit tests in executable 'rustfs'",
            "cargo": {
                "args": [
                    "test",
                    "--no-run",
                    "--bin=rustfs",
                    "--package=rustfs"
                ],
                "filter": {
                    "name": "rustfs",
                    "kind": "bin"
                }
            },
            "args": [],
            "cwd": "${workspaceFolder}"
        },
        {
            "type": "lldb",
            "request": "launch",
            "name": "Debug unit tests in library 'ecstore'",
            "cargo": {
                "args": [
                    "test",
                    "--no-run",
                    "--lib",
                    "--package=rustfs-ecstore"
                ]
            },
            "args": [],
            "cwd": "${workspaceFolder}"
        },
        {
            "name": "Debug executable target/debug/rustfs",
            "type":  "lldb",
            "request": "launch",
            "cargo": {
                "args": [
                    "run",
                    "--bin",
                    "rustfs",
                    "-j",
                    "1",
                    "--profile",
                    "dev"
                ]
            },
            "args": [],
            "cwd": "${workspaceFolder}",
            //"stopAtEntry": false,
            //"preLaunchTask": "cargo build",
            "env": {
                "RUSTFS_ACCESS_KEY": "rustfsadmin",
                "RUSTFS_SECRET_KEY": "rustfsadmin",
                //"RUSTFS_VOLUMES": "./target/volume/test{1...4}",
                "RUSTFS_ADDRESS": ":9000",
                "RUSTFS_CONSOLE_ENABLE": "true",
                // "RUSTFS_OBS_TRACE_ENDPOINT": "http://127.0.0.1:4318/v1/traces", // jeager otlp http endpoint
                // "RUSTFS_OBS_METRIC_ENDPOINT": "http://127.0.0.1:4318/v1/metrics", // default otlp http endpoint
                // "RUSTFS_OBS_LOG_ENDPOINT": "http://127.0.0.1:4318/v1/logs", // default otlp http endpoint
                // "RUSTFS_COMPRESS_ENABLE": "true",
                "RUSTFS_CONSOLE_ADDRESS": "127.0.0.1:9001",
                "RUSTFS_OBS_LOG_DIRECTORY": "./target/logs",
                "RUST_LOG":"rustfs=debug,ecstore=debug,s3s=debug,iam=debug",
            },
            "sourceLanguages": [
                "rust"
            ],
        },
        {
            "type": "lldb",
            "request": "launch",
            "name": "Debug test_lifecycle_transition_basic",
            "cargo": {
                "args": [
                    "test",
                    "-p",
                    "rustfs-scanner",
                    "--test",
                    "lifecycle_integration_test",
                    "serial_tests::test_lifecycle_transition_basic",
                    "-j",
                    "1"
                ]
            },
            "args": [],
            "cwd": "${workspaceFolder}"
        },
        {
            "name": "Debug executable target/debug/test",
            "type":  "lldb",
            "request": "launch",
            "program": "${workspaceFolder}/target/debug/deps/lifecycle_integration_test-5915cbfcab491b3b",
            "args": [
              "--skip",
              "test_lifecycle_expiry_basic",
              "--skip",
              "test_lifecycle_expiry_deletemarker",
              //"--skip",
              //"test_lifecycle_transition_basic",
            ],
            "cwd": "${workspaceFolder}",
            //"stopAtEntry": false,
            //"preLaunchTask": "cargo build",
            "sourceLanguages": [
                "rust"
            ],
        },
        {
            "name": "Debug executable target/debug/rustfs with sse kms",
            "type":  "lldb",
            "request": "launch",
            "program": "${workspaceFolder}/target/debug/rustfs",
            "args": [],
            "cwd": "${workspaceFolder}",
            //"stopAtEntry": false,
            //"preLaunchTask": "cargo build",
            "env": {
                "RUSTFS_ACCESS_KEY": "rustfsadmin",
                "RUSTFS_SECRET_KEY": "rustfsadmin",
                "RUSTFS_VOLUMES": "./target/volumes/test{1...4}",
                "RUSTFS_ADDRESS": ":9000",
                "RUSTFS_CONSOLE_ENABLE": "true",
                "RUSTFS_CONSOLE_ADDRESS": "127.0.0.1:9001",
                "RUSTFS_OBS_LOG_DIRECTORY": "./target/logs",
                "RUSTFS_UNSAFE_BYPASS_DISK_CHECK": "true",
                // "RUSTFS_OBS_TRACE_ENDPOINT": "http://127.0.0.1:4318/v1/traces", // jeager otlp http endpoint
                // "RUSTFS_OBS_METRIC_ENDPOINT": "http://127.0.0.1:4318/v1/metrics", // default otlp http endpoint
                // "RUSTFS_OBS_LOG_ENDPOINT": "http://127.0.0.1:4318/v1/logs", // default otlp http endpoint
                // "RUSTFS_COMPRESS_ENABLE": "true",

                // 1. simple sse test key (no kms system)
                // "__RUSTFS_SSE_SIMPLE_CMK": "2dfNXGHlsEflGVCxb+5DIdGEl1sIvtwX+QfmYasi5QM=",

                // 2. kms local backend test key
                // "RUSTFS_KMS_ENABLE": "true",
                // "RUSTFS_KMS_BACKEND": "local",
                // "RUSTFS_KMS_KEY_DIR": "/tmp/kms-key-dir",
                // "RUSTFS_KMS_LOCAL_MASTER_KEY": "my-secret-key", // Some Password
                // "RUSTFS_KMS_DEFAULT_KEY_ID": "rustfs-master-key",

                // 3. kms vault backend test key
                // "RUSTFS_KMS_ENABLE": "true",
                // "RUSTFS_KMS_BACKEND": "vault-kv2",
                // "RUSTFS_KMS_VAULT_ADDRESS": "http://127.0.0.1:8200",
                // "RUSTFS_KMS_VAULT_TOKEN": "Dev Token",
                // "RUSTFS_KMS_DEFAULT_KEY_ID": "rustfs-master-key",

                // 4. kms vault transit backend test key
                // "RUSTFS_KMS_ENABLE": "true",
                // "RUSTFS_KMS_BACKEND": "vault-transit",
                // "RUSTFS_KMS_VAULT_ADDRESS": "http://127.0.0.1:8200",
                // "RUSTFS_KMS_VAULT_TOKEN": "Dev Token",
                // "RUSTFS_KMS_VAULT_MOUNT_PATH": "transit",
                // "RUSTFS_KMS_DEFAULT_KEY_ID": "rustfs-master-key",
                
                // 5、kms static backend test key
                "RUSTFS_KMS_ENABLE": "true",
                "RUSTFS_KMS_BACKEND": "static",
                "RUSTFS_KMS_STATIC_SECRET_KEY": "rustfs-master-key:2dfNXGHlsEflGVCxb+5DIdGEl1sIvtwX+QfmYasi5QM="
            },
            "sourceLanguages": [
                "rust"
            ],
        },
        {
            "name": "Debug executable target/debug/rustfs with local sse",
            "type": "lldb",
            "request": "launch",
            "program": "${workspaceFolder}/target/debug/rustfs",
            "args": [],
            "cwd": "${workspaceFolder}",
            "env": {
                "RUSTFS_ACCESS_KEY": "rustfsadmin",
                "RUSTFS_SECRET_KEY": "rustfsadmin",
                "RUSTFS_VOLUMES": "./target/volumes/test{1...4}",
                "RUSTFS_ADDRESS": ":9000",
                "RUSTFS_CONSOLE_ENABLE": "true",
                "RUSTFS_CONSOLE_ADDRESS": "127.0.0.1:9001",
                "RUSTFS_OBS_LOG_DIRECTORY": "./target/logs",
                "RUSTFS_UNSAFE_BYPASS_DISK_CHECK": "true",
                "RUSTFS_SSE_S3_MASTER_KEY": "xGb3aYSp825j2tPpg8JrUzghiXsIkfdOtmrsJ/iafiM=",
                "RUST_LOG": "rustfs=debug,ecstore=debug,s3s=debug,iam=debug",
            },
            "sourceLanguages": [
                "rust"
            ],
        },
        {
            "type": "lldb",
            "request": "launch",
            "name": "Debug executable 'rustfs' with rio-v2 full matrix",
            "cargo": {
                "args": [
                    "build",
                    "--bin=rustfs",
                    "--package=rustfs",
                    "--features=full,rio-v2"
                ],
                "filter": {
                    "name": "rustfs",
                    "kind": "bin"
                }
            },
            "env": {
                "RUST_LOG": "rustfs=error,ecstore=error,s3s=error,iam=error",
                "RUSTFS_ALLOW_INSECURE_DEFAULT_CREDENTIALS": "true",
                "RUST_BACKTRACE": "full",
                "RUSTFS_ACCESS_KEY": "rustfsadmin",
                "RUSTFS_SECRET_KEY": "rustfsadmin",
                "RUSTFS_VOLUMES": "./target/rio-v2/test{1...4}",
                "RUSTFS_SCANNER_ENABLED": "false",
                "RUSTFS_HEAL_ENABLED": "false",
                "RUSTFS_REGION": "us-east-1",
                "RUSTFS_ADDRESS": ":9000",
                "RUSTFS_CONSOLE_ENABLE": "true",
                "RUSTFS_CONSOLE_ADDRESS": "127.0.0.1:9001",
                "RUSTFS_OBS_LOG_DIRECTORY": "./target/logs/rio-v2",
                "RUSTFS_UNSAFE_BYPASS_DISK_CHECK": "true",
                "RUSTFS_COMPRESSION_ENABLED": "true",
                "RUSTFS_KMS_ENABLE": "true",
                "RUSTFS_KMS_BACKEND": "local",
                "RUSTFS_KMS_KEY_DIR": "./target/rio-v2/kms-key-dir",
                "RUSTFS_KMS_LOCAL_MASTER_KEY": "my-secret-key", // Some Password
                "RUSTFS_KMS_DEFAULT_KEY_ID": "rustfs-master-key",
            },
            "args": [],
            "cwd": "${workspaceFolder}"
        },
        {
            "name": "E2E test executable target/debug/rustfs",
            "type":  "lldb",
            "request": "launch",
            "program": "${workspaceFolder}/target/debug/rustfs",
            "args": [],
            "cwd": "${workspaceFolder}",
            //"stopAtEntry": false,
            //"preLaunchTask": "cargo build",
            "env": {
                "RUST_LOG": "rustfs=debug,ecstore=info,s3s=debug,iam=debug",
                "RUST_BACKTRACE": "full",
                "RUSTFS_ACCESS_KEY": "rustfsadmin",
                "RUSTFS_SECRET_KEY": "rustfsadmin",
                "RUSTFS_VOLUMES": "./target/e2e-test/test{1...4}",
                "RUSTFS_REGION": "us-east-1",
                "RUSTFS_ADDRESS": ":9000",
                "RUSTFS_CONSOLE_ENABLE": "true",
                "RUSTFS_CONSOLE_ADDRESS": "127.0.0.1:9001",
                "RUSTFS_OBS_LOG_DIRECTORY": "./target/logs",

                "RUSTFS_KMS_ENABLE": "true",
                "RUSTFS_KMS_BACKEND": "local",
                "RUSTFS_KMS_KEY_DIR": "./target/e2e-key-dir",
                "RUSTFS_KMS_LOCAL_MASTER_KEY": "my-secret-key", // Some Password
                "RUSTFS_KMS_DEFAULT_KEY_ID": "rustfs-master-key",
            },
            "sourceLanguages": [
                "rust"
            ],
        },
    ]
}
