ElementsProject/filebazaar

Setup questions

chrisguida opened this issue · 8 comments

I've got filebazaar installed and running, like so:

$ filebazaar
FileBazaar serving /home/bitcoin/ForSale on port 9678, browse at http://0.0.0.0:9678/

...but when I visit it in my browser, I get a text-only display (rather than a pretty interface as in the readme), and the links don't work. I suppose I have something misconfigured?

_filebazaar.yaml looks like:

---

### Server settings

env: production

#port: 9678
host: 0.0.0.0
#url: http://my-url.com

### Lightning Charge

charge_url: http://localhost:9112
charge_token: SECRET

### FileBazaar settings

# The directory containing the files for sale
# defaults to the directory containing this file
# directory: /path/to/files

# The default file price, can be overridden for individual files (see below)
#default_price: 0.25 USD

# Expiry times
#invoice_ttl: 3600 # lock-in exchange rate for 1 hour
#download_ttl: 172800 # make download available for 2 days after payment

# Secret for generating HMAC access tokens (required)
token_secret: SECRET

# Directory to keep cached preview files
# defaults to `{directory}/_filebazaar_cache`
#cache_path: /path/to/filebazaar_cache

### Looks & feel

# See available themes on https://bootswatch.com
#theme: yeti

# Add custom CSS
#css: |
#  body { background: blue }
#  a { color: orange }

# Set custom views directory
#views_dir: /path/to/custom/views

# Set custom static files directory
#static_dir: /path/to/custom/static

### Files settings

files:
  Books/:
    Mastering-Bitcoin.pdf:
      price: 5 USD
      button: Buy this book

Thanks for your help :)

Are you accessing the webserver through localhost, or is it running on a remote server?

Try setting the url configuration option in _filebazaar.yaml to the same URL you're using to access the web interface with your browser.

It's running on an Ubuntu VPS. I did try that, but it's not putting the port number into the url when I click links, so they're going to port 80 instead, which of course isn't listening.

Oh hey! I put the port number in the url: field and now the links work and there's a style applied to the website! I guess that's what I was missing :)

Sweet! Just sold myself a file! It's working!!

Maybe change the docs to say that if you're hosting on a remote URL to be sure to include [:port] at the end of the url config field?

Awesome! Glad it worked out.

Have you seen the changes in 3567471 (made in response to this issue)? It mentions that the default is http://{host}:{port}/, which hints that you should be including the port number. Do you think that's clear enough, or should I clarify this further?

I didn't see that, but no, the problem is that it doesn't default to http://{host}:{port}; it defaults to http://{host}, it seems to be ignoring the value in port.

I had to explicitly say http://my-url.com:9678 to get it to work.

This is pretty strange, it definitely looks like it should be adding the port number:

config.url = config.url || process.env.URL || `http://${config.host}:${config.port}/`

It it possible that you had url set in the config file or as the URL environment variable, without the port number?