Skip to content

Commit

Permalink
Revert config.php changes
Browse files Browse the repository at this point in the history
  • Loading branch information
daN4cat committed Sep 2, 2023
1 parent 4806c0f commit 10b2453
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -96,6 +96,8 @@ NOTE: If you're running non-release code, please make sure you always run the la

- If the avatar pictures are not shown in items or at item save you get an error, please make sure your `public` and subdirs are assigned to the correct owner and the access permission is set to `750`.

- If you install OSPOS in Docker behind a proxy that performs `ssloffloading`, you can enable the URL generated to be HTTPS instead of HTTP, by activating the environment variable `FORCE_HTTPS = 1`.

- If you install OSPOS behind a proxy and OSPOS constantly drops your session, consider whitelisting the proxy IP address by setting `$config['proxy_ips'] = '<proxy ip>';` in the [main php config file](https://github.com/opensourcepos/opensourcepos/blob/master/application/config/config.php). In extreme instances, changing `$config['sess_match_ip'] = TRUE;` to `FALSE` may also help.

- If you have suhosin installed and face an issue with CSRF, please make sure you read [issue #1492](https://github.com/opensourcepos/opensourcepos/issues/1492).
Expand Down
6 changes: 4 additions & 2 deletions application/config/config.php
Expand Up @@ -65,7 +65,9 @@
| a PHP script and you can easily do that on your own.
|
*/
$config['base_url'] = '//' . ((isset($_SERVER['HTTP_HOST'])) ? $_SERVER['HTTP_HOST'] : 'localhost') ;
$config['https_on'] = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_ENV['FORCE_HTTPS']) && $_ENV['FORCE_HTTPS'] == 'true');
$config['base_url'] = $config['https_on'] ? 'https' : 'http';
$config['base_url'] .= '://' . ((isset($_SERVER['HTTP_HOST'])) ? $_SERVER['HTTP_HOST'] : 'localhost') ;
$config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);

/*
Expand Down Expand Up @@ -436,7 +438,7 @@
$config['cookie_prefix'] = '';
$config['cookie_domain'] = '';
$config['cookie_path'] = '/';
$config['cookie_secure'] = TRUE;
$config['cookie_secure'] = $config['https_on'];
$config['cookie_httponly'] = TRUE;

/*
Expand Down
1 change: 1 addition & 0 deletions docker-compose.nginx.yml
Expand Up @@ -28,6 +28,7 @@ services:
- logs:/app/application/logs
environment:
- CI_ENV=${OSPOS_CI_ENV}
- FORCE_HTTPS=true
- PHP_TIMEZONE=UTC
- MYSQL_USERNAME=${OSPOS_MYSQL_USERNAME}
- MYSQL_PASSWORD=${OSPOS_MYSQL_PASSWORD}
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Expand Up @@ -31,6 +31,7 @@ services:
- logs:/app/application/logs
environment:
- CI_ENV=production
- FORCE_HTTPS=false
- PHP_TIMEZONE=UTC
- MYSQL_USERNAME=admin
- MYSQL_PASSWORD=pointofsale
Expand Down

0 comments on commit 10b2453

Please sign in to comment.