You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current URLs are too large even on trivial files, you can't paste them in quite a lot of places, telegram silently truncates them for example, which means you have to use external URL shorteners. BUT! URLs are so large in fact that a number of URL shorteners break too, imagine!
URLs should contain the key to the entry in the DB instead. That's what rust playground and godbolt do. This is trivial to implement.
Implementation notes:
You would probably want to compress the DB with zstd, also you would need to implement rate limit to prevent API abuse.
To implement rate limit you would need to hash the client IP address and store the date of link generation.
For the DB I suggest using RocksDB, I had great time in using it with Rust, it also supports lz4 and zstd compression for hot/cold data, the downside is that it is harder to administer with CLI tools. You can use any DB that you want, it doesn't matter much. You can store all of the data just as plaintext regular files in the FS tree too, for that ideally you would want something like a compressed btrfs subvolume.
You may also add privacy policy. I suggest copying from godbolt:
Short links
If you choose to share your code using the "Share" dropdown, then the user interface state including the source code is stored. For a "Full" link, this information is encoded into the URL as a URL hash (e.g. https://godbolt.org/#ui_state_and_code). For short URLs, the interface state is stored on Compiler Explorer's servers, and a shortened name uniquely referring to this data is returned. The shortened name comes from a secure hash of the state, and without knowing the name it is infeasible to access the data. Only Compiler Explorer administrators can access this data directly. Obfuscated IP addresses and creation time are stored alongside this data, to enable spam detection. Links of this form look like https://godbolt.org/z/SHORTNAME.
Prior to storing data itself, Compiler Explorer used an external URL shortening service (goo.gl) and the resulting short URL was rewritten as https://godbolt.org/g/SHORTURLPART. The storage for the user experience state in this case remains with the short URL provider, not Compiler Explorer.
The text was updated successfully, but these errors were encountered:
Right now your code is never seen by the slintpad server. So it can not store it for you. We want to add a way to share data with other users, so we need to add this eventually.
You can share into a github Gist, getting you a shorter URL. That sends the data to github, but needs you to set up an access token.
Current URLs are too large even on trivial files, you can't paste them in quite a lot of places, telegram silently truncates them for example, which means you have to use external URL shorteners. BUT! URLs are so large in fact that a number of URL shorteners break too, imagine!
URLs should contain the key to the entry in the DB instead. That's what rust playground and godbolt do. This is trivial to implement.
Implementation notes:
You would probably want to compress the DB with zstd, also you would need to implement rate limit to prevent API abuse.
To implement rate limit you would need to hash the client IP address and store the date of link generation.
For the DB I suggest using RocksDB, I had great time in using it with Rust, it also supports lz4 and zstd compression for hot/cold data, the downside is that it is harder to administer with CLI tools. You can use any DB that you want, it doesn't matter much. You can store all of the data just as plaintext regular files in the FS tree too, for that ideally you would want something like a compressed btrfs subvolume.
You may also add privacy policy. I suggest copying from godbolt:
The text was updated successfully, but these errors were encountered: