fix(aura-gui): rename product to 'Aura' + uppercase SETENV in sudoers

Two bugs visible after user's first Install-admin-access click:

1) `visudo -c` rejected the fragment because sudoers tags must be UPPERCASE.
   We wrote `setenv:` (lowercase) which sudoers does not recognise as a tag
   and treats as a command path, producing a syntax error at column 29 of
   /etc/sudoers.d/aura-gui:2 — and worse, the broken file stayed on disk
   so every subsequent `sudo` complained about the syntax error too (sudo
   still functions but the warning is noise).

   Fix: drop the `setenv:` tag entirely. We never needed it — the GUI only
   passes RUST_LOG to the child via env(), which `sudo -E` would forward
   but we deliberately chose not to (smaller surface). Removing the tag
   also removes the failure mode.

2) Product rename per user feedback ("переименуй пакет на просто Aura"):
   - tauri.conf.json `productName` and window title: `aura-gui` -> `Aura`
   - bundle now produces /Applications/Aura.app and Aura_0.1.0_aarch64.dmg
   - identifier `ru.undergr0und.aura` was already correct, no change
   - sudoers file is now /etc/sudoers.d/aura (was aura-gui), so the success
     message and revert hint are updated accordingly

The internal MacOS/ binary is still named `aura-gui` (Tauri uses the Cargo
crate name there) — not user-visible, only the dev internals see it.

Manual cleanup also performed on the dev host:
- /Applications/aura-gui.app removed
- /etc/sudoers.d/aura-gui (the broken fragment from the first failed
  install attempt) removed via `osascript ... with administrator
  privileges` so sudo is no longer logging syntax errors

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
xah30
2026-05-29 19:39:04 +03:00
parent 1635190797
commit dbee9d8b93
2 changed files with 16 additions and 13 deletions
+14 -11
View File
@@ -268,22 +268,25 @@ fn install_sudoers_admin(state: tauri::State<'_, Arc<AppState>>) -> Result<Strin
#[cfg(unix)]
{
// Sudoers fragment. `%admin` matches the macOS admin group (which the desktop user is
// always a member of on a single-user Mac). `setenv:RUST_LOG` lets us forward verbose
// logging from the GUI to the child without `sudo -E`.
// always a member of on a single-user Mac). Sudoers tags must be UPPERCASE — `SETENV:`
// would be valid; we omit it because the GUI already sets RUST_LOG and we don't need
// sudo to pass it through (the env var inherits through sudo for explicitly named
// variables in /etc/sudoers `Defaults env_keep` — and aura has its own defaults anyway).
let fragment = format!(
"# Installed by aura-gui — NOPASSWD for `aura client` only.\n\
%admin ALL=(root) NOPASSWD: setenv: {bin_path} client *\n"
"# Installed by Aura GUI — NOPASSWD for `aura client` only.\n\
%admin ALL=(root) NOPASSWD: {bin_path} client *\n"
);
// The shell script is run inside `osascript do shell script … with administrator
// privileges`, which prompts via the native auth dialog and runs as root.
// privileges`, which prompts via the native auth dialog and runs as root. We write to
// a name-stable path (/etc/sudoers.d/aura) so subsequent installs overwrite cleanly.
let escaped = fragment.replace('"', "\\\"").replace('$', "\\$");
let shell_cmd = format!(
"umask 077 && \
cat > /etc/sudoers.d/aura-gui <<'AURA_GUI_EOF'\n{escaped}AURA_GUI_EOF\n\
chown root:wheel /etc/sudoers.d/aura-gui && \
chmod 0440 /etc/sudoers.d/aura-gui && \
visudo -c -f /etc/sudoers.d/aura-gui"
cat > /etc/sudoers.d/aura <<'AURA_EOF'\n{escaped}AURA_EOF\n\
chown root:wheel /etc/sudoers.d/aura && \
chmod 0440 /etc/sudoers.d/aura && \
visudo -c -f /etc/sudoers.d/aura"
);
let osa = format!(
"do shell script \"{}\" with administrator privileges",
@@ -306,8 +309,8 @@ fn install_sudoers_admin(state: tauri::State<'_, Arc<AppState>>) -> Result<Strin
));
}
Ok(format!(
"✓ /etc/sudoers.d/aura-gui installed. The Connect button now spawns aura without \
a password prompt. To revert later: `sudo rm /etc/sudoers.d/aura-gui`."
"✓ /etc/sudoers.d/aura installed. The Connect button now spawns aura without \
a password prompt. To revert later: `sudo rm /etc/sudoers.d/aura`."
))
}
#[cfg(windows)]
+2 -2
View File
@@ -1,6 +1,6 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "aura-gui",
"productName": "Aura",
"version": "0.1.0",
"identifier": "ru.undergr0und.aura",
"build": {
@@ -12,7 +12,7 @@
"app": {
"windows": [
{
"title": "aura-gui",
"title": "Aura",
"width": 800,
"height": 600
}