mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 15:15:10 +00:00
Install rules IDK
I HATE GIT
This commit is contained in:
parent
8588a6fb5c
commit
a92e3daafa
8 changed files with 79 additions and 35 deletions
|
|
@ -2,4 +2,6 @@ Some dates for Parsee-related events. They mostly serve as LDA's TODOs with
|
||||||
a strict deadline:
|
a strict deadline:
|
||||||
- ~September 2024:
|
- ~September 2024:
|
||||||
Get Parsee into the _Phantasmagoria of Bug View_ stage (essentially
|
Get Parsee into the _Phantasmagoria of Bug View_ stage (essentially
|
||||||
v0.0.1 for a public testing) once I can afford `yama`.
|
v0.0.1 for a public testing) once I can afford `yama`, and start
|
||||||
|
bridging the Matrix room alongside a shiny XMPP MUC, bridged by
|
||||||
|
yours truly.
|
||||||
|
|
|
||||||
23
Makefile
23
Makefile
|
|
@ -10,10 +10,11 @@ VERSION=0.0.0
|
||||||
REPOSITORY=$(shell git remote get-url origin)
|
REPOSITORY=$(shell git remote get-url origin)
|
||||||
|
|
||||||
# =========================== Compilation Flags ============================
|
# =========================== Compilation Flags ============================
|
||||||
CYTO_INC=/usr/local/include/ # Where Cytoplasm's include path is
|
CYTO_INC ?=/usr/local/include/ # Where Cytoplasm's include path is
|
||||||
# located.
|
# located.
|
||||||
CYTO_LIB=/usr/local/lib # Where's Cytoplasm's library is
|
CYTO_LIB ?=/usr/local/lib # Where's Cytoplasm's library is
|
||||||
# located.
|
# located.
|
||||||
|
PREFIX ?=/usr/local
|
||||||
|
|
||||||
SOURCE=src
|
SOURCE=src
|
||||||
OBJECT=build
|
OBJECT=build
|
||||||
|
|
@ -53,4 +54,20 @@ $(AYAS)/%.html: $(INCLUDES)/%.h
|
||||||
@mkdir -p $(shell dirname "$@")
|
@mkdir -p $(shell dirname "$@")
|
||||||
tools/out/aya $(AFLAGS) -i $< -o $@
|
tools/out/aya $(AFLAGS) -i $< -o $@
|
||||||
|
|
||||||
# TODO: a install rule that reads prefix for software packagers?
|
|
||||||
|
# Installs everything. Except Ayadocs. Get pranked.
|
||||||
|
install: binary utils ayadoc install_setup install_parsee install_tools
|
||||||
|
@echo $(PREFIX)
|
||||||
|
|
||||||
|
install_setup:
|
||||||
|
install -dm755 "$(PREFIX)/bin"
|
||||||
|
install -dm755 "$(PREFIX)/doc"
|
||||||
|
|
||||||
|
install_parsee:
|
||||||
|
install -Dm755 "$(BINARY)" "$(PREFIX)/bin/$(BINARY)"
|
||||||
|
|
||||||
|
TOOLS:=$(shell find 'tools/out' -name '*')
|
||||||
|
ITOOL:=${subst tools/out/,$(PREFIX)/bin/,$(TOOLS)}
|
||||||
|
install_tools: $(ITOOL)
|
||||||
|
$(PREFIX)/bin/%: tools/out/%
|
||||||
|
install -Dm755 "$<" "$@"
|
||||||
|
|
|
||||||
18
README.MD
18
README.MD
|
|
@ -16,14 +16,19 @@ codebase I'm already familiar with.
|
||||||
### "Why not just use Matrix lol"
|
### "Why not just use Matrix lol"
|
||||||
### "Why not just use XMPP lol"
|
### "Why not just use XMPP lol"
|
||||||
These two having the same answer should be enough information. Also can I *just* have fun?
|
These two having the same answer should be enough information. Also can I *just* have fun?
|
||||||
|
One could also argue that both sides need to migrate(onboard) the other side, so
|
||||||
~~Also dependency bad.~~
|
a bridge may be a good way to start.
|
||||||
|
|
||||||
## BUILDING
|
## BUILDING
|
||||||
```sh
|
```sh
|
||||||
$ make # This generates a 'parsee' executable.
|
$ make # This generates a 'parsee' executable.
|
||||||
$
|
$ cd tools # If you want to build more tools
|
||||||
|
$ make && cd ..
|
||||||
|
$ make ayadoc # If you want to build HTML documentation
|
||||||
|
# make [PREFIX=(install path)] install # To install Parsee.
|
||||||
```
|
```
|
||||||
|
If there are any Cytoplasm-related build failures, you may want to check the Makefile to
|
||||||
|
change a few variables (you can set `CYTO_INC` and `CYTO_LIB`)
|
||||||
|
|
||||||
### DEPENDENCIES
|
### DEPENDENCIES
|
||||||
Parsee tries to avoid dependencies aside from [Cytoplasm](https://git.telodendria.io/Telodendria/Cytoplasm).
|
Parsee tries to avoid dependencies aside from [Cytoplasm](https://git.telodendria.io/Telodendria/Cytoplasm).
|
||||||
|
|
@ -35,6 +40,13 @@ TODO
|
||||||
TODO
|
TODO
|
||||||
|
|
||||||
## TODOS
|
## TODOS
|
||||||
|
- Add [libomemo](https://github.com/gkdr/libomemo) as an optional dependency.
|
||||||
|
- It depends on more stuff anyways, and I don't want to weigh down the
|
||||||
|
dependency list of Parsee for that.
|
||||||
|
- Matrix's libolm is deprecated. They replaced it with a Rust version that
|
||||||
|
pulls in *way too many* dependencies, and that lacks a C binding. We may
|
||||||
|
put in the work of either forking off libolm or making a binding to KappaChat.
|
||||||
|
|
||||||
- Mess with Cytoplasm to make it have support for something like LMDB as an
|
- Mess with Cytoplasm to make it have support for something like LMDB as an
|
||||||
*optional* dependency. This should increase reliability and speed for anyone.
|
*optional* dependency. This should increase reliability and speed for anyone.
|
||||||
- Nesting might be an issue we'll need to deal with. libdb and Berkley DB
|
- Nesting might be an issue we'll need to deal with. libdb and Berkley DB
|
||||||
|
|
|
||||||
11
XEPS-TBD.TXT
11
XEPS-TBD.TXT
|
|
@ -31,12 +31,6 @@ For future XEPs:
|
||||||
A minor issue with that is pack management. XMPP requires a pack field
|
A minor issue with that is pack management. XMPP requires a pack field
|
||||||
which is used along PEP, it seems, and meanwhile Matrix has ''support''
|
which is used along PEP, it seems, and meanwhile Matrix has ''support''
|
||||||
for packs too, tracking them is between "annoyance" and "yeah, no.".
|
for packs too, tracking them is between "annoyance" and "yeah, no.".
|
||||||
- https://xmpp.org/extensions/xep-0080.html
|
|
||||||
Doxxing people over two protocols is great! Sadly works over PEP it seems,
|
|
||||||
so I can't think of a good analogy tbf, also I hate dealing with PEP tbf.
|
|
||||||
- https://xmpp.org/extensions/xep-0118.html
|
|
||||||
I feel like polluting Matrix status(which more clients should implement)
|
|
||||||
sounds like a bad idea. When are we getting _extensible statuses_?
|
|
||||||
|
|
||||||
ON STANDBY BECAUSE THESE HAVE BEEN TERRIBLE TO DEAL WITH AND WHO KEEPS WRITING
|
ON STANDBY BECAUSE THESE HAVE BEEN TERRIBLE TO DEAL WITH AND WHO KEEPS WRITING
|
||||||
THESE I WANT TO SEND THEM A NICE, BRIGHT GIFT:
|
THESE I WANT TO SEND THEM A NICE, BRIGHT GIFT:
|
||||||
|
|
@ -45,13 +39,16 @@ THESE I WANT TO SEND THEM A NICE, BRIGHT GIFT:
|
||||||
Matrix and XMPP both have support for these.
|
Matrix and XMPP both have support for these.
|
||||||
XEP-0084 is a pain in the ass to implement and seems generally just
|
XEP-0084 is a pain in the ass to implement and seems generally just
|
||||||
unreliable, however.
|
unreliable, however.
|
||||||
|
x https://xmpp.org/extensions/xep-0080.html
|
||||||
|
Can't think of a good analogy to these...
|
||||||
|
|
||||||
|
|
||||||
Not XEPs, but ideas that _needs_ to be added:
|
Not XEPs, but ideas that _needs_ to be added:
|
||||||
~ "also it [Bifrost] doesn't respect voice either" -> Send a form on moderated
|
v "also it [Bifrost] doesn't respect voice either" -> Send a form on moderated
|
||||||
MUCs (which is standard, so its not too bad!). Currently WIP, and barely tested.
|
MUCs (which is standard, so its not too bad!). Currently WIP, and barely tested.
|
||||||
~ "GIVE THE PUPPETS APPROPRIATE PLS/ROLES" - Hydro/t4d
|
~ "GIVE THE PUPPETS APPROPRIATE PLS/ROLES" - Hydro/t4d
|
||||||
- Standalone/Static Parsee, ideally as small as it can be(if not as APE).
|
- Standalone/Static Parsee, ideally as small as it can be(if not as APE).
|
||||||
|
- Kappa-like extension system(maybe bridging more than just Matrix-XMPP.)
|
||||||
- https://www.youtube.com/watch?v=InL414iDZmY
|
- https://www.youtube.com/watch?v=InL414iDZmY
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ CommandParse(char *cmd)
|
||||||
char c = *cur;
|
char c = *cur;
|
||||||
char *tmp;
|
char *tmp;
|
||||||
bool type;
|
bool type;
|
||||||
|
char char_type;
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case STATE_WHITE:
|
case STATE_WHITE:
|
||||||
|
|
@ -73,23 +74,24 @@ CommandParse(char *cmd)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case STATE_VALUE:
|
case STATE_VALUE:
|
||||||
type = c == '"';
|
type = c == '"' || c == '\'';
|
||||||
if (type)
|
if (type)
|
||||||
{
|
{
|
||||||
|
char_type = c;
|
||||||
cur++;
|
cur++;
|
||||||
}
|
}
|
||||||
while (*cur)
|
while (*cur)
|
||||||
{
|
{
|
||||||
char c = *cur;
|
char c = *cur;
|
||||||
char cb[2] = { c, '\0' };
|
char cb[2] = { c, '\0' };
|
||||||
if ((type && c == '"') || (!type && isblank(c)))
|
if ((type && c == char_type) || (!type && isblank(c)))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c == '\\' && *(cur + 1) == '"')
|
if (c == '\\' && *(cur + 1) == char_type)
|
||||||
{
|
{
|
||||||
cb[0] = '"';
|
cb[0] = char_type;
|
||||||
cur++;
|
cur++;
|
||||||
}
|
}
|
||||||
tmp = val;
|
tmp = val;
|
||||||
|
|
|
||||||
10
src/Signal.c
10
src/Signal.c
|
|
@ -27,11 +27,9 @@ SignalHandler(int signal)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* Create a loopback stanza, forcing the thread to die */
|
|
||||||
|
|
||||||
/* TODO: Better way to break out. */
|
/* TODO: Better way to break out. */
|
||||||
Log(LOG_INFO, "Killing thread...");
|
Log(LOG_INFO, "Killing thread...");
|
||||||
//XMPPKillThread(jabber, "killer");
|
|
||||||
XMPPFinishCompStream(jabber);
|
XMPPFinishCompStream(jabber);
|
||||||
pthread_join(xmpp_thr, NULL);
|
pthread_join(xmpp_thr, NULL);
|
||||||
valid = false;
|
valid = false;
|
||||||
|
|
@ -68,10 +66,10 @@ ParseeInitialiseSignals(HttpServer *s, pthread_t xmpp, XMPPComponent *j)
|
||||||
Log(LOG_DEBUG, "Installed signal handler: %s", #sig); \
|
Log(LOG_DEBUG, "Installed signal handler: %s", #sig); \
|
||||||
}
|
}
|
||||||
|
|
||||||
SIGACTION(SIGINT, &sigAction, NULL);
|
SIGACTION(SIGINT, &sigAction, NULL);
|
||||||
SIGACTION(SIGTERM, &sigAction, NULL);
|
SIGACTION(SIGTERM, &sigAction, NULL);
|
||||||
SIGACTION(SIGPIPE, &sigAction, NULL);
|
SIGACTION(SIGPIPE, &sigAction, NULL);
|
||||||
SIGACTION(SIGUSR1, &sigAction, NULL); /* Make USR1 do a softrestart */
|
SIGACTION(SIGUSR1, &sigAction, NULL); /* Make USR1 do a softrestart */
|
||||||
#undef SIGACTION
|
#undef SIGACTION
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
|
|
@ -30,14 +30,33 @@ extern bool ASRegisterUser(const ParseeConfig *, char *);
|
||||||
/* Pings the homeserver to get attention. */
|
/* Pings the homeserver to get attention. */
|
||||||
extern void ASPing(const ParseeConfig *);
|
extern void ASPing(const ParseeConfig *);
|
||||||
|
|
||||||
/* Joins a room from an ID and a given user we want to masquerade
|
/** Joins a room from an {id} and a given {user} we want to masquerade
|
||||||
* as. */
|
* as.
|
||||||
extern char * ASJoin(const ParseeConfig *, char *, char *);
|
* --------------
|
||||||
|
* Returns: the decoded room ID that was joined[HEAP] | NULL
|
||||||
|
* Modifies: the rooms/{user}s inner state */
|
||||||
|
extern char * ASJoin(const ParseeConfig *config, char *id, char *user);
|
||||||
|
|
||||||
/* Bans from a room a specific user */
|
/** Bans from a room a specific user
|
||||||
extern void ASBan(const ParseeConfig *, char *, char *);
|
* ---------------------
|
||||||
extern void ASKick(const ParseeConfig *, char *, char *);
|
* Returns: NOTHING
|
||||||
extern void ASLeave(const ParseeConfig *, char *, char *);
|
* Modifies: the rooms state
|
||||||
|
* See-Also: ASJoin, ASKick, ASLeave */
|
||||||
|
extern void ASBan(const ParseeConfig *config, char *room, char *user);
|
||||||
|
|
||||||
|
/** Kicks from a room a specific user
|
||||||
|
* ---------------------
|
||||||
|
* Returns: NOTHING
|
||||||
|
* Modifies: the rooms state
|
||||||
|
* See-Also: ASJoin, ASBan, ASLeave */
|
||||||
|
extern void ASKick(const ParseeConfig *, char *room, char *user);
|
||||||
|
|
||||||
|
/** Makes a specific user leave the room
|
||||||
|
* ---------------------
|
||||||
|
* Returns: NOTHING
|
||||||
|
* Modifies: the rooms state
|
||||||
|
* See-Also: ASJoin, ASKick, ASBan */
|
||||||
|
extern void ASLeave(const ParseeConfig *config, char *room, char *user);
|
||||||
|
|
||||||
/* Invites from a room a specific user */
|
/* Invites from a room a specific user */
|
||||||
extern void ASInvite(const ParseeConfig *, char *, char *);
|
extern void ASInvite(const ParseeConfig *, char *, char *);
|
||||||
|
|
|
||||||
|
|
@ -329,7 +329,6 @@ GenerateHTML(Stream *out, AyadocComment *ayadoc, HeaderDeclaration decl)
|
||||||
{
|
{
|
||||||
if (StrEquals(attr, "Returns"))
|
if (StrEquals(attr, "Returns"))
|
||||||
{
|
{
|
||||||
/* TODO: Be a little more advanced. */
|
|
||||||
StreamPrintf(out, "<div class='aya-pret' id='pret-%s'>", decl.name);
|
StreamPrintf(out, "<div class='aya-pret' id='pret-%s'>", decl.name);
|
||||||
StreamPrintf(out, "<h2>Returns</h2>");
|
StreamPrintf(out, "<h2>Returns</h2>");
|
||||||
GenerateReturns(out, ayadoc, decl, value);
|
GenerateReturns(out, ayadoc, decl, value);
|
||||||
|
|
@ -339,7 +338,6 @@ GenerateHTML(Stream *out, AyadocComment *ayadoc, HeaderDeclaration decl)
|
||||||
}
|
}
|
||||||
else if (StrEquals(attr, "See-Also"))
|
else if (StrEquals(attr, "See-Also"))
|
||||||
{
|
{
|
||||||
/* TODO: Be a little more advanced. */
|
|
||||||
StreamPrintf(out, "<div class='aya-see' id='see-%s'>", decl.name);
|
StreamPrintf(out, "<div class='aya-see' id='see-%s'>", decl.name);
|
||||||
StreamPrintf(out, "<h2>See also</h2>");
|
StreamPrintf(out, "<h2>See also</h2>");
|
||||||
GenerateSee(out, ayadoc, decl, value);
|
GenerateSee(out, ayadoc, decl, value);
|
||||||
|
|
@ -349,7 +347,6 @@ GenerateHTML(Stream *out, AyadocComment *ayadoc, HeaderDeclaration decl)
|
||||||
}
|
}
|
||||||
else if (StrEquals(attr, "Thrasher"))
|
else if (StrEquals(attr, "Thrasher"))
|
||||||
{
|
{
|
||||||
/* TODO: Be a little more advanced. */
|
|
||||||
StreamPrintf(out, "<p class='aya-free' id='free-%s'>", decl.name);
|
StreamPrintf(out, "<p class='aya-free' id='free-%s'>", decl.name);
|
||||||
StreamPrintf(out, "<strong>This function may be destroyed with ");
|
StreamPrintf(out, "<strong>This function may be destroyed with ");
|
||||||
StreamPrintf(out, "<code><a href='#fdiv-%s'>%s</a></code>", value, value);
|
StreamPrintf(out, "<code><a href='#fdiv-%s'>%s</a></code>", value, value);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue