Skip to content

chore: cleanup VirtioFS workarounds, parameterize PHP version, add Makefile, and fix minor issues#417

Closed
mortezamirkar wants to merge 18 commits into
MISP:masterfrom
mortezamirkar:fix/virtiofs-php-makefile-cleanup
Closed

chore: cleanup VirtioFS workarounds, parameterize PHP version, add Makefile, and fix minor issues#417
mortezamirkar wants to merge 18 commits into
MISP:masterfrom
mortezamirkar:fix/virtiofs-php-makefile-cleanup

Conversation

@mortezamirkar
Copy link
Copy Markdown
Contributor

1. safe_sed_i() helper + VirtioFS cleanup
Added a safe_sed_i() function using mktemp+cat to replace the repetitive sed > tmp; cat tmp > file; rm tmp workaround for VirtioFS (Docker Desktop for Mac). Replaced dd if=... of=... copies with cat ... > ... for clarity.
2. Parameterize hardcoded PHP 8.4
Added PHP_PACKAGE_VERSION build arg (default 8.4) to core/Dockerfile. Replaced 31 hardcoded references across Dockerfile, nginx config, and entrypoint scripts. Scripts now use version-agnostic php-fpm command via build-time symlink. Nginx config uses @PHP_VERSION@ placeholder templated at build time.
3. Add Makefile
New Makefile with build, build-core, build-modules, build-guard, build-slim, bake, up, down, logs, shellcheck, clean, and prune targets. help is the default.
4. Fix trailing comma in docker-bake.hcl
Added missing trailing comma after GUARD_COMMIT in the misp-guard target args block.
5. Remove duplicate AUTOCONF_ADMIN_KEY var
Removed AUTOCONF_ADMIN_KEY which was only a fallback for AUTOGEN_ADMIN_KEY. Simplified to a single AUTOGEN_ADMIN_KEY (default true).

m.amirkar and others added 17 commits October 20, 2025 16:42
- fix typos and capitalization in Okta integration guide
- change "methd" to "method" in Sign-in method line
- change "OID - OpenID Connect" to "OIDC - OpenID Connect"
- fix "Clinet Authentication" to "Client Authentication"
- fix "Sig-in" to "Sign-in"
- add missing "the" before Sign-in tab and capitalize consistently
- Create a link to troubleshooting section
- Add safe_sed_i() function using mktemp+cat pattern to replace
  the fragile sed > tmp; cat tmp > file; rm tmp workaround used
  for VirtioFS compatibility (Docker Desktop for Mac)
- Replace dd if=... of=... initial file copies with cat ... > ...
  for clearer intent
- Remove deprecated VirtioFS workaround comments referencing the
  Docker forum bug report
- Add PHP_PACKAGE_VERSION build arg (default 8.4) to core/Dockerfile
- Replace all php8.4 package names, binary paths, and config refs
  with php for single-point-of-change upgrades
- Create /usr/local/sbin/php-fpm symlink so entrypoint scripts
  use php-fpm instead of hardcoded versioned binary paths
- Use @PHP_VERSION@ placeholder in nginx config, templated at
  build time via sed
- Pass PHP_PACKAGE_VERSION to docker-compose build args
- Update entrypoint_fpm.sh and kubernetes/entrypoint_fpm.sh
  to use the version-agnostic php-fpm command
Provides convenient targets for the most frequent operations:
- build, build-core, build-modules, build-guard, build-slim, bake
- up, down, logs for runtime management
- shellcheck, clean, prune for maintenance
- help target as default to list available commands
The GUARD_COMMIT line was missing a trailing comma, inconsistent
with the rest of the args blocks in docker-bake.hcl
Comment thread core/files/entrypoint.sh
Comment thread docker-bake.hcl
Copy link
Copy Markdown
Collaborator

@ostefano ostefano left a comment

Choose a reason for hiding this comment

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

I like this thanks!

Just one comment that might require some spelunking (either git blame or github issues)

@ostefano ostefano self-assigned this Jun 3, 2026
@ostefano
Copy link
Copy Markdown
Collaborator

ostefano commented Jun 3, 2026

You could also split this PR, so we could merge the rest right now (and ADMIN_KEY issues postponed).

Now uses a single export line that expands AUTOCONF_ADMIN_KEY
as an inline fallback, keeping backward compat for users with
AUTOCONF_ADMIN_KEY in their .env files.
@mortezamirkar mortezamirkar force-pushed the fix/virtiofs-php-makefile-cleanup branch from 45bd487 to b1b54d2 Compare June 3, 2026 11:30
@mortezamirkar
Copy link
Copy Markdown
Contributor Author

@ostefano Fixed! I've replaced the two-line pattern with a single export that keeps AUTOCONF_ADMIN_KEY as an inline fallback:
export AUTOGEN_ADMIN_KEY=${AUTOGEN_ADMIN_KEY:-${AUTOCONF_ADMIN_KEY:-true}}
Old .env files using AUTOCONF_ADMIN_KEY still work, but we no longer export the redundant variable into the environment. Everything else is unchanged — should be ready for merge.

@mortezamirkar mortezamirkar requested a review from ostefano June 3, 2026 11:32
@ostefano
Copy link
Copy Markdown
Collaborator

ostefano commented Jun 4, 2026

Superseded by #421

Changes:

  • rebased
  • made build var consistent

@ostefano ostefano closed this Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request scheduled Will merge at the next opportunity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants