Skip to content

Commit

Permalink
Merge branch 'main' of github.com:charmverse/app.charmverse.io into n…
Browse files Browse the repository at this point in the history
…otify-new-arrivals
  • Loading branch information
motechFR committed Oct 16, 2024
2 parents a9285e9 + 3d9137a commit f258aa9
Show file tree
Hide file tree
Showing 255 changed files with 11,925 additions and 5,048 deletions.
5 changes: 5 additions & 0 deletions .cdk/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ export const apps: { [key: string]: { stg?: Options; prd?: Options } } = {
sslCert: sunnyCert
}
},
scoutgameadmin: {
prd: {
sslCert: scoutgameCert
}
},
scoutgame: {
prd: {
sslCert: scoutgameCert
Expand Down
14 changes: 14 additions & 0 deletions .ebextensions/scoutgameadmin/00_env_vars.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Do not put any env var or secrets used by the app here. Put in .ebstalk.apps.env/scoutgame.env
# This file should only have
# - env variables referenced in docker-compose file
# - variables needed for the .platform/hooks/predeploy/01_pull_secrets.sh script to run

option_settings:
aws:elasticbeanstalk:application:environment:
COMPOSE_PROJECT_NAME: "prd"
COMPOSE_PROFILES: "prd-scoutgameadmin"
EBSTALK_ENV_FILE: "scoutgameadmin.env"
SERVICE_ENV: "prd" # this sets the value of datadog env tag
SERVICE_NAME: "scoutgameadmin"
IMGNAME: "scoutgameadmin"
IMGTAG: ""
4 changes: 4 additions & 0 deletions .ebextensions/scoutgameadmin/01_filesystem.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
option_settings:
aws:autoscaling:launchconfiguration:
RootVolumeType: gp2
RootVolumeSize: "24"
7 changes: 7 additions & 0 deletions .ebextensions/scoutgameadmin/02_autoscaling.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# this configures Beanstalk to restart the app if the app's health check fails
Resources:
AWSEBAutoScalingGroup:
Type: "AWS::AutoScaling::AutoScalingGroup"
Properties:
HealthCheckType: ELB
HealthCheckGracePeriod: 300
13 changes: 13 additions & 0 deletions .ebextensions/scoutgameadmin/03_env_health_ignore_400.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
option_settings:
aws:elasticbeanstalk:healthreporting:system:
SystemType: enhanced
ConfigDocument:
Rules:
Environment:
Application:
ApplicationRequests4xx:
Enabled: false
ELB:
ELBRequests4xx:
Enabled: false
Version: 1
21 changes: 21 additions & 0 deletions .ebextensions/scoutgameadmin/06_cloudwatch_alarm.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Adding alarm for degraded state
Resources:
EnvHealthAlarm:
Type: "AWS::CloudWatch::Alarm"
Properties:
AlarmDescription: "A CloudWatch Alarm that triggers when an Elastic Beanstalk Environment is unhealthy."
Namespace: "AWS/ElasticBeanstalk"
MetricName: "EnvironmentHealth"
Dimensions:
- Name: EnvironmentName
Value: { "Ref" : "AWSEBEnvironmentName" }
Statistic: "Average"
Period: "300"
EvaluationPeriods: "2"
Threshold: "19" # a value between 15 and 20. 15 is warning, 20 is degraded
ComparisonOperator: "GreaterThanOrEqualToThreshold"
AlarmActions:
- "arn:aws:sns:us-east-1:310849459438:Production-Alerts"
OKActions:
- "arn:aws:sns:us-east-1:310849459438:Production-Alerts"
TreatMissingData: "notBreaching"
42 changes: 42 additions & 0 deletions .ebextensions/scoutgameadmin/07_http-to-https.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# source: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/configuring-https-httpredirect.html

###################################################################################################
#### Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
####
#### Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
#### except in compliance with the License. A copy of the License is located at
####
#### http://aws.amazon.com/apache2.0/
####
#### or in the "license" file accompanying this file. This file is distributed on an "AS IS"
#### BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#### License for the specific language governing permissions and limitations under the License.
###################################################################################################

###################################################################################################
#### This configuration file modifies the default port 80 listener attached to an Application Load Balancer
#### to automatically redirect incoming connections on HTTP to HTTPS.
#### This will not work with an environment using the load balancer type Classic or Network.
#### A prerequisite is that the 443 listener has already been created.
#### Please use the below link for more information about creating an Application Load Balancer on
#### the Elastic Beanstalk console.
#### https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environments-cfg-alb.html#environments-cfg-alb-console
###################################################################################################

Resources:
AWSEBV2LoadBalancerListener:
Type: AWS::ElasticLoadBalancingV2::Listener
Properties:
LoadBalancerArn:
Ref: AWSEBV2LoadBalancer
Port: 80
Protocol: HTTP
DefaultActions:
- Type: redirect
RedirectConfig:
Host: "#{host}"
Path: "/#{path}"
Port: "443"
Protocol: "HTTPS"
Query: "#{query}"
StatusCode: "HTTP_301"
4 changes: 2 additions & 2 deletions .ebstalk.apps.env/scoutgame.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ REACT_APP_APP_ENV="production"
DATABASE_URL="{{pull:secretsmanager:/io.cv.app/prd/db:SecretString:database_url}}"
AUTH_COOKIE="sg-session"
AUTH_SECRET="{{pull:secretsmanager:/io.cv.app/prd/auth_secret:SecretString:auth_secret}}"
ALCHEMY_API_KEY="{{pull:secretsmanager:/io.cv.app/prd/alchemy:SecretString:scout_game_alchemy_api_key}}"
REACT_APP_ALCHEMY_API_KEY="{{pull:secretsmanager:/io.cv.app/prd/alchemy:SecretString:scout_game_alchemy_api_key}}"
ALCHEMY_API_KEY="{{pull:secretsmanager:/io.cv.app/prd/alchemy:SecretString:scout_game_private_key}}"
REACT_APP_ALCHEMY_API_KEY="{{pull:secretsmanager:/io.cv.app/prd/alchemy:SecretString:scout_game_public_key}}"
NEYNAR_API_KEY="{{pull:secretsmanager:/io.cv.app/prd/neynar:SecretString:neynar_api_key}}"
DD_API_KEY="{{pull:secretsmanager:/io.cv.app/shared/datadog:SecretString:dd_api_key}}"
DD_AGENT_HOST="datadog-agent"
Expand Down
9 changes: 9 additions & 0 deletions .ebstalk.apps.env/scoutgameadmin.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
DOMAIN="https://admin.scoutgame.xyz"
REACT_APP_APP_ENV="production"
NODE_ENV="production"
DATABASE_URL="{{pull:secretsmanager:/io.cv.app/prd/db:SecretString:database_url}}"
AUTH_COOKIE="scoutadmin-session"
AUTH_SECRET="{{pull:secretsmanager:/io.cv.app/prd/auth_secret:SecretString:auth_secret}}"
# apis
GITHUB_ACCESS_TOKEN="{{pull:secretsmanager:/io.cv.app/prd/github:SecretString:scoutgame_github_access_token}}"
NEYNAR_API_KEY="{{pull:secretsmanager:/io.cv.app/prd/neynar:SecretString:neynar_api_key}}"
19 changes: 11 additions & 8 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,25 @@
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "react", "react-hooks"],
"plugins": ["@typescript-eslint", "@stylistic/ts", "react", "react-hooks"],
"rules": {
"react/jsx-key": "error",
"react/forbid-prop-types": 0,
"@next/next/no-img-element": "off",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/ban-ts-comment": "off",
"@stylistic/ts/ban-ts-comment": "off",
"@typescript-eslint/consistent-type-imports": [
"error",
{
"prefer": "type-imports"
}
],
"@typescript-eslint/no-empty-function": "off",
"@stylistic/ts/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-empty-interface": "off",
"@stylistic/ts/no-inferrable-types": "off",
"@stylistic/ts/no-empty-interface": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/member-delimiter-style": [
"@stylistic/ts/member-delimiter-style": [
"error",
{
"multiline": {
Expand All @@ -61,7 +61,7 @@
"multilineDetection": "brackets"
}
],
"@typescript-eslint/object-curly-spacing": ["error", "always"],
"@stylistic/ts/object-curly-spacing": ["error", "always"],
"object-curly-spacing": "off",
"arrow-body-style": "off",
"arrow-parens": "off",
Expand All @@ -78,18 +78,21 @@
"devDependencies": true,
"packageDir": [
"./",
"../..",
"./@connect-shared",
"./apps/cron/",
"./apps/farcaster/",
"./apps/scoutgame/",
"./apps/scoutgameadmin/",
"./apps/scoutgamecron/",
"./apps/sunnyawards/",
"./apps/waitlist/",
"./apps/websockets/",
"./apps/ceramic/",
"./packages/charmeditor/",
"./packages/github/",
"./packages/scoutgame/"
"./packages/scoutgame/",
"./packages/utils/"
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/build_app/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ runs:
# Instead of hasing files, use the latest git commit in a directory to speed up cache key https://github.com/actions/runner/issues/1840#issuecomment-2094847172
run: |
echo "NPM_PACKAGES_COMMIT=$(git log -1 --pretty=format:%H -- package-lock.json)" >> $GITHUB_ENV
echo "SOURCE_CODE_COMMIT=$(git log -1 --pretty=format:%H -- lib @connect-shared apps/${{ inputs.app_name }})" >> $GITHUB_ENV
echo "SOURCE_CODE_COMMIT=$(git log -1 --pretty=format:%H -- lib packages @connect-shared apps/${{ inputs.app_name }})" >> $GITHUB_ENV
- name: Restore build
id: restore_build
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy_cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ jobs:
- name: Run eslint on changed files
uses: tj-actions/eslint-changed-files@v25
with:
warn_ignored: 'true'
skip_annotations: 'true' # do not annotate code in the PR
file_extensions: '**/*.{ts,tsx}'
escape_paths: 'false'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy_scoutgame.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ jobs:
with:
skip_annotations: 'true' # do not annotate code in the PR
file_extensions: '**/*.{ts,tsx}'
warn_ignored: 'true'
# Flag necessary to avoid issues when using parentheses in the paths
# https://github.com/tj-actions/eslint-changed-files/issues/1801#issuecomment-2083477324
escape_paths: 'false'
Expand Down
Loading

0 comments on commit f258aa9

Please sign in to comment.