wip
Some checks failed
Check / build (pull_request) Has been cancelled
E2E tests / build (pull_request) Has been cancelled
Publish CLI / publish-docker (pull_request) Has been cancelled
Publish server Docker image / publish-docker (pull_request) Has been cancelled

This commit is contained in:
András Schmelczer 2025-12-23 23:14:12 +01:00
commit 2b568fd20e

View file

@ -1,13 +1,25 @@
# Getting Started
Set up VaultLink in 5 minutes. Deploy server, connect clients, done.
Set up VaultLink in 5 minutes.
## Prerequisites
## Self-hosting the VaultLink server with docker-compose
- Docker (or Rust toolchain if building from source)
- A server (VPS, home server, or localhost for testing)
todo: add compose file
## Step 1: Deploy Server
Mount the configuration, databases, and (optionally) logs folder to your host:
- Configuration: the default path to it is. Mount the parent folder with something like:
```
- volumes:
```
and the configuration.yaml will be created on first startup. When a new config option is added to a future server version, the config.yml will be automatically updated. This also means that comments are not preserved inside the file but previously set values are.
On first startup, an admin account is generated if no configuration.yaml exists or if the existing one contains no users. Changes made to the users section take into effect without requiring a server restart. This is controlled through the `hot-reload` flag within the `users` section.
- Databases: each vault is stored in its dedicated sqlite database located in the databases folder
- Logs: Logs are located at ... and are rotated every 7 days by default.
Add an expandable examplle <summary/>
Create `config.yml`:
@ -34,7 +46,7 @@ logging:
```
::: tip
Generate secure token: `openssl rand -hex 32`
You can generate secure token using: `openssl rand -hex 32`
:::
Run server:
@ -46,25 +58,42 @@ docker run -d \
-p 3000:3000 \
-v $(pwd):/data \
ghcr.io/schmelczer/vault-link-server:latest \
/app/sync_server /data/config.yml
/app/sync_server
```
Verify: `curl http://localhost:3000/vaults/test/ping` should return server version and auth status
## Step 2: Connect Client
Verify: `curl http://localhost:3000/vaults/test/ping` should return server version and auth status and http://localhost:3000 should show a version of this documentation bundled with the server's version.
### Obsidian Plugin
::: warning
The server doesn't terminate HTTPS connections and is thus recommended to deploy behind a reverse proxy such as [NGINX] or [Caddy].
:::
::: tip
The server uses a local sqlite database to track documents within a Vault as opposed to plain text files. This is necessary so that the full provenance (history) of every document can be retrieved and it also prevents corruption of the server's state coming from outside changes to these files. In case you'd like to keep the latest version of a Vault's files on the server, you can deploy the [CLI client][#cli].
:::
In case of failures, check the logs on stdout or historical logs in the logs folder.
[Full server guide →](/guide/obsidian-plugin)
## Connecting to a VaultLink server using the VaultLink Obsidian plugin
1. Settings → Community Plugins → Browse
2. Search "VaultLink", install, enable
3. Configure:
- Server URL: `ws://localhost:3000` (or `wss://your-server.com` for SSL)
3. Then, update the sync settings within the VaultLink options:
- Server URL: `http://localhost:3000` (or `https://your-server.com` for SSL)
- Token: Your token from config.yml
- Vault Name: `default`
- Vault Name: Pick any name the token has access to, such as `default`. Users may be allowed to access a predefined list of vaults or every vault managed by the server. See [authorization](#auth) for more on this.
In case of failures, check the state summary (todo screenshot) or the logs tab available through the follow button from the settings tab (todo screenshot).
[Full plugin guide →](/guide/obsidian-plugin)
### CLI Client
## CLI Client
```bash
docker run -d \
@ -77,49 +106,4 @@ docker run -d \
[Full CLI guide →](/guide/cli-client)
## Production Setup
For production:
1. **SSL/TLS**: Use Nginx/Caddy reverse proxy for `wss://` ([setup guide](/guide/server-setup#ssl-tls-with-reverse-proxy))
2. **Secure tokens**: Generate with `openssl rand -hex 32`, don't reuse the example
3. **Firewall**: Only expose port 3000 to reverse proxy
4. **Backups**: SQLite databases are in `databases/` directory
## Multiple Users
```yaml
users:
user_configs:
- name: alice
token: alice-token
vault_access:
type: allow_list
allowed:
- personal
- shared
- name: bob
token: bob-token
vault_access:
type: allow_list
allowed:
- shared
```
[Auth docs →](/config/authentication)
## Troubleshooting
**Server won't start**: `docker logs vaultlink-server`
**Client can't connect**:
1. Verify server: `curl http://your-server:3000/vaults/test/ping`
2. Check URL: `ws://` for HTTP, `wss://` for HTTPS
3. Verify token matches config.yml
**Understanding limitations**: [See what VaultLink can and can't do →](/guide/limitations)
**Files not syncing**: Check client logs, verify vault name matches
[Server setup →](/guide/server-setup) | [Architecture →](/architecture/)