Skip to content

Commit

Permalink
wordpress: add (patched) wp2static, bump plugin versions
Browse files Browse the repository at this point in the history
  • Loading branch information
lillian committed Mar 27, 2024
1 parent 4322fa7 commit 6e28bbe
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
17 changes: 15 additions & 2 deletions docker/wordpress/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
FROM alpine:latest AS wp2static-builder

RUN apk add composer php82-simplexml php82-dom php82-tokenizer php82-xml php82-xmlwriter zip git
WORKDIR /build
COPY wp2static.patch .
RUN git clone https://github.com/elementor/wp2static
WORKDIR /build/wp2static
RUN git apply ../wp2static.patch
RUN composer install
RUN composer build wp2static

FROM ghcr.io/hacklabto/unit-base:cda4fb84927d8de52c03c98183bf55718699bf0c

RUN wget -O - https://wordpress.org/wordpress-6.4.3.tar.gz | tar xz

# akismet is preinstalled, although maybe we will want to download a specific version of it at some point
RUN (cd wordpress/wp-content/plugins && wget -O - https://downloads.wordpress.org/plugin/contact-form-7.5.8.7.zip | busybox unzip -)
RUN (cd wordpress/wp-content/plugins && wget -O - https://downloads.wordpress.org/plugin/flamingo.2.4.zip | busybox unzip -)
RUN (cd wordpress/wp-content/plugins && wget -O - https://downloads.wordpress.org/plugin/contact-form-7.5.9.3.zip | busybox unzip -)
RUN (cd wordpress/wp-content/plugins && wget -O - https://downloads.wordpress.org/plugin/flamingo.2.5.zip | busybox unzip -)
RUN (cd wordpress/wp-content/plugins && wget -O - https://downloads.wordpress.org/plugin/wp-security-audit-log.zip | busybox unzip -)
RUN (cd wordpress/wp-content/plugins && wget -O - https://downloads.wordpress.org/plugin/wpdirauth.1.10.7.zip | busybox unzip -)
COPY --from=wp2static-builder /root/Downloads/wp2static.zip /app/wordpress/wp-content/plugins/wp2static.zip
RUN (cd wordpress/wp-content/plugins && busybox unzip wp2static.zip && rm -rf wp2static.zip)
RUN rm wordpress/wp-content/plugins/hello.php

RUN (cd wordpress/wp-content/themes && git clone https://github.com/hacklabto/pixeled-wordpress-theme pixeled && rm -rf pixeled/.git)
Expand Down
13 changes: 13 additions & 0 deletions docker/wordpress/wp2static.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/Crawler.php b/src/Crawler.php
index 81e526ed..b3cc1baa 100755
--- a/src/Crawler.php
+++ b/src/Crawler.php
@@ -232,7 +232,7 @@ class Crawler {
WsLog::l( $notice );
}
},
- 'rejected' => function ( RequestException $reason, $index ) use ( $urls ) {
+ 'rejected' => function ( $reason, $index ) use ( $urls ) {
$root_relative_path = $urls[ $index ]['path'];
WsLog::l( 'Failed ' . $root_relative_path );
},

0 comments on commit 6e28bbe

Please sign in to comment.