From 233f502d15c0e4cb755df444dfedea74567eb3ea Mon Sep 17 00:00:00 2001 From: owrainfo Date: Tue, 9 Dec 2025 08:35:50 +0000 Subject: [PATCH 01/17] Update app/Config/App.php --- app/Config/App.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Config/App.php b/app/Config/App.php index 81a3822..b4c64a6 100644 --- a/app/Config/App.php +++ b/app/Config/App.php @@ -16,7 +16,7 @@ class App extends BaseConfig * * E.g., http://example.com/ */ - public string $baseURL = 'http://localhost:8800/'; + public string $baseURL = 'http://test2-admin.confirms.co.kr'; /** * Allowed Hostnames in the Site URL other than the hostname in the baseURL. From 28d7592b20da7a90492b08499cf81fd9738caaf0 Mon Sep 17 00:00:00 2001 From: jjstyle Date: Tue, 9 Dec 2025 19:43:57 +0900 Subject: [PATCH 02/17] =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index ca09863..138371b 100644 --- a/.gitignore +++ b/.gitignore @@ -66,6 +66,13 @@ writable/uploads/* writable/debugbar/* !writable/debugbar/index.html +# Ignore writable but keep directory structure +!/writable/logs/.gitkeep +!/writable/cache/.gitkeep +!/writable/session/.gitkeep +!/writable/debugbar/.gitkeep +!/writable/uploads/.gitkeep + php_errors.log #------------------------- From 8948631454e28fc1fb6e953389f645a3090ad1f1 Mon Sep 17 00:00:00 2001 From: jjstyle Date: Mon, 15 Dec 2025 14:30:22 +0900 Subject: [PATCH 03/17] =?UTF-8?q?worker=20=EC=99=80=20=EB=9D=BC=EC=9A=B0?= =?UTF-8?q?=ED=84=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Commands/NaverWorker.php | 50 ++++++++++++++++++++++++++++++ app/Config/Routes.php | 13 ++++++++ app/Config/Routes/Api.php | 10 ++++++ app/Controllers/KisoController.php | 29 +++++++++++++++++ 4 files changed, 102 insertions(+) create mode 100644 app/Commands/NaverWorker.php create mode 100644 app/Config/Routes/Api.php create mode 100644 app/Controllers/KisoController.php diff --git a/app/Commands/NaverWorker.php b/app/Commands/NaverWorker.php new file mode 100644 index 0000000..7f2490b --- /dev/null +++ b/app/Commands/NaverWorker.php @@ -0,0 +1,50 @@ +connect('redis', 6379); + + CLI::write('Worker started...'); + + while (true) { + // 큐에서 데이터 꺼내기 (blocking pop) + $item = $redis->brPop(['naver:queue'], 5); + if ($item) { + $payload = json_decode($item[1], true); + $this->process($payload); + } + } + } + + private function process($payload) + { + $articleNum = $payload['articleNumbr']; + $requestType = $payload['reqeustType']; + + if (in_array($requestType, ['REG','MOD'])) { + $client = \Config\Services::curlrequest(); + $url = "https://네이버CP/kiso/center/verification-article/{$articleNum}"; + + try { + $response = $client->get($url); + CLI::write("Processed {$requestType} for {$articleNum}: " . $response->getStatusCode()); + } catch (\Exception $e) { + CLI::error("Error processing {$articleNum}: " . $e->getMessage()); + } + } else { + CLI::write("Skipping {$requestType} for {$articleNum}"); + } + } +} diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 61fdffd..57cc04a 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -62,3 +62,16 @@ $routes->post('/manage/dupl_phone/savePhone', 'Manage\Phone::savePhone'); // 전 $routes->get('/manage/loginlog/getLogList', 'Manage\LoginLog::getLogList'); // 로그 목록 조회 $routes->get('/manage/loginlog/excel', 'Manage\LoginLog::excel'); // 엑셀다운로드 + + +/* + * -------------------------------------------------------------------- + * Additional Routing + * -------------------------------------------------------------------- + * + * 이 영역에서 다른 라우트 파일을 로드할 수 있습니다. + */ + +if (is_file($filepath = APPPATH . 'Config/Routes/Api.php')) { + require $filepath; +} \ No newline at end of file diff --git a/app/Config/Routes/Api.php b/app/Config/Routes/Api.php new file mode 100644 index 0000000..bac8a3d --- /dev/null +++ b/app/Config/Routes/Api.php @@ -0,0 +1,10 @@ +group('kiso', function(RouteCollection $routes) { + $routes->get('api/vrfcReq', 'KisoController::vrfcReq'); +}); \ No newline at end of file diff --git a/app/Controllers/KisoController.php b/app/Controllers/KisoController.php new file mode 100644 index 0000000..71d1ffb --- /dev/null +++ b/app/Controllers/KisoController.php @@ -0,0 +1,29 @@ +request->getJSON(true); + + $articleNum = $data['articleNumbr'] ?? null; + $requestType = $data['reqeustType'] ?? null; + + if (!$articleNum || !$requestType) { + return $this->response->setStatusCode(ResponseInterface::HTTP_BAD_REQUEST) + ->setJSON(['error' => 'Invalid request']); + } + + // Redis 연결 + $redis = new \Redis(); + $redis->connect('redis', 6379); + + // 큐에 push + $redis->lPush('naver:queue', json_encode($data)); + + return $this->response->setJSON(['status' => 'queued']); + } +} From c129af9a9be84afc1368b61a93b1dba5248dfd56 Mon Sep 17 00:00:00 2001 From: jjstyle Date: Mon, 15 Dec 2025 14:58:27 +0900 Subject: [PATCH 04/17] Resolve merge conflict in Routes.php --- app/Config/Routes.php | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index def2da6..15f60b7 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -70,23 +70,6 @@ $routes->group('manage', ['namespace' => 'App\Controllers\Manage'], function ($r $routes->get('user/excel', 'User::excel'); $routes->post('user/saveSms', 'User::saveSms'); -<<<<<<< HEAD -$routes->get('/manage/loginlog/getLogList', 'Manage\LoginLog::getLogList'); // 로그 목록 조회 -$routes->get('/manage/loginlog/excel', 'Manage\LoginLog::excel'); // 엑셀다운로드 - - -/* - * -------------------------------------------------------------------- - * Additional Routing - * -------------------------------------------------------------------- - * - * 이 영역에서 다른 라우트 파일을 로드할 수 있습니다. - */ - -if (is_file($filepath = APPPATH . 'Config/Routes/Api.php')) { - require $filepath; -} -======= /** API - 조직관리 */ $routes->get('dept/getDeptList', 'Dept::getDeptList'); $routes->get('dept/getUserList', 'Dept::getUserList'); @@ -127,4 +110,3 @@ if (is_file($filepath = APPPATH . 'Config/Routes/Api.php')) { * 로그인 API */ $routes->post('/login/chkLogin', 'Login::chkLogin'); ->>>>>>> feature/template From b5c12928eba80568f68543870bf446e207002345 Mon Sep 17 00:00:00 2001 From: jjstyle Date: Mon, 15 Dec 2025 14:59:42 +0900 Subject: [PATCH 05/17] Add additional routing configuration --- app/Config/Routes.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 15f60b7..5b9c28d 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -110,3 +110,16 @@ $routes->group('manage', ['namespace' => 'App\Controllers\Manage'], function ($r * 로그인 API */ $routes->post('/login/chkLogin', 'Login::chkLogin'); + + +/* + * -------------------------------------------------------------------- + * Additional Routing + * -------------------------------------------------------------------- + * + * 이 영역에서 다른 라우트 파일을 로드할 수 있습니다. + */ + +if (is_file($filepath = APPPATH . 'Config/Routes/Api.php')) { + require $filepath; +} From 843c763afe0afd2eaf4ec1183bb5858a34a5c4a7 Mon Sep 17 00:00:00 2001 From: jjstyle Date: Tue, 16 Dec 2025 16:13:17 +0900 Subject: [PATCH 06/17] =?UTF-8?q?=EB=84=A4=EC=9D=B4=EB=B2=84=20=EB=A7=A4?= =?UTF-8?q?=EB=AC=BC=20=EC=A0=95=EB=B3=B4=EB=B0=9B=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Commands/NaverWorker.php | 93 ++++++++++++++++++++++++------ app/Config/Cache.php | 28 ++++++--- app/Config/Routes/Api.php | 2 +- app/Controllers/KisoController.php | 83 +++++++++++++++++++++----- 4 files changed, 164 insertions(+), 42 deletions(-) diff --git a/app/Commands/NaverWorker.php b/app/Commands/NaverWorker.php index 7f2490b..d5a56ea 100644 --- a/app/Commands/NaverWorker.php +++ b/app/Commands/NaverWorker.php @@ -9,42 +9,99 @@ class NaverWorker extends BaseCommand { protected $group = 'Workers'; protected $name = 'naver:worker'; - protected $description = 'Process Naver verification requests from Redis queue'; + protected $description = 'Process Naver verification requests from Redis queue with retry logic.'; + + // 최대 재시도 횟수 정의 + private const MAX_RETRIES = 3; + private const RETRY_DELAY = 60; // 초 단위 (60초 지연 후 재시도) public function run(array $params) { $redis = new \Redis(); - $redis->connect('redis', 6379); + // 환경 변수를 사용하도록 변경 (php_worker service의 env 설정 활용) + $redisHost = getenv('REDIS_HOST') ?: 'redis'; + $redisPort = getenv('REDIS_PORT') ?: 6379; + + $redis->connect($redisHost, $redisPort); - CLI::write('Worker started...'); + CLI::write('Worker started. Listening on naver:queue...'); while (true) { - // 큐에서 데이터 꺼내기 (blocking pop) - $item = $redis->brPop(['naver:queue'], 5); + // 메인 큐 및 재시도 큐에서 데이터 꺼내기 (Blocking Pop, 5초 타임아웃) + // LIFO (lPush/brPop) 사용 시: ['naver:queue:retry', 'naver:queue'] + $item = $redis->brPop(['naver:queue'], 5); + if ($item) { $payload = json_decode($item[1], true); - $this->process($payload); + $this->process($redis, $payload); // Redis 객체를 process에 전달 } } } - private function process($payload) + private function process(\Redis $redis, $payload) { $articleNum = $payload['articleNumbr']; $requestType = $payload['reqeustType']; + $retryCount = $payload['retry_count'] ?? 0; + + CLI::write("Processing {$requestType} for {$articleNum} (Attempt: " . ($retryCount + 1) . ")"); - if (in_array($requestType, ['REG','MOD'])) { - $client = \Config\Services::curlrequest(); - $url = "https://네이버CP/kiso/center/verification-article/{$articleNum}"; + if (!in_array($requestType, ['REG', 'MOD'])) { + CLI::write("Skipping non-verification request {$requestType} for {$articleNum}"); + return; + } - try { - $response = $client->get($url); - CLI::write("Processed {$requestType} for {$articleNum}: " . $response->getStatusCode()); - } catch (\Exception $e) { - CLI::error("Error processing {$articleNum}: " . $e->getMessage()); + // 1. 네이버 CP API 호출 + $client = \Config\Services::curlrequest([ + 'timeout' => 10, + // ... (인증 헤더 설정 등 이전 답변의 보안 관련 항목 추가) + ]); + $url = "https://네이버CP/kiso/center/verification-article/{$articleNum}"; + + try { + $response = $client->get($url); + $statusCode = $response->getStatusCode(); + + if ($statusCode >= 200 && $statusCode < 300) { + // 2. 성공 처리 + CLI::write("✅ SUCCESS: {$requestType} for {$articleNum} (Status: {$statusCode})"); + // 성공 시 DB에 결과 업데이트 등 후속 작업 진행 + } else { + // 3. API 실패 (4xx, 5xx 에러) + $this->handleFailure($redis, $payload, $retryCount, "API returned Status: {$statusCode}"); } - } else { - CLI::write("Skipping {$requestType} for {$articleNum}"); + } catch (\Exception $e) { + // 4. 네트워크/타임아웃 오류 + $this->handleFailure($redis, $payload, $retryCount, "Network Error: " . $e->getMessage()); } } -} + + private function handleFailure(\Redis $redis, $payload, $retryCount, $reason) + { + $articleNum = $payload['articleNumbr']; + + if ($retryCount < self::MAX_RETRIES) { + // 5. 재시도 로직: 재시도 횟수 증가 및 큐에 다시 푸시 + $payload['retry_count'] = $retryCount + 1; + + // 지연된 재시도를 위해 Sorted Set (ZADD) 또는 별도의 큐 사용을 고려할 수 있으나, + // 여기서는 단순성을 위해 즉시 재시도 큐에 넣고 sleep을 사용하는 방식을 가정합니다. + // **주의: 실제 프로덕션 환경에서는 `Redis ZSET`을 사용하여 지연된 작업을 처리하는 것이 더 일반적입니다.** + + // 단순 재시도 큐 (ZSET을 사용하지 않는 경우) + $redis->lPush('naver:queue:retry', json_encode($payload)); + + // CLI 환경에서 재시도 간 지연 시간을 강제 (Blocking pop을 쓰므로 실제 지연은 다음 worker 실행 시 발생) + CLI::error("Attempt {$retryCount} FAILED for {$articleNum}. Reason: {$reason}. Retrying later."); + + } else { + // 6. 최종 실패 처리: DLQ로 이동 + $payload['fail_reason'] = $reason; + $payload['fail_time'] = date('Y-m-d H:i:s'); + + $redis->lPush('naver:queue:dlq', json_encode($payload)); + + CLI::error("❌ CRITICAL FAIL: {$articleNum} moved to DLQ after " . self::MAX_RETRIES . " attempts."); + } + } +} \ No newline at end of file diff --git a/app/Config/Cache.php b/app/Config/Cache.php index 1169c95..1b9c141 100644 --- a/app/Config/Cache.php +++ b/app/Config/Cache.php @@ -21,7 +21,7 @@ class Cache extends BaseConfig * The name of the preferred handler that should be used. If for some reason * it is not available, the $backupHandler will be used in its place. */ - public string $handler = 'file'; + public string $handler = 'redis'; /** * -------------------------------------------------------------------------- @@ -114,13 +114,7 @@ class Cache extends BaseConfig * * @var array{host?: string, password?: string|null, port?: int, timeout?: int, database?: int} */ - public array $redis = [ - 'host' => '127.0.0.1', - 'password' => null, - 'port' => 6379, - 'timeout' => 0, - 'database' => 0, - ]; + public array $redis = []; /** * -------------------------------------------------------------------------- @@ -159,4 +153,22 @@ class Cache extends BaseConfig * @var bool|list */ public $cacheQueryString = false; + + + public function __construct() + { + parent::__construct(); + + // Redis 설정에 .env 값을 할당 (이전 논의된 Docker 호스트 이름 'redis' 사용) + $this->redis = [ + 'host' => env('redis.default.host', '127.0.0.1'), + 'password' => env('redis.default.password', null), + 'port' => (int)env('redis.default.port', 6379), + 'timeout' => (int)env('redis.default.timeout', 0), + 'database' => (int)env('redis.default.database', 0) + ]; + + // 필요하다면, 이 생성자에서 $handler나 $backupHandler 같은 다른 설정도 + // 환경 변수에 따라 동적으로 설정할 수 있습니다. + } } diff --git a/app/Config/Routes/Api.php b/app/Config/Routes/Api.php index bac8a3d..9961c47 100644 --- a/app/Config/Routes/Api.php +++ b/app/Config/Routes/Api.php @@ -6,5 +6,5 @@ use CodeIgniter\Router\RouteCollection; /** @var RouteCollection $routes */ $routes->group('kiso', function(RouteCollection $routes) { - $routes->get('api/vrfcReq', 'KisoController::vrfcReq'); + $routes->match(['get', 'post'], 'api/vrfcReq', 'KisoController::vrfcReq'); }); \ No newline at end of file diff --git a/app/Controllers/KisoController.php b/app/Controllers/KisoController.php index 71d1ffb..331d7ed 100644 --- a/app/Controllers/KisoController.php +++ b/app/Controllers/KisoController.php @@ -2,28 +2,81 @@ namespace App\Controllers; use CodeIgniter\HTTP\ResponseInterface; +use CodeIgniter\HTTP\RequestInterface; +use CodeIgniter\HTTP\Response; class KisoController extends BaseController { + /** @var RequestInterface */ + protected $request; + + /** @var ResponseInterface */ + protected $response; + public function vrfcReq() { - $data = $this->request->getJSON(true); - - $articleNum = $data['articleNumbr'] ?? null; - $requestType = $data['reqeustType'] ?? null; - - if (!$articleNum || !$requestType) { - return $this->response->setStatusCode(ResponseInterface::HTTP_BAD_REQUEST) - ->setJSON(['error' => 'Invalid request']); + // 1. 요청 방식에 따라 데이터 파싱 + if ($this->request->getMethod() === 'post') { + // POST 방식: JSON Body에서 데이터 가져오기 + $data = $this->request->getJSON(true); + } elseif ($this->request->getMethod() === 'get') { + // GET 방식: Query Parameter에서 데이터 가져오기 + $data = $this->request->getGet(); + } else { + // 지원하지 않는 메소드 처리 (예: PUT, DELETE 등) + return $this->response->setStatusCode(Response::HTTP_METHOD_NOT_ALLOWED) + ->setJSON(['resultCode' => 'E005', 'resultMessage' => 'Method not allowed. Use GET or POST.']); } - // Redis 연결 - $redis = new \Redis(); - $redis->connect('redis', 6379); + // 2. 필수 항목 검증 + $requiredKeys = ['articleNumbr', 'reqeustType', 'requestDatetime']; - // 큐에 push - $redis->lPush('naver:queue', json_encode($data)); + foreach ($requiredKeys as $key) { + // 파싱된 데이터($data) 내에 키가 없거나 값이 비어있는지 확인 + if (empty($data[$key])) { + return $this->response->setStatusCode(Response::HTTP_BAD_REQUEST) + ->setJSON([ + 'resultCode' => 'E001', + 'resultMessage' => "Missing required parameter: {$key}" + ]); + } + } + + // 3. Redis 연결 및 예외 처리 + try { + // CI4 Cache Service 인스턴스를 가져옴. 기본 핸들러가 Redis여야 함. + // (또는 Services::cache('redis')를 사용해 RedisHandler를 명시적으로 요청) + $redis = \Config\Services::cache(); - return $this->response->setJSON(['status' => 'queued']); + // Redis 핸들러가 맞는지 확인 (선택 사항) + if (!($redis->getHandler() instanceof RedisHandler)) { + throw new \Exception('Cache handler is not Redis. Check Config/Cache.php $handler setting.'); + } + // 요청에 재시도 횟수 초기화 + $data['retry_count'] = 0; + + // RedisHandler의 getClient()를 사용하여 원본 \Redis 객체를 가져옵니다. + // 주의: 모든 RedisHandler가 getClient()를 제공하는 것은 아니지만, CI4 내장 RedisHandler는 제공합니다. + $client = $redis->getHandler()->getClient(); + + // 큐에 push + $client->lPush('naver:queue', json_encode($data)); + + } catch (\Exception $e) { + log_message('error', 'Redis connection failed: ' . $e->getMessage()); + return $this->response->setStatusCode(Response::HTTP_INTERNAL_SERVER_ERROR) + ->setJSON([ + 'resultCode' => 'E999', + 'resultMessage' => 'Internal server error (Queue system unavailable)' + ]); + } + + // 4. 성공 응답 + return $this->response->setStatusCode(Response::HTTP_ACCEPTED) // 202 Accepted + ->setJSON([ + 'resultCode' => 'S000', + 'resultMessage' => 'Request successfully queued for processing', + 'articleNumbr' => $data['articleNumbr'] + ]); } -} +} \ No newline at end of file From d631384e6bd4bc7ce7d58982e746066027311c76 Mon Sep 17 00:00:00 2001 From: jjstyle Date: Tue, 16 Dec 2025 21:14:33 +0900 Subject: [PATCH 07/17] gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2bdba66..012508e 100644 --- a/.gitignore +++ b/.gitignore @@ -51,7 +51,7 @@ Dockerfile #------------------------- # CI ignore #------------------------- -app/Config/App.php +#app/Config/App.php #------------------------- # Temporary Files From 12a10a12108e9eae2ae6ed407547285c882c1b08 Mon Sep 17 00:00:00 2001 From: jjstyle Date: Tue, 16 Dec 2025 21:20:01 +0900 Subject: [PATCH 08/17] =?UTF-8?q?app.php=20=EB=90=98=EC=82=B4=EB=A6=AC?= =?UTF-8?q?=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Config/App.php | 202 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 app/Config/App.php diff --git a/app/Config/App.php b/app/Config/App.php new file mode 100644 index 0000000..b4c64a6 --- /dev/null +++ b/app/Config/App.php @@ -0,0 +1,202 @@ + + */ + public array $allowedHostnames = []; + + /** + * -------------------------------------------------------------------------- + * Index File + * -------------------------------------------------------------------------- + * + * Typically, this will be your `index.php` file, unless you've renamed it to + * something else. If you have configured your web server to remove this file + * from your site URIs, set this variable to an empty string. + */ + public string $indexPage = ''; + + /** + * -------------------------------------------------------------------------- + * URI PROTOCOL + * -------------------------------------------------------------------------- + * + * This item determines which server global should be used to retrieve the + * URI string. The default setting of 'REQUEST_URI' works for most servers. + * If your links do not seem to work, try one of the other delicious flavors: + * + * 'REQUEST_URI': Uses $_SERVER['REQUEST_URI'] + * 'QUERY_STRING': Uses $_SERVER['QUERY_STRING'] + * 'PATH_INFO': Uses $_SERVER['PATH_INFO'] + * + * WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded! + */ + public string $uriProtocol = 'REQUEST_URI'; + + /* + |-------------------------------------------------------------------------- + | Allowed URL Characters + |-------------------------------------------------------------------------- + | + | This lets you specify which characters are permitted within your URLs. + | When someone tries to submit a URL with disallowed characters they will + | get a warning message. + | + | As a security measure you are STRONGLY encouraged to restrict URLs to + | as few characters as possible. + | + | By default, only these are allowed: `a-z 0-9~%.:_-` + | + | Set an empty string to allow all characters -- but only if you are insane. + | + | The configured value is actually a regular expression character group + | and it will be used as: '/\A[]+\z/iu' + | + | DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!! + | + */ + public string $permittedURIChars = 'a-z 0-9~%.:_\-'; + + /** + * -------------------------------------------------------------------------- + * Default Locale + * -------------------------------------------------------------------------- + * + * The Locale roughly represents the language and location that your visitor + * is viewing the site from. It affects the language strings and other + * strings (like currency markers, numbers, etc), that your program + * should run under for this request. + */ + public string $defaultLocale = 'en'; + + /** + * -------------------------------------------------------------------------- + * Negotiate Locale + * -------------------------------------------------------------------------- + * + * If true, the current Request object will automatically determine the + * language to use based on the value of the Accept-Language header. + * + * If false, no automatic detection will be performed. + */ + public bool $negotiateLocale = false; + + /** + * -------------------------------------------------------------------------- + * Supported Locales + * -------------------------------------------------------------------------- + * + * If $negotiateLocale is true, this array lists the locales supported + * by the application in descending order of priority. If no match is + * found, the first locale will be used. + * + * IncomingRequest::setLocale() also uses this list. + * + * @var list + */ + public array $supportedLocales = ['en']; + + /** + * -------------------------------------------------------------------------- + * Application Timezone + * -------------------------------------------------------------------------- + * + * The default timezone that will be used in your application to display + * dates with the date helper, and can be retrieved through app_timezone() + * + * @see https://www.php.net/manual/en/timezones.php for list of timezones + * supported by PHP. + */ + public string $appTimezone = 'UTC'; + + /** + * -------------------------------------------------------------------------- + * Default Character Set + * -------------------------------------------------------------------------- + * + * This determines which character set is used by default in various methods + * that require a character set to be provided. + * + * @see http://php.net/htmlspecialchars for a list of supported charsets. + */ + public string $charset = 'UTF-8'; + + /** + * -------------------------------------------------------------------------- + * Force Global Secure Requests + * -------------------------------------------------------------------------- + * + * If true, this will force every request made to this application to be + * made via a secure connection (HTTPS). If the incoming request is not + * secure, the user will be redirected to a secure version of the page + * and the HTTP Strict Transport Security (HSTS) header will be set. + */ + public bool $forceGlobalSecureRequests = false; + + /** + * -------------------------------------------------------------------------- + * Reverse Proxy IPs + * -------------------------------------------------------------------------- + * + * If your server is behind a reverse proxy, you must whitelist the proxy + * IP addresses from which CodeIgniter should trust headers such as + * X-Forwarded-For or Client-IP in order to properly identify + * the visitor's IP address. + * + * You need to set a proxy IP address or IP address with subnets and + * the HTTP header for the client IP address. + * + * Here are some examples: + * [ + * '10.0.1.200' => 'X-Forwarded-For', + * '192.168.5.0/24' => 'X-Real-IP', + * ] + * + * @var array + */ + public array $proxyIPs = []; + + /** + * -------------------------------------------------------------------------- + * Content Security Policy + * -------------------------------------------------------------------------- + * + * Enables the Response's Content Secure Policy to restrict the sources that + * can be used for images, scripts, CSS files, audio, video, etc. If enabled, + * the Response object will populate default values for the policy from the + * `ContentSecurityPolicy.php` file. Controllers can always add to those + * restrictions at run time. + * + * For a better understanding of CSP, see these documents: + * + * @see http://www.html5rocks.com/en/tutorials/security/content-security-policy/ + * @see http://www.w3.org/TR/CSP/ + */ + public bool $CSPEnabled = false; +} From d70b756308ca625fafba48d46087eb5ae41bba9a Mon Sep 17 00:00:00 2001 From: jjstyle Date: Wed, 17 Dec 2025 11:15:12 +0900 Subject: [PATCH 09/17] =?UTF-8?q?=EB=82=B4=EC=9A=A9=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 012508e..f75e3ac 100644 --- a/.gitignore +++ b/.gitignore @@ -142,4 +142,31 @@ _modules/* .history/ -.README \ No newline at end of file +.README + +# 1. 민감한 환경 설정 파일 (필수) +# 실제 환경 변수 값이 담긴 파일은 Git에 절대 포함하지 않습니다. +/.env + +# 2. Composer 종속성 (필수) +# CI/CD에서 'composer install'로 재설치합니다. +/vendor/ + +# 3. CI4가 생성하는 런타임 파일 (필수) +# 캐시, 로그, 세션 등은 서버에서 생성 및 관리되어야 합니다. +/writable/cache/* +/writable/logs/* +/writable/session/* + +# 4. IDE 및 OS 생성 파일 +# 개발 환경에서만 필요한 파일 (Windows/MacOS/Linux 등) +.idea/ +.vscode/ +*.swp +.DS_Store + +# 5. 빌드 및 테스트 부산물 (선택적) +# 특정 IDE나 빌드 도구가 생성하는 파일은 추가합니다. +/build/ +/dist/ +/node_modules/ \ No newline at end of file From 178c2a79a7116bea3c9e62cff6ad46ed731cf1ef Mon Sep 17 00:00:00 2001 From: jjstyle Date: Wed, 17 Dec 2025 15:01:26 +0900 Subject: [PATCH 10/17] =?UTF-8?q?=EB=82=B4=EC=9A=A9=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f75e3ac..410e34b 100644 --- a/.gitignore +++ b/.gitignore @@ -146,7 +146,7 @@ _modules/* # 1. 민감한 환경 설정 파일 (필수) # 실제 환경 변수 값이 담긴 파일은 Git에 절대 포함하지 않습니다. -/.env +#/.env # 2. Composer 종속성 (필수) # CI/CD에서 'composer install'로 재설치합니다. From eadc19ccc734530559ee6c3fced7d296f23964ec Mon Sep 17 00:00:00 2001 From: jjstyle Date: Wed, 17 Dec 2025 15:10:04 +0900 Subject: [PATCH 11/17] =?UTF-8?q?env=20=EC=82=AC=EC=9A=A9=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Config/Database.php | 48 ++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/app/Config/Database.php b/app/Config/Database.php index 1ebbb03..36a74c3 100644 --- a/app/Config/Database.php +++ b/app/Config/Database.php @@ -25,30 +25,30 @@ class Database extends Config * @var array */ public array $default = [ - 'DSN' => '', - 'hostname' => '192.168.10.246', - 'username' => 'confirms', - 'password' => 'zjsvjatm', - 'database' => 'db_confirms', - 'DBDriver' => 'MySQLi', - 'DBPrefix' => '', - 'pConnect' => false, - 'DBDebug' => true, - 'charset' => 'utf8mb4', - 'DBCollat' => 'utf8mb4_general_ci', - 'swapPre' => '', - 'encrypt' => false, - 'compress' => false, - 'strictOn' => false, - 'failover' => [], - 'port' => 3306, - 'numberNative' => false, - 'foundRows' => false, - 'dateFormat' => [ - 'date' => 'Y-m-d', - 'datetime' => 'Y-m-d H:i:s', - 'time' => 'H:i:s', - ], + // 'DSN' => '', + // 'hostname' => '192.168.10.246', + // 'username' => 'confirms', + // 'password' => 'zjsvjatm', + // 'database' => 'db_confirms', + // 'DBDriver' => 'MySQLi', + // 'DBPrefix' => '', + // 'pConnect' => false, + // 'DBDebug' => true, + // 'charset' => 'utf8mb4', + // 'DBCollat' => 'utf8mb4_general_ci', + // 'swapPre' => '', + // 'encrypt' => false, + // 'compress' => false, + // 'strictOn' => false, + // 'failover' => [], + // 'port' => 3306, + // 'numberNative' => false, + // 'foundRows' => false, + // 'dateFormat' => [ + // 'date' => 'Y-m-d', + // 'datetime' => 'Y-m-d H:i:s', + // 'time' => 'H:i:s', + // ], ]; // /** From 362346f0d6a20f2da3221d48a1551d672f194133 Mon Sep 17 00:00:00 2001 From: jjstyle Date: Wed, 17 Dec 2025 15:12:27 +0900 Subject: [PATCH 12/17] =?UTF-8?q?env=20=EC=82=AC=EC=9A=A9=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Config/Database.php | 48 ++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/app/Config/Database.php b/app/Config/Database.php index 36a74c3..1c7f952 100644 --- a/app/Config/Database.php +++ b/app/Config/Database.php @@ -25,30 +25,30 @@ class Database extends Config * @var array */ public array $default = [ - // 'DSN' => '', - // 'hostname' => '192.168.10.246', - // 'username' => 'confirms', - // 'password' => 'zjsvjatm', - // 'database' => 'db_confirms', - // 'DBDriver' => 'MySQLi', - // 'DBPrefix' => '', - // 'pConnect' => false, - // 'DBDebug' => true, - // 'charset' => 'utf8mb4', - // 'DBCollat' => 'utf8mb4_general_ci', - // 'swapPre' => '', - // 'encrypt' => false, - // 'compress' => false, - // 'strictOn' => false, - // 'failover' => [], - // 'port' => 3306, - // 'numberNative' => false, - // 'foundRows' => false, - // 'dateFormat' => [ - // 'date' => 'Y-m-d', - // 'datetime' => 'Y-m-d H:i:s', - // 'time' => 'H:i:s', - // ], + 'DSN' => '', + 'hostname' => 'localhost', + 'username' => '', + 'password' => '', + 'database' => '', + 'DBDriver' => 'MySQLi', + 'DBPrefix' => '', + 'pConnect' => false, + 'DBDebug' => true, + 'charset' => 'utf8mb4', + 'DBCollat' => 'utf8mb4_general_ci', + 'swapPre' => '', + 'encrypt' => false, + 'compress' => false, + 'strictOn' => false, + 'failover' => [], + 'port' => 3306, + 'numberNative' => false, + 'foundRows' => false, + 'dateFormat' => [ + 'date' => 'Y-m-d', + 'datetime' => 'Y-m-d H:i:s', + 'time' => 'H:i:s', + ], ]; // /** From 7deb85c2b45d559963666aca683a618f70d876a3 Mon Sep 17 00:00:00 2001 From: jjstyle Date: Wed, 17 Dec 2025 15:15:04 +0900 Subject: [PATCH 13/17] =?UTF-8?q?env=20=EC=82=AC=EC=9A=A9=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Config/Database.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Config/Database.php b/app/Config/Database.php index 1c7f952..41c2417 100644 --- a/app/Config/Database.php +++ b/app/Config/Database.php @@ -26,7 +26,7 @@ class Database extends Config */ public array $default = [ 'DSN' => '', - 'hostname' => 'localhost', + 'hostname' => '192.168.10.246', 'username' => '', 'password' => '', 'database' => '', From 5b83c3032793d673b6a9e3cf478a6cc6f93c353d Mon Sep 17 00:00:00 2001 From: jjstyle Date: Wed, 17 Dec 2025 15:20:03 +0900 Subject: [PATCH 14/17] =?UTF-8?q?env=20=EC=82=AC=EC=9A=A9=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 0000000..ab46ae0 --- /dev/null +++ b/.env @@ -0,0 +1,64 @@ +#-------------------------------------------------------------------- +# Example Environment Configuration file +# +# This file can be used as a starting point for your own +# custom .env files, and contains most of the possible settings +# available in a default install. +# +# By default, all of the settings are commented out. If you want +# to override the setting, you must un-comment it by removing the '#' +# at the beginning of the line. +#-------------------------------------------------------------------- +#-------------------------------------------------------------------- +# ENVIRONMENT +#-------------------------------------------------------------------- +# CI_ENVIRONMENT = production +#-------------------------------------------------------------------- +# APP +#-------------------------------------------------------------------- +app.baseURL = 'http://test2.admin.confirms.co.kr/' +# If you have trouble with `.`, you could also use `_`. +# app_baseURL = '' +# app.forceGlobalSecureRequests = false +# app.CSPEnabled = false +#-------------------------------------------------------------------- +# DATABASE +#-------------------------------------------------------------------- +database.default.hostname = 192.168.10.246 +database.default.database = db_confirms +database.default.username = confirms +database.default.password = zjsvjatm +database.default.DBDriver = MySQLi +database.default.DBPrefix = +database.default.port = 3306 +# If you use MySQLi as tests, first update the values of Config\Database::$tests. +# database.tests.hostname = localhost +# database.tests.database = ci4_test +# database.tests.username = root +# database.tests.password = root +# database.tests.DBDriver = MySQLi +# database.tests.DBPrefix = +# database.tests.charset = utf8mb4 +# database.tests.DBCollat = utf8mb4_general_ci +# database.tests.port = 3306 +#-------------------------------------------------------------------- +# ENCRYPTION +#-------------------------------------------------------------------- +# encryption.key = +#-------------------------------------------------------------------- +# SESSION +#-------------------------------------------------------------------- +# session.driver = 'CodeIgniter\Session\Handlers\FileHandler' +# session.savePath = null +#-------------------------------------------------------------------- +# Redis +#-------------------------------------------------------------------- +redis.default.host = redis +redis.default.port = 6379 +redis.default.password = +redis.default.database = 10 +redis.default.timeout = 0 +#-------------------------------------------------------------------- +# LOGGER +#-------------------------------------------------------------------- +# logger.threshold = 4 \ No newline at end of file From 465a82093eaeafcefbbc748470d1a9025ae74b32 Mon Sep 17 00:00:00 2001 From: jjstyle Date: Fri, 19 Dec 2025 15:41:37 +0900 Subject: [PATCH 15/17] =?UTF-8?q?API=20=EA=B4=80=EB=A0=A8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 4 ++- app/Commands/NaverWorker.php | 2 +- app/Config/Filters.php | 5 +++- app/Controllers/KisoController.php | 44 ++++++++++++++---------------- app/Filters/JavascriptInjector.php | 39 ++++++++++++++++++++++++++ app/Views/layouts/footer.php | 20 ++++++++++++++ public/common/js/de.js | 43 +++++++++++++++++++++++++++++ 7 files changed, 131 insertions(+), 26 deletions(-) create mode 100644 app/Filters/JavascriptInjector.php create mode 100644 public/common/js/de.js diff --git a/.env b/.env index ab46ae0..f01722d 100644 --- a/.env +++ b/.env @@ -12,11 +12,13 @@ #-------------------------------------------------------------------- # ENVIRONMENT #-------------------------------------------------------------------- +APP_SERVER_NAME = "TEST-SERVER-01" +CI_ENVIRONMENT = development # CI_ENVIRONMENT = production #-------------------------------------------------------------------- # APP #-------------------------------------------------------------------- -app.baseURL = 'http://test2.admin.confirms.co.kr/' +app.baseURL = 'http://test2-admin.confirms.co.kr/' # If you have trouble with `.`, you could also use `_`. # app_baseURL = '' # app.forceGlobalSecureRequests = false diff --git a/app/Commands/NaverWorker.php b/app/Commands/NaverWorker.php index d5a56ea..580e25b 100644 --- a/app/Commands/NaverWorker.php +++ b/app/Commands/NaverWorker.php @@ -29,7 +29,7 @@ class NaverWorker extends BaseCommand while (true) { // 메인 큐 및 재시도 큐에서 데이터 꺼내기 (Blocking Pop, 5초 타임아웃) // LIFO (lPush/brPop) 사용 시: ['naver:queue:retry', 'naver:queue'] - $item = $redis->brPop(['naver:queue'], 5); + $item = $redis->brPop(['naver:worker_queue'], 5); if ($item) { $payload = json_decode($item[1], true); diff --git a/app/Config/Filters.php b/app/Config/Filters.php index 2d029f6..cca04dc 100644 --- a/app/Config/Filters.php +++ b/app/Config/Filters.php @@ -35,6 +35,7 @@ class Filters extends BaseFilters 'pagecache' => PageCache::class, 'performance' => PerformanceMetrics::class, 'auth' => \App\Filters\AuthCheck::class, + 'jsInjector' => \App\Filters\JavascriptInjector::class, ]; /** @@ -84,13 +85,15 @@ class Filters extends BaseFilters 'index.php/login/*', // /index.php/login/* 'register', // 회원가입 등 'register/*', - 'api/*', // 필요하면 API는 예외 + 'kiso/*', // 필요하면 API는 예외 ], ], ], 'after' => [ // 'honeypot', // 'secureheaders', + 'jsInjector', // 모든 페이지 응답 후에 실행 + 'toolbar', ], ]; diff --git a/app/Controllers/KisoController.php b/app/Controllers/KisoController.php index 331d7ed..d7af24a 100644 --- a/app/Controllers/KisoController.php +++ b/app/Controllers/KisoController.php @@ -16,10 +16,10 @@ class KisoController extends BaseController public function vrfcReq() { // 1. 요청 방식에 따라 데이터 파싱 - if ($this->request->getMethod() === 'post') { + if ( $this->request->is('post') ) { // POST 방식: JSON Body에서 데이터 가져오기 $data = $this->request->getJSON(true); - } elseif ($this->request->getMethod() === 'get') { + } else if ( $this->request->is('get') ) { // GET 방식: Query Parameter에서 데이터 가져오기 $data = $this->request->getGet(); } else { @@ -29,7 +29,7 @@ class KisoController extends BaseController } // 2. 필수 항목 검증 - $requiredKeys = ['articleNumbr', 'reqeustType', 'requestDatetime']; + $requiredKeys = ['articleNumber', 'requestType', 'requestDatetime']; foreach ($requiredKeys as $key) { // 파싱된 데이터($data) 내에 키가 없거나 값이 비어있는지 확인 @@ -43,32 +43,30 @@ class KisoController extends BaseController } // 3. Redis 연결 및 예외 처리 + // 3. Redis 연결 및 직접 푸시 try { - // CI4 Cache Service 인스턴스를 가져옴. 기본 핸들러가 Redis여야 함. - // (또는 Services::cache('redis')를 사용해 RedisHandler를 명시적으로 요청) - $redis = \Config\Services::cache(); + $redis = new \Redis(); + // Docker 환경이므로 host를 'redis'로 설정 + $success = $redis->connect('redis', 6379); - // Redis 핸들러가 맞는지 확인 (선택 사항) - if (!($redis->getHandler() instanceof RedisHandler)) { - throw new \Exception('Cache handler is not Redis. Check Config/Cache.php $handler setting.'); + if (!$success) { + throw new \Exception('Redis connection failed'); } - // 요청에 재시도 횟수 초기화 + + $redis->select(10); // 10번 DB 선택 + + // 데이터 준비 $data['retry_count'] = 0; - // RedisHandler의 getClient()를 사용하여 원본 \Redis 객체를 가져옵니다. - // 주의: 모든 RedisHandler가 getClient()를 제공하는 것은 아니지만, CI4 내장 RedisHandler는 제공합니다. - $client = $redis->getHandler()->getClient(); - - // 큐에 push - $client->lPush('naver:queue', json_encode($data)); + // 리스트에 데이터 삽입 (이 명령어가 실행되어야 monitor에 LPUSH가 뜹니다) + $redis->lPush('naver:queue', json_encode($data)); } catch (\Exception $e) { - log_message('error', 'Redis connection failed: ' . $e->getMessage()); - return $this->response->setStatusCode(Response::HTTP_INTERNAL_SERVER_ERROR) - ->setJSON([ - 'resultCode' => 'E999', - 'resultMessage' => 'Internal server error (Queue system unavailable)' - ]); + log_message('error', 'Redis Push Error: ' . $e->getMessage()); + return $this->response->setStatusCode(500)->setJSON([ + 'resultCode' => 'E999', + 'resultMessage' => 'Redis Connection Error' + ]); } // 4. 성공 응답 @@ -76,7 +74,7 @@ class KisoController extends BaseController ->setJSON([ 'resultCode' => 'S000', 'resultMessage' => 'Request successfully queued for processing', - 'articleNumbr' => $data['articleNumbr'] + 'articleNumber' => $data['articleNumber'] ]); } } \ No newline at end of file diff --git a/app/Filters/JavascriptInjector.php b/app/Filters/JavascriptInjector.php new file mode 100644 index 0000000..fee49ff --- /dev/null +++ b/app/Filters/JavascriptInjector.php @@ -0,0 +1,39 @@ +getHeaderLine('Content-Type'), 'text/html') === false) return; + + // .env에서 서버 이름 가져오기 (없으면 'Unknown' 또는 컨테이너ID) + $serverAlias = env('APP_SERVER_NAME') ?? gethostname(); + $envMode = ENVIRONMENT; + + $scriptTag = " + + "; + + $body = $response->getBody(); + if (strpos($body, '') !== false) { + $response->setBody(str_replace('', $scriptTag . '', $body)); + } + } +} \ No newline at end of file diff --git a/app/Views/layouts/footer.php b/app/Views/layouts/footer.php index f273d1d..0d87401 100644 --- a/app/Views/layouts/footer.php +++ b/app/Views/layouts/footer.php @@ -34,4 +34,24 @@ --> + + + + + \ No newline at end of file diff --git a/public/common/js/de.js b/public/common/js/de.js new file mode 100644 index 0000000..450533e --- /dev/null +++ b/public/common/js/de.js @@ -0,0 +1,43 @@ +(function() { + // 1. 환경 데이터 가져오기 (없으면 기본값 production) + const info = window.SERVER_INFO || { alias: 'UNKNOWN', env: 'production' }; + + // 2. 운영 환경이면 실행 중단 (표시 안 함) + if (info.env === 'production') { + return; + } + + // 3. 테스트/로컬 환경일 때 스타일 설정 (강렬한 빨간색) + const bgColor = '#dc3545'; // 경고 의미의 빨간색 + const textColor = '#ffffff'; + const borderColor = '#a71d2a'; // 더 어두운 빨간색 테두리 + + // 4. 상태바 생성 및 스타일 적용 + const statusDiv = document.createElement('div'); + Object.assign(statusDiv.style, { + position: 'fixed', + bottom: '0', + left: '0', + width: '100%', + height: '32px', + backgroundColor: bgColor, + color: textColor, + textAlign: 'center', + fontSize: '14px', + lineHeight: '32px', + fontWeight: '900', + zIndex: '2147483647', // 최상단 레이어 보장 + opacity: '1', + pointerEvents: 'none', // 클릭 방해 금지 + boxShadow: '0 -4px 15px rgba(0,0,0,0.4)', + borderTop: `3px solid ${borderColor}`, + letterSpacing: '0.5px', + fontFamily: 'system-ui, -apple-system, sans-serif' + }); + + // 5. 출력 문구 (서버 이름 강조) + statusDiv.innerHTML = `⚠️ [TEST SERVER] NAME: ${info.alias} | HOST: ${window.location.hostname} ⚠️`; + + // 6. 문서에 추가 + document.body.appendChild(statusDiv); +})(); \ No newline at end of file From ef4ae0b5f2ce9c2e25d24db7b6e373f2f8b59e63 Mon Sep 17 00:00:00 2001 From: jjstyle Date: Mon, 22 Dec 2025 13:45:11 +0900 Subject: [PATCH 16/17] Conflict fixed --- .env | 7 ++++++- .gitignore | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.env b/.env index f01722d..7f1d62a 100644 --- a/.env +++ b/.env @@ -12,7 +12,7 @@ #-------------------------------------------------------------------- # ENVIRONMENT #-------------------------------------------------------------------- -APP_SERVER_NAME = "TEST-SERVER-01" +APP_SERVER_NAME = "DEV-LOCAL-01" CI_ENVIRONMENT = development # CI_ENVIRONMENT = production #-------------------------------------------------------------------- @@ -23,6 +23,8 @@ app.baseURL = 'http://test2-admin.confirms.co.kr/' # app_baseURL = '' # app.forceGlobalSecureRequests = false # app.CSPEnabled = false +app.forceGlobalSecureRequests = false +app.appTimezone = 'Asia/Seoul' #-------------------------------------------------------------------- # DATABASE #-------------------------------------------------------------------- @@ -33,6 +35,9 @@ database.default.password = zjsvjatm database.default.DBDriver = MySQLi database.default.DBPrefix = database.default.port = 3306 +database.default.timezone = '+09:00' +database.tests.charset = utf8mb4 +database.tests.DBCollat = utf8mb4_general_ci # If you use MySQLi as tests, first update the values of Config\Database::$tests. # database.tests.hostname = localhost # database.tests.database = ci4_test diff --git a/.gitignore b/.gitignore index 410e34b..8162bd2 100644 --- a/.gitignore +++ b/.gitignore @@ -169,4 +169,5 @@ _modules/* # 특정 IDE나 빌드 도구가 생성하는 파일은 추가합니다. /build/ /dist/ -/node_modules/ \ No newline at end of file +/node_modules/ +.env From cba5e3b86ecd5f5730d939fa7a1f8d7be876ea6e Mon Sep 17 00:00:00 2001 From: jjstyle Date: Mon, 22 Dec 2025 13:47:19 +0900 Subject: [PATCH 17/17] Stop tracking .env file --- .env | 71 ------------------------------------------------------------ 1 file changed, 71 deletions(-) delete mode 100644 .env diff --git a/.env b/.env deleted file mode 100644 index 7f1d62a..0000000 --- a/.env +++ /dev/null @@ -1,71 +0,0 @@ -#-------------------------------------------------------------------- -# Example Environment Configuration file -# -# This file can be used as a starting point for your own -# custom .env files, and contains most of the possible settings -# available in a default install. -# -# By default, all of the settings are commented out. If you want -# to override the setting, you must un-comment it by removing the '#' -# at the beginning of the line. -#-------------------------------------------------------------------- -#-------------------------------------------------------------------- -# ENVIRONMENT -#-------------------------------------------------------------------- -APP_SERVER_NAME = "DEV-LOCAL-01" -CI_ENVIRONMENT = development -# CI_ENVIRONMENT = production -#-------------------------------------------------------------------- -# APP -#-------------------------------------------------------------------- -app.baseURL = 'http://test2-admin.confirms.co.kr/' -# If you have trouble with `.`, you could also use `_`. -# app_baseURL = '' -# app.forceGlobalSecureRequests = false -# app.CSPEnabled = false -app.forceGlobalSecureRequests = false -app.appTimezone = 'Asia/Seoul' -#-------------------------------------------------------------------- -# DATABASE -#-------------------------------------------------------------------- -database.default.hostname = 192.168.10.246 -database.default.database = db_confirms -database.default.username = confirms -database.default.password = zjsvjatm -database.default.DBDriver = MySQLi -database.default.DBPrefix = -database.default.port = 3306 -database.default.timezone = '+09:00' -database.tests.charset = utf8mb4 -database.tests.DBCollat = utf8mb4_general_ci -# If you use MySQLi as tests, first update the values of Config\Database::$tests. -# database.tests.hostname = localhost -# database.tests.database = ci4_test -# database.tests.username = root -# database.tests.password = root -# database.tests.DBDriver = MySQLi -# database.tests.DBPrefix = -# database.tests.charset = utf8mb4 -# database.tests.DBCollat = utf8mb4_general_ci -# database.tests.port = 3306 -#-------------------------------------------------------------------- -# ENCRYPTION -#-------------------------------------------------------------------- -# encryption.key = -#-------------------------------------------------------------------- -# SESSION -#-------------------------------------------------------------------- -# session.driver = 'CodeIgniter\Session\Handlers\FileHandler' -# session.savePath = null -#-------------------------------------------------------------------- -# Redis -#-------------------------------------------------------------------- -redis.default.host = redis -redis.default.port = 6379 -redis.default.password = -redis.default.database = 10 -redis.default.timeout = 0 -#-------------------------------------------------------------------- -# LOGGER -#-------------------------------------------------------------------- -# logger.threshold = 4 \ No newline at end of file