#!/bin/sh
# Validate environment
if ! command -v msgbus > /dev/null; then
printf "missing msgbus command. Use: go install git.mills.io/prologic/msgbus/cmd/msgbus@latest"
exit 1
fi
if ! command -v salty > /dev/null; then
printf "missing salty command. Use: go install go.mills.io/salty/cmd/salty@latest"
exit 1
fi
if ! command -v salty-keygen > /dev/null; then
printf "missing salty-keygen command. Use: go install go.mills.io/salty/cmd/salty-keygen@latest"
exit 1
fi
if [ -z "$SALTY_IDENTITY" ]; then
export SALTY_IDENTITY="$HOME/.config/salty/$USER.key"
fi
get_user () {
user=$(grep user: "$SALTY_IDENTITY" | awk '{print $3}')
if [ -z "$user" ]; then
user="$USER"
fi
echo "$user"
}
stream () {
if [ -z "$SALTY_IDENTITY" ]; then
echo "SALTY_IDENTITY not set"
exit 2
fi
jq -r '.payload' | base64 -d | salty -i "$SALTY_IDENTITY" -d
}
lookup () {
if [ $# -lt 1 ]; then
printf "Usage: %s nick@domain\n" "$(basename "$0")"
exit 1
fi
user="$1"
nick="$(echo "$user" | awk -F@ '{ print $1 }')"
domain="$(echo "$user" | awk -F@ '{ print $2 }')"
curl -qsSL "https://$domain/.well-known/salty/${nick}.json"
}
readmsgs () {
topic="$1"
if [ -z "$topic" ]; then
topic=$(get_user)
fi
export SALTY_IDENTITY="$HOME/.config/salty/$topic.key"
if [ ! -f "$SALTY_IDENTITY" ]; then
echo "identity file missing for user $topic" >&2
exit 1
fi
msgbus sub "$topic" "$0"
}
sendmsg () {
if [ $# -lt 2 ]; then
printf "Usage: %s nick@domain.tld <message>\n" "$(basename "$0")"
exit 0
fi
if [ -z "$SALTY_IDENTITY" ]; then
echo "SALTY_IDENTITY not set"
exit 2
fi
user="$1"
message="$2"
salty_json="$(mktemp /tmp/salty.XXXXXX)"
lookup "$user" > "$salty_json"
endpoint="$(jq -r '.endpoint' < "$salty_json")"
topic="$(jq -r '.topic' < "$salty_json")"
key="$(jq -r '.key' < "$salty_json")"
rm "$salty_json"
message="[$(date +%FT%TZ)] <$(get_user)> $message"
echo "$message" \
| salty -i "$SALTY_IDENTITY" -r "$key" \
| msgbus -u "$endpoint" pub "$topic"
}
make_user () {
mkdir -p "$HOME/.config/salty"
if [ $# -lt 1 ]; then
user=$USER
else
user=$1
fi
identity_file="$HOME/.config/salty/$user.key"
if [ -f "$identity_file" ]; then
printf "user key exists!"
exit 1
fi
# Check for msgbus env.. probably can make it fallback to looking for a config file?
if [ -z "$MSGBUS_URI" ]; then
printf "missing MSGBUS_URI in environment"
exit 1
fi
salty-keygen -o "$identity_file"
echo "# user: $user" >> "$identity_file"
pubkey=$(grep key: "$identity_file" | awk '{print $4}')
cat <<- EOF
Create this file in your webserver well-known folder. https://hostname.tld/.well-known/salty/$user.json
{
"endpoint": "$MSGBUS_URI",
"topic": "$user",
"key": "$pubkey"
}
EOF
}
# check if streaming
if [ ! -t 1 ]; then
stream
exit 0
fi
# Show Help
if [ $# -lt 1 ]; then
printf "Commands: send read lookup"
exit 0
fi
CMD=$1
shift
case $CMD in
send)
sendmsg "$@"
;;
read)
readmsgs "$@"
;;
lookup)
lookup "$@"
;;
make-user)
make_user "$@"
;;
esac
One down! More to go.
BREAKING: Russian billionaire Alisher Usmanovâs super yacht, one of the biggest in the world, seized in Germany - Forbes
Google no longer allows in-app donations that donât go through Google Play. https://github.com/streetcomplete/StreetComplete/issues/3768
One year ago to the date I made the lastest update for #phpub2twtxt to github and now 365 days later I have published #pixelblog as its successor - lets see where things are going for trip around the sun
@prologic@twtxt.net, who calls me name when I am busy profiting? đ In a less serious noteâbecause nothing is more serious than making profit, of courseâyes, it seems your avatar issue has been fixed. I am kind of sad, I looked forward each day to see which random one was going to show. LOL.
@prologic@twtxt.net let us take the path of less resistance, that is, less effort, for now. I am going to be a great-grandfather before search ever get implemented locally, least one to search on âall podsâ. In other words, let us donât bite more than we can chew. đč Neep-gren!
I just went to type the phrase âI avoid Linux like the plagueâ but then remembered that weâve all learned that most people wonât actually go much out of their way to avoid the plague.
@fastidious@arrakis.netbros.com the things Gemini has going for it are mutual TLS and lack of JavaScript. Which makes for a secure albeit boring experience (much like gopher). The fake markdown is a bit of a drag.
A render mode for Gemini probably wouldnt be too hard. There are markdown to Gemini libs out there.
With Web3 the whole trust a 3rd party browser ext + high fees + env impact for compute and storage are serious no gos for me.. I have heard one too many horror stories about clicking the wrong link and some script draining your metamask wallet.
@lyse@lyse.isobeef.org more often than not, it is! I mean, I try to go over the changes, but soon find myself in a web (not pun!), all entangled. Then say, âscrew it!â and to the bin it goes. đ„Ž
DS9 is best Star Trek. And that last second half of the last season where they go all out. chef kiss
No on gitlab. If its self hosted gitea is best in class.
I can see hosting a mirror on github if only for the redundancy/visibility. Some projects will host but then direct contributions on their self host. Like Go does.
I would suggest using a vanity domain that can redirect tools like go get to hosting of choice. And not require rewriting all the packages any time it gets moved.
Yep! https://git.mills.io/yarnsocial/yarn/src/branch/master/internal/webmention/webmention.go#L150-L156
Now, onto the real question: what to eat? Partner isnât home, so zero nutritional supplements have been consumed, and I have been lazy enough not to go out to fetch me something. So⊠hmm, yeah. Going to an eight years old niece birthday âroller scattingâ party in an hour, maybe I get lucky with a slice of pizza, or two. đ€Ł
@movq@www.uninformativ.de
Aha! Cool! Not just deleting, but proceeding as if the twt is going to be send. If I :q! on vi it will add an empty line. If, instead, I go :x like I normally do, it works as you saidâand as I wanted it. Thanks!
Is it me, or Gmailâs web interface is going down the drain? Using Safariâmy default browserâoften takes two, or three clicks to open an email. If it werenât because its search is amazing, I would never visit its web interface.
@eldersnake@yarn.andrewjvpowell.com
Seems like you need to make your parser smarter. Go tinker! đ
Now, if there is going to be some sort of price, which for me equals to profit, then I will twt non-stop until I hit it! đ€Ł
Having usedâand still usingâ1Password (a password manager) for many years, I have gone through a few stages of disliking/frustration with it. The first was when subscriptions were set in place, the second is now, with their approach for auto-filling under iOS. It is, more often than I would like to, telling me to configure it when I did so from day one. My open support ticket isnât going too far either.
I wish iCloud KeyChain would mimic some of its features, so I can just dump it. KeyChain has improved a lot, now allowing OTP to be saved with a credential, but it is still not quite there yet.
Appleâs event on Monday is bringing, as always, speculation to the table. One thing most outlets seem to agree is the introduction of an âM1Xâ chip, thought Apple might call it differently. M1X might also mean, M1(we donât know what comes after, or next generation). Either way, I would really like to see the return of the 27â iMac, but I will not hold my breath. Nevertheless, Monday is going to be an exciting day for many, including me! đ
@adi@f.adi.onl Oh boy⊠we donât want to go down that route. There is plenty to know about the Taliban, not just from the news but from people who livedâand still livesâunder their âgovernanceâ; all of which is, I am afraid, much more accurate than your highschool girlfriend story telling.
@prologic@twtxt.net Hopefully this URL change fixes things. Otherwise I am lost; donât know whatâs going on. đ©
Entirely sensible, & no reason for file storage to match the wire format. Iâm just really curious whatâs going on on macOS! I can test on hfs+ later.ïżŒ
I had a Pleroma node up for a little bit. It sort of died for some reason a few months later because its resource usage kept going up.
@lyse@lyse.isobeef.org @adi@twtxt.net @prologic@twtxt.net @movq@www.uninformativ.de Awesome man! Welcome to the Go coding for work club!
Just over a week left to apply to Summer of Code. Plan 9 is in there, and ~200 other good orgs. Go apply and tell students you know. https://summerofcode.withgoogle.com/
Sure. I think search, if itâs going to exist, should be the clientâs responsibility. But I also value the readability of the raw twtxt file a lot more than yâall do.
Bookmarking this to read over a few more times. https://dave.cheney.net/practical-go/presentations/qcon-china.html #practical #GO
@lyse@lyse.isobeef.org (#hut4mnq) I am so sorry for you. I left my Java job for Go. Though through ârestructuringâ its become a Python job.
Iâm unclear if Iâm going to do the twtxt.net discovery protocol; neither my web server nor Plan 9âs default capture agent strings. :-/
@prologic@twtxt.net Looks like twtxt.net is already happy with it, so thatâs good! Iâm just going to aim for that.
@prologic@twtxt.net https://github.com/JonLundy/twtxt/tree/xuu/integrate-lextwt I made a stats command for the new parser that extracts a bunch of info about a twtxt file. run like: go run ./cmd/stats https://twtxt.net/user/prologic/twtxt.txt
@prologic@twtxt.net as promised! https://github.com/JonLundy/twtxt/blob/xuu/integrate-lextwt/types/lextwt/lextwt_test.go#
the lexer is nearing completion.. the tough part left is rooting out all the formatting code.
@prologic@twtxt.net yeah it would replace rice. best part is that itâs in the go build step so you donât need to do any prep work with make.
So excited for Go embedded files. https://golangtutorial.dev/tips/embed-files-in-go/
@prologic@twtxt.netd so.. convert the 4 attributes in the struct to private, add getters plus some the other methods that make sense.
type Twt interface {
Twter() Twter
Text() string
MarkdownText() string
Created() time.Time
...
}
@prologic@twtxt.net I have some ideas to improve on twtxt. figure I can contribute some. đ bit more work and it will almost be a drop in replacement for ParseFile
Kinda wish types.Twt was an interface. itâs sooo close.
@prologic@twtxt.net it is some interesting work to decentralize all the things.. tricky part is finding tooling. i am using a self hacked version of the go openpgp library. A tool to add and remove notations would need to be local since it needs your private key.
@prologic@twtxt.net this is a go version of Keyoxide.org that runs all server side. which is based on work from https://metacode.biz/openpgp/
OpenPGP has a part of the self signature reserved for notatinal data. which is basically a bunch of key/values.
this site tries to emulate the identity proofs of keybase but in a more decentralized/federation way.
my next steps are to have this project host WKD keys which is kinda like a self hosting of your pgp key that are also discoverable with http requests.
then to add a new notation for following other keys. where you can do a kind of web of trust.
