Configuration
ADA configuration options can be given as in a config file, environmental variables, or (CLI/constructor) arguments. In order of precedence from high to low:
CLI/constructor arguments ← Environment variables ← ~/.ada/ada.conf ← /etc/ada.conf ← <package>/etc/ada.conf
The configuration options are:
Key |
Type |
Default |
Description |
|---|---|---|---|
|
string |
- |
dCache REST API URL (must start with |
|
integer |
|
Default SSE channel timeout in seconds |
|
boolean |
|
Enable debug logging |
|
string |
— |
Default token file path (precedence over netrcfile) |
|
string |
— |
Default netrc file path (precedence over proxy authentification) |
|
boolean |
|
Use IGTF Grid certificates for proxy authentication |
Note that the order of precedence for authentication is (high-to-low):
tokenfile ← netrcfile ← Grid proxy
Config File
ADA uses a simple key=value format, with lines starting with # as comments. This is compatible with the original Bash version. An example can be found in ada.conf.
# ADA configuration
api=https://dcacheview.grid.surfsara.nl:22880/api/v1
tokenfile=tokenfile.conf
igtf=true
channel_timeout=3600
debug=false
netrcfile=~/.netrc
Config file location, in order of precedence from high to low, is expected to be:
Priority |
Path |
Description |
|---|---|---|
1 (highest) |
|
User-level config |
2 |
|
System-wide config |
3 (lowest) |
|
Bundled defaults |
Environment Variables
Environment variables override config file values. They are checked after loading config files but before applying explicit CLI arguments.
Variable |
Overrides |
Description |
|---|---|---|
|
|
dCache API URL |
|
|
Enable debug output ( |
|
|
SSE channel timeout |
|
|
Use IGTF certificates |
|
|
Token file path |
|
|
Netrc file path (precedence over X509_USER_PROXY) |
|
— |
Direct bearer token string (precedence over ada_tokenfile) |
|
— |
X.509 proxy file path |
|
— |
Grid certificate directory |
Example Setup
Minimal setup to avoid passing arguments every time:
# Create config directory
mkdir -p ~/.ada
chmod 700 ~/.ada
# Create config file
cat > ~/.ada/ada.conf << 'EOF'
api=https://dcacheview.grid.surfsara.nl:22880/api/v1
EOF
# Store your token
echo "your-bearer-token-here" > ~/.ada/token
chmod 600 ~/.ada/token
# Point to it in config
echo "tokenfile=$HOME/.ada/token" >> ~/.ada/ada.conf
Now you can use ADA without any arguments:
ada-cli whoami
ada-cli list /pnfs/grid.sara.nl/data/myproject
Library Configuration
When using ADA as a library, you can also pass custom config paths (in order of high-to-low precedence):
from ada.client import AdaClient
# Use default config file search
client = AdaClient()
# Use custom config paths
client = AdaClient(config_paths=["/custom/path/ada.conf"])
# Override everything explicitly (ignores config files for these values)
client = AdaClient(
api="https://dcacheview.grid.surfsara.nl:22880/api/v1",
tokenfile="/path/to/token",
debug=True,
)
Explicit constructor arguments always have the highest priority.