Skip to content

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):

  1. ./intunnel.yaml (current directory)
  2. ~/.intunnel/config.yaml (home directory)
  3. /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

OptionTypeDefaultDescription
tokenstring-Authentication token (required)
portinteger3000Local port to expose
subdomainstring-Subdomain to use
domainstringintunnel.cloudDomain (.cloud, .online, .tech)

Example Configurations

Basic Configuration

yaml
# ~/.intunnel/config.yaml
token: "abc123xyz"
port: 3000

Development 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
intunnel

Priority Order

Command-line flags override configuration file values:

bash
# Config file has port: 3000
# This will use port 8080 instead
intunnel -port 8080

Priority (highest to lowest):

  1. Command-line flags
  2. Environment variables
  3. Local config file (./intunnel.yaml)
  4. User config file (~/.intunnel/config.yaml)
  5. 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.yaml

Interactive 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!

bash
# Linux/macOS
chmod 600 ~/.intunnel/config.yaml

Don't Commit to Git

Add to your .gitignore:

gitignore
# InTunnel config
intunnel.yaml
.intunnel/

Validating Configuration

Check if your configuration is valid:

bash
intunnel -version

If the configuration is invalid, you'll see an error message explaining the issue.

Released under the MIT License.