panel icon indicating copy to clipboard operation
panel copied to clipboard

Configuration parser json convert boolean to int

Open Thesam1798 opened this issue 3 years ago • 3 comments

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?

  • [X] I have searched the existing issues before opening this issue.
  • [X] 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.
  • [X] 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 avatar Oct 22 '22 15:10 Thesam1798

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"

parkervcp avatar Oct 22 '22 15:10 parkervcp

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...

Thesam1798 avatar Oct 22 '22 19:10 Thesam1798

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}}"
        }
    }
}

Sam-fr avatar Dec 04 '23 20:12 Sam-fr

Still no way around this?

hafometh88 avatar Jul 01 '24 09:07 hafometh88