10 Commits

Author SHA1 Message Date
github-actions
17df410999 GitHub bot: changelog [nobuild] 2026-04-14 13:27:29 +00:00
Alexandre
02326d8533 Merge pull request #2650 from alexbelgium/copilot/fix-storage-folder-recognition
Fix Linkwarden STORAGE_FOLDER path resolution for persistent storage
2026-04-14 15:24:17 +02:00
copilot-swe-agent[bot]
2b93184d25 Improve warning message clarity for data migration failures
Agent-Logs-Url: https://github.com/alexbelgium/hassio-addons/sessions/58467521-7d29-4fad-99f8-aad56f0540b8

Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
2026-04-14 08:58:01 +00:00
copilot-swe-agent[bot]
f4f9b15628 Generalize STORAGE_FOLDER symlink fix into reusable function with comprehensive documentation
Extract fix_linkwarden_path() function that can handle any absolute path
affected by the upstream path.join(process.cwd(), '../..', ...) pattern.
Document all 6 affected upstream filesystem operations.

Agent-Logs-Url: https://github.com/alexbelgium/hassio-addons/sessions/58467521-7d29-4fad-99f8-aad56f0540b8

Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
2026-04-14 08:57:02 +00:00
github-actions
a2843bd5d8 GitHub bot: changelog [nobuild] 2026-04-14 08:54:41 +00:00
Alexandre
de83bf2483 Update version in config.yaml to 2.14.0-2 2026-04-14 10:52:55 +02:00
Alexandre
c422dcd695 Update version to 3.1.0-4 in config.yaml 2026-04-14 10:51:14 +02:00
copilot-swe-agent[bot]
10cb1d2629 Address review: improve error logging for data migration and add clarifying comment
Agent-Logs-Url: https://github.com/alexbelgium/hassio-addons/sessions/23af3f23-96f8-49a3-849a-82fb5feef2bc

Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
2026-04-14 06:33:36 +00:00
copilot-swe-agent[bot]
6768d8f019 Fix STORAGE_FOLDER not being recognized by creating symlink from resolved path to persistent location
Linkwarden resolves STORAGE_FOLDER via path.join(process.cwd(), '../..', STORAGE_FOLDER)
which produces /data_linkwarden/config/library instead of /config/library when the app
runs from apps/web or apps/worker subdirectories. The symlink ensures data written to the
resolved path ends up in the persistent addon config directory.

Agent-Logs-Url: https://github.com/alexbelgium/hassio-addons/sessions/23af3f23-96f8-49a3-849a-82fb5feef2bc

Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
2026-04-14 06:32:37 +00:00
copilot-swe-agent[bot]
f80a8a9072 Initial plan 2026-04-14 06:23:26 +00:00
5 changed files with 43 additions and 2 deletions

View File

@@ -1,3 +1,5 @@
## 2.14.0-2 (14-04-2026)
- Minor bugs fixed
## 2.14.0 (2026-03-28)
- Update to latest version from linkwarden/linkwarden (changelog : https://github.com/linkwarden/linkwarden/releases)

View File

@@ -45,5 +45,5 @@ schema:
STORAGE_FOLDER: str?
slug: linkwarden
url: https://github.com/alexbelgium/hassio-addons/tree/master/linkwarden
version: "2.14.0"
version: "2.14.0-2"
webui: "[PROTO:ssl]://[HOST]:[PORT:3000]"

View File

@@ -9,6 +9,43 @@ set -e
bashio::log.info "Creating folders"
mkdir -p "$STORAGE_FOLDER"
# Upstream Linkwarden (packages/filesystem/*.ts) resolves STORAGE_FOLDER via:
# path.join(process.cwd(), '../..', STORAGE_FOLDER, filePath)
# The yarn workspace commands run from apps/web/ or apps/worker/, so
# process.cwd()/../.. resolves to the monorepo root /data_linkwarden.
# Node.js path.join treats absolute path segments as relative when they are not
# the first argument, so an absolute STORAGE_FOLDER like /config/library becomes
# /data_linkwarden/config/library instead of /config/library.
# This affects all filesystem operations: createFile, createFolder, readFile,
# moveFile, removeFile, removeFolder.
# Fix: symlink the top-level directory so all subpaths resolve correctly.
fix_linkwarden_path() {
local actual_path="$1"
local resolved_path="/data_linkwarden${actual_path}"
# Only needed for absolute paths that differ after prefixing
if [ "$resolved_path" = "$actual_path" ]; then
return
fi
mkdir -p "$(dirname "$resolved_path")"
# Preserve any data already written to the non-persistent path
if [ -d "$resolved_path" ] && [ ! -L "$resolved_path" ]; then
if ! cp -rn "$resolved_path/." "$actual_path/" 2>/dev/null; then
bashio::log.warning "Could not migrate existing data from $resolved_path to $actual_path (may be empty or a permissions issue)"
fi
rm -rf "$resolved_path"
fi
ln -sfn "$actual_path" "$resolved_path"
bashio::log.info "Symlinked $resolved_path -> $actual_path"
}
if [[ "$STORAGE_FOLDER" == /* ]]; then
fix_linkwarden_path "$STORAGE_FOLDER"
fi
######################
# CONFIGURE POSTGRES #
######################

View File

@@ -1,3 +1,5 @@
## 3.1.0-4 (14-04-2026)
- Minor bugs fixed
## 3.1.0-3 (14-04-2026)
- Minor bugs fixed

View File

@@ -95,4 +95,4 @@ schema:
slug: seerr
udev: true
url: https://github.com/alexbelgium/hassio-addons/tree/master/seerr
version: "3.1.0-3"
version: "3.1.0-4"