Skip to content

Commit

Permalink
Fixed checksums and readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
mesaprotector committed Dec 14, 2024
1 parent efedbad commit 1e4e199
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 21 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2024 mesaprotector <arcanapluvia at gmail dot com>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ depends=(
'sudo'
)
source=($url/archive/v$pkgver/$pkgname-v$pkgver.tar.gz)
sha256sums=('76cd4e35800a5e71f19c5c39924e98835d3719f86a77054c87a7fce33e522876')
sha256sums=('f24309efb5d25f400941181920b490075ccbdfaf79c0536fabe0f3cfbc180ac4')

package() {
cd "${srcdir}/${pkgname}-${pkgver}"
Expand Down
45 changes: 26 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,39 @@ Prompt for comments after certain actions as root

Requires: ttyecho (https://github.com/osospeed/ttyecho).

Think of this as complementing tools like etckeeper that do versioning control for system files. This
doesn't do versioning control - instead, all it does is bug you for a comment/explanation *every
time* certain commands are run through sudo. If you ever forgot why you installed a package, or ever
wondered why the hell you made that one-line change to /etc/bluetooth/main.conf, this tool might be
for you!

Since it depends on sudo, it won't prompt when you're logged in as real root. But it (optionally)
will if you get a root shell with sudo -s or sudo -i (see below).

The provided files are exactly what I use on my system (minus the license, I guess...). They include a
systemd service to monitor the sudo logfile using entr, and a config file geared towards Arch Linux with
pacman, bash as shell and vim as editor. However it should not be hard to get it to work on other
Think of this as complementing tools like etckeeper that do versioning
control for system files. This doesn't do versioning control - instead,
all it does is bug you for a comment/explanation *every time* certain
commands are run through sudo. If you ever forgot why you installed a
package, or ever wondered why the hell you made that one-line change to
/etc/bluetooth/main.conf, this tool might be for you!

Since it depends on sudo, it won't prompt when you're logged in as real
root. But it (optionally) will if you get a root shell with sudo -s or
sudo -i (see below).

Includes a systemd service to monitor the sudo logfile using entr, and
a config file geared towards Arch Linux with pacman, bash as shell and
vim as editor. However it should not be hard to get it to work on other
setups. For my setup, it's "feature-complete" (see issue #4).

With sudo alternatives like doas I'm not sure. It depends on their logging abilities. Would likely
require a major rewrite though.
With sudo alternatives like doas I'm not sure. It depends on their
logging abilities. Would likely require a major rewrite though.

You need to make a couple changes to the sudoers file for this to function:
You need to make a couple changes to the sudoers file for this to
function:

Defaults logfile=/var/log/sudo.log (replace with your preferred path)

Defaults!/usr/bin/bash log_subcmds (replace with your preferred shell)

Defaults>root !use_pty (this is included in the default config file and only needs to be uncommented)
Defaults>root !use_pty (this is included in the default config file and
only needs to be uncommented)

The second line above is to get sudo-comment to prompt even when editing files in a root shell
spawned with commands like sudo -i.
The second line above is to get sudo-comment to prompt even when
editing files in a root shell spawned with commands like sudo -i.

addcomment can be run manually if the terminal failed to run it (ex. if you type too fast :>). It will exit immediately if there isn't an unresolved change to the sudo log file though.
addcomment can be run manually if the terminal failed to run it (ex. if
you type too fast :>). It will exit immediately if there isn't a
waitcomment process in the background wondering why it hasn't heard
back from its child yet.

0 comments on commit 1e4e199

Please # to comment.