Skip to content
This repository has been archived by the owner on May 2, 2022. It is now read-only.

move config to git in order to make it easier to keep all production … #547

Merged
merged 6 commits into from
Apr 5, 2020

Conversation

fossecode
Copy link
Member

@fossecode fossecode commented Apr 4, 2020

…configs up to date, closes #543

Sorry guys, large PR again, but most of the changes are just moving files around.

Maintaining the configs on all the servers is a big pain in the ass, and there are nothing secret or sensitive in the config. We can therefore make it simpler and less fragile by moving the config into the project files (and git).

config.json now only contains

{
  "COUNTRY_CODE": "no"
}

The rest of the config values are stored in app/countrySpecific/xx/config.ts, so that it is easier to keep the server-configs up to date. As they are now .ts-files instead of .json, we get type safety as well.

It is also still possible to override config values with env-variables.

This is the new structure for country specific files:
image

  • ar
  • au
  • bd
  • br
  • ca
  • cl
  • co
  • cz
  • de
  • dk
  • en
  • es
  • fr
  • id
  • in
  • it
  • lt
  • mt
  • mx
  • my
  • ng
  • nl
  • no
  • np
  • ph
  • pt
  • ro
  • se
  • sg
  • sk
  • tr
  • ua
  • us

Copy link
Contributor

@btutal btutal left a comment

Choose a reason for hiding this comment

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

tr looks fine, I've just made a small commit to wordlist to fix #545

@michaelmcmillan
Copy link
Member

much better than status quo 👍

@fossecode fossecode requested a review from zacel April 5, 2020 10:56
Copy link
Contributor

@jkspn jkspn left a comment

Choose a reason for hiding this comment

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

Re-applied the typo corrections from #552

README.md Outdated
@@ -76,13 +76,14 @@ Click on "Issues" in the menu above to see what we need help with.

Adding a new language should be pretty straightforward. If you need help, you can always ask in the Telegram group chat or contact us by email. The following is needed in order to set up a new language:

- Set up a new config file: `cp config.example.json config.json`. `LOCALE` should be one of the locales from [here](https://github.com/ladjs/i18n-locales). `CONTRY_CODE` should be the Alpha-2-code listed here: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes
- Set up a new config file: `cp config.example.json config.json`. `CONTRY_CODE` should be the Alpha-2-code listed here: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Set up a new config file: `cp config.example.json config.json`. `CONTRY_CODE` should be the Alpha-2-code listed here: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes
- Set up a new config file: `cp config.example.json config.json`. `COUNTRY_CODE` should be the Alpha-2-code (two-letter country codes) as listed here: [ISO_3166-1 alpha 2 country codes](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes).

README.md Outdated
- In `app/locales` you have to add
- Translations for all the sentences in `en.json`. The keys are the same in all the `{LOCALE}.json`-files, and the values are the translations. We recommend translating everything in the file first, and then testing the site in order to verify that the translations look ok in context. Some texts conains `{{ SOME_VALUE }}`. The content in `{{ }}` will be replace with a country specific variable.
- Translations for all the sentences in `en.json`. The translations should be placed in `{LOCALE}.json` (`LOCALE` should be one of the locales from [here](https://github.com/ladjs/i18n-locales)). The keys are the same in all the `{LOCALE}.json`-files, and the values are the translations. We recommend translating everything in the file first, and then testing the site in order to verify that the translations look ok in context. Some texts conains `{{ SOME_VALUE }}`. The content in `{{ }}` will be replace with a country specific variable.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Translations for all the sentences in `en.json`. The translations should be placed in `{LOCALE}.json` (`LOCALE` should be one of the locales from [here](https://github.com/ladjs/i18n-locales)). The keys are the same in all the `{LOCALE}.json`-files, and the values are the translations. We recommend translating everything in the file first, and then testing the site in order to verify that the translations look ok in context. Some texts conains `{{ SOME_VALUE }}`. The content in `{{ }}` will be replace with a country specific variable.
- Translations for all the sentences in `en.json`. The translations should be placed in `{LOCALE}.json` (`LOCALE` should be one of the locales from [here](https://github.com/ladjs/i18n-locales)). The keys are the same in all the `{LOCALE}.json`-files, and the values are the translations. We recommend translating everything in the file first, and then testing the site in order to verify that the translations look okay in context. Some texts contain `{{ SOME_VALUE }}`. The content in `{{ }}` will be replaced with a country-specific variable (as set in `text-variables.ts`).

README.md Outdated
@@ -91,7 +92,6 @@ Adding a new language should be pretty straightforward. If you need help, you ca
- You also need a domain (preferably `coronastatus.tld` if it is available), and a server to run the app on. We can assist you with setting this up.
- Generate images for social media etc. using [this guide](https://github.com/BustByte/coronastatus#generating-social-images)
- We can host the site for you if you want that. Just send a message to us in telegram. This makes it easier to maintain and deploy new changes to all the sites. We will give you access to the server as well. If you insist on hosting it yourself, please add your name to the README [here](ops)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- We can host the site for you if you want that. Just send a message to us in telegram. This makes it easier to maintain and deploy new changes to all the sites. We will give you access to the server as well. If you insist on hosting it yourself, please add your name to the README [here](ops)
- We can host the site for you if you want that. Just send a message to us in Telegram. This makes it easier to maintain and deploy new changes to all the sites. We will give you access to the server as well. If you insist on hosting it yourself, please add your name to the README [here](ops)

@fossecode
Copy link
Member Author

@jkspn Did you look at each commit separately or all together in "Files changed"? I think the stuff you commented on are outdated, check out https://github.com/BustByte/coronastatus/pull/547/files#diff-04c6e90faac2675aa89e2176d2eec7d8R79

Copy link
Contributor

@adriaandotcom adriaandotcom left a comment

Choose a reason for hiding this comment

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

Looks good!

@jkspn
Copy link
Contributor

jkspn commented Apr 5, 2020

@jkspn Did you look at each commit separately or all together in "Files changed"? I think the stuff you commented on are outdated, check out https://github.com/BustByte/coronastatus/pull/547/files#diff-04c6e90faac2675aa89e2176d2eec7d8R79

My bad! It may have been the outdated file. Checked it again now it's good.

@fossecode fossecode merged commit c1ccf88 into master Apr 5, 2020
@fossecode fossecode deleted the config-in-git branch April 5, 2020 18:00
Copy link
Contributor

@zacel zacel left a comment

Choose a reason for hiding this comment

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

so much cleaner then before!

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

Successfully merging this pull request may close these issues.

Add config files to git
6 participants