Ruby on Rails / Companion / AWS3

Hi everyone,
First of all, congratulations for what you are building, I don’t have enough words to praise it !!

Unfortunately, I am slightly lost with the hooking up to S3 for direct uploads part.

I’ve read the docs extensively but am still not sure how to go about it all, I’ve only got less than a year’s coding experience under the belt too, sorry!

My app is on Ruby on Rails with Webpack for the build, I’ve managed to integrate the Dashboard on my page but setting up companion is harder for me.

I’m not sure whether to go for an the option to plugin to an existing server (you use express, can I customize this to my app or do I need to install express etc?).
Setting up my own server I see I have to create environment variables, which I know how to do, but then you talk about express.js again or using the implicit path to where companion lives (/node_modules/@uppy/companion-client ?).
I’m unclear as to what value I should give to these, due to lack of server knowledge I imagine:

any long set of random characters for the server session

export COMPANION_SECRET=“shh!Issa Secret!” -> A value I define myself, correct?

corresponds to the server.host option

export COMPANION_DOMAIN=“YOUR SERVER DOMAIN” -> http://localhost:3000 ?

corresponds to the filePath option

export COMPANION_DATADIR=“PATH/TO/DOWNLOAD/DIRECTORY” -> ??

How will this then work in production, when deploying to heroku or hatchbox?

I’m building a small p2p housing platform for a crypto currency that we produce ourselves as part of a web-of-trust, small and groundbreaking french project with just 1300 members for now. More info on duniter.org :wink:

Regards from France

Hello. I’m aware that this is an older question, but I should be able to help:

COMPANION_SECRET

This is a value that you define, that I believe is used to encrypt the token, which is utilized by the way Uppy works with Companion (read more here)

COMPANION_DOMAIN

This value represents the domain of the server. Some examples are

  • http://localhost:3000
  • https://my-domain.com
  • http://127.0.0.1

Your guess was correct for this

If you are curious why this is needed, it is required for redirect URIs and things of that nature

COMPANION_DATADIR

Once again your guess was correct. This is a directory that all files will be stored temporarily. Make sure that this exists and is accessible by Companion

I’m not really sure how it would work on a PaaS provider. It depends on whether you have filesystem access. I’m sure that there is some sort of modification to Companion you could make this possible if it isn’t. I haven’t tried it so I can’t be too sure

I hope this helped. Let me know if you have any more questions or concerns
- Andrew

Okay after a little more looking, I’ve found this docs page, which explains using Companion on Heroku