Skip to content

Commit

Permalink
next big update:
Browse files Browse the repository at this point in the history
- resuming interupted uploads (closes #1)
- dedup of already existing files
- multi-part uploads
- configurable expiration time
- UTF-8 support
- copy URLs to clipboard (closes #12)
- a ton of other smaller fixes
  • Loading branch information
stv0g committed Apr 3, 2022
1 parent 9ed88be commit bd97abf
Show file tree
Hide file tree
Showing 34 changed files with 1,508 additions and 648 deletions.
28 changes: 18 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p align="center" >
<img style="width: 30%; margin: 4em 0" src="frontend/img/gose-logo.svg" alt="GoSƐ logo" />
<h1 align="center">GoSƐ - A tera-scale file-uploader</h1>
<h1 align="center">GoSƐ - A terascale file-uploader</h1>
</p>

<!-- [![Codacy coverage](https://img.shields.io/codacy/coverage/27eec133fcfd4459885d78f52d03daa8?style=flat-square)](https://app.codacy.com/gh/stv0g/gose/) -->
Expand All @@ -18,20 +18,28 @@ GoSƐ is a modern file-uploader focusing on scalability and simplicity. It only

## Features

- De-duplication of uploaded files based on their content-hash
- Uploads of existing files will complete in no-time without re-upload
- S3 Multi-part uploads
- Resumption of interrupted uploads
- Drag & Drop of files
- Browser notifications about failed & completed uploads
- User-provided object expiration/retention time
- Copy URL of uploaded file to clip-board
- Detailed transfer statistics and progress-bar / chart
- Installation via single binary or container
- JS/HTML/CSS Frontend is bundled into binary
- Scalable to multiple replicas
- No other backend services apart from S3 storage are required
- Upload progress-bar and transfer statistics
- Direct upload to Amazon S3 via presigned-URLs
- Direct download from Amazon S3
- Drag & Drop of files
- Multi-part / chunked upload
- File integrity checks after finished upload via using MD5 checksum & ETags
- All state is kept in the S3 storage backend
- No other database or cache is required
- Direct up & download to Amazon S3 via presigned-URLs
- Gose deployment does not see an significant traffic
- UTF-8 filenames
- Multiple user-selectable buckets / servers
- Optional link shortening via an external service
- Optional notification about new uploads via [shoutrrr](https://containrrr.dev/shoutrrr/v0.5/)
- Mail notifications to user-provided recipient
- Browser notifications about failed & completed uploads
- User-provided object expiration/retention time


## Roadmap

Expand Down
5 changes: 3 additions & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ func run(cfg *config.Config) {

router.GET(apiBase+"/config", handlers.HandleConfig)
router.POST(apiBase+"/initiate", handlers.HandleInitiate)
router.POST(apiBase+"/part", handlers.HandlePart)
router.POST(apiBase+"/complete", handlers.HandleComplete)
router.GET(apiBase+"/download/:server/*key", handlers.HandleDownload)
router.HEAD(apiBase+"/download/:server/*key", handlers.HandleDownload)
router.GET(apiBase+"/download/:server/:etag/:filename", handlers.HandleDownload)
router.HEAD(apiBase+"/download/:server/:etag/:filename", handlers.HandleDownload)

server := &http.Server{
Addr: cfg.Listen,
Expand Down
4 changes: 3 additions & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ notification:
File: {{.FileName}}
Size: {{.FileSizeHuman}}
Type: {{.FileType}}
IP: {{.UploaderIP}} ({{.UploaderHostname}})
Uploaded at: {{.UploadDate.Format "Jan 02, 2006 15:04:05 UTC"}}
Uploaded by: {{.UploaderIP}} ({{.UploaderHostname}})
Expires at: {{.ExpiryDate.Format "Jan 02, 2006 15:04:05 UTC"}} ({{.ExpiryRuleID}})
# For user notifications
mail:
Expand Down
17 changes: 17 additions & 0 deletions frontend/css/chart.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$color-chart-fill: #f6bad1;
$color-chart-stroke: #eb71a0;

#chart {
width: 100%;
height: 100%;

svg {
path {
fill: $color-chart-fill;
stroke: $color-chart-stroke;
stroke-width: 0.4;
fill-opacity: 0.15;
stroke-opacity: 0.8;
}
}
}
23 changes: 23 additions & 0 deletions frontend/css/custom-file-button.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.custom-file-button {
input[type="file"] {
margin-left: -2px !important;

&::-webkit-file-upload-button {
display: none;
}

&::file-selector-button {
display: none;
}

height: 52px;
line-height: 38px;
}

&:hover {
label {
background-color: #dde0e3;
cursor: pointer;
}
}
}
102 changes: 73 additions & 29 deletions frontend/css/index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "variables.scss";
$color-dragzone: #eb71a0;

.dropzone {
box-sizing: border-box;
Expand All @@ -14,52 +14,96 @@
}

.logo {
margin-left: 2em;
width: 200px;
margin-left: 2em; // Aligns goose feet with title text
max-width: 40%;
}

.title {
margin-top: 1em;
font-family: "Lucida Console", Monaco, monospace;
font-weight: bolder;
}

.subtitle {
margin-bottom: 2em;
#copy {
margin-right: 0.5em;
cursor: pointer;
}

.progress {
margin-top: 1.5em;
height: 20px;
}
@import "chart.scss";
@import "custom-file-button.scss";

#statistics table {
margin-bottom: 0;
}
$container-max-widths: (
sm: 540px,
md: 600px,
lg: 640px,
xl: 680px
);

.custom-file-button input[type=file] {
margin-left: -2px !important;
}
$primary: #eb71a0;
$secondary: #73D2DE;
$success: #285943;
$info: #e5e5e5;
$warning: #773344;
$danger: #f22775;
$light: #eeeeee;
$dark: #23395B;
$warning: #f5ee81;

.custom-file-button input[type=file]::-webkit-file-upload-button {
display: none;
$spinner-height: 1em;
$spinner-width: 1em;
$spinner-animation-speed: 1s;

@import "~bootstrap/scss/bootstrap";

.alert-success {
a {
color: $success;
}
}

.custom-file-button input[type=file]::file-selector-button {
display: none;
#reset {
svg {
width: 2em;
height: 2em;
}

color: lightgray;
}

.custom-file-button:hover label {
background-color: #dde0e3;
cursor: pointer;
#reset:hover {
color: darkgray;
}

@import "~bootstrap/scss/bootstrap";
#statistics {
.progress {
height: 2em;
}

header {
margin-top: 4rem;
}
.progress-bar {
font-weight: 600;
}

table {
margin-bottom: 0;

th {
padding-left: 0;
font-weight: 500;
}

tr > *:not(:first-child) {
text-align: right;
}

th, td {
width: 25%;
padding-top: 0px;
padding-bottom: 0px;
}

.row {
margin-top: 1rem;
tr:last-child {
th, td {
border: 0;
}
}
}
}
1 change: 0 additions & 1 deletion frontend/css/variables.scss

This file was deleted.

Binary file added frontend/img/gose-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit bd97abf

Please sign in to comment.