1
0
Fork 0
mirror of synced 2024-05-20 20:52:36 +12:00

work in progress

This commit is contained in:
Eldad Fux 2020-06-19 03:04:09 +03:00
parent 0266e1a667
commit 2803e62769
4 changed files with 12 additions and 11 deletions

View file

@ -83,7 +83,7 @@ $utopia->init(function () use ($utopia, $request, $response, &$user, $project, $
* As recommended at:
* @see https://www.owasp.org/index.php/List_of_useful_HTTP_headers
*/
if ($request->getServer('_APP_OPTIONS_FORCE_HTTPS', 'disabled') === 'enabled') { // Force HTTPS
if ($utopia->getEnv('_APP_OPTIONS_FORCE_HTTPS', 'disabled') === 'enabled') { // Force HTTPS
if(Config::getParam('protocol') !== 'https') {
return $response->redirect('https://' . Config::getParam('domain').$request->getServer('REQUEST_URI'));
}

View file

@ -50,6 +50,9 @@ const APP_SOCIAL_DEV = 'https://dev.to/appwrite';
$register = new Registry();
$request = new Request();
$response = new Response();
$utopia = new App('Asia/Tel_Aviv');
$utopia->setMode($utopia->getEnv('_APP_ENV', App::MODE_TYPE_PRODUCTION));
/*
* ENV vars
@ -60,7 +63,7 @@ Config::load('platforms', __DIR__.'/../app/config/platforms.php');
Config::load('locales', __DIR__.'/../app/config/locales.php');
Config::load('collections', __DIR__.'/../app/config/collections.php');
Config::setParam('env', $request->getServer('_APP_ENV', App::MODE_TYPE_PRODUCTION));
Config::setParam('env', $utopia->getMode());
Config::setParam('domain', $request->getServer('HTTP_HOST', ''));
Config::setParam('domainVerification', false);
Config::setParam('version', $request->getServer('_APP_VERSION', 'UNKNOWN'));
@ -68,8 +71,6 @@ Config::setParam('protocol', $request->getServer('HTTP_X_FORWARDED_PROTO', $requ
Config::setParam('port', (string) parse_url(Config::getParam('protocol').'://'.$request->getServer('HTTP_HOST', ''), PHP_URL_PORT));
Config::setParam('hostname', parse_url(Config::getParam('protocol').'://'.$request->getServer('HTTP_HOST', null), PHP_URL_HOST));
$utopia = new App('Asia/Tel_Aviv', Config::getParam('env'));
Resque::setBackend($request->getServer('_APP_REDIS_HOST', '')
.':'.$request->getServer('_APP_REDIS_PORT', ''));

View file

@ -32,7 +32,7 @@
"appwrite/php-clamav": "1.0.*",
"utopia-php/framework": "0.3.1",
"utopia-php/framework": "0.3.3",
"utopia-php/abuse": "0.2.*",
"utopia-php/audit": "0.3.*",
"utopia-php/cache": "0.2.*",

12
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "79b5c353af354f8df106d2f933750102",
"content-hash": "b40a5280315184407b21232e6c607b85",
"packages": [
{
"name": "appwrite/php-clamav",
@ -1596,16 +1596,16 @@
},
{
"name": "utopia-php/framework",
"version": "0.3.1",
"version": "0.3.3",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/framework.git",
"reference": "b480f9dd01ad7990a12e90e5e4d11ded558dd8fc"
"reference": "dae7464b257663cd250e58244b21781a996134c2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/framework/zipball/b480f9dd01ad7990a12e90e5e4d11ded558dd8fc",
"reference": "b480f9dd01ad7990a12e90e5e4d11ded558dd8fc",
"url": "https://api.github.com/repos/utopia-php/framework/zipball/dae7464b257663cd250e58244b21781a996134c2",
"reference": "dae7464b257663cd250e58244b21781a996134c2",
"shasum": ""
},
"require": {
@ -1636,7 +1636,7 @@
"php",
"upf"
],
"time": "2020-06-18T22:58:05+00:00"
"time": "2020-06-18T23:28:10+00:00"
},
{
"name": "utopia-php/locale",