The goal of the project is to create an easy to setup file hosting service. The idea is that anyone with a linux computer can setup a upfi-instance!
You will need to create a database and configure an environment variables file. Here is a example of the .env
file. All of the fields below must be added to the .env
for the service to work.
#.env
db_name=upfi
db_port=5432
db_host=localhost
port=8080
db_user=postgres
root_dir=/home/username/go/src/github.com/nireo/upfi/
The root dir is there since I found some problems with relative file paths. Such that the project uses a util function which appends the 'root_dir' variable to all of the paths.
To use a different database than postgres, check out the documentation of gorm.
Now you can just run the app.
go run main.go
- Make the service more secure and follow security best practices.
- Do some input validation to make sure user's don't post too long inputs.
- Add a success page to remove the bug with redirecting.
- Make the encryption key map to a single file rather than being global for the user.
- Make it optional to encrypt a file such that the user can possibly share it.
Anyone can contribute to the project by creating a pull request!