Convert the game config from the config file to env variables #3

Open
opened 2023-12-29 22:16:51 +02:00 by Exynox · 1 comment
Owner
No description provided.
Exynox added the
enhancement
label 2023-12-29 22:16:51 +02:00
Exynox added this to the Ready for public testing milestone 2023-12-31 12:47:02 +02:00
Contributor

Did some initial research on libraries that could help us.

  • libenvpp can parse, validate and cast env variables, but not directly read from a .env file. Is actively maintained
  • cpp-dotenv can read .env files, but does not validate or cast them. Not maintained.
  • cpp-validator general purpose validation library. Does not cast.
  • reflect-cpp general purpose serialization, deserialization and validation of json, yml and more. Does not support ENV format, but could be handy if we ever want to handle those types of files.

As it stands, I think libenvpp is a good fit for our needs. If we really want to use a .env file from disk, we could read it into the env, and then use libenvpp. Or we choose not to do the file reading and force the users to source .env && game for example.

Did some initial research on libraries that could help us. - [libenvpp](https://github.com/ph3at/libenvpp) can parse, validate and cast env variables, but not directly read from a `.env` file. Is actively maintained - [cpp-dotenv](https://github.com/adeharo9/cpp-dotenv) can read `.env` files, but does not validate or cast them. Not maintained. - [cpp-validator](https://github.com/evgeniums/cpp-validator) general purpose validation library. Does not cast. - [reflect-cpp](https://github.com/getml/reflect-cpp) general purpose serialization, deserialization and validation of json, yml and more. Does not support ENV format, but could be handy if we ever want to handle those types of files. As it stands, I think libenvpp is a good fit for our needs. If we really want to use a `.env` file from disk, we could read it into the env, and then use libenvpp. Or we choose not to do the file reading and force the users to `source .env && game` for example.
Sign in to join this conversation.
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: metin2/server#3
No description provided.