config.js 693 B

1234567891011121314151617181920212223242526272829
  1. let userOptions
  2. try {
  3. userOptions = require('../../data/onesky.json')
  4. } catch (err) {
  5. if (!process.env.ONE_SKY_PUBLIC_KEY) {
  6. console.error(
  7. 'Cannot detect onesky credentials.\n\tDevelopers: see the docs at',
  8. 'https://github.com/overleaf/developer-manual/blob/master/code/translations.md#testing-translations-scripts',
  9. '\n\tOps: environment variable ONE_SKY_PUBLIC_KEY is not set'
  10. )
  11. process.exit(1)
  12. }
  13. }
  14. function withAuth(options) {
  15. return Object.assign(
  16. options,
  17. {
  18. apiKey: process.env.ONE_SKY_PUBLIC_KEY,
  19. secret: process.env.ONE_SKY_PRIVATE_KEY,
  20. projectId: '25049',
  21. },
  22. userOptions
  23. )
  24. }
  25. module.exports = {
  26. withAuth,
  27. }