diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 9b8a5cf42ab2..000000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,72 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ "master" ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ "master" ] - schedule: - - cron: '45 11 * * 5' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'javascript' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # â„šī¸ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml deleted file mode 100644 index dd6f455803f8..000000000000 --- a/.github/workflows/config.yml +++ /dev/null @@ -1,626 +0,0 @@ -name: Blockscout - -on: - push: - branches: - - master - pull_request: - branches: - - master - -env: - MIX_ENV: test - OTP_VERSION: '25.2.1' - ELIXIR_VERSION: '1.14.3' - ACCOUNT_AUTH0_DOMAIN: 'blockscoutcom.us.auth0.com' - -jobs: - build-and-cache: - name: Build and Cache deps - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: erlef/setup-beam@v1 - with: - otp-version: ${{ env.OTP_VERSION }} - elixir-version: ${{ env.ELIXIR_VERSION }} - - - name: "ELIXIR_VERSION.lock" - run: echo "${ELIXIR_VERSION}" > ELIXIR_VERSION.lock - - - name: "OTP_VERSION.lock" - run: echo "${OTP_VERSION}" > OTP_VERSION.lock - - - name: Restore Mix Deps Cache - uses: actions/cache@v2 - id: deps-cache - with: - path: | - deps - _build - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_18-${{ hashFiles('mix.lock') }} - restore-keys: | - ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps- - - - name: Conditionally build Mix deps cache - if: steps.deps-cache.outputs.cache-hit != 'true' - run: | - mix local.hex --force - mix local.rebar --force - mix deps.get - mix deps.compile - cd deps/libsecp256k1 - make - - - name: Restore Explorer NPM Cache - uses: actions/cache@v2 - id: explorer-npm-cache - with: - path: apps/explorer/node_modules - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-explorer-npm-${{ hashFiles('apps/explorer/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-explorer-npm- - - - name: Conditionally build Explorer NPM Cache - if: steps.explorer-npm-cache.outputs.cache-hit != 'true' - run: npm install - working-directory: apps/explorer - - - name: Restore Blockscout Web NPM Cache - uses: actions/cache@v2 - id: blockscoutweb-npm-cache - with: - path: apps/block_scout_web/assets/node_modules - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-blockscoutweb-npm-${{ hashFiles('apps/block_scout_web/assets/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-blockscoutweb-npm- - - - name: Conditionally build Blockscout Web NPM Cache - if: steps.blockscoutweb-npm-cache.outputs.cache-hit != 'true' - run: npm install - working-directory: apps/block_scout_web/assets - - credo: - name: Credo - runs-on: ubuntu-latest - needs: build-and-cache - steps: - - uses: actions/checkout@v2 - - uses: erlef/setup-beam@v1 - with: - otp-version: ${{ env.OTP_VERSION }} - elixir-version: ${{ env.ELIXIR_VERSION }} - - - name: Restore Mix Deps Cache - uses: actions/cache@v2 - id: deps-cache - with: - path: | - deps - _build - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_18-${{ hashFiles('mix.lock') }} - restore-keys: | - ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-" - - - run: mix credo - - check_formatted: - name: Code formatting checks - runs-on: ubuntu-latest - needs: build-and-cache - steps: - - uses: actions/checkout@v2 - - uses: erlef/setup-beam@v1 - with: - otp-version: ${{ env.OTP_VERSION }} - elixir-version: ${{ env.ELIXIR_VERSION }} - - - name: Restore Mix Deps Cache - uses: actions/cache@v2 - id: deps-cache - with: - path: | - deps - _build - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_18-${{ hashFiles('mix.lock') }} - restore-keys: | - ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-" - - - run: mix format --check-formatted - dialyzer: - name: Dialyzer static analysis - runs-on: ubuntu-latest - needs: build-and-cache - steps: - - uses: actions/checkout@v2 - - uses: erlef/setup-beam@v1 - with: - otp-version: ${{ env.OTP_VERSION }} - elixir-version: ${{ env.ELIXIR_VERSION }} - - - name: Restore Mix Deps Cache - uses: actions/cache@v2 - id: deps-cache - with: - path: | - deps - _build - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_18-${{ hashFiles('mix.lock') }} - restore-keys: | - ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-" - - - name: Restore Dialyzer Cache - uses: actions/cache@v2 - id: dialyzer-cache - with: - path: priv/plts - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-dialyzer-mixlockhash_18-${{ hashFiles('mix.lock') }} - restore-keys: | - ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-dialyzer-" - - - name: Conditionally build Dialyzer Cache - if: steps.dialyzer-cache.output.cache-hit != 'true' - run: | - mkdir -p priv/plts - mix dialyzer --plt - - - name: Run Dialyzer - run: mix dialyzer --halt-exit-status - - gettext: - name: Missing translation keys check - runs-on: ubuntu-latest - needs: build-and-cache - steps: - - uses: actions/checkout@v2 - - uses: erlef/setup-beam@v1 - with: - otp-version: ${{ env.OTP_VERSION }} - elixir-version: ${{ env.ELIXIR_VERSION }} - - - name: Restore Mix Deps Cache - uses: actions/cache@v2 - id: deps-cache - with: - path: | - deps - _build - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_18-${{ hashFiles('mix.lock') }} - restore-keys: | - ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-" - - - run: | - mix gettext.extract --merge | tee stdout.txt - ! grep "Wrote " stdout.txt - working-directory: "apps/block_scout_web" - sobelow: - name: Sobelow security analysis - runs-on: ubuntu-latest - needs: build-and-cache - steps: - - uses: actions/checkout@v2 - - uses: erlef/setup-beam@v1 - with: - otp-version: ${{ env.OTP_VERSION }} - elixir-version: ${{ env.ELIXIR_VERSION }} - - - name: Mix Deps Cache - uses: actions/cache@v2 - id: deps-cache - with: - path: | - deps - _build - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_18-${{ hashFiles('mix.lock') }} - restore-keys: | - ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-" - - - name: Scan explorer for vulnerabilities - run: mix sobelow --config - working-directory: "apps/explorer" - - name: Scan block_scout_web for vulnerabilities - run: mix sobelow --config - working-directory: "apps/block_scout_web" - - cspell: - name: Check spelling - runs-on: ubuntu-latest - needs: build-and-cache - steps: - - uses: actions/checkout@v2 - - uses: erlef/setup-beam@v1 - with: - otp-version: ${{ env.OTP_VERSION }} - elixir-version: ${{ env.ELIXIR_VERSION }} - - - name: Mix Deps Cache - uses: actions/cache@v2 - id: deps-cache - with: - path: | - deps - _build - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_18-${{ hashFiles('mix.lock') }} - restore-keys: | - ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-" - - - name: Restore Explorer NPM Cache - uses: actions/cache@v2 - id: explorer-npm-cache - with: - path: apps/explorer/node_modules - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-explorer-npm-${{ hashFiles('apps/explorer/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-explorer-npm- - - - name: Restore Blockscout Web NPM Cache - uses: actions/cache@v2 - id: blockscoutweb-npm-cache - with: - path: apps/block_scout_web/assets/node_modules - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-blockscoutweb-npm-${{ hashFiles('apps/block_scout_web/assets/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-blockscoutweb-npm- - - - name: Run cspell - uses: streetsidesoftware/cspell-action@v2 - with: - files: | - **/*.ex* - **/*.eex - **/*.js" - - eslint: - name: ESLint - runs-on: ubuntu-latest - needs: build-and-cache - steps: - - uses: actions/checkout@v2 - - uses: erlef/setup-beam@v1 - with: - otp-version: ${{ env.OTP_VERSION }} - elixir-version: ${{ env.ELIXIR_VERSION }} - - - name: Mix Deps Cache - uses: actions/cache@v2 - id: deps-cache - with: - path: | - deps - _build - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_18-${{ hashFiles('mix.lock') }} - restore-keys: | - ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-" - - - name: Restore Explorer NPM Cache - uses: actions/cache@v2 - id: explorer-npm-cache - with: - path: apps/explorer/node_modules - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-explorer-npm-${{ hashFiles('apps/explorer/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-explorer-npm- - - - name: Restore Blockscout Web NPM Cache - uses: actions/cache@v2 - id: blockscoutweb-npm-cache - with: - path: apps/block_scout_web/assets/node_modules - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-blockscoutweb-npm-${{ hashFiles('apps/block_scout_web/assets/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-blockscoutweb-npm- - - - name: Build assets - run: node node_modules/webpack/bin/webpack.js --mode development - working-directory: "apps/block_scout_web/assets" - - - run: ./node_modules/.bin/eslint --format=junit --output-file="test/eslint/junit.xml" js/** - working-directory: apps/block_scout_web/assets - jest: - name: JS Tests - runs-on: ubuntu-latest - needs: build-and-cache - steps: - - uses: actions/checkout@v2 - - uses: erlef/setup-beam@v1 - with: - otp-version: ${{ env.OTP_VERSION }} - elixir-version: ${{ env.ELIXIR_VERSION }} - - - name: Mix Deps Cache - uses: actions/cache@v2 - id: deps-cache - with: - path: | - deps - _build - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_18-${{ hashFiles('mix.lock') }} - restore-keys: | - ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-" - - - name: Restore Blockscout Web NPM Cache - uses: actions/cache@v2 - id: blockscoutweb-npm-cache - with: - path: apps/block_scout_web/assets/node_modules - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-blockscoutweb-npm-${{ hashFiles('apps/block_scout_web/assets/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-blockscoutweb-npm- - - - name: Build assets - run: node node_modules/webpack/bin/webpack.js --mode development - working-directory: "apps/block_scout_web/assets" - - - run: ./node_modules/.bin/jest - working-directory: apps/block_scout_web/assets - - test_nethermind_mox_ethereum_jsonrpc: - name: EthereumJSONRPC Tests - runs-on: ubuntu-latest - needs: build-and-cache - services: - postgres: - image: postgres - env: - # Match apps/explorer/config/test.exs config :explorer, Explorer.Repo, database - POSTGRES_DB: explorer_test - # match PGPASSWORD for elixir image above - POSTGRES_PASSWORD: postgres - # match PGUSER for elixir image above - POSTGRES_USER: postgres - # Set health checks to wait until postgres has started - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - # Maps tcp port 5432 on service container to the host - - 5432:5432 - steps: - - uses: actions/checkout@v2 - - uses: erlef/setup-beam@v1 - with: - otp-version: ${{ env.OTP_VERSION }} - elixir-version: ${{ env.ELIXIR_VERSION }} - - - name: Mix Deps Cache - uses: actions/cache@v2 - id: deps-cache - with: - path: | - deps - _build - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_18-${{ hashFiles('mix.lock') }} - restore-keys: | - ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-" - - - run: ./bin/install_chrome_headless.sh - - name: mix test --exclude no_nethermind - run: | - cd apps/ethereum_jsonrpc - mix compile - mix test --no-start --exclude no_nethermind - env: - # match POSTGRES_PASSWORD for postgres image below - PGPASSWORD: postgres - # match POSTGRES_USER for postgres image below - PGUSER: postgres - ETHEREUM_JSONRPC_CASE: "EthereumJSONRPC.Case.Nethermind.Mox" - ETHEREUM_JSONRPC_WEB_SOCKET_CASE: "EthereumJSONRPC.WebSocket.Case.Mox" - test_nethermind_mox_explorer: - name: Explorer Tests - runs-on: ubuntu-latest - needs: build-and-cache - services: - postgres: - image: postgres - env: - # Match apps/explorer/config/test.exs config :explorer, Explorer.Repo, database - POSTGRES_DB: explorer_test - # match PGPASSWORD for elixir image above - POSTGRES_PASSWORD: postgres - # match PGUSER for elixir image above - POSTGRES_USER: postgres - # Set health checks to wait until postgres has started - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - # Maps tcp port 5432 on service container to the host - - 5432:5432 - steps: - - uses: actions/checkout@v2 - - uses: erlef/setup-beam@v1 - with: - otp-version: ${{ env.OTP_VERSION }} - elixir-version: ${{ env.ELIXIR_VERSION }} - - - name: Mix Deps Cache - uses: actions/cache@v2 - id: deps-cache - with: - path: | - deps - _build - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_18-${{ hashFiles('mix.lock') }} - restore-keys: | - ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-" - - - name: Restore Explorer NPM Cache - uses: actions/cache@v2 - id: explorer-npm-cache - with: - path: apps/explorer/node_modules - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-explorer-npm-${{ hashFiles('apps/explorer/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-explorer-npm - - - run: ./bin/install_chrome_headless.sh - - name: mix test --exclude no_nethermind - run: | - mix ecto.create --quiet - mix ecto.migrate - cd apps/explorer - mix compile - mix test --no-start --exclude no_nethermind - env: - # match POSTGRES_PASSWORD for postgres image below - PGPASSWORD: postgres - # match POSTGRES_USER for postgres image below - PGUSER: postgres - ETHEREUM_JSONRPC_CASE: "EthereumJSONRPC.Case.Nethermind.Mox" - ETHEREUM_JSONRPC_WEB_SOCKET_CASE: "EthereumJSONRPC.WebSocket.Case.Mox" - test_nethermind_mox_indexer: - name: Indexer Tests - runs-on: ubuntu-latest - needs: build-and-cache - services: - postgres: - image: postgres - env: - # Match apps/explorer/config/test.exs config :explorer, Explorer.Repo, database - POSTGRES_DB: explorer_test - # match PGPASSWORD for elixir image above - POSTGRES_PASSWORD: postgres - # match PGUSER for elixir image above - POSTGRES_USER: postgres - # Set health checks to wait until postgres has started - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - # Maps tcp port 5432 on service container to the host - - 5432:5432 - steps: - - uses: actions/checkout@v2 - - uses: erlef/setup-beam@v1 - with: - otp-version: ${{ env.OTP_VERSION }} - elixir-version: ${{ env.ELIXIR_VERSION }} - - - name: Mix Deps Cache - uses: actions/cache@v2 - id: deps-cache - with: - path: | - deps - _build - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_18-${{ hashFiles('mix.lock') }} - restore-keys: | - ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-" - - - - run: ./bin/install_chrome_headless.sh - - - name: mix test --exclude no_nethermind - run: | - mix ecto.create --quiet - mix ecto.migrate - cd apps/indexer - mix compile - mix test --no-start --exclude no_nethermind - env: - # match POSTGRES_PASSWORD for postgres image below - PGPASSWORD: postgres - # match POSTGRES_USER for postgres image below - PGUSER: postgres - ETHEREUM_JSONRPC_CASE: "EthereumJSONRPC.Case.Nethermind.Mox" - ETHEREUM_JSONRPC_WEB_SOCKET_CASE: "EthereumJSONRPC.WebSocket.Case.Mox" - - test_nethermind_mox_block_scout_web: - name: Blockscout Web Tests - runs-on: ubuntu-latest - needs: build-and-cache - services: - redis_db: - image: 'redis:alpine' - ports: - - 6379:6379 - - postgres: - image: postgres - env: - # Match apps/explorer/config/test.exs config :explorer, Explorer.Repo, database - POSTGRES_DB: explorer_test - # match PGPASSWORD for elixir image above - POSTGRES_PASSWORD: postgres - # match PGUSER for elixir image above - POSTGRES_USER: postgres - # Set health checks to wait until postgres has started - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - # Maps tcp port 5432 on service container to the host - - 5432:5432 - steps: - - uses: actions/checkout@v2 - - uses: erlef/setup-beam@v1 - with: - otp-version: ${{ env.OTP_VERSION }} - elixir-version: ${{ env.ELIXIR_VERSION }} - - - name: Mix Deps Cache - uses: actions/cache@v2 - id: deps-cache - with: - path: | - deps - _build - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-mixlockhash_18-${{ hashFiles('mix.lock') }} - restore-keys: | - ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-deps-" - - - - name: Restore Explorer NPM Cache - uses: actions/cache@v2 - id: explorer-npm-cache - with: - path: apps/explorer/node_modules - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-explorer-npm-${{ hashFiles('apps/explorer/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-explorer-npm- - - - name: Restore Blockscout Web NPM Cache - uses: actions/cache@v2 - id: blockscoutweb-npm-cache - with: - path: apps/block_scout_web/assets/node_modules - key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-blockscoutweb-npm-${{ hashFiles('apps/block_scout_web/assets/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ env.MIX_ENV }}-blockscoutweb-npm- - - - name: Build assets - run: node node_modules/webpack/bin/webpack.js --mode development - working-directory: "apps/block_scout_web/assets" - - - run: ./bin/install_chrome_headless.sh - - - name: mix test --exclude no_nethermind - run: | - mix ecto.create --quiet - mix ecto.migrate - cd apps/block_scout_web - mix compile - mix test --no-start --exclude no_nethermind - env: - # match POSTGRES_PASSWORD for postgres image below - PGPASSWORD: postgres - # match POSTGRES_USER for postgres image below - PGUSER: postgres - ETHEREUM_JSONRPC_CASE: "EthereumJSONRPC.Case.Nethermind.Mox" - ETHEREUM_JSONRPC_WEB_SOCKET_CASE: "EthereumJSONRPC.WebSocket.Case.Mox" - CHAIN_ID: "77" - API_RATE_LIMIT_DISABLED: "true" - ADMIN_PANEL_ENABLED: "true" - ACCOUNT_ENABLED: "true" - ACCOUNT_REDIS_URL: "redis://localhost:6379" - API_V2_ENABLED: "true" - SOURCIFY_INTEGRATION_ENABLED: "true" diff --git a/.github/workflows/publish-docker-image-every-push-saas.yml b/.github/workflows/publish-docker-image-every-push-saas.yml new file mode 100644 index 000000000000..7df0aa258420 --- /dev/null +++ b/.github/workflows/publish-docker-image-every-push-saas.yml @@ -0,0 +1,85 @@ +name: Publish Docker image on every push to master branch + +on: + push: + branches: + - master +env: + OTP_VERSION: "24.3.4.1" + ELIXIR_VERSION: "1.13.4" + NEXT_RELEASE_VERSION: 4.1.11 + +jobs: + push_to_registry: + name: Push Docker image to Docker Hub + runs-on: ubuntu-latest + outputs: + release-version: ${{ steps.output-step.outputs.release-version }} + short-sha: ${{ steps.output-step.outputs.short-sha }} + steps: + - name: Check out the repo + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.PAT_TOKEN }} + + - run: docker context create gha${{ github.sha }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: ghcr.io/settlemint/blockscout-saas + + - name: Add SHORT_SHA env property with commit short sha + run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV + + - name: Add outputs + run: | + echo "::set-output name=release-version::${{ env.NEXT_RELEASE_VERSION }}" + echo "::set-output name=short-sha::${{ env.SHORT_SHA }}" + id: output-step + + - name: Build and push Docker image + uses: docker/build-push-action@v3 + with: + context: . + file: ./docker/Dockerfile + cache-from: type=registry,ref=ghcr.io/settlemint/blockscout:buildcache + cache-to: type=registry,ref=ghcr.io/settlemint/blockscout:buildcache,mode=max + push: true + platforms: | + linux/arm64 + linux/amd64 + tags: ghcr.io/settlemint/blockscout-saas:latest, ghcr.io/settlemint/blockscout-saas:${{ env.NEXT_RELEASE_VERSION }}-prerelease-${{ env.SHORT_SHA }}, ghcr.io/settlemint/blockscout-saas:${{ env.NEXT_RELEASE_VERSION }} + build-args: | + CACHE_EXCHANGE_RATES_PERIOD= + DISABLE_READ_API=false + DISABLE_WEBAPP=false + DISABLE_WRITE_API=false + CACHE_ENABLE_TOTAL_GAS_USAGE_COUNTER= + WOBSERVER_ENABLED=false + ADMIN_PANEL_ENABLED=true + CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL= + DISABLE_BRIDGE_MARKET_CAP_UPDATER=true + CACHE_BRIDGE_MARKET_CAP_UPDATE_INTERVAL= + CHAIN_ID= + JSON_RPC= + COIN_NAME=Native Token + COIN=NT + SUBNETWORK= + DISABLE_EXCHANGE_RATES=true + SECRET_KEY_BASE=RMgI4C1HSkxsEjdhtGMfwAHfyT6CKWXOgzCboJflfSm4jeAlic52io05KB6mqzc5 + ENABLE_TXS_STATS=true + SHOW_TXS_CHART=true + LOGO=/images/blockscout_logo.svg diff --git a/.github/workflows/publish-docker-image-every-push.yml b/.github/workflows/publish-docker-image-every-push.yml deleted file mode 100644 index 397955702e85..000000000000 --- a/.github/workflows/publish-docker-image-every-push.yml +++ /dev/null @@ -1,103 +0,0 @@ -name: Publish Docker image on every push to master branch - -on: - push: - branches: - - master -env: - OTP_VERSION: '25.2.1' - ELIXIR_VERSION: '1.14.3' - RELEASE_VERSION: 5.1.5 - -jobs: - push_to_registry: - name: Push Docker image to Docker Hub - runs-on: ubuntu-latest - outputs: - release-version: ${{ steps.output-step.outputs.release-version }} - short-sha: ${{ steps.output-step.outputs.short-sha }} - steps: - - name: Check out the repo - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Log in to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v4 - with: - images: blockscout/blockscout - - - name: Add SHORT_SHA env property with commit short sha - run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV - - - name: Add outputs - run: | - echo "::set-output name=release-version::${{ env.NEXT_RELEASE_VERSION }}" - echo "::set-output name=short-sha::${{ env.SHORT_SHA }}" - id: output-step - - - name: Build and push Docker image - uses: docker/build-push-action@v3 - with: - context: . - file: ./docker/Dockerfile - push: true - cache-from: type=registry,ref=blockscout/blockscout:buildcache - cache-to: type=registry,ref=blockscout/blockscout:buildcache,mode=max - tags: blockscout/blockscout:master, blockscout/blockscout:${{ env.RELEASE_VERSION }}.commit.${{ env.SHORT_SHA }} - build-args: | - CACHE_EXCHANGE_RATES_PERIOD= - API_V1_READ_METHODS_DISABLED=false - DISABLE_WEBAPP=false - API_V1_WRITE_METHODS_DISABLED=false - CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED= - ADMIN_PANEL_ENABLED=false - DECODE_NOT_A_CONTRACT_CALLS=false - MIXPANEL_URL= - MIXPANEL_TOKEN= - AMPLITUDE_URL= - AMPLITUDE_API_KEY= - CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL= - BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-beta.+commit.${{ env.SHORT_SHA }} - RELEASE_VERSION=${{ env.RELEASE_VERSION }} - - - name: Build and push Docker image for frontend - uses: docker/build-push-action@v3 - with: - context: . - file: ./docker/Dockerfile - push: true - cache-from: type=registry,ref=blockscout/blockscout:buildcache - tags: blockscout/blockscout:frontend-main - build-args: | - CACHE_EXCHANGE_RATES_PERIOD= - API_V1_READ_METHODS_DISABLED=false - DISABLE_WEBAPP=false - API_V1_WRITE_METHODS_DISABLED=false - CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED= - ADMIN_PANEL_ENABLED=false - CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL= - SESSION_COOKIE_DOMAIN=${{ secrets.FRONTEND_MAIN }} - BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-beta.+commit.${{ env.SHORT_SHA }} - RELEASE_VERSION=${{ env.RELEASE_VERSION }} - tests: - needs: push_to_registry - uses: blockscout/blockscout-ci-cd/.github/workflows/e2e_new.yaml@master - with: - blockscoutImage: blockscout/blockscout:${{ needs.push_to_registry.outputs.release-version }}-prerelease-${{ needs.push_to_registry.outputs.short-sha }} - blockscoutIngressHost: e2e-blockscout-$GITHUB_SHA_SHORT - frontendIngressHost: e2e-blockscout-$GITHUB_SHA_SHORT - gethIngressHost: e2e-geth-$GITHUB_SHA_SHORT - scVerifierIngressHost: e2e-sc-verifier-$GITHUB_SHA_SHORT - secrets: inherit diff --git a/.github/workflows/publish-docker-image-release.yml b/.github/workflows/publish-docker-image-release.yml deleted file mode 100644 index 031b197627e1..000000000000 --- a/.github/workflows/publish-docker-image-release.yml +++ /dev/null @@ -1,117 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -name: Publish Docker image - -on: - release: - types: [published] - -env: - OTP_VERSION: '25.2.1' - ELIXIR_VERSION: '1.14.3' - -jobs: - push_to_registry: - name: Push Docker image to Docker Hub - runs-on: ubuntu-latest - env: - RELEASE_VERSION: 5.1.5 - steps: - - name: Check out the repo - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Log in to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v4 - with: - images: blockscout/blockscout - - - name: Build & Push Docker image - uses: docker/build-push-action@v3 - with: - context: . - file: ./docker/Dockerfile - push: true - cache-from: type=registry,ref=blockscout/blockscout:buildcache - cache-to: type=registry,ref=blockscout/blockscout:buildcache,mode=max - tags: blockscout/blockscout:latest, blockscout/blockscout:${{ env.RELEASE_VERSION }} - platforms: | - linux/arm64 - linux/amd64 - build-args: | - CACHE_EXCHANGE_RATES_PERIOD= - API_V1_READ_METHODS_DISABLED=false - DISABLE_WEBAPP=false - API_V1_WRITE_METHODS_DISABLED=false - CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED= - ADMIN_PANEL_ENABLED=false - DECODE_NOT_A_CONTRACT_CALLS=false - MIXPANEL_URL= - MIXPANEL_TOKEN= - AMPLITUDE_URL= - AMPLITUDE_API_KEY= - CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL= - BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}-beta - RELEASE_VERSION=${{ env.RELEASE_VERSION }} - - merge-master-after-release: - name: Merge 'master' to specific branch after release - runs-on: ubuntu-latest - env: - BRANCHES: | - production-core-stg - production-sokol-stg - production-eth-stg-experimental - production-eth-goerli-stg - production-lukso-stg - production-optimism-goerli-stg - production-optimism-mainnet-stg - production-optimism-opcraft-stg - production-xdai-stg - production-gc-chiado-stg - production-polygon-supernets-stg - production-base-goerli-stg - production-rsk-stg - production-neon-stg - steps: - - uses: actions/checkout@v2 - - name: Set Git config - run: | - git config --local user.email "actions@github.com" - git config --local user.name "Github Actions" - - name: Merge master back after release - run: | - git fetch --unshallow - touch errors.txt - for branch in $BRANCHES; - do - git reset --merge - git checkout master - git fetch origin - echo $branch - git ls-remote --exit-code --heads origin $branch || { echo $branch >> errors.txt; continue; } - echo "Merge 'master' to $branch" - git checkout $branch - git pull || { echo $branch >> errors.txt; continue; } - git merge --no-ff master -m "Auto-merge master back to $branch" || { echo $branch >> errors.txt; continue; } - git push || { echo $branch >> errors.txt; continue; } - git checkout master; - done - [ -s errors.txt ] && echo "There are problems with merging 'master' to branches:" || echo "Errors file is empty" - cat errors.txt - [ ! -s errors.txt ] diff --git a/apps/block_scout_web/assets/js/pages/layout.js b/apps/block_scout_web/assets/js/pages/layout.js index edabc03366cc..eebc57b6af3b 100644 --- a/apps/block_scout_web/assets/js/pages/layout.js +++ b/apps/block_scout_web/assets/js/pages/layout.js @@ -176,20 +176,20 @@ const search = (value) => { analytics.trackEvent(eventName, eventProperties) if (value) { - window.location.href = `${commonPath}/search?q=${value}` + window.location.href = `${commonPath}/explorer/search?q=${value}` } } $(document) - .on('keyup', function (event) { - if (event.key === '/') { - $('.main-search-autocomplete').trigger('focus') - } - }) - .on('click', '.js-btn-add-chain-to-mm', event => { - const $btn = $(event.target) - addChainToMM({ btn: $btn }) - }) + .on('keyup', function (event) { + if (event.key === '/') { + $('.main-search-autocomplete').trigger('focus') + } + }) + .on('click', '.js-btn-add-chain-to-mm', event => { + const $btn = $(event.target) + addChainToMM({ btn: $btn }) + }) $('.main-search-autocomplete').on('keyup', function (event) { if (event.key === 'Enter') { diff --git a/apps/block_scout_web/lib/block_scout_web/csp_header.ex b/apps/block_scout_web/lib/block_scout_web/csp_header.ex index 10e01eec7c7a..28f9c052c849 100644 --- a/apps/block_scout_web/lib/block_scout_web/csp_header.ex +++ b/apps/block_scout_web/lib/block_scout_web/csp_header.ex @@ -9,24 +9,16 @@ defmodule BlockScoutWeb.CSPHeader do def init(opts), do: opts def call(conn, _opts) do - config = Application.get_env(:block_scout_web, __MODULE__) - google_url = "https://www.google.com" - czilladx_url = "https://request-global.czilladx.com" - coinzillatag_url = "https://coinzillatag.com" - trustwallet_url = "https://raw.githubusercontent.com/trustwallet/assets/" - walletconnect_urls = "wss://*.bridge.walletconnect.org https://registry.walletconnect.org/data/wallets.json" - json_rpc_url = Application.get_env(:block_scout_web, :json_rpc) - Controller.put_secure_browser_headers(conn, %{ "content-security-policy" => "\ - connect-src 'self' #{json_rpc_url} #{config[:mixpanel_url]} #{config[:amplitude_url]} #{websocket_endpoints(conn)} #{czilladx_url} #{trustwallet_url} #{walletconnect_urls};\ - default-src 'self';\ - script-src 'self' 'unsafe-inline' 'unsafe-eval' #{coinzillatag_url} #{google_url} https://www.gstatic.com;\ + connect-src 'self' #{websocket_endpoints(conn)} wss://*.bridge.walletconnect.org/ https://*.settlemint.com/ wss://*.settlemint.com/ https://request-global.czilladx.com/ https://raw.githubusercontent.com/trustwallet/assets/ https://registry.walletconnect.org/data/wallets.json https://*.poa.network;\ + default-src 'self' https://*.settlemint.com/;\ + script-src 'self' 'unsafe-inline' 'unsafe-eval' https://coinzillatag.com https://www.google.com https://www.gstatic.com;\ style-src 'self' 'unsafe-inline' 'unsafe-eval' https://fonts.googleapis.com;\ img-src 'self' * data:;\ media-src 'self' * data:;\ font-src 'self' 'unsafe-inline' 'unsafe-eval' https://fonts.gstatic.com data:;\ - frame-src 'self' 'unsafe-inline' 'unsafe-eval' #{czilladx_url} #{google_url};\ + frame-src 'self' 'unsafe-inline' 'unsafe-eval' https://request-global.czilladx.com/ https://www.google.com;\ " }) end diff --git a/apps/block_scout_web/lib/block_scout_web/router.ex b/apps/block_scout_web/lib/block_scout_web/router.ex index 8b7421b2773b..8de389ab17c3 100644 --- a/apps/block_scout_web/lib/block_scout_web/router.ex +++ b/apps/block_scout_web/lib/block_scout_web/router.ex @@ -1,6 +1,7 @@ defmodule BlockScoutWeb.Router do use BlockScoutWeb, :router + alias BlockScoutWeb.Plug.AllowIframe alias BlockScoutWeb.Plug.GraphQL alias BlockScoutWeb.{ApiRouter, WebRouter} @@ -44,14 +45,14 @@ defmodule BlockScoutWeb.Router do ) else scope "/", BlockScoutWeb do - pipe_through(:browser) + pipe_through([:browser, BlockScoutWeb.Plug.AllowIframe]) get("/api-docs", PageNotFoundController, :index) get("/eth-rpc-api-docs", PageNotFoundController, :index) end end scope "/", BlockScoutWeb do - pipe_through(:browser) + pipe_through([:browser, BlockScoutWeb.Plug.AllowIframe]) get("/api-docs", APIDocsController, :index) get("/eth-rpc-api-docs", APIDocsController, :eth_rpc) diff --git a/apps/block_scout_web/lib/block_scout_web/templates/layout/_footer.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/layout/_footer.html.eex index 0f82cf278d16..2081a98b1e2c 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/layout/_footer.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/layout/_footer.html.eex @@ -1,97 +1 @@ - + \ No newline at end of file diff --git a/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex index 1f8707d57f69..9b19bdd0cfdd 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex @@ -1,7 +1,4 @@ <% apps_menu = Application.get_env(:block_scout_web, :apps_menu) %> -<% other_nets = dropdown_other_nets() %> -<% test_nets = test_nets(dropdown_nets()) %> -<% main_nets = dropdown_head_main_nets() %> + \ No newline at end of file diff --git a/apps/ethereum_jsonrpc/README.md b/apps/ethereum_jsonrpc/README.md index 945c793da83e..4b65295eeb39 100644 --- a/apps/ethereum_jsonrpc/README.md +++ b/apps/ethereum_jsonrpc/README.md @@ -1,6 +1,6 @@ # EthereumJSONRPC -Ethereum JSONRPC client. +Ethereum JSONRPC client ## Configuration diff --git a/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/web_socket/web_socket_client.ex b/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/web_socket/web_socket_client.ex index 37b4249a8c5c..9deb994fbe28 100644 --- a/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/web_socket/web_socket_client.ex +++ b/apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/web_socket/web_socket_client.ex @@ -71,7 +71,7 @@ defmodule EthereumJSONRPC.WebSocket.WebSocketClient do url, __MODULE__, url, - ssl_verify: :verify_peer, + ssl_verify: :verify_none, keepalive: keepalive, socket_opts: [ cacerts: :certifi.cacerts(), diff --git a/apps/explorer/config/config.exs b/apps/explorer/config/config.exs index 4e077d969cb1..5d524852896f 100644 --- a/apps/explorer/config/config.exs +++ b/apps/explorer/config/config.exs @@ -5,9 +5,6 @@ # is restricted to this project. import Config -[__DIR__ | ~w(.. .. .. config config_helper.exs)] -|> Path.join() -|> Code.eval_file() # General application configuration config :explorer, @@ -82,7 +79,7 @@ config :explorer, Explorer.Chain.Cache.TransactionActionUniswapPools, enabled: t config :explorer, Explorer.ExchangeRates, cache_period: ConfigHelper.parse_time_env_var("CACHE_EXCHANGE_RATES_PERIOD", "10m") -config :explorer, Explorer.ExchangeRates.TokenExchangeRates, enabled: true +config :explorer, Explorer.ExchangeRates.TokenExchangeRates, enabled: false config :explorer, Explorer.Counters.TokenHoldersCounter, enabled: true, diff --git a/config/runtime.exs b/config/runtime.exs index 744a8f21d7d6..7c45e6581574 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -1,8 +1,5 @@ import Config -[__DIR__ | ~w(config_helper.exs)] -|> Path.join() -|> Code.eval_file() ###################### ### BlockScout Web ### diff --git a/docker-compose/envs/common-blockscout.env b/docker-compose/envs/common-blockscout.env index 5f67ecace98f..43db1bdce2a5 100644 --- a/docker-compose/envs/common-blockscout.env +++ b/docker-compose/envs/common-blockscout.env @@ -9,11 +9,14 @@ ETHEREUM_JSONRPC_TRACE_URL=http://host.docker.internal:8545/ NETWORK= SUBNETWORK=Awesome chain LOGO=/images/blockscout_logo.svg +LOGO_FOOTER=/explorer/images/blockscout_logo.svg # ETHEREUM_JSONRPC_WS_URL= ETHEREUM_JSONRPC_TRANSPORT=http ETHEREUM_JSONRPC_DISABLE_ARCHIVE_BALANCES=false IPC_PATH= NETWORK_PATH=/ +API_PATH=/ +SOCKET_ROOT=/ BLOCKSCOUT_HOST= BLOCKSCOUT_PROTOCOL= # SECRET_KEY_BASE= diff --git a/docker/Dockerfile b/docker/Dockerfile index 4b8018c39be2..360a1d131594 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -38,7 +38,7 @@ ADD apps/explorer/mix.exs ./apps/explorer/ ADD apps/ethereum_jsonrpc/mix.exs ./apps/ethereum_jsonrpc/ ADD apps/indexer/mix.exs ./apps/indexer/ -RUN mix do deps.get, local.rebar --force, deps.compile +RUN mix do deps.get, local.rebar --force, deps.compile, deps.compile phoenix --force ADD . . @@ -79,3 +79,9 @@ COPY --from=builder /app/apps/explorer/node_modules ./node_modules COPY --from=builder /app/config/config_helper.exs ./config/config_helper.exs COPY --from=builder /app/config/config_helper.exs /app/releases/${RELEASE_VERSION}/config_helper.exs +RUN chgrp -R 0 /app && \ + chmod -R g=u /app && \ + chown -R 1001:0 /app && \ + chmod 775 /app + +USER 1001 \ No newline at end of file diff --git a/mix.lock b/mix.lock index acd1b4d9a85d..d4b679ed8e8c 100644 --- a/mix.lock +++ b/mix.lock @@ -92,7 +92,7 @@ "nimble_csv": {:hex, :nimble_csv, "1.2.0", "4e26385d260c61eba9d4412c71cea34421f296d5353f914afe3f2e71cce97722", [:mix], [], "hexpm", "d0628117fcc2148178b034044c55359b26966c6eaa8e2ce15777be3bbc91b12a"}, "nimble_options": {:hex, :nimble_options, "1.0.2", "92098a74df0072ff37d0c12ace58574d26880e522c22801437151a159392270e", [:mix], [], "hexpm", "fd12a8db2021036ce12a309f26f564ec367373265b53e25403f0ee697380f1b8"}, "nimble_parsec": {:hex, :nimble_parsec, "1.3.1", "2c54013ecf170e249e9291ed0a62e5832f70a476c61da16f6aac6dca0189f2af", [:mix], [], "hexpm", "2682e3c0b2eb58d90c6375fc0cc30bc7be06f365bf72608804fb9cffa5e1b167"}, - "number": {:hex, :number, "1.0.3", "932c8a2d478a181c624138958ca88a78070332191b8061717270d939778c9857", [:mix], [{:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}], "hexpm", "dd397bbc096b2ca965a6a430126cc9cf7b9ef7421130def69bcf572232ca0f18"}, + "number": {:hex, :number, "1.0.4", "3e6e6032a3c1d4c3760e77a42c580a57a15545dd993af380809da30fe51a032c", [:mix], [{:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}], "hexpm", "16f7516584ef2be812af4f33f2eaf3f9b9f6ed8892f45853eb93113f83721e42"}, "numbers": {:hex, :numbers, "5.2.4", "f123d5bb7f6acc366f8f445e10a32bd403c8469bdbce8ce049e1f0972b607080", [:mix], [{:coerce, "~> 1.0", [hex: :coerce, repo: "hexpm", optional: false]}, {:decimal, "~> 1.9 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "eeccf5c61d5f4922198395bf87a465b6f980b8b862dd22d28198c5e6fab38582"}, "oauth2": {:hex, :oauth2, "2.0.1", "70729503e05378697b958919bb2d65b002ba6b28c8112328063648a9348aaa3f", [:mix], [{:hackney, "~> 1.13", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "c64e20d4d105bcdbcbe03170fb530d0eddc3a3e6b135a87528a22c8aecf74c52"}, "optimal": {:hex, :optimal, "0.3.6", "46bbf52fbbbd238cda81e02560caa84f93a53c75620f1fe19e81e4ae7b07d1dd", [:mix], [], "hexpm", "1a06ea6a653120226b35b283a1cd10039550f2c566edcdec22b29316d73640fd"},