aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2024-03-30log: increase buffer sizeturret
2024-03-30todo: updateturret
remove ev abstraction add initcall names
2024-03-30bits: add intentsturret
2024-03-30net: event handlerturret
in subsys.h: include init.h to ensure l5_initcall availability also: add example/ directory to provide some user-code in the skeleton (will likely be made defunct as i make the remainder of the skeleton, such as a /ping command and user action and maybe some buttons, which will require more organisation)
2024-03-30*: directory changesturret
since this project is a skeleton and not meant to clutter up the code that will actually consume the bot, i've opted to consolidate the majority of files under a single directory and minimise extra files *: move code to util/ *: move include files to include/dbs/ net: consolidate net functions into single file config: remove config
2024-03-30extern: add extern-only includeturret
also: in makefile add support for deeper c files
2024-01-18all: remove defunct printsturret
2024-01-18doc: remove completed TODOsturret
2024-01-18init: apply .env filesturret
we apply .env files from both the current working directory and the directory of the executable we're running from very simple .env format, KEY=VALUE, comments prepended with # on first character of line only.
2024-01-18api: extensify api apiturret
2024-01-18net: use strerrorturret
also: empty signal set before using due to malloc
2024-01-18ws: fix typoturret
2024-01-17net: minor refactorturret
enforce 78 character limit add comments for reasoning and description purposes
2024-01-17net: basic ws handlerturret
includes heartbeat mechanism
2024-01-16init: minor optimisationsturret
use switch{case} instead of if statements for determining action upon signal
2024-01-14misc: change RSL 2 -> 1turret
design choice since 1 << n == pow(2,n)
2024-01-14subsys: clear signal handlersturret
since we moved our signal handlers to be created before subsystems are created, our new signal handlers (which namely blocks SIGTERM, used for panicing) are passed on. in order to restore full panic functionality, we clear all signal blocks before passing execution to the subsystem
2024-01-14log: minor optimisationsturret
in panic, when killing process group, set pid to 0, where it gets our pgid for us, using kernel optimisations, saving a trip to kernel land to get the pgid ourselves
2024-01-14init: register signal blockers earlierturret
prevents potential race condition where a subsystem can terminate before we fully block SIGCHLD, causing SIGCHLD to be sent to init and having our entire process terminated ungracefully. prevents bash and family from sending "Terminated" due to our process receiving SIGTERM during a panic, since we already exit in there and it'd be queued up if we do receive one
2024-01-14init: modify panic termination sequenceturret
in log: we ensure we panic by killing our process group with SIGTERM, raising it for ourselves, and exiting (if all else fails simply). in init: we catch SIGTERM and exit with 0 if we get it, as bash (and likely others) prints a nasty "Terminated" to stderr
2024-01-12net: format WSS url properlyturret
libcurl requires first 3 characters of a wss url (i.e. wss://example.com) to be capital, so instead WSS://example.com. so we modify the assume url to use WSS and ensure the returned URL from discord uses the WSS capital scheme
2024-01-12init: add random seed & bug fixesturret
2024-01-12log: implement lock breakingturret
2024-01-11init: panic on keyboard interruptturret
also: change panic signal to be SIGKILL as sigint being caught would result in a loop
2024-01-11init: panic on child exit status !=0turret
also: modify log to exit status 0 on panic instead of 1 (only runs exit on panicmode respawn which shouldn't cause a fatal termination)
2024-01-11net: minor optimisationsturret
break out of WSS compatability checker loop when we find a valid match for wss
2023-12-18init: global init curl while not multithreadedturret
2023-12-18log: edit inline assemblyturret
just read the note on osdev wiki that stated that input operands shouldn't be changed, so we move both rax and the console lock to the output operands so the compiler knows we are modifying them for our lovely optimisation
2023-12-18init: minor optimisationsturret
move spin locks to dedicated function so we can minimise repetition of code. now uses more C and less assembly. init.c uses 8192 * 512 as a maximum even if the stack rlimit is larger
2023-12-18*: enforce 78 char line limitturret
2023-12-18init: panic on no more subsystemsturret
2023-12-18subsys: decrement subsystem count on subsys terminationturret
2023-12-18subsys: implement subsystem respawningturret
2023-12-18panic: add second cut-here for debug & respawnonlyturret
2023-12-18subsys: use rlimits to determine stack sizeturret
2023-12-18panic: use exit_group instead of exitturret
2023-12-18panic: fix macrosturret
2023-12-18net: panic if wss not supported by libcurlturret
2023-12-18panic: fix memory leakturret
2023-12-18net: get gateway urlturret
basic api http_get function, (which the definition of will def. change in the future) uses libcurl to get the api /gateway to get the wss url, and assumes a url in case of failure so we at least try authenticating
2023-12-18init: token logicturret
(also add loglevel for failed to reap message) token is required and init will panic without TOKEN in the environment
2023-12-18build: link against libcurlturret
2023-12-18extern: include a copy of cJSONturret
2023-12-18git: ignore .envturret
2023-12-18log: add panic featturret
rearrange print to use internal vaprint to accomadate print added additional options to vaprint (nolock, noparsecolon, etc) use subsystem modes to accomadate restarting
2023-12-03subsys: add mode variable & some helper funcsturret
2023-12-02util: remove libsl `die`turret
potential copyright violations?? doesnt matter anyway since i'm going to implement my own panic soon which should address the downfalls of a generic `die`
2023-11-24doc: add basic info about repo, and todo listturret
2023-11-24log: remove unused variableturret
2023-11-24misc: subsys upgrade, log timestampsturret
(log) - create LOGLEVEL constant numbers - implement CONSOLE_LOGLEVEL - color array now uses loglevel constants - timestamp now shown (thanks util-linux) (init) - register mainpid - hello world print - fix process reaper to refer to subsys when reaping (subsys) - create maximum subsystem count - create subsystem table - add debugging prints to subsystem entry and termination - create function to handle process termination (unmap stack, free subsystem malloc, clear entry in table) - disable subsystem inception - change die references to fail with print - supply clone with signal to send on termination (SIGCHLD)