How to Share Files from Google Cloud Object Storage (GCP)
You will require a new Virtual Machine instance with at least 2GB RAM, 20GB hard space and Ubuntu 20.04 LTS. Let us create one and configure the same.
- Login to https://console.cloud.google.com
- Go to Compute Engine – VM instances
- Click on CREATE INSTANCE
- Provide required details including hardware specification.
- For the Boot disk, you need to select operating system as Ubuntu 20.04 LTS
- Create the VM instance.
- For more information you can also refer to Google Documentation
Once the VM is created, we need to open couple of ports for NirvaShare, so let us create a new firewall rule.
- From the main menu, click on VPC Network and select Firewall
- Click on CREATE FIREWALL RULE
- Provide name and target tags as nirvashare-firewall
- For Source IP range, enter 0.0.0.0/0 to let access from all source IP addresses.
- For Protocols and ports, select Specified protocols and ports
- Enter ports as 8080, 8081 and create it.
Now, let us open the ports to the newly created VM by changing the firewall policy.
- Go to Compute Engine – VM instances or open https://console.cloud.google.com/compute/instances
- Click on the VM instance that we created.
- Click on EDIT button
- For the Network Tags, enter nirvashare-firewall and Save it.
SSH to the newly created VM instance using your private ssh key or the simplest way is to use the option to open with browser.
- From the VM instance SSH , select Open in browser window
- Once you log in to SSH console, run below commands to start the installation as root user. This will download the script and install NirvaShare.
sudo su root curl -s https://raw.githubusercontent.com/nirvashare/nirvashare/main/linux/ubuntu/install_nirvashare.sh -o ns_install.sh && bash ns_install.sh && rm ns_install.sh
Above command will prompt you to enter database password, once provided, it will proceed and complete the installation within a minute or two.
After installation is completed, wait for 3-4 minutes for server to come up as it takes time to create schema, etc.
Access the url as http://(your IP):8080
This should open up login screen as shown below.
Login Profile for Form based Authentication
To password protect a shared File/Folder, a login profile is required to be created which will enable authentication for the shares. In this exercise, we will create a simple Form based login profile (Single User) and refer to below documentation.
Now we are good to share a file/folder with a user that is based on the Login Profile we created. Multiple Shares can be created for the same login profile. Let us create a Share for a folder that you like to share with the user. Please refer to the below documentation on how to create a new share for a file/folder, associate to a login profile, and share the same with the user. During the configuration, for the authentication, please select the login profile that we created from the above section.
SSL and Domain Names
For testing purposes, File/Folder can still be shared to user without SSL and domain name, but however for production deployment or to integration with external identity providers, you will require domain name and SSL to be configured. Please refer to below documentation.