From 562a8983ca19105dad0c38f7217a512486a9d5aa Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Tue, 18 May 2021 20:42:02 -0400 Subject: [PATCH 1/6] update example environment variable config for upload limits --- docker-compose.yaml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 01934da..663ebd0 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -15,6 +15,7 @@ services: - proxy-certs:/etc/nginx/certs:ro - proxy-vhost:/etc/nginx/vhost.d - proxy-html:/usr/share/nginx/html + proxy-letsencrypt: image: 'jrcs/letsencrypt-nginx-proxy-companion' restart: always @@ -27,6 +28,7 @@ services: - proxy-certs:/etc/nginx/certs - proxy-vhost:/etc/nginx/vhost.d - proxy-html:/usr/share/nginx/html + send: image: '${DOCKER_SEND_IMAGE}' restart: always @@ -56,14 +58,16 @@ services: # - S3_USE_PATH_STYLE_ENDPOINT=true # To customize upload limits - # - ANON_MAX_EXPIRE_SECONDS=604800 - # - MAX_EXPIRE_SECONDS=604800 - # - ANON_MAX_DOWNLOADS=20 - # - MAX_DOWNLOADS=20 - # - ANON_MAX_FILE_SIZE=2684354560 + # - EXPIRE_TIMES_SECONDS=3600,86400,604800,2592000,31536000 + # - DEFAULT_EXPIRE_SECONDS=3600 + # - MAX_EXPIRE_SECONDS=31536000 + # - DOWNLOAD_COUNTS=1,2,5,10,15,25,50,100,1000 + # - MAX_DOWNLOADS=1000 # - MAX_FILE_SIZE=2684354560 + redis: image: 'redis:alpine' + command: redis-server --appendonly yes restart: always volumes: - send-redis:/data From 7056cc8b68d040edfc6f970cd4e5f25d3cb5d3b6 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Tue, 18 May 2021 21:02:05 -0400 Subject: [PATCH 2/6] add configuration section to README explaining common gotchas --- README.md | 48 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c5093f2..efcb42b 100644 --- a/README.md +++ b/README.md @@ -16,13 +16,15 @@ This is configurable in your [`.env`](.env.example) file. See [docker-compose.yaml](./docker-compose.yaml). ### Usage -- Install Docker with Docker compose -- Clone repository -- Run `cp .env.example .env` and configure it (see [example](#example-env)) -- Run `docker-compose up` -- Visit your domain + +1. Install Docker with Docker Compose https://get.docker.com/ +2. Clone this repository `git clone https://github.com/timvisee/send-docker-compose` +3. Run `cp .env.example .env` and configure it (see [example](#example-env)) +4. Run `docker-compose up` +5. Visit your domain ### Example .env + ```bash # Docker image to use for Send # - Latest Send version by @timvisee: registry.gitlab.com/timvisee/send:latest @@ -41,3 +43,39 @@ LETSENCRYPT_HOST= # Optional: for LetsEncrypt SSL, your email address LETSENCRYPT_EMAIL=mail@example.org ``` + +### Configuration + +All the config options and their defaults can be found here: https://github.com/timvisee/send/blob/master/server/config.js. + +Config options expecting array values (e.g. `EXPIRE_TIMES_SECONDS`, `DOWNLOAD_COUNTS`) are parsed as CSV, and the first entry is the default. + +Other options should be set as unquoted strings, integers, booleans, etc., for example: +```yaml +... +services: + ... + send: + ... + environment: + ... + + # strings numbers, bools, etc. shoul all be set as bare unquoted values + - BASE_URL=https://send.example.com + - DHPARAM_GENERATION=false + - MAX_DOWNLOADS=250000 + + # use values set in the .env using ${VARNAME} bash syntax + - VIRTUAL_HOST=${HOST} + + # time values are all in seconds, e.g. 365d * 60*60*24 = 31,536,000 seconds + - MAX_EXPIRE_SECONDS=31536000 + - DEFAULT_EXPIRE_SECONDS=86400 + + # array configs are set as CSV (first entry is the default for the UI dropdown) + - EXPIRE_TIMES_SECONDS=86400,3600,86400,604800,2592000,31536000,157680000 + - DOWNLOAD_COUNTS=10,1,2,5,10,15,25,50,100,1000,10000,100000,250000 + + # size values are are in bytes, e.g. 10GB * 1024*1024*1024 = 10,747,904,000 bytes + - MAX_FILE_SIZE=10747904000 +``` From 3b78c4d7e36701c89caaedf16108c269b5e8016a Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Tue, 18 May 2021 21:07:23 -0400 Subject: [PATCH 3/6] fix url with dangling period --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index efcb42b..0bd0fc4 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ LETSENCRYPT_EMAIL=mail@example.org ### Configuration -All the config options and their defaults can be found here: https://github.com/timvisee/send/blob/master/server/config.js. +All the config options and their defaults can be found here: https://github.com/timvisee/send/blob/master/server/config.js Config options expecting array values (e.g. `EXPIRE_TIMES_SECONDS`, `DOWNLOAD_COUNTS`) are parsed as CSV, and the first entry is the default. From 54749f65285afd9f3026eaba66d97d7795b9b0c6 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Tue, 18 May 2021 22:37:16 -0400 Subject: [PATCH 4/6] fix example.org domains to example.com, fix typos, improve setup steps --- README.md | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 0bd0fc4..2c23be9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Send in Docker compose + This repository provides a basic Docker compose configuration to host a public [Send](https://gitlab.com/timvisee/send) instance on your own domain. @@ -15,15 +16,19 @@ This is configurable in your [`.env`](.env.example) file. See [docker-compose.yaml](./docker-compose.yaml). -### Usage +*Note: for plain Docker usage without Compose, see: https://github.com/timvisee/send/blob/master/docs/docker.md* -1. Install Docker with Docker Compose https://get.docker.com/ -2. Clone this repository `git clone https://github.com/timvisee/send-docker-compose` -3. Run `cp .env.example .env` and configure it (see [example](#example-env)) -4. Run `docker-compose up` -5. Visit your domain +## Usage -### Example .env +1. Install Docker and Docker Compose on your system: https://get.docker.com/ +2. Clone this repository `git clone https://github.com/timvisee/send-docker-compose && cd send-docker-compose` +3. Run `cp .env.example .env` and edit `.env` and `docker-compose.yaml` to setup your configuration (see [example](#example-env)) +4. Run `docker-compose up` to start the containers (add `-d` to start it in the background) +5. Wait 30sec for it to start, then visit your domain verify the UI is up and running, e.g. `https://send.example.com` + +Screenshot of succesfully running Send UI + +## Example .env ```bash # Docker image to use for Send @@ -32,23 +37,25 @@ See [docker-compose.yaml](./docker-compose.yaml). DOCKER_SEND_IMAGE=registry.gitlab.com/timvisee/send:latest # Host to expose Send on -HOST=send.example.org +HOST=send.example.com # Base URL for Send -SEND_BASE_URL=https://send.example.org +SEND_BASE_URL=https://send.example.com # Optional: for LetsEncrypt SSL, same as HOST -LETSENCRYPT_HOST= +LETSENCRYPT_HOST=send.example.com # Optional: for LetsEncrypt SSL, your email address -LETSENCRYPT_EMAIL=mail@example.org +LETSENCRYPT_EMAIL=ssl@send.example.com ``` -### Configuration +## Configuration All the config options and their defaults can be found here: https://github.com/timvisee/send/blob/master/server/config.js -Config options expecting array values (e.g. `EXPIRE_TIMES_SECONDS`, `DOWNLOAD_COUNTS`) are parsed as CSV, and the first entry is the default. +For more documentation about the config options available and their defaults, see: https://github.com/timvisee/send/blob/master/docs/docker.md + +Config options expecting array values (e.g. `EXPIRE_TIMES_SECONDS`, `DOWNLOAD_COUNTS`) should be set as bare comma separated values, and the first entry is used as the default. Other options should be set as unquoted strings, integers, booleans, etc., for example: ```yaml @@ -60,7 +67,7 @@ services: environment: ... - # strings numbers, bools, etc. shoul all be set as bare unquoted values + # strings numbers, bools, etc. should all be set as bare unquoted values - BASE_URL=https://send.example.com - DHPARAM_GENERATION=false - MAX_DOWNLOADS=250000 @@ -72,10 +79,10 @@ services: - MAX_EXPIRE_SECONDS=31536000 - DEFAULT_EXPIRE_SECONDS=86400 + # size values are are in bytes, e.g. 10GB * 1024*1024*1024 = 10,747,904,000 bytes + - MAX_FILE_SIZE=10747904000 + # array configs are set as CSV (first entry is the default for the UI dropdown) - EXPIRE_TIMES_SECONDS=86400,3600,86400,604800,2592000,31536000,157680000 - DOWNLOAD_COUNTS=10,1,2,5,10,15,25,50,100,1000,10000,100000,250000 - - # size values are are in bytes, e.g. 10GB * 1024*1024*1024 = 10,747,904,000 bytes - - MAX_FILE_SIZE=10747904000 ``` From 58d5956d0b6c8d20784fcd92f5e0564295e70db9 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Tue, 18 May 2021 23:05:53 -0400 Subject: [PATCH 5/6] add line about autostarting on boot --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 2c23be9..82500e0 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,8 @@ See [docker-compose.yaml](./docker-compose.yaml). Screenshot of succesfully running Send UI +*Note: the server will autostart on boot (to disable, change all the `restart: always` lines to `restart: on-failure`)* + ## Example .env ```bash From 3c3e805b278381c3b482576e3f9f722a7c988dce Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Wed, 19 May 2021 04:44:05 -0400 Subject: [PATCH 6/6] remove appendonly mode --- docker-compose.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 663ebd0..d629c3b 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -67,7 +67,6 @@ services: redis: image: 'redis:alpine' - command: redis-server --appendonly yes restart: always volumes: - send-redis:/data