Commit graph

13 commits

Author SHA1 Message Date
inx
692800c5d9
chore: bump version 2026-01-28 21:59:36 +08:00
inx
a735c7cf84
chore: finish rename 2026-01-28 21:50:08 +08:00
inx
9a16f9a22e
chore: extend cargo informations 2026-01-28 21:20:59 +08:00
inx
adce0a5e0d
chore(rename): rename project from 'gosh' to 'naj'
This rebrands the CLI tool to 'naj' (Old Chinese reconstruction for "Me/I").
This name was chosen for better typing ergonomics (R-L-R alternation) and
availability on crates.io.

Changes:
- Update `Cargo.toml` package name to `naj`.
- Update binary name target to `naj`.
- Update documentation and README to reflect the new identity.

BREAKING CHANGE: The binary name is now `naj`. Users must update their
scripts and usage from `gosh` to `naj`.
2026-01-28 21:08:09 +08:00
inx
bb41d4acda
fix(mocking): some moking will leak
Fix leakage for the config while using `git config`.
2026-01-28 21:01:48 +08:00
inx
1bc109ae64
fix(security): sanitize gpg.ssh.program to prevent global config leaks
Explicitly inject `gpg.ssh.program=ssh-keygen` during blind injection.
Leaving this unset would allow global configuration (potentially malicious)
to bleed into the ephemeral session. Setting it to empty string causes
Git to crash. Using the system default `ssh-keygen` ensures both
stability and isolation.
2026-01-28 17:52:46 +08:00
inx
e512bd9e2a
chore: modify workflow scripts
calc hash for dist.
2026-01-28 16:36:20 +08:00
inx
593c5f8f7f
fix: critical patches for ssh signing, profile switching, and subdir support
fix: critical patches for ssh signing, profile switching, and subdir support

This release addresses several critical issues discovered during E2E testing:

- **fix(exec):** Prevent crash in Exec Mode when using SSH signing.
  - Sanitizer now resets `gpg.format` to "openpgp" and `gpg.ssh.program` to "ssh-keygen" instead of empty strings (which caused Git to exit with code 128).
- **fix(switch):** Correctly replace active profile instead of appending.
  - Now cleans up existing Gosh include paths before adding the new one to prevent ambiguous identity resolution.
- **fix(core):** Support running Gosh from deep subdirectories.
  - Replaced manual `.git` folder check with `git rev-parse` to correctly detect repository root.
- **security:** Hardened Blind Injection defaults to align with Git 2.52+ strictness.
2026-01-28 15:56:54 +08:00
inx
fe173e7d4a
feat(build): add cross compiling script 2026-01-27 17:12:32 +08:00
inx
98d8258061
chore: rename README
Renamed README to README.md to add markdown support.
2026-01-27 16:06:40 +08:00
inx
9898e1d486
chore(docs): add comprehensive README and usage guide
Adds a detailed README.md covering:
- Project core value proposition (Security & Isolation).
- Installation instructions.
- Detailed usage workflows (Setup, Exec, Switch, Management).
- Explanation of the "Blind Injection" security design.
- Configuration directory structure (XDG).
2026-01-27 15:25:07 +08:00
inx
999b270293
feat(core): implement secure multi-identity management system
This commit introduces the complete core logic for Gosh (Git Operations Shell),
providing a fail-safe mechanism for managing multiple Git identities.

Key features implemented:
- **Ephemeral Execution (Exec Mode)**: Uses `git -c` with blind injection to
  sanitize the environment (clearing user/gpg keys) before injecting the
  target profile. Zero disk modification.
- **Persistent Switching (Switch Mode)**: Modifies `.git/config` using
  `[include]` directive. Supports `-f` force mode to strictly sanitize
  legacy dirty configurations (removing user/gpg sections).
- **Setup Automation**: Handles `clone` and `init` by automatically inferring
  directory names and applying the profile immediately.
- **Profile Management**: CRUD operations (-c, -r, -e, -l) for profiles.
- **Config**: XDG-compliant configuration with auto-initialization at
  `~/.config/gosh/`.
- **Testing**: Comprehensive integration suite covering isolation, injection,
  persistence, and sanitization logic.

Implements strict security boundaries defined in the PRD (Blacklist/Whitelist).
2026-01-27 15:22:21 +08:00
inx
b3e139b689
chore: setup rust project 2026-01-27 15:01:08 +08:00