• 1 Post
  • 167 Comments
Joined 3 years ago
cake
Cake day: June 12th, 2023

help-circle
  • To create an invite you:

    # drop into mongo shell
    docker compose exec database mongosh
    
    # create the invite
    use revolt
    db.invites.insertOne({ _id: "enter_an_invite_code_here" })
    

    That’s pretty jank.

    Also - I’m getting pretty fed-up with self-hosting documentation that assumes very specific environments and goes into detailed configuration for that environment. Don’t tell me how to setup a server and how to enable/configure SSH and setup UFW as part of setting up your software. Just tell me how to setup your software and what ports it uses.






  • …it answers from the attached KBs only. If the fact isn’t there, it tells you - explicitly - instead of winging it.

    So you’ve made a FAQ with a LLM interface? I could see that potentially being useful for cooperate “let our bot answer your questions” tools.

    But the usefulness of AI isn’t just in “tell me a fact”. Like what would your AI give for "what functions would I use in Python to convert a utf16 string to utf8? Would the answer need to be in the KB already?






  • Non-containerized applications. Not in a container. It’s not complicated. Running “on bare metal” sounds cool but it’s a wildly inaccurate description. Containerized applications run on the system natively just like non-containerized applications. So if one of them runs “on bare metal” then then others do as well.

    But historically “on bare metal” is used for embedded or micro-controllers where you don’t have an OS.




  • You know what? Rather than over-complicate things you can probably just check that filenames only contain a small set of white-listed chars. [a-zA-z-._] (and != ‘…’ or ‘.’) or something.

    And one other nit-pick if you’re up for more code-review - your authentication logic should probably be inverted:

    if !ok || user != session.config.username ||
    				pass != session.config.password
    

    I’d change that to be something like

    if ok && user == session.config.username && pass == session.config.password {
       // do login
    } else {
       // not auth
    }
    

    There’s a whole category of security errors where an exception in logic like that causes the code to skip the “you’re not allowed” logic and go right to the “you’re allowed!” block. It’s more of an issue with languages that support exceptions but it’s still considered a best practice generally (it’s also typically easier to read).