Skip to content

Commit cefa0bc

Browse files
authored
Merge pull request #1 from dnote/server
Document server commands
2 parents a1bf3bf + 98df360 commit cefa0bc

11 files changed

Lines changed: 160 additions & 57 deletions

File tree

content/en/docs/cli/commands.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
title: Commands
2+
title: CLI Commands
3+
linkTitle: Commands
34
description: Complete reference for Dnote CLI commands
45
weight: 2
56
---
@@ -232,16 +233,6 @@ Display the installed Dnote version.
232233
dnote version
233234
```
234235

235-
### Upgrade
236-
237-
Check if a new version of Dnote is available.
238-
239-
```bash
240-
dnote upgrade
241-
```
242-
243-
This command checks GitHub for the latest release. To upgrade, see the [installation guide](../installation/).
244-
245236
## Global Flags
246237

247238
All commands support the following global flag:

content/en/docs/cli/configuration.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
title: Configuration
2+
title: CLI Configuration
3+
linkTitle: Configuration
34
description: Configure your Dnote CLI
45
weight: 3
56
---
@@ -18,7 +19,7 @@ You can customize these locations by setting the `XDG_CONFIG_HOME` and `XDG_DATA
1819
A config file looks like following:
1920

2021
```yaml
21-
editor: vim
22+
editor: vi
2223
apiEndpoint: http://localhost:3001/api
2324
enableUpgradeCheck: true
2425
```
@@ -27,8 +28,8 @@ enableUpgradeCheck: true
2728
2829
Text editor for interactive note editing.
2930
30-
* **Default:** `vim`
31-
* **Examples:** `nano`, `emacs`, `code --wait`, `subl -w`
31+
* **Default:** `vi`
32+
* **Examples:** `vim`, `nano`, `emacs`, `code --wait`, `subl -w`
3233

3334
### apiEndpoint
3435

content/en/docs/cli/installation.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,32 @@ description: Install Dnote CLI on your system
44
weight: 1
55
---
66

7-
## Commands
8-
9-
### Script
7+
## Script
108

119
Automatically install platform-specific Dnote binary. Supports Linux, macOS, FreeBSD, and Windows:
1210

1311
```bash
1412
curl -s https://www.getdnote.com/install | sh
1513
```
1614

17-
### Homebrew (macOS)
15+
## Homebrew (macOS)
1816

1917
```bash
2018
brew install dnote
2119
```
2220

23-
### Manual Download
21+
## Manual Download
2422

25-
Download from [GitHub Releases](https://github.com/dnote/cli/releases) for your platform:
23+
Download from [GitHub Releases](https://github.com/dnote/cli/releases) for your platform.
2624

27-
**Windows:**
25+
Pre-built binaries are available for:
2826

29-
Download the `.zip` file from the releases page and add to PATH.
27+
- **Linux**: amd64, arm64, armv7 (32-bit)
28+
- **macOS**: amd64 (Intel), arm64 (Apple Silicon)
29+
- **Windows**: amd64
30+
- **FreeBSD**: amd64
3031

31-
### Build from Source
32+
## Build from Source
3233

3334
Requires Go 1.21+:
3435

content/en/docs/server/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: API Reference
33
description: Dnote Server API documentation
4-
weight: 4
4+
weight: 5
55
---
66

77
The Dnote server provides a REST API (v3) for syncing notes and books.

content/en/docs/server/commands.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
---
2+
title: Server Commands
3+
linkTitle: Commands
4+
description: Dnote server CLI commands
5+
weight: 3
6+
---
7+
8+
The Dnote server provides CLI commands for managing your server instance and users.
9+
10+
## Start Server
11+
12+
Start the Dnote server:
13+
14+
```bash
15+
dnote-server start
16+
```
17+
18+
See [Configuration](../configuration/) for available flags and environment variables.
19+
20+
## User Management
21+
22+
### Create User
23+
24+
Create a new user account:
25+
26+
```bash
27+
dnote-server user create --email=user@example.com --password=yourpassword
28+
```
29+
30+
**Flags:**
31+
- `--email` - User email address (required)
32+
- `--password` - User password (required, minimum 8 characters)
33+
- `--dbPath` - Path to database file (optional, defaults to `$XDG_DATA_HOME/dnote/server.db`)
34+
35+
**Example with custom database path:**
36+
37+
```bash
38+
dnote-server user create \
39+
--dbPath=/var/lib/dnote/server.db \
40+
--email=user@example.com \
41+
--password=yourpassword
42+
```
43+
44+
### Reset Password
45+
46+
Reset a user's password:
47+
48+
```bash
49+
dnote-server user reset-password --email=user@example.com --password=newpassword
50+
```
51+
52+
**Flags:**
53+
- `--email` - User email address (required)
54+
- `--password` - New password (required, minimum 8 characters)
55+
- `--dbPath` - Path to database file (optional)
56+
57+
**Example:**
58+
59+
```bash
60+
dnote-server user reset-password \
61+
--dbPath=/var/lib/dnote/server.db \
62+
--email=user@example.com \
63+
--password=newpassword123
64+
```
65+
66+
### Remove User
67+
68+
Remove a user account:
69+
70+
```bash
71+
dnote-server user remove --email=user@example.com
72+
```
73+
74+
**Flags:**
75+
- `--email` - User email address (required)
76+
- `--dbPath` - Path to database file (optional)
77+
78+
**Example:**
79+
80+
```bash
81+
dnote-server user remove \
82+
--dbPath=/var/lib/dnote/server.db \
83+
--email=user@example.com
84+
```
85+
86+
**Important:** Users with existing notes or books cannot be removed. Delete all their notes and books first.
87+
88+
## Version
89+
90+
Display the server version:
91+
92+
```bash
93+
dnote-server version
94+
```
95+
96+
## Help
97+
98+
Display help information:
99+
100+
```bash
101+
# General help
102+
dnote-server
103+
104+
# Command-specific help
105+
dnote-server start --help
106+
dnote-server user
107+
dnote-server user create --help
108+
```

content/en/docs/server/configuration.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
---
22
title: Server Configuration
3+
linkTitle: Configuration
34
description: Configure your Dnote server
4-
weight: 3
5+
weight: 4
56
---
67

78
## Options
@@ -25,7 +26,6 @@ environment:
2526
- DBPath=~/custom.db
2627
- DisableRegistration=false
2728
- LOG_LEVEL=debug
28-
- WebURL=https://dnote.example.com
2929
```
3030
3131
### Systemd
@@ -35,7 +35,6 @@ Environment="PORT=3001"
3535
Environment="DBPath=~/custom.db"
3636
Environment="DisableRegistration=false"
3737
Environment="LOG_LEVEL=debug"
38-
Environment="WebURL=https://dnote.example.com"
3938
```
4039

4140
### Command Line
@@ -45,8 +44,7 @@ dnote-server start \
4544
--port=3001 \
4645
--dbPath=/var/lib/dnote/server.db \
4746
--disableRegistration=true \
48-
--logLevel=debug \
49-
--webUrl=https://dnote.example.com
47+
--logLevel=debug
5048
```
5149

5250
## Email (Optional)

content/en/docs/server/docker.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ See [configuration docs](../configuration/) for all options.
4646
4747
### Updating
4848
49+
Pull the latest image and restart the container:
50+
4951
```bash
5052
docker compose pull
5153
docker compose up -d
@@ -54,6 +56,8 @@ docker compose up -d
5456

5557
## Docker run
5658

59+
If you prefer to use `docker run` instead of Docker Compose:
60+
5761
```bash
5862
docker run -d \
5963
--name dnote \
@@ -62,6 +66,18 @@ docker run -d \
6266
dnote/dnote:latest
6367
```
6468

69+
## Supported Platforms
70+
71+
The Docker images support the following platforms and architectures:
72+
73+
- **linux/amd64** (x86_64)
74+
- **linux/arm64** (ARM 64-bit)
75+
- **linux/arm/v7** (ARM 32-bit)
76+
- **linux/386** (x86 32-bit)
77+
78+
Docker automatically selects the correct image for your platform.
79+
80+
6581
## Data & Backups
6682

6783
All data is stored in a single SQLite file. No separate database server required. The `./dnote_data:/data` volume mount persists data on your host at `./dnote_data/dnote.db`, so your notes survive container restarts and upgrades.

content/en/docs/server/manual.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,13 @@ curl http://localhost:3001
206206
sudo systemctl show dnote --property=Environment
207207
```
208208

209+
## Supported Platforms
210+
211+
Pre-built binaries are available for the following platforms and architectures:
212+
213+
- **Linux**: amd64, arm64, armv7 (ARM 32-bit), 386
214+
- **FreeBSD**: amd64
215+
209216
## Connecting CLI to Server
210217

211218
Edit your Dnote CLI config at `$XDG_CONFIG_HOME/dnote/dnoterc` (typically `~/.config/dnote/dnoterc`):

themes/basic/assets/sass/_docs.scss

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -93,32 +93,17 @@ $header-offset: rem(74px);
9393

9494
// Heading anchor links
9595
.heading-anchor {
96-
opacity: 0;
97-
color: #9ca3af;
96+
opacity: 0.7;
97+
color: $light-gray;
9898
text-decoration: none;
9999
font-weight: normal;
100-
transition: opacity 0.2s ease;
100+
transition: opacity 0.2s ease, color 0.2s ease;
101101
margin-left: rem(8px);
102-
display: inline-flex;
103-
align-items: center;
104-
vertical-align: middle;
105102

106103
&:hover {
104+
opacity: 1;
107105
color: $third;
108106
}
109-
110-
svg {
111-
display: block;
112-
}
113-
}
114-
115-
h1:hover .heading-anchor,
116-
h2:hover .heading-anchor,
117-
h3:hover .heading-anchor,
118-
h4:hover .heading-anchor,
119-
h5:hover .heading-anchor,
120-
h6:hover .heading-anchor {
121-
opacity: 1;
122107
}
123108

124109
p {
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
<h{{ .Level }} id="{{ .Anchor }}">
22
{{ .Text | safeHTML }}
3-
<a class="heading-anchor" href="#{{ .Anchor }}" aria-label="Link to {{ .Text }}">
4-
<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true">
5-
<path d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path>
6-
</svg>
7-
</a>
3+
<a class="heading-anchor" href="#{{ .Anchor }}" aria-label="Link to {{ .Text }}">#</a>
84
</h{{ .Level }}>

0 commit comments

Comments
 (0)