diff --git a/.env b/.env index 65e8a5b..6e807ae 100644 --- a/.env +++ b/.env @@ -1,6 +1,7 @@ CONTAINER_PORT=9088 UID=1000 CI_ENV=development +CI_ENVIRONMENT=development API_ENDPOINT="https://apigate.lotus.g1.wrenchboard.com" # $arr["host"] = "10.10.10.23"; # $arr["name"] = "wrenchboard"; diff --git a/.env.development b/.env.development index 65e8a5b..6e807ae 100644 --- a/.env.development +++ b/.env.development @@ -1,6 +1,7 @@ CONTAINER_PORT=9088 UID=1000 CI_ENV=development +CI_ENVIRONMENT=development API_ENDPOINT="https://apigate.lotus.g1.wrenchboard.com" # $arr["host"] = "10.10.10.23"; # $arr["name"] = "wrenchboard"; diff --git a/.env.production b/.env.production index 977fe8b..c847bc0 100644 --- a/.env.production +++ b/.env.production @@ -1,6 +1,7 @@ CONTAINER_PORT=9088 UID=1000 -CI_ENV=development +CI_ENV=production +CI_ENVIRONMENT=production API_ENDPOINT="https://apigate.orion.g1.wrenchboard.com" # $arr["host"] = "10.10.10.23"; # $arr["name"] = "wrenchboard"; diff --git a/.env.testing b/.env.testing new file mode 100644 index 0000000..2e66471 --- /dev/null +++ b/.env.testing @@ -0,0 +1,81 @@ +CONTAINER_PORT=9088 +UID=1000 +CI_ENV=testing +CI_ENVIRONMENT=testing +API_ENDPOINT="https://apigate.lotus.g1.wrenchboard.com" +# $arr["host"] = "10.10.10.23"; +# $arr["name"] = "wrenchboard"; +# $arr["user"] = "wrenchboard"; +# $arr["pass"] = "wrenchboard"; +# $arr["port"] = 5432; + + +#-------------------------------------------------------------------- +# 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 = '' +# If you have trouble with `.`, you could also use `_`. +# app_baseURL = '' +# app.forceGlobalSecureRequests = false +# app.CSPEnabled = false + +#-------------------------------------------------------------------- +# DATABASE +#-------------------------------------------------------------------- + +# database.default.hostname = localhost +# database.default.database = ci4 +# database.default.username = root +# database.default.password = root +# 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 + +#-------------------------------------------------------------------- +# LOGGER +#-------------------------------------------------------------------- + +# logger.threshold = 4 diff --git a/.gitignore b/.gitignore index 4bca513..38128f4 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,133 @@ apache_log apache_log/* apache_log* +#------------------------- +# Operating Specific Junk Files +#------------------------- + +# OS X +.DS_Store +.AppleDouble +.LSOverride + +# OS X Thumbnails +._* + +# Windows image file caches +Thumbs.db +ehthumbs.db +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# Linux +*~ + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +#------------------------- +# Environment Files +#------------------------- +# These should never be under version control, +# as it poses a security risk. +.env +.vagrant +Vagrantfile + +#------------------------- +# Temporary Files +#------------------------- +writable/cache/* +!writable/cache/index.html + +writable/logs/* +!writable/logs/index.html + +writable/session/* +!writable/session/index.html + +writable/uploads/* +!writable/uploads/index.html + +writable/debugbar/* +!writable/debugbar/index.html + +writable/**/*.db +writable/**/*.sqlite + +php_errors.log + +#------------------------- +# User Guide Temp Files +#------------------------- +user_guide_src/build/* + +#------------------------- +# Test Files +#------------------------- +tests/coverage* + +# Don't save phpunit under version control. +phpunit + +#------------------------- +# Composer +#------------------------- +vendor/ +composer.lock + +#------------------------- +# IDE / Development Files +#------------------------- + +# Modules Testing +_modules/* + +# phpenv local config +.php-version + +# Jetbrains editors (PHPStorm, etc) +.idea/ +*.iml + +# Netbeans +nbproject/ +build/ +nbbuild/ +dist/ +nbdist/ +nbactions.xml +nb-configuration.xml +.nb-gradle/ + +# Sublime Text +*.tmlanguage.cache +*.tmPreferences.cache +*.stTheme.cache +*.sublime-workspace +*.sublime-project +.phpintel +/api/ + +# Visual Studio Code +.vscode/ + +/results/ +/phpunit*.xml + +/.php-cs-fixer.php + diff --git a/apache_log/other_vhosts_access.log b/apache_log/.placeholder similarity index 100% rename from apache_log/other_vhosts_access.log rename to apache_log/.placeholder diff --git a/apache_log/error.log b/apache_log/error.log deleted file mode 100644 index 3a0335a..0000000 --- a/apache_log/error.log +++ /dev/null @@ -1,2 +0,0 @@ -[Sun Sep 15 20:09:10.537221 2024] [mpm_prefork:notice] [pid 1:tid 1] AH00163: Apache/2.4.62 (Debian) PHP/8.1.29 configured -- resuming normal operations -[Sun Sep 15 20:09:10.537923 2024] [core:notice] [pid 1:tid 1] AH00094: Command line: 'apache2 -D FOREGROUND' diff --git a/app/Config/Boot/development.php b/app/Config/Boot/development.php index a868447..9b16ef4 100644 --- a/app/Config/Boot/development.php +++ b/app/Config/Boot/development.php @@ -32,3 +32,5 @@ defined('SHOW_DEBUG_BACKTRACE') || define('SHOW_DEBUG_BACKTRACE', true); | items. It can always be used within your own application too. */ defined('CI_DEBUG') || define('CI_DEBUG', true); + +define ('API_ENDPOINT',"https://apigate.lotus.g1.wrenchboard.com"); diff --git a/app/Config/Boot/production.php b/app/Config/Boot/production.php index 1822cf5..58cd216 100644 --- a/app/Config/Boot/production.php +++ b/app/Config/Boot/production.php @@ -23,3 +23,5 @@ ini_set('display_errors', '0'); | release of the framework. */ defined('CI_DEBUG') || define('CI_DEBUG', false); + +define ('API_ENDPOINT',"https://apigate.orion.g1.wrenchboard.com"); diff --git a/app/Config/Boot/testing.php b/app/Config/Boot/testing.php index 40b6ca8..a9bde7b 100644 --- a/app/Config/Boot/testing.php +++ b/app/Config/Boot/testing.php @@ -36,3 +36,5 @@ defined('SHOW_DEBUG_BACKTRACE') || define('SHOW_DEBUG_BACKTRACE', true); | release of the framework. */ defined('CI_DEBUG') || define('CI_DEBUG', true); + +define ('API_ENDPOINT',"https://apigate.lotus.g1.wrenchboard.com"); diff --git a/app/Controllers/BaseController.php b/app/Controllers/BaseController.php index 22c0a0f..b0edb36 100644 --- a/app/Controllers/BaseController.php +++ b/app/Controllers/BaseController.php @@ -104,6 +104,6 @@ abstract class BaseController extends Controller } public function wrenchApiServer():string{ - return getenv("API_ENDPOINT")."/en/promo/api/v1/"; + return API_ENDPOINT."/en/promo/api/v1/"; } } diff --git a/docker-compose.yml b/docker-compose.yml index 3e1e7cf..0cdfa98 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,6 +12,8 @@ services: - APACHE_RUN_GROUP=#${UID} #- CI_ENV - CI_CONFIG + - CI_ENVIRONMENT=${CI_ENVIRONMENT:-development} + env_file: ${ENV_FILE:-.env.development} restart: unless-stopped volumes: - ./:/var/www/html