Configuration Problems with Multi-Juicer
mistersso opened this issue · 4 comments
Hi,
I'm actually trying to edit the values.yaml to hide the Challenge Hints, Hacking Instructor and to upgrade the Grace Period to 10d. Therefore I deleted the #
in front of showChallengeHints
and showHackingInstructor
in the values.yaml file. After that I tried the installation with your instruction: helm install -f values.yaml multi-juicer ./multi-juicer/helm/multi-juicer/
This command was not useful in all, because I get the following error: Error: path "./multi-juicer/helm/multi-juicer/" not found
The only way this command works if I change it to: helm install -f values.yaml multi-juicer multi-juicer/multi-juicer
If I do this, I won't be able to open a JuiceShop after I joined a team. The error that Kubernetes shows me is:
Readiness probe failed: Get "http://10.1.13.73:3000/rest/admin/application-version": dial tcp 10.1.13.73:3000: connect: connection refused
Back-off restarting failed container
(If I install it without changing the values.yaml file, it is working)
After that I tried to change the values using the --set=""
command. My command was: helm install multi-juicer multi-juicer/multi-juicer --set="juiceShopCleanup.gracePeriod=10d" --set="juiceShop.config.application.showChallengeHints=false" --set="juiceShop.config.application.showHackingInstructor=false"
If i try this command, I will get this error:
coalesce.go:199: warning: destination for config is a table. Ignoring non-table value application:
logo: JuiceShopCTF_Logo.png
favicon: favicon_ctf.ico
# showChallengeHints: false
showVersionNumber: false
# showHackingInstructor: false
showGitHubLinks: false
# ctf:
# showFlagsInNotifications: true
Error: template: multi-juicer/templates/juice-shop-config-map.yaml:9:37: executing "multi-juicer/templates/juice-shop-config-map.yaml" at <4>: wrong type for value ; expected string; got map[string]interface {}
Can you help me to solve this problem?
Regards
Hi 👋
Thanks for taking the time wrioting down which problems you encountered, that helps a lot.
That's quite a few points there, let me try if I can break them down:
helm install -f values.yaml multi-juicer ./multi-juicer/helm/multi-juicer/
failed, because this would require you to have the repo cloned locally, which the error indicates you didn't do.helm install -f values.yaml multi-juicer multi-juicer/multi-juicer
should have been okay, as this pulls the helm chart from the repo and overrides the values defined in values.yaml. Not sure what exactly you did change in the values file, might have been something the juice-shop didn't like. If you see the error again, the juice-shop logs might be able to tell whats wrong there.- The install with
--set="juiceShop.config.application.showChallengeHints=false"
, doesn't work like this because thejuiceShop.config
in the helmvalues isn't a real yaml object but a multi line string (indicated byconfig: |
). To change values in there you'll have to override the entire multi line string. Easiest way to do that is by using a values file rather than a string.
Suggested solution:
helm install -f values.yaml multi-juicer multi-juicer/multi-juicer
values.yaml file:
juiceShop:
config: |
application:
logo: JuiceShopCTF_Logo.png
favicon: favicon_ctf.ico
showChallengeHints: false
showVersionNumber: false
showHackingInstructor: false
showGitHubLinks: false
ctf:
showFlagsInNotifications: true
If this fails again, take a peak into the juiceshop logs of the pods of the newly created team. This might be clearer on why the pod doesn't start correctly.
Hope that helps 🤞
I tried it out, but it is still not working. It seems like, it is having some issues with overwriting the config file.
The juice-shop logs look likes this:
> juice-shop@12.3.0 start /juice-shop
> node app
info: All dependencies in ./package.json are satisfied (OK)
info: Chatbot training data botDefaultTrainingData.json validated (OK)
info: Detected Node.js version v12.20.0 (OK)
info: Detected OS linux (OK)
info: Detected CPU x64 (OK)
warn: Config schema validation failed with 2 errors (NOT OK)
warn: application.showChallengeHints: is not present in schema
warn: application.showHackingInstructor: is not present in schema
warn: Configuration multi-juicer validated (NOT OK)
warn: Visit https://pwning.owasp-juice.shop/part1/customization.html#yaml-configuration-file for the configuration schema definition.
error: Exiting due to configuration errors!
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! juice-shop@12.3.0 start: `node app`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the juice-shop@12.3.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/juicer/.npm/_logs/2021-02-03T08_43_40_679Z-debug.log
Mh no apperently the schema for the config has changed, which clashes with the previously commented out config values. Will have to update the default config. This values file should work:
juiceShop:
config: |
application:
logo: JuiceShopCTF_Logo.png
favicon: favicon_ctf.ico
showVersionNumber: false
showGitHubLinks: false
challenges:
showHints: false
hackingInstructor:
isEnabled: false
ctf:
showFlagsInNotifications: true
Nice, it is working perfectly now. Thank you for your always fast and helpful support :)