Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- read -rp "registry: " registry
- read -rp "tg bot token: " bot_token
- read -rp "jwt key [generated]: " jwt_key
- jwt_key=${jwt_key:-$(openssl rand -hex 32)}
- read -rp "admin chat id: " admin_chat_id
- read -rp "service chat id: " service_chat_id
- read -rp "cloudpayments public key: " pay_public
- read -rp "cloudpayments secret key: " pay_api_key
- read -rp "domain: " domain
- read -rp "nginx port [80]: " nginx_port
- nginx_port=${nginx_port:-80}
- read -rp "backend port [5000]: " backend_port
- backend_port=${backend_port:-5000}
- read -rp "frontend port [3000]: " frontend_port
- frontend_port=${frontend_port:-3000}
- read -rp "default time zone: " timezone
- read -rp "db user [user]: " postgres_user
- postgres_user=${postgres_user:-user}
- read -rp "db password [generated]: " postgres_password
- postgres_password=${postgres_password:-$(openssl rand -hex 16)}
- read -rp "db name [postgres]: " postgres_db
- postgres_db=${postgres_db:-postgres}
- read -rp "db port [5432]: " postgres_port
- postgres_port=${postgres_port:-5432}
- env_file=".env"
- if [ -f "$env_file" ]; then
- env_file="generated.env"
- fi
- cat << EOF > $env_file
- REGISTRY=$registry
- BOT_TOKEN=$bot_token
- JWT_KEY=$jwt_key
- ADMIN_CHAT_ID=$admin_chat_id
- SERVICE_CHAT_ID=$service_chat_id
- PAY_PUBLIC=$pay_public
- PAY_API_KEY=$pay_api_key
- DOMAIN=$domain
- NGINX_PORT=$nginx_port
- BACKEND_PORT=$backend_port
- FRONTEND_PORT=$frontend_port
- TIMEZONE=$timezone
- POSTGRES_USER=$postgres_user
- POSTGRES_PASSWORD=$postgres_password
- POSTGRES_DB=$postgres_db
- POSTGRES_PORT=$postgres_port
- EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement