-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run wp2static on Kubernetes (unprivileged container) #903
Comments
I see a reference to a variable Line 49 in 47980c2
I don't see any mention of that in the documentation. How can I use it with the wp-cli command to set an alternative port? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For context, I have set up WordPress on Kubernetes using the Bitnami HELM chart. My goal is to be able to run a Kubernetes Job to execute a wp2static export.
The problem is that since executing containers as root in Kubernetes is discouraged, it prevents you from binding your web server (Apache) to ports 80/443. As an alternative, the container runs Apache on ports 8080/6443. To expose your website on ports 80/443 to the outside world, you then use an Ingress object, which basically is a TLS reverse proxy, to forward traffic to the container.
Considering this, when I run "wp2static detect" within my Wordpress container, I get this error:
'''
$ wp wp2static detect
[2023-08-02T16:58:01+02:00] Starting to detect WordPress site URLs.
[02-Aug-2023 14:58:01 UTC] PHP Fatal error: Uncaught WP2StaticGuzzleHttp\Exception\ConnectException: cURL error 7: Failed to connect to 127.0.0.1 port 443: Connection refused (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://127.0.0.1/robots.txt in /bitnami/wordpress/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/CurlFactory.php:210
'''
After some research, I tried to find a workaround with this :
'''
$ wp --path=/ --http=https://127.0.0.1:6443 wp2static detect
Error: Failed to get url 'https://127.0.0.1:6443': cURL error 60: SSL certificate problem: self signed certificate.
'''
Unfortunately, I feel like I'm stuck here.
Do you see any easy workaround to this situation?
A potential workaround to address this would be to implement additional arguments into the wp2static CLI. One approach would be to allow users to set the address, port, and to bypass certificate verification directly from the command line.
For example, it could be something like this:
The text was updated successfully, but these errors were encountered: