joshwcomeau / Tello

🐣 A simple and delightful way to track and manage TV shows.
https://tello.tv
329 stars 31 forks source link

Missing config file aws.json #11

Open luisnomad opened 6 years ago

luisnomad commented 6 years ago

Hey Josh! First of all, thanks a lot for sharing this project, it really looks interesting. I was hoping to give it a run, but when starting the server I get this:

fs.js:640
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: ENOENT: no such file or directory, open './server/config/aws.json'
    at Error (native)
    at Object.fs.openSync (fs.js:640:18)
    at Object.fs.readFileSync (fs.js:508:33)
    at Object.readFileSync (/Users/luisnomad/Projects/Tello/node_modules/aws-sdk/lib/util.js:97:26)
    at Config.loadFromPath (/Users/luisnomad/Projects/Tello/node_modules/aws-sdk/lib/config.js:407:39)
    at Object.<anonymous> (/Users/luisnomad/Projects/Tello/server/helpers/image.helpers.js:12:12)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/luisnomad/Projects/Tello/server/models/User.model.js:5:50)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
[nodemon] app crashed - waiting for file changes before starting...

Since there's no installation guide, I assume there's a step/pre-requisite I am missing, right?

Thanks again!

joshwcomeau commented 6 years ago

Ah, yeah, so truthfully I hadn't anticipated anyone trying to run it locally! The code is open-sourced for folks to read, but I assumed it'd be too much trouble for anyone to run.

You'll need a bunch of stuff, I'm afraid :/

Then, you'll need to create two config files:

// server/config/aws.json
{
  "accessKeyId": "XXX",
  "secretAccessKey": "XXX",
  "region": "XXX"
}
// server/config/private.json
{
  "PORT": 3005, // or whatever
  "AUTH_TOKEN_KEY": "some-key", // doesn't matter, just a string
  "JWT_SECRET": "generated-uuid", // generate a UUID, doesn't matter what
  "MONGO_URL": "mongodb://path-to-your-db",
  "GOOGLE_CLIENT_ID": "XXX",
  "GOOGLE_CLIENT_SECRET": "XXX",
  "GOOGLE_CALLBACK_URL": "http://localhost:port/auth/google/callback"
}

Looking at the code now, I think you'll run into an issue with imgix... the URLs are just https://tello.imgix.net/image.jpg, which works because my AWS account and imgix are linked... yours won't be. So you'll need to update the tello.imgix.net references. Alternativelky you could just use your AWS url if you don't care about the perf wins of cropping TV Maze images.

I know this is a fair bit of trouble! If you can update the https://tello.imgix.net part to be a config var, maybe IMAGE_URL_PREFIX or something? That'd make it easier.

Lemme know if this works, or if you run into more issues!

luisnomad commented 6 years ago

Thanks a lot! I'll try that!