Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BACKBLAZE_HOST_URL ? #393

Open
kgnfth opened this issue Dec 19, 2020 · 16 comments
Open

BACKBLAZE_HOST_URL ? #393

kgnfth opened this issue Dec 19, 2020 · 16 comments

Comments

@kgnfth
Copy link

kgnfth commented Dec 19, 2020

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
Copy link
Author

kgnfth commented Dec 19, 2020

ok got it

BACKBLAZE_BUCKET is bucket name instead of bucket id

@mayeaux
Copy link
Owner

mayeaux commented Dec 22, 2020

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

@kgnfth
Copy link
Author

kgnfth commented Dec 23, 2020

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

@kgnfth
Copy link
Author

kgnfth commented Dec 23, 2020

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

@BassOfBass
Copy link
Collaborator

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

Repository owner deleted a comment from kgnfth Dec 23, 2020
@BassOfBass
Copy link
Collaborator

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

@kgnfth
Copy link
Author

kgnfth commented Dec 23, 2020

@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
Copy link
Author

kgnfth commented Dec 23, 2020

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

@BassOfBass
Copy link
Collaborator

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

@kgnfth
Copy link
Author

kgnfth commented Dec 23, 2020

@BassOfBass
Copy link
Collaborator

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

@kgnfth
Copy link
Author

kgnfth commented Dec 23, 2020

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

@kgnfth
Copy link
Author

kgnfth commented Dec 23, 2020

@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

@mayeaux
Copy link
Owner

mayeaux commented Dec 25, 2020

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

@l1ghtsword
Copy link

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

@BassOfBass
Copy link
Collaborator

BassOfBass commented Jan 19, 2021

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants