Naylepsh / Azur-Booru

Azur Lane themed imageboard
2 stars 0 forks source link

Installation problem #57

Open Mirodys opened 1 year ago

Mirodys commented 1 year ago

I wanted to install azur booru on my Google cloud bucket but I have problems on how to have the Auth file and to link it

Naylepsh commented 1 year ago

It's been a while since I've done GCP stuff, so I'm just going to link to docs: https://cloud.google.com/iam/docs/creating-managing-service-account-keys. Or you can google for google cloud keyfile.

Once it's downloaded, set the appropriate values in your env vars: https://github.com/Naylepsh/Azur-Booru/blob/master/server/services/storage/google-cloud-storage.service.js (lines 7-8)

Mirodys commented 1 year ago

It's been a while since I've done GCP stuff, so I'm just going to link to docs: https://cloud.google.com/iam/docs/creating-managing-service-account-keys. Or you can google for google cloud keyfile.

Once it's downloaded, set the appropriate values in your env vars: https://github.com/Naylepsh/Azur-Booru/blob/master/server/services/storage/google-cloud-storage.service.js (lines 7-8)

Thanks I will try that

Mirodys commented 1 year ago

It's been a while since I've done GCP stuff, so I'm just going to link to docs: https://cloud.google.com/iam/docs/creating-managing-service-account-keys. Or you can google for google cloud keyfile.

Once it's downloaded, set the appropriate values in your env vars: https://github.com/Naylepsh/Azur-Booru/blob/master/server/services/storage/google-cloud-storage.service.js (lines 7-8)

I now have problems with jwt secret But I don't know what to write there And same with mongodb

Naylepsh commented 1 year ago

I'm guessing you're just missing JWT_SECRET env var. You can set it to whatever gibberish you want. And with mongodb, you have to set MONGODB_URI env var to point to your mongo db instance (be it on your local machine or some cloud instance)

Mirodys commented 1 year ago

I'm guessing you're just missing JWT_SECRET env var. You can set it to whatever gibberish you want. And with mongodb, you have to set MONGODB_URI env var to point to your mongo db instance (be it on your local machine or some cloud instance)

sorry it's me again i have done that and now i have that problems when usin the npm start command on cd server:

[nodemon] 2.0.20 [nodemon] to restart at any time, enter rs [nodemon] watching path(s): . [nodemon] watching extensions: js,mjs,json [nodemon] starting node ./bin/www /home/clementdis9/Azur-Booru/server/app.js:21 mongoose.connect(config.db.URI, { ^

TypeError: Cannot read properties of undefined (reading 'db') at Object. (/home/clementdis9/Azur-Booru/server/app.js:21:25) at Module._compile (node:internal/modules/cjs/loader:1159:14) at Module._extensions..js (node:internal/modules/cjs/loader:1213:10) at Module.load (node:internal/modules/cjs/loader:1037:32) at Module._load (node:internal/modules/cjs/loader:878:12) at Module.require (node:internal/modules/cjs/loader:1061:19) at require (node:internal/modules/cjs/helpers:103:18) at Object. (/home/clementdis9/Azur-Booru/server/bin/www:7:13) at Module._compile (node:internal/modules/cjs/loader:1159:14) at Module._extensions..js (node:internal/modules/cjs/loader:1213:10) at Module.load (node:internal/modules/cjs/loader:1037:32) at Module._load (node:internal/modules/cjs/loader:878:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:23:47

Node.js v18.12.1 [nodemon] app crashed - waiting for file changes before starting...

Naylepsh commented 1 year ago

Ah, I'm guessing you're using a platform different than windows? The script invoked by npm start sets the NODE_ENV to dev. On different platforms it has no effect I believe. Adding NODE_ENV=dev to your env vars should resolve the issue in that case.

Mirodys commented 1 year ago

Ah, I'm guessing you're using a platform different than windows? The script invoked by npm start sets the NODE_ENV to dev. On different platforms it has no effect I believe. Adding NODE_ENV=dev to your env vars should resolve the issue in that case.

no i am using windows 11 but i will try

Mirodys commented 1 year ago

Ah, I'm guessing you're using a platform different than windows? The script invoked by npm start sets the NODE_ENV to dev. On different platforms it has no effect I believe. Adding NODE_ENV=dev to your env vars should resolve the issue in that case.

and it still get me the same error

Naylepsh commented 1 year ago

Well, the only way for this error to happen is when config is empty (has no db property), and for that to happen, NODE_ENV has to be different than either dev or test. Can you add console.log({ env }) to config.js file (https://github.com/Naylepsh/Azur-Booru/blob/master/server/config.js) and see what the output is?