All the files necessary for the deployment and testing of the backend web application can be found under ./backend/.
Run the deployment script: sh runserver.sh
After a successful deployment, run the testing script: sh runtests.sh.
POST /api/users/auth
{
"email" : "...",
"password" : "..."
}
Response:
Status 200, body:
{
"token" : "..."
}
PUT /api/users/register
{
"email" : "...",
"name" : "....",
"password" : "..."
}
Response:
Status 201, body:
{
"message" : "Success!"
}
GET /api/users/vms
Required header: Authorization : Bearer token_from_auth
Response:
Status 200, body:
[
{
"name": "..."
"desc": "...",
"address": "...",
"sts": "...",
"img": "..."
}
]
POST /api/users/vms/start
Required header: Authorization : Bearer token_from_auth
{
"instance" : name_of_instance
}
POST /api/users/vms/stop
Required header: Authorization : Bearer token_from_auth
{
"instance" : name_of_instance
}
Frontend of the project is implemented both as an Android application and responsive website.
To build APK files run buildapks.sh in frontend/android directory.
sh buildapks.sh
After the build you can find the APK files at: multivnc: frontend/android/multivnc/app/build/outputs/apk/app-debug.apk thin-client-computing: frontend/android/thin-client-computing/app/build/outputs/apk/app-debug.apk
Our Android client uses multivnc as an external VNC app.
To build and run web application, run runfront.sh in frontend/web directory.
sh runfront.sh
The build script will launch a tunnel to localhost where the webapp will run. This is done to give possibility to run the web app over https for the geolocation to work on mobile.
Note: As of Chrome 50, the Geolocation API will only work on secure contexts such as HTTPS. If your site is hosted on an non-secure origin (such as HTTP) the requests to get the users location will no longer function. http://www.w3schools.com/html/html5_geolocation.asp
The website VNC viewer is implemented by using noVNC HTML5 client.
- Your operating system needs to be a fresh Ubuntu 16.04 LTS
- In case you use this configuration outside of the specific google cloud project, you need to make specific changes to the script so it reflects your environment.
- You need to alter the lines 156 and 160 so they have right IP address.
- You need to alter the lines 156,160,147, 41,168 so they have right existing username (root/projectname).
- You must create a firewall rule that allows VNC and Websocket connections to the VM.
If you want to configure a fresh Ubuntu 16.04 LTS Virtual Machine, you can use the configuration file (vm_config.sh). You can use SCP or various other methods or just copy paste it into the VM. After the file has been transfered remember to change user rights so you can execute it:
chmod +x vm_config.sh
Then just execute it:
./vm_config.sh
VNC IPs are hardcoded in this configuration script. Also, at one point it refers to the google account as an username. This means it wont work without some minor tweaks for other projects.