Config is run as shell by hotkey/doctor but parsed literally by systemd and Settings

Abierto
#95 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
shell
Área
backend, cli

Línea de trabajo

Read bin/hermeskey, bin/hermeskey-doctor, hermeskey-settings.py, scripts/check-config.sh, and hermeskey.service to trace how each reads the config. Compare the shell and systemd parsing rules, then choose one of the two proposals and check whether the hotkey, Doctor, Settings, and service handle values consistently. Done means the chosen behavior is implemented and documented or validated across those entry points.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

documentation enhancement future consideration

Summary

The config file is handled inconsistently:

  • bin/hermeskey and bin/hermeskey-doctor run it as shell code (source "$CONFIG_FILE").
  • hermeskey-settings.py deliberately avoids that (it only passes validated literal values to Doctor), and scripts/check-config.sh refuses non-literal PYTHON_STT, because Bash and systemd EnvironmentFile= parse values differently.
  • hermeskey.service reads the same file with systemd's parser.

So values like MODEL=$HOME/models/x or SOCK=$XDG_RUNTIME_DIR/… work for the hotkey but not the service. The two can disagree on the model or socket path (and the hotkey may start a second server). It also means the "advanced config" is executable shell code. The file is user-owned and 0600, so this is a consistency/clarity issue rather than a cross-user vulnerability.

Proposal (pick one)

  1. Replace source in the hotkey/doctor with a small literal KEY=value parser (same rules as systemd: no expansion, no command substitution), ideally shared with hermeskey_settings_config.py; or
  2. Keep source, but document clearly that the file is trusted shell code and that only literal values behave the same for the service. Doctor could also warn when it finds $, backticks, or export lines.
Lenguaje dominante
Shell
Estrellas
0
Forks
0
Merge medio
16 min
PR fusionados (30 d)
40

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de graygarbage/HermesKey

Todos los issues de graygarbage/HermesKey

Issues similares

Más issues de Shell/Bash

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.