Logpheus banner

Logpheus

36 devlogs
52h 13m 1s

Basic Slack Bot that makes use of FT API to query for new devlogs and posts it to personal channels (for each personal channel you will have to provide your own api key i aint hitting ratelimit on my own api key for yall smh)

Demo Repository

Loading README...

Local Estwadiol Dealer Gizzy

I did some things 3c

  • It now redacts sensitive info in logs as it didn’t before
  • Improved FT API Handler so that I can easily modify it without it being annoying
  • Made it throw an error on dupe handler names as I keep accidentally not changing the name
  • Changed to use lib of checkAPIKey instead of manual implementation for each handler
  • Enforces strict typescript so that its easier to see issues in files
Attachment
Attachment
0
Local Estwadiol Dealer Gizzy

Since I forgor to devlog my changes yesturday/day before I’ll devlog it today for you cuties 3c

  • Fixed the disabled message not getting posted which caused people not to get alerted when bot broke for them as unauthorized
  • Wip of Projects Command mostly working but slack hates long tables idk how to fix that and still needs to fix pagination on it
  • System information on the stats command now
Attachment
Attachment
Attachment
Attachment
0
Local Estwadiol Dealer Gizzy

58 minutes for this? Damn peak! ANYWAY UPDATE yay

  • I added a drop command to make dev testing easier allowing me to drop data in db ONLY ON DEVPHEUS and only people with MY SLACK IDS so can’t happen on prod
  • Dropped sentryEnabled mostly everywhere as logtape is now used so I do the check if sentryEnabled in the sink so if its not enabled it uses console and if it is enabled it uses sentry

Changelog

Attachment
Attachment
Attachment
0
Local Estwadiol Dealer Gizzy

Quack another devlog colon three 3c
Update not really that big but still I need the hours

  • Increased deployment speed on builds from new commits by making apk (alpine linux package manager) cache and use the right bun cache location
  • Added MP (Multi-Platform) Dockerfile as I think my changes are really platform specific to alpine as I used apk cache folder on host too as my server runs alpine linux so to ensure other instances don’t break they can use MP
  • Updated the README to reflect new changes for docker with the MP but also to reflect the change in code for chosing how the prefix is chosen
  • I made the markdown parser more maintainable by swapping from a bunch of if’s to a switch statement and not using a bunch of numbers with match[] to find it and instead using match.groups! for group.,emoji etc so it actually makes sense
  • Fixed FT Utils emoji handler on FT messing up Logpheus’s emojis as it uses it was links so I had to make a parser to look for emoji.slack-edge.com and parse that for emojiName to use emojiName for emoji in slack

I LIED THIS WAS A BIG CHANGE BOZO GET LIED TO bleh

Attachment
Attachment
Attachment
0
Local Estwadiol Dealer Gizzy

Yeah I should probably devlog 3c
HAIIIII FLAVORTOWN VIEWERS AND QUACKERS som-duck
so this time was literally spent on literally debugging

  • I bwoke prod of logpheus so I needed to debug and a lot of the debugging was kinda vague so I swapped over to logtape so I can get better drizzle logging in sentry and also allow me to log easy with sentry
  • I added a lot of debug stuff to prod to see why it was down and found out IT WASNT MY CODE YAY it was a psql misconfiguration causing it to not allow wireguard connection
  • I moved prod back to server with db as db reqs was slow but now there is more chance of slack timing out requests but ig cope i want fast db requests not slow ones
Attachment
Attachment
0
Local Estwadiol Dealer Gizzy

HEYYY ITS ME FINALLY AGAIN ima just say the changes i made today as i cant remember all of the stuff i fixed a hwhile ago JESUS 17 DAYS SINCE LAST DEVLOG DAMN

ANYWAY

  • The logs was pretty vague especially for drizzle so I swapped to logtape to log all drizzle stuff to sentry enabled breadcrumbs to help debugging even more
  • Swapped the contexts to use logtape so its even better for contexts
  • Broke prod logpheus because slack broke saying i didnt own bot meaning i couldnt work on it adding new commands n stuff so i had to kick it from the workspace remake new account
  • DMed all private channel users about the kick so if they want to use it they just have to add it back and for public channel users I added it back for them
Attachment
Attachment
0
msw

Tagged your project as well cooked!

🔥 msw marked your project as well cooked! As a prize for your nicely cooked project, look out for a bonus prize in the mail :)

Local Estwadiol Dealer Gizzy

Chat, are we codemaxxing rn? no stupid we are bugfixing dumb ahh

  • Fixed my channel being spammed in dev cuz i dropped project table by adding fallback to checker to prevent that
  • Fixed sentry context not being included in commands/views sending sentry errors
  • I realised slack modals have private metadata and also has body so instead of manually parsing the channel and user id through view i used that to hide it from user
  • Idiotproofed the bot more because people somehow keep using other self hosted instances so now titles of modals use prefix as title which is different on every self hosted instance and for offical prod its just logpheus so if you STILL use wrong instance you are dumb nothing to say more about that
  • DATA COMMADN TO SEE WHAT DATA LOGPHEUS HAS ON YOU YIPEEEEEEEEEEE yay
  • Config command not channel specific now it uses user id to update api key
  • Tells user that prod exploded instead of ghostting them when it does
Attachment
Attachment
0
Local Estwadiol Dealer Gizzy

Almost 3 hours again GOD i kinda forgor was gonna do one this morning but devlogs was done ANYWAY

  • Register command and project command to register to use bot as general purpose just for its commands, user to get a persons profile and project to look at project by id bleh
  • Bug fixes such as shutting up the error logged when FT did a restart or anything like that sickbro
  • Drops disabled clients from saved clients arr because they are disabled
  • More bug fixes as an FT api route changed without me knowing breaking the bot so had to fix that and fallback so if it happens again it logs to sentry as sus sussy
  • Did a update to readme to match new stuff yay
Attachment
Attachment
Attachment
0
Local Estwadiol Dealer Gizzy

oop 3h already past jesus anyway
i fixed sum bugs
user command! get someones ft profile from sometimes slack account
opt outs column for something soon owo

Attachment
0
Local Estwadiol Dealer Gizzy

Another time for a devlog!!!!!!!!!!!!!!!!!!!!!!! BLEH :hyper-dino-wave:
I spent most of the time improving the error handling of logpheus so it makes use of MY BUGSINK MOREEEE and its more specific with errors so now if it isnt 401 it doesnt default to no project exists at id it only does that at 404 :3c with MORE CONTEXT TOO so better easier debugging

Attachment
0
Local Estwadiol Dealer Gizzy

uhm pushed to prod the changes i madeto table etc fixed sum stuff took down prod for like half and hour as u do so fixed that because of dumb migration issues bleh but it does make use of new tables now for data not all data in new tables tho like last devlog timestamp or the store of user ids so i need to manually add uids in for users previous to the update but also change it so it stores and uses last devlog timestamp as main check and fallback to id check if need be

Attachment
Attachment
0
Local Estwadiol Dealer Gizzy

bleh more time for me! I did sum cleaning moving devlog check to sept file and no longer rely on loadApiKeys which is super overkill for 1 function using it since func was legacy code used a lot before changing to drizzle etc

Attachment
2

Comments

sabio (USE SPICETOWN)

please ignore this comment :hs:

Local Estwadiol Dealer Gizzy

uuh wattefigmaballs comment is ts stinky pants

Local Estwadiol Dealer Gizzy

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
I work on moving schema :3c and also cleaning up the codebase so its more readable as ts confusing also improved schema migration by learning how to actually use drizzle frfr

Attachment
1

Comments

Local Estwadiol Dealer Gizzy

Well uhm this was a crazy one, a self hosted instance caused offical to die because of how slack handles slash commands its extremely secure setup allows other bots to overwrite the slash commnads you have to their own and dw it does the exact opposite of telling user this it still shows that the command you are about to run is from the offical bot so i had to modify it so self hosted instances now use user id and bot user as prefix to fix it also updating schema to work more efficiently then and clean up code

Attachment
Attachment
0
Local Estwadiol Dealer Gizzy

Mreowwwww! I’m literally just improving logpheus handling of issues to use bugsink to post errors so I can read but also handle 401 errors better so I’m not being spammed with errors because you guys being annoying with your api keys

Attachment
0
Local Estwadiol Dealer Gizzy

Bleh not devlogged this in a while but i got time so might aswell
Fixed bugs!

  • You can now add multiple projects to one api key as fixed bug preventing this
  • you can no longer be a stinky and try add the same project twice under a api key
Attachment
0
Local Estwadiol Dealer Gizzy

Shipped this project!

Hours: 13.12
Cookies: 🍪 258
Multiplier: 19.66 cookies/hr

Made a few changes to improve the bot blehhhhhhh

  • It now makes use of postgres in prod and pglite in dev using drizzle
  • Validates api keys given on add or configuration
  • fixes sum bugs in the bot
Local Estwadiol Dealer Gizzy

Nvm i hate code! 16m of more bug fixing to get it to stop spamming qwp

Attachment
0
Local Estwadiol Dealer Gizzy

I’m logging this cuz free time! Logpheus felt like going on a spamming spree because of a bug in my code. Every minute a check ran and my dumbass made it update db to the value of the check so every 2 minutes it would change value back to one that causes shipped message to post causing spam hopefully this should be fixed tho

Attachment
0
Local Estwadiol Dealer Gizzy

WOOOOOOO just took down prod for 10 minutes because im dumb! I spent this time fixing my dumb mistakes, adding support to use full postgres in prod so I only need pglite in dev making my life easier in both cases and adding validation of api keys when added!

Attachment
0
Local Estwadiol Dealer Gizzy

This whole devlog time was spent on another migration because I found out about pglite (postgres in wasm) and drizzle supported it so I migrated over to that instead because drizzle makes my life way more convienent especially working on logpheus it just took so long to setup as it was my first time using drizzle and i had to also create migration from sqlite and json to pglite to ensure no data loss.

Attachment
0
Local Estwadiol Dealer Gizzy

Migration!

Using json was really annoying especially for every project using their own cache json file for devlogs so instead i swapped to SQL which is using bun:sqlite for storing api keys, projects etc taking advantage of buns implementation which is pretty fast but also its less resource usage slightly because I’m not using json for everything I need parsing it stringifying it pushing it to file a lot. All previous json files will be migrated on start to the new db.

Attachment
0
Local Estwadiol Dealer Gizzy

OKAY REAL DEVLOG THIS TIME, markdown support is now fully added i think yes

Attachment
0
Local Estwadiol Dealer Gizzy

Trying to implement support for markdown in logpheus
meow

i like potatos

Attachment
0
Local Estwadiol Dealer Gizzy

Haiiiiiiiiiiii

I NEED MARKDOWN TO TEST LOGPHEUS THIS ISNT REALLY A DEVLOG JUST TESTING SOMETHING DEVLOG SOON THO

REA
DK
YOUR BALD

  • QUACK
  • A
  1. A
  2. a
  • quacked at people today
  • meowed at people today
    sniffs you
arf arf

quacker


sadgagagdag

Attachment
0
Local Estwadiol Dealer Gizzy

UH MORE HOURS FOR ME YIPEEEEEE so basically i in this time explode prod a couple times because of the new dockerfile but fixed it added improved error handling so that it doesnt spam my logs when something like a 401 happens i added ability to change api key in a channel using /logpheus-config, i converted timestamps to utc and now use the good format not the us format for dates so DD/MM/YYYY and it is now clickable timestamp so users can click it and convert it to their timezone if they want to and i moved the ext header which is useless to axios.create instead of spammed in every func call

Attachment
0
Local Estwadiol Dealer Gizzy

Might aswell make a devlog for the stuff i did even though not really important. During this time I improved upon the add command to post more detail of the project when being added, I made changes to the Dockerfile to improve its build times using docker’s cache mounts and removing unnecessary stages (i stole the build file from buns website and its very over complicated for this) and I made pending review after ship message more clear and once reviewed message more clear.

Attachment
0
Local Estwadiol Dealer Gizzy

Shipped this project!

Hours: 3.51
Cookies: 🍪 69
Multiplier: 19.66 cookies/hr

From last ship i just improved upon the bot. It now has ship posts so it posts a msg when you ship a project and when it gets accepted i also cleaned up code to be more readable and easier to dev in and also with new api fields it uses less resources and hits api less hard and probably sum other stuff

Local Estwadiol Dealer Gizzy

Clean up of code to be more easier to develop in by seperating views/commands out into seperate files, fixed cache files that was done before latest update using differnet cache setup not causing any issues but with this update would of so it now migrates old caches to new format and now includes ship status!!!!!!!

Attachment
0
Local Estwadiol Dealer Gizzy

More improvements to the code! The bot message has improved to be more detailed with the devlog and also improved the code by setting types to the functions used so when called you can know what data is returned easily from typescript and your ide and also cleaned up some of the code.

Attachment
0
Local Estwadiol Dealer Gizzy

Okay bot now makes use of devlog_ids to check so less resources during hosting and should also mean less api hits :3c also now /logpheus-stats to see how many users it has and every req has header that makes bot show up on the extensions page

Attachment
0
Local Estwadiol Dealer Gizzy

I need a devlog to test but the bot’s handling system of new devlogs is being changed to do less work by making us of the new devlog_id in /api/v1/projects/:id making the bot and probably the api do less work thats just assuming but atleast the bot will do less work so peak!!!

Attachment
0
Local Estwadiol Dealer Gizzy

Shipped this project!

Hours: 4.77
Cookies: 🍪 94
Multiplier: 19.66 cookies/hr

I built Logpheus a bot that you can add to your personal channel to get your flavortown devlogs posted to. It requires your own api key which can only be used once per channel but multiple projects can be added to a channel. If you don’t want to give me your api key to use it then it has a self host guide using docker in its readme. I didn’t learn much part from how to use the flavortown api.

Local Estwadiol Dealer Gizzy

An extra 21 minutes for me because docker sucks! I literally spent 21 minutes just trying to get apiKeys to be persistant in the docker containuer using docker volumes i hate docker NOW ITS PRODTATO READY

Attachment
0
Local Estwadiol Dealer Gizzy

Prodtato. The bot is in prod and seems stable working in my channel! The docker is complete and also finished the readme showing how to use it but also how to self host it if you dont trust me with your api key which is BORING TRUST MEEEEEE its basically done i ship i think i did other stuff too but i forgor

Attachment
0
Local Estwadiol Dealer Gizzy

Woah fast fix too i swapped it to use api key instead sas the prefix only allowing 1 api key to be used for a channel but a channe4l can have multiple projects subscribed so yipeeeeeeeee

Attachment
0
Local Estwadiol Dealer Gizzy

Woah this was a fast devlog i made /logpheus-remove so you can now remove your project from a channel! and i also realised im an idiot! i now gotta modify the code to not use project id as a prefix and instead use channel id so someone cant block you from adding your proj to your channel because they added it to theres!

Attachment
0
Local Estwadiol Dealer Gizzy

The past hour I have been debugging and making the bot worked implementing /logpheus-add to add projects to the list and it works i just need to add /logpheus-remove now :3c and also docker support

Attachment
0
Local Estwadiol Dealer Gizzy

I need a devlog to test so uhm past hour and half i well made lib file for ft its a class file so i can use it in other projects if i want to too then using that i made it pull projects then pull devlogs if no cache file exists it adds all devlogs of project id which is in apiKeys.json which stores project id as key then under it the api key and channel to post it to

Attachment
2

Comments

Matei sHomePage (No.1 PHP Lover)

wow gizzy good job!!

Pascal Lösch
Pascal Lösch about 1 month ago

Its really great, well done!!!