Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Kutt self-hosted support #137

Open
sasakitz opened this issue Jun 18, 2022 · 5 comments
Open

Kutt self-hosted support #137

sasakitz opened this issue Jun 18, 2022 · 5 comments
Labels
Feature Things the extension should do but isn't yet.

Comments

@sasakitz
Copy link

I would like to see support for kutt in self-hostd as well as kutt.it.

@fwenzel
Copy link
Owner

fwenzel commented Jun 19, 2022

That is probably not too hard, since I assume the API of kutt.it and a self-hosted instance is identical. However, I do not really have a way to test it?

@fwenzel fwenzel added the Feature Things the extension should do but isn't yet. label Jun 19, 2022
@sasakitz
Copy link
Author

Thank you.

I am now using the following bookmarklet to create a shortened URL for my self-hosted kutt.

javascript: (function() {
  fetch("https://HOSTED_DOMAIN/api/v2/links", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "X-API-Key": "KUTT_API_KEY"
    },
    body: JSON.stringify({
      target: location.href
    })
  }).then(response => response.json()).then(data => {
    navigator.clipboard.writeText(data.link).then(alert("Copied! " + data.link));
  }).catch(error => {
    navigator.clipboard.writeText(location.href).then(alert("Copied! " + location.href));
  });
})();

I am wondering if it would be possible if the domain of the following fetch point is not fixed to kutt.it but variable.

return fetch('https://kutt.it/api/v2/links', {

You can help with testing methods to the extent possible, either by testing them myself or by issuing API keys for self-hosted kutt.

@fwenzel
Copy link
Owner

fwenzel commented Jun 20, 2022

Oh thank you this is super helpful. I have a setting for custom shortener domain in there but I think that's less important than the self-hosted domain type.

@sasakitz
Copy link
Author

sasakitz commented Jun 20, 2022

Support for self-hosting may be less important for the majority.
However, kutt.it is currently unable to accept new signup and a reverse proxy is required to support SSL for custom domains.

@fwenzel
Copy link
Owner

fwenzel commented Jun 20, 2022

Makes sense to me - the request for self-hosting is pretty common from Copy ShortURL users. I think I'll just add a new setting for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Things the extension should do but isn't yet.
Projects
None yet
Development

No branches or pull requests

2 participants