Skip to content

Commit 7d39c4e

Browse files
author
admins
committed
updated some files that had drifted locally
1 parent e475fb1 commit 7d39c4e

File tree

6 files changed

+315
-313
lines changed

6 files changed

+315
-313
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ misc/toot.json
22
renew-wildcard.sh
33
fuzzies.log
44
fuzzies-historical.log
5+
fuzzies-denied.log
56
users-added.log
7+
users-denied.log
8+
users-maybe.log
69
newusers.dat
710
newuseralert.py
811
gotifytokens.txt
12+
bin/instistats

bin/instistats

-3.36 MB
Binary file not shown.

bin/makeuser

+9-2
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,20 @@ case $1 in
8484
# to the main site
8585
sort -u /etc/httpd-vusers.conf > /etc/httpd-vusers.conf.sorted
8686
cp /etc/httpd-vusers.conf.sorted /etc/httpd-vusers.conf
87-
pkill -HUP httpd
87+
#pkill -HUP httpd
88+
rcctl restart httpd
8889

8990
# send welcome email
9091
sed -e "s/newusername/$1/g" /admin/misc/email.tmpl | mail -r admins@tilde.institute -s "welcome to tilde.institute!" $2
9192

9293
# subscribe to mailing list
93-
echo " " | doas -u $1 mail -s "subscribe" institute-join@lists.tildeverse.org
94+
#echo " " | doas -u $1 mail -s "subscribe" institute-join@lists.tildeverse.org
95+
96+
# lock down the users' history files so they can't be deleted or truncated (bash and ksh only)
97+
doas -u "$1" touch /home/$1/.history
98+
doas -u "$1" touch /home/$1/.bash_history
99+
chflags uappnd /home/$1/.history
100+
chflags uappnd /home/$1/.bash_history
94101

95102
# announce the new user's creation on mastodon
96103
# then copy their ssh key to their home directory

bin/rmuser

+15-14
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
#!/usr/local/bin/bash
1+
#!/bin/sh
2+
set -eu
23

3-
# Hopefully, this never has to be used.
4-
# Cleans up and removes a user from the system.
5-
# gbmor <ben@gbmor.dev>
4+
if [ -z "$1" ]; then
5+
printf 'Please pass a user as the first argument.\n'
6+
exit 1
7+
fi
68

7-
echo "Removing user $1 from the system"
8-
userdel $1
9-
echo "Cleaning /home and /var/www/users"
10-
rm -rf /home/$1
11-
rm -rf /var/www/users/$1
12-
echo "Removing httpd config"
13-
rm -f /etc/httpd/$1.conf
14-
httpdpid=`pgrep httpd | awk 'NR==1{print $1}'`
15-
kill -HUP $httpdpid
16-
echo "Done! Don't forget to remove the appropriate include line from httpd-vusers.conf"
9+
printf 'Removing user %s from the system\n' "$1"
10+
userdel -r -v "$1"
11+
printf 'Cleaning /var/www/users/%s\n' "$1"
12+
rm -rf "/var/www/users/$1"
13+
printf 'Deleting cgit repos\n'
14+
rm -rf "/var/www/cgit_repos/$1"
15+
printf 'Removing httpd config\n'
16+
rm -f "/etc/httpd/$1.conf"
17+
printf 'You need to remove the include line from httpd-vusers.conf and restart httpd\n'

bin/toot.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/local/bin/python2
1+
#!/usr/local/bin/python3
22

33
import json
44
import os
@@ -50,7 +50,7 @@ def toot(status, media):
5050
status = "".join(sys.stdin).strip()
5151

5252
# replace shortcodes with emoji :thumbsup:
53-
status = emoji.emojize(status, use_aliases=True)
53+
status = emoji.emojize(status, language='alias')
5454

5555
# check status length and post status
5656
if len(status) > 500:

0 commit comments

Comments
 (0)