mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-20 21:23:08 +03:00
Merge branch 'feat/ansible-vault' into chore/all-my-stuffs
# Conflicts: # package.json # pnpm-lock.yaml # src/tools/index.ts
This commit is contained in:
commit
76f03ffb3e
5 files changed
+128
-1
No files matched your search
@@ -105,6 +105,7 @@
|
||||
"arr-diff": "^4.0.0",
|
||||
"@xmldom/xmldom": "^0.8.10",
|
||||
"aircodes": "^1.3.16",
|
||||
"ansible-vault": "^1.1.1",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"big.js": "^6.2.2",
|
||||
"change-case": "^4.1.2",
|
||||
|
||||
Generated
+8
-1
@@ -161,6 +161,9 @@ dependencies:
|
||||
aircodes:
|
||||
specifier: ^1.3.16
|
||||
version: 1.3.16
|
||||
ansible-vault:
|
||||
specifier: ^1.1.1
|
||||
version: 1.3.0
|
||||
arr-diff:
|
||||
specifier: ^4.0.0
|
||||
version: 4.0.0
|
||||
@@ -6532,6 +6535,11 @@ packages:
|
||||
engines: {node: '>=12'}
|
||||
dev: false
|
||||
|
||||
/ansible-vault@1.3.0:
|
||||
resolution: {integrity: sha512-LPqmE+ZJX4cY+fMfGc6ooXzmkPga/oYn05xJ7DQqDgZUYX/JBCB8GIEPHHRsTcCqq8YQddEpt/SWwALNNbeyyg==}
|
||||
engines: {node: '>=18.0.0'}
|
||||
dev: false
|
||||
|
||||
/any-base@1.1.0:
|
||||
resolution: {integrity: sha512-uMgjozySS8adZZYePpaWs8cxB9/kdzmpX6SgJZ+wbz1K5eYk5QMYDVJaZKhxyIHUdnnJkfR7SVgStgH7LkGUyg==}
|
||||
dev: false
|
||||
@@ -15923,7 +15931,6 @@ packages:
|
||||
|
||||
/yamljs@0.3.0:
|
||||
resolution: {integrity: sha512-C/FsVVhht4iPQYXOInoxUM/1ELSf9EsgKH34FofQOp6hwCPrW4vG4w5++TED3xRUo8gD7l0P1J1dLlDYzODsTQ==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
argparse: 1.0.10
|
||||
glob: 7.2.3
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
<script setup lang="ts">
|
||||
import { Vault } from 'ansible-vault';
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
|
||||
const decryptedInput = ref('');
|
||||
const encryptPassword = ref('');
|
||||
const encryptId = ref('');
|
||||
const cryptedOutput = computedAsync(
|
||||
async () => {
|
||||
try {
|
||||
const v = new Vault({ password: encryptPassword.value });
|
||||
return await v.encrypt(decryptedInput.value, encryptId.value);
|
||||
}
|
||||
catch (e: any) {
|
||||
return e.toString();
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const cryptedInput = ref('');
|
||||
const decryptPassword = ref('');
|
||||
const decryptedOutput = computedAsync(
|
||||
async () => {
|
||||
try {
|
||||
const v = new Vault({ password: decryptPassword.value });
|
||||
// handle mac \r
|
||||
return (await v.decrypt(cryptedInput.value?.replace(/\r(?!\n)/, '\n'), undefined)) ?? '';
|
||||
}
|
||||
catch (e: any) {
|
||||
return e.toString();
|
||||
}
|
||||
},
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<c-card title="Encrypt Ansible Vault Secret">
|
||||
<c-input-text
|
||||
v-model:value="decryptedInput"
|
||||
placeholder="Put your string to encrypt..."
|
||||
label="String to encrypt"
|
||||
raw-text
|
||||
mb-5
|
||||
/>
|
||||
|
||||
<n-space>
|
||||
<c-input-text
|
||||
v-model:value="encryptPassword"
|
||||
placeholder="Encryption password"
|
||||
label="Encryption password"
|
||||
raw-text
|
||||
mb-5
|
||||
/>
|
||||
<c-input-text
|
||||
v-model:value="encryptId"
|
||||
placeholder="Encryption Id"
|
||||
label="Encryption Id"
|
||||
raw-text
|
||||
mb-5
|
||||
/>
|
||||
</n-space>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<TextareaCopyable
|
||||
label="Encrypted string"
|
||||
:value="cryptedOutput"
|
||||
multiline
|
||||
readonly
|
||||
rows="5"
|
||||
mb-5
|
||||
/>
|
||||
</c-card>
|
||||
|
||||
<c-card title="Decrypt Ansible Vault Secret">
|
||||
<c-input-text
|
||||
v-model:value="cryptedInput"
|
||||
placeholder="Put your encrypted string here..."
|
||||
label="String to decrypt"
|
||||
raw-text multiline mb-5
|
||||
rows="5"
|
||||
/>
|
||||
|
||||
<c-input-text
|
||||
v-model:value="decryptPassword"
|
||||
placeholder="Decryption password"
|
||||
label="Decryption password"
|
||||
raw-text
|
||||
mb-5
|
||||
/>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<TextareaCopyable
|
||||
label="Decrypted string"
|
||||
:value="decryptedOutput"
|
||||
multiline
|
||||
readonly
|
||||
rows="5"
|
||||
mb-5
|
||||
/>
|
||||
</c-card>
|
||||
</template>
|
||||
@@ -0,0 +1,12 @@
|
||||
import { LockSquare } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Ansible vault crypt decrypt',
|
||||
path: '/ansible-vault-crypt-decrypt',
|
||||
description: 'Encrypt and decrypt Ansible Vault Secrets',
|
||||
keywords: ['ansible', 'vault', 'crypt', 'decrypt'],
|
||||
component: () => import('./ansible-vault-crypt-decrypt.vue'),
|
||||
icon: LockSquare,
|
||||
createdAt: new Date('2024-02-25'),
|
||||
});
|
||||
@@ -67,6 +67,7 @@ import { tool as certificateKeyParser } from './certificate-key-parser';
|
||||
import { tool as crcCalculator } from './crc-calculator';
|
||||
import { tool as ipGeoLocation } from './ip-geo-location';
|
||||
import { tool as ocrImage } from './ocr-image';
|
||||
import { tool as ansibleVaultCryptDecrypt } from './ansible-vault-crypt-decrypt';
|
||||
import { tool as safelinkDecoder } from './safelink-decoder';
|
||||
import { tool as mongoObjectidConverter } from './mongo-objectid-converter';
|
||||
import { tool as removeExif } from './remove-exif';
|
||||
@@ -226,6 +227,9 @@ export const toolsByCategory: ToolCategory[] = [
|
||||
passwordStrengthAnalyser,
|
||||
pdfSignatureChecker,
|
||||
wpaPskGenerator,
|
||||
ansibleVaultCryptDecrypt,
|
||||
passwordStrengthAnalyser,
|
||||
pdfSignatureChecker,
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user