install/.defaults.sh
2019-06-25 23:03:46 +03:00

25 lines
963 B
Bash

# based on https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample
# variables used in default config template
RUN_MODE=${RUN_MODE:-"dev"}
RUN_USER=${RUN_USER:-"$USER"}
MAIN_DIR=${MAIN_DIR:-"$(cd "$(dirname "$0")" && pwd)"}
HTTP_PORT=${HTTP_PORT:-"3000"}
ROOT_URL=${ROOT_URL:-"http://127.0.0.1:3000"}
SSH_DOMAIN=${SSH_DOMAIN:-"127.0.0.1"}
SSH_PORT=${SSH_PORT:-"3022"}
DISABLE_SSH=${DISABLE_SSH:-"false"}
LFS_JWT_SECRET=${LFS_JWT_SECRET:-"$(head /dev/urandom | tr -dc 'A-Za-z0-9_' | head -c 32)"}
SECRET_KEY=${SECRET_KEY:-"$(head /dev/urandom | tr -dc 'A-Za-z0-9_' | head -c 32)"}
INTERNAL_TOKEN=${INTERNAL_TOKEN:-"$(head /dev/urandom | tr -dc 'A-Za-z0-9_' | head -c 64)"}
JWT_SECRET=${JWT_SECRET:-"$(head /dev/urandom | tr -dc 'A-Za-z0-9_' | head -c 32)"}
# global settings
[ -z "${A_DEFAULT_SETTINGS}" ] \
&& A_DEFAULT_SETTINGS=$(cat << EOF
APP_NAME = Gitea: Git with a cup of tea
RUN_MODE = {{%RUN_MODE%}}
RUN_USER = {{%RUN_USER%}}
EOF
)