Allow path to config to be defined in httpd conf

This commit is contained in:
Sylvain Berfini 2020-07-30 10:11:50 +02:00
parent 4ad97a784f
commit 39b5e6fc16
3 changed files with 15 additions and 13 deletions

View file

@ -8,7 +8,7 @@
#%define _datadir %{_datarootdir}
#%define _docdir %{_datadir}/doc
%define build_number 21
%define build_number 22
%define var_dir /var/opt/belledonne-communications
%define opt_dir /opt/belledonne-communications/share/flexisip-account-manager
%define env_file "$RPM_BUILD_ROOT/etc/flexisip-account-manager/flexiapi.env"

View file

@ -5,6 +5,7 @@ Alias /flexisip-account-manager /opt/belledonne-communications/share/flexisip-ac
Options FollowSymLinks MultiViews
AllowOverride None
Require all denied
SetEnv FLEXISIP_ACCOUNT_MANAGER_PATH_TO_CONFIG /etc/flexisip-account-manager
<Files xmlrpc.php>
<RequireAll>

View file

@ -18,20 +18,21 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define("PATH_TO_CONFIG", "/etc/flexisip-account-manager");
$path = isset($_SERVER['FLEXISIP_ACCOUNT_MANAGER_PATH_TO_CONFIG']) ? $_SERVER['FLEXISIP_ACCOUNT_MANAGER_PATH_TO_CONFIG'] : "/etc/flexisip-account-manager";
define("FLEXISIP_ACCOUNT_MANAGER_PATH_TO_CONFIG", $path);
include_once PATH_TO_CONFIG . '/accounts.conf';
include_once PATH_TO_CONFIG . '/auth.conf';
include_once PATH_TO_CONFIG . '/db.conf';
include_once PATH_TO_CONFIG . '/emails.conf';
include_once PATH_TO_CONFIG . '/inapp.conf';
include_once PATH_TO_CONFIG . '/logs.conf';
include_once PATH_TO_CONFIG . '/provisioning.conf';
include_once PATH_TO_CONFIG . '/sms.conf';
include_once PATH_TO_CONFIG . '/tests.conf';
include_once FLEXISIP_ACCOUNT_MANAGER_PATH_TO_CONFIG . '/accounts.conf';
include_once FLEXISIP_ACCOUNT_MANAGER_PATH_TO_CONFIG . '/auth.conf';
include_once FLEXISIP_ACCOUNT_MANAGER_PATH_TO_CONFIG . '/db.conf';
include_once FLEXISIP_ACCOUNT_MANAGER_PATH_TO_CONFIG . '/emails.conf';
include_once FLEXISIP_ACCOUNT_MANAGER_PATH_TO_CONFIG . '/inapp.conf';
include_once FLEXISIP_ACCOUNT_MANAGER_PATH_TO_CONFIG . '/logs.conf';
include_once FLEXISIP_ACCOUNT_MANAGER_PATH_TO_CONFIG . '/provisioning.conf';
include_once FLEXISIP_ACCOUNT_MANAGER_PATH_TO_CONFIG . '/sms.conf';
include_once FLEXISIP_ACCOUNT_MANAGER_PATH_TO_CONFIG . '/tests.conf';
// these two might include some of the scripts from the installation, so keep them last
include_once PATH_TO_CONFIG . '/hooks.conf';
include_once PATH_TO_CONFIG . '/overloads.conf';
include_once FLEXISIP_ACCOUNT_MANAGER_PATH_TO_CONFIG . '/hooks.conf';
include_once FLEXISIP_ACCOUNT_MANAGER_PATH_TO_CONFIG . '/overloads.conf';
?>