Cloud-native file storage and sharing, built with security, convenience, and resilience in mind.
To run a multi-node deployment, clone this repository and run make prod-up:
# Clone the repository
git clone git@github.com:OhanaFS/ohana.git
# Enter the cloned directory
cd ohana
# Start
make prod-upTo get started with development, you'll need:
- Go 1.18
- Docker and Docker Compose
- GNU Make
- Node.js and Yarn
- upx
Once you have the tools installed, simply run make:
# Clone the repository
git clone git@github.com:OhanaFS/ohana.git
# Enter the cloned directory
cd ohana
# Build
make
# Run backend in development mode
CONFIG_FILE=config.example.yaml make dev
# Set up and run frontend development server
cd web
yarn
yarn devThen try it out! Go to https://127.0.0.1:8000/ in your browser and you should
see the React app. The login URL is /auth/login and the default credentials is
admin:password, as defined in the .dev/docker-compose.yaml file (the
USERS_CONFIGURATION_INLINE part).
If you get a
panic: open certificates/main_GLOBAL_CERTIFICATE.pem: no such file or directory
error, you need to generate the certificates to allow the servers to securely
communicate with each other.
-
Make a copy of certshost.example.yaml, name it certshost.yaml, and fill it out with all the hostnames or IP addresses of the servers in the cluster. You can use wildcards, but they cannot be too generic (e.g. *.hosts is fine, but * is not). See wildcards here for more.
-
From the ohana directory, run
./bin/ohana --gen-ca --gen-certs -hosts certhosts.example.yaml--gen-cawill generate a new CA package that includes the following:main_csr.json- this is the CSR for the CA. This is required for making new client and node certificatesmain_PRIVATE_KEY.pem- this is the private key for the CA. This is required for making new client and node certificates.main_GLOBAL_CERTIFICATE.pem- this is the certificate for the CA. This is required for making new client and node certificates, and for validating the certificates of the other servers.
--gen-certswill generate a new Cert Package that includes the following:output_cert.pem- this is the certificate for the server.output_key.pem- this is the private key for the server.
Cert Generation Parameters
- You can use
-num-of-certsto specify the number of certificates to generate. - After generating the CA once, you can generate more certificates by specifying
the paths of the CA files using the following parameters and run
./bin/ohana --gen-certswith the following parameters:--csr-pathformain_csr.json--cert-pathformain_GLOBAL_CERTIFICATE.pem--pk-pathformain_PRIVATE_KEY.pem
- You can find more information about the parameters by running
./bin/ohana --help
When you're done, don't forget to tear down redis and the postgres database:
make dev-down
-
Code formatting
To ensure style consistency, make sure you install gofmt to automatically format your code. Most editors should include this by default in their language extensions. Enable formatting in VSCode.
-
Try to wrap comments to at most 80 characters wide.
-
We also try to follow Uber's Go Style Guide.