Skip to content

Dev#117

Open
TatevikGr wants to merge 25 commits into
mainfrom
dev
Open

Dev#117
TatevikGr wants to merge 25 commits into
mainfrom
dev

Conversation

@TatevikGr
Copy link
Copy Markdown
Contributor

@TatevikGr TatevikGr commented May 18, 2026

Summary

Thanks for contributing to phpList!

Summary by CodeRabbit

  • New Features

    • Modern Vue-based web frontend, rich text editor support, and charting visualization added.
  • Chores

    • Updated container build and deployment (app now serves on port 8081).
    • Added automated frontend asset build pipeline and composer script to compile web assets.
    • Enabled CORS support and updated project dependencies and build tooling.
    • Documentation updated with frontend build instructions.
  • Tests

    • Improved test bootstrap and test-suite initialization.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

📝 Walkthrough

Walkthrough

This PR integrates a Vue 3 frontend build system (Webpack Encore, Tailwind, CKEditor), adds npm/package tooling, wires a Composer script to build frontend assets, updates the Dockerfile to install Node/Yarn and build assets during image creation, adjusts docker-compose and Apache to run on port 8081 with mounted var volumes, adds a CI publish workflow, and updates test bootstrap/phpunit configuration.

Changes

Web Frontend Build Pipeline Integration

Layer / File(s) Summary
Frontend build tooling (Webpack, PostCSS, npm dependencies)
webpack.config.js, postcss.config.js, package.json
Adds Symfony Webpack Encore config with Vue 3 loader, PostCSS/Tailwind setup, JS/CSS entry points, asset copying and aliases. package.json adds build:web-frontend/watch:web-frontend scripts plus dev and runtime dependencies for Vue 3, CKEditor, ApexCharts, Webpack/Babel/Encore, and Tailwind/PostCSS.
PHP build script and Composer dependency wiring
composer.json, README.md
composer.json updates tatevikgr/rest-api-client to dev-main, adds nelmio/cors-bundle, registers the bundle in extra, and adds build-web-frontend-assets script that runs yarn install && yarn build:web-frontend. README documents the Composer script.
Docker image build enhancements
Dockerfile
Dockerfile installs freetype/jpeg dev libs and enables PHP gd with those options, installs Node.js 20.x and Yarn, copies package.json and yarn.lock into the dependency layer before composer install, and runs the Composer build-web-frontend-assets script during image build.
Docker compose service configuration & Apache
docker-compose.yml, docker/apache/*
docker-compose.yml switches app image, maps host port to container port 8081, sets REST/API/FRONT_END base URLs to http://app:8081/, mounts ./var/logs and ./var/cache, and replaces startup command to create/prepare prod cache/log dirs and permissions. Apache configs added/updated to listen on 8081 and set ServerName app.
CI workflow
.github/workflows/docker-publish.yml
Adds a CI workflow that builds the Docker image and conditionally publishes multi-arch images to Docker Hub for non-PR events.
Test bootstrap and phpunit configuration
tests/bootstrap.php, phpunit.xml.dist, tests/System/HttpEndpoints/WebFrontEndTest.php
Adds test bootstrap that enables strict types, starts output buffering, and requires Composer autoloader; updates PHPUnit bootstrap path; test adds assertion that /api/v2 does not return 500.
Build context and version control ignore rules
.dockerignore, .gitignore
.dockerignore now ignores var/cache, var/logs, var/log, var/sessions, .env, Dockerfile*, docker-compose*.yml, and public/build and removes yarn.lock from ignores. .gitignore adds node_modules/.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The pull request title 'Dev' is vague and generic, providing no meaningful information about the changeset beyond implying it relates to development or a development branch. Replace the title with a specific, descriptive summary of the main change, such as 'Add frontend build tooling and Docker publishing workflow' or 'Integrate Webpack Encore frontend assets and CI/CD pipeline'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch dev

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
Copy Markdown

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
.gitignore (1)

1-1: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Remove repository-wide wildcard ignore at root.

Line 1 (*) causes Git to ignore essentially all new files, which can break normal staging workflows and makes subsequent rules ineffective unless explicit negations are added.

Suggested fix
-*
 *.bak
 /.idea/
 /.project
 /.webprj
 /bin/
 /config/bundles.yml
 /config/config_modules.yml
 /config/parameters.yml
 /config/routing_modules.yml
 /nbproject
 /public/
 /var/
 /vendor/
 /node_modules/
 .DS_Store
 .vagrant
 .phpunit.result.cache
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.gitignore at line 1, Remove the repository-wide wildcard entry '*' from
.gitignore (the root wildcard that ignores all new files) and replace it with
either specific ignore patterns (e.g., editor backups, build artifacts, OS
files) or move broad personal ignores to a global git exclude via git config
--global core.excludesfile; if you intended to ignore everything except a few
files, convert to explicit negation rules instead of '*'. Ensure you update the
existing .gitignore entry that currently contains '*' to one of these safer
options so normal staging and subsequent ignore rules work correctly.
Dockerfile (1)

47-50: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

composer install runs scripts before bin/console exists.

composer install is executed before COPY . ., but post-install scripts call php bin/console. This can break the image build.

🐛 Proposed fix
-RUN composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader
+RUN composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader --no-scripts

 # Copy the rest of the application (except files ignored by .dockerignore)
 COPY . .
+
+# Run project scripts after app sources (including bin/console) are present
+RUN composer run-script post-install-cmd
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Dockerfile` around lines 47 - 50, The Dockerfile runs "composer install"
before "COPY . .", which triggers Composer post-install scripts that call "php
bin/console" when bin/console doesn't exist yet; either move the "COPY . ." step
so that the application files (including bin/console) are copied before running
"composer install", or change the composer step to "composer install
--no-scripts --no-dev --no-interaction --prefer-dist --optimize-autoloader" and
then run "composer run scripts" (or "composer install" without --no-scripts)
after the COPY so post-install scripts can find bin/console.
🧹 Nitpick comments (1)
postcss.config.js (1)

2-5: ⚡ Quick win

Remove redundant autoprefixer from the Tailwind v4 pipeline.

With Tailwind v4, @tailwindcss/postcss automatically handles vendor prefixing and minification through Lightning CSS, making Autoprefixer unnecessary.

♻️ Proposed change
 module.exports = {
     plugins: [
         require('`@tailwindcss/postcss`'),
-        require('autoprefixer'),
     ],
 };
 // package.json (devDependencies)
-    "autoprefixer": "^10.4.27",
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@postcss.config.js` around lines 2 - 5, The plugins array in postcss.config.js
includes require('autoprefixer') which is redundant with Tailwind v4's
require('`@tailwindcss/postcss`'); remove the require('autoprefixer') entry from
the plugins array so only require('`@tailwindcss/postcss`') remains, and ensure
the plugins array syntax remains valid after removal.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@composer.json`:
- Around line 94-97: The build script "build-web-frontend-assets" uses a
non-deterministic "yarn install"; replace that command with a lockfile-enforced
install: use "yarn install --frozen-lockfile" if the repo uses Yarn v1, or "yarn
install --immutable" if it uses Yarn v2+/Berry; update the
"build-web-frontend-assets" array accordingly and ensure CI uses the same Yarn
major version.

In `@docker-compose.yml`:
- Line 4: Remove the hard-coded personal registry image tag currently set via
the image: key in docker-compose (the "tatevikg1/phplist:test" entry) and
replace it with a project-local tag or omit the image: line so the service uses
its local build context (build: .); update the compose service definition that
contains the image: key to either use a neutral project image name (e.g.,
phplist:local) or delete the image: line entirely to rely on the existing build:
. configuration.

In `@tests/System/HttpEndpoints/WebFrontEndTest.php`:
- Line 49: The current weak assertion in testHomepageReturnsContent uses
assertNotEquals(500, $response->getStatusCode()) which allows other error codes;
update the assertion to assert a successful HTTP result instead — e.g. replace
the not-equals check with a positive check such as asserting
$response->isSuccessful() (or assertEquals(200, $response->getStatusCode()) or
assertThat the status is in the 2xx range) so the test in
testHomepageReturnsContent reliably verifies successful content delivery.

---

Outside diff comments:
In @.gitignore:
- Line 1: Remove the repository-wide wildcard entry '*' from .gitignore (the
root wildcard that ignores all new files) and replace it with either specific
ignore patterns (e.g., editor backups, build artifacts, OS files) or move broad
personal ignores to a global git exclude via git config --global
core.excludesfile; if you intended to ignore everything except a few files,
convert to explicit negation rules instead of '*'. Ensure you update the
existing .gitignore entry that currently contains '*' to one of these safer
options so normal staging and subsequent ignore rules work correctly.

In `@Dockerfile`:
- Around line 47-50: The Dockerfile runs "composer install" before "COPY . .",
which triggers Composer post-install scripts that call "php bin/console" when
bin/console doesn't exist yet; either move the "COPY . ." step so that the
application files (including bin/console) are copied before running "composer
install", or change the composer step to "composer install --no-scripts --no-dev
--no-interaction --prefer-dist --optimize-autoloader" and then run "composer run
scripts" (or "composer install" without --no-scripts) after the COPY so
post-install scripts can find bin/console.

---

Nitpick comments:
In `@postcss.config.js`:
- Around line 2-5: The plugins array in postcss.config.js includes
require('autoprefixer') which is redundant with Tailwind v4's
require('`@tailwindcss/postcss`'); remove the require('autoprefixer') entry from
the plugins array so only require('`@tailwindcss/postcss`') remains, and ensure
the plugins array syntax remains valid after removal.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 40e54fb2-fbc9-4018-9810-9466038bdea5

📥 Commits

Reviewing files that changed from the base of the PR and between 6b8196b and 0f28f6e.

⛔ Files ignored due to path filters (2)
  • composer.lock is excluded by !**/*.lock
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (12)
  • .dockerignore
  • .gitignore
  • Dockerfile
  • README.md
  • composer.json
  • docker-compose.yml
  • package.json
  • phpunit.xml.dist
  • postcss.config.js
  • tests/System/HttpEndpoints/WebFrontEndTest.php
  • tests/bootstrap.php
  • webpack.config.js

Comment thread composer.json
Comment on lines +94 to +97
"build-web-frontend-assets": [
"yarn install",
"yarn build:web-frontend"
],
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Make frontend dependency installation deterministic.

Using plain yarn install can produce drift across image builds. Enforce lockfile-based install in this script.

🔒 Proposed change
 "build-web-frontend-assets": [
-    "yarn install",
+    "yarn install --frozen-lockfile --non-interactive",
     "yarn build:web-frontend"
 ],
For the Yarn version used here, what is the correct deterministic CI install flag (`--frozen-lockfile` vs `--immutable`)?
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@composer.json` around lines 94 - 97, The build script
"build-web-frontend-assets" uses a non-deterministic "yarn install"; replace
that command with a lockfile-enforced install: use "yarn install
--frozen-lockfile" if the repo uses Yarn v1, or "yarn install --immutable" if it
uses Yarn v2+/Berry; update the "build-web-frontend-assets" array accordingly
and ensure CI uses the same Yarn major version.

Comment thread docker-compose.yml
app:
build: .
image: phplist/base-distribution:latest
image: tatevikg1/phplist:test
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Avoid committing a personal registry image tag in default compose config.

Keeping tatevikg1/phplist:test here can accidentally pull/use an external personal image in shared workflows. Prefer a project-local tag or omit image for default local builds.

🔧 Proposed change
-    image: tatevikg1/phplist:test
+    image: phplist/base-distribution:local

or remove the image: line entirely and rely on build: ..

📝 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
image: tatevikg1/phplist:test
image: phplist/base-distribution:local
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docker-compose.yml` at line 4, Remove the hard-coded personal registry image
tag currently set via the image: key in docker-compose (the
"tatevikg1/phplist:test" entry) and replace it with a project-local tag or omit
the image: line so the service uses its local build context (build: .); update
the compose service definition that contains the image: key to either use a
neutral project image name (e.g., phplist:local) or delete the image: line
entirely to rely on the existing build: . configuration.

{
self::getClient()->request('get', '/api/v2');
$response = self::getClient()->getResponse();
self::assertNotEquals(500, $response->getStatusCode());
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Weak assertion allows non-success status codes.

assertNotEquals(500, ...) passes for any non-500 status, including 404, 403, or other error codes. The test name testHomepageReturnsContent suggests it should verify successful content delivery, not just the absence of server errors.

Consider using a positive assertion:

✅ Proposed fix to assert success status
-        self::assertNotEquals(500, $response->getStatusCode());
+        self::assertSame(Response::HTTP_OK, $response->getStatusCode());

Alternatively, if this test is meant to be distinct from testHomepageReturnsSuccess, consider asserting a 2xx range or removing the status check entirely if assertNotEmpty($response->getContent()) is sufficient.

📝 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
self::assertNotEquals(500, $response->getStatusCode());
self::assertSame(Response::HTTP_OK, $response->getStatusCode());
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/System/HttpEndpoints/WebFrontEndTest.php` at line 49, The current weak
assertion in testHomepageReturnsContent uses assertNotEquals(500,
$response->getStatusCode()) which allows other error codes; update the assertion
to assert a successful HTTP result instead — e.g. replace the not-equals check
with a positive check such as asserting $response->isSuccessful() (or
assertEquals(200, $response->getStatusCode()) or assertThat the status is in the
2xx range) so the test in testHomepageReturnsContent reliably verifies
successful content delivery.

* release: dev → main (add frontend build system) (#110)



    New Features
        Modern frontend build and bundling setup with Node/Yarn support and asset compilation
        CORS support enabled for API compatibility

    Chores
        Updated build tooling and runtime dependencies; added image processing support in the runtime environment
        Docker and compose improvements for build steps and persistent logs/cache; adjusted ignore rules

    Tests
        Added test bootstrap and improved server-error assertion in endpoint tests

    Documentation
        Added instructions to build and publish frontend assets

---------

Co-authored-by: Tatevik <tatevikg1@gmail.com>

* Add dockerhub publish workflow

* Fix docker compose configs

* Update docker-publish workflow to trigger on main and dev branches

* Add todo

* Update tags strategy in docker-publish workflow

---------

Co-authored-by: Tatevik <tatevikg1@gmail.com>
Copy link
Copy Markdown

@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: 2

♻️ Duplicate comments (2)
.github/workflows/docker-publish.yml (1)

14-14: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Move CI publish target off a personal DockerHub namespace.

Line 14 points releases to a personal repo; this is fragile for org-owned publishing and release provenance.

Suggested fix
-  DOCKERHUB_IMAGE: tatevikg1/phplist4
+  DOCKERHUB_IMAGE: phplist/base-distribution
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/docker-publish.yml at line 14, The CI is publishing to a
personal DockerHub namespace via the DOCKERHUB_IMAGE variable; change the value
of DOCKERHUB_IMAGE to point at the organisation-owned image (or a generic org
repository) instead of "tatevikg1/phplist4", and update any related workflow
references to use that variable; if necessary, coordinate with org owners to use
the org DockerHub repository name or a repository dispatch/secret
(DOCKERHUB_IMAGE) that references the canonical org image for releases.
docker-compose.yml (1)

5-5: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use a neutral default image tag in shared compose config.

Line 5 still hard-codes a personal registry image, which can cause teams/CI to pull unintended images by default.

Suggested fix
-    image: tatevikg1/phplist:test
+    image: phplist/base-distribution:local
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docker-compose.yml` at line 5, The docker-compose.yml currently hard-codes a
personal registry image "tatevikg1/phplist:test"; change this to a neutral
default image tag (e.g., replace the image value with a team/official or generic
tag such as "phplist:latest" or remove the image key and use a build/context
reference) so shared configs and CI do not pull a personal image by default;
update the image field in docker-compose.yml accordingly and ensure any related
service name remains unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/docker-publish.yml:
- Line 23: The workflow currently uses floating tags for actions (e.g.,
actions/checkout, docker/setup-qemu-action, docker/setup-buildx-action,
docker/login-action, docker/metadata-action, docker/build-push-action); replace
each `uses:` entry with the corresponding immutable commit SHA (pin to a full
commit ref like actions/checkout@<SHA>) to reduce supply-chain risk, updating
all occurrences of those symbols in the workflow file (the instances referenced
in the review) so none remain on major/minor tags.

In `@docker-compose.yml`:
- Around line 17-19: The docker-compose env values REST_API_BASE_URL,
FRONT_END_BASE_URL and API_BASE_URL currently point to the internal Docker
hostname "http://app:8081/" which browsers cannot resolve; change them to a
host-reachable URL by replacing "app" with a public host/port variable (for
example use an interpolated env var like ${PUBLIC_HOST}:${PHPLIST_PORT} or
${HOST}:${PHPLIST_PORT} or a full external URL) so the browser-facing base URLs
resolve outside the Docker network; update the three keys (REST_API_BASE_URL,
FRONT_END_BASE_URL, API_BASE_URL) to reference the public-facing environment
variable(s) instead of the internal service name.

---

Duplicate comments:
In @.github/workflows/docker-publish.yml:
- Line 14: The CI is publishing to a personal DockerHub namespace via the
DOCKERHUB_IMAGE variable; change the value of DOCKERHUB_IMAGE to point at the
organisation-owned image (or a generic org repository) instead of
"tatevikg1/phplist4", and update any related workflow references to use that
variable; if necessary, coordinate with org owners to use the org DockerHub
repository name or a repository dispatch/secret (DOCKERHUB_IMAGE) that
references the canonical org image for releases.

In `@docker-compose.yml`:
- Line 5: The docker-compose.yml currently hard-codes a personal registry image
"tatevikg1/phplist:test"; change this to a neutral default image tag (e.g.,
replace the image value with a team/official or generic tag such as
"phplist:latest" or remove the image key and use a build/context reference) so
shared configs and CI do not pull a personal image by default; update the image
field in docker-compose.yml accordingly and ensure any related service name
remains unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 34d6192e-060d-4004-b699-d83a25572ee5

📥 Commits

Reviewing files that changed from the base of the PR and between 0f28f6e and 8aef04b.

📒 Files selected for processing (5)
  • .github/workflows/docker-publish.yml
  • docker-compose.yml
  • docker/apache/000-default.conf
  • docker/apache/ports.conf
  • docker/apache/servername.conf
✅ Files skipped from review due to trivial changes (3)
  • docker/apache/ports.conf
  • docker/apache/servername.conf
  • docker/apache/000-default.conf

contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify all `uses:` entries in workflows and find non-SHA refs.
rg -n --type=yaml '^\s*uses:\s*[^@]+@' .github/workflows \
  | rg -n -v '@[0-9a-fA-F]{40}$'

Repository: phpList/base-distribution

Length of output: 798


🏁 Script executed:

cat -n .github/workflows/docker-publish.yml | head -60

Repository: phpList/base-distribution

Length of output: 1947


Pin GitHub Actions to immutable SHAs instead of floating version tags.

Using floating major tags for build/publish actions increases supply-chain risk. Pin all uses: entries to full commit SHAs.

Lines 23, 26, 29, 33, 40, 50 currently use:

  • actions/checkout@v4
  • docker/setup-qemu-action@v3
  • docker/setup-buildx-action@v3
  • docker/login-action@v3
  • docker/metadata-action@v5
  • docker/build-push-action@v6

Replace with specific SHAs (e.g., actions/checkout@a5ac7e51b41094c5405359c7b978efb3c90df8be).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/docker-publish.yml at line 23, The workflow currently uses
floating tags for actions (e.g., actions/checkout, docker/setup-qemu-action,
docker/setup-buildx-action, docker/login-action, docker/metadata-action,
docker/build-push-action); replace each `uses:` entry with the corresponding
immutable commit SHA (pin to a full commit ref like actions/checkout@<SHA>) to
reduce supply-chain risk, updating all occurrences of those symbols in the
workflow file (the instances referenced in the review) so none remain on
major/minor tags.

Comment thread docker-compose.yml
Comment on lines +17 to +19
REST_API_BASE_URL: 'http://app:8081/'
FRONT_END_BASE_URL: 'http://app:8081/'
API_BASE_URL: 'http://app:8081/'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Avoid internal-only hostname for browser-facing base URLs.

Line 17-19 use http://app:8081/; that hostname is Docker-network internal and is usually not resolvable by end-user browsers. Prefer host-reachable URLs (for example via ${PHPLIST_PORT} / external host env).

Suggested fix
-      REST_API_BASE_URL: 'http://app:8081/'
-      FRONT_END_BASE_URL: 'http://app:8081/'
-      API_BASE_URL: 'http://app:8081/'
+      REST_API_BASE_URL: ${REST_API_BASE_URL:-http://localhost:${PHPLIST_PORT:-8081}/}
+      FRONT_END_BASE_URL: ${FRONT_END_BASE_URL:-http://localhost:${PHPLIST_PORT:-8081}/}
+      API_BASE_URL: ${API_BASE_URL:-http://localhost:${PHPLIST_PORT:-8081}/}
📝 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
REST_API_BASE_URL: 'http://app:8081/'
FRONT_END_BASE_URL: 'http://app:8081/'
API_BASE_URL: 'http://app:8081/'
REST_API_BASE_URL: ${REST_API_BASE_URL:-http://localhost:${PHPLIST_PORT:-8081}/}
FRONT_END_BASE_URL: ${FRONT_END_BASE_URL:-http://localhost:${PHPLIST_PORT:-8081}/}
API_BASE_URL: ${API_BASE_URL:-http://localhost:${PHPLIST_PORT:-8081}/}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docker-compose.yml` around lines 17 - 19, The docker-compose env values
REST_API_BASE_URL, FRONT_END_BASE_URL and API_BASE_URL currently point to the
internal Docker hostname "http://app:8081/" which browsers cannot resolve;
change them to a host-reachable URL by replacing "app" with a public host/port
variable (for example use an interpolated env var like
${PUBLIC_HOST}:${PHPLIST_PORT} or ${HOST}:${PHPLIST_PORT} or a full external
URL) so the browser-facing base URLs resolve outside the Docker network; update
the three keys (REST_API_BASE_URL, FRONT_END_BASE_URL, API_BASE_URL) to
reference the public-facing environment variable(s) instead of the internal
service name.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants