Plan icon indicating copy to clipboard operation
Plan copied to clipboard

CloudNet v4 Support

Open TheCGuyGitHub opened this issue 1 year ago • 11 comments

I would like to be able to..

It would be nice, if you can have an Config option, to enable CloudNet Support.

Is your feature request related to a problem? Please describe.

When it is enabled Plan would set the ServerName to the name of the CloudNet service. This is really useful, beacuse if the services/servers aren't static you cannot change the ServerName and beacuse of this, all servers would use the same Name

TheCGuyGitHub avatar Aug 27 '24 08:08 TheCGuyGitHub

Can Cloudnet set environment variables?

Plan supports environment variables for configuration.

PLAN_PLUGIN_SERVER_NAME=name
PLAN_SERVER_UUID=uuid

AuroraLS3 avatar Aug 27 '24 08:08 AuroraLS3

CloudNet supports environmentVariables, but i don't know if they can be set dynamicly, i will look if i can do that

TheCGuyGitHub avatar Aug 27 '24 08:08 TheCGuyGitHub

Sadly, cloudnet does not allow to set the environmentVariables automaticly to the server name

TheCGuyGitHub avatar Aug 27 '24 09:08 TheCGuyGitHub

Does it support running scripts before server starts? Doing a export PLAN_SERVER_NAME=$CLOUDNET_SERVER_NAME (Or whatever their environment variable for the name is) could be used to do this in bash.

AuroraLS3 avatar Aug 27 '24 09:08 AuroraLS3

I dont think so, the way you set the environment variables is in a json file. i have it like this right now "environmentVariables": { "PLAN_PLUGIN_SERVER_NAME": "test-1" }

TheCGuyGitHub avatar Aug 27 '24 09:08 TheCGuyGitHub

It just seems really backwards to get configuration variables by having to ask the platform rather than the platform dictating the value - usually everything is configured top down to retain control over what is happening. I'd ask Cloudnet first if they would add support for setting specific environment variables as the server name, copying your example, something like

"environmentVariables": { "PLAN_PLUGIN_SERVER_NAME": "$serverName" }

AuroraLS3 avatar Aug 27 '24 09:08 AuroraLS3

It should be way easier for them to implement change like that than me having to add their api and figure out what to call and where

AuroraLS3 avatar Aug 27 '24 09:08 AuroraLS3

I have already asked, and they said that i would have to code that myself, i will try it, and thank you for the quick response but i still have a question, do i have to set the ServerName to nothing in the config if i use the environmentVariables? beacuse right now, it seems like it didnt take the environmentVariable and still uses the name from the config

TheCGuyGitHub avatar Aug 27 '24 09:08 TheCGuyGitHub

I probably remembered the config path wrong. Basically uppercase it and put _ between any levels, might be PLAN_SERVER_NAME instead.

If the environment variable exists the one in the file won't be read at all.

AuroraLS3 avatar Aug 27 '24 10:08 AuroraLS3

Okay, thank you

TheCGuyGitHub avatar Aug 27 '24 11:08 TheCGuyGitHub

Another ticket that would solve this issue https://github.com/CloudNetService/CloudNet/issues/1354

AuroraLS3 avatar Jan 06 '25 14:01 AuroraLS3