Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow STEAM_API_KEY to be a command-line arg for headless/automated builds #8

Open
ewrogers opened this issue Feb 14, 2018 · 3 comments

Comments

@ewrogers
Copy link

The combination of npx and prompt library does not play nice when trying to run npx screeps init in a Docker build. It also does not work inside a Docker container either (prompt is never shown, hangs).

It would be ideal if a command-line arg --steam-api-key <key> could be passed in to init (or allow that step to be skipped).

This is pretty much the only blocker so far to a proper containerized screeps build.

@tedivm
Copy link

tedivm commented Feb 15, 2018

Would this work? I haven't tried it in docker but it's how I handle my own automated screeps builds.

yes STEAM_KEY | npx screeps init

@ewrogers
Copy link
Author

ewrogers commented Feb 16, 2018

Interesting, the one thing I didn't try! I've just made an init.sh script:

EDIT: Did try the yes STEAM_KEY | npx screeps init with the same issue.

echo 'Copying initial world state...'
cp -avr ./node_modules/@screeps/launcher/init_dist/. .

if [ -n $STEAM_API_KEY ]
then
  sed -i "s/{{STEAM_KEY}}/$STEAM_API_KEY/g" .screepsrc
fi

@scitor
Copy link

scitor commented Mar 6, 2018

Please use ENV variables for such things (when you can't use config files), since you can see the command line args in the process list, which would be a security issue.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants