clowd/Clowd

Add Self-Hosted Hasty Paste to Pastebin upload solution

Opened this issue · 1 comments

EVOTk commented

Hello,
Is it possible to integrate the self-hosted solution https://github.com/enchant97/hasty-paste as an Pastebin upload solution?

Hasty paste can be used via API keys:
https://enchantedcode.co.uk/hasty-paste/rest-api.html

Ideally, if it would be possible to set the default expiration time ( never / x days / x hours ...) in settings that would be great.

thanks again


Exemple USE API :

curl -X 'POST' \
  'https://paste_url/api/pastes' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "content": "string",
  "expire_dt": "2022-10-25T12:18:34.347Z",
  "long_id": true,
  "content": "test"
}'

Acces to paste via : https://paste_url/<paste_id>

Réponse :

{
  "creation_dt": "Sun, 25 Sep 2022 12:24:40 GMT",
  "expire_dt": "Tue, 25 Oct 2022 12:18:34 GMT",
  "lexer_name": null,
  "paste_id": "uwZXsvCngRgXhTeCnUUpg6DOu0UPF5GgspEIETGB",
  "title": null,
  "version": 1
}

Acces to paste via : https://paste_url/<paste_id>
Acces to exemple paste via : https://paste_url/uwZXsvCngRgXhTeCnUUpg6DOu0UPF5GgspEIETGB

Clowd does already support HasteBin, which is a clean/simple self-hosted upload solution with automatic-syntax-highlighting. https://github.com/toptal/haste-server. I will have a look at this though