Web Development

jnovinger , in Send Web Push Notifications from your own Server
@jnovinger@programming.dev avatar

Do you have a written version?

I really dislike having to watch an entire video to catch the one bit of useful information. I wish I had the time to watch entire videos, but honestly, I don't. On top of that, my brain has often wandered off well before I get to the interesting bit.

anzo ,
Zoop ,

Oooh, neat! I'm the same way, preferring to read rather than watch a video. This looks like it could be really helpful. Thank you!

harenfellerdev OP ,

Oh wow, I didn't know this existed. A little bit thin on the information, but better than nothing. I also want to look at the new capabilities of the Gemini model to help me create blog posts from my videos.

jnovinger ,
@jnovinger@programming.dev avatar

Thanks!

harenfellerdev OP ,

Will write a blog post about it. In the mean time you could check out the last commits on this branch: https://github.com/phartenfeller/sveltekit-1.0-sqlite-demo-app/tree/tut-19-web-push-notifications or get the fundamental steps from MDN: https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Tutorials/js13kGames/Re-engageable_Notifications_Push

jnovinger ,
@jnovinger@programming.dev avatar

Thanks, I appreciate the reply and openness to doing things besides just video.

parens , in Open Letter to Tim Cook: Sabotaging Web Apps Is Indefensible

Apple should be called Malus, honestly. It's the Latin designation for "common apple" and sounds evil: exactly what Apple is.

harenfellerdev OP , in Send Web Push Notifications from your own Server

Kind of horrible timing, as Apple will disable PWAs in the next iOS update for the EU. Kind of crazy, but I guess they will get punished for this behavior. So let's hope this will be reverted soon...

nous , in Should you allow username to use Apostrophe (aka quotes )

Any field in a DB can be vulnerable to SQL injection. Filtering out characters is a terrible way to mitigate that attack, you should be using prepared queries where it does not matter what chars you have in your username or password. You should never form a query with string concatenation.

You may want to limit chars in a username to ones allowed in URLs (or even ones that don't need escaping) if you ever want it to appear in a URL though. Or any other places the user name might be used, but a entry in a DB should not matter.

peter ,
@peter@feddit.uk avatar

Another good reason to filter characters is based on what people expect. You don't want people to be making accounts like OfficialSiteSupport'

damium ,

There are a lot of edge case characters around visually indistinguishable names. If that is a concern usernames should use a restricted known character sets instead of trying to block specific characters. You likely should also treat lookalike characters as equivalents when checking for username overlap.

computergeek125 , in Should you allow username to use Apostrophe (aka quotes )

Since character filtering is all about edge cases, I would like to note that if someone uses an FF14 character name as a display name, the game allows for apostrophe and hyphen and will have a single space.

It's not a huge edge case population wise (unless you're building an application focused on that community or genre), but as others have said it's much safer to prevent the injection from happening in the first place using an interface rather than try to figure out all the way a user can break out of a constructed string.

Kissaki , in Should you allow username to use Apostrophe (aka quotes )

You don't need to escape any content for storing in a DB field.

Use the correct database interface and you're good.

I'd be more concerned about intention and intentional design. Arbitrary characters can be misleading or problematic for users. Using an allow list for accepted username characters is a good approach if you can't depend on good intentions of users.

prettybunnys , in Things you can do on your personal website

Big “100 ways to love your cat” vibes

https://youtu.be/87p53rAD7Sk?si=TxiVptPAqZBZQQ2h

wahming , in Apple attempting killing PWAs in EU: Action Needed

Eh, I'm happy to let apple do stupid stuff to lose themselves customers and / or bring the EU down on their heads

libreom OP ,

EU regulators needs to hear from those affected to action, after march 7 they will take feedback

technom ,

I always say this - you're underestimating the size of the Apple fanboi crowd. They're ready to defend any crap Apple pulls on them.

Fijxu , in htmz - a low power tool for html

Looks pretty good. I could use it to rebuild my simple HTML and CSS only webpage. Having a lot of HTML files that you have to modify manually every time you want to update them is pretty boring and exhausting.

spartanatreyu , in Full Stack Web Development Roadmap
@spartanatreyu@programming.dev avatar

This seems a little meh, people shouldn't be getting taught react or nextjs if they're not proficient enough with JS first.

That just teaches people to reach for frameworks when what they're trying to do could likely be solved in a few lines of code.

amargo85 OP ,

i totally agree. i've been posting things in js for those interested in learning the basics of the language

spartanatreyu , in jQuery 4.0.0 BETA
@spartanatreyu@programming.dev avatar

Theo had a great video on this, and went through why jquery is still important for the internet (besides the older and/or inexperienced who use it):

https://www.youtube.com/watch?v=1bZYmpOOC8U

TootSweet , in Framework of Your choice and why

More important than learning a framework is to learn how things work beneath the frameworks. Try doing a project without frameworks. Who knows. You might even like it.

0x1C3B00DA ,
@0x1C3B00DA@kbin.social avatar

this is how I like to do my personal projects. And I can always pull in Alpine.js or HTMX if I need to as the project progresses

dan ,
@dan@upvote.au avatar

HTMX

I'm glad this style of frontend coding (where you use a prebuilt JS library that handles common interactions through simple configuration, rather than writing custom JS) is coming back into fashion. It was common 15-20 years ago, and as web apps became heavier and heavier, I started to think it was a good idea again.

crazyfuckincoder , in Bun 1.0

Javascript isn't my primary language but How is it different/better than vite? I've used vite for a few vue projects and it felt really fast.

g6d3np81 ,
@g6d3np81@kbin.social avatar

Bun is designed as a drop-in replacement for Node.js. It natively implements hundreds of Node.js and Web APIs, including fs, path, Buffer and more.

The goal of Bun is to run most of the world's server-side JavaScript and provide tools to improve performance, reduce complexity, and multiply developer productivity.

If it can replace node and pnpm at the same time then this sounds quite good actually.

EDIT
https://bun.sh/guides/ecosystem/vite

While Vite currently works with Bun, it has not been heavily optimized, nor has Vite been adapted to use Bun's bundler, module resolver, or transpiler.

https://bun.sh/guides/ecosystem/nuxt

Bun supports Nuxt out of the box. Initialize a Nuxt app with official nuxi CLI.

crazyfuckincoder ,

So it can also do tooling like vite but it primarily aims to replace node as a better and faster js runtime since they're rewritten most js api in zig and c++ from what it shows on their github. I'll give it a try sometime and see if it's really all that fast and easy as it claims.

mac , in Deno in 2023
@mac@infosec.pub avatar

I still can't get to grips with the islands directory causing separation from my other components, it feels weird because both islands and components are components, I think Next.js' approach of having a use client string at the top of the interactive component makes much more sense because your component directory structure can mimic the app/pages directory layout.

Honestly it's the only thing keeping me from jumping over to Fresh.

Max_P , in End-To-End Encrypted (EE2E) Websites?
@Max_P@lemmy.max-p.me avatar

HTTPS is already end to end encrypted. It's literally what it's for. TLS is everywhere: SMTP/IMAP (emails), even OpenVPN.

What about it are you trying to improve on? There ain't much you can do on a website, if the connection is intercepted then everything falls apart because the attacker already has the ability to modify whatever your server is sending, so any encryption you'd do in JS is compromised before it even runs.

If you can make an app, then you can do something called certificate pinning which effectively gives the client the public key of the server to expect. It guarantees that the client will only talk to the right server, and if that is broken, then literally everything is broken and nukes are probably about to get launched.

Most encryption uses the same primitives: RSA/ECDSA/DH to derive a stream cipher and then it's pretty much always AES these days, or sometimes ChaCha20, and usually SHA1 (broken) or SHA256 for message authentication.

E2EE makes senses when you're building say, a messaging app. There the E2EE is that the user's device holds the keys, so even the server can't see the message even as it stores it and sends it to the other device.

trymeout OP ,

I may at times only have access to HTTP only (No HTTPS) which is one of the reasons why I want another form of encryption.

Encryption with most VPNs are more secure than HTTPS. Yes, the connection between the VPN server and the web server is not encrypted with the VPN and only HTTPS. However the encryption between the VPN and personal device is superior, not because it is relayed. My understanding is that HTTPS is "secure" for basic use, just like Windows 11 is secure. But not secure from five eye agencies unlike VPNs and other like systems like Tor and I2P.

My goal is to have a user connect to a web server and have it not possible for the web server to know what is going on, nor can anyone snooping the packets in transit know what is going on. Not know the HTML structure, form field data, etc.

Lmaydev ,

Why do you only have access to http? Knowing that would help guide answers.

trymeout OP ,

I may not have a domain name, and therefore no HTTPS, just HTTP only and can only connect by knowing the IP address and port number.

towerful ,

And you cant use self signed certificates because?
They provide the same level of encryption. The benefit of a domain and a trusted CA issued cert is that browsers/os will automatically trust that the server is who its said it is (ie you dont get a warning).

But if you import your servers root CA to your OS, then your OS (and browser) will automatically trust any cert issued using that root cert, thus you dont get a warning.

With or without a warning, it will still encrypt at TLS1.3

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • webdev@programming.dev
  • test
  • worldmews
  • mews
  • All magazines