Created
May 17, 2024 14:21
-
-
Save suenot/62f37136b8592118f192d9e38612027a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo ufw allow 3006 | |
sudo ufw allow 3007 | |
sudo apt update | |
sudo apt install -y git curl docker.io docker-compose | |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash | |
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" | |
nvm install 18 && nvm alias default 18 && nvm use default | |
npm i -g npm@latest | |
# прененазначил порты для hasura | |
export DEEP_POSTGRES_PORT="42001" | |
export DEEP_HASURA_PORT="42002" | |
export DEEP_MINIO_PORT="42003" | |
export DEEP_MINIO_CONSOLE_PORT="42004" | |
export DEEP_HASURA_STORAGE_PORT="42005" | |
export GQL_SSL="0" | |
export PROTOCOL="http" | |
export HOST_IP="194.163.155.95" | |
export DEEPCASE_HOST="$HOST_IP:3007" | |
export DEEPLINKS_HOST="$HOST_IP:3006" | |
npm rm --unsafe-perm -g @deep-foundation/deeplinks | |
npm install --unsafe-perm -g @deep-foundation/deeplinks@latest | |
export HASURA_ADMIN_SECRET=$(node -e "console.log(require('crypto').randomBytes(24).toString('hex'));") | |
export POSTGRES_PASSWORD=$(node -e "console.log(require('crypto').randomBytes(24).toString('hex'));") | |
export MINIO_ACCESS_KEY=$(node -e "console.log(require('crypto').randomBytes(24).toString('hex'));") | |
export MINIO_SECRET_KEY=$(node -e "console.log(require('crypto').randomBytes(24).toString('hex'));") | |
tee call-options.json << JSON | |
{ | |
"operation": "run", | |
"envs": { | |
"DEEPLINKS_PUBLIC_URL": "${PROTOCOL}://$DEEPLINKS_HOST", | |
"NEXT_PUBLIC_DEEPLINKS_URL": "${PROTOCOL}://$DEEPLINKS_HOST", | |
"NEXT_PUBLIC_GQL_PATH": "$DEEPLINKS_HOST/gql", | |
"NEXT_PUBLIC_GQL_SSL": "${GQL_SSL}", | |
"NEXT_PUBLIC_DEEPLINKS_SERVER": "${PROTOCOL}://$DEEPCASE_HOST", | |
"NEXT_PUBLIC_ENGINES_ROUTE": "0", | |
"NEXT_PUBLIC_DISABLE_CONNECTOR": "1", | |
"JWT_SECRET": "'{\"type\":\"HS256\",\"key\":\"$(node -e "console.log(require('crypto').randomBytes(50).toString('base64'));")\"}'", | |
"DEEPLINKS_HASURA_STORAGE_URL": "http://host.docker.internal:8000/", | |
"HASURA_GRAPHQL_ADMIN_SECRET": "$HASURA_ADMIN_SECRET", | |
"MIGRATIONS_HASURA_SECRET": "$HASURA_ADMIN_SECRET", | |
"DEEPLINKS_HASURA_SECRET": "$HASURA_ADMIN_SECRET", | |
"POSTGRES_PASSWORD": "$POSTGRES_PASSWORD", | |
"HASURA_GRAPHQL_DATABASE_URL": "postgres://postgres:$POSTGRES_PASSWORD@postgres:5432/postgres", | |
"POSTGRES_MIGRATIONS_SOURCE": "postgres://postgres:[email protected]:5432/postgres?sslmode=disable", | |
"RESTORE_VOLUME_FROM_SNAPSHOT": "0", | |
"MANUAL_MIGRATIONS": "1", | |
"MINIO_ROOT_USER": "$MINIO_ACCESS_KEY", | |
"MINIO_ROOT_PASSWORD": "$MINIO_SECRET_KEY", | |
"S3_ACCESS_KEY": "$MINIO_ACCESS_KEY", | |
"S3_SECRET_KEY": "$MINIO_SECRET_KEY" | |
} | |
} | |
JSON | |
export DEEPLINKS_CALL_OPTIONS=$(cat call-options.json) | |
export DEBUG="deeplinks:engine:*,deeplinks:migrations:*" | |
deeplinks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment