btcpayserver / btcpayserver/dockerfile-deps

Woocommerce theme messed up on TOR

Open
#52 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Dockerfile
Stars
32
Forks
57
Avg merge
2h 26m
Merged PRs (30d)
11

Description

If you first use woocommerce on clearnet and then attempt to use TOR, then the layout is messed up because woocommerce saved options `home` and `siteurl` in database during the install.

This website shows [manual steps](https://codex.wordpress.org/Changing_The_Site_URL) to edit this those values.

A better idea, is to modify wp-config.php and add:

```php
define('WP_SITEURL', $_SERVER["REQUEST_SCHEME"].'://'.$_SERVER["SERVER_NAME"]);
define('WP_HOME', $_SERVER["REQUEST_SCHEME"]'.'://'.'$_SERVER["SERVER_NAME"]);
```
We should check `$_SERVER['HTTP_X_FORWARDED_PROTO']` instead of `REQUEST_SCHEME` though.

This has the advantage to make woocommerce works at same time on clearnet and Tor.
We should probably do this automatically in the `docker-entrypoint.sh`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading docker-entrypoint.sh and the wp-config.php configuration path, then trace how the existing container handles WordPress site URLs. Verify the finished behavior against both clearnet and Tor access, including the forwarded-protocol case described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
dockerfile, php, wordpress
Domain
backend, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.