Skip to content

Commit f04ec26

Browse files
authored
Merge pull request #4 from hthienloc/main
Pin GitHub Actions, update dependencies, and sanitize v-html output
2 parents df14251 + d68f92a commit f04ec26

4 files changed

Lines changed: 26 additions & 9 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: 🛎️ Checkout code
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2323

2424
- name: 🥟 Setup Bun
25-
uses: oven-sh/setup-bun@v2
25+
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.0.1
2626
with:
2727
bun-version: latest
2828

@@ -33,7 +33,7 @@ jobs:
3333
run: bun run build
3434

3535
- name: 📁 Upload Pages artifact
36-
uses: actions/upload-pages-artifact@v3
36+
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
3737
with:
3838
path: ./dist
3939

@@ -48,4 +48,4 @@ jobs:
4848
steps:
4949
- name: 🚀 Deploy to GitHub Pages
5050
id: deployment
51-
uses: actions/deploy-pages@v4
51+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5

bun.lock

Lines changed: 13 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@
1212
},
1313
"dependencies": {
1414
"@element-plus/icons-vue": "^2.3.2",
15+
"dompurify": "^3.3.3",
1516
"element-plus": "^2.13.5",
1617
"oh-vue-icons": "^1.0.0-rc3",
1718
"vue": "^3.5.29",
1819
"vue-router": "4"
1920
},
2021
"devDependencies": {
2122
"@tsconfig/node24": "^24.0.4",
23+
"@types/dompurify": "^3.2.0",
2224
"@types/node": "^24.11.0",
2325
"@vitejs/plugin-vue": "^6.0.4",
2426
"@vue/tsconfig": "^0.9.0",
@@ -32,6 +34,8 @@
3234
"vue-tsc": "^3.2.5"
3335
},
3436
"overrides": {
37+
"lodash": "^4.18.1",
38+
"lodash-es": "^4.18.1",
3539
"unimport": "latest",
3640
"strip-literal": "latest"
3741
},

src/components/InteractiveInstaller.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { ref, computed } from 'vue';
33
import { DocumentCopy } from '@element-plus/icons-vue';
44
import { ElMessage } from 'element-plus';
5+
import DOMPurify from 'dompurify';
56
import {
67
distros,
78
methods,
@@ -21,6 +22,8 @@ const selectedDe = ref<string>(deWms[0] || '');
2122
const selectedEnv = ref<string>(environments[1] || '');
2223
const selectedInit = ref<string>(initSystems[0] || 'systemd');
2324
25+
const sanitize = (html: string) => DOMPurify.sanitize(html);
26+
2427
const activateServerCode = computed(() => {
2528
if (selectedDistro.value === 'NixOS')
2629
return '# Bước này đã được cấu hình trong flake.nix ở trên.';
@@ -346,7 +349,7 @@ const chromiumWaylandFlags =
346349
<li
347350
v-for="(step, idx) in fcitx5Config.steps"
348351
:key="idx"
349-
v-html="step"
352+
v-html="sanitize(step)"
350353
></li>
351354
</ul>
352355
</div>
@@ -398,7 +401,7 @@ const chromiumWaylandFlags =
398401
<li
399402
v-for="(point, idx) in waylandDeSpecific.best_setup"
400403
:key="idx"
401-
v-html="point"
404+
v-html="sanitize(point)"
402405
></li>
403406
</ul>
404407
</div>

0 commit comments

Comments
 (0)