From ad38c3b764d2e9cdd91f40f3bb19c409abb140fc Mon Sep 17 00:00:00 2001 From: pchang388 Date: Tue, 23 Jan 2024 05:03:50 -0500 Subject: [PATCH 1/6] update description --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e118dcb..720651f 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Table of Contents ## Background _If you encounter any issues, want to request an additional feature, or provide assistance, feel free to open a Github issue._ -This tool provides a way to export [Bookstack](https://github.com/BookStackApp/BookStack) pages and their content (_text, images, metadata, etc._) into a relational parent-child layout locally with an option to push to remote object storage locations. See [Backup Behavior](#backup-behavior) section for more details on how pages are organized. +This tool provides a way to export [Bookstack](https://github.com/BookStackApp/BookStack) pages and their content (_text, images, attachments, metadata, etc._) into a relational parent-child layout locally with an option to push to remote object storage locations. See [Backup Behavior](#backup-behavior) section for more details on how pages are organized. This small project was mainly created to run as a cron job in k8s but works anywhere. This tool allows me to export my docs in markdown, or other formats like pdf. I use Bookstack's markdown editor as default instead of WYSIWYG editor and this makes my notes portable anywhere even if offline. From 4c02d684129f86882a0b154936c57519c059be46 Mon Sep 17 00:00:00 2001 From: pchang388 Date: Tue, 23 Jan 2024 05:05:40 -0500 Subject: [PATCH 2/6] update description --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e118dcb..9989b4b 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Table of Contents ## Background _If you encounter any issues, want to request an additional feature, or provide assistance, feel free to open a Github issue._ -This tool provides a way to export [Bookstack](https://github.com/BookStackApp/BookStack) pages and their content (_text, images, metadata, etc._) into a relational parent-child layout locally with an option to push to remote object storage locations. See [Backup Behavior](#backup-behavior) section for more details on how pages are organized. +This tool provides a way to export [Bookstack](https://github.com/BookStackApp/BookStack) pages and their content (_text, images, metadata, etc._) into a relational parent-child layout locally with an option to push to remote object storage locations. See [Backup Behavior](#backup-behavior) section for more details on how pages are organized. Image and attachment links can also be modified in markdown exports to point to local exported paths. This small project was mainly created to run as a cron job in k8s but works anywhere. This tool allows me to export my docs in markdown, or other formats like pdf. I use Bookstack's markdown editor as default instead of WYSIWYG editor and this makes my notes portable anywhere even if offline. From 7b9e6c21e82ba10a9e8f415802b77db481a3073e Mon Sep 17 00:00:00 2001 From: pchang388 Date: Tue, 23 Jan 2024 05:07:14 -0500 Subject: [PATCH 3/6] update description --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9989b4b..498345d 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Table of Contents ## Background _If you encounter any issues, want to request an additional feature, or provide assistance, feel free to open a Github issue._ -This tool provides a way to export [Bookstack](https://github.com/BookStackApp/BookStack) pages and their content (_text, images, metadata, etc._) into a relational parent-child layout locally with an option to push to remote object storage locations. See [Backup Behavior](#backup-behavior) section for more details on how pages are organized. Image and attachment links can also be modified in markdown exports to point to local exported paths. +This tool provides a way to export [Bookstack](https://github.com/BookStackApp/BookStack) pages and their content (_text, images, attachments, metadata, etc._) into a relational parent-child layout locally with an option to push to remote object storage locations. See [Backup Behavior](#backup-behavior) section for more details on how pages are organized. Image and attachment links can also be modified in markdown exports to point to local exported paths. This small project was mainly created to run as a cron job in k8s but works anywhere. This tool allows me to export my docs in markdown, or other formats like pdf. I use Bookstack's markdown editor as default instead of WYSIWYG editor and this makes my notes portable anywhere even if offline. From 80749cbd3fc6959e2203d68ab26e00602144b7c0 Mon Sep 17 00:00:00 2001 From: pchang388 Date: Wed, 31 Jan 2024 02:36:54 -0500 Subject: [PATCH 4/6] update readme for suggestion by @intrepidsilence --- README.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 498345d..5ce6970 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Table of Contents - [Using This Application](#using-this-application) - [Run via Pip](#run-via-pip) - [Run via Docker](#run-via-docker) - - [Authentication](#authentication) + - [Authentication and Permissions](#authentication-and-permissions) - [Configuration](#configuration) - [Backup Behavior](#backup-behavior) - [General](#general) @@ -174,9 +174,16 @@ docker run \ | `config` | `/export/config/config.yml` | A valid configuration file |`-v /local/yourpath/config.yml:/export/config/config.yml:ro`| | `dump` | `/export/dump` | Directory to place exports. **This is optional when using remote storage option(s)**. Omit if you don't need a local copy. | `-v /local/yourpath/bkps:/export/dump` | -### Authentication -**Note visibility of pages is based on user**, so use a user that has access to pages you want to back up. +### Authentication and Permissions +#### Permissions +**Note visibility of pages is based on user**, so use a user that has read access to pages and content you want to back up. *The role assigned to the user* should have the additional permissions for target pages and their content: +- `read` for all images and attachments + - For most users this may already be set - may be required to be set depending on storage option used +- `Export Content` (This can be found in `Edit Role --> System Permissions`) + - For most users this may already set - may be required to be set if using custom roles + - If not set, you may see page contents showing as a HTML login page, as reported in this [issue](https://github.com/homeylab/bookstack-file-exporter/issues/35) +#### Token Authentication Ref: [https://demo.bookstackapp.com/api/docs#authentication](https://demo.bookstackapp.com/api/docs#authentication) Provide a tokenId and a tokenSecret as environment variables or directly in the configuration file. @@ -188,7 +195,7 @@ Env variables for credentials will take precedence over configuration file optio **For object storage authentication**, find the relevant sections further down in their respective sections. ### Configuration -_Ensure [Authentication](#authentication) has been set up beforehand for required credentials._ For a simple example to run quickly, refer to the one in the [Using This Application](#using-this-application) section. A full example is also shown below with descriptions. Optionally, look at `examples/` folder of the github repo for more examples. +_Ensure [Authentication](#authentication-and-permissions) has been set up beforehand for required credentials._ For a simple example to run quickly, refer to the one in the [Using This Application](#using-this-application) section. A full example is also shown below with descriptions. Optionally, look at `examples/` folder of the github repo for more examples. For object storage configuration, find more information in their respective sections - [Minio](#minio-backups) From 7dc399aa92d84aab7e4b037468bffd36d441af1c Mon Sep 17 00:00:00 2001 From: pchang388 Date: Fri, 5 Jul 2024 04:52:15 -0400 Subject: [PATCH 5/6] bump python version to 3.12.4, update pkg depedencies to latest --- .devcontainer/devcontainer.json | 5 +++-- Dockerfile | 2 +- Makefile | 2 +- setup.cfg | 6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 16d03db..82d6346 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,7 +7,7 @@ "features": { "ghcr.io/devcontainers/features/python:1": { "installTools": true, - "version": "3.12.1" + "version": "3.12.4" } }, "customizations": { @@ -15,7 +15,8 @@ "extensions": [ "streetsidesoftware.code-spell-checker", "ms-python.python", - "redhat.vscode-yaml" + "redhat.vscode-yaml", + "GitHub.copilot" ] } } diff --git a/Dockerfile b/Dockerfile index c368f25..c493943 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ ARG BASE_IMAGE=python -ARG BASE_IMAGE_TAG=3.12.1-slim-bookworm +ARG BASE_IMAGE_TAG=3.12.4-slim-bookworm FROM ${BASE_IMAGE}:${BASE_IMAGE_TAG} diff --git a/Makefile b/Makefile index 4eebcfd..93ae354 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ ## DOCKER BUILD VARS BASE_IMAGE=python -BASE_IMAGE_TAG=3.12-slim-bookworm +BASE_IMAGE_TAG=3.12.4-slim-bookworm IMAGE_NAME=homeylab/bookstack-file-exporter # keep this start sequence unique (IMAGE_TAG=) # github actions will use this to create a tag diff --git a/setup.cfg b/setup.cfg index dffaf0c..ef0c2bf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,9 +18,9 @@ classifiers = python_requires = >=3.8 install_requires = Pyyaml >= 6.0.1 # https://pypi.org/project/PyYAML/ - Pydantic >= 2.5.3 # https://docs.pydantic.dev/latest/ - requests >= 2.31.0 # https://pypi.org/project/requests/ - minio >= 7.2.3 # https://pypi.org/project/minio/ + Pydantic >= 2.8.2 # https://docs.pydantic.dev/latest/ + requests >= 2.32.3 # https://pypi.org/project/requests/ + minio >= 7.2.7 # https://pypi.org/project/minio/ packages = find: [options.entry_points] From bee6f9511e643e55e5558c8ce49d5a5fbaabcced Mon Sep 17 00:00:00 2001 From: pchang388 Date: Sat, 6 Jul 2024 02:54:44 -0400 Subject: [PATCH 6/6] bump py version for actions --- .github/actions/python/action.yml | 2 +- .github/actions/tests/action.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/python/action.yml b/.github/actions/python/action.yml index afef031..677c051 100644 --- a/.github/actions/python/action.yml +++ b/.github/actions/python/action.yml @@ -23,7 +23,7 @@ runs: - name: Set up Python uses: actions/setup-python@v3 with: - python-version: '3.12.1' + python-version: '3.12.4' - name: Install Dependencies shell: bash run: | diff --git a/.github/actions/tests/action.yml b/.github/actions/tests/action.yml index 3606371..3b7ed0c 100644 --- a/.github/actions/tests/action.yml +++ b/.github/actions/tests/action.yml @@ -8,7 +8,7 @@ runs: - name: Set up Python uses: actions/setup-python@v3 with: - python-version: '3.12.1' + python-version: '3.12.4' - name: Install dependencies shell: bash run: |