Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Script config admin panel #239

Merged
merged 6 commits into from
Nov 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions samples/configs/destroy_world.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "destroy_world",
"script_path": "./samples/scripts/destroy_world.py",
"description": "This is a very dangerous script, please be careful when running. Don't forget your protective helmet.",
"requires_terminal": false
Expand Down
4 changes: 2 additions & 2 deletions samples/configs/mult_words.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "Multiple words",
"script_path": "'mult words.py' 1 'word 2' '' 'word4'",
"description": "Executes a complex command specified as a scripts path and prints all incoming parameters",
"working_directory": "./samples/scripts/",
"description": "Executes a complex command specified as a scripts path and prints all incoming parameters",
"parameters": [
{
"name": "Param1",
Expand All @@ -15,4 +15,4 @@
"default": "a single parameter"
}
]
}
}
90 changes: 45 additions & 45 deletions samples/configs/parameterized.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "Very parameterized",
"script_path": "scripts/parameterized.sh",
"working_directory": "./samples",
"description": "This script does nothing except accepting a lot of parameters and printing them",
"allowed_users": [
"*"
],
"include": "${Simple Text}.json",
"working_directory": "./samples",
"parameters": [
{
"name": "Simple Int",
Expand All @@ -21,15 +21,15 @@
},
{
"name": "Simple Text",
"required": true,
"param": "--simple_text",
"description": "Parameter Four",
"required": true
"description": "Parameter Four"
},
{
"name": "Simple List",
"param": "--simple_list",
"description": "Parameter Five",
"type": "list",
"description": "Parameter Five",
"values": [
"val1",
"val3",
Expand All @@ -38,15 +38,15 @@
},
{
"name": "File upload",
"description": "File upload testing",
"param": "--file_upload",
"type": "file_upload",
"param": "--file_upload"
"description": "File upload testing"
},
{
"name": "Multiple selection",
"description": "Multiselect list",
"type": "multiselect",
"param": "--multiselect",
"type": "multiselect",
"description": "Multiselect list",
"values": [
"Black cat",
"Brown dog",
Expand All @@ -56,74 +56,74 @@
},
{
"name": "Required Text",
"required": true,
"param": "--required_text",
"description": "Parameter One",
"required": true
"description": "Parameter One"
},
{
"name": "Required List",
"required": true,
"param": "--required_list",
"description": "List with required value",
"type": "list",
"required": true,
"description": "List with required value",
"values": [
"v1",
"v2"
]
},
{
"name": "Constrained Int",
"required": "true",
"param": "--constrained_int",
"description": "Parameter Three",
"type": "int",
"required": "true",
"default": "5",
"description": "Parameter Three",
"min": "-1",
"max": "123"
},
{
"name": "Default Text",
"param": "--def_text",
"description": "Text with default value and required",
"required": true,
"default": "some_text"
"param": "--def_text",
"default": "some_text",
"description": "Text with default value and required"
},
{
"name": "Default Boolean",
"param": "--def_bool",
"no_value": true,
"description": "Boolean Two",
"default": true
"default": true,
"description": "Boolean Two"
},
{
"name": "Constant Text",
"description": "Constant value",
"param": "--const_text",
"default": "constOne",
"constant": true,
"default": "constOne"
"description": "Constant value"
},
{
"name": "Command-based list",
"param": "--var_file",
"description": "List parameter 2",
"type": "list",
"description": "List parameter 2",
"values": {
"script": "ls /var"
}
},
{
"name": "Secure Int",
"type": "int",
"description": "Parameter Nine",
"secure": true,
"type": "int"
"secure": true
},
{
"name": "Secure List",
"description": "Parameter Ten",
"secure": true,
"param": "--secure_list",
"type": "list",
"default": "qwerty",
"param": "--secure_list",
"description": "Parameter Ten",
"secure": true,
"values": [
"qwerty",
"12345678",
Expand All @@ -132,9 +132,9 @@
},
{
"name": "Very long list",
"description": "List with very long values",
"type": "list",
"param": "--very_long_list",
"type": "list",
"description": "List with very long values",
"values": [
"some quite long line",
"short",
Expand All @@ -146,25 +146,25 @@
},
{
"name": "Multiselect as secure arguments",
"description": "Multiselect list as multiple arguments",
"type": "multiselect",
"required": true,
"multiple_arguments": true,
"secure": true,
"type": "multiselect",
"default": [
"multi1",
"multi 3"
],
"description": "Multiselect list as multiple arguments",
"secure": true,
"values": [
"multi1",
"multi2",
"multi 3"
]
],
"multiple_arguments": true
},
{
"name": "Dependant list",
"description": "A list with values depending on other parameters",
"type": "list",
"description": "A list with values depending on other parameters",
"values": {
"script": "ls /var/${Command-based list}/${Required Text}"
}
Expand All @@ -176,9 +176,9 @@
},
{
"name": "Audit name",
"constant": true,
"param": "--audit_name",
"default": "${auth.audit_name}"
"default": "${auth.audit_name}",
"constant": true
},
{
"name": "Any IP",
Expand All @@ -200,28 +200,28 @@
"name": "Server file",
"param": "--server_file",
"type": "server_file",
"secure": true,
"file_dir": "/var/log",
"file_extensions": [
"log"
],
"secure": true
]
},
{
"name": "Recursive file",
"param": "--recurs_file",
"type": "server_file",
"default": [
"samples",
"configs",
"parameterized.json"
],
"secure": true,
"file_dir": "..",
"file_recursive": true,
"file_extensions": [
"json",
".log",
"TXT"
],
"secure": true,
"default": [
"samples",
"configs",
"parameterized.json"
]
}
]
Expand Down
16 changes: 10 additions & 6 deletions samples/configs/write_file.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
"@admin_users",
"127.0.0.1"
],
"output_files": [
"##any_path#",
"~/${filename}",
{
"type": "inline-image",
"path": "##any_path.png#"
}
],
"parameters": [
{
"name": "text",
Expand All @@ -17,8 +25,8 @@
"name": "repeats",
"param": "-r",
"type": "int",
"min": 1,
"description": "How many times the text should be written to the file"
"description": "How many times the text should be written to the file",
"min": 1
},
{
"name": "clear file",
Expand All @@ -31,9 +39,5 @@
"param": "-f",
"description": "Custom filename"
}
],
"output_files": [
"##any_path#",
"~/${filename}"
]
}
Loading