Compare commits

..

4 Commits

Author SHA1 Message Date
7d2923c276 fixed typo in README 2022-06-25 12:15:30 +02:00
70a23c0d55 added direct image link in share script 2022-06-24 13:27:18 +02:00
73559fde88 version bump
All checks were successful
continuous-integration/drone/push Build is passing
2022-06-08 22:11:46 +02:00
d303ec9154 added docker to README 2022-06-08 22:09:18 +02:00
3 changed files with 13 additions and 4 deletions

View File

@@ -12,7 +12,7 @@ Run `make` and the binary together with the web frontend will be in the `build`
# Usage # Usage
Run the `s3browser` binary with the `--help` flag to see the available options. Run the `s3share` binary with the `--help` flag to see the available options.
The `public` directory needs to be in the same directory as the binary. The `public` directory needs to be in the same directory as the binary.
S3Share requires two things: S3Share requires two things:
@@ -20,6 +20,10 @@ S3Share requires two things:
- a s3 bucket with read access - a s3 bucket with read access
- a sql database - a sql database
## Docker
The docker image is available at [Dockerhub](https://hub.docker.com/r/djeeberjr/s3share). There is also a [docker-compose](docker-compose.yml) file that can be used as an example.
# Synopsis # Synopsis
``` ```

View File

@@ -19,8 +19,7 @@ type args struct {
} }
func (args) Version() string { func (args) Version() string {
// TODO return "s3share 1.0"
return "s3share 0.1"
} }
func main() { func main() {

View File

@@ -36,4 +36,10 @@ SLUG=$(curl -s -u "$API_USERNAME:$API_PASSWORD" -X POST --header "Content-Type
--data "{\"key\":\"$UPLOAD_FILENAME\"}" \ --data "{\"key\":\"$UPLOAD_FILENAME\"}" \
"$ENDPOINT/api/share" | jq -r ".slug") "$ENDPOINT/api/share" | jq -r ".slug")
printf "%s/%s\n" "$ENDPOINT" "$SLUG"
MIME=$(file -i -b "$UPLOAD_FILE")
if echo "$MIME" | grep "image" &> /dev/null; then
printf "%s/s/%s.%s\n" "$ENDPOINT" "$SLUG" "${UPLOAD_FILENAME##*.}"
else
printf "%s/%s\n" "$ENDPOINT" "$SLUG"
fi