printf
?!)
@prologic@twtxt.net There have always been and there will always be people who have absolutely no clue what theyāre doing. Iāve been 100% one of them when I started. Guaranteed, heaps of new SQL injections are born every single day, numbers rising.
That doesnāt justify all the WAF crap in the first place, though. In my opinion itās just a filthy plaster applied to an injected wound. The software itself must be secure. Otherwise, donāt put that shit on the internet. Probably not even operate it at all. Nowhere. Fix it or throw it in the bin.
One thing about my design here is that it would no longer incorporate āregexā-based rules like OWASP, mostly because my experience thus far has taught me that these rules are kind of overly sensitive, produce false positives and Iām not sure they are really very effective. For example, why is the point of performing SQL injection detection at the Edge using a WAF if you already handle SQL properly in the first place? (seriously does anyone still construct SQL queries by hand with effectively printf
?!)
Today is the day where everything is falling apart. Suddenly, I get: SQL logic error: cannot start a transaction within a transaction
I was trying to optimize the SQL query used for the Compact FrontPage (anonymous view for Discovery when the Admin/Operator chooses āone twt per feedā).
SQL scares me i tweaked a bash script that pulled from a DB and the bash part was easy even if i was just going off of the code in there that i didnāt write (like i understood it at least) but the SQL parts had me suffering
The other day, after a discussion online, we came to the conclusion that using awk+sed+tr could replace much of the development that requires a database. However, using SQLite to have a SQL syntax isnāt a bad idea either. What do you think?
@lyse@lyse.isobeef.org OK. So how I have worked things like this out is to have the interface in the root package from the implementations. The interface doesnāt need to be tested since itās just a contract. The implementations donāt need to import storage.Storage
- storage/ defines the
Storage
interface (no tests!)
- storage/sqlite for the sqlite implementation tests for sqlite directly
- storage/ram for the ram implementation and tests for RAM directly
- storage/sqlite for the sqlite implementation tests for sqlite directly
- controller/ can now import both storage and the implementation as needed.
So now I am guessing you wanted the RAM test for testing queries against sqlite and have it return some query response?
For that I usually would register a driver for SQL that emulates sqlite. Then itās just a matter of passing the connection string to open the registered driver on setup.
https://github.com/glebarez/go-sqlite?tab=readme-ov-file#connection-string-examples
Learn SQL by solving crimes. I want to highlight it as a teacher and a developer, itās extremely well done.
https://www.sqlnoir.com/
#sql
@kat@yarn.girlonthemoon.xyz I approve! Thatās how I learned HTML (version 4 at the time and XHTML shortly after) and making websites, too. Some of them are still made like this to this day. Hand-written HTML. Hardly any <div>
and class nonsense. I canāt remember with which editor I started out with, but I upgraded to Webweaver (later renamed to Webcraft) quickly. Yeah, this were the times when there was just a single computer for the whole family.
Free hosting on Arcor, Freenet and I donāt know anymore how they were all called. Like this author, I uploaded everything via FTP. Oh dear, when was the last time I used that? And I had registered plenty of free .de.vu
domains.
Being on Windows at the time, everything was ISO-8859-1 for me. No UTF-8, I donāt think Iāve heard about it back then.
Later, I wrote my own CMSes in PHP. Man, were they bad in retrospect. :-D Of course, MySQL databases were used as backends. I still exactly know the moment I read the first time about SQL injections. I tried it on my own CMS login and was shocked when I could just break in. The very next thing I did was to lock down everything with an .htaccess until I actually fixed my broken PHP code. Hahaha, good memories.
I swear by Atom or RSS feeds. Many of my sites offer them. I daily consume feeds, theyāre just great.
I share I did write up an algorithm for it at some point I think it is lost in a git comment someplace. Iāll put together a pseudo/go code this week.
Super simple:
Making a reply:
- If yarn has one use that. (Maybe do collision check?)
- Make hash of twt raw no truncation.
- Check local cache for shortest without collision
- in SQL:
select len(subject) where head_full_hash like subject || '%'
- in SQL:
Threading:
- Get full hash of head twt
- Search for twts
- in SQL:
head_full_hash like subject || '%' and created_on > head_timestamp
- in SQL:
The assumption being replies will be for the most recent head. If replying to an older one it will use a longer hash.
@prologic@twtxt.net, are you running Gitea with an SQL backend, or using sqlite? Any reason have havenāt moved to Forgejo?
Como dirĆa mi abuelo āDĆ”ndole al SQL nuestro de cada dĆaā
Bueno, lo decĆa a su profesión, aunque me entienden.
On the topic of Programming Languages and Telemetry. Iām kind of curious⦠Do any of these programming language and their toolchains collect telemetry on their usage and effectively āspyā on your development?
- Python
- C
- C++
- Java
- C#
- Visual Basic
- Javascript
- SQL
- Assembly Language
- PHP
@abucci@anthony.buc.ci Where did I hate on SQL databases? š¤
@eldersnake@we.loveprivacy.club Several reasons:
- Itās another language to learn (SQL)
- It adds another dependency to your system
- Itās another failure mode (database blows up, scheme changes, indexs, etc)
- It increases security problems (now you have to worry about being SQL-safe)
And most of all, in my experience, it doesnāt actually solve any problems that a good key/value store can solve with good indexes and good data structures. Iām just no longer a fan, I used to use MySQL, SQLite, etc back in the day, these days, nope I wouldnāt even go anywhere near a database (for my own projects) if I can help it ā Itās just another thing that can fail, another operational overhead.
Iāve never liked the idea of having everything displayed all of the time for all of history.
And I still donāt: Search and Bookmarks are better tools for this IMO.
From a technical perspective however, we will not introduce any CGO dependencies into yarnd
ā It makes portability harder.
Also I hate SQL š
it uses the queries you define for add/del/set/keys. which corrispond to something like INSERT INTO <table> (key, value) VALUES ($key, $value)
, DELETE ...
, or UPDATE ...
the commands are issued by using the maddycli but not the running maddy daemon.
see https://maddy.email/reference/table/sql_query/
the best way to locate in source is anything that implements the MutableTable interface⦠https://github.com/foxcpp/maddy/blob/master/framework/module/table.go#L38
Trying to figure out what sql query maddy does to change user passwords, but first, iām looking for the subcommand that actually does that⦠on the source code