From 3871670c91c5040f6b68ffcda60b04341506b57d Mon Sep 17 00:00:00 2001 From: Leonid Nikitin Date: Tue, 11 Jun 2024 22:30:56 +0500 Subject: [PATCH 1/8] Removed extra code. --- app/application/resources/volt/js/volt.js | 177 +--------------------- 1 file changed, 1 insertion(+), 176 deletions(-) diff --git a/app/application/resources/volt/js/volt.js b/app/application/resources/volt/js/volt.js index 483167e..dc82184 100644 --- a/app/application/resources/volt/js/volt.js +++ b/app/application/resources/volt/js/volt.js @@ -19,51 +19,9 @@ const d = document; import * as bootstrap from 'bootstrap'; -import Swal from 'sweetalert2'; import SmoothScroll from 'smooth-scroll'; d.addEventListener("DOMContentLoaded", function(event) { - - const swalWithBootstrapButtons = Swal.mixin({ - customClass: { - confirmButton: 'btn btn-primary me-3', - cancelButton: 'btn btn-gray' - }, - buttonsStyling: false - }); - - var themeSettingsEl = document.getElementById('theme-settings'); - var themeSettingsExpandEl = document.getElementById('theme-settings-expand'); - - if(themeSettingsEl) { - - var themeSettingsCollapse = new bootstrap.Collapse(themeSettingsEl, { - show: true, - toggle: false - }); - - if (window.localStorage.getItem('settings_expanded') === 'true') { - themeSettingsCollapse.show(); - themeSettingsExpandEl.classList.remove('show'); - } else { - themeSettingsCollapse.hide(); - themeSettingsExpandEl.classList.add('show'); - } - - themeSettingsEl.addEventListener('hidden.bs.collapse', function () { - themeSettingsExpandEl.classList.add('show'); - window.localStorage.setItem('settings_expanded', false); - }); - - themeSettingsExpandEl.addEventListener('click', function () { - themeSettingsExpandEl.classList.remove('show'); - window.localStorage.setItem('settings_expanded', true); - setTimeout(function() { - themeSettingsCollapse.show(); - }, 300); - }); - } - // options const breakpoints = { sm: 540, @@ -82,13 +40,6 @@ d.addEventListener("DOMContentLoaded", function(event) { }); } - var iconNotifications = d.querySelector('.notification-bell'); - if (iconNotifications) { - iconNotifications.addEventListener('shown.bs.dropdown', function () { - iconNotifications.classList.remove('unread'); - }); - } - [].slice.call(d.querySelectorAll('[data-background]')).map(function(el) { el.style.background = 'url(' + el.getAttribute('data-background') + ')'; }); @@ -110,7 +61,7 @@ d.addEventListener("DOMContentLoaded", function(event) { //Tooltips var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')) var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) { - return new bootstrap.Tooltip(tooltipTriggerEl) + return new bootstrap.Tooltip(tooltipTriggerEl) }) @@ -129,68 +80,6 @@ d.addEventListener("DOMContentLoaded", function(event) { }); }) - if(d.querySelector('.input-slider-container')) { - [].slice.call(d.querySelectorAll('.input-slider-container')).map(function(el) { - var slider = el.querySelector(':scope .input-slider'); - var sliderId = slider.getAttribute('id'); - var minValue = slider.getAttribute('data-range-value-min'); - var maxValue = slider.getAttribute('data-range-value-max'); - - var sliderValue = el.querySelector(':scope .range-slider-value'); - var sliderValueId = sliderValue.getAttribute('id'); - var startValue = sliderValue.getAttribute('data-range-value-low'); - - var c = d.getElementById(sliderId), - id = d.getElementById(sliderValueId); - - noUiSlider.create(c, { - start: [parseInt(startValue)], - connect: [true, false], - //step: 1000, - range: { - 'min': [parseInt(minValue)], - 'max': [parseInt(maxValue)] - } - }); - }); - } - - if (d.getElementById('input-slider-range')) { - var c = d.getElementById("input-slider-range"), - low = d.getElementById("input-slider-range-value-low"), - e = d.getElementById("input-slider-range-value-high"), - f = [d, e]; - - noUiSlider.create(c, { - start: [parseInt(low.getAttribute('data-range-value-low')), parseInt(e.getAttribute('data-range-value-high'))], - connect: !0, - tooltips: true, - range: { - min: parseInt(c.getAttribute('data-range-value-min')), - max: parseInt(c.getAttribute('data-range-value-max')) - } - }), c.noUiSlider.on("update", function (a, b) { - f[b].textContent = a[b] - }); - } - - if (d.getElementById('loadOnClick')) { - d.getElementById('loadOnClick').addEventListener('click', function () { - var button = this; - var loadContent = d.getElementById('extraContent'); - var allLoaded = d.getElementById('allLoadedText'); - - button.classList.add('btn-loading'); - button.setAttribute('disabled', 'true'); - - setTimeout(function () { - loadContent.style.display = 'block'; - button.style.display = 'none'; - allLoaded.style.display = 'block'; - }, 1500); - }); - } - var scroll = new SmoothScroll('a[href*="#"]', { speed: 500, speedAsDuration: true @@ -199,68 +88,4 @@ d.addEventListener("DOMContentLoaded", function(event) { if(d.querySelector('.current-year')){ d.querySelector('.current-year').textContent = new Date().getFullYear(); } - - // Glide JS - - if (d.querySelector('.glide')) { - new Glide('.glide', { - type: 'carousel', - startAt: 0, - perView: 3 - }).mount(); - } - - if (d.querySelector('.glide-testimonials')) { - new Glide('.glide-testimonials', { - type: 'carousel', - startAt: 0, - perView: 1, - autoplay: 2000 - }).mount(); - } - - if (d.querySelector('.glide-clients')) { - new Glide('.glide-clients', { - type: 'carousel', - startAt: 0, - perView: 5, - autoplay: 2000 - }).mount(); - } - - if (d.querySelector('.glide-news-widget')) { - new Glide('.glide-news-widget', { - type: 'carousel', - startAt: 0, - perView: 1, - autoplay: 2000 - }).mount(); - } - - if (d.querySelector('.glide-autoplay')) { - new Glide('.glide-autoplay', { - type: 'carousel', - startAt: 0, - perView: 3, - autoplay: 2000 - }).mount(); - } - - // Pricing countup - var billingSwitchEl = d.getElementById('billingSwitch'); - if(billingSwitchEl) { - const countUpStandard = new countUp.CountUp('priceStandard', 99, { startVal: 199 }); - const countUpPremium = new countUp.CountUp('pricePremium', 199, { startVal: 299 }); - - billingSwitchEl.addEventListener('change', function() { - if(billingSwitch.checked) { - countUpStandard.start(); - countUpPremium.start(); - } else { - countUpStandard.reset(); - countUpPremium.reset(); - } - }); - } - }); From ed6a036d8dc7b4e151b86d02038e308e0dd76e97 Mon Sep 17 00:00:00 2001 From: Leonid Nikitin Date: Tue, 11 Jun 2024 22:34:55 +0500 Subject: [PATCH 2/8] Deleted sweetalert2. --- app/application/package-lock.json | 15 --------------- app/application/package.json | 1 - 2 files changed, 16 deletions(-) diff --git a/app/application/package-lock.json b/app/application/package-lock.json index 7ebded0..a9e193b 100644 --- a/app/application/package-lock.json +++ b/app/application/package-lock.json @@ -15,7 +15,6 @@ "sass": "^1.47.0", "simplebar": "^5.3.4", "smooth-scroll": "^16.1.3", - "sweetalert2": "^11.0.18", "vanillajs-datepicker": "^1.2.0", "waypoints": "^4.0.1" }, @@ -1659,15 +1658,6 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/sweetalert2": { - "version": "11.7.12", - "resolved": "https://registry.npmjs.org/sweetalert2/-/sweetalert2-11.7.12.tgz", - "integrity": "sha512-TQJy8mQymJLzqWPQOMQErd81Zd/rSYr0UL4pEc7bqEihtjS+zt7LWJXLhfPp93e+Hf3Z2FHMB6QGNskAMCsdTg==", - "funding": { - "type": "individual", - "url": "https://github.com/sponsors/limonte" - } - }, "node_modules/tapable": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", @@ -3050,11 +3040,6 @@ "has-flag": "^4.0.0" } }, - "sweetalert2": { - "version": "11.7.12", - "resolved": "https://registry.npmjs.org/sweetalert2/-/sweetalert2-11.7.12.tgz", - "integrity": "sha512-TQJy8mQymJLzqWPQOMQErd81Zd/rSYr0UL4pEc7bqEihtjS+zt7LWJXLhfPp93e+Hf3Z2FHMB6QGNskAMCsdTg==" - }, "tapable": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", diff --git a/app/application/package.json b/app/application/package.json index c446ebb..73d6308 100644 --- a/app/application/package.json +++ b/app/application/package.json @@ -15,7 +15,6 @@ "sass": "^1.47.0", "simplebar": "^5.3.4", "smooth-scroll": "^16.1.3", - "sweetalert2": "^11.0.18", "vanillajs-datepicker": "^1.2.0", "waypoints": "^4.0.1" }, From cce94cd2106f7a157ef23bcca41512022f5f8cda Mon Sep 17 00:00:00 2001 From: Leonid Nikitin Date: Tue, 11 Jun 2024 22:39:15 +0500 Subject: [PATCH 3/8] Added autocomplete="off" attribute to input password. --- .../resources/views/private/profile/profile.blade.php | 4 ++-- app/application/resources/views/public/login.blade.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/application/resources/views/private/profile/profile.blade.php b/app/application/resources/views/private/profile/profile.blade.php index 838f10c..228cf6c 100644 --- a/app/application/resources/views/private/profile/profile.blade.php +++ b/app/application/resources/views/private/profile/profile.blade.php @@ -23,8 +23,8 @@
@csrf @method('PUT') - - + + diff --git a/app/application/resources/views/public/login.blade.php b/app/application/resources/views/public/login.blade.php index d7f7f77..9be8e15 100644 --- a/app/application/resources/views/public/login.blade.php +++ b/app/application/resources/views/public/login.blade.php @@ -37,7 +37,7 @@ - + From de69776bc80a6c85afd30e9939bf933376932c2c Mon Sep 17 00:00:00 2001 From: Leonid Nikitin Date: Tue, 11 Jun 2024 22:42:10 +0500 Subject: [PATCH 4/8] Added php artisan storage:link. --- app/docker/docker-entrypoint_prod.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/app/docker/docker-entrypoint_prod.sh b/app/docker/docker-entrypoint_prod.sh index b6fd0bb..c1b7d9c 100644 --- a/app/docker/docker-entrypoint_prod.sh +++ b/app/docker/docker-entrypoint_prod.sh @@ -103,6 +103,7 @@ php artisan config:cache php artisan event:cache php artisan route:cache php artisan view:cache +php artisan storage:link if [ "$role" = "app" ]; then php artisan migrate --force fi From af053b4d530bb2b6e41c20ea4ec0b883d7a0c1e9 Mon Sep 17 00:00:00 2001 From: Leonid Nikitin Date: Tue, 11 Jun 2024 22:42:58 +0500 Subject: [PATCH 5/8] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=20=D0=BA=20Redis=20Volumes.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose-prod.yml | 2 ++ docker-compose-prod_docker-hub.yml | 2 ++ docker-compose.yml | 2 ++ redis/.gitignore | 1 + 4 files changed, 7 insertions(+) create mode 100644 redis/.gitignore diff --git a/docker-compose-prod.yml b/docker-compose-prod.yml index a4bb96c..b0eb113 100644 --- a/docker-compose-prod.yml +++ b/docker-compose-prod.yml @@ -80,6 +80,8 @@ services: redis: image: redis:3.0-alpine # restart: always + volumes: + - ./redis/data:/data db: image: docker.io/mysql:8.0.33 command: --default-authentication-plugin=mysql_native_password diff --git a/docker-compose-prod_docker-hub.yml b/docker-compose-prod_docker-hub.yml index c46994e..5b07e03 100644 --- a/docker-compose-prod_docker-hub.yml +++ b/docker-compose-prod_docker-hub.yml @@ -50,6 +50,8 @@ services: redis: image: redis:3.0-alpine # restart: always + volumes: + - ./redis/data:/data swagger: image: swaggerapi/swagger-ui depends_on: diff --git a/docker-compose.yml b/docker-compose.yml index b098d3c..ffbad99 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -62,6 +62,8 @@ services: - ./app/application:/var/www/html redis: image: redis:3.0-alpine + volumes: + - ./redis/data:/data db: image: mysql:8.0.33 command: --default-authentication-plugin=mysql_native_password diff --git a/redis/.gitignore b/redis/.gitignore new file mode 100644 index 0000000..adbb97d --- /dev/null +++ b/redis/.gitignore @@ -0,0 +1 @@ +data/ \ No newline at end of file From 0f07c8c6abe4fc8d1d7c4fa1110b75cfc502a17c Mon Sep 17 00:00:00 2001 From: Leonid Nikitin Date: Tue, 11 Jun 2024 22:44:48 +0500 Subject: [PATCH 6/8] Improved queue launch in Docker. Now it does not die, but in a loop inside it restarts php /var/www/html/artisan queue:work --verbose --sleep=5 --tries=10 --max-time=3600. --- app/docker/start_dev.sh | 5 ++++- app/docker/start_prod.sh | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/docker/start_dev.sh b/app/docker/start_dev.sh index 007ea47..8ee0609 100755 --- a/app/docker/start_dev.sh +++ b/app/docker/start_dev.sh @@ -5,7 +5,10 @@ if [ "$role" = "app" ]; then exec unitd --no-daemon --control unix:/var/run/control.unit.sock --user unit --group unit elif [ "$role" = "queue" ]; then echo "Running the queue..." - php /var/www/html/artisan queue:work --verbose --sleep=5 --tries=10 + while [ true ] + do + php /var/www/html/artisan queue:work --verbose --sleep=5 --tries=10 --max-time=3600 + done elif [ "$role" = "websockets" ]; then echo "Running the websockets..." php /var/www/html/artisan reverb:start --port=9000 diff --git a/app/docker/start_prod.sh b/app/docker/start_prod.sh index e4d2379..8ee0609 100755 --- a/app/docker/start_prod.sh +++ b/app/docker/start_prod.sh @@ -5,7 +5,10 @@ if [ "$role" = "app" ]; then exec unitd --no-daemon --control unix:/var/run/control.unit.sock --user unit --group unit elif [ "$role" = "queue" ]; then echo "Running the queue..." - php /var/www/html/artisan queue:work --verbose --sleep=5 --tries=10 --max-time=3600 + while [ true ] + do + php /var/www/html/artisan queue:work --verbose --sleep=5 --tries=10 --max-time=3600 + done elif [ "$role" = "websockets" ]; then echo "Running the websockets..." php /var/www/html/artisan reverb:start --port=9000 From 47ef821c0f18b153165b286be04c178310659cf2 Mon Sep 17 00:00:00 2001 From: Leonid Nikitin Date: Tue, 11 Jun 2024 23:02:48 +0500 Subject: [PATCH 7/8] Added environment UNIT_SOURCE as an example. --- docker-compose-prod.yml | 3 +++ docker-compose-prod_docker-hub.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/docker-compose-prod.yml b/docker-compose-prod.yml index b0eb113..eca64f4 100644 --- a/docker-compose-prod.yml +++ b/docker-compose-prod.yml @@ -28,6 +28,9 @@ services: - redis - reverb env_file: app/application/.env + environment: + CONTAINER_ROLE: app + UNIT_SOURCE: '["172.16.0.0/12"]' queue: build: context: app diff --git a/docker-compose-prod_docker-hub.yml b/docker-compose-prod_docker-hub.yml index 5b07e03..55a6b72 100644 --- a/docker-compose-prod_docker-hub.yml +++ b/docker-compose-prod_docker-hub.yml @@ -18,6 +18,9 @@ services: - redis - reverb env_file: app/.env + environment: + CONTAINER_ROLE: app + UNIT_SOURCE: '["172.16.0.0/12"]' queue: image: korelf/service-captcha:0.8.1 # restart: always From e2b9e60b3641b13f571411102ec729507a064071 Mon Sep 17 00:00:00 2001 From: Leonid Nikitin Date: Tue, 11 Jun 2024 23:19:32 +0500 Subject: [PATCH 8/8] Updated to korelf/service-captcha:0.8.2. --- docker-compose-prod_docker-hub.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker-compose-prod_docker-hub.yml b/docker-compose-prod_docker-hub.yml index 55a6b72..9977040 100644 --- a/docker-compose-prod_docker-hub.yml +++ b/docker-compose-prod_docker-hub.yml @@ -11,7 +11,7 @@ services: ports: - ${DOCKER_NGINX_PORT}:80 app: - image: korelf/service-captcha:0.8.1 + image: korelf/service-captcha:0.8.2 # restart: always depends_on: - db @@ -22,7 +22,7 @@ services: CONTAINER_ROLE: app UNIT_SOURCE: '["172.16.0.0/12"]' queue: - image: korelf/service-captcha:0.8.1 + image: korelf/service-captcha:0.8.2 # restart: always depends_on: - db @@ -31,7 +31,7 @@ services: CONTAINER_ROLE: queue env_file: app/.env reverb: - image: korelf/service-captcha:0.8.1 + image: korelf/service-captcha:0.8.2 # restart: always depends_on: - db @@ -42,7 +42,7 @@ services: ports: - ${DOCKER_WEBSOCKET_PORT}:9000 scheduler: - image: korelf/service-captcha:0.8.1 + image: korelf/service-captcha:0.8.2 # restart: always depends_on: - db