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

Feat/env variables #183

Merged
merged 4 commits into from
Jan 8, 2024
Merged

Feat/env variables #183

merged 4 commits into from
Jan 8, 2024

Conversation

yaaax
Copy link
Contributor

@yaaax yaaax commented Nov 28, 2022

Move hard coded variables to config params:

  • API base URL
  • API Host
  • API key

All params can be set through environment variables (see Configure with Environment Variables)

Those new variables can be set with those environment variables:

  • HUGO_PARAMS_api_baseURL
  • HUGO_PARAMS_api_host
  • HUGO_PARAMS_api_apiKey

Comment on lines +3 to +6
[api]
key = "3037e7e96fmsh12bedced9f019f8p1cd804jsn4967070f8bda"
baseurl = "https://ecoindex.p.rapidapi.com/v1/"
host = "ecoindex.p.rapidapi.com"
Copy link
Member

@vvatelot vvatelot Nov 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ question: Ne faudrait il pas plutôt mettre des valeurs nulles ici ? Et on documente comment lancer l'application avec les valeurs qui vont bien... ça me paraitrait plus propre. Tu en penses quoi @yaaax ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pourquoi pas ! On peut en profiter pour générer un nouvelle clé ? Histoire d'éviter d'avoir une clé valide dans le code ?
Même si cette clé reste lisible pour ceux qui regardent le contenu des requêtes… (la limitation restant la vérification de l'hôte et les 5 tentatives par jour, vérifications gérées côté serveur)

Ça me va !

@vvatelot
Copy link
Member

J'ai pu tester, ça marche bien ! C'est top !

Copy link

github-actions bot commented Dec 3, 2023

Cette pull request a été marquée comme inactive car elle n'a pas eu de mise à jour depuis 30 jours. Si elle n'est pas mise à jour d'ici 7 jours, elle sera fermée automatiquement. Pour éviter qu'elle soit fermée, vous pouvez ajouter le label keep open.

@github-actions github-actions bot added the Stale label Dec 3, 2023
@vvatelot vvatelot added keep open and removed Stale labels Dec 3, 2023
@vvatelot vvatelot merged commit 90d9c02 into master Jan 8, 2024
1 check passed
@vvatelot vvatelot deleted the feat/env-variables branch January 8, 2024 08:10
vvatelot added a commit that referenced this pull request Jan 8, 2024
vvatelot added a commit that referenced this pull request Jan 8, 2024
* Revert "Feat/env variables (#183)"

This reverts commit 90d9c02.

* chore: revert env variables
vvatelot pushed a commit that referenced this pull request Jan 8, 2024
Bumps [ky](https://github.com/sindresorhus/ky) from 0.33.3 to 1.2.0.
- [Release notes](https://github.com/sindresorhus/ky/releases)
- [Commits](sindresorhus/ky@v0.33.3...v1.2.0)

---
updated-dependencies:
- dependency-name: ky
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Feat/env variables (#183)

* Get api settings from config (or environment variables)

* Remove debugger

* format code

---------

Co-authored-by: Vincent Vatelot <vincent.vatelot@ik.me>

Revert "Feat/env variables" (#307)

* Revert "Feat/env variables (#183)"

This reverts commit 90d9c02.

* chore: revert env variables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants