Created
May 18, 2024 11:27
-
-
Save suenot/0fe01bea6afa20a8d7776cc833496d2d 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 tmux 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 | |
# default: | |
# export DEEP_POSTGRES_PORT="5432" | |
# export DEEP_HASURA_PORT="8080" | |
# export DEEP_MINIO_PORT="9000" | |
# export DEEP_MINIO_CONSOLE_PORT="32765" | |
# export DEEP_HASURA_STORAGE_PORT="8000" | |
# прененазначил порты для 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]:42001/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", | |
"DEEP_POSTGRES_PORT": "$DEEP_POSTGRES_PORT", | |
"DEEP_HASURA_PORT": "$DEEP_HASURA_PORT", | |
"DEEP_MINIO_PORT": "$DEEP_MINIO_PORT", | |
"DEEP_MINIO_CONSOLE_PORT": "$DEEP_MINIO_CONSOLE_PORT", | |
"DEEP_HASURA_STORAGE_PORT": "$DEEP_HASURA_STORAGE_PORT" | |
} | |
} | |
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