Add short-path for changing URL provided by copy buttons #151
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.
This PR adds a "short path" that replaces the public path when using the copy buttons, along with shortened endpoint names. my use case would be using a different domain for the shared link.
For example, lets say my microbin instance is reachable at
microbin.mylongdomain.name
, but to keep the shared url short I want to use my other domain,short.name
, to handle links to pastas and urls. With this PR, using--short-path https://short.name
means that I can use microbin frommicrobin.mydomain.name
as normal, while clicking copy buttons provides links toshort.name/p/{id}
orshort.name/u/{id}
I originally achieved the link handling part of this just by using rewrites and redirects in my reverse proxy, but I made this PR so that I can use the copy buttons without fixing the url myself.
edit: A docker image of this branch is available at docker.io/frap129/microbin:latest