File tree 6 files changed +315
-313
lines changed
6 files changed +315
-313
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,11 @@ misc/toot.json
2
2
renew-wildcard.sh
3
3
fuzzies.log
4
4
fuzzies-historical.log
5
+ fuzzies-denied.log
5
6
users-added.log
7
+ users-denied.log
8
+ users-maybe.log
6
9
newusers.dat
7
10
newuseralert.py
8
11
gotifytokens.txt
12
+ bin /instistats
Original file line number Diff line number Diff line change @@ -84,13 +84,20 @@ case $1 in
84
84
# to the main site
85
85
sort -u /etc/httpd-vusers.conf > /etc/httpd-vusers.conf.sorted
86
86
cp /etc/httpd-vusers.conf.sorted /etc/httpd-vusers.conf
87
- pkill -HUP httpd
87
+ # pkill -HUP httpd
88
+ rcctl restart httpd
88
89
89
90
# send welcome email
90
91
sed -e " s/newusername/$1 /g" /admin/misc/email.tmpl | mail -r admins@tilde.institute -s " welcome to tilde.institute!" $2
91
92
92
93
# 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
94
101
95
102
# announce the new user's creation on mastodon
96
103
# then copy their ssh key to their home directory
Original file line number Diff line number Diff line change 1
- #! /usr/local/bin/bash
1
+ #! /bin/sh
2
+ set -eu
2
3
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
6
8
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'
Original file line number Diff line number Diff line change 1
- #!/usr/local/bin/python2
1
+ #!/usr/local/bin/python3
2
2
3
3
import json
4
4
import os
@@ -50,7 +50,7 @@ def toot(status, media):
50
50
status = "" .join (sys .stdin ).strip ()
51
51
52
52
# replace shortcodes with emoji :thumbsup:
53
- status = emoji .emojize (status , use_aliases = True )
53
+ status = emoji .emojize (status , language = 'alias' )
54
54
55
55
# check status length and post status
56
56
if len (status ) > 500 :
You can’t perform that action at this time.
0 commit comments