changes contributed by ~seifferth

This commit is contained in:
deepend 2023-12-13 17:54:34 +00:00
parent e35d0b8d4a
commit cd7072a5ef
5 changed files with 105 additions and 18 deletions

46
gemlog.gmi Executable file
View File

@ -0,0 +1,46 @@
#!/bin/sh
printf "20 text/gemini\r\n"
cat <<EOF
=> index.gmi back to main index
# Aggregated gemlog for all users of tilde.club
While this is an aggregated gemlog for all users, this does not imply that it is also a list of all posts. For one thing, this aggregated gemlog only includes links that follow the gemini companion specification for subscribing to text/gemini pages. For another, it only includes links found in one of only a few prominent entry points that are suspected of containing gemlogs (such as the main index.gmi file of a capsule or a file called gemlog.gmi, for example). If you are a tilde.club user and your gemlog is not included in the list, please feel free to request its inclusion by sending an email to seifferth@tilde.club.
EOF
get() {
grep \
'^=>[ ]\+[^ ]\+[ ]\+[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]' \
-s "$@" |
sed 's,\t, ,g;s, *$,,
s,^/home/,,
# Link processing in sed can be quite messy; Hence the comments
# on this part of the script.
#
# Process absolute links containing a scheme and all
s,\([^/]\+\)/public_gemini/[^:]*:=> *\([a-z]\+://\),\1\t\2,
# Process absolute links that do not contain any scheme. This
# includes scheme-relative and site-relative links and should
# work fine in both cases.
s,\([^/]\+\)/public_gemini/[^:]*:=> */,\1\t/,
# Treat all remaining links as relative to the files location.
s,\([^/]\+\)/public_gemini/\([^:]*/\)\?[^:]*:=> *,\1\t/~\1/\2,
s,^\([^\t]\+\)\t\(.*\)$,\2\t\1,
s,^\([^ ]*\) \+\([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\)[ :-]*,\2\t\1 \2 ,'
}
( get \
/home/*/public_gemini/index.gmi \
/home/*/public_gemini/gemlog.gmi \
/home/*/public_gemini/blog.gmi \
/home/*/public_gemini/gemlog/index.gmi \
/home/*/public_gemini/gemlog/all.gmi \
/home/*/public_gemini/blog/index.gmi \
/home/*/public_gemini/blog/all.gmi \
/home/*/public_gemini/text/gemlog.gmi \
/home/*/public_gemini/journal/index.gmi \
/home/*/public_gemini/log/index.gmi
) | sort -r | uniq | sed 's,^[^\t]\+\t,,;s,^\(.*\)\t\([^\t]*\)$,=> \1 (by ~\2),'

View File

@ -2,23 +2,26 @@
printf "20 text/gemini\r\n"
printf "hello gemini!!\n"
printf '```\n'
cowsay WELCOME TO TILDE.CLUB A PLACE FOR WEBPAGES
printf '```\n'
printf "\n"
printf "we're a a digital community for socializing, \n"
printf "learning, and making cool stuff\n"
printf "\n"
printf "visit us in gopher and html lands for more info\n"
printf "\n"
printf "here are our esteemed users:\n"
printf "if you're not appearing here, mkdir ~/public_gemini\n"
cat <<EOF
hello gemini!!
$(printf '```')
$(cowsay WELCOME TO TILDE.CLUB A PLACE FOR WEBPAGES)
$(printf '```')
for user in $(ls -d1 /home/*/public_gemini); do
user=$(stat -c '%U' $user)
if [[ -f /home/$user/public_gemini/index.gmi ]]; then
printf "=> gemini://tilde.club/~%s/ ~%s\n" "$user" "$user"
fi
done
We're a a digital community for socializing, learning, and making cool stuff. Visit us in gopher and html lands for more info.
Here are some recent gemlog posts by our esteemed users:
$(./gemlog.gmi | grep \
'^=>[ \t]\+[^ ]\+[ \t]\+[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]' |
head -n6)
=> gemlog.gmi See the complete list of aggregated gemlog posts
To see a complete list of gemini users on this server, choose one of the following links:
=> users.gmi All gemini users (sorted alphabetically)
=> users-lastmod.gmi All gemini users (sorted by last modification of their gemini capsule)
EOF

1
security.txt Normal file
View File

@ -0,0 +1 @@
root@tilde.club

18
users-lastmod.gmi Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
printf "20 text/gemini\r\n"
cat <<EOF
=> index.gmi back to main index
# Users sorted by last modification of their gemini capsule
EOF
for user in $(ls -d1 /home/*/public_gemini|sed 's,^/home/,,;s,/public_gemini$,,'); do
if ! cmp -s /etc/skel/public_gemini/index.gmi /home/$user/public_gemini/index.gmi; then
date="$(find "/home/$user/public_gemini" -type f -printf '%CF\n'|sort -r|head -n1)"
test "$date" || continue
printf "%s\t=> gemini://tilde.club/~%s/ ~%s\n" "$date" "$user" "$user"
fi
done | sort -k1,1r | sed 's,^\([^\t]*\)\t\([^\t]*\)$,\2 (modified \1),'

19
users.gmi Executable file
View File

@ -0,0 +1,19 @@
#!/bin/sh
printf "20 text/gemini\r\n"
cat <<EOF
=> index.gmi back to main index
# Users sorted alphabetically
EOF
for user in $(ls -d1 /home/*/public_gemini|sed 's,^/home/,,;s,/public_gemini$,,'); do
if ! cmp -s /etc/skel/public_gemini/index.gmi /home/$user/public_gemini/index.gmi; then
# Skip empty public_gemini directories
test $(find /home/$user/public_gemini -type f|head -n1|wc -l) -gt 0 || continue
# Print link
printf "=> gemini://tilde.club/~%s/ ~%s\n" "$user" "$user"
fi
done