8000 improve run instructions · homeylab/bookstack-file-exporter@6f95e1c · GitHub
[go: up one dir, main page]

Skip to content

Commit 6f95e1c

Browse files
committed
improve run instructions
1 parent dbc94d4 commit 6f95e1c

File tree

1 file changed

+43
-8
lines changed

1 file changed

+43
-8
lines changed

README.md

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,41 +44,65 @@ The main use case is to backup all docs in a relational directory-tree format to
4444
Ensure a valid configuration is provided when running this application. See [Configuration](#Configuration) section for more details.
4545

4646
### Run via Pip
47+
The exporter can be installed via pip and run directly.
48+
49+
#### Examples
4750
```bash
4851
python -m pip install bookstack-file-exporter
4952

50-
# if you already have python bin directory in your path
51-
bookstack-file-exporter -c <path_to_config_file>
52-
5353
# using pip
5454
python -m bookstack_file_exporter -c <path_to_config_file>
55+
56+
# if you already have python bin directory in your path
57+
bookstack-file-exporter -c <path_to_config_file>
5558
```
59+
60+
#### Options
5661
Command line options:
5762
| option | required | description |
5863
| ------ | -------- | ----------- |
5964
|`-c`, `--config-file`|True|Relative or Absolute path to a valid configuration file. This configuration file is checked against a schema for validation.|
6065
|`-v`, `--log-level` |False, default: info|Provide a valid log level: info, debug, warning, error.|
6166

67+
#### Environment Variables
68+
See [Valid Environment Variables](#valid-environment-variables) for more options.
69+
70+
Example:
71+
```bash
72+
export LOG_LEVEL=debug
73+
74+
# using pip
75+
python -m bookstack_file_exporter -c <path_to_config_file>
76+
```
77+
78+
#### Python Version
6279
_Note: This application is tested and developed on Python version `3.12.X`. It will probably work for >= `3.8` but is recommended to install (or set up a venv) a `3.12.X` version._
6380

6481
### Run Via Docker
65-
Example:
82+
Docker can be utilized to run the exporter.
6683

84+
#### Examples
6785
```bash
6886
docker run \
6987
--user ${USER_ID}:${USER_GID} \
7088
-v $(pwd)/config.yml:/export/config/config.yml:ro \
7189
-v $(pwd)/bkps:/export/dump \
7290
homeylab/bookstack-file-exporter:latest
7391
```
74-
Minimal example with object storage upload:
92+
93+
Minimal example with object storage upload. A temporary filesystem will be used so a 8000 rchive will not be persistent locally.
7594
```bash
7695
docker run \
7796
-v $(pwd)/config.yml:/export/config/config.yml:ro \
7897
homeylab/bookstack-file-exporter:latest
7998
```
8099

100+
101+
#### Environment Variables
102+
See [Valid Environment Variables](#valid-environment-variables) for more options.
103+
81104
Tokens and other options can be specified, example:
105+
82106
```bash
83107
# '-e' flag for env vars
84108
# --user flag to override the uid/gid for created files
@@ -91,7 +115,8 @@ docker run \
91115
-v $(pwd)/bkps:/export/dump \
92116
homeylab/bookstack-file-exporter:latest
93117
```
94-
Bind Mounts:
118+
119+
#### Bind Mounts
95120
| purpose | static docker path | description | example |
96121
| ------- | ------------------ | ----------- | ------- |
97122
| `config` | `/export/config/config.yml` | A valid configuration file |`-v /local/yourpath/config.yml:/export/config/config.yml:ro`|
@@ -136,7 +161,6 @@ assets:
136161
export_images: false
137162
export_meta: false
138163
verify_ssl: true
139-
keep_last: 5
140164
```
141165
142166
#### Full Example
@@ -191,6 +215,18 @@ More descriptions can be found for each section below:
191215
| `keep_last` | `int` | `false` | Optional (default: `None`), if exporter can delete older archives. valid values are:<br>- set to `-1` if you want to delete all archives after each run (useful if you only want to upload to object storage)<br>- set to `1+` if you want to retain a certain number of archives<br>- `0` will result in no action done |
192216
| `minio` | `object` | `false` | Optional [Minio](#minio-backups) configuration options. |
193217

218+
#### Valid Environment Variables
219+
General
220+
- `LOG_LEVEL`: default: `info``. Provide a valid log level: info, debug, warning, error.
221+
222+
[Bookstack Credentials](#authentication)
223+
- `BOOKSTACK_TOKEN_ID`
224+
- `BOOKSTACK_TOKEN_SECRET`
225+
226+
[Minio Credentials](#authentication-1)
227+
- `MINIO_ACCESS_KEY`
228+
- `MINIO_SECRET_KEY`
229+
194230
### Backup Behavior
195231
Backups are exported in `.tgz` format and generated based off timestamp. Export names will be in the format: `%Y-%m-%d_%H-%M-%S` (Year-Month-Day_Hour-Minute-Second). *Files are first pulled locally to create the tarball and then can be sent to object storage if needed*. Example file name: `bookstack_export_2023-09-22_07-19-54.tgz`.
196232

@@ -289,7 +325,6 @@ Environment variables:
289325
- `MINIO_ACCESS_KEY`
290326
- `MINIO_SECRET_KEY`
291327
292-
293328
#### Example
294329
```yaml
295330
minio:

0 commit comments

Comments
 (0)
0