nodetube icon indicating copy to clipboard operation
nodetube copied to clipboard

BACKBLAZE_HOST_URL ?

Open kgnfth opened this issue 4 years ago • 16 comments

Hello what do i have to put at BACKBLAZE_HOST_URL https://bucketname.s3.us-west-001.backblazeb2.com/ or s3.eu-central-003.backblazeb2.com

i keep getting this error Uncaught Exception: Error: bucket 05662bb3f3... could not be found

kgnfth avatar Dec 19 '20 22:12 kgnfth

ok got it

BACKBLAZE_BUCKET is bucket name instead of bucket id

kgnfth avatar Dec 19 '20 22:12 kgnfth

You were able to get it working? Sorry there's not a ton of docs rn

mayeaux avatar Dec 22 '20 23:12 mayeaux

@kgnfth yes but it still tries to locate the file from the local folder

kgnfth avatar Dec 23 '20 11:12 kgnfth

if i set SAVE_AND_SERVE_FILES='false' it doesnt upload to B2 but it will save the file to uploads folder and it doesnt display the file from the browser

if i set SAVE_AND_SERVE_FILES='true' it does upload to B2 and local uploads folder

but i dont want it to save it to the local folder

i thought it would serve the files from the bucket

kgnfth avatar Dec 23 '20 13:12 kgnfth

@kgnfth do you have UPLOAD_TO_B2 set to true? Probably have to change UPLOAD_SERVER too.

BassOfBass avatar Dec 23 '20 14:12 BassOfBass

@kgnfth It's not a good idea to share variables from .env.private by the way.

BassOfBass avatar Dec 23 '20 15:12 BassOfBass

@kgnfth thos where stripped out soo not too worry

So i have to change like this UPLOAD_SERVER=s3.eu-central-003.backblazeb2.com ?

im not an expert but i think based on this code

uploadServer = https://${process.env.UPLOAD_SERVER}.${domainNameAndTLD}/uploads;

UPLOAD_SERVER=s3.eu-central-003.backblazeb2.com is right

kgnfth avatar Dec 23 '20 15:12 kgnfth

this is what i get

<div class="display-div">
    <a href="s3.eu-central-003.backblazeb2.com/deejavu/4TScUOF.jpeg">
        <img class="display-element" src="s3.eu-central-003.backblazeb2.com/deejavu/4TScUOF.jpeg">
    </a>
</div>

using thing env

      - SAVE_AND_SERVE_FILES=false
      - UPLOAD_TO_B2=true
      - MAX_RATING_ALLOWED=SENS
      - DOMAIN_NAME_AND_TLD=https://tube.gocloud.fun
      - BACKBLAZE_HOST_URL=s3.eu-central-003.backblazeb2.com
      - BACKBLAZE_ACCOUNT_ID=0035
      - BACKBLAZE_APP_KEY=K003
      - BACKBLAZE_BUCKET=nodetubetest
      - SESSION_SECRET=d54fwefwe45fwef45
      - UPLOAD_SERVER=s3.eu-central-003.backblazeb2.com
      - SAVE_AND_SERVE_FILES_DIRECTORY=https://s3.eu-central-003.backblazeb2.com

Look at bottom left image

Correct url to the file is https://f003.backblazeb2.com/file/nodetubetest/deejavu/4TScUOF.jpeg

kgnfth avatar Dec 23 '20 16:12 kgnfth

Is it the link to the file on the actual upload server though?

BassOfBass avatar Dec 23 '20 16:12 BassOfBass

@BassOfBass yes its here https://f003.backblazeb2.com/file/nodetubetest/deejavu/4TScUOF.jpeg

kgnfth avatar Dec 23 '20 16:12 kgnfth

I assume the file was uploaded from your nodetube instance, right? So backend is not a problem.

BassOfBass avatar Dec 23 '20 16:12 BassOfBass

@BassOfBass it uploads correctly but the serve url is wrong if u need to test it i can provide you B2 creds

kgnfth avatar Dec 23 '20 16:12 kgnfth

@BassOfBass @mayeaux

Okey finally i made it work

the correct settings are like this

      - SAVE_AND_SERVE_FILES=false
      - UPLOAD_TO_B2=true
      - DOMAIN_NAME_AND_TLD=https://tube.gocloud.fun
      - BACKBLAZE_HOST_URL= #this does not need a value but why ?
      - BACKBLAZE_ACCOUNT_ID=5
      - BACKBLAZE_APP_KEY=0
      - BACKBLAZE_BUCKET=nodetubetest
      - SESSION_SECRET=d54
      - UPLOAD_SERVER=https://f003.backblazeb2.com/file/nodetubetest
      - SAVE_AND_SERVE_FILES_DIRECTORY=s3.eu-central-003.backblazeb2.com

but the importer still uses local folder

kgnfth avatar Dec 23 '20 18:12 kgnfth

Okay thanks for this @kgnfth I'll consult this when writing up the docs for Backblaze. And yeah importer would need a bit of a touch up to add the uploading to backblaze function. I can show you what code to copy and where if you'd like to submit a PR for that. Thanks also for the help @BassOfBass

mayeaux avatar Dec 25 '20 05:12 mayeaux

@mayeaux If you could point me in the right direction I could take a crack at it.

l1ghtsword avatar Jan 18 '21 14:01 l1ghtsword

@l1ghtsword Check SAVE_AND_SERVE_FILES and SAVE_AND_SERVE_FILES_DIRECTORY variables and why they aren't disabled when BACKBLAZE_ variables are enabled. I guess you should also check the behaviour of UPLOAD_URL and UPLOAD_SERVER just in case.

The files to shuffle through:

  • lib\helpers\settings.js
  • controllers\backend\internalApi.js
  • controllers\backend\uploading.js
  • lib\uploading\ffmpeg.js
  • lib\uploading\backblaze.js

BassOfBass avatar Jan 19 '21 13:01 BassOfBass