Using bepasty with non-web clients (pastebinit)

Bepasty is an awesome way to share files using the browser.
Another way to access bepasty is from terminal using pastebinit.
Bepasty project support this method as it is included in the official documentation.
Unfortunately I cannot make it work on Freedombox.

Problem Description
When I try to upload a file using the above method. I gen an error:

Failed to contact the server: HTTP Error 405: METHOD NOT ALLOWED

Steps to Reproduce (in my personal Computer)

  1. create file ~/.pastebinit.xml:
<pastebinit>
    <pastebin>https://myfboxdomain.org/bepasty</pastebin>
    <format></format>
</pastebinit>
  1. create file ~/.pastebin.d/bepasty.conf:

[pastebin]
basename = myfboxdomain.com/bepasty
regexp = https://myfboxdomain.com/bepasty

[format]
content = text
title = filename
format = contenttype
page = page
password = token

[defaults]
page = +upload
  1. run the command:
    pastebinit -t example.txt -p yourpassword -i example.txt

where yourpassword is the admin password from myfboxdomain.com/apps/bepasty

Expected Results
terminal must return me an upload url and actually upload the file

Actual results

Failed to contact the server: HTTP Error 405: METHOD NOT ALLOWED

Information

  • FreedomBox version: 24.8
  • Hardware: Freedombox Pioneer

P.S.: If there is another cli method that a dev/user is using successfully please let me know.

1 Like

This very likely due to insufficient Apache configuration. I have created an issue to track this.

1 Like

Try with the following configuration:

[pastebin]
basename = myfboxdomain.com/bepasty
regexp = https://myfboxdomain.com/bepasty
post_page = +upload

[format]
content = text
title = filename
format = contenttype
password = token

[defaults]

P.S.: If there is another cli method that a dev/user is using successfully please let me know.

I can upload files using curl (all on one line):

curl --insecure -F "file=@${FILENAME}" https://user:${PASSWORD}@${HOSTNAME}/bepasty/+upload -X POST

Where ${FILENAME} is the path/filename in the local filesystem, ${PASSWORD} is a bepasty password with write permissions configured on the freedombox, and ${HOSTNAME} is the freedombox hostname.

I used --insecure to disable curl’s certificate validation because my freedombox currently has a self-signed certificate (this option is not recommended - see the warning in curl - SSL CA Certificates).

I notice in /.pastebinit.xml

https://myfboxdomain.org

And in be pasty.conf

basename = myfboxdomain.com/bepasty
regexp = https://myfboxdomain.com/bepasty

It may be the top level domains don’t match?