Skip to content

Commit

Permalink
fix: docker build (#3078)
Browse files Browse the repository at this point in the history
* fix: docker build

* fix: adding missing linter config
  • Loading branch information
nutrina authored Nov 21, 2024
1 parent 650f16b commit d764b13
Show file tree
Hide file tree
Showing 10 changed files with 4,795 additions and 8 deletions.
86 changes: 86 additions & 0 deletions embed/.env-example.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# .env
GOOGLE_CLIENT_ID=MY-APP-ID.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=MY_APP_SECRET
GOOGLE_CALLBACK=http://localhost:3000/

GENERIC_CALLBACK_URL=http://localhost:3000/

TWITTER_CLIENT_ID=MY-APP-ID-TWITTER
TWITTER_CLIENT_SECRET=MY_APP_SECRET
TWITTER_CALLBACK=http://127.0.0.1:3000/
BRIGHTID_PRIVATE_KEY=BRIGHTID_PRIVATE_KEY
GITHUB_CLIENT_ID=MY_GITHUB_CLIENT_ID
GITHUB_CLIENT_SECRET=MY_GITHUB_CLIENT_SECRET
GRANT_HUB_GITHUB_CLIENT_ID=MY_GRANT_HUB_GITHUB_CLIENT_ID
GRANT_HUB_GITHUB_CLIENT_SECRET=MY_GRANT_HUB_GITHUB_CLIENT_SECRET
GRANT_HUB_MACI_GITHUB_CLIENT_ID=MY_GRANT_HUB_GITHUB_CLIENT_ID
GRANT_HUB_MACI_GITHUB_CLIENT_SECRET=MY_GRANT_HUB_GITHUB_CLIENT_SECRET
LINKEDIN_CLIENT_ID=MY_LINKEDIN_CLIENT_ID
LINKEDIN_CLIENT_SECRET=MY_LINKEDIN_CLIENT_SECRET
LINKEDIN_CLIENT_ID_V2=MY_LINKEDIN_CLIENT_ID_V2
LINKEDIN_CLIENT_SECRET_V2=MY_LINKEDIN_CLIENT_SECRET_V2
LINKEDIN_CALLBACK=http://localhost:3000/
DISCORD_CLIENT_ID=MY_APP_CLIENT_ID
DISCORD_CLIENT_SECRET=MY_APP_CLIENT_SECRET
DISCORD_CALLBACK=MY_APP_CALLBACK
ETHERSCAN_API_KEY=MY_API_KEY
GTC_STAKING_GRAPH_API_KEY=MY_API_KEY
COINBASE_CLIENT_ID=MY_COINBASE_CLIENT_ID
COINBASE_CLIENT_SECRET=MY_COINBASE_CLIENT_SECRET
COINBASE_CALLBACK=http://localhost:3000/
TRUSTA_LABS_ACCESS_TOKEN=trusta_labs_access_token
OUTDID_API_KEY=<api key>
OUTDID_API_SECRET=<secret>

CURRENT_ENV=development
EXIT_ON_UNHANDLED_ERROR=true

# For server to use a consistent public key, provide a valid Ed25519 key here:
# IAM_JWK='{"kty":"OKP","crv":"Ed25519","x":"yourIamKeyValues","d":"yourIamKeyValues"}'
IAM_JWK='{"kty":"OKP","crv":"Ed25519","x":"a7wbszn1DfZ3I7-_zDkUXCgypcGxL_cpCSTYEPRYj_o","d":"Z0hucmxRt1C22ygAXJ1arXwD9QlAA5tEPLb7qoXYDGY"}'

EMBED_PORT=8004

RPC_URL=https://eth-mainnet.alchemyapi.io/v2/<API_KEY>
ALCHEMY_API_KEY=<API_KEY>
MORALIS_API_KEY=<API_KEY>

AMI_API_TOKEN='SECRET_GITCOIN_AMI_API_TOKEN'

GTC_STAKING_GRAPH_API_KEY=<your api key token>
GTC_STAKING_ROUNDS='[{"id": 4, "start": 1693526400, "duration": 7592340}, {"id": 5, "start": 1701118741, "duration": 8157658}]'


ATTESTATION_SIGNER_PRIVATE_KEY=0x0000000000000000000000000000000000000000000000000000000000000001
TESTNET_ATTESTATION_SIGNER_PRIVATE_KEY=0x0000000000000000000000000000000000000000000000000000000000000001
PASSPORT_SCORER_BACKEND=http://localhost:8002/
# Needs to match FE/APP equivalents in app/.env
ALLO_SCORER_ID=3
SCORER_ENDPOINT=http://localhost:8002/
SCORER_API_KEY=abc # This is a static authentication secret token
EAS_FEE_USD=2

EAS_GITCOIN_STAMP_SCHEMA=0xd83994d5459162a259c3a18d3db267ca05982f1e1e261d5388a8bfe2a2a2c7f9

PASSPORT_STAMP_METADATA_PATH=http://localhost:3000/stampMetadata.json

# Use this environment variable to enable/disable testnets on on-chain-based stamp evaluation.
INCLUDE_TESTNETS=false
ZKSYNC_ERA_MAINNET_ENDPOINT=zksync_mainnet_endpoint

CGRANTS_API_URL=http://localhost:8002/cgrants


DATA_SCIENCE_API_URL=http://localhost:8001/predict

IAM_JWK_EIP712='{"kty":"EC","crv":"secp256k1","x":"PdB2nS-knyAxc6KPuxBr65vRpW-duAXwpeXlwGJ03eU","y":"MwoGZ08hF5uv-_UEC9BKsYdJVSbJNHcFhR1BZWer5RQ","d":"z9VrSNNZXf9ywUx3v_8cLDhSw8-pvAT9qu_WZmqqfWM"}'

REDIS_URL=redis://localhost:6379

# Used by the 'src/scripts/checkOnChainProvidersAreInSync.ts' script
ALCHEMY_API_KEY=...

# See the equivalent value configured in app sample
SCROLL_BADGE_PROVIDER_INFO='{"badge_provider":{"contractAddress":"0x...","level":1}}'
SCROLL_BADGE_ATTESTATION_SCHEMA_UID=0xd57de4f41c3d3cc855eadef68f98c0d4edd22d57161d96b7c06d2f4336cc3b49

8 changes: 8 additions & 0 deletions embed/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*.js
/*.ts
/dist/*
/coverage/*
/node_modules/*
/__mocks__/**/*
/__tests__/**/*
bright-id-script.js
52 changes: 52 additions & 0 deletions embed/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
module.exports = {
env: {
es6: true,
browser: true,
jest: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:prettier/recommended",
"plugin:jest/recommended",
"plugin:react/recommended",
"prettier",
],
ignorePatterns: [".eslintrc.js", "jest.config.js"],
parser: "@typescript-eslint/parser",
parserOptions: {
sourceType: "module",
ecmaVersion: 2017,
ecmaFeatures: {
jsx: true,
},
tsconfigRootDir: __dirname,
project: ["./tsconfig.json"],
},
plugins: ["@typescript-eslint", "prettier", "jest", "react"],
rules: {
quotes: ["error", "double"],
"no-console": "warn",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{ vars: "all", args: "after-used", ignoreRestSiblings: false },
],
"@typescript-eslint/explicit-function-return-type": "warn", // Consider using explicit annotations for object literals and function return types even when they can be inferred.
"no-empty": "warn",
"@typescript-eslint/no-misused-promises": 1,
"@typescript-eslint/no-floating-promises": 1,
"@typescript-eslint/no-unsafe-assignment": "warn",
},
settings: {
"import/resolver": {
node: {
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
},
react: {
version: "detect",
},
},
};
25 changes: 25 additions & 0 deletions embed/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
/dist
/coverage
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
2 changes: 2 additions & 0 deletions embed/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/dist/*
/coverage/*
3 changes: 3 additions & 0 deletions embed/.prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require("../.prettierrc.js"),
};
4 changes: 2 additions & 2 deletions embed/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ WORKDIR /usr/src

COPY . .

RUN yarn
RUN yarn && cd embed && yarn build

EXPOSE 80 443
CMD [ "node", "embed/dist/main.js" ]
CMD [ "node", "embed/dist/src/main.js" ]
7 changes: 1 addition & 6 deletions embed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@gitcoin/passport-embed",
"private": true,
"version": "1.0.0",
"main": "dist/main.js",
"main": "dist/src/main.js",
"types": "src/types.d.ts",
"type": "module",
"license": "MIT",
Expand All @@ -20,11 +20,6 @@
"lint:fix": "eslint --fix --ext .ts,.js,.tsx ."
},
"dependencies": {
"@ethereum-attestation-service/eas-sdk": "^2.7.0",
"@gitcoin/passport-identity": "^1.0.0",
"@gitcoin/passport-platforms": "^1.0.0",
"@gitcoin/passport-types": "^1.0.0",
"@spruceid/didkit-wasm-node": "^0.2.1",
"axios": "^0.27.2",
"cors": "^2.8.5",
"dotenv": "^16.0.0",
Expand Down
Loading

0 comments on commit d764b13

Please sign in to comment.