Skip to content

Commit

Permalink
cli: Change default port to 8080
Browse files Browse the repository at this point in the history
It is a more common HTTP port and is not confused with the SOCKS protocol, which commonly uses 1080.

Closes #503
  • Loading branch information
Acconut committed Sep 21, 2023
1 parent f4e4774 commit 285b2f5
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ RUN apk add --no-cache ca-certificates jq bash \

COPY --from=builder /go/bin/tusd /usr/local/bin/tusd

EXPOSE 1080
EXPOSE 8080
USER tusd

ENTRYPOINT ["/usr/local/share/docker-entrypoint.sh"]
Expand Down
2 changes: 1 addition & 1 deletion cmd/tusd/cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func ParseFlags() {

fs.AddGroup("Listening options", func(f *flag.FlagSet) {
f.StringVar(&Flags.HttpHost, "host", "0.0.0.0", "Host to bind HTTP server to")
f.StringVar(&Flags.HttpPort, "port", "1080", "Port to bind HTTP server to")
f.StringVar(&Flags.HttpPort, "port", "8080", "Port to bind HTTP server to")
f.StringVar(&Flags.HttpSock, "unix-sock", "", "If set, will listen to a UNIX socket at this location instead of a TCP socket")
f.StringVar(&Flags.Basepath, "base-path", "/files/", "Basepath of the HTTP server")
f.BoolVar(&Flags.BehindProxy, "behind-proxy", false, "Respect X-Forwarded-* and similar headers which may be set by proxies")
Expand Down
6 changes: 3 additions & 3 deletions docs/hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Below you can find an annotated, JSON-ish encoded example of a hook request:
// headers can be included multiple times, e.g. Cookies.
"Header": {
"Host": [
"localhost:1080"
"localhost:8080"
],
"Tus-Resumable": [
"1.0.0"
Expand Down Expand Up @@ -246,9 +246,9 @@ $ tusd --hooks-http http://localhost:8081/write --hooks-http-retry 5 --hooks-htt
gRPC Hooks are the third type of hooks supported by tusd. It is disabled by default. To enable it, pass the `--hooks-grpc` option to the tusd binary. The flag's value will be a gRPC endpoint, whose service will be used:

```bash
$ tusd --hooks-grpc localhost:8080
$ tusd --hooks-grpc localhost:8081

[tusd] Using 'localhost:8080' as the endpoint for gRPC hooks
[tusd] Using 'localhost:8081' as the endpoint for gRPC hooks
[tusd] Using './data' as directory storage.
...
```
Expand Down
24 changes: 12 additions & 12 deletions docs/usage-binary.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

Starting the tusd upload server is as simple as invoking a single command. For example, following
snippet demonstrates how to start a tusd process which accepts tus uploads at
`http://localhost:1080/files/` (notice the trailing slash) and stores them locally in the `./data` directory:
`http://localhost:8080/files/` (notice the trailing slash) and stores them locally in the `./data` directory:

```
$ tusd -upload-dir=./data
[tusd] 2019/09/29 21:10:50 Using './data' as directory storage.
[tusd] 2019/09/29 21:10:50 Using 0.00MB as maximum size.
[tusd] 2019/09/29 21:10:50 Using 0.0.0.0:1080 as address to listen.
[tusd] 2019/09/29 21:10:50 Using 0.0.0.0:8080 as address to listen.
[tusd] 2019/09/29 21:10:50 Using /files/ as the base path.
[tusd] 2019/09/29 21:10:50 Using /metrics as the metrics path.
[tusd] 2019/09/29 21:10:50 Supported tus extensions: creation,creation-with-upload,termination,concatenation,creation-defer-length
[tusd] 2019/09/29 21:10:50 You can now upload files to: http://0.0.0.0:1080/files/
[tusd] 2019/09/29 21:10:50 You can now upload files to: http://0.0.0.0:8080/files/
```

Alternatively, if you want to store the uploads on an AWS S3 bucket, you only have to specify
Expand All @@ -27,11 +27,11 @@ $ export AWS_REGION=eu-west-1
$ tusd -s3-bucket=my-test-bucket.com
[tusd] 2019/09/29 21:11:23 Using 's3://my-test-bucket.com' as S3 bucket for storage.
[tusd] 2019/09/29 21:11:23 Using 0.00MB as maximum size.
[tusd] 2019/09/29 21:11:23 Using 0.0.0.0:1080 as address to listen.
[tusd] 2019/09/29 21:11:23 Using 0.0.0.0:8080 as address to listen.
[tusd] 2019/09/29 21:11:23 Using /files/ as the base path.
[tusd] 2019/09/29 21:11:23 Using /metrics as the metrics path.
[tusd] 2019/09/29 21:11:23 Supported tus extensions: creation,creation-with-upload,termination,concatenation,creation-defer-length
[tusd] 2019/09/29 21:11:23 You can now upload files to: http://0.0.0.0:1080/files/
[tusd] 2019/09/29 21:11:23 You can now upload files to: http://0.0.0.0:8080/files/
```

If your S3 bucket has been configured for AWS S3 Transfer Acceleration and you want to make use of that advanced service,
Expand All @@ -45,11 +45,11 @@ $ export AWS_REGION=eu-west-1
$ tusd -s3-bucket=my-test-bucket.com -s3-transfer-acceleration
[tusd] 2019/09/29 21:11:23 Using 's3://my-test-bucket.com' as S3 bucket for storage with AWS S3 Transfer Acceleration enabled.
[tusd] 2019/09/29 21:11:23 Using 0.00MB as maximum size.
[tusd] 2019/09/29 21:11:23 Using 0.0.0.0:1080 as address to listen.
[tusd] 2019/09/29 21:11:23 Using 0.0.0.0:8080 as address to listen.
[tusd] 2019/09/29 21:11:23 Using /files/ as the base path.
[tusd] 2019/09/29 21:11:23 Using /metrics as the metrics path.
[tusd] 2019/09/29 21:11:23 Supported tus extensions: creation,creation-with-upload,termination,concatenation,creation-defer-length
[tusd] 2019/09/29 21:11:23 You can now upload files to: http://0.0.0.0:1080/files/
[tusd] 2019/09/29 21:11:23 You can now upload files to: http://0.0.0.0:8080/files/
```

tusd is also able to read the credentials automatically from a shared credentials file (~/.aws/credentials) as described in https://github.com/aws/aws-sdk-go#configuring-credentials.
Expand All @@ -62,7 +62,7 @@ $ export GCS_SERVICE_ACCOUNT_FILE=./account.json
$ tusd -gcs-bucket=my-test-bucket.com
[tusd] Using 'gcs://my-test-bucket.com' as GCS bucket for storage.
[tusd] Using 0.00MB as maximum size.
[tusd] Using 0.0.0.0:1080 as address to listen.
[tusd] Using 0.0.0.0:8080 as address to listen.
[tusd] Using /files/ as the base path.
[tusd] Using /metrics as the metrics path.
```
Expand All @@ -77,7 +77,7 @@ $ tusd -azure-storage my-test-container
[tusd] 2023/02/13 16:13:20.937373 Custom Azure Endpoint not specified in flag variable azure-endpoint.
Using endpoint https://xxxxx.blob.core.windows.net
[tusd] Using 0.00MB as maximum size.
[tusd] Using 0.0.0.0:1080 as address to listen.
[tusd] Using 0.0.0.0:8080 as address to listen.
[tusd] Using /files/ as the base path.
[tusd] Using /metrics as the metrics path.
```
Expand All @@ -91,7 +91,7 @@ $ export AZURE_STORAGE_KEY=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UV
$ tusd -azure-storage my-test-container -azure-endpoint https://my-custom-endpoint.com
[tusd] 2023/02/13 16:15:18.641937 Using Azure endpoint http://127.0.0.1:10000/devstoreaccount1
[tusd] Using 0.00MB as maximum size.
[tusd] Using 0.0.0.0:1080 as address to listen.
[tusd] Using 0.0.0.0:8080 as address to listen.
[tusd] Using /files/ as the base path.
[tusd] Using /metrics as the metrics path.
```
Expand All @@ -106,7 +106,7 @@ $ tusd -azure-storage my-test-container -azure-blob-access-tier cool
[tusd] 2023/02/13 16:13:20.937373 Custom Azure Endpoint not specified in flag variable azure-endpoint.
Using endpoint https://xxxxx.blob.core.windows.net
[tusd] Using 0.00MB as maximum size.
[tusd] Using 0.0.0.0:1080 as address to listen.
[tusd] Using 0.0.0.0:8080 as address to listen.
[tusd] Using /files/ as the base path.
[tusd] Using /metrics as the metrics path.
```
Expand Down Expand Up @@ -186,7 +186,7 @@ $ tusd -help
-metrics-path string
Path under which the metrics endpoint will be accessible (default "/metrics")
-port string
Port to bind HTTP server to (default "1080")
Port to bind HTTP server to (default "8080")
-s3-bucket string
Use AWS S3 with this bucket as storage backend (requires the AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_REGION environment variables to be set)
-s3-disable-content-hashes
Expand Down
4 changes: 2 additions & 2 deletions examples/apache2.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
ProxyPreserveHost on

# Pass requests to tusd server
ProxyPass /files http://localhost:1080/files
ProxyPassReverse /files http://localhost:1080/files
ProxyPass /files http://localhost:8080/files
ProxyPassReverse /files http://localhost:8080/files
</VirtualHost>

# This SSL configuration has been taken from Mozilla SSL Generator:
Expand Down

0 comments on commit 285b2f5

Please sign in to comment.