From 7643802f713ddf3f8317d1095cbd30a2e89f693b Mon Sep 17 00:00:00 2001 From: creme Date: Tue, 4 Feb 2020 22:50:59 +0100 Subject: [PATCH] do not allow users to toot as envs and remove envs_toot from motd. --- bin/envs_toot | 4 ++++ etc/etc/sudoers | 4 ++-- etc/update-motd.d/30-envs-info | 7 +++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/bin/envs_toot b/bin/envs_toot index 14f4c7d..36d0fae 100755 --- a/bin/envs_toot +++ b/bin/envs_toot @@ -1,5 +1,9 @@ #!/usr/bin/env sh +if [ "$(id -u)" -ne 0 ] || [ "$(id -u)" -ne 10000 ]; then + printf 'sorry only root and creme can toot as envs.\n' && exit 1 +fi + print_usage() { printf 'usage: envs_toot "your message"\n\n' printf 'sample output:\nusername | your message\n' diff --git a/etc/etc/sudoers b/etc/etc/sudoers index 765e9ee..697e1aa 100644 --- a/etc/etc/sudoers +++ b/etc/etc/sudoers @@ -16,7 +16,7 @@ Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/b # Cmnd alias specification Cmnd_Alias THELOUNGE=/srv/thelounge/.yarn/bin/thelounge add * -Cmnd_Alias TOOT=/usr/bin/toot post * +#Cmnd_Alias TOOT=/usr/bin/toot post * # User privilege specification root ALL=(ALL:ALL) ALL @@ -26,7 +26,7 @@ services ALL=(ALL:ALL) NOPASSWD:ALL %sudo ALL=(ALL:ALL) ALL %envs ALL=(thelounge) NOPASSWD: THELOUNGE -%envs ALL=(services) NOPASSWD: TOOT +#%envs ALL=(services) NOPASSWD: TOOT # See sudoers(5) for more information on "#include" directives: diff --git a/etc/update-motd.d/30-envs-info b/etc/update-motd.d/30-envs-info index 6007415..e0c203c 100755 --- a/etc/update-motd.d/30-envs-info +++ b/etc/update-motd.d/30-envs-info @@ -9,18 +9,17 @@ cool things to do while you're here on envs.net: * gomuks - a terminal based matrix client written in go * neomutt - default @envs.net command line mail client * clinte - community notices system -* bbj - forum - command line bbs (bulletin butter and jelly) -* linkulator - a link aggregator for the shell +* bbj - forum - command line bbs ( bulletin butter and jelly ) +* linkulator - a link aggregator - gopher://envs.net/1/linkulator/ * who - see who else is connected right now * finger - get info on other users (local and remote) * envs - manage your users_info.json entrys and user-submitted scripts -* envs_toot - submit a post to the official envs.net pleroma account - (https://pleroma.envs.net/@envs) * pb - command line pastebin - see https://envs.sh and man pb * twtxt - minimalist microblogging service - see twtxt --help * todo-txt - simple todo managing * burrow - manage your gopherhole - try burrow -h to see the options * hole - open our envs.net gopherhole +* toot - a command-line mastodon client * feels - ttbp feels engine post to local feels, somewhere on your site, or gopher or bb - bashblog - see https://help.envs.net/blog/#with-bashblog