The neverending quest to rewrite vichan -
Archived threads:
https://archive.is/xiA7y>>26420>the jannies may we involved in a serious effort to write a new chan using C# Blazor soon.Good morning sir.
Can you please do the needful and provide update?
>>26717>typescriptGood choice.
>ReactDoesn't anyone know how to design site layouts in html anymore? If i understand it correctly, React is basically for optimizing infinite-scroll type layouts and batching document tree updates. This might be necessary for webapps with lots of state, but for imageboards it traditionally isn't and they run a lot smoother for it. If the browser caches image and stylesheets, fetching the initial site and updates should be the most common bottleneck, so it's a good idea to keep the document tree as small as possible.
>We will not let people write their own clients>I will document the API in the OpenAPI formatI'm confused on how exactly you want to prevent other people from writing clients.
>Designer's ego is fucking huge and he thinks he does glassmorphism better than anything we shown him.Personally i like a good glassmorphism. Just make sure the site is easily themeable, especially if the document tree is going to be a sprawling, js-generated mess.
>>26759NTA
looks like python and the second one is probably some sort of html/css templating system like jinja. If i had to guess the reason the file is an array is because there can be multiple uploads so multiple files.
>>26757>>26763ChunkedIteratorResult sounds like it is supposed to chunk or "page" the query, can't you do something like
files = db.post_files(thread).all()
Got login working, but broke some other aspects somehow, namely pic related, is breaking deletion… Don't suppose anyone has run into this one before? Am setting via an update and
status = PostStatus[status_string])
but don't see why that should break things this badly. Not too terribly found of Python.
>>26852is this like a convoluted way of implementing enum in python?
can't you just use numbers?
>>26856Tried this out and didn't seem to help any. Am not looking to use them as numbers, just want to be able to test for equality.
>>26856Apparently SQLAlchemy stores the enum as the string of its value so in this case '5' but attempting to use the string of the value in the queries also didn't help any.
>>26858I didn't explain myself. class instances in python are like bags, you can throw anything in them, and sometimes ORMs put state in what would otherwise look like plain data
I looked it up and sqlalchemy apparently does do this. see if you can do "sqlalchemy.inspect(post)" or "sqlalchemy.inspect(post.status)"
>>26859Only some of it's secret because of hardcoded emails, directories, and such. Can show.
>>26860ewww.
>>26860But how do you end up with multiple instances of the enum value?
>>26863What if you try dir(post.status) and dir(PostStatus.DELETE)?
>>26852>>26858>Apparently SQLAlchemy stores the enum as the string of its value so in this case '5' but attempting to use the string of the value in the queries also didn't help any.just dynamic language trash lmao
It's a preference thing but I would never want to write anything in a dynamic loosely typed language, except maybe a lisp. OK maybe forth or some shit like this for funsies.
Good job though, power to you. I don't have time to do anything for myself, let alone a hobby project.
>>26872It has `value', and comparison with that worked. It also has `
eq' and using = calls that.
>>26876tbh I feel like all programming languages and frameworks are kind of clunky at modeling websites. something like an imageboard or a CRUD could be represented as set of layers that do simple transformations on input data. you take the parameters from the request, query the db, adjust the data a little, and then render a template or populate a json payload
imagine how easy it would be to shit out backends if there was something like the unreal engine "blueprints" editor but with something like the C# linq for queries and data transformations. like, a good chunk of *all* code is just boilerplate around the shortcomings of the tools
>>26877>something like the unreal engine "blueprints" editor but with something like the C# linq for queries and data transformations.Was going to compare this to something existing, but there's really no point and they're quite different. It sounds really nice though, and would save a lot of people a lot of work.
>good chunk of *all* code is just boilerplate around the shortcomings of the toolsA shame.
>>26877>imagine how easy it would be to shit out backends if there was something like the unreal engine "blueprints" editor but with something like the C# linq for queries and data transformations. like, a good chunk of *all* code is just boilerplate around the shortcomings of the toolsOnly really works if performance is not an issue, and the backend does very simple stuff imo
BP in UE is a good example, they are amazing to quickly iterate on simple stuff that is not more than function calls. Like they're good to jump if spacebar is pressed, or to fire a raycast and call an interface on the first target if E is pressed, not to implement heavier logic
>>26885a system of roles and actions similar to discord?
a long time ago I used an anarchist ib and one of the boards was made (as a joke) such that all users had moderator privileges. I don't think vichan descendants can do something like that out of the box
>>26887basically all interactions, from posting to banning people are listed as actions or permissions. the "owner" or root user can create roles with arbitrary sets of actions (permissions), and then assign one or more roles to users. so for example there could be the role "poster" with the "post" action, "janitor" with the "delete" action, and "dev" with the "see metadata" and "delete" actions. a single user has one or more roles
note that the action sets can overlap, and that the user can have many overlapping sets of actions
what they did in this case was enable the moderator actions for the default, unregistered user role
>>26897Running into another very stange pythonism bug where logic isn't short-circuiting in a conditional variable declaration. Checks for:
current_user is not None and current_user.is_authenticated
still results in an error of NoneType doesn't have attribute is_authenticated. This was while trying to setup a transition from the login / signup button to a logout button.
Anyway cleaned up the CSS some more so that now the checkboxes seem to have pixel perfect placement, and the post header lines up nicely, with the images properly formatted in all situations. Also made the menu hamburger turn into a big 'X' when clicked (only in CSS).
Hoping to maybe find a solution to the first problem and setup a board management page here soon.
>>26903You can see the subtle change in alignment of the article header and checkbox in comparison to
>>26807. Don't think there are any images of broken image formatting here.
>>26927Christ that took all day! Pic related is an implementation of Vichan style markup using an LL(infinity) parser combinator library called "parsy". My implementation is a worse version of my Java, but it seems to cover all the common cases included cross board links, and urls. The markup syntax needs to change a little, bold doesn't work as is, because it's colliding with italics, and it would be better if the closing and opening tags of spoilers were asymmetrical allowing for nested spoilers. Might be taking feed back on this:
Any changes to the markup you guys are interested in? Before had spoilers as /* and */.
>>26930Decided not to sleep. Added
https://2ch.hk style backlinks, html escaping, made the dark-mode toggle with operating system preference. Realize there is actually a global namespace for post.id, crossing over boards, so might axe the more complex cross-board linking system (despite having just finished putting in the work to get it operational). Changed bold to ##for now##, and spoiler to /*spoiled*/. Would still be interested in what people would change about the markup language.
>>26935>Some sites support BBCode like spoiler and code tags, that's pretty cool.Not too fond of these myself.
Been doing bug fixes mostly, made the images user resizable (no Javascript). Had the idea for a user history page for moderation and personal use, together with an administrator page to control permission, and an already partially implemented page to view reports would be
all of the moderation tooling. Have considered not even having the admin page so that there is no page that's permission restricted. Anyway all of that's on hold because can't seem to get current_user to work all of the sudden.
>>26937>made the images user resizable (no Javascript)This sucked so it got deleted. Feeling pretty exhausted… If had anything better to do it would certainly be dead.
>>26937>Anyway all of that's on hold because can't seem to get current_user to work all of the sudden.This got fixed, and now there is a primitive version of the report and history pages.
>>26945Added a recent.html view which displays threads in chronological order and broke a whole bunch of stuff trying to write the backend for the history page, then subsequently fixed all of this stuff except for the reports.html page which is in a dismal state, don't even know how its supposed to look anymore. Also made it where users are allowed to moderate their own posts (sink, lock, delete, warn). Really reports.html, and admin.html are the only further planned features.
Didn't realize that vichan was
13k SLOC excluding the front-end ($413,000 in developer time according to David A. Wheeler's SLOCCount). Am currently at 710 (nearly $19,000 in developer time), and it seems odd to think there would be something like 18 times the current functionality.
>>26946This is it for the report page.. it's bad.. but am probably just going to leave it as is (if can think of anything better to do.. like resuming the job search). My thought presently is the way it should look is with the reports under the message they concern, only displaying the message concerned once, and these should be bump ordered. An exaggeration but this almost feels like a whole other application. The only thing it might need is to add UserReports in addition to the PostReports currently present.
The way the admin panel appears in my mind is as a two input forms with text areas for emails and a select area for permission to grant or remove depending on which of the two input forms is selected. This lets me continue with the lack of access controls on pages at the expense of the user. This is also not great as the administrator needs to remember the emails of their moderators for promotions and the like.
Lastly another page which might want to be added is a log.html for displaying moderation actions. This would be comparatively easy.
>>26949An even worse admin panel… but with the requested fine grain permission system (discord style), and my own constraint that all pages be public, and secure. Likely the whole project now needs some fall cleaning, (and for someone who's not me to write some Javascript) but it's got all the features that one desired! Kept thinking was going to give up, but guess not.
Current total SLOC count is 820 with a cost estimate of $22,000 once again according to David A. Wheeler's 'SLOCCount'.
Other than pushing to a repo, which just requires me to make an account somewhere (ironic) would anyone like to see any features added, or anything documented?
>>26959Licensed AGPL, and found the right set of hacks to make the API endpoints elegant enough. SWIM also might have lifted some JS for click/highlight to reply, 19 SLOC. Floating reference may also be easy to add, though less so, especially for cross thread references. Entered into discussions about the best place to host a repo
>>26958.
>>26959Added primitive always on autoRefresh (always on every minute) in 20 SLOC and floating reference with another 47 lines of JavaScript (copy-edited from 2ch.hk). Was hoping to add 2ch.hk style endless on-hover replies
as mentioned in https://lainchan.org/%CE%BB/res/26674.html#q29059, but for cross-thread references this requires you to do dynamic lookup of threads in JavaScript, which am not quite willing to do. Next major front-end task for SWIM is the floating quick reply form.
>>26959Added per user granular flood detection to every relevant page except for login/signup and a notice in the title in autoRefresh.js for when a new post is made. None of the features from
>>26959 have been planned, but email verification, and a floating quick reply form are the only even semi-panned features.
>>26981No seriously, it's such a pain to work with. Luckily it's only for four usability improvements: auto refresh, reference on hover, click to reply, and the floating quick reply form.
Have been thinking of how to add these features without Javascript. autorefresh could be done with an iframe and http-equiv="refresh". the floating quick reply form could be just a static form to the left that you can hide or show (sort of like a popup chat menu some sites have). You could make a show-references button to show references without Javascript, though they wouldn't be as nice or granular. And for click to reply one is just out of luck.
Would be interested in other's thoughts on this. The Javascript solution for all of these things is probably the easier of the two.
>>26982just use javascript. iframes are incredibly dated. The fact is you should just use javascript, if you need a library try some modernized jquery alternative like alpine.js or htmx
the only alternative to this is just biting the bullet going full SPA and writing a frontend in angular/react or something, or thin client shit like C# blazor. Webasm is a meme, iframes are from the 90s. you are forced to use javascript unless as said before you go full SPA and transcompile typescript, or something even edgier like clojurescript, rust to wasm, or even more obscure shit like dart.
>>26982>the floating quick reply form could be just a static form to the left that you can hide or show (sort of like a popup chat menu some sites have).this is how nanochan/picochan does it.
>>26984what part of iframes do you specifically consider dated? the fact they have well defined privileges as a potentially insecure third-party resource?
>>26984Even if it was reduced there would probably still be some on my board since there are some usability enhancements which can't be had any other way. There doesn't seem to be a need for any libraries however, still don't actually know what JQuery does…
>>26985>this is how nanochan/picochan does it.Floating quick reply went really poorly, and not much would be lost scrapping the present attempt and going the other way.
>iframesThe only disadvantage of this for me is that it pollutes my views.py because every page with autorefresh (and thusly an iframe) would need a separate route.
>>26986>iframesAnother disadvantage is that without Javascript can't think of any way to change the title when there are new replies
or rather to change it back to the default state once they've been viewed so the autorefresh would be of limited utility.
>>26993>Might give it a go.Am just going to reload the whole body
well <section> of the thread every time there's an update for now. Have everything setup except for some reason it seems that each socket handler only executes one at a time.
>>26994>>26995>allow some of these options to be passed in the url.This seems possible, what other features would you like to see disabled?
>>26996theme selection, (you)s and inline image/video expansion seem like good options.
on that note: with vichan every theme, except the default and yotsuba b, has a noticeable delay for every page, so you might want to verify if themes get cached and if there is significant latency during loading. i briefly copied the css of a theme into a user stylesheet, but it broke often because of site updates.
>>26996>Have everything setup except for some reason it seems that each socket handler only executes one at a time.Really confused about what could be going wrong here.
>>26997>theme selection, (you)s and inline image/video expansion seem like good options. This sounds like a great idea, apparently this is a JavaScript feature which surprises. Themes and inline image expansion aren't implemented yet, and (you)s are in the backend, but can probably make all of this work.
>with vichan every theme, except the default and yotsuba b, has a noticeable delay for every page, so you might want to verify if themes get cached and if there is significant latency during loading.This would probably be the job of whatever was in front of the application. Themes are very small currently though, just a change of around ten CSS variables.
>>27004Got Anonymous posting, address based logging, flood control, and bans implemented. Would like to have it where it was a per-board configuration option for Anonymous posting, but don't see how it could be easily implemented at the moment.
>with vichan every theme, except the default and yotsuba b, has a noticeable delay for every page, so you might want to verify if themes get cached and if there is significant latency during loading.Have been trying to solve a similar issue to this where there are a few milliseconds of unstyled content which flash when using the theme selector. Apparently the only way to fix this is to modify things server side to work with the search parameter.
>>27007>Would like to have it where it was a per-board configuration option for Anonymous posting, but don't see how it could be easily implemented at the moment.This is now implemented. Source including the frontend is now at around two thousand line. The whole thing probably needs a once over, and a lot of usage to find any missing bugs and inconveniences. Here's a list of my todos at the moment:
Clerical
- host source
- public instance
- project name (presently "cyberia")
Source
- word filters
- captcha (after some number of failed login attempts, and on signup)
- email verification or validation
- reimplement themes in backend
- views for user and address reports
Am currently implementing the captcha system. Might finish it tonight. Think could get away without email verification if this was done right. There's currently no plans for range bans, that might be a mistake, wonder if they're used often in practice.
>>27025Yesterday gave the whole program a read through correcting errors along the way. Also expanded on the todos a little. Managed this morning to get thumbnail resizing setup to save on bandwidth. Would like to setup incremental autorefresh next, but don't exactly know how to do it without dropping messages, especially considering there are bulk operations.
Clerical
- host source
- public instance
Backend
- views for ban reports.
- easier way to create the admin account.
- LLM for moderation. (Llama Guard)
- prettier error pages.
- incremental autorefresh
>>27030Styled the error pages, cleaned up the error handling in source, and add proper handling for 500 errors in the mean time. The incremental refresh is turning out to be quite tricky. Was thinking could take a hash of the page to check for dropped messages, and just refresh the whole thing
like is currently always done in this case, but it turns out the preview script modifies the DOM and this is no longer a reliable measure. Am open to suggestions on how
of if its necessary to do this. Is the gevent loop just fast enough? The LLM has to wait for me to get a new computer to avoid swapping.
>>27030The only addition to the program after this morning was the simpler system to create admin accounts. Realized to setup incremental autorefresh would require reparsing posts to generate backlinks and at that point gave up for now. The view for reports of posts, users, and addresses requires me to make a query that don't know how to express in SQLAlchemy
think it would be an outer join, and coalesce. The LLM requires me to have a better computer to avoid swapping while developing. So that's it from me for now. Releasing the source is the only thing which seems possible for now, and still haven't decided on a platform for this.
Open to any suggestions.
>>27018I suggest you add the ability to run messages through an arbitrary server-side spam detection program. See
https://bogofilter.sourceforge.io for something like spamassassin, that also works for plaintext.
>>27045>ability to run messages through an arbitrary server-side spam detection program.Added, though this is a feature for advanced users given the implementation. Will use this for my LLM moderation system and have it as a separate program.
>>27045>beg for money.In the lupen sense and not the grifter, went ahead and removed it from the temporary nav.
Not a clue what boards to actually include either if it ever gets hosted.Also added stickies and locked stickies, styled the success pages, and cleaned up the error reporting some more.
>>27062Thank you! Avoiding the LLM is probably more practical because of the 2Gb of ram it eats up raising costs 50%. The idea was just to make moderation a little easier for those of us without thick skin.
>>27059Haven't yet found a way to write an ActivityPub server that would be reasonable. The FChannel implementation is many thousands of lines. The way the've implemented actors is also somewhat strange. Rather than having actors be a salt hashed address or a user account they've made them boards:
https://github.com/FChannel0/FChannel-Server/issues/9#issuecomment-822675142 There is a good JSON-LD library from the looks of it.
>>27134Don't suppose anyone here knows how to make SQLAlchemy return only the first image for each thread? So far as can tell am doing everything correctly here, but still getting an error that "row_number" doesn't exist. If it were just SQL could pull it off but for some reason the "label" even as it emits an AS does not cooperate with the following use of the labeled item.
Unrelated am also having an issue with Starlette-Login trying to serialize user to JSON for some reason and failing at this. Should be able to take a deeper look into this myself at some point.
>>27168Is there someway to have two hashes for the same object and then confirm that they are for the same object without knowing what that object is? Was thinking for moderation purposes it would be interesting to have hashes of addresses communicated between federated servers along with their respective messages in such a way that each could check whether or not its an already banned user. Found this:
https://crypto.stackexchange.com/a/102963 but it seems a little theoretical, so probably not.
>>27170>Hopefully sometime tomorrow can finish off the migrations with its comprehensive testing,Wouldn't say the testing was quite comprehensive, but did a quick read through, and some sporadic testing which turned out well. Went ahead and merged the Starlette branch with main.
>>27170>begin to implement new features again.Am considering getting rid of the (you)s to enable caching to work more effectively. Theoretically post identifiers could be stored in the session, and this way the (you)s added back at a later date. Am also considering replacing the server side rendering of the [logout] button with client side rendering. The downside is slightly less functionality for noscript users, the advantage is that caching is much easier.
>>27174Made the image and reply count appear on the catalog page. Also added the user and address reports to the reported page. Been working through bugs otherwise. Here are my remaining TODOs:
Devops- host source
- public instance
Missing- RSS feeds.
- ActivityPub.
- post search?
Most of what the program needs at the moment is testing, to uncover bugs and then subsequently fix them. Have been doing some of this already today, but it may be about time to finally get the source code hosted somewhere and start receiving feedback. Biggest hold up here is deciding on the platform; seems like it's GitHub or Codeberg.
>>27178Don't have it in me to write documentation at the moment but here's the repository:
https://codeberg.org/jung/arsvia Plan to add install instructions, and some pictures. The gist is:
1. install postgres, imagemagick (libmagickwand-dev), python3, and pip.
2. run pip install -e .
3. setup a user and database in postgress and add to config.py
4. python3 arsvia
5. navigate to 127.0.0.1:5000
6. create an account which will automatically become an admin.
>>28343Make everyone register an account
(for real tho this could be not bad. It would help against spam and illegal content by raising the barrier to entry some [and new account creation could be temporarily halted, which is better than harming vpn or tor users or etc], and on the front everyone could still be anonymous. Or a tripfag at their choosing. whatever. Would it be so bad?)
Unique IPs: 29