From dbb284b1d00596bf320fccbd25b2910f2c9fb116 Mon Sep 17 00:00:00 2001 From: Madalin Ignisca Date: Mon, 23 Aug 2021 11:41:08 +0200 Subject: [PATCH] Refactor --- .devcontainer/devcontainer.json | 21 ------ docker-compose.yml | 127 ++------------------------------ xhgui/config/config.default.php | 68 ----------------- xhgui/mongo.init.d/xhgui.js | 5 -- xhgui/nginx.conf | 21 ------ 5 files changed, 8 insertions(+), 234 deletions(-) delete mode 100644 xhgui/config/config.default.php delete mode 100644 xhgui/mongo.init.d/xhgui.js delete mode 100644 xhgui/nginx.conf diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index c41f108..3fc244c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -76,36 +76,15 @@ "args": ["-l"] } }, - "todohighlight.isEnable": true, - "todohighlight.include": [ - "**/*.js", - "**/*.jsx", - "**/*.ts", - "**/*.tsx", - "**/*.html", - "**/*.php", - "**/*.css", - "**/*.sass", - "**/*.scss", - "**/*.vue" - ], }, "extensions": [ - "CoenraadS.bracket-pair-colorizer", "EditorConfig.EditorConfig", "bmewburn.vscode-intelephense-client", - "calebporzio.better-phpunit", "dbaeumer.vscode-eslint", - "eamodio.gitlens", "esbenp.prettier-vscode", "felixfbecker.php-debug", - "formulahendry.auto-close-tag", - "formulahendry.auto-rename-tag", "octref.vetur", - "redhat.vscode-yaml", "stylelint.vscode-stylelint", - "visualstudioexptteam.vscodeintellicode", - "wayou.vscode-todo-highlight" ], "remoteUser": "developer" } diff --git a/docker-compose.yml b/docker-compose.yml index 59d8d55..5092a43 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,7 +13,7 @@ services: mem_limit: 4000000000 mem_swappiness: 0 - # mariadb: + # maria: # image: mariadb:10 # environment: # - MYSQL_ROOT_PASSWORD=root @@ -21,45 +21,15 @@ services: # - MYSQL_USER=developer # - MYSQL_PASSWORD=developer # volumes: - # - mysql:/var/lib/mysql + # - mariadb:/var/lib/mysql # ports: # - "${FORWARD_DB_PORT:-3306}:3306" # cpu_count: 1 # mem_limit: 1000000000 # mem_swappiness: 0 - # mysql: - # image: mysql:8 - # environment: - # - MYSQL_ROOT_PASSWORD=root - # - MYSQL_DATABASE=developer - # - MYSQL_USER=developer - # - MYSQL_PASSWORD=developer - # volumes: - # - mysql:/var/lib/mysql - # ports: - # - "${FORWARD_DB_PORT:-3306}:3306" - # cpu_count: 1 - # mem_limit: 1000000000 - # mem_swappiness: 0 - - # postgres: - # image: postgres:13 - # environment: - # - POSTGRES_PASSWORD=developer - # - POSTGRES_USER=developer - # - POSTGRES_DB=developer - # - PGDATA=/var/lib/postgresql/data/pgdata - # ports: - # - "${FORWARD_DB_PORT:-5432}:5432" - # volumes: - # - postgres:/var/lib/postgresql/data - # cpu_count: 1 - # mem_limit: 1000000000 - # mem_swappiness: 0 - # This is Postgresql with Postgis preenabled - # postgis: + # postgres: # image: postgis/postgis:13-3.1-alpine # environment: # - POSTGRES_PASSWORD=developer @@ -74,22 +44,8 @@ services: # mem_limit: 1000000000 # mem_swappiness: 0 - # mongo: - # image: mongo:4 - # environment: - # - MONGO_INITDB_ROOT_USERNAME=root - # - MONGO_INITDB_ROOT_PASSWORD=root - # - MONGO_INITDB_DATABASE=developer - # ports: - # - "${FORWARD_MONGO_PORT:-27017}:27017" - # volumes: - # - mongo:/data/db - # cpu_count: 1 - # mem_limit: 1000000000 - # mem_swappiness: 0 - # elasticsearch: - # image: elasticsearch:7.12.1 + # image: elasticsearch:7.14.0 # environment: # - discovery.type=single-node # ports: @@ -97,24 +53,9 @@ services: # volumes: # - elasticsearch:/usr/share/elasticsearch/data # cpu_count: 1 - # mem_limit: 1000000000 + # mem_limit: 2000000000 # mem_swappiness: 0 - # kibana: - # image: kibana:7.12.1 - # environment: - # - ELASTICSEARCH_HOSTS=http://elasticsearch:9200 - # ports: - # - "${FORWARD_KIBANA_PORT:-5601}:5601 - # cpu_count: 1 - # mem_limit: 1000000000 - # mem_swappiness: 0 - - # rabbitmq: - # image: rabbitmq:3-management-alpine - # ports: - # - "${FORWARD_RABBITMQ_PORT:-15672}:15672 - # redis: # image: redis:6-alpine # volumes: @@ -124,12 +65,6 @@ services: # mem_limit: 500000000 # mem_swappiness: 0 - # memcached: - # image: memcached:1-alpine - # cpu_count: 1 - # mem_limit: 500000000 - # mem_swappiness: 0 - # mailhog: # image: mailhog/mailhog # ports: @@ -138,65 +73,19 @@ services: # mem_limit: 500000000 # mem_swappiness: 0 - # minio: - # image: minio/minio - # environment: - # - MINIO_ACCESS_KEY=minio - # - MINIO_SECRET_KEY=minio123 - # command: minio server /data - # ports: - # - "${FORWARD_MINIO_PORT:-9000}:9000" - # volumes: - # - minio:/data - # healthcheck: - # test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] - # interval: 30s - # timeout: 20s - # retries: 3 - # cpu_count: 1 - # mem_limit: 1000000000 - # mem_swappiness: 0 - # adminer: # image: adminer # environment: - # - ADMINER_DEFAULT_SERVER=mariadb + # - ADMINER_DEFAULT_SERVER=maria # ports: # - "${FORWARD_ADMINER_PORT:-8080}:8080" # cpu_count: 1 # mem_limit: 500000000 # mem_swappiness: 0 - # xhgui: - # image: xhgui/xhgui:0.18.1 - # volumes: - # - ./xhgui/config:/var/www/xhgui/config - # - ./xhgui/nginx.conf:/etc/nginx/conf.d/default.conf:ro - # environment: - # - XHGUI_MONGO_HOSTNAME=xhguidata - # - XHGUI_MONGO_DATABASE=xhprof - # ports: - # - "8142:80" - # cpu_count: 1 - # mem_limit: 500000000 - # mem_swappiness: 0 - - # xhguidata: - # image: percona/percona-server-mongodb:3.6 - # environment: - # - MONGO_INITDB_DATABASE=xhprof - # volumes: - # - ./xhgui/mongo.init.d:/docker-entrypoint-initdb.d - # - xhguidata:/data/db - # cpu_count: 1 - # mem_limit: 1000000000 - # mem_swappiness: 0 - volumes: projects: - # mysql: + # maria: # postgres: - # mongo: + # redis: # elasticsearch: - # minio: - # xhguidata: diff --git a/xhgui/config/config.default.php b/xhgui/config/config.default.php deleted file mode 100644 index 0423d2b..0000000 --- a/xhgui/config/config.default.php +++ /dev/null @@ -1,68 +0,0 @@ - getenv('XHGUI_SAVE_HANDLER') ?: 'mongodb', - - // Database options for PDO. - 'pdo' => [ - 'dsn' => getenv('XHGUI_PDO_DSN') ?: null, - 'user' => getenv('XHGUI_PDO_USER') ?: null, - 'pass' => getenv('XHGUI_PDO_PASS') ?: null, - 'table' => getenv('XHGUI_PDO_TABLE') ?: 'results', - ], - - // Database options for MongoDB. - 'mongodb' => [ - // 'hostname' and 'port' are used to build DSN for MongoClient - 'hostname' => getenv('XHGUI_MONGO_HOSTNAME') ?: '127.0.0.1', - 'port' => getenv('XHGUI_MONGO_PORT') ?: 27017, - // The database name - 'database' => getenv('XHGUI_MONGO_DATABASE') ?: 'xhprof', - // Additional options for the MongoClient constructor, - // for example 'username', 'password', or 'replicaSet'. - // See . - 'options' => [], - // An array of options for the MongoDB driver. - // Options include setting connection context options for SSL or logging callbacks. - // See . - 'driverOptions' => [], - ], - - 'run.view.filter.names' => [ - 'Zend*', - 'Composer*', - ], - - // If defined, add imports via upload (/run/import) must pass token parameter with this value - 'upload.token' => getenv('XHGUI_UPLOAD_TOKEN') ?: '', - - // Add this path prefix to all links and resources - // If this is not defined, auto-detection will try to find it itself - 'path.prefix' => null, - - // Setup timezone for date formatting - // Example: 'UTC', 'Europe/Tallinn' - // If left empty, php default will be used (php.ini or compiled in default) - 'timezone' => '', - - // Date format used when browsing XHGui pages. - // - // Must be a format supported by the PHP date() function. - // See . - 'date.format' => 'M jS H:i:s', - - // The number of items to show in "Top lists" with functions - // using the most time or memory resources, on XHGui Run pages. - 'detail.count' => 6, - - // The number of items to show per page, on XHGui list pages. - 'page.limit' => 25, -]; diff --git a/xhgui/mongo.init.d/xhgui.js b/xhgui/mongo.init.d/xhgui.js deleted file mode 100644 index c386fca..0000000 --- a/xhgui/mongo.init.d/xhgui.js +++ /dev/null @@ -1,5 +0,0 @@ -db.results.ensureIndex( { 'meta.SERVER.REQUEST_TIME' : -1 } ); -db.results.ensureIndex( { 'profile.main().wt' : -1 } ); -db.results.ensureIndex( { 'profile.main().mu' : -1 } ); -db.results.ensureIndex( { 'profile.main().cpu' : -1 } ); -db.results.ensureIndex( { 'meta.url' : 1 } ); diff --git a/xhgui/nginx.conf b/xhgui/nginx.conf deleted file mode 100644 index 4f009f9..0000000 --- a/xhgui/nginx.conf +++ /dev/null @@ -1,21 +0,0 @@ -server { - listen 80 default_server; - listen [::]:80 default_server; - - root /var/www/xhgui/webroot; - index index.php; - - location / { - try_files $uri $uri/ /index.php$is_args$args; - } - - location ~ \.php$ { - try_files $uri =404; - include /etc/nginx/fastcgi_params; - fastcgi_pass xhgui:9000; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - - client_body_buffer_size 1M; - } -}