Kodkollektivet / owtf-valhalla

owtf-valhalla
Other
2 stars 3 forks source link

Fet/restructure command list response #38

Closed Spetastian closed 8 years ago

Spetastian commented 8 years ago

Response from commands endpoint now looks like this: [ { "code": "666", "target": "", "image": "owtfvalhallatestcontainer:0.1", "noise": "passive", "command": "sleep 5s", "description": "Test" } ]

Instead of this: { "666": [ { "code": "666", "target": "", "image": "owtfvalhallatestcontainer:0.1", "noise": "passive", "command": "sleep 5s", "description": "Test" } ] }

Its a list of objects just like the containers from the API.

Spetastian commented 8 years ago

I see that the tests fail because the log-folder cannot be found. The log folder was a part of the repo at first but i thought that was strange since its in the gitignore-file.

Spetastian commented 8 years ago

Added the new scripts in the build lifecycle. The build fails on this:

$ python ./owtf.sh setup File "./owtf.sh", line 8 function setup { ^ SyntaxError: invalid syntax The command "python ./owtf.sh setup" failed and exited with 1 during . Your build has been stopped.

jherrlin commented 8 years ago

How will the commands endpoint work out when there are more than one container?

jherrlin commented 8 years ago

Django wont create all the log files so they need to be in the repo, and should be in the .gitignore so we dont push log stuff to the repo.

jherrlin commented 8 years ago

This is not a python file. I guess it could be run with: bash -c ./owtf.sh

$ python ./owtf.sh setup File "./owtf.sh", line 8 function setup { ^ SyntaxError: invalid syntax The command "python ./owtf.sh setup" failed and exited with 1 during . Your build has been stopped.

Spetastian commented 8 years ago

Every "code object" would probably just have a list of commands as such:

[ { "code": "666", "target": "", commands: [ {"image": "owtfvalhallatestcontainer:0.1", "noise": "passive", "command": "sleep 5s", "description": "Test"}, {"image": "owtfvalhallatestcontainer:0.2", "noise": "passive", "command": "sleep 5s", "description": "Test"} ]} ]

jherrlin commented 8 years ago

I am a little unsure about removing the log files, if the application is not set up with the ./owtf setup script, there will be an error that the log files are missing.