Subtle changes, bugs and feedback

Posted on
Page
of 312
  • Lol

    Awesome coverage dude

  • not enough 1%

    but this time my head hurt, and I figured I should write a test to show what I'd written at least worked.

    my approach was:

    1. think hard
    2. forget about DOMs as I didn't want to append the embeds as individual nodes
    3. think hard some more
    4. write code
    5. compile (first time!)
    6. hover over the deploy button... and then realise I've written code, not tested it, it compiled first time and no-one is that lucky
    7. write a couple of tests
    8. they pass
    9. fuck it... ship it and see

    and lines 272 and 273 show that I was thinking originally of a different approach... as the comment does not match what I then decided to do after thinking harder.

  • Also... TIL...

    resp, err := http.Get(...)
    if err != nil { return err }
    defer resp.body.Close()
    json.NewDecoder(resp.Body).Decode(&foo)
    

    This leaves the HTTP connection open a fraction longer than desired, because it may not have consumed the input up to the EOF.

    Need to add this after it:

    io.Copy(ioutil.Discard, resp.Body)
    
  • No, no headway on that.

    The /out links I've fixed by removing them all, as well as redirecting the http:// to https://.

    But the attachments make no sense to me.

    This comment

    curl https://www.lfgss.com/comments/17405497/
    

    Results in this API call

    curl https://lfgss.microcosm.app/api/v1/comments/17405497 
    

    Results in this check for attachments

    curl https://lfgss.microcosm.app/api/v1/comments/17405497 /attachments
    

    Within the comment was the profile avatar:

    "avatar":"/api/v1/files/73821736f57a61bc3675f9469025d8f1e8fb32a9.png",
    

    And within the attachments was the picture:

    "href":"/api/v1/files/a1192d75683ebe6f1104c13f03b4f71443919dbf.jpg",
    

    Both results from the API should be called at the API URL of https://lfgss.microcosm.app.

    and I cannot see any reason why it shouldn't work.

  • I've just wiped the caches again and am checking for 404s

    status = 404 and uri =~ "^/api/v1/files/.*$"

    Just waiting to see if they emerge and confirm there is still an issue.

  • @cyclotron3k I think I have it... you're using the wrong URL.

    http://www.lfgss.com GET /api/v1/files/677fd6380f7e4b1f9428035dfa7e3dbcb227cfbd.png HTTP/1.1

    body_bytes_sent	19
    filename	/var/log/nginx/https.wildcard.microcosm.app.access.log
    geoip_country_code	AU
    host	http://www.lfgss.com
    http_user_agent	Dart/3.4 (dart:io)
    job	lb.microcosm.cc
    msec	1717940166.718
    remote_addr	163.53.144.29
    request	GET /api/v1/files/677fd6380f7e4b1f9428035dfa7e3dbcb227cfbd.png HTTP/1.1
    request_length	372
    request_method	GET
    request_time	0.001
    request_uri	/api/v1/files/677fd6380f7e4b1f9428035dfa7e3dbcb227cfbd.png
    server_protocol	HTTP/1.1
    service_name	lb.microcosm.cc
    ssl_cipher	TLSv1.3/TLS_AES_256_GCM_SHA384
    ssl_protocol	TLSv1.3/TLSv1.3
    status	404
    time_local	2024-06-09T13:36:06+00:00
    

    ignore the http:// prefix in the host name... that isn't actually there, but the Markdown "I'm going to guess this is a link" got involved when I posted it.

    it shouldn't be https://www.lfgss.com/api/v1/files/677fd6380f7e4b1f9428035dfa7e3dbcb227cfbd.png

    it should be https://lfgss.microcosm.app/api/v1/files/677fd6380f7e4b1f9428035dfa7e3dbcb227cfbd.png

    I can reproduce this... in so far as, when I use the app I get 404s and I see them in the logs.

    I've put a fix into the nginx caching to ensure the $host was in the cache key, as this avoids 404s generated by the app poisoning the cache for others.

    In the server block

            location /api/v1/files {
                    proxy_pass            http://microcosm;
                    proxy_read_timeout    90;
                    proxy_cache_key       "$request_method $scheme://$host$request_uri";                                                                     
                    proxy_ignore_headers  Set-Cookie;
                    proxy_hide_header     Set-Cookie;
                    proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
                    add_header            X-Cache-Status $upstream_cache_status;
                    proxy_cache_valid     any 1y;
                    proxy_cache           FILES;
                    proxy_cache_lock      on;
            }
    

    the $request_method $scheme://$host are all new to that.

    ignore the proxy_pass http://microcosm; there, as in nginx that's just talking about a backend proxy not a request URL.

  • AFAICT, the only thing not working on the app are avatar pics within the LFGSS app... are you doing anything unique for them?

  • Ah, nice catch! I'll get a fix out asap...

  • My partners account is blocked.
    @dangeek
    How can it be fixed?

  • ^the issue has been resolved.
    I’m not sure how 🤷

  • I didn't do anything.

    What did the block look like? And was it as a result of something? i.e. did you try and make a post and suddenly it said you were blocked, or something like that?

  • I posted a comment on a thread. That’s all.
    The block was a page with a big ‘stop’ sign.
    If it happens again I’ll screenshot it.
    I just entered a new country so wondered if that could affect it.

  • Some countries I have a Cloudflare rule in for a country to block it.

    Russia, China, etc... places which have only sent scams or bots.

  • Were you on public wifi?

  • I’ve had it happen twice more, but then it will work fine, like now.

    Here’s a screenshot of what I’m getting.


    2 Attachments

    • IMG_1957.png
    • IMG_1956.png
  • Charge your phone 😱

    But that's perfect, one of the screenshots includes the Cloudflare Ray ID, and I can look that up.

  • Found.

    OVH is a huge source of spam bots, and you're on a connection that is sending the traffic via OVH.

    The IP address is 176.31.198.209 which is registered to OVH https://bgp.he.net/AS16276 , which is one of the cheapest web hosting companies https://www.ovhcloud.com/en-gb/ .

    Because they're a cheap web host, the vast majority of spam bots originate from there, and so I block traffic.

    I've changed the rule to be an interactive challenge rather than a block, so you should be able to get past it now.

  • Thank you 🙏
    Probably my cheap French eSIM 🤷
    And don’t worry my phone is now plugged into my dynamo.

  • Getting a lot (2-3x daily) Cloudflare challenges when accessing the site on my Android phone.

    No rhyme or reason - happens on the work wifi, home wifi, 5g all in the UK. New tabs and refreshing of the last active page I was on. It is unpredictable.

    I do access it via Google VPN and almost always targeting the Following url. Is that likely to increase the frequency of challenges?

  • Yeah, VPNs that bounce off some Cloud provider exits can do it.

    The Cloudflare challenges suck TBH, but killing them will leave me with a very binary allow / deny decision for all the bot and spam traffic, which isn't good as it's more likely to be deny.

    If you take a screenshot or can copy the "Cloudflare Ray-ID" then I can lookup which rule challenged you, and potentially review it.

  • Meh. I'm not that bothered and I understand the need. But it good to have my suspicions confirmed. Will see if I can exclude it from the VPN on my side.

    FWIW I have a former colleague who has been at OVH for a long time. Can put you in contact if you need to raise the bot thing directly for any reason.

  • Maybe a slightly niche gripe (two actually) concerning the ignore feature:

    I have a sub-forum on ignore but it still shows up on the front page.
    If the last post in a forum is in the ignored sub-forum, that post shows up on the right on the front page.

    I'm aware this is a bit niche, but it would be wildly appreciated. I currently have all forums except for the Current Projects forum on ignore, it's a great way to pretend this forum is still primarily about bikes. The real estate and car sub-forum of Current Projects kind of ruins that fantasy.

  • When I open a thread it goes to the newest post but then all images above make it go flpplpfllfpfppplplp and push the whole page down, so I have to scroll down and find the latest post. Even on threads I’ve viewed earlier the same day, so surely cached(?) images. My phone and WiFi are quick generally, it’s only on here that it happens. Any tips?

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Subtle changes, bugs and feedback

Posted by Avatar for Velocio @Velocio

Actions