[ home / rules / faq ] [ overboard / sfw / alt ] [ leftypol / siberia / hobby / tech / edu / games / anime / music / draw / AKM ] [ meta / roulette ] [ cytube / git ] [ GET / ref / marx / booru ]

/tech/ - Technology

"Technology reveals the active relation of man to nature" - Karl Marx
Password (For file deletion.)

Join our Matrix Chat <=> IRC: #leftypol on Rizon
Please give feedback on proposals, new on Mondays : /meta/
New /roulette/ topic: /spoox/ - Paranormal, horror and the occult.
New board: /AKM/ - Guns, weapons and the art of war.

File: 1612129656526.gif (2.28 MB, 224x240, 1608608621350.gif)

 No.6724[View All]

This thread is only for feedback related to technical issues (bug reports, suggestions). Otherwise use /meta/.
Public Repo:
If you have any grievances you can make a PR.

Mobile Support:
Thread For Mobile Feedback: >>>/tech/6316

Onion Link:


Matrix rooms:

We are currently working on improvements to the site, subject to the need of the tech team to sleep and go to their day jobs. If you need more immediate feedback please join the matrix room[s] and ask around. Feel free to leave comments, concerns, and suggestions about the tech side of the site here and we will try to get to it as soon as possible

Archived thread:
275 posts and 66 image replies omitted. Click reply to view.


>My friend, do you honestly think it likely that the posts would be missing their reply count information when the catalog template already shows reply counts for every thread?
Kek. You're right, just doing:
$post['reply'] >= $config['noko50_min'] was enough.

The href links are fixed now without workaround in the templates, thanks.


Invidious proxy is broke.
Vid as an example


Title: `Unexpected char ' ' at line 1, column 1 (JSON::ParseException)`
Date: `2021-11-25T05:45:19Z`
Route: `/embed/N9o1X_TNXWA?autoplay=1&html5=1`
Version: `2021.11.18-b5a96b17 @ master`

Unexpected char ' ' at line 1, column 1 (JSON::ParseException)
from /usr/share/crystal/src/json/lexer.cr:331:7 in 'raise'
from /usr/share/crystal/src/json/lexer.cr:327:5 in 'unexpected_char'
from /usr/share/crystal/src/json/lexer.cr:326:11 in 'unexpected_char'
from /usr/share/crystal/src/slice.cr:213:5 in 'next_token'
from /usr/share/crystal/src/json/parser.cr:13:12 in '_post_json'
from src/invidious/yt_backend/youtube_api.cr:317:12 in 'extract_video_info:video_id'
from src/invidious/videos.cr:972:10 in 'get_video:region'
from src/invidious/routes/embed.cr:122:15 in 'show'
from lib/kemal/src/kemal/route.cr:13:9 in '->'
from /usr/share/crystal/src/primitives.cr:266:3 in 'call'
from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call'
from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'
from lib/kemal/src/kemal/filter_handler.cr:21:7 in 'call'
from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'
from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'
from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'
from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call'
from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'
from src/invidious/helpers/static_file_handler.cr:167:15 in 'call'
from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call'
from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call'
from /usr/share/crystal/src/http/server/handler.cr:28:7 in 'call_next'
from lib/kemal/src/kemal/init_handler.cr:12:7 in 'process'
from /usr/share/crystal/src/http/server.cr:500:5 in '->'
from /usr/share/crystal/src/primitives.cr:266:3 in 'run'
from ???


>>12403 >>12404
The first script of >>11649 continues to work.


>>12403 >>12404
The issue is an indirect invidious bug caused by the crystal-lang upstrem: https://github.com/iv-org/invidious/issues/2612
The invidious workaround with manual decompression is in testing: https://github.com/iv-org/invidious/pull/2623
When it's merged and the instances update or when crystal-lang fixes the HTTP::Client, whichever comes sooner, the issue will go away.


Is this really how the PDF thumbnail is made? I tried doing it by hand on my machine but it wouldn't let me use `convert' on PDF files because there are known RCE vulnerabilities regarding that:


Would it be possible to have an option to search for posts based on filename too? It would be extremely useful


>Would it be possible to have an option to search for posts based on filename too?
Sure, but the non-body field test would have to be loosened from always using equality.
> $like .= '`' . $name . '` = '. $pdo->quote($value);

A new filter type can be added here:
> if(!in_array($name, array('id', 'thread', 'subject', 'name'))) {

The file names are inside a json_encode in the 'files' field of posts.
> `files` text DEFAULT NULL,
> $query->bindValue(':files', json_encode($post['files']));

The 'files' structure is an array of objects with a 'filename' field holding the upload file name.
> $file['filename'] = urldecode($file['name']);

So as a trial version a LIKE test can be applied to a new files:value filter in search.php. After that with a little more effort the test can be targeted at the 'filename' field with a json path query like:
'$[*] ? (@.filename like_regex ".*valuegoeshere.*" flag "i").size()'

but this will depend on the quality of the SQL/JSON support available in the exact database type and version in use.


>YouTube now embeds as Incognet's invidious on onion site
Amazing. Thank you based devs


Would be possible to scramble original filename? It's a pain in the ass to do it manual.


File: 1638483249769-0.jpg (175.44 KB, 680x986, 0.jpg)

File: 1638483249769-1.png (208.37 KB, 798x680, 1.png)

Luckily I have done this before for 8chan, I had to fiddle with it a bit but now it seems to work. Add this to your User JS and it will automatically rename the files just to their index like with this post:
function getFiles(t) {
    return jQuery(t).children('.tmb-container').map(function (i, e) {
        return $(e).data('file-ref');

function changeName(i, file) {
    var name = i + '.' + file.name.split('.').pop();
    var newFile = new File([file], name, { type: file.type }); 
    return newFile;

function renameFiles(files) {
    return files.map(changeName);

function removeFiles(t) {
    jQuery('.dropzone .remove-btn').each(function (i, e) {

function addFiles(t, files) {
    transfer = new DataTransfer();
    for (i = 0; i < files.length; i++) {

        $.Event('drop', {
            originalEvent: new DragEvent(
                { dataTransfer : transfer})}));

function stripFilenames(t) {
    var files = getFiles(t);
    addFiles(t, renameFiles(files));

function observer(e) {
    // You have to remove it first to avoid recursion.
    jQuery('.file-thumbs').unbind("DOMSubtreeModified", observer);
    // Always do it on the main form
    jQuery('.file-thumbs').bind("DOMSubtreeModified", observer);

// Initialize
jQuery('.file-thumbs').bind("DOMSubtreeModified", observer);


For a backend version of Anon's >>12449 code a checkbox can be added to the post form wherever convenient
then the $file['filename'] can be suppressed between $file['extension'] and $config['filename_func']
if ($config['suppress_filenames'] && isset($_POST['suppressfilenames'])) $file['filename'] = "$i." . $file['extension'];

Checkbox sync is in >>10441 and memory leak cleanup in >>10455 and >>10478.


You can change the filename doing this way, but it doesn't change the json value for some reason.


Hey, when you dont F5 a thread, the auto update doesnt remove post deleted by mods, so you can end up replying to already banned retards
what about quickly checking if the replied to post still exist when sending it, and displaying a warning if it does not ?

also what about inline reply expansion


>the replied to post
You might reply to several posts, with only one of them having been deleted. You might mean some of the post references in your reply as part of the substance of your reply, rather than as posts being replied to.

What are your thoughts on auto update applying some visual marking to those posts that are still present in your view of the thread but would go away if you were to press F5?



Good idea, NPFchan faced a lot of abuse so it has some good moderation stuff that we can sample. Hash filters currently can't be done through the moderation interface.
There were plans for a vichan-NPFchan uplift (getting all the stuff lainchan never pulled), but unfortunately most of the development manpower is on hold for a while and (as one may have noticed) available time is mostly focused on maintenance and easy wins rather than new features and infrastructure improvement. People getting involved in the git repo would help this massively.

I haven't implemented phashes yet but it's always an option and possible with existing tools. I feel that most people able to intentionally evade a hash ban should be motivated and able to evade a phash, so it might be a wasted and computationally expensive effort.


>Perceptual hashing >>12518
>I feel that most people able to intentionally evade a hash ban should be motivated and able to evade a phash, so it might be a wasted and computationally expensive effort. >>12519
This would autoban false positives. Once autobanning a small fraction of innocents is conceded, that would provide an incentive for the spammers to push for a higher false positive rate.


Concerning >>>/meta/15307
>How the hell do you turn it off?
the current snow test is
> var snow = localStorage['snow'] ? false : true;
while the current option uncheck handler is
> localStorage.snow = false;
which causes snow to remain true regardless of the checkbox state.

To disable the effect without waiting for a backend fix use the dev tools console to set localStorage.snow to a value that evaluates to true in a conditional, such as
localStorage.snow = "nothanks";

then check in dev tools storage that your browser stored the new value, then reload the page.


Bug report that I think is reproducible:
In the following post I place a youtube link in the embed and the enter three lines of [code] text. The result is that only the embed is posted with zero text whatsoever.




textan bloo blee blouf


The text missing from the above are these three lines, which perhaps (testing) will be posted normally when I now do not enter an embed in the following post:




textan bloo blee blouf


>The text missing from the above
The text is present:
<div class="post reply" id="reply_12587" data-board="tech"><p class="intro"><a id="12587" class="post_anchor"></a><input type="checkbox" class="delete" name="delete_12587" id="delete_12587"><label for="delete_12587"><span class="name">Anonymous</span> <time datetime="2021-12-20T14:45:22Z">2021-12-20 (Mon) 14:45:22</time></label>&nbsp;<a class="post_no" id="post_no_12587" onclick="highlightReply(12587)" href="/tech/res/6724.html#12587">No.</a><a class="post_no" onclick="citeReply(12587)" href="/tech/res/6724.html#q12587">12587</a></p>    <div class="video-container" data-video="NLpPyuzxSf4"><a href="https://youtu.be/NLpPyuzxSf4" target="_blank" class="file"><img style="width:255px;height:190px;" src="/vi/NLpPyuzxSf4/0.jpg" class="post-image"></a></div>         <div class="body"><pre class="code lang-">text</pre><br><pre class="code lang-">textblabla</pre><br><pre class="code lang-">textan bloo blee blouf</pre></div></div>

You can apply this CSS workaround:
pre { clear: both; }


File: 1640037484931.png (79.16 KB, 440x173, ClipboardImage.png)

For me (desktop), this text shows a scroll bar.
I assume the issue is that it's invisible on your device so it looks like it's just cut off.


Very strange. It is indeed invisible on my end, still.
I'm on desktop using Tor Browser, latest version, which is based on Firefox ESR, with javascript disabled (highest security setting).
Is [code] a javascript function? It doesn't seem like it. Another strange thing is that sometimes it works and I can see the [code] text like regular (leading me to speculate if it's to do with the number of lines). I did a similar test post on /siberia/ with typed in another way with an embed and it showed up normal, which made me think you had just disabled [code] on /leftypol/ as a board specifically. This was all without JS too (I always post without JS).


I turned off JS (also desktop Tor; Ubuntu-based OS) and it still showed up. There is no JS involved, just CSS. That is weird. It may be a far show and I have no evidence for this but maybe Firefox's recent theming changes affected it for your OS/current-theme.


$(document).on('ajax_after_post', function(e, r) { localStorage.own_posts = '{}'; });


Update of js/show-own-posts.js to allow users to opt out of (You) tracking. >>12724


You are a hero of leftypol


So who's the dummy who shat up APNG uploads because of this weird error?
>Failed to resize image! Details: gm convert: fcTL: no space in chunk cache (/tmp/phpsZjJMc).


APNG upload works in principle. >>>/meta/15840 The error is "benign" but for separate reasons shell_exec_error considers any stderr output an error. >>>/leftypol_archive/1787 The workaround is the same as for the iCCP family of errors. >>7107 The error means that your image has too many sPLT, tEXt, zTXt, iTXt or unknown chunks for libpng's taste.
png_chunk_benign_error(png_ptr, "no space in chunk cache");

   /* Added in libpng-1.4.0: Total number of sPLT, text, and unknown
    * chunks that can be stored (0 means unlimited).
   png_uint_32 user_chunk_cache_max;

In practice this most likely means that your animation has more frames than leftypol->gm->libpng is currently willing to quietly accept. I assume that your image was good faith but it's also possible that you were attempting a resource consumption attack. I cannot check this as you have not provided a link to an external upload of your image. >>7106 For future reference, uploading your file to http://0x0.st/ or similar and including a link will improve your bug reports.



I'm fairly certain I've uploaded this exact animation before here with no problem, and certainly without trouble on other image boards. Fix your shit, I'm never using that webp crap.


Update on the implementation of this?


Your image is legitimate >>>/meta/15862 but it has 6228 frames and 12462 chunks.
< In practice this most likely means that your animation has more frames than leftypol->gm->libpng is currently willing to quietly accept. >>12809
You have the option of uploading it spoilered, which bypasses thumbnailing. >>10845 Since the image is a type 3 8-bit PLTE with single-index transparency (tRNS=0x00) which was converted from a gif using gif2apng.sf.net, you also have the option of uploading the source gif, or losslessly reobtaining it with apng2gif. >>>/meta/15864 The techs can try adding [0] to the first %s of $config['convert_args'] to explicitly request only the first source frame, which may or may not fix the problem.
     // Command-line options passed to ImageMagick when using `convert` for thumbnailing. Don't touch the
    // placement of "%s" and "%d".
    $config['convert_args'] = '-size %dx%d %s -thumbnail %dx%d -auto-orient +profile "*" %s';

Another option is the general workaround shared with the iCCP family of errors. >>12809 >>7107 >>>/leftypol_archive/1787


Hopefully this is update made by a helpful anon arrives soon for leftypol.


File: 1641893877973.png (7.25 KB, 708x236, posthistory.png)

suggestion: username registration and post history. it's the next logical step for this website.


cry about it


Viewing the post history of an IP >>12946 for site administration didn't originate with lefty, lain or vichan, in this family it goes all the way back to Tinyboard.
Reusing the same functionality to allow users to access a read-only view of their own post history might be reasonable on a site that doesn't allow VPNs or Tor, but on a site that does allow them it's probably not a good idea.
Here's some harmless fun with localStorage.own_posts:
((sortkeys, link, divide, cites, install, slice, groups) => {
  const own    = JSON.parse (localStorage.own_posts || '{}')
  const boards = sortkeys (Object.keys (own))
  const count  = boards.reduce ((acc, item) => acc + own [item].length, 0)
  const html   = ['own posts: ' + count + ' boards: ' + boards.length]
  boards.forEach (b => {
    const ownb = own [b].reverse ()
    const have = ownb.length
    const [div, mod, left] = divide (have, slice, groups)
    html.push ('board: ' + link ('/' + b + '/index.html', '/' + b + '/') + ' ' + link ('/' + b + '/catalog.html', '&copy;') + ' count: ' + have + ' = ' + div + ' * ' + slice + ' + ' + mod + ' + ' + left)
    for (let k = 0; k < div; k++) {
      html.push (cites (b, ownb, slice, k, slice))
    if (mod) {
      html.push (cites (b, ownb, slice, div, mod))
  install (html)
}) (
  arr => arr.map (s => [s, s.toUpperCase ()]).sort ((a, b) => a [1] < b [1] ? -1 : a [1] > b [1] ? 1 : 0).map (p => p [0]),
  (href, text) => '<a href="' + href + '">' + text + '</a>',
  (have, slice, groups) => {
    const take = Math.min (have, slice * groups)
    const mod  = take % slice
    return [(take - mod) / slice, mod, have - take]
  (board, arr, slice, skip, now) => arr.slice (skip * slice, skip * slice + now).map (s => '>>>/' + board + '/' + s).join (' '),
  html => {
    const old  = document.getElementById ("ownposts-report")
    if (old) { old.remove (); }
    const node = document.createElement ("div")
    node.setAttribute ("id", "ownposts-report")
    node.setAttribute ("style", "border: thin solid;")
    node.innerHTML = html.map (s => '<p>' + s + '</p>').join ("")
    const foot = document.querySelector ('footer')
    if (foot) {
      foot.parentNode.insertBefore (node, foot)
    } else {
      document.body.appendChild (node)
  45, 2


A page history for a user it's quite simple to make in php, it's just a gimp mod_view_ip and template as well.
I got this ideia from wizchan and works quite good. But that leaves you with one problem, vpn, since tor is easily blocked. But again, in my imageboard vpn and tor isn't allowed.


If you have some influence on the wizchan admin tell him to fix the double escaping in his code tags: https://wizchan.org/meta/res/60390.html#60449 08/24/21.



Sorry, I don't even post on wizchan.


Thank you writing for the code. It has been tested and is now added to the site. (I made a minor change to put them in a frameset labeled (You)s ).
Do you have any issue with me trying to upstream this to vichan and lainchan?


>Do you have any issue with me trying to upstream this to vichan and lainchan?
None at all. Use it freely and in good health. Same for the other fixes I post here.

Separately, I'd like to point out that you need to treat show-own-posts.js.txt >>12776 as UTF-8 to get Marcin's last name right.


The database has been changed to a different engine (MyISAM -> InnoDB). Reverted lmao, vichan isn't concurrency-safe so a couple of people got deadlocks so we noped out.
If you notice anything weird/slow/broken, let me know.
We've also upgraded the caching, which will hopefully provide major speed improvements.

I think one of the biggest issues we should focus on for now (high impact, possible easy win) is the large delay between a post appearing on the website and the poster being told their post is successful.

Fixed, thanks.



You are ignoring the state of $noko, which if false, such as by manual nonoko, causes:
$redirect = $root . $board['dir'] . $config['file_index'];

so you might want the same buildIndex before fastcgi_finish_request order when $noko is false as for "if ($post['op'])".


These should now be fixed, thank you.


these mf's using php lmao

Unique IPs: 15

[Return][Go to top] [Catalog] | [Home][Post a Reply]
Delete Post [ ]
[ home / rules / faq ] [ overboard / sfw / alt ] [ leftypol / siberia / hobby / tech / edu / games / anime / music / draw / AKM ] [ meta / roulette ] [ cytube / git ] [ GET / ref / marx / booru ]