To test on Google Cloud:
- Clone the repository to your desired local directory with
git clone. - Open the local version of the repository
CNT3004-Project. - On a browser, navigate to Google Cloud.
- Create a new project.
- Navigate to the Compute Engine page for your project, and select on the 'VM Instances' tab.
- Create a VM Instance with the 'Create Instance' button
- Configure your instance to suit your billing affordance.
- Start your instance.
- Open the instance. Scroll to network interfaces:
- In
server.pychangehostto the IP address listed under 'Primary internal IP address' - In
client.pychangehostto the IP address listed under 'External IP address'. Remember that this address can change with Starting/Stoping the instance or overtime.
- Scroll back to the top and open an SSH window with the 'SSH' button.
- Upload the file
server.pyinto the SSH with the 'Upload File' button. - Create a directory for the server files named
server_filesin your main directory.
use command
mkdir server_filesto create the folder.
- Create a file named
passwords.txtin your main directory.
use command
touch passwords.txtto create the file.
- In
view.py, updateFILE_STORAGE_DIRto the path ofserver_files
use command
realpath server_filesto get the exact path; copy it and assign the value toFILE_STORAGE_DIR
- In
view.pyin the methodvalidate_credentials()in the classLoginView, updatefilepathto the path ofpasswords.txt.\
use command
realpath passwords.txtto get the exact path; copy it and assign the value tofilepath
- Start the server with the command
python3 server.py. - Start the program by running
main.py. - When finished, Stop your VM instance to avoid extra billing.