1.1 --- a/OpenSecurity.iss Mon Mar 10 13:14:31 2014 +0100
1.2 +++ b/OpenSecurity.iss Mon Mar 10 15:23:16 2014 +0100
1.3 @@ -8,12 +8,12 @@
1.4 AppContact=AIT Austrian Institute of Technology
1.5 AppPublisher=AIT Austrian Institute of Technology
1.6 AppPublisherURL=http://www.ait.ac.at/
1.7 -AppVersion=0.2
1.8 +AppVersion=0.2.1
1.9 ArchitecturesInstallIn64BitMode=x64
1.10 DefaultDirName={pf}\OpenSecurity
1.11 DefaultGroupName=OpenSecurity
1.12 OutputDir="."
1.13 -OutputBaseFilename="OpenSecurity Setup V0.2"
1.14 +OutputBaseFilename="OpenSecurity Setup V0.2.1"
1.15 OutputManifestFile=OpenSecurity-Setup-Manifest.txt
1.16 SetupIconFile=OpenSecurity\gfx\OpenSecurity.ico
1.17 SolidCompression=yes
1.18 @@ -28,8 +28,8 @@
1.19 Source: "OpenSecurity\python27\*"; DestDir: "{app}\python27"; Flags: recursesubdirs createallsubdirs;
1.20
1.21 [Dirs]
1.22 -Name: "{app}\log";
1.23 -Name: "{app}\vm";
1.24 +Name: "{app}\cygwin64\var\log\xwin"; Permissions: everyone-modify
1.25 +Name: "{app}\log"; Permissions: everyone-modify
1.26
1.27 [Registry]
1.28 ; Registry entries to set
1.29 @@ -37,19 +37,18 @@
1.30
1.31 [Icons]
1.32 ; Program Icons in start menu
1.33 -Name: "{group}\OpenSecurity Initial VM"; Filename: "{app}\python27\pythonw.exe"; Parameters: """{app}\bin\download-image.pyw"""; WorkingDir: "{app}"; Comment: "Download and install the initial OpenSecurity VM image"; IconFilename: "{app}\gfx\OpenSecurity.ico"
1.34 Name: "{group}\OpenSecurity Tray Icon"; Filename: "{app}\python27\pythonw.exe"; Parameters: """{app}\bin\opensecurity_tray.pyw"""; WorkingDir: "{userappdata}"; Comment: "The OpenSecurity Tray Icon"; IconFilename: "{app}\gfx\OpenSecurity.ico"
1.35 -Name: "{group}\Initial VM import"; Filename: "{app}\cygwin64\bin\bash.exe"; Parameters: "-i -l /OpenSecurity/install/initial_vm.sh"; WorkingDir: "{app}"; Comment: "Import the initial OpenSecurity VM"; IconFilename: "{app}\gfx\OpenSecurity.ico"
1.36 Name: "{group}\Uninstall OpenSecurity"; Filename: "{uninstallexe}"
1.37
1.38 [Run]
1.39 ; Run after installment
1.40 Filename: "{app}\cygwin64\bin\dash.exe"; Parameters: "/bin/rebaseall"; Description: "Rebasing background system"; WorkingDir: "{app}"; StatusMsg: "Rebasing background system..."; Flags: runascurrentuser
1.41 -Filename: "{app}\install\fix_cygwin_paths.bat"; Description: "Fixing Cygwin paths"; WorkingDir: "{app}\install"; StatusMsg: "Fixing Cygwin Paths..";
1.42 +Filename: "{app}\install\fix_cygwin_paths.bat"; Description: "Fixing Cygwin paths"; WorkingDir: "{app}\install"; StatusMsg: "Fixing Cygwin Paths...";
1.43 +Filename: "{app}\cygwin64\bin\bash.exe"; Parameters: "-l -i -c echo -n"; Description: "Enforcing login environment for shells"; WorkingDir: "{app}"; StatusMsg: "Enforcing login environment for shells...";
1.44 Filename: "{app}\python27\pythonw.exe"; Parameters: """{app}\bin\opensecurity_service.pyw"" --startup auto install"; Description: "Installing the OpenSecurity Service"; WorkingDir: "{app}"; StatusMsg: "Installing the OpenSecurity Service"; Flags: runascurrentuser
1.45 -Filename: "{app}\python27\pythonw.exe"; Parameters: """{app}\bin\download-image.pyw"""; WorkingDir: "{app}"; Description: "Download and install the initial OpenSecurity VM image"; Flags: postinstall runascurrentuser
1.46 -Filename: "{app}\cygwin64\bin\bash.exe"; Parameters: "-i -l /OpenSecurity/install/initial_vm.sh"; WorkingDir: "{app}"; Description: "Import the initial OpenSecurity VM"; Flags: postinstall runascurrentuser
1.47 -
1.48 +Filename: "{app}\python27\pythonw.exe"; Parameters: """{app}\bin\opensecurity_service.pyw"" start"; Description: "Starting OpenSecurity Service"; WorkingDir: "{app}"; StatusMsg: "Starting OpenSecurity Service"; Flags: runascurrentuser
1.49 +Filename: "{app}\python27\pythonw.exe"; Parameters: """{app}\bin\opensecurity_tray.pyw"""; WorkingDir: "{userappdata}"; Description: "Launching OpenSecurity Tray Icon";
1.50 +
1.51 [UninstallRun]
1.52 ; When uninstalling run this command prior
1.53 Filename: "{app}\python27\pythonw.exe"; Parameters: """{app}\bin\opensecurity_service.pyw"" stop"; WorkingDir: "{app}"; StatusMsg: "Stopping the OpenSecurity Service"; Flags: runascurrentuser
2.1 --- a/OpenSecurity/bin/initial_vm.sh Mon Mar 10 13:14:31 2014 +0100
2.2 +++ b/OpenSecurity/bin/initial_vm.sh Mon Mar 10 15:23:16 2014 +0100
2.3 @@ -114,6 +114,9 @@
2.4 else
2.5 echo "found SecurityDVM already present in VBox reusing it."
2.6 echo "if you want a complete new import please remove the VM first."
2.7 + echo "starting OpenSecurity service..."
2.8 + net start "OpenSecurity Service"
2.9 + echo "OpenSecurity service started"
2.10 exit 1
2.11 fi
2.12
2.13 @@ -126,6 +129,9 @@
2.14 if [ -z "${VDISK_CONTROLLER}" ]; then
2.15 echo "unable to grab virtual disk controller in VM."
2.16 echo "this shouldn't happen. It's a bug."
2.17 + echo "starting OpenSecurity service..."
2.18 + net start "OpenSecurity Service"
2.19 + echo "OpenSecurity service started"
2.20 exit 1
2.21 fi
2.22
3.1 --- a/OpenSecurity/bin/opensecurityd.pyw Mon Mar 10 13:14:31 2014 +0100
3.2 +++ b/OpenSecurity/bin/opensecurityd.pyw Mon Mar 10 15:23:16 2014 +0100
3.3 @@ -64,6 +64,7 @@
3.4 '/sdvms/(.*)/start', 'os_sdvm_start', # http://localhost:8080/sdvms/[VMNAME]/start GET
3.5 '/sdvms/(.*)/stop', 'os_sdvm_stop', # http://localhost:8080/sdvms/[VMNAME]/stop GET
3.6 '/sdvms/(.*)', 'os_sdvm', # http://localhost:8080/sdvms/[VMNAME] GET, DELETE
3.7 + '/setup', 'os_setup', # http://localhost:8080/setup GET
3.8 '/vms', 'os_vms', # http://localhost:8080/vms GET
3.9 '/vms/(.*)', 'os_vm', # http://localhost:8080/vms/[VMNAME] GET
3.10 '/update_template', 'os_update_template', # http://localhost:8080/update_template GET
3.11 @@ -122,7 +123,16 @@
3.12 download_initial_image_script = '/OpenSecurity/bin/download_initial_image.sh \'' + machine_folder + '\''
3.13 Cygwin.bashExecute(download_initial_image_script, wait_return = False, stdout = trace_file, stderr = trace_file)
3.14
3.15 - return trace_file_name
3.16 + page = """
3.17 + <html>
3.18 + <head></head>
3.19 + <body>
3.20 + Fetch OpenSecurity image log ({0}):<br/>
3.21 + <iframe src="file://{0}" width="100%" height="100%"></iframe>
3.22 + </body>
3.23 + </head>
3.24 + """
3.25 + return page.format(trace_file_name)
3.26
3.27
3.28 class os_init:
3.29 @@ -142,7 +152,16 @@
3.30 initial_import_script = '/OpenSecurity/bin/initial_vm.sh \'' + vm_image + '\''
3.31 Cygwin.bashExecute(initial_import_script, wait_return = False, stdout = trace_file, stderr = trace_file)
3.32
3.33 - return trace_file_name
3.34 + page = """
3.35 + <html>
3.36 + <head></head>
3.37 + <body>
3.38 + Import initial OpenSecurity image log ({0}):<br/>
3.39 + <iframe src="file://{0}" width="100%" height="100%"></iframe>
3.40 + </body>
3.41 + </head>
3.42 + """
3.43 + return page.format(trace_file_name)
3.44
3.45
3.46 class os_root:
3.47 @@ -259,6 +278,31 @@
3.48 return name
3.49
3.50
3.51 +class os_setup:
3.52 + """OpenSecurity '/setup' handler
3.53 +
3.54 + - GET: Give user some info how to setup the OpenSecurity envvironment
3.55 + """
3.56 +
3.57 + def GET(self):
3.58 +
3.59 + log_call(web.ctx.environ)
3.60 +
3.61 + page = """
3.62 + <html>
3.63 + <body>
3.64 + <h1>Setup OpenSecurity</h1>
3.65 + In order to setup OpenSecurity an inital VM image has to be downloaded and imported:<br/>
3.66 + <ul>
3.67 + <li>Download initial VM image: <a href="/fetch_initial_image">fetch_initial_image</a>
3.68 + <li>Import initial VM: <a href="/init">init</a>
3.69 + </ul>
3.70 + </body>
3.71 + </html>
3.72 + """
3.73 + return page
3.74 +
3.75 +
3.76 class os_terminate:
3.77 """OpenSecurity '/terminate' handler
3.78