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

Configuration parser json convert boolean to int #4462

Closed
3 tasks done
Thesam1798 opened this issue Oct 22, 2022 · 4 comments
Closed
3 tasks done

Configuration parser json convert boolean to int #4462

Thesam1798 opened this issue Oct 22, 2022 · 4 comments
Labels
not confirmed Report seems plausible but requires additional testing or 3rd part confirmation.

Comments

@Thesam1798
Copy link

Current Behavior

Currently, in the Configuration Files of the nest, if the json parser is assigned and the environment variable is set to boolean, it puts 0 or 1 in the json file.

image

image

image

Expected Behavior

If the environment variable is boolean, it should put true or false in the json file.

Steps to Reproduce

Create an environment variable QUERY_PORT_ENABLED in boolean.
Set the value to true.
Define in Configuration Files of the nest a json parser like this:

{
    "config.json": {
        "parser": "json",
        "find": {
            "a2sQueryEnabled": "{{server.build.env.QUERY_PORT_ENABLED}}"
        }
    }
}

Create a server and check the config.json file

Panel Version

1.10.4

Wings Version

1.7.2

Games and/or Eggs Affected

All

Docker Image

All

Error Logs

All pterodactyl run in docker.

Wings logs : https://ptero.co/desalusowi.yaml
Panel logs : https://ptero.co/juxyqucihu.apache

Is there an existing issue for this?

  • I have searched the existing issues before opening this issue.
  • I have provided all relevant details, including the specific game and Docker images I am using if this issue is related to running a server.
  • I have checked in the Discord server and believe this is a bug with the software, and not a configuration issue with my specific system.
@Thesam1798 Thesam1798 added the not confirmed Report seems plausible but requires additional testing or 3rd part confirmation. label Oct 22, 2022
@parkervcp
Copy link
Member

This is a problem with laravel. Technically 0 and 1 are valid boolean values.

Many of my eggs use the following for bool values.
"required|string|in:true,false"

@Thesam1798
Copy link
Author

I tried that, but the parser puts it in string and not in boolean in the json.

By the way, it does the same thing with strings that have only numbers, it converts to int...

@Sam-fr
Copy link

Sam-fr commented Dec 4, 2023

I also have this problem.
Also with decimal numbers that become strings.

It might be a good idea to be able to specify a value type to the parser, something like this:

{
    "config.json": {
        "parser": "json",
        "find": {
            "a2sQueryEnabled": "{{server.build.env.QUERY_PORT_ENABLED;boolean}}"
        }
    }
}

@hafometh88
Copy link

Still no way around this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not confirmed Report seems plausible but requires additional testing or 3rd part confirmation.
Projects
None yet
Development

No branches or pull requests

5 participants