Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b52f4b6919 | |||
| b8e3e2b369 | |||
| 3a86ba5b26 | |||
| b1934e1627 | |||
| 583d936fd2 | |||
| 1076ecbaf2 | |||
| 92894bad44 | |||
| 9916e81dba |
@@ -89,6 +89,7 @@ DB_PASSWORD_11=G0dz!ll42020
|
|||||||
|
|
||||||
CACHE_DRIVER=file
|
CACHE_DRIVER=file
|
||||||
QUEUE_CONNECTION=sync
|
QUEUE_CONNECTION=sync
|
||||||
|
|
||||||
MAX_MUTUEMAS=true
|
MAX_MUTUEMAS=true
|
||||||
|
|
||||||
TENNANT_MASTER_DB=master_erahn
|
TENNANT_MASTER_DB=master_erahn
|
||||||
@@ -97,6 +98,8 @@ TENNANT_KAUNTER_DB=kaunter_erahn
|
|||||||
KAUNTER_URL=http://host.docker.internal:8081
|
KAUNTER_URL=http://host.docker.internal:8081
|
||||||
INTERNAL_NOTIFICATION_SECRET=
|
INTERNAL_NOTIFICATION_SECRET=
|
||||||
|
|
||||||
|
LOGVIEWER_PASSWORD=
|
||||||
|
|
||||||
WHATSAPP_TOKEN= # Paste token from Graph API explorer.
|
WHATSAPP_TOKEN= # Paste token from Graph API explorer.
|
||||||
WHATSAPP_PHONE_NUMBER_ID=1323449077519027
|
WHATSAPP_PHONE_NUMBER_ID=1323449077519027
|
||||||
WHATSAPP_API_VERSION=v25.0
|
WHATSAPP_API_VERSION=v25.0
|
||||||
|
|||||||
+6
-4
@@ -9,6 +9,7 @@ API_ARRAHNBID_ANNUR=https://adminbid-annur.erahn.com.my/api/
|
|||||||
|
|
||||||
LOG_CHANNEL=stack
|
LOG_CHANNEL=stack
|
||||||
LOG_SLACK_WEBHOOK_URL=
|
LOG_SLACK_WEBHOOK_URL=
|
||||||
|
LOGVIEWER_PASSWORD="$2y$10$k7eiUyZdm3BruwAaT1gbmelTm.PPgZptOEQT1nlBjyiR84a4KBMlm"
|
||||||
|
|
||||||
DB_CONNECTION_2=mysql
|
DB_CONNECTION_2=mysql
|
||||||
DB_HOST_2=192.168.1.216
|
DB_HOST_2=192.168.1.216
|
||||||
@@ -77,11 +78,12 @@ TENNANT_KAUNTER_DB=kaunter_erahn
|
|||||||
KAUNTER_URL=https://ujrah.erahn.com.my
|
KAUNTER_URL=https://ujrah.erahn.com.my
|
||||||
INTERNAL_NOTIFICATION_SECRET="nIDTe(u@6[)VLJyd"
|
INTERNAL_NOTIFICATION_SECRET="nIDTe(u@6[)VLJyd"
|
||||||
|
|
||||||
WHATSAPP_TOKEN=EAAZAonT56AO0BSlxZAKa8QX6HIWJpp5Czsz2KQ8BYE4iyZAe5fg8ZAmaSwZCXZCPf44xazDZAhaXLHJKHKUrUZCxei86EWl6Ar3RingfybZAlXp79Yd6WwOG5IZAnu9o5mevm895ygrs39H11G01fpYU2lYRpIWdn6URkTA0kMJdqZAlTaRILTjUM5KhvV05Q4lLAZDZD
|
WHATSAPP_CLOUD_ENABLED=true
|
||||||
WHATSAPP_PHONE_NUMBER_ID=1323449077519027
|
WHATSAPP_TOKEN=EAAZAonT56AO0BSnZAhWLi4UXDRT6iAldbiybxSQZAnGrzIke1QiNWvQkZAbQQTjWeVZC5bL1gEBhW6ff3Shf79nowXiTQEwyxqgZAZB6ZATwFCeTs8MZA5H6ZA76IJBuVqRiAZBvZCfkeSurbUNpEWyi9W7zsT2GWiZCLX8meX0KCfDHu7cp4aBgVu1Ps5ZCRO3bP4ZCQZDZD
|
||||||
|
WHATSAPP_PHONE_NUMBER_ID=1375899418935337
|
||||||
WHATSAPP_API_VERSION=v25.0
|
WHATSAPP_API_VERSION=v25.0
|
||||||
WHATSAPP_TEMPLATE=pembiayaan_online_paid
|
WHATSAPP_TEMPLATE=hebahan_pembiayaan_online
|
||||||
WHATSAPP_TEMPLATE_LANG=ms
|
WHATSAPP_TEMPLATE_LANG=ms
|
||||||
WHATSAPP_VERIFY_TOKEN=418ed86d49422071681c76bed25ae1cb7e90456c794a92f1c9ea417945a35a0a
|
WHATSAPP_VERIFY_TOKEN=418ed86d49422071681c76bed25ae1cb7e90456c794a92f1c9ea417945a35a0a
|
||||||
WHATSAPP_APP_SECRET=
|
WHATSAPP_APP_SECRET=
|
||||||
ADMIN_PHONE_NUMBER=60193450165
|
ADMIN_PHONE_NUMBER=
|
||||||
+26
-12
@@ -4,17 +4,16 @@ APP_KEY=WbPGkYNmXZ6ZQplGlvl0iZ7zyW1b09xa
|
|||||||
APP_DEBUG=true
|
APP_DEBUG=true
|
||||||
APP_URL=http://127.0.0.1:8090
|
APP_URL=http://127.0.0.1:8090
|
||||||
APP_TIMEZONE=Asia/Kuala_Lumpur
|
APP_TIMEZONE=Asia/Kuala_Lumpur
|
||||||
|
API_ARRAHNBID=http://lelong.test/api/
|
||||||
|
API_ARRAHNBID_ANNUR=http://lelong-annur.test/api/
|
||||||
|
|
||||||
# Unique host ports — change these if they collide with other containers on the server.
|
|
||||||
# Host nginx should proxy the staging domain to 127.0.0.1:${HTTP_PORT}
|
|
||||||
HTTP_PORT=8090
|
HTTP_PORT=8090
|
||||||
MYSQL_PUBLISH_PORT=3308
|
MYSQL_PUBLISH_PORT=3308
|
||||||
|
|
||||||
MAX_MUTUEMAS=true
|
|
||||||
|
|
||||||
LOG_CHANNEL=stack
|
LOG_CHANNEL=stack
|
||||||
LOG_LEVEL=debug
|
LOG_LEVEL=debug
|
||||||
LOG_SLACK_WEBHOOK_URL=
|
LOG_SLACK_WEBHOOK_URL=
|
||||||
|
LOGVIEWER_PASSWORD=
|
||||||
|
|
||||||
DB_CONNECTION=mysql
|
DB_CONNECTION=mysql
|
||||||
DB_HOST=mysql
|
DB_HOST=mysql
|
||||||
@@ -72,15 +71,30 @@ DB_DATABASE_6=erahn_test
|
|||||||
DB_USERNAME_6=root
|
DB_USERNAME_6=root
|
||||||
DB_PASSWORD_6=root
|
DB_PASSWORD_6=root
|
||||||
|
|
||||||
# DB_CONNECTION_8=mysql
|
DB_CONNECTION_9=mysql
|
||||||
# DB_HOST_8=mysql
|
DB_HOST_9=mysql
|
||||||
# DB_PORT_8=3306
|
DB_PORT_9=3306
|
||||||
# DB_DATABASE_8=arrahn_klanas
|
DB_DATABASE_9=annur_tampoi
|
||||||
# DB_USERNAME_8=spider
|
DB_USERNAME_9=root
|
||||||
# DB_PASSWORD_8=G0dz!ll42020
|
DB_PASSWORD_9=root
|
||||||
|
|
||||||
|
CACHE_DRIVER=file
|
||||||
|
QUEUE_CONNECTION=sync
|
||||||
|
|
||||||
|
MAX_MUTUEMAS=true
|
||||||
|
|
||||||
TENNANT_MASTER_DB=master_erahn
|
TENNANT_MASTER_DB=master_erahn
|
||||||
TENNANT_KAUNTER_DB=kaunter_erahn
|
TENNANT_KAUNTER_DB=kaunter_erahn
|
||||||
|
|
||||||
CACHE_DRIVER=file
|
KAUNTER_URL=https://staging.erahn.com.my/login
|
||||||
QUEUE_CONNECTION=sync
|
INTERNAL_NOTIFICATION_SECRET=staging_noti_secret
|
||||||
|
|
||||||
|
WHATSAPP_CLOUD_ENABLED=false
|
||||||
|
WHATSAPP_TOKEN=EAAZAonT56AO0BSnZAhWLi4UXDRT6iAldbiybxSQZAnGrzIke1QiNWvQkZAbQQTjWeVZC5bL1gEBhW6ff3Shf79nowXiTQEwyxqgZAZB6ZATwFCeTs8MZA5H6ZA76IJBuVqRiAZBvZCfkeSurbUNpEWyi9W7zsT2GWiZCLX8meX0KCfDHu7cp4aBgVu1Ps5ZCRO3bP4ZCQZDZD
|
||||||
|
WHATSAPP_PHONE_NUMBER_ID=1375899418935337
|
||||||
|
WHATSAPP_API_VERSION=v25.0
|
||||||
|
WHATSAPP_TEMPLATE=hebahan_pembiayaan_online
|
||||||
|
WHATSAPP_TEMPLATE_LANG=ms
|
||||||
|
WHATSAPP_VERIFY_TOKEN=418ed86d49422071681c76bed25ae1cb7e90456c794a92f1c9ea417945a35a0a
|
||||||
|
WHATSAPP_APP_SECRET=
|
||||||
|
ADMIN_PHONE_NUMBER=
|
||||||
@@ -31,11 +31,12 @@ class WhatsappTestSend extends Command
|
|||||||
$bodyParams = [];
|
$bodyParams = [];
|
||||||
|
|
||||||
if (strtolower($template) !== 'hello_world') {
|
if (strtolower($template) !== 'hello_world') {
|
||||||
|
// pembiayaan_online_paid: SAG, amaun, bank, 4 digit akhir, tarikh, rujukan
|
||||||
$bodyParams = [
|
$bodyParams = [
|
||||||
'Tampoi',
|
|
||||||
'TEST-SAG',
|
'TEST-SAG',
|
||||||
'100.00',
|
'100.00',
|
||||||
'Maybank ****1234',
|
'Maybank',
|
||||||
|
'1234',
|
||||||
date('d/m/Y'),
|
date('d/m/Y'),
|
||||||
'TEST-REF',
|
'TEST-REF',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
|
||||||
|
class LogViewerPassword
|
||||||
|
{
|
||||||
|
public function handle($request, Closure $next)
|
||||||
|
{
|
||||||
|
$passwordHash = config('logviewer.password');
|
||||||
|
|
||||||
|
if (!is_string($passwordHash) || $passwordHash === '') {
|
||||||
|
return response('Akses log belum dikonfigurasi.', 503)
|
||||||
|
->header('Cache-Control', 'no-store');
|
||||||
|
}
|
||||||
|
|
||||||
|
$provided = $request->getPassword();
|
||||||
|
if ($request->getUser() !== 'logviewer' || !is_string($provided) ||
|
||||||
|
!password_verify($provided, $passwordHash)) {
|
||||||
|
return response('Kata laluan diperlukan untuk mengakses log.', 401, [
|
||||||
|
'WWW-Authenticate' => 'Basic realm="Log Viewer", charset="UTF-8"',
|
||||||
|
'Cache-Control' => 'no-store',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$response = $next($request);
|
||||||
|
$response->headers->set('Cache-Control', 'no-store');
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -54,10 +54,10 @@ class WhatsappPembiayaanOnlinePaid extends Job
|
|||||||
$storedPhone = $customer ? ($customer->telefon ?: $customer->telefon2) : null;
|
$storedPhone = $customer ? ($customer->telefon ?: $customer->telefon2) : null;
|
||||||
$to = $client->normalizeMsisdn($storedPhone);
|
$to = $client->normalizeMsisdn($storedPhone);
|
||||||
|
|
||||||
if (env('APP_ENV') !== 'production') {
|
if (!config('whatsapp.whatsapp_cloud_enabled')) {
|
||||||
$admin = $client->normalizeMsisdn(env('ADMIN_PHONE_NUMBER'));
|
$admin = $client->normalizeMsisdn(env('ADMIN_PHONE_NUMBER'));
|
||||||
if (!$admin) {
|
if (!$admin) {
|
||||||
Log::warning('WhatsApp Cloud skipped: ADMIN_PHONE_NUMBER required when not production', [
|
Log::warning('WhatsApp Cloud skipped: ADMIN_PHONE_NUMBER required when WHATSAPP_ENABLED is false', [
|
||||||
'norujukan' => $this->norujukan,
|
'norujukan' => $this->norujukan,
|
||||||
]);
|
]);
|
||||||
$this->logBlast($now, $storedPhone, 'skipped: ADMIN_PHONE_NUMBER empty');
|
$this->logBlast($now, $storedPhone, 'skipped: ADMIN_PHONE_NUMBER empty');
|
||||||
@@ -96,27 +96,29 @@ class WhatsappPembiayaanOnlinePaid extends Job
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Matches pembiayaan_online_paid body: cawangan, SAG, amaun, akaun, tarikh, rujukan.
|
* Matches Meta template pembiayaan_online_paid (ms):
|
||||||
|
* AR-RAHN KoPKB: Pembiayaan bagi No. SAG *{{1}}* sebanyak *RM{{2}}*
|
||||||
|
* telah berjaya dikreditkan ke akaun *{{3}}* berakhir *{{4}}* pada *{{5}}*.
|
||||||
|
* Rujukan: *{{6}}*
|
||||||
|
*
|
||||||
|
* {{1}} SAG, {{2}} amaun, {{3}} nama bank/akaun, {{4}} 4 digit akhir, {{5}} tarikh, {{6}} rujukan bayaran
|
||||||
*
|
*
|
||||||
* @return array<int,string>
|
* @return array<int,string>
|
||||||
*/
|
*/
|
||||||
protected function bodyParams()
|
protected function bodyParams()
|
||||||
{
|
{
|
||||||
$akaun = trim((string) $this->namaBank);
|
$bank = trim((string) $this->namaBank);
|
||||||
$tail = $this->accountTail($this->noakaun);
|
$tail = $this->accountTail($this->noakaun);
|
||||||
if ($tail !== '') {
|
|
||||||
$akaun = trim($akaun . ' ' . $tail);
|
|
||||||
}
|
|
||||||
|
|
||||||
$tarikh = $this->tarikhBayaran
|
$tarikh = $this->tarikhBayaran
|
||||||
? Carbon::parse($this->tarikhBayaran)->format('d/m/Y')
|
? Carbon::parse($this->tarikhBayaran)->format('d/m/Y')
|
||||||
: Carbon::now()->format('d/m/Y');
|
: Carbon::now()->format('d/m/Y');
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$this->cawName ?: $this->kodcaw,
|
|
||||||
$this->norujukan ?: '-',
|
$this->norujukan ?: '-',
|
||||||
number_format((float) $this->pinjaman, 2, '.', ''),
|
number_format((float) $this->pinjaman, 2, '.', ''),
|
||||||
$akaun !== '' ? $akaun : '-',
|
$bank !== '' ? $bank : '-',
|
||||||
|
$tail !== '' ? $tail : '-',
|
||||||
$tarikh,
|
$tarikh,
|
||||||
$this->noRujukanBayaran ?: '-',
|
$this->noRujukanBayaran ?: '-',
|
||||||
];
|
];
|
||||||
@@ -129,7 +131,7 @@ class WhatsappPembiayaanOnlinePaid extends Job
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return '****' . substr($digits, -4);
|
return substr($digits, -4);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function logBlast($now, $telefon, $status)
|
protected function logBlast($now, $telefon, $status)
|
||||||
|
|||||||
@@ -1992,7 +1992,7 @@ class PembiayaanOnlineService
|
|||||||
'slot' => 'BATCH2',
|
'slot' => 'BATCH2',
|
||||||
'label' => 'Batch 2',
|
'label' => 'Batch 2',
|
||||||
'mula' => '11:00',
|
'mula' => '11:00',
|
||||||
'cutoff' => '16:30',
|
'cutoff' => '15:00',
|
||||||
'proses' => '16:30',
|
'proses' => '16:30',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
+4
-3
@@ -88,6 +88,7 @@ $app->singleton(
|
|||||||
|
|
||||||
$app->configure('app');
|
$app->configure('app');
|
||||||
$app->configure('logging');
|
$app->configure('logging');
|
||||||
|
$app->configure('logviewer');
|
||||||
$app->configure('tinker');
|
$app->configure('tinker');
|
||||||
$app->configure('tennant_database');
|
$app->configure('tennant_database');
|
||||||
$app->configure('report');
|
$app->configure('report');
|
||||||
@@ -110,9 +111,9 @@ $app->configure('kaunter');
|
|||||||
// App\Http\Middleware\ExampleMiddleware::class
|
// App\Http\Middleware\ExampleMiddleware::class
|
||||||
// ]);
|
// ]);
|
||||||
|
|
||||||
// $app->routeMiddleware([
|
$app->routeMiddleware([
|
||||||
// 'auth' => App\Http\Middleware\Authenticate::class,
|
'logviewer.password' => App\Http\Middleware\LogViewerPassword::class,
|
||||||
// ]);
|
]);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'password' => env('LOGVIEWER_PASSWORD'),
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Pattern and storage path settings
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| The env key for pattern and storage path with a default value
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'max_file_size' => 52428800, // size in Byte
|
||||||
|
'pattern' => env('LOGVIEWER_PATTERN', '*.log'),
|
||||||
|
'storage_path' => env('LOGVIEWER_STORAGE_PATH', storage_path('logs')),
|
||||||
|
];
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
'whatsapp_cloud_enabled' => env('WHATSAPP_CLOUD_ENABLED', true),
|
||||||
'token' => env('WHATSAPP_TOKEN'),
|
'token' => env('WHATSAPP_TOKEN'),
|
||||||
'phone_number_id' => env('WHATSAPP_PHONE_NUMBER_ID'),
|
'phone_number_id' => env('WHATSAPP_PHONE_NUMBER_ID'),
|
||||||
'api_version' => env('WHATSAPP_API_VERSION', 'v25.0'),
|
'api_version' => env('WHATSAPP_API_VERSION', 'v25.0'),
|
||||||
|
|||||||
+4
-1
@@ -25,7 +25,10 @@ $router->get('/health', function () {
|
|||||||
return response()->json(['status' => 'ok']);
|
return response()->json(['status' => 'ok']);
|
||||||
});
|
});
|
||||||
|
|
||||||
$router->group(['namespace' => '\Rap2hpoutre\LaravelLogViewer'], function() use ($router) {
|
$router->group([
|
||||||
|
'namespace' => '\Rap2hpoutre\LaravelLogViewer',
|
||||||
|
'middleware' => 'logviewer.password',
|
||||||
|
], function () use ($router) {
|
||||||
$router->get('logs', 'LogViewerController@index');
|
$router->get('logs', 'LogViewerController@index');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user