Skip to content

Conversation

@parkervcp
Copy link
Contributor

@parkervcp parkervcp commented Jan 3, 2026

Fixes being able to install plugins
Resolves #2024
Resolves #2025

Fixes symlink for plugins

Adds symlink for server icons
Resolves #2054

Fixes loading environment variables
Resolves #2037

Integrates #2051 #2034 #2045 into a single PR.

Fixes being able to install plugins
Resolves pelican-dev#2024
Resolves pelican-dev#2025

Fixes symlink for plugins

Adds symlink for server icons
Resolves pelican-dev#2054

Fixes loading environment variables
Resolves pelican-dev#2056

Integrates pelican-dev#2051 pelican-dev#2034 pelican-dev#2045 into a single PR.
@coderabbitai
Copy link

coderabbitai bot commented Jan 3, 2026

📝 Walkthrough

Walkthrough

The changes update Docker image configurations and entrypoint script to add missing dependencies (yarn, compression utilities) for plugin installation, establish symlinks for persistent storage of icons and plugins, and fix environment variable parsing to handle spaces in values.

Changes

Cohort / File(s) Summary
Docker image setup
Dockerfile, Dockerfile.dev
Added APK packages: zip, unzip, 7zip, bzip2-dev, and yarn. Restructured filesystem symlinks to relocate plugins to /pelican-data/plugins and add symlink for icons at /pelican-data/storage/icons. Removed plugins directory from application root and updated symlink paths for plugin and storage assets. Added chown directive for PHP configuration directory.
Entrypoint initialization
docker/entrypoint.sh
Updated environment variable loading to use xargs -d '\n' for newline-only splitting, preventing issues with spaces in environment values. Added creation of /pelican-data/storage/icons directory alongside existing volume initialization.

Pre-merge checks

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is vague and generic, describing multiple fixes without indicating the specific primary change or the nature of the container issues being addressed. Make the title more descriptive by specifying the primary focus, such as 'Fix plugin installation and container symlinks' or 'Add plugin dependencies and icon persistence to container'.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR addresses all major linked issues: installs yarn and other plugin dependencies [#2024, #2025], adds icons symlink [#2054], and updates environment variable loading [#2056].
Out of Scope Changes check ✅ Passed All changes are in scope: Dockerfile and Dockerfile.dev modifications address plugin dependencies and symlinks; entrypoint.sh fixes environment loading. Changes directly correspond to objectives in issues #2024, #2025, #2054, and #2056.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description clearly outlines the changes: fixes for plugin installation, symlink handling for plugins and icons, environment variable loading, and integration of related PRs.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
docker/entrypoint.sh (1)

6-6: Consider a more robust environment loading approach.

The xargs -d '\n' fix handles spaces in values, but the export $(...) pattern remains fragile with special characters (quotes, backticks, etc.). Consider using:

-  export $(grep -v '^#' .env | xargs -d '\n') # Fix is from https://github.com/pelican-dev/panel/pull/2045
+  set -a
+  . .env
+  set +a

This approach sources the file directly with automatic exporting enabled, avoiding word-splitting issues entirely.

📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3141fe6 and 7764903.

📒 Files selected for processing (3)
  • Dockerfile
  • Dockerfile.dev
  • docker/entrypoint.sh
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: QuintenQVD0
Repo: pelican-dev/panel PR: 2034
File: Dockerfile.base:12-12
Timestamp: 2025-12-24T09:21:58.780Z
Learning: Git is required at runtime in the Docker image for the plugin system's dependency installation, even though standard Packagist packages don't require it. This is needed in Dockerfile.base and other Dockerfiles.
📚 Learning: 2025-12-24T09:22:18.560Z
Learnt from: QuintenQVD0
Repo: pelican-dev/panel PR: 2034
File: Dockerfile.base:8-8
Timestamp: 2025-12-24T09:22:18.560Z
Learning: In the pelican-dev/panel project, the bz2 PHP extension is required in Dockerfile.base because a plugin in the plugin system depends on it for bzip2 compression functionality.

Applied to files:

  • Dockerfile
  • Dockerfile.dev
📚 Learning: 2025-12-24T09:21:52.260Z
Learnt from: QuintenQVD0
Repo: pelican-dev/panel PR: 2034
File: Dockerfile.base:12-12
Timestamp: 2025-12-24T09:21:52.260Z
Learning: Ensure that Dockerfiles install git at runtime where required for plugin system dependency installation. Update Dockerfile.base and any other Dockerfiles that build runtime images to include git in the runtime dependencies (not just for build-time), so plugin installation steps function correctly in the container.

Applied to files:

  • Dockerfile.dev
🪛 Shellcheck (0.11.0)
docker/entrypoint.sh

[warning] 6-6: Quote this to prevent word splitting.

(SC2046)

🔇 Additional comments (4)
docker/entrypoint.sh (1)

28-28: LGTM!

The addition of /pelican-data/storage/icons correctly ensures the directory exists for the new icons symlink, supporting the objective to persist icons across container restarts.

Dockerfile.dev (2)

70-74: Verify git is installed for plugin system.

The added packages (zip, unzip, 7zip, bzip2-dev, yarn) correctly support plugin installation per the PR objectives. However, based on learnings, git is required at runtime for the plugin system's dependency installation. Ensure git is included in the runtime packages.

🔎 Proposed fix to add git
 RUN apk add --no-cache \
     # packages for running the panel
     caddy ca-certificates supervisor supercronic fcgi coreutils \
     # required for installing plugins. Pulled from https://github.com/pelican-dev/panel/pull/2034
-    zip unzip 7zip bzip2-dev yarn 
+    zip unzip 7zip bzip2-dev yarn git

Based on learnings, git is required at runtime for plugin system dependency installation.


93-93: LGTM!

The icons symlink correctly ensures icon persistence across container restarts, directly addressing issue #2054.

Dockerfile (1)

88-88: LGTM!

The icons symlink correctly ensures persistence across container restarts, addressing issue #2054.

Comment on lines 65 to +69
RUN apk add --no-cache \
caddy ca-certificates supervisor supercronic fcgi
# packages for running the panel
caddy ca-certificates supervisor supercronic fcgi \
# required for installing plugins. Pulled from https://github.com/pelican-dev/panel/pull/2034
zip unzip 7zip bzip2-dev yarn
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find all Dockerfile-related files
find . -name "Dockerfile*" -type f | head -20

Repository: pelican-dev/panel

Length of output: 108


🏁 Script executed:

#!/bin/bash
# Check if Dockerfile.base exists and examine its contents
if [ -f "Dockerfile.base" ]; then
  echo "=== Dockerfile.base ===" 
  cat -n Dockerfile.base
else
  echo "Dockerfile.base not found in root"
  # Search for it
  find . -name "Dockerfile.base" -type f 2>/dev/null
fi

Repository: pelican-dev/panel

Length of output: 595


🏁 Script executed:

#!/bin/bash
# Search for git references in Docker-related files
rg -l "git" --type dockerfile . 2>/dev/null | head -10

Repository: pelican-dev/panel

Length of output: 43


🏁 Script executed:

#!/bin/bash
# Check the main Dockerfile to see base image reference
if [ -f "Dockerfile" ]; then
  echo "=== Checking Dockerfile base image ===" 
  head -20 Dockerfile
fi

Repository: pelican-dev/panel

Length of output: 714


🏁 Script executed:

#!/bin/bash
# Check lines 65-69 in Dockerfile
sed -n '60,75p' Dockerfile

Repository: pelican-dev/panel

Length of output: 700


Add git to the runtime packages.

Git is required at runtime for the plugin system's dependency installation, but it's not included in the base image (Dockerfile.base) or in the packages being installed here. Add git to the RUN apk add command:

RUN apk add --no-cache \
    # packages for running the panel
    caddy ca-certificates git supervisor supercronic fcgi \
    # required for installing plugins. Pulled from https://github.com/pelican-dev/panel/pull/2034
    zip unzip 7zip bzip2-dev yarn

Alternatively, add it to Dockerfile.base if git should be part of the base image.

🤖 Prompt for AI Agents
In Dockerfile around lines 65 to 69, the runtime apk package list is missing git
which the plugin system needs for dependency installation; update the RUN apk
add --no-cache command to include git among the runtime packages (or add git to
Dockerfile.base if you prefer it in the base image) so git is available at
container runtime for plugin installs.

Comment on lines +89 to +91
&& rmdir /var/www/html/plugins \
# fix from https://github.com/pelican-dev/panel/pull/2051
&& ln -s /pelican-data/plugins /var/www/html \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Ensure rmdir handles missing or non-empty directories.

The rmdir command will fail if /var/www/html/plugins doesn't exist or is not empty, causing the Docker build to fail. Use a more resilient approach.

🔎 Proposed fix
-    && rmdir  /var/www/html/plugins \
     # fix from https://github.com/pelican-dev/panel/pull/2051
+    && rm -rf /var/www/html/plugins \
     && ln -s  /pelican-data/plugins /var/www/html

Alternatively, if you want to preserve the safety of rmdir (ensuring it's empty):

-    && rmdir  /var/www/html/plugins \
+    && (rmdir /var/www/html/plugins 2>/dev/null || true) \
     # fix from https://github.com/pelican-dev/panel/pull/2051
     && ln -s  /pelican-data/plugins /var/www/html
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
&& rmdir /var/www/html/plugins \
# fix from https://github.com/pelican-dev/panel/pull/2051
&& ln -s /pelican-data/plugins /var/www/html \
&& rm -rf /var/www/html/plugins \
# fix from https://github.com/pelican-dev/panel/pull/2051
&& ln -s /pelican-data/plugins /var/www/html
🤖 Prompt for AI Agents
In Dockerfile around lines 89-91, the rmdir command can fail if
/var/www/html/plugins is missing or non-empty; replace it with a resilient
removal sequence that first checks/removes any existing path and does not fail
the build (e.g., test -e and remove recursively or use rm -rf safely), and
ensure any existing /var/www/html/plugins or /var/www/html/plugins symlink is
removed before creating the new symlink to /pelican-data/plugins so ln -s cannot
fail.

Comment on lines +94 to +96
&& rmdir /var/www/html/plugins \
# fix from https://github.com/pelican-dev/panel/pull/2051
&& ln -s /pelican-data/plugins /var/www/html \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Ensure rmdir handles missing or non-empty directories.

The rmdir command will fail if /var/www/html/plugins doesn't exist or is not empty, causing the Docker build to fail. Use a more resilient approach.

🔎 Proposed fix
-    && rmdir  /var/www/html/plugins \
     # fix from https://github.com/pelican-dev/panel/pull/2051
+    && rm -rf /var/www/html/plugins \
     && ln -s  /pelican-data/plugins /var/www/html

Alternatively, if you want to preserve the safety of rmdir (ensuring it's empty):

-    && rmdir  /var/www/html/plugins \
+    && (rmdir /var/www/html/plugins 2>/dev/null || true) \
     # fix from https://github.com/pelican-dev/panel/pull/2051
     && ln -s  /pelican-data/plugins /var/www/html
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
&& rmdir /var/www/html/plugins \
# fix from https://github.com/pelican-dev/panel/pull/2051
&& ln -s /pelican-data/plugins /var/www/html \
&& rm -rf /var/www/html/plugins \
# fix from https://github.com/pelican-dev/panel/pull/2051
&& ln -s /pelican-data/plugins /var/www/html \
🤖 Prompt for AI Agents
Dockerfile.dev lines 94-96: the use of plain `rmdir` will fail the build if
/var/www/html/plugins is missing or not empty; change the step to a resilient
removal that only attempts to remove if the directory exists and otherwise is a
no-op (or use a safe recursive-force removal when you intend to delete
contents), then create the symlink—i.e., replace the `rmdir` command with a
check-and-remove or `rm -rf` style approach so the Docker build does not fail
when the directory is absent or non-empty.

Comment on lines +89 to +91
&& rmdir /var/www/html/plugins \
# fix from https://github.com/pelican-dev/panel/pull/2051
&& ln -s /pelican-data/plugins /var/www/html \
Copy link
Member

@rmartinoscar rmartinoscar Jan 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
&& rmdir /var/www/html/plugins \
# fix from https://github.com/pelican-dev/panel/pull/2051
&& ln -s /pelican-data/plugins /var/www/html \
&& ln -sf /pelican-data/plugins /var/www/html \

Why don't use the same as above ?

Image

(Ran on the php:8.4-fpm-alpine image)

Comment on lines +94 to +96
&& rmdir /var/www/html/plugins \
# fix from https://github.com/pelican-dev/panel/pull/2051
&& ln -s /pelican-data/plugins /var/www/html \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
&& rmdir /var/www/html/plugins \
# fix from https://github.com/pelican-dev/panel/pull/2051
&& ln -s /pelican-data/plugins /var/www/html \
&& ln -sf /pelican-data/plugins /var/www/html \

Why don't use the same as above ?

Image

(Ran on the php:8.4-fpm-alpine image)

Copy link
Member

@rmartinoscar rmartinoscar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other then the ln situation LGTM
Also it doesn't actually solves #2056 im still able to reproduce inside & outside of docker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants