Skip to content

Commit 67ff507

Browse files
committed
Add more documentation in README.md
1 parent 4ecc68a commit 67ff507

File tree

2 files changed

+72
-7
lines changed

2 files changed

+72
-7
lines changed

.github/workflows/docker.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
type=ref,event=branch
2424
type=semver,pattern={{version}}
2525
type=semver,pattern={{major}}.{{minor}}
26+
type=match,pattern=\d.\d.\d,value=latest
2627
- uses: docker/setup-qemu-action@v1
2728
- uses: docker/setup-buildx-action@v1
2829
- uses: docker/login-action@v1

README.md

Lines changed: 71 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,71 @@ A small and ultrasecure [Lesspass][1] database server written in [Rust][2].
77

88
## Installation
99

10-
### Installing Rust
10+
### From binary
11+
12+
Simply download latest release from [releases page][releases]. You can use
13+
[systemd unit][unit] from [Arch Linux package][package] to run it.
14+
15+
[releases]: https://github.com/ogarcia/rockpass/releases
16+
[unit]: https://aur.archlinux.org/cgit/aur.git/tree/rockpass.service?h=rockpass
17+
[package]: https://aur.archlinux.org/packages/rockpass
18+
19+
### With Docker
20+
21+
A docker image of Rockpass can be downloaded from [here][ghcr] or from
22+
[Docker Hub][hub].
23+
24+
To run it, simply exec.
25+
```
26+
docker run -t -d \
27+
--name=rockpass \
28+
-p 8000:8000 \
29+
ogarcia/rockpass
30+
```
31+
32+
This start Rockpass and publish the port to host.
33+
34+
Warning: this is a basic run, all data will be destroyed after container
35+
stop and rm.
36+
37+
[ghcr]: https://github.com/users/ogarcia/packages/container/package/rockpass
38+
[hub]: https://hub.docker.com/repository/docker/ogarcia/rockpass
39+
40+
#### Persist data using a Docker volume
41+
42+
Rockpass Docker image uses a volume `/var/lib/rockpass` to store sqlite
43+
database. You can exec the following to mount it in your host as persistent
44+
storage.
45+
```
46+
docker run -t -d \
47+
--name=rockpass \
48+
-p 8000:8000 \
49+
-v /my/rockpass:/var/lib/rockpass \
50+
ogarcia/rockpass
51+
```
52+
53+
Take note that you must create before the directory `/my/rockpass` and set
54+
ownership to UID/GID 100.
55+
```
56+
mkdir -p /my/rockpass
57+
chown -R 100:100 /my/rockpass
58+
```
59+
60+
#### Docker environment variables
61+
62+
| Variable | Used for | Default value |
63+
| --- | --- | --- |
64+
| `ROCKET_DATABASES` | Database location | {rockpass = { url = \"/var/lib/rockpass/rockpass.sqlite\" }} |
65+
| `ROCKET_SECRET_KEY` | Unused, but need to be defined to something to avoid warnings | fIdKuZfnI2oUJg4HMrKB7RTXxXS5B2Yw9D5RpOaKciI= |
66+
| `ROCKET_ADDRESS` | Listen address | 0.0.0.0 |
67+
| `ROCKET_PORT` | Listen port | 8000 |
68+
| `ROCKET_REGISTRATION_ENABLED` | Enable or disable the ability to register new users | true |
69+
| `ROCKET_TOKEN_LIFETIME` | Time, in seconds, that the login token is valid | 2592000 (30 days) |
70+
| `ROCKET_LOG` | Log level | normal |
71+
72+
### From source
73+
74+
#### Installing Rust
1175

1276
Rockpass is based in [Rocket][3] so you need to use a nightly version of
1377
Rust.
@@ -22,7 +86,7 @@ rustup override set nightly
2286

2387
[3]: https://rocket.rs/
2488

25-
### Installing Rockpass
89+
#### Installing Rockpass
2690

2791
To build Rockpass binary simply execute the following commands.
2892
```sh
@@ -39,11 +103,11 @@ Since Rockpass is based in Rocket, the config is same that is detailed in
39103
[Rocket documentation][4]. Anyway a `Rocket.toml.example` is provided with
40104
comments and the interesting field are the following.
41105

42-
| Setting | Use | Default value |
43-
|:----------------------:|:---------------------------------------------------:|:-----------------:|
44-
| `registration_enabled` | Enable or disable the ability to register new users | true |
45-
| `token_lifetime` | Time, in seconds, that the login token is valid | 2592000 (30 days) |
46-
| `rockpass` | SQLite database location (see below) | |
106+
| Setting | Use | Default value |
107+
| --- | --- | --- |
108+
| `registration_enabled` | Enable or disable the ability to register new users | true |
109+
| `token_lifetime` | Time, in seconds, that the login token is valid | 2592000 (30 days) |
110+
| `rockpass` | SQLite database location (see below) | |
47111

48112
The database configuration can be detailed in two options.
49113

0 commit comments

Comments
 (0)