diff --git a/setup.sh b/setup.sh index 2713de515cf99b405d22b9132d87ce9cd4bb5464..ce8e1ca652281abac8237e96a09d70fb9dd87031 100755 --- a/setup.sh +++ b/setup.sh @@ -1,7 +1,10 @@ #!/bin/bash +## Install Funkwhale using Docker (the multi-container installation) +## Documentation: https://docs.funkwhale.audio/installation/docker.html#docker-multi-container + set -e -funkwhale_version_default=1.2.2 +funkwhale_version_default=1.2.3 funkwhale_version="${FUNKWHALE_VERSION-$funkwhale_version_default}" funkwhale_hostname="" @@ -11,7 +14,7 @@ funkwhale_userpasswd="" funkwhale_useremail="" # Show an error message and exit. -# Params: +# Parameters: # 1. message function die() { @@ -20,7 +23,7 @@ function die() } # Get the value out of a "key=value" argument. -# Params: +# Parameters: # 1. the option (in the format "key=value") function get_not_empty_arg() { @@ -34,7 +37,7 @@ function get_not_empty_arg() } # Show the help text. -# No param. +# No parameter. function show_help() { local bin_name @@ -74,7 +77,7 @@ HELP } # Run an interactive shell to prompt for a value. -# Params: +# Parameters: # 1. the prompt text # 2. the variable name function prompt_value() @@ -91,7 +94,7 @@ function prompt_value() } # Run an interactive shell to prompt for a password. -# Params: +# Parameters: # 1. the prompt text # 2. the variable name function prompt_password() @@ -235,25 +238,25 @@ fi echo -n "Fetching the template files... " raw_src="https://dev.funkwhale.audio/funkwhale/funkwhale/raw/${funkwhale_version}/deploy" mkdir -p "templates/nginx" -pushd "templates" > /dev/null -curl -sLo "nginx/funkwhale.template" "${raw_src}/docker.nginx.template" -curl -sLo "nginx/funkwhale_proxy.conf" "${raw_src}/docker.funkwhale_proxy.conf" -curl -sLo "docker-compose.yml" "${raw_src}/docker-compose.yml" -curl -sLo "env.prod.sample" "${raw_src}/env.prod.sample" -popd > /dev/null +curl -sLo "templates/nginx/funkwhale.template" "${raw_src}/docker.nginx.template" +curl -sLo "templates/nginx/funkwhale_proxy.conf" "${raw_src}/docker.funkwhale_proxy.conf" +curl -sLo "templates/docker-compose.yml" "${raw_src}/docker-compose.yml" +curl -sLo "templates/env.prod.sample" "${raw_src}/env.prod.sample" echo "done" # Copy the template files to the "funkwhale" directory echo echo "Copy files to the \"funkwhale\" directory" mkdir -p "funkwhale/nginx" +cp "templates/nginx/funkwhale.template" "funkwhale/nginx/" +cp "templates/nginx/funkwhale_proxy.conf" "funkwhale/nginx/" +cp "templates/docker-compose.yml" "funkwhale/" +cp "templates/env.prod.sample" "funkwhale/.env" + +# Enter working directory cd "funkwhale" -cp "../templates/nginx/funkwhale.template" "nginx/" -cp "../templates/nginx/funkwhale_proxy.conf" "nginx/" -cp "../templates/docker-compose.yml" "./" -cp "../templates/env.prod.sample" ".env" -# reduce permissions on the .env file since it contains sensitive data +# Reduce permissions on the .env file since it contains sensitive data chmod 600 ".env" # Set up the Funkwhale instance files