hexparrot / mineos-node

node.js implementation of mineos minecraft management
GNU General Public License v3.0
338 stars 173 forks source link

https default on? #342

Open dimio111 opened 4 years ago

dimio111 commented 4 years ago

I am using mineos in a docker on unraid. But i'm having trouble with the ssl certificates, i don't need https for my server... (Internal use) Would it be possible to make the use_https=true in mineos.conf an ENV variable for docker usage?

hexparrot commented 4 years ago

That's probably quite possible, but I'm not the maintainer of the unraid deployment package.

You might try: https://forums.unraid.net/topic/49775-support-for-atribes-repo-docker-images/

I'm not entirely sure who the owner and maintainer of that project is (I've never installed unraid).

Indemnity83 commented 4 years ago

I think what @dimio111 is talking about is making the line below a system variable instead of hardcoded into the config. It's not really specific to deploying the docker image on Unraid.

https://github.com/hexparrot/mineos-node/blob/9cf8fe12ed650e11911c238115238785bf10d7a4/mineos.conf#L1

dimio111 commented 4 years ago

Indeed, what @Indemnity83 says is what i meant. I don't think you can just add use_https as an ENV variable without changing some logic in MineOs? MineOs should check if there is an ENV variable "use_https", if not fall back to the config?

Correct me if i'm wrong.

dimio111 commented 4 years ago

I guess it would be possible to just add the logic in entrypoint.sh to read the env var and change the line in mineos.conf accordingly, i can create a pull request in the coming weekend if you would agree to that.

Ahze85283 commented 4 years ago

if you do update it please post it i'm tired of typing this out on a webpage console everytime i spin up the docker

sed 's/use_https = true/use_https = false/' /usr/games/minecraft/mineos.conf > /usr/games/minecraft/mineos.conf.changed && mv /usr/games/minecraft/mineos.conf.changed /usr/games/minecraft/mineos.conf

dimio111 commented 4 years ago

pull request created: https://github.com/hexparrot/mineos-node/pull/344

hexparrot commented 4 years ago

I'm not sure I understand the request here. Is there a reason that I'd enter in logic into the entrypoint.sh if the variable is already an easily-changable value in mineos.conf?

Why can't mineos.conf be changed from true to false and then just create a commit that secures that value? (All future updates will do push which will maintain this manual, preferential change).

4o66 commented 4 years ago

The reason for making this setting exposed via a variable is so that you can set it before the container even runs, by putting it in either a docker compose file, or as part of the command line to create the container. Think of it as a docker "best practice" that all configuration of the containerized app should be exposed either via environment variable or command line option passed to entrypoint.

I've submitted a pull request that not only handles the https_on, but also what port it listens on, user creation, user id, and auto-generation of a random password if one is not supplied. See https://github.com/hexparrot/mineos-node/pull/353

4o66 commented 4 years ago

Please bear in mind that many, if not most mineos docker users are pulling the docker image directly from docker hub. This means that your question about creating a commit is rendered null, as they are not on that path at all.

Ahze85283 commented 4 years ago

@4o66 thank you so much that is precisely what I was looking for.

4o66 commented 4 years ago

I yanked my pull request after discovering some issues, but just put it back in with fixes: https://github.com/hexparrot/mineos-node/pull/355