Add minimal pastebin behaviour#1546
Merged
svenstaro merged 9 commits intosvenstaro:masterfrom Feb 10, 2026
Merged
Conversation
Allows users to create plaintext 'pastes' from the webui. The interface
can be enabled with the `--pastebin` cli argumen and also requires
`--file-uploads` to be enabled.
A textarea input & title field are presented to the user. When
the paste form is submitted, we create a plaintext file in memory and
pass it to the exiting upload form. This means the pastebin behaviour
inherits all behaviours associated with uploading files (eg: filename
collisions).
If no title is given we generate a `paste-{random-6-ch}.txt` filename,
otherwise the given title is suffixed with `.txt`, if required, and used
as the filename.
Owner
Owner
|
Do you think you'll have some time soon-ish to work on this so I can ship this in the next release of miniserve? |
Contributor
Author
|
Yep I will try and get it out tonight. |
Creates a "stack" for upload + mkdir tools, with pastebin next to it taking any remaining space. When the window is small, all tools are stacked vertical. If pastebin is not enabled, upload + mkdir are rendered horizontally with width: min-content.
Contributor
Author
svenstaro
requested changes
Feb 8, 2026
Owner
svenstaro
left a comment
There was a problem hiding this comment.
I really like the effort you put into wrangling the CSS. Would just like to see some tests and then I think we're actually good to merge this. The JS looks fine, maybe sprinkle in a few comments about what you're doing and we're good.
Only one test really applicable to the pastebin functionality.
Contributor
Author
|
Probably ready to go I think. The CSS is still a bit awkward at some between-breakpoint limbo sizes but not in a blocking way. |
Owner
|
Could you make |
Owner
|
Very cool! |
svenstaro
added a commit
that referenced
this pull request
Feb 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.






Fixes #1475
My usage for this is wanting to share text between systems on an authenticated network, any more complicated "password protection", "secret" or "expiry" behaviour seen on other pastebins is out of scope. Protecting the "pastebin" can be done by existing methods in
miniserveif desired. Viewing pastes is done by viewing the file in browser. I think that's inline with miniserves objectives, "For when you really just want to serve somefilestext content over HTTP right now! ".The PR allows users to create plaintext 'pastes' from the webui. The interface can be enabled with the
--pastebincli argument and also requires--file-uploadsto be enabled.A textarea (required) input & title input (optional) are presented to the user. When the paste form is submitted, we create a plaintext file in memory and pass it to the exiting upload form. This means the pastebin behaviour inherits all behaviours associated with uploading files (eg: filename collisions).
If no title is given we generate a
paste-{random-6-ch}.txtfilename, otherwise the given title is suffixed with.txt, if required, and used as the filename.This is a WIP/POC to see if the idea is acceptable, things not addressed:
-Pwas already taken)