Configuration File
The InTunnel CLI can be configured using a configuration file for easier management.
File Location
The CLI looks for configuration in these locations (in order):
./intunnel.yaml(current directory)~/.intunnel/config.yaml(home directory)/etc/intunnel/config.yaml(system-wide)
File Format
Configuration files use YAML format:
yaml
# InTunnel Configuration
token: "your-token-here"
port: 3000
subdomain: "myapp"
domain: "intunnel.cloud"Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
token | string | - | Authentication token (required) |
port | integer | 3000 | Local port to expose |
subdomain | string | - | Subdomain to use |
domain | string | intunnel.cloud | Domain (.cloud, .online, .tech) |
Example Configurations
Basic Configuration
yaml
# ~/.intunnel/config.yaml
token: "abc123xyz"
port: 3000Development Server
yaml
# ./intunnel.yaml
token: "dev-token-here"
port: 3000
subdomain: "dev-myapp"
domain: "intunnel.cloud"Multiple Environments
You can create different config files for different environments:
development.yaml
yaml
token: "dev-token"
port: 3000
subdomain: "dev-app"
domain: "intunnel.cloud"staging.yaml
yaml
token: "staging-token"
port: 3000
subdomain: "staging-app"
domain: "intunnel.online"Use with:
bash
cp development.yaml intunnel.yaml
intunnelPriority Order
Command-line flags override configuration file values:
bash
# Config file has port: 3000
# This will use port 8080 instead
intunnel -port 8080Priority (highest to lowest):
- Command-line flags
- Environment variables
- Local config file (
./intunnel.yaml) - User config file (
~/.intunnel/config.yaml) - System config file (
/etc/intunnel/config.yaml)
Creating a Config File
Quick Setup
bash
# Create config directory
mkdir -p ~/.intunnel
# Create config file
cat > ~/.intunnel/config.yaml << EOF
token: "your-token-here"
port: 3000
subdomain: "myapp"
domain: "intunnel.cloud"
EOF
# Set permissions (recommended for security)
chmod 600 ~/.intunnel/config.yamlInteractive Setup
The GUI client can export its configuration to a file for CLI use.
Security Considerations
WARNING
Your config file contains your authentication token. Keep it secure!
Recommended Permissions
bash
# Linux/macOS
chmod 600 ~/.intunnel/config.yamlDon't Commit to Git
Add to your .gitignore:
gitignore
# InTunnel config
intunnel.yaml
.intunnel/Validating Configuration
Check if your configuration is valid:
bash
intunnel -versionIf the configuration is invalid, you'll see an error message explaining the issue.