LINEAGEOTA_BASE_PATH sourcing - use $_SERVER instead of $_ENV #84
Replies: 3 comments
-
Hi, see #76 and relative commits/documentation.
BR, |
Beta Was this translation helpful? Give feedback.
-
Thank you for the quick response and information, i've went ahead and reverted my edit to the latest revision, set the variable in envvars, and removed the line from site config. The variable should be set at the environment level when it's declared in I looked further and noticed that the default PHP config at
Adding The default configuration for Apache/PHP on Debian seems to have been this way for some time, and it makes me wonder why the behavior hasn't been noticed yet, unless i'm going about it wrong. With this method, a future PHP upgrade would also require the extended Is there a drawback to using |
Beta Was this translation helpful? Give feedback.
-
It's set as an environment variable because this project is used also in a container first and foremost. Regarding adapting it to use The important part is that it does not depend on single use cases, like Apache/Nginx only. |
Beta Was this translation helpful? Give feedback.
-
Hello! Long story short, I had to make a quick modification to index.php so LINEAGEOTA_BASE_PATH could reach the API server, and i'm not sure if it's my apache configuration or something else:
When I first set the deployment up a few months ago, I needed to define env variable LINEAGEOTA_BASE_PATH for my reverse proxy, and updated to latest commit (latest tagged release that composer grabs is 2.9.0 without the change for $base_path).
I declared the variable in /etc/apache2/envvars as
LINEAGEOTA_BASE_PATH=https://externalURL
, however the server does not seem to see the variable, the API call would return"url":"http:\/\/internalURL:port\"
. Tried defining it in .htaccess as well, no dice.I can confirm the variables in envvars were being set by viewing phpinfo() under Apache Environment:
index.php follows else here, but phpinfo() could resolve the variable.
After a bit of trial and error, I ended up modifying the file, changing:
$_ENV
to$_SERVER
This allowed me to define the variable in /etc/apache2/sites-enabled/LineageOTA.conf with
SetEnv LINEAGEOTA_BASE_PATH https://externalURL
, where it is successfully read by the API server ("url":"https:\/\/externalURL\"
), and downloads are able to commence on my phone with the corresponding prop.I'd forgotten about this modification until I decided to redeploy the api server into my main Jenkins container, sure enough the same issue became visible again, and I made the same change to allow the variable to reach the server after troubleshooting Apache. Am I missing something in Apache2 regarding environment variables? Anyone had a similar experience/solution?
Beta Was this translation helpful? Give feedback.
All reactions