diff --git a/.gitignore b/.gitignore index 88f467d..e8abc2e 100644 --- a/.gitignore +++ b/.gitignore @@ -12,26 +12,21 @@ !bin/config/ !bin/ansible/ !inventory/ -!templates/ !sops/ -!proyectos/ +!projects/ # Permitir el seguimiento de archivos específicos # !archivo1.txt !README.md +!CLUADE.md !.gitignore -# Ignorar archivos específicos -CLAUDE.md -bin/config/rates/ - # Permitir archivos en carpetas específicas # !carpeta1/*.txt !bin/* !bin/lib/* !bin/msg/* -!bin/config/* +!bin/config/** !bin/ansible/** !inventory/** -!templates/** !sops/*.yaml diff --git a/CLAUDE.md b/CLAUDE.md index 3ede9c6..a99f239 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -18,17 +18,21 @@ ## Development Practices - Use `bin/lib/base.lib` for common functions +- Use `bin/lib/developers.lib` for developers functions +- Use `bin/lib/clonsole.lib` for dialog functions - Message files stored in `bin/msg/` (multilingual support) - Configuration in `bin/config/` directory -- Use git commit messages with prefixes: [ADDED], [IMPROVED], [FIXED], [SOPS] +- Use git commit messages with prefixes: [ADDED], [IMPROVED], [FIXED], [SOPS], [INIT] - Prefer podman over docker for container management - All shell scripts (.sh) and Python scripts (.py) must be placed in the `bin/` directory unless explicitly specified otherwise ## Authorship Policy +- Use `bin/config/python.header` how example to python comment header +- Use `bin/config/bash.header` how example to bash comment header - For new projects created by Claude Code, use author: "Cortana Rosero One " - Include reference indicating generation by Claude Code and the version used - Example header comment: ``` # [Author] Cortana Rosero One # [Generated] Created by Claude Code (claude-3-7-sonnet-20250219) - ``` \ No newline at end of file + ``` diff --git a/bin/config/bash.head b/bin/config/bash.head new file mode 100644 index 0000000..74870cd --- /dev/null +++ b/bin/config/bash.head @@ -0,0 +1,10 @@ +#!/bin/bash +# +# Script: cversadm_token.sh +# Description: Administrador de tokens para plataformas de control de versiones +# Created: 2025/01/04 20:00:00 +# Modified: 2025/03/15 16:08:03 +# [Author] Cortana Rosero One +# [Generated] Created by Claude Code (claude-3-7-sonnet-20250219) +# +# Derechos de Autor (C) [2025] [Mauro Rosero P. ] diff --git a/bin/config/projects.dat b/bin/config/projects.dat index 51c1c7a..7201f8c 100644 --- a/bin/config/projects.dat +++ b/bin/config/projects.dat @@ -1 +1 @@ -proyectos +projects diff --git a/bin/config/rates/backend.rate b/bin/config/rates/backend.rate new file mode 100644 index 0000000..c351fec --- /dev/null +++ b/bin/config/rates/backend.rate @@ -0,0 +1 @@ +57.73 \ No newline at end of file diff --git a/bin/config/rates/bash.rate b/bin/config/rates/bash.rate new file mode 100644 index 0000000..dec8b77 --- /dev/null +++ b/bin/config/rates/bash.rate @@ -0,0 +1 @@ +23.64 \ No newline at end of file diff --git a/bin/config/rates/cloud.rate b/bin/config/rates/cloud.rate new file mode 100644 index 0000000..ba00533 --- /dev/null +++ b/bin/config/rates/cloud.rate @@ -0,0 +1 @@ +51.00 \ No newline at end of file diff --git a/bin/config/rates/data.rate b/bin/config/rates/data.rate new file mode 100644 index 0000000..bc0becf --- /dev/null +++ b/bin/config/rates/data.rate @@ -0,0 +1 @@ +56.81 \ No newline at end of file diff --git a/bin/config/rates/devops.rate b/bin/config/rates/devops.rate new file mode 100644 index 0000000..129beeb --- /dev/null +++ b/bin/config/rates/devops.rate @@ -0,0 +1 @@ +59.11 \ No newline at end of file diff --git a/bin/config/rates/dotnet.rate b/bin/config/rates/dotnet.rate new file mode 100644 index 0000000..9a43705 --- /dev/null +++ b/bin/config/rates/dotnet.rate @@ -0,0 +1 @@ +49.00 \ No newline at end of file diff --git a/bin/config/rates/frontend.rate b/bin/config/rates/frontend.rate new file mode 100644 index 0000000..83185d0 --- /dev/null +++ b/bin/config/rates/frontend.rate @@ -0,0 +1 @@ +41.00 \ No newline at end of file diff --git a/bin/config/rates/fullstack.rate b/bin/config/rates/fullstack.rate new file mode 100644 index 0000000..e92548e --- /dev/null +++ b/bin/config/rates/fullstack.rate @@ -0,0 +1 @@ +88.66 \ No newline at end of file diff --git a/bin/config/rates/java.rate b/bin/config/rates/java.rate new file mode 100644 index 0000000..9a43705 --- /dev/null +++ b/bin/config/rates/java.rate @@ -0,0 +1 @@ +49.00 \ No newline at end of file diff --git a/bin/config/rates/ml.rate b/bin/config/rates/ml.rate new file mode 100644 index 0000000..9a43705 --- /dev/null +++ b/bin/config/rates/ml.rate @@ -0,0 +1 @@ +49.00 \ No newline at end of file diff --git a/bin/config/rates/mobile.rate b/bin/config/rates/mobile.rate new file mode 100644 index 0000000..afc2c6d --- /dev/null +++ b/bin/config/rates/mobile.rate @@ -0,0 +1 @@ +47.00 \ No newline at end of file diff --git a/bin/config/rates/odoo.rate b/bin/config/rates/odoo.rate new file mode 100644 index 0000000..6e395fa --- /dev/null +++ b/bin/config/rates/odoo.rate @@ -0,0 +1 @@ +20.00 \ No newline at end of file diff --git a/bin/config/rates/php.rate b/bin/config/rates/php.rate new file mode 100644 index 0000000..9a43705 --- /dev/null +++ b/bin/config/rates/php.rate @@ -0,0 +1 @@ +49.00 \ No newline at end of file diff --git a/bin/config/rates/python.rate b/bin/config/rates/python.rate new file mode 100644 index 0000000..9a43705 --- /dev/null +++ b/bin/config/rates/python.rate @@ -0,0 +1 @@ +49.00 \ No newline at end of file diff --git a/bin/config/rates/ruby.rate b/bin/config/rates/ruby.rate new file mode 100644 index 0000000..628c8f1 --- /dev/null +++ b/bin/config/rates/ruby.rate @@ -0,0 +1 @@ +31.00 \ No newline at end of file diff --git a/bin/qr_secret.sh b/bin/qr_secret.sh index 450778a..9b875e2 100755 --- a/bin/qr_secret.sh +++ b/bin/qr_secret.sh @@ -53,12 +53,6 @@ apps_title="${qrmsg_000}" # Verificar dependencias check_dependencies() { - # Verificar si dialog está instalado - if ! command -v dialog &> /dev/null; then - # Sin dialog, tenemos que usar echo - echo "Error: ${qrmsg_013}. ${cvmsg_014}" - exit 1 - fi # Verificar si zbar está instalado if ! command -v zbarimg &> /dev/null; then @@ -137,26 +131,6 @@ get_output_name() { return 0 } -# Seleccionar archivo QR -select_qr_file() { - # Usar dialog directamente para seleccionar un archivo - local home_dir="$HOME/" - - exec 3>&1 - local selected_file=$(dialog --backtitle "$title" --title "${qrmsg_003}" \ - --stdout --fselect "$home_dir" 15 60) - local exit_code=$? - exec 3>&- - - if [ $exit_code -ne 0 ] || [ ! -f "$selected_file" ]; then - # Usuario canceló o no seleccionó un archivo válido - return 1 - fi - - echo "$selected_file" - return 0 -} - # Extraer secreto de imagen QR extract_secret() { local qr_file="$1" @@ -180,7 +154,7 @@ extract_secret() { fi fi - echo "$secret" + echo "$(echo "$secret" | base64)" return 0 } @@ -212,9 +186,40 @@ save_encrypted_secret() { # Función principal main() { + + # Verificar si dialog está instalado + if ! command -v dialog &> /dev/null; then + # Sin dialog, tenemos que usar echo + echo "Error: ${qrmsg_013}. ${cvmsg_014}" + exit 1 + fi + # Verificar dependencias check_dependencies + # Seleccionar archivo QR + # Usar dialog_input_filepath de console.lib para seleccionar un archivo + local home_dir="$HOME/*.jpg" + dialog_input_filepath "$home_dir" "${qrmsg_003}" + if [ $? -ne 0 ]; then + clear + dialog_error_box "${head_info}" "${qrmsg_010}" + exit 0 + fi + + # Verificar el resultado + if [ "$valid_file" == "1" ]; then + qr_file="$result" + return 0 + else + # Usuario canceló o no seleccionó un archivo válido + return 1 + fi + + # Extraer secreto de la imagen QR + local secret=$(extract_secret "$qr_file") + local extract_status=$? + # Solicitar nombre del archivo local output_name=$(get_output_name) if [ $? -ne 0 ]; then @@ -223,17 +228,6 @@ main() { exit 0 fi - # Seleccionar archivo QR - local qr_file=$(select_qr_file) - if [ $? -ne 0 ]; then - clear - dialog_error_box "${head_info}" "${qrmsg_010}" - exit 0 - fi - - # Extraer secreto de la imagen QR - local secret=$(extract_secret "$qr_file") - local extract_status=$? if [ $extract_status -ne 0 ]; then dialog_error_box "${qrmsg_012}" "${qrmsg_007}" @@ -255,4 +249,4 @@ main() { } # Ejecutar función principal -main \ No newline at end of file +main