Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add short-path for changing URL provided by copy buttons #151

Merged
merged 2 commits into from
Apr 20, 2023

Conversation

frap129
Copy link
Contributor

@frap129 frap129 commented Apr 12, 2023

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 from microbin.mydomain.name as normal, while clicking copy buttons provides links to short.name/p/{id} or short.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

@szabodanika szabodanika self-assigned this Apr 20, 2023
@szabodanika szabodanika self-requested a review April 20, 2023 16:34
@szabodanika
Copy link
Owner

Works great, thanks a lot for the PR :-) Can't wait to set this up for my personal server

@szabodanika szabodanika merged commit b6841a5 into szabodanika:master Apr 20, 2023
@frap129
Copy link
Contributor Author

frap129 commented Apr 20, 2023

@szabodanika The best part is that the public-path can be behind an SSO, while the short-url is public. This way only authed users can make pastas, but anyone can use/view them.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants