Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/luzifer/share
S3 based file sharing as a replacement for CloudApp / Droplr / ...
https://github.com/luzifer/share
aws golang s3 self-hosted sharing
Last synced: 2 months ago
JSON representation
S3 based file sharing as a replacement for CloudApp / Droplr / ...
- Host: GitHub
- URL: https://github.com/luzifer/share
- Owner: Luzifer
- License: apache-2.0
- Created: 2017-12-02T15:35:06.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-03-22T13:56:31.000Z (10 months ago)
- Last Synced: 2024-06-20T20:04:40.605Z (7 months ago)
- Topics: aws, golang, s3, self-hosted, sharing
- Language: Go
- Homepage:
- Size: 18.8 MB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: History.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[![Go Report Card](https://goreportcard.com/badge/github.com/Luzifer/share)](https://goreportcard.com/report/github.com/Luzifer/share)
![](https://badges.fyi/github/license/Luzifer/share)
![](https://badges.fyi/github/downloads/Luzifer/share)
![](https://badges.fyi/github/latest-release/Luzifer/share)# 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.
![](./docs/demo.gif)
## 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](docs/cloudformation.yml) for an example stack)
- Run bootstrap to initialize frontend files:
`./share --bucket= --bootstrap`
- Upload files to your sharing bucket:
`./share --bucket= --base-url='https://your.site.com/#' `
- Share the URL you received from last stepAfter 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 guessExamples:
- `--file-template="file/{{ printf \"%.8s\" .Hash}}/{{ .SafeFileName }}"`
- `--file-template="file/{{ printf \"%.8s\" .Hash}}/{{ .UUID }}{{ .Ext }}"`