Commit Graph

617 Commits

Author SHA1 Message Date
Alexey Kostin 1eecc22fb3
Normalize upload file name (#606)
* Generate secure token using crypto rand

* Normalize names of uploaded files

* revert token.go accidentally added to commit

* better input filename normalization using transfrom chain

* remove unused line

---------

Co-authored-by: Alexey Kostin <a.kostin@corp.mail.ru>
Co-authored-by: Andrea Spacca <andrea.spacca@gmail.com>
2024-03-20 09:02:57 +09:00
dependabot[bot] bedbc8162d
Bump google.golang.org/protobuf from 1.30.0 to 1.33.0 (#608)
Bumps google.golang.org/protobuf from 1.30.0 to 1.33.0.

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-15 15:16:01 +09:00
Alex Mayer 54b4f1aa86
Update Encryption Examples (#592)
Use long flags (i.e. --armor) which are easier to understand in examples

Co-authored-by: Andrea Spacca <andrea.spacca@gmail.com>
2024-02-22 18:39:39 +09:00
ArGei26 b5187546b1
Update examples.md (#603)
Added example script to display URL and deletion token
2024-02-22 18:38:42 +09:00
dependabot[bot] f207ec6122
Bump github.com/cloudflare/circl from 1.3.3 to 1.3.7 (#600)
Bumps [github.com/cloudflare/circl](https://github.com/cloudflare/circl) from 1.3.3 to 1.3.7.
- [Release notes](https://github.com/cloudflare/circl/releases)
- [Commits](https://github.com/cloudflare/circl/compare/v1.3.3...v1.3.7)

---
updated-dependencies:
- dependency-name: github.com/cloudflare/circl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-13 12:29:42 +01:00
dependabot[bot] 24e93f376a
Bump golang.org/x/crypto from 0.14.0 to 0.17.0 (#593)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.17.0.
- [Commits](https://github.com/golang/crypto/compare/v0.14.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-03 12:42:43 +01:00
Adams 29d93c6da0
Add new example (#574)
Add new example with option to upload password protected files of any format

Co-authored-by: Alexey Gynu <alexey.gynu@itentika.ru>
Co-authored-by: Andrea Spacca <andrea.spacca@gmail.com>
2023-12-04 14:58:11 +09:00
Luiz Angelo Daros de Luca a6f197a482
Fixes transfer() issues (#579)
- use subshell to avoid leaking vars to current shell
- use POSIX 'test -t' instead of tty
- have a single place to call curl
- echo the output url to add the carrier return when needed.
- use printf to process \n
- silence curl instead of teeing /dev/null

Co-authored-by: Andrea Spacca <andrea.spacca@gmail.com>
2023-12-04 14:54:54 +09:00
Andrea Spacca 95c7e675a0 fix http-auth-ip-whitelist 2023-12-04 14:36:57 +09:00
dependabot[bot] 4d8b442576
Bump google.golang.org/grpc from 1.53.0 to 1.56.3 (#586)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.53.0 to 1.56.3.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.53.0...v1.56.3)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-26 07:57:28 +09:00
Gavin Inglis 436c73c39b
deps: remove ioutil package (#583)
ioutil has been deprecated since Go 1.16:
https://pkg.go.dev/io/ioutil

Signed-off-by: ginglis13 <ginglis05@gmail.com>
2023-10-13 23:52:59 +02:00
dependabot[bot] 1c49575939
Bump golang.org/x/net from 0.8.0 to 0.17.0 (#581)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.8.0 to 0.17.0.
- [Commits](https://github.com/golang/net/compare/v0.8.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-12 11:59:57 +02:00
Stefan Benten 891ef14cfb
server/server.go: use TLS config provided by acme/autocert (#567)
Suggestion based on go docs of acme autocert.
2023-06-20 20:07:19 +02:00
Andrea Spacca 45e2654036
fix basic auth (#564)
* fix basic auth

* better logic
2023-06-06 19:59:21 +09:00
Michael Manganiello fc844ac341
Upgrade aws-sdk-go to v2 (#559)
* Upgrade aws-sdk-go to v2

`aws-sdk-go-v2` is the newer SDK version, replacing the one being used
at the moment by the project.

This change maintains full compatibility with existing flags and
configurations, and only replaces the underlying library.

* Simplify and isolate AWS config logic
2023-05-24 18:37:06 +09:00
Michael Manganiello a653181ea8
Improve Docker layer caching for Go dependencies (#560)
Running `go mod download` before copying the entire project to the
Docker image avoids dependencies from being re-downloaded every time any
file is modified, and `docker build` runs again.

This follows the steps detailed in the official Docker guide for Go
images:
https://docs.docker.com/language/golang/build-images/#create-a-dockerfile-for-the-application

Also, `GO111MODULE` doesn't make any difference for the supported
Go versions, so it can be removed from the Dockerfile.
2023-05-23 11:54:02 +09:00
Natalí Paura bafbf0c1a0
Improve purgeTime display in web page (#558)
- changing the line `purgeTime = s.purgeDays.String()` to use a function that formats the days like this: "N days" or "1 day"
- adding the function `formatDurationDays` in utils.go file

Fixes #557

Co-authored-by: Andrea Spacca <andrea.spacca@gmail.com>
2023-05-19 19:01:54 +09:00
Michael Manganiello df0d04f0da
Upgrade github.com/urfave/cli to v2 (#551)
`urfave/cli` v2 was released in 2019, and it doesn't introduce relevant
user-facing breaking changes.

Migration guide from v1 can be found at: https://cli.urfave.org/migrate-v1-to-v2/

The only user-facing change is within the "Flags before args" section,
but I haven't found that to affect `transfer.sh` as arguments are not
used.

Co-authored-by: Stefan Benten <mail@stefan-benten.de>
Co-authored-by: Andrea Spacca <andrea.spacca@gmail.com>
2023-05-19 14:51:40 +09:00
Junoh Moon 2a11ca13a3
Add mime.types to docker container to select charset properly (#547)
* Add charset to content type in getHandler

Add charset to content type in the getHandler function to fix CJK-letter related issues.
If the content type is empty after trimming, set it to "text/plain; charset=utf-8".

* Add mailcap and mime.types to transfer.sh container

This commit includes /etc/mime.types file to the container, which is necessary to properly select the charset using MIME typing during file upload.

For more information, read https://github.com/dutchcoders/transfer.sh/pull/545#issuecomment-1528712181

---------

Co-authored-by: Andrea Spacca <andrea.spacca@gmail.com>
2023-05-19 13:09:37 +09:00
dependabot[bot] 1e6346c3d1
Bump github.com/cloudflare/circl from 1.1.0 to 1.3.3 (#552)
Bumps [github.com/cloudflare/circl](https://github.com/cloudflare/circl) from 1.1.0 to 1.3.3.
- [Release notes](https://github.com/cloudflare/circl/releases)
- [Commits](https://github.com/cloudflare/circl/compare/v1.1.0...v1.3.3)

---
updated-dependencies:
- dependency-name: github.com/cloudflare/circl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-19 11:57:12 +09:00
Michael Manganiello eecf529138
Dockerfile: Use Go 1.20 by default (#550)
Use Go 1.20 by default in Dockerfile

Updating the default Go version used in the Dockerfile, to the latest
one supported by the project at the moment.

Also, Go `1.17` support was removed in
9f1fe62e05
2023-05-11 18:23:58 +02:00
Junoh Moon e837849d44
Add charset to content type in getHandler (#545)
Add charset to content type in the getHandler function to fix CJK-letter related issues.
If the content type is empty after trimming, set it to "text/plain; charset=utf-8".
2023-04-29 20:07:52 +09:00
Andrea Spacca a5dacb36a9
call WriteHeader after last change to header map (#542)
* call WriteHeader after last change to header map

* fix reader/decryptionReader
2023-04-05 23:30:58 +09:00
Kot 3dcbfe2e4d
Add `Vary` headers in responses (#536)
* Add `Vary` headers in responses

* Add `Referer` to file handler `Vary`

* Fix Vary value for routes
2023-03-16 10:25:46 +09:00
Andrea Spacca 1fb67f49ff
add IP_FILTERLIST_BYPASS_HTTP_AUTH (#538)
* add IP_FILTERLIST_BYPASS_HTTP_AUTH

* refactor to separated ip whitelist
2023-03-12 13:34:41 +09:00
Andrea Spacca 54cacb5487
add http-auth-htpasswd (#537)
* add http-auth-htpasswd

* go mod tidy
2023-03-12 11:52:45 +09:00
Andrea Spacca 3b777e1c19
gpg encryption support (#162)
* gpg encryption support

* gpg encryption support

* refinement

* refactor using protonmail opengpg

* warning

* remove exception in linting

* reduce I/O on decrypt

* fix typo

* streaming in encrypt

* Update README.md

do not reference server public hosting version in encrypt/decrypt headers example

* linting

* linting fix

* increase default random-token-length to 10
2023-03-11 10:08:55 +09:00
Andrea Spacca 28fc9c73f5
Lint accept range (#535)
* Support Range header for GET

* Adds 'Accept-Ranges: bytes' header to handlers

* proper param name in error

* bump gdrive dependecies

* refactor CloseCheck to avoid panic on nil, remove range/audio/video special handling on get handler

* refactor CloseCheck to avoid panic on nil, handle range with no limit

* refactor CloseCheck to avoid panic on nil, handle range in gdrive storage

* refactor CloseCheck to avoid panic on nil

* handle range with no limit

* lint

* bump deps

* go mod tidy

* gofmt

* cr fixes, replace deprecated ioutil.NopCloser

* linting

* do not write to file by default

* fix storj

---------

Co-authored-by: Vladislav Grubov <vladgrubov@gmail.com>
2023-03-11 01:41:43 +09:00
dependabot[bot] c452bd4719
Bump golang.org/x/net from 0.0.0-20220513224357-95641704303c to 0.7.0 (#534)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20220513224357-95641704303c to 0.7.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/commits/v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-01 16:39:47 +01:00
dependabot[bot] a4475513bc
Bump golang.org/x/crypto from 0.0.0-20220131195533-30dcbda58838 to 0.1.0 (#533)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.0.0-20220131195533-30dcbda58838 to 0.1.0.
- [Release notes](https://github.com/golang/crypto/releases)
- [Commits](https://github.com/golang/crypto/commits/v0.1.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-01 16:07:10 +01:00
Andrea Spacca 9f1fe62e05
min go version 1.18, include tip for test (#532)
* min go version 1.18, include tip for test

* lint

* lint

* lint

* lint

* lint

* lint

* lint

* lint

* lint

* lint

* lint

* lint

* lint
2023-03-01 21:51:24 +09:00
mpl 193f944829
server: do not ignore listening errors (#523) 2023-01-06 01:43:57 +01:00
Frankie ebc4097959
Fix for unrecognized flags on du (#488)
--total --block-size="K" --dereference were all unrecognized flags for this script. I have updated them to the correct flags to run correctly.

Co-authored-by: Stefan Benten <mail@stefan-benten.de>
2023-01-04 12:57:40 +01:00
Andrea Spacca ca798ff6f6
Update README.md
add `-v` on sample command, print both x-url-delete and upload link in x-url-delete example
2022-09-22 11:58:07 +02:00
am97 31520b1afd
Add /tmp dir to Docker image (#506)
fixes #462

Co-authored-by: Andrés Maldonado <maldonado@codelutin.com>
2022-08-31 08:07:29 +02:00
Andrea Spacca 3588502c50
bump transfer.sh-web dep (#504) 2022-08-24 11:01:54 +02:00
Farhan Khursheed 31ad4e01e1
Fixed improper implementation of content type (#501)
* Fixed improper implementation of content type

Add text/plain content type if metadata.ContentType is unable to determine the content type of the file

* Update server/handlers.go

Co-authored-by: Farhan Khursheed <41877347+blind-intruder@users.noreply.github.com>

* Update handlers.go

let's trim space

* Update handlers.go

Co-authored-by: Andrea Spacca <andrea.spacca@gmail.com>
2022-08-20 15:29:52 +02:00
Andrea Spacca 343427d3b9
Update README.md
fixes #483
2022-07-31 09:53:20 +02:00
Stefan Benten 64c7759126
all: update gdrive client and various linting cleanups (#497) 2022-07-14 18:02:18 +02:00
Stefan Benten 21812d3efc
server: reorganize storage layer into more clear subfolder (#496)
* server: reorganize storage layer into more clear subfolder

* cmd: fix version command
2022-07-13 06:26:42 +02:00
Andrea Spacca 35e794220b
Issue 485: fix IDN unicode/punycode handling (#486) 2022-05-15 16:48:13 +02:00
Ramon Fischer f06aef1c3e
Example Zsh/Bash function for transfer.sh homepage (#478)
* correct typo

* adapt title

* update function, correct typo, adapt sample output

* adapt subheading

* improve readability, reuse variables, save delete token as separate variable

* improve readability

* put function into expandable detail section

Co-authored-by: Stefan Benten <mail@stefan-benten.de>
2022-04-20 15:40:49 +02:00
Stefan Benten eeff2c88be
.github/,go.mod,go.sum: Update storj dependencies, drop older go versions (#468)
* go.mod,go.sum: Update storj dependencies

* bump go version

* another bump to latest storj release

* set minimum go version in go.mod

Co-authored-by: Andrea Spacca <andrea.spacca@gmail.com>
2022-04-20 01:50:44 +02:00
Stefan Benten 92324798d5
server: adding no-store header (#476)
In order to prevent viewing content, which max-download rate has been reached,
we need to ensure the data is not stored locally in a browser cache.
To achieve this, we set the Cache-Control Setting to "no-store" according to:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control

fixes #470
2022-04-10 12:13:06 +02:00
Ramon Fischer b30b296ac8
correct typo (#480) 2022-04-06 01:33:40 +02:00
jeanluc bb0891cd7d
Docker: Allow selection of (unprivileged) UID/GID at build time (#418)
* Docker: use custom non-root UID/GID (build-arg)
2022-04-03 14:55:15 +02:00
Andrea Spacca 9c31ceb2c5
Update README.md 2022-04-03 06:17:51 +02:00
Anirudh Haritas Murali 597554a59e
Add X-Url-Delete-* headers to POST handler (#435)
* Add X-Url-Delete-* headers to POST handler

* Remove token from header

* Fix writing of headers

* Handle error returned by Write

* Update handlers.go

Co-authored-by: Andrea Spacca <andrea.spacca@gmail.com>
2022-03-02 13:26:00 +01:00
Stefan Benten 368431fb6b
server/storage.go: Update storj dependencies and set user-agent (#467) 2022-02-09 12:37:11 +01:00
Andrea Spacca e3bb49993c
fix perform-clamav-prescan (#460) 2022-01-10 11:01:26 +01:00