# Configuration

The client needs two settings: the server's address (`url`) and your access key (`key`).

## Order of precedence

Highest first:

1. The flags `--url` and `--key`.
2. The environment variables `FUZZY_URL` and `FUZZY_KEY`.
3. The file written by `fuzzy login`.

## The saved login

| System | Path |
|---|---|
| macOS and Linux | `$XDG_CONFIG_HOME/fuzzyshare/config.json`, else `~/.config/fuzzyshare/config.json` |
| Windows | `fuzzy\config.json` in the user config directory |

The file holds `{"url": "...", "key": "..."}`. It is written atomically with mode `0600` in a `0700` directory. Delete it to sign out.

## Environment variables

| Variable | Used by | Meaning |
|---|---|---|
| `FUZZY_URL` | all client commands | Server address |
| `FUZZY_KEY` | all client commands | Access key |
| `FUZZY_PASSPHRASE` | `fetch`, and `--private` links | Passphrase, kept out of the process list |
| `FUZZY_SIGNUP_CODE` | `register` | The signup code, if the server needs one |
| `FUZZY_INSTALL_DIR` | `install.sh`, `install.ps1` | Where to install the binary |

## Safety

The client warns on standard error when the key would be sent over plain `http` to anything but localhost. Use `https`: the key travels in every request.
