-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
change prefix in piler.js #163
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather like to see a simpler solution. Eg. just set PATH_PREFIX as a docker-compose env var, and if it exists in the container then you simply use sed to fix piler.js, and update config-site.php with this value, eg. $config['PATH_PREFIX'] = ....;
if it's not already in the file.
Also, please use $( ... ) format for running commands, not the obsoleted backtick (`)
what about $config['SITE_URL'] = 'http://' . $config[SITE_NAME_CONST] . '/mail/'; |
Yes, you are correct. I suggest to add |
And also fix |
docker/start.sh
Outdated
then | ||
log "PATH_PREFIX set $PATH_PREFIX" | ||
sed -i -e "s#location.origin\ +\ .*#location.origin\ +\ $PATH_PREFIX,#" /var/piler/www/assets/js/piler.js | ||
sed -i "s%PATH_PREFIX%${PATH_PREFIX}%" "$CONFIG_SITE_PHP" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't cut it, see my next comment below.
etc/config-site.dist.php
Outdated
@@ -3,7 +3,7 @@ | |||
define('SITE_NAME_CONST', 'SITE_NAME'); | |||
|
|||
$config[SITE_NAME_CONST] = 'HOSTNAME'; | |||
$config['SITE_URL'] = 'http://' . $config[SITE_NAME_CONST] . '/'; | |||
$config['SITE_URL'] = 'http://' . $config[SITE_NAME_CONST] . 'PATH_PREFIX'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PATH_PREFIX is a non-existing variable. What we need is
$config['PATH_PREFIX'] = '/';
$config['SITE_URL'] = 'http://' . $config[SITE_NAME_CONST] . $config['PATH_PREFIX'];
Then in start.sh you need to fix $config['PATH_PREFIX'] = '/';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used PATH_PREFIX like HOSTNAME in the file. and replaced it with the env variable in start.sh I also added $config['PATH_PREFIX'].
In my setup it looks like:
...
$config['SITE_URL'] = 'http://' . $config[SITE_NAME_CONST] . '/mail/';
...
$config['PATH_PREFIX'] = '/mail/';
...
Adding $config['PATH_PREFIX'] is an little bit more tricky.
OK, it looks good. However, there's an issue, see #167. The problem is that with the current setup you can't override the BRANDING_* variables, so they need to be restored to the original place as they were. Please check out the other PR, and we need to come to an agreement how to solve this catch 22 issue. |
…PREFIX'] variable accordingly
This patch sets base_url in piler.js according to the setting on config-site.php.