mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-20 21:23:08 +03:00
Merge branch 'feat/htpasswd' into chore/all-my-stuffs
# Conflicts: # package.json # pnpm-lock.yaml # src/tools/index.ts
This commit is contained in:
commit
d03b31eee9
5 files changed
+85
-1
No files matched your search
@@ -111,6 +111,7 @@
|
||||
"@xmldom/xmldom": "^0.8.10",
|
||||
"aircodes": "^1.3.16",
|
||||
"ansible-vault": "^1.1.1",
|
||||
"apache-md5": "^1.1.8",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"big.js": "^6.2.2",
|
||||
"change-case": "^4.1.2",
|
||||
|
||||
Generated
+10
-1
@@ -167,6 +167,9 @@ dependencies:
|
||||
ansible-vault:
|
||||
specifier: ^1.1.1
|
||||
version: 1.3.0
|
||||
apache-md5:
|
||||
specifier: ^1.1.8
|
||||
version: 1.1.8
|
||||
arr-diff:
|
||||
specifier: ^4.0.0
|
||||
version: 4.0.0
|
||||
@@ -5267,7 +5270,7 @@ packages:
|
||||
/@types/lodash-es@4.17.10:
|
||||
resolution: {integrity: sha512-YJP+w/2khSBwbUSFdGsSqmDvmnN3cCKoPOL7Zjle6s30ZtemkkqhjVfFqGwPN7ASil5VyjE2GtyU/yqYY6mC0A==}
|
||||
dependencies:
|
||||
'@types/lodash': 4.14.192
|
||||
'@types/lodash': 4.14.200
|
||||
dev: false
|
||||
|
||||
/@types/lodash.defaultsdeep@4.6.9:
|
||||
@@ -5290,6 +5293,7 @@ packages:
|
||||
|
||||
/@types/lodash@4.14.192:
|
||||
resolution: {integrity: sha512-km+Vyn3BYm5ytMO13k9KTp27O75rbQ0NFw+U//g+PX7VZyjCioXaRFisqSIJRECljcTv73G3i6BpglNGHgUQ5A==}
|
||||
dev: true
|
||||
|
||||
/@types/lodash@4.14.200:
|
||||
resolution: {integrity: sha512-YI/M/4HRImtNf3pJgbF+W6FrXovqj+T+/HpENLTooK9PnkacBsDpeP3IpHab40CClUfhNmdM2WTNP2sa2dni5Q==}
|
||||
@@ -6585,6 +6589,11 @@ packages:
|
||||
normalize-path: 3.0.0
|
||||
picomatch: 2.3.1
|
||||
|
||||
/apache-md5@1.1.8:
|
||||
resolution: {integrity: sha512-FCAJojipPn0bXjuEpjOOOMN8FZDkxfWWp4JGN9mifU2IhxvKyXZYqpzPHdnTSUpmPDy+tsslB6Z1g+Vg6nVbYA==}
|
||||
engines: {node: '>=8'}
|
||||
dev: false
|
||||
|
||||
/argparse@1.0.10:
|
||||
resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==}
|
||||
dependencies:
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
<script setup lang="ts">
|
||||
import { hashSync } from 'bcryptjs';
|
||||
import md5 from 'apache-md5';
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
|
||||
const username = ref('');
|
||||
const password = ref('');
|
||||
const hashMethod = ref('bcrypt');
|
||||
const saltCount = ref(10);
|
||||
|
||||
const htpasswd = computed(() => {
|
||||
if (username.value === '' || password.value === '') {
|
||||
return '# username and password must not be empty';
|
||||
}
|
||||
let hash;
|
||||
if (hashMethod.value === 'md5') {
|
||||
hash = md5(password.value);
|
||||
}
|
||||
else {
|
||||
hash = hashSync(password.value, saltCount.value);
|
||||
}
|
||||
return `${username.value}:${hash}`;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<c-input-text
|
||||
v-model:value="username"
|
||||
label="Username"
|
||||
placeholder="Your username..."
|
||||
clearable raw-text mb-5
|
||||
/>
|
||||
<c-input-text
|
||||
v-model:value="password"
|
||||
label="Password"
|
||||
placeholder="Your password..."
|
||||
clearable
|
||||
raw-text
|
||||
mb-2
|
||||
type="password"
|
||||
/>
|
||||
|
||||
<c-select
|
||||
v-model:value="hashMethod"
|
||||
label="Hash method:"
|
||||
:options="['bcrypt', 'md5']"
|
||||
/>
|
||||
|
||||
<n-form-item v-if="hashMethod === 'bcrypt'" label="Salt count: " label-placement="left" label-width="120">
|
||||
<n-input-number v-model:value="saltCount" placeholder="Salt rounds..." :max="100" :min="0" w-full />
|
||||
</n-form-item>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<n-form-item label="htpasswd content:">
|
||||
<TextareaCopyable :value="htpasswd" />
|
||||
</n-form-item>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,12 @@
|
||||
import { PasswordRound } from '@vicons/material';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Htpasswd/htaccess generator',
|
||||
path: '/htpasswd-generator',
|
||||
description: 'htpassword/htaccess user/password generator',
|
||||
keywords: ['htpasswd', 'htaccess', 'bcrypt', 'password'],
|
||||
component: () => import('./htpasswd-generator.vue'),
|
||||
icon: PasswordRound,
|
||||
createdAt: new Date('2024-02-20'),
|
||||
});
|
||||
@@ -71,6 +71,7 @@ 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 gzipConverter } from './gzip-converter';
|
||||
import { tool as htpasswdGenerator } from './htpasswd-generator';
|
||||
import { tool as safelinkDecoder } from './safelink-decoder';
|
||||
import { tool as mongoObjectidConverter } from './mongo-objectid-converter';
|
||||
import { tool as removeExif } from './remove-exif';
|
||||
@@ -304,6 +305,7 @@ export const toolsByCategory: ToolCategory[] = [
|
||||
urlParser,
|
||||
deviceInformation,
|
||||
basicAuthGenerator,
|
||||
htpasswdGenerator,
|
||||
metaTagGenerator,
|
||||
otpCodeGeneratorAndValidator,
|
||||
mimeTypes,
|
||||
|
||||
Reference in new issue
Block a user