mobile api changes + docker image basics

This commit is contained in:
Schneider Roland
2022-06-11 21:05:19 +02:00
parent 7e5efc2c7f
commit 067fc72ce4
207 changed files with 3803 additions and 130 deletions

View File

@@ -0,0 +1,16 @@
<?php
return [
'components' => [
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => 'cutler_EUDhEYy-Bl-cq02-OZj6Cqm1wtw9jj3U',
],
'session' => [
'name' => '_cutlerBackendSessionId', // unique for backend
'savePath' => __DIR__ . '/../runtime', // a temporary folder on backend
'cookieParams' => [
// 'path' => '/backend/web',
],
],
],
];

View File

@@ -0,0 +1,50 @@
<?php
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
);
return [
'id' => 'app-backend',
'name' => 'Fitness Adminisztráció',
'basePath' => dirname(__DIR__),
'controllerNamespace' => 'backend\controllers',
'bootstrap' => ['log'],
'modules' => [],
'components' => [
'request' => [
'enableCsrfValidation'=>false,
// 'csrfParam' => '_backendCSRF',
// 'csrfCookie' => [
// 'path' => '/backend/web',
// ],
],
'user' => [
'identityClass' => 'common\models\User',
'enableAutoLogin' => true,
'identityCookie' => [
'name' => '_backendUser', // unique for backend
// 'path' => '/backend/web',
]
],
'session' => [
'name' => '_backendSessionId', // unique for backend
'savePath' => __DIR__ . '/../runtime', // a temporary folder on backend
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'errorHandler' => [
'errorAction' => 'site/error',
],
],
'params' => $params,
];

View File

@@ -0,0 +1,4 @@
<?php
return [
'adminEmail' => 'admin@example.com',
];

View File

@@ -0,0 +1,3 @@
<?php
return [
];

View File

@@ -0,0 +1,40 @@
<?php
$DB_HOST=getenv('FITNESS_DB_HOST');
$DB_NAME=getenv('FITNESS_DB_NAME');
$DB_PORT=getenv('FITNESS_DB_PORT');
$DB_USERNAME=getenv('FITNESS_DB_USERNAME');
$DB_PASSWORD=getenv('FITNESS_DB_PASSWORD');
$MAIL_HOST=getenv('FITNESS_MAIL_HOST');
$MAIL_PORT=getenv('FITNESS_MAIL_PORT');
$MAIL_USERNAME=getenv('FITNESS_MAIL_USERNAME');
$MAIL_PASSWORD=getenv('FITNESS_MAIL_PASSWORD');
return [
'components' => [
'db' => [
'class' => 'yii\db\Connection',
// 'dsn' => 'mysql:host=fitnessadmin.hu;dbname=cutler_prod',
'dsn' => "mysql:host=$DB_HOST;dbname=$DB_NAME",
'username' => "$DB_USERNAME",
'password' => "$DB_PASSWORD",
'charset' => 'utf8',
],
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'viewPath' => '@common/mail',
'useFileTransport' =>false,
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => "$MAIL_HOST",
'username' => "$MAIL_USERNAME",
'password' => "$MAIL_PASSWORD",
'port' => "$MAIL_PASSWORD",
],
],
],
];

View File

@@ -0,0 +1,39 @@
<?php
return [
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
// 'language' => 'hu-HU',
'timezone' => 'Europe/Budapest',
'language' => 'hu',
'components' => [
'cache' => [
'class' => 'yii\caching\FileCache',
],
'i18n' => [
'translations' => [
'*' => [
'class' => 'yii\i18n\PhpMessageSource',
'basePath' => '@common/messages',
],
],
],
'formatter' => [
'class' => 'yii\i18n\Formatter',
'dateFormat' => 'yyyy.MM.dd',
'datetimeFormat' => 'yyyy.MM.dd HH:mm',
'timeFormat' => 'HH:mm',
'locale' => 'hu-Hu',
// 'timeZone' => 'Europe/Budapest',
'timeZone' => 'UTC',
// 'defaultTimeZone' => 'UTC',
'nullDisplay' => "-",
],
'authManager' => [
'class' => 'yii\rbac\DbManager'
],
'assetManager' =>[
'appendTimestamp' => true
]
],
];

View File

@@ -0,0 +1,24 @@
<?php
return [
'user.passwordResetTokenExpire' => 3600,
'company' => 'gyor',//gyor
'company_name' => "Cutler Four kft.",
'product_visiblity' => 'global',// on reception which products to dis
'notify_mail' => ['rocho02@gmail.com' ],
'mail_account_state_open' => false,
'login_reception_email' => false, //if reception login should send email
'account_state_close_preload_money' => 'true',//preload money wnen s
'ugiro_duplom_kod' => 1,
'ugiro_kezdemenyezo_szamlaszam' => '1173700723721449',
'ugiro_kezdemenyezo_azonosito' => 'A25006285',
'backend_skin' => 'skin-green',
'user_cart_item_visibility' => 'all',
'user_cart_on' => false,
'product_sale_default_focus' => 'autocomplete',
'ticket_create_price_editable' => false,
'reception_account_state_index_only_today' => true,
'reception_transfer_list_only_today' => true,
'reception_show_stock' => false,
'login_admin_email' => false,
'warn_ticket_expire_in_usage_count' => 10
];

View File

@@ -0,0 +1,68 @@
<?php
return [
'development' => false,
'adminEmail' => 'rocho02@gmail.com',
'supportEmail' => 'rocho02@gmail.com',
'infoEmail' => 'info@rocho-net.hu',
'user.passwordResetTokenExpire' => 3600,
'version' => 'v0.1.25',
'company' => 'movar',//gyor
'company_name' => "Freimann Kft.",
'product_visiblity' => 'account',// on reception which products to display. account or global
'notify_mail' => ['rocho02@gmail.com' ],
/**Kassza nyitáskor küldjünk email-t?*/
'mail_account_state_open' => true,
/**Kassza záráskor küldjünk email-t?*/
'mail_account_state_close' => false,
'login_reception_email' => false, //if reception login should send email
'login_admin_email' => false, //if admin login should send email
'account_state_close_preload_money' => 'true',//preload money wnen show account state close page
'ugiro_duplom_kod' => 1,
'ugiro_kezdemenyezo_szamlaszam' => '000000000000000',//5860025215371128
'ugiro_kezdemenyezo_azonosito' => 'A25006285',//
//a recepicó kosár csak az aktuális user által kiadott termékeket tartalmazza
//vagy mindent
//értékek user|all
// * - user: a felhasználó csak azokat a termékeket látja a kosrába, amiket ő rakott bele
// - all: a felhasználó minden kosrában lévő terméket lát, még azokat is , amiket nem ő rakott bele
'user_cart_item_visibility' => 'user',
/**
* Hány napig láthatják visszamenőleg a recepciósok az adatokat
* */
'reception_visibility_days' => 3,
'reception_account_state_index_only_today' => false,
'reception_transfer_list_only_today' => false,
'reception_show_stock' => true,
'backend_skin' => 'skin-red', //skin-green
/**User cart module on/off*/
'user_cart_on' => true,
/**
* a termék eladás oldalon hol legyen az alaéprtelmezett focus
* a vonalkód mezőn vagy az autocomplete mezőn
barcode | autocomplete */
'product_sale_default_focus' => 'barcode',
/**
* Bérlet eladásnál módosítható e az ár
* */
'ticket_create_price_editable' => true,
'warn_ticket_expire_enabled' => false,
'warn_ticket_expire_days' =>[
[
'day' => 5,
]
],
'newsletter_from' => 'noreply@fitnessadmin.hu',
'newsletter_enabled' => false,
/**
* if true, key in/out events will generate doorlog events
*/
'key_toggle_door_log_enabled' => false,
//if key required for entry trough the door
'key_required' => true,
'ticket_type_door_allowed_check_on' => false,
'warn_ticket_expire_in_days_count' => 3,
'warn_ticket_expire_in_usage_count' => 3,
'inventory.products.only.active' => true
];

View File

@@ -0,0 +1,3 @@
<?php
return [
];

View File

@@ -0,0 +1,25 @@
<?php
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
);
return [
'id' => 'app-console',
'basePath' => dirname(__DIR__),
'bootstrap' => ['log'],
'controllerNamespace' => 'console\controllers',
'components' => [
'log' => [
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning','info'],
],
],
],
],
'params' => $params,
];

View File

@@ -0,0 +1,3 @@
<?php
return [
];

View File

@@ -0,0 +1,4 @@
<?php
return [
'adminEmail' => 'admin@example.com',
];

View File

@@ -0,0 +1,13 @@
<?php
return [
'components' => [
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => 'cutler_UTVb6_cw5UgJ4jukRO3ftYIxGBUfTJJw',
],
'session' => [
'name' => '_cutlerFrontendSessionId', // unique for frontend
'savePath' => __DIR__ . '/../runtime', // a temporary folder on frontend
],
],
];

View File

@@ -0,0 +1,53 @@
<?php
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
);
return [
'id' => 'app-frontend',
'name' =>'Fitness recepció',
'basePath' => dirname(__DIR__),
'bootstrap' => ['log'],
'controllerNamespace' => 'frontend\controllers',
'components' => [
// 'assetsAutoCompress' =>
// [
// 'class' => '\iisns\assets\AssetsCompressComponent',
// 'enabled' => true,
// 'jsCompress' => true,
// 'cssFileCompile' => true,
// 'jsFileCompile' => true,
// ],
'request' => [
'enableCsrfValidation'=>false,
],
'user' => [
'identityClass' => 'common\models\User',
'enableAutoLogin' => true,
'identityCookie' => [
'name' => '_frontendUser', // unique for frontend
'path'=>'/frontend/web' // correct path for the frontend app.
]
],
'session' => [
'name' => '_frontendSessionId', // unique for frontend
'savePath' => __DIR__ . '/../runtime', // a temporary folder on frontend
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'errorHandler' => [
'errorAction' => 'site/error',
],
],
'params' => $params,
];

View File

@@ -0,0 +1,3 @@
<?php
return [
];

View File

@@ -0,0 +1,4 @@
<?php
return [
'adminEmail' => 'admin@example.com',
];

View File

@@ -0,0 +1,22 @@
<?php
$config = [
'components' => [
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => 'cutler_prod_mobileapi_UTVb6_cw5UgJ4jukRO3ftYIxGBUfTJJw',
],
],
];
//if (!YII_ENV_TEST) {
// // configuration adjustments for 'dev' environment
// $config['bootstrap'][] = 'debug';
// $config['modules']['debug'] = 'yii\debug\Module';
//
// $config['bootstrap'][] = 'gii';
// $config['modules']['gii'] = 'yii\gii\Module';
//}
return $config;

View File

@@ -0,0 +1,53 @@
<?php
use mobileapi\components\JwtValidationData;
use sizeg\jwt\Jwt;
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
);
return [
'id' => 'app-mobileapi',
'name' =>'Fitness recepció',
'basePath' => dirname(__DIR__),
'bootstrap' => ['log'],
'controllerNamespace' => 'mobileapi\controllers',
'components' => [
'request' => [
'enableCsrfValidation'=>false,
'csrfParam' => '_csrf-mobileapi',
'parsers' => [
'application/json' => 'yii\web\JsonParser',
]
],
'user' => [
'identityClass' => 'common\models\MobileDevice',
'enableSession' => false,
'enableAutoLogin' => false,
'loginUrl' => null,
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'errorHandler' => [
'errorAction' => 'site/error',
],
'jwt' => [
'class' => Jwt::class,
'key' => 'dianaveronika',
// You have to configure ValidationData informing all claims you want to validate the token.
'jwtValidationData' => JwtValidationData::class,
],
],
'params' => $params,
];

View File

@@ -0,0 +1,3 @@
<?php
return [
];

View File

@@ -0,0 +1,4 @@
<?php
return [
'adminEmail' => 'admin@example.com',
];

View File

@@ -0,0 +1,21 @@
<?php
$config = [
'components' => [
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => 'cutler_prod_rest_UTVb6_cw5UgJ4jukRO3ftYIxGBUfTJJw',
],
],
];
//if (!YII_ENV_TEST) {
// // configuration adjustments for 'dev' environment
// $config['bootstrap'][] = 'debug';
// $config['modules']['debug'] = 'yii\debug\Module';
//
// $config['bootstrap'][] = 'gii';
// $config['modules']['gii'] = 'yii\gii\Module';
//}
return $config;

View File

@@ -0,0 +1,43 @@
<?php
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
);
return [
'id' => 'app-rest',
'name' =>'Fitness recepció',
'basePath' => dirname(__DIR__),
'bootstrap' => ['log'],
'controllerNamespace' => 'rest\controllers',
'components' => [
'request' => [
'enableCsrfValidation'=>false,
'csrfParam' => '_csrf-rest',
'parsers' => [
'application/json' => 'yii\web\JsonParser',
]
],
'user' => [
'identityClass' => 'common\models\User',
'enableSession' => false,
'enableAutoLogin' => false,
'loginUrl' => null,
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'errorHandler' => [
'errorAction' => 'site/error',
],
],
'params' => $params,
];

View File

@@ -0,0 +1,3 @@
<?php
return [
];

View File

@@ -0,0 +1,4 @@
<?php
return [
'adminEmail' => 'admin@example.com',
];