1
0
Fork 0
mirror of https://github.com/Luzifer/share.git synced 2024-12-19 18:11:17 +00:00
S3 based file sharing as a replacement for CloudApp / Droplr / ...
Find a file
2024-12-03 15:11:36 +01:00
.github/workflows CI: Update workflow 2024-12-03 15:06:41 +01:00
ci Port frontend to Vue 3 / Bootstrap 5.3 2024-03-18 20:22:31 +01:00
docs Add Demo 2024-03-18 21:27:40 +01:00
frontend Port frontend to Vue 3 / Bootstrap 5.3 2024-03-18 20:22:31 +01:00
frontend-src Lint: Fix linter errors 2024-12-03 14:59:11 +01:00
.eslintrc.js Port frontend to Vue 3 / Bootstrap 5.3 2024-03-18 20:22:31 +01:00
.gitignore Port frontend to Vue 3 / Bootstrap 5.3 2024-03-18 20:22:31 +01:00
CONTRIBUTING.md Add meta-files 2017-12-02 19:48:18 +01:00
Dockerfile Port frontend to Vue 3 / Bootstrap 5.3 2024-03-18 20:22:31 +01:00
go.mod Update Go dependencies 2024-12-03 15:05:19 +01:00
go.sum Update Go dependencies 2024-12-03 15:05:19 +01:00
History.md prepare release v0.14.2 2024-12-03 15:11:36 +01:00
http.go Update deps, fix linter errors, improve code 2024-03-18 13:42:19 +01:00
LICENSE Add meta-files 2017-12-02 19:48:18 +01:00
main.go Port frontend to Vue 3 / Bootstrap 5.3 2024-03-18 20:22:31 +01:00
Makefile Port frontend to Vue 3 / Bootstrap 5.3 2024-03-18 20:22:31 +01:00
mime.go Update deps, fix linter errors, improve code 2024-03-18 13:42:19 +01:00
package-lock.json Update Node dependencies 2024-12-03 15:04:43 +01:00
package.json Update Node dependencies 2024-12-03 15:04:43 +01:00
progress.go Update deps, fix linter errors, improve code 2024-03-18 13:42:19 +01:00
README.md Add Demo 2024-03-18 21:27:40 +01:00
upload.go Fix: Complete bar even for very small files 2024-03-18 20:22:35 +01:00

Go Report Card

Luzifer / share

share is a small replacement I wrote for sharing my files through external services like CloudApp using Amazon S3. Files are uploaded using this utility into S3 and previewed (if supported) using the included frontend.

Browser Support

The frontend can be used in all modern browsers. Internet Explorer is not supported.

Setup / usage

  • Create a S3 bucket and CloudFront distribution
    (See docs/cloudformation.yml for an example stack)
  • Run bootstrap to initialize frontend files:
    ./share --bucket=<bucket from step 1> --bootstrap
  • Upload files to your sharing bucket:
    ./share --bucket=<bucket from step 1> --base-url='https://your.site.com/#' <yourfile>
  • Share the URL you received from last step

After you've updated the binary you need to run the --bootstrap command once more to have the latest interface changes uploaded to your bucket.

Templating in file-template

You can specify where in the bucket the file should be stored and how it should be named by passing the --file-template parameter. It takes a Go template with these placeholders:

  • {{ .Ext }} - The extension of the file (including the leading dot, i.e. .txt)
  • {{ .FileName }} - The original filename without changes (i.e. my video.mp4)
  • {{ .Hash }} - The SHA256 hash of the file content
  • {{ .SafeFileName }} - URL-safe version of the filename (i.e. my-video.mp4)
  • {{ .UUID }} - Random UUIDv4 to be used within the URL to make it hard to guess

Examples:

  • --file-template="file/{{ printf \"%.8s\" .Hash}}/{{ .SafeFileName }}"
  • --file-template="file/{{ printf \"%.8s\" .Hash}}/{{ .UUID }}{{ .Ext }}"