tempb.in is a temporary file storage.
The application uses the following:
- Go
- Postgresql
- HTML/CSS/JS
- Prometheus
Development of this project is complete unless there are some alarming bugs.
On submission of the form, a unique string is created. This string is set as the filename and will be used as the path of the URL that is returned.
A database record is created with the unique string and the actual file name. The file is then stored in a directory called bucket.
A worker scans the database every minute to find files that have expired. The files that have expired are deleted and the database record deleted.
git clone https://github.com/vivekmurali/tempbin.git
Create a database in postgresql tempbin is used here
psql -d tempbin < db.sql
make
The application is deployed on a VM and the application is run by systemd. To visualize the prometheus metrics, I have used grafana.
A prometheus client counts the number of http requests, the responses, the number of files in the bucket and the duration of the responses.
ID (PK) | NAME | UPLOAD_TIME | URL | IS_PROTECTED | PASSWORD | IS_LIMIT | LIMIT |
---|---|---|---|---|---|---|---|
serial | text | datetime | text | bool | text | bool | int |
All issues are welcome, there's a higher chance of it being fixed if the issues is accompanied with a PR.
Vivek Murali - @vivekmurali2k - vivekmurali2k@gmail.com
Thanks to:
MIT