From 1ec92b5f97badb55ebcae2dcec43b1da20c167b6 Mon Sep 17 00:00:00 2001 From: didirus4 Date: Thu, 10 Jul 2025 15:59:17 +0300 Subject: [PATCH 1/3] ci: add steps with LF & CRLF checks --- .github/workflows/astralrinth-build.yml | 31 +++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.github/workflows/astralrinth-build.yml b/.github/workflows/astralrinth-build.yml index c0ca1729..97f79b9a 100644 --- a/.github/workflows/astralrinth-build.yml +++ b/.github/workflows/astralrinth-build.yml @@ -41,6 +41,37 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 2 + - name: 🔍 Validate Git config does not introduce CRLF + run: | + echo "🔍 Checking Git config for CRLF settings..." + + autocrlf=$(git config --get core.autocrlf || echo "unset") + eol_setting=$(git config --get core.eol || echo "unset") + + echo "core.autocrlf = $autocrlf" + echo "core.eol = $eol_setting" + + if [ "$autocrlf" = "true" ]; then + echo "❌ ERROR: core.autocrlf is set to 'true'. Please set to 'input' or 'false'." + exit 1 + fi + + if [ "$eol_setting" = "crlf" ]; then + echo "❌ ERROR: core.eol is set to 'crlf'. Please unset it or set to 'lf'." + exit 1 + fi + + echo "✅ Git config is safe (no forced CRLF)" + + - name: 🔍 Check migration files line endings (LF only) + run: | + echo "🔍 Scanning migration SQL files for CR characters (\\r)..." + if grep -Iq $'\r' packages/app-lib/migrations/*.sql; then + echo "❌ ERROR: Some migration files contain CR (\\r) characters — expected only LF line endings." + exit 1 + fi + echo "✅ All migration files use LF line endings" + - name: 🧰 Setup Rust toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 -- 2.49.1 From 1ef96c447eb272e840264221a57b0a3e39855e7e Mon Sep 17 00:00:00 2001 From: didirus4 Date: Thu, 10 Jul 2025 16:30:04 +0300 Subject: [PATCH 2/3] ci: patch validating git config on windows runner --- .github/workflows/astralrinth-build.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/astralrinth-build.yml b/.github/workflows/astralrinth-build.yml index 97f79b9a..c5a263d7 100644 --- a/.github/workflows/astralrinth-build.yml +++ b/.github/workflows/astralrinth-build.yml @@ -41,7 +41,9 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 2 + - name: 🔍 Validate Git config does not introduce CRLF + shell: bash run: | echo "🔍 Checking Git config for CRLF settings..." @@ -52,18 +54,15 @@ jobs: echo "core.eol = $eol_setting" if [ "$autocrlf" = "true" ]; then - echo "❌ ERROR: core.autocrlf is set to 'true'. Please set to 'input' or 'false'." - exit 1 + echo "⚠️ WARNING: core.autocrlf is set to 'true'. Consider setting it to 'input' or 'false'." fi if [ "$eol_setting" = "crlf" ]; then - echo "❌ ERROR: core.eol is set to 'crlf'. Please unset it or set to 'lf'." - exit 1 + echo "⚠️ WARNING: core.eol is set to 'crlf'. Consider unsetting it or setting to 'lf'." fi - echo "✅ Git config is safe (no forced CRLF)" - - name: 🔍 Check migration files line endings (LF only) + shell: bash run: | echo "🔍 Scanning migration SQL files for CR characters (\\r)..." if grep -Iq $'\r' packages/app-lib/migrations/*.sql; then @@ -72,7 +71,6 @@ jobs: fi echo "✅ All migration files use LF line endings" - - name: 🧰 Setup Rust toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: -- 2.49.1 From 332a543f6656661200468de6fe4f3f3d44e38fca Mon Sep 17 00:00:00 2001 From: didirus4 Date: Thu, 10 Jul 2025 21:09:06 +0300 Subject: [PATCH 3/3] fix: added ability for regenerate checksums with issued mr migrations. --- apps/app-frontend/src/App.vue | 4 +- .../src/components/ui/ErrorModal.vue | 135 +++++++++++++ apps/app-frontend/src/helpers/utils.js | 6 + apps/app/build.rs | 1 + apps/app/src/api/utils.rs | 12 +- apps/app/tauri.conf.json | 2 +- packages/app-lib/src/api/download.rs | 55 ------ packages/app-lib/src/api/mod.rs | 2 +- packages/app-lib/src/api/update.rs | 42 ++++ packages/app-lib/src/lib.rs | 2 +- packages/app-lib/src/state/db.rs | 179 ++++++++++-------- packages/app-lib/src/util/utils.rs | 50 ++++- 12 files changed, 349 insertions(+), 141 deletions(-) delete mode 100644 packages/app-lib/src/api/download.rs create mode 100644 packages/app-lib/src/api/update.rs diff --git a/apps/app-frontend/src/App.vue b/apps/app-frontend/src/App.vue index a8a76db2..81107c4f 100644 --- a/apps/app-frontend/src/App.vue +++ b/apps/app-frontend/src/App.vue @@ -161,11 +161,11 @@ async function setupApp() { initAnalytics() if (!telemetry) { - console.info("[AR] Telemetry disabled by default (Hard patched).") + console.info("[AR] • Telemetry disabled by default (Hard patched).") optOutAnalytics() } if (!personalized_ads) { - console.info("[AR] Personalized ads disabled by default (Hard patched).") + console.info("[AR] • Personalized ads disabled by default (Hard patched).") } if (dev) debugAnalytics() diff --git a/apps/app-frontend/src/components/ui/ErrorModal.vue b/apps/app-frontend/src/components/ui/ErrorModal.vue index bae91908..3df0cc11 100644 --- a/apps/app-frontend/src/components/ui/ErrorModal.vue +++ b/apps/app-frontend/src/components/ui/ErrorModal.vue @@ -18,11 +18,15 @@ import { cancel_directory_change } from '@/helpers/settings.ts' import { install } from '@/helpers/profile.js' import { trackEvent } from '@/helpers/analytics' import ModalWrapper from '@/components/ui/modal/ModalWrapper.vue' +import { applyMigrationFix } from '@/helpers/utils.js' const errorModal = ref() const error = ref() const closable = ref(true) const errorCollapsed = ref(false) +const language = ref('en') +const migrationFixSuccess = ref(null) // null | true | false +const migrationFixCallbackModel = ref() const title = ref('An error occurred') const errorType = ref('unknown') @@ -148,6 +152,25 @@ async function copyToClipboard(text) { copied.value = false }, 3000) } + +function toggleLanguage() { + language.value = language.value === 'en' ? 'ru' : 'en' +} + +async function onApplyMigrationFix(eol) { + console.log(`[AR] • Attempting to apply migration ${eol.toUpperCase()} fix`) + try { + const result = await applyMigrationFix(eol) + migrationFixSuccess.value = result === true + console.log(`[AR] • Successfully applied migration ${eol.toUpperCase()} fix`, result) + } catch (err) { + console.error(`[AR] • Failed to apply migration fix:`, err) + migrationFixSuccess.value = false + } finally { + migrationFixCallbackModel.value?.show?.() + } +} +