From 8ffaf71aa7ebc5959f159917a2530cd84a838c88 Mon Sep 17 00:00:00 2001 From: Keith Stevens Date: Mon, 26 Dec 2022 12:07:40 +0900 Subject: [PATCH 1/8] Tweaking the docker files and prisma to prepare for reliable aws deployments --- docker/Dockerfile.website | 18 +++--------------- scripts/endtoend-demo/docker-compose.yaml | 4 +++- website/prisma/schema.prisma | 1 + 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/docker/Dockerfile.website b/docker/Dockerfile.website index afb18baf..a9a677bc 100644 --- a/docker/Dockerfile.website +++ b/docker/Dockerfile.website @@ -1,7 +1,5 @@ # Install dependencies only when needed -FROM node:16.19 AS deps -# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. -# RUN apk add --no-cache libc6-compat +FROM node:16.18.0 AS deps WORKDIR /app # Install dependencies based on the preferred package manager @@ -12,27 +10,19 @@ RUN \ fi # Rebuild the source code only when needed -FROM node:16.19 AS builder +FROM node:16.18.0 AS builder WORKDIR /app COPY --from=deps /app/node_modules ./node_modules COPY ./website/ . -# Next.js collects completely anonymous telemetry data about general usage. -# Learn more here: https://nextjs.org/telemetry -# Uncomment the following line in case you want to disable telemetry during the build. -# ENV NEXT_TELEMETRY_DISABLED 1 - -# RUN yarn build RUN npx prisma generate RUN npm run build # Production image, copy all the files and run next -FROM node:16.19 AS runner +FROM node:16.18.0 AS runner WORKDIR /app ENV NODE_ENV production -# Uncomment the following line in case you want to disable telemetry during runtime. -# ENV NEXT_TELEMETRY_DISABLED 1 RUN addgroup --system --gid 1001 nodejs RUN adduser --system --uid 1001 nextjs @@ -48,8 +38,6 @@ COPY --chown=nextjs:nodejs ./website/prisma/schema.prisma ./ # https://docs.docker.com/compose/startup-order/ COPY --chown=nextjs:nodejs ./website/wait-for-postgres.sh ./ -# Automatically leverage output traces to reduce image size -# https://nextjs.org/docs/advanced-features/output-file-tracing COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static diff --git a/scripts/endtoend-demo/docker-compose.yaml b/scripts/endtoend-demo/docker-compose.yaml index 5e9ad9ac..936e4a33 100644 --- a/scripts/endtoend-demo/docker-compose.yaml +++ b/scripts/endtoend-demo/docker-compose.yaml @@ -12,6 +12,8 @@ services: extends: file: ../frontend-development/docker-compose.yaml service: webdb + environment: + POSTGRES_DB: oasst_web # This lets you manually inspect the web and backend databases. adminer: @@ -40,7 +42,7 @@ services: context: ../../ image: oasst-web environment: - - DATABASE_URL=postgres://postgres:postgres@webdb/ocgpt_website + - DATABASE_URL=postgres://postgres:postgres@webdb/oasst_web - FASTAPI_URL=http://backend:8080 - FASTAPI_KEY=1234 - NEXTAUTH_SECRET=O/M2uIbGj+lDD2oyNa8ax4jEOJqCPJzO53UbWShmq98= diff --git a/website/prisma/schema.prisma b/website/prisma/schema.prisma index 9a9678c9..3e379d43 100644 --- a/website/prisma/schema.prisma +++ b/website/prisma/schema.prisma @@ -5,6 +5,7 @@ datasource db { generator client { provider = "prisma-client-js" + binaryTargets = ["native", "linux-musl"] } model Account { From 5e1ed2e2436519d35e63715e544a3638dbd1b34a Mon Sep 17 00:00:00 2001 From: Keith Stevens Date: Mon, 26 Dec 2022 13:54:58 +0900 Subject: [PATCH 2/8] Adding in aws copilot configurations to simplify full deployment on aws. Also updating dependencies to work in standalone mode --- .pre-commit-config.yaml | 1 + copilot/.workspace | 1 + copilot/environments/staging/manifest.yml | 10 + copilot/web/addons/web-cluster.yml | 144 ++++ copilot/web/manifest.yml | 41 ++ website/package-lock.json | 678 ++++++++++++++++++ website/package.json | 1 + .../20221215064332_initialized/migration.sql | 66 -- .../migration.sql | 2 - website/prisma/migrations/migration_lock.toml | 3 - website/src/pages/auth/signup.tsx | 24 +- 11 files changed, 888 insertions(+), 83 deletions(-) create mode 100644 copilot/.workspace create mode 100644 copilot/environments/staging/manifest.yml create mode 100644 copilot/web/addons/web-cluster.yml create mode 100644 copilot/web/manifest.yml delete mode 100644 website/prisma/migrations/20221215064332_initialized/migration.sql delete mode 100644 website/prisma/migrations/20221215101838_record_labeler_id/migration.sql delete mode 100644 website/prisma/migrations/migration_lock.toml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 928810f5..c388cc43 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,6 +10,7 @@ repos: - id: trailing-whitespace - id: check-ast - id: check-yaml + exclude: copilot/web/addons/* - id: check-json - id: check-case-conflict - id: detect-private-key diff --git a/copilot/.workspace b/copilot/.workspace new file mode 100644 index 00000000..3e35e57d --- /dev/null +++ b/copilot/.workspace @@ -0,0 +1 @@ +application: open-assistant diff --git a/copilot/environments/staging/manifest.yml b/copilot/environments/staging/manifest.yml new file mode 100644 index 00000000..a336d6ed --- /dev/null +++ b/copilot/environments/staging/manifest.yml @@ -0,0 +1,10 @@ +# The manifest for the "staging" environment. +# Read the full specification for the "Environment" type at: +# https://aws.github.io/copilot-cli/docs/manifest/environment/ + +name: staging +type: Environment + +# Configure observability for your environment resources. +observability: + container_insights: false diff --git a/copilot/web/addons/web-cluster.yml b/copilot/web/addons/web-cluster.yml new file mode 100644 index 00000000..783cdec1 --- /dev/null +++ b/copilot/web/addons/web-cluster.yml @@ -0,0 +1,144 @@ +Parameters: + App: + Type: String + Description: Your application's name. + Env: + Type: String + Description: The environment name your service, job, or workflow is being deployed to. + Name: + Type: String + Description: The name of the service, job, or workflow being deployed. + # Customize your Aurora Serverless cluster by setting the default value of the following parameters. + webclusterDBName: + Type: String + Description: The name of the initial database to be created in the Aurora Serverless v2 cluster. + Default: oassist_web + # Cannot have special characters + # Naming constraints: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Limits.html#RDS_Limits.Constraints +Mappings: + webclusterEnvScalingConfigurationMap: + staging: + "DBMinCapacity": 0.5 # AllowedValues: from 0.5 through 128 + "DBMaxCapacity": 8 # AllowedValues: from 0.5 through 128 + + All: + "DBMinCapacity": 0.5 # AllowedValues: from 0.5 through 128 + "DBMaxCapacity": 8 # AllowedValues: from 0.5 through 128 + +Resources: + webclusterDBSubnetGroup: + Type: "AWS::RDS::DBSubnetGroup" + Properties: + DBSubnetGroupDescription: Group of Copilot private subnets for Aurora Serverless v2 cluster. + SubnetIds: + !Split [",", { "Fn::ImportValue": !Sub "${App}-${Env}-PrivateSubnets" }] + webclusterSecurityGroup: + Metadata: + "aws:copilot:description": "A security group for your workload to access the Aurora Serverless v2 cluster webcluster" + Type: "AWS::EC2::SecurityGroup" + Properties: + GroupDescription: !Sub "The Security Group for ${Name} to access Aurora Serverless v2 cluster webcluster." + VpcId: + Fn::ImportValue: !Sub "${App}-${Env}-VpcId" + Tags: + - Key: Name + Value: !Sub "copilot-${App}-${Env}-${Name}-Aurora" + webclusterDBClusterSecurityGroup: + Metadata: + "aws:copilot:description": "A security group for your Aurora Serverless v2 cluster webcluster" + Type: AWS::EC2::SecurityGroup + Properties: + GroupDescription: The Security Group for the Aurora Serverless v2 cluster. + SecurityGroupIngress: + - ToPort: 5432 + FromPort: 5432 + IpProtocol: tcp + Description: !Sub "From the Aurora Security Group of the workload ${Name}." + SourceSecurityGroupId: !Ref webclusterSecurityGroup + VpcId: + Fn::ImportValue: !Sub "${App}-${Env}-VpcId" + webclusterAuroraSecret: + Metadata: + "aws:copilot:description": "A Secrets Manager secret to store your DB credentials" + Type: AWS::SecretsManager::Secret + Properties: + Description: !Sub Aurora main user secret for ${AWS::StackName} + GenerateSecretString: + SecretStringTemplate: '{"username": "postgres"}' + GenerateStringKey: "password" + ExcludePunctuation: true + IncludeSpace: false + PasswordLength: 16 + webclusterDBClusterParameterGroup: + Metadata: + "aws:copilot:description": "A DB parameter group for engine configuration values" + Type: "AWS::RDS::DBClusterParameterGroup" + Properties: + Description: !Ref "AWS::StackName" + Family: "aurora-postgresql14" + Parameters: + client_encoding: "UTF8" + webclusterDBCluster: + Metadata: + "aws:copilot:description": "The webcluster Aurora Serverless v2 database cluster" + Type: "AWS::RDS::DBCluster" + Properties: + MasterUsername: + !Join [ + "", + [ + "{{resolve:secretsmanager:", + !Ref webclusterAuroraSecret, + ":SecretString:username}}", + ], + ] + MasterUserPassword: + !Join [ + "", + [ + "{{resolve:secretsmanager:", + !Ref webclusterAuroraSecret, + ":SecretString:password}}", + ], + ] + DatabaseName: !Ref webclusterDBName + Engine: "aurora-postgresql" + EngineVersion: "14.4" + DBClusterParameterGroupName: !Ref webclusterDBClusterParameterGroup + DBSubnetGroupName: !Ref webclusterDBSubnetGroup + Port: 5432 + VpcSecurityGroupIds: + - !Ref webclusterDBClusterSecurityGroup + ServerlessV2ScalingConfiguration: + # Replace "All" below with "!Ref Env" to set different autoscaling limits per environment. + MinCapacity: + !FindInMap [webclusterEnvScalingConfigurationMap, All, DBMinCapacity] + MaxCapacity: + !FindInMap [webclusterEnvScalingConfigurationMap, All, DBMaxCapacity] + webclusterDBWriterInstance: + Metadata: + "aws:copilot:description": "The webcluster Aurora Serverless v2 writer instance" + Type: "AWS::RDS::DBInstance" + Properties: + DBClusterIdentifier: !Ref webclusterDBCluster + DBInstanceClass: db.serverless + Engine: "aurora-postgresql" + PromotionTier: 1 + AvailabilityZone: !Select + - 0 + - !GetAZs + Ref: AWS::Region + + webclusterSecretAuroraClusterAttachment: + Type: AWS::SecretsManager::SecretTargetAttachment + Properties: + SecretId: !Ref webclusterAuroraSecret + TargetId: !Ref webclusterDBCluster + TargetType: AWS::RDS::DBCluster +Outputs: + webclusterSecret: # injected as WEBCLUSTER_SECRET environment variable by Copilot. + Description: "The JSON secret that holds the database username and password. Fields are 'host', 'port', 'dbname', 'username', 'password', 'dbClusterIdentifier' and 'engine'" + Value: !Ref webclusterAuroraSecret + webclusterSecurityGroup: + Description: "The security group to attach to the workload." + Value: !Ref webclusterSecurityGroup diff --git a/copilot/web/manifest.yml b/copilot/web/manifest.yml new file mode 100644 index 00000000..18df80c1 --- /dev/null +++ b/copilot/web/manifest.yml @@ -0,0 +1,41 @@ +# The manifest for the "web" service. +# Read the full specification for the "Load Balanced Web Service" type at: +# https://aws.github.io/copilot-cli/docs/manifest/lb-web-service/ + +name: web +type: Load Balanced Web Service + +http: + path: "/" + +image: + build: + dockerfile: docker/Dockerfile.website + context: ./ + port: 3000 + +cpu: 256 +memory: 512 +platform: linux/amd64 +count: 1 +exec: true +network: + connect: true + +environments: + staging: + variables: + NEXTAUTH_URL: https://web.staging.open-assistant.surfacedata.org + +secrets: + DATABASE_URL: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/DATABASE_URL + DISCORD_CLIENT_ID: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/DISCORD_CLIENT_ID + DISCORD_CLIENT_SECRET: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/DISCORD_CLIENT_SECRET + EMAIL_SERVER_HOST: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/EMAIL_SERVER_HOST + EMAIL_SERVER_PASSWORD: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/EMAIL_SERVER_PASSWORD + EMAIL_SERVER_PORT: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/EMAIL_SERVER_PORT + EMAIL_SERVER_USER: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/EMAIL_SERVER_USER + EMAIL_FROM: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/EMAIL_FROM + FASTAPI_KEY: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/FASTAPI_KEY + FASTAPI_URL: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/FASTAPI_URL + NEXTAUTH_SECRET: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/NEXTAUTH_SECRET diff --git a/website/package-lock.json b/website/package-lock.json index 45063104..19a32f1b 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -31,6 +31,7 @@ "react": "18.2.0", "react-dom": "18.2.0", "react-icons": "^4.7.1", + "sharp": "^0.31.3", "swr": "^2.0.0", "tailwindcss": "^3.2.4", "use-debounce": "^9.0.2" @@ -2739,6 +2740,25 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -2747,6 +2767,16 @@ "node": ">=8" } }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -2794,6 +2824,29 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, "node_modules/call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", @@ -2889,6 +2942,11 @@ "node": ">= 6" } }, + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" + }, "node_modules/client-only": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", @@ -2902,6 +2960,18 @@ "node": ">=6" } }, + "node_modules/color": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "dependencies": { + "color-convert": "^2.0.1", + "color-string": "^1.9.0" + }, + "engines": { + "node": ">=12.5.0" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -2918,6 +2988,15 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, + "node_modules/color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, "node_modules/color2k": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/color2k/-/color2k-2.0.0.tgz", @@ -3048,6 +3127,28 @@ } } }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "engines": { + "node": ">=4.0.0" + } + }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -3092,6 +3193,14 @@ "node": ">=0.4.0" } }, + "node_modules/detect-libc": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", + "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", + "engines": { + "node": ">=8" + } + }, "node_modules/detect-node-es": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/detect-node-es/-/detect-node-es-1.1.0.tgz", @@ -3155,6 +3264,14 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dependencies": { + "once": "^1.4.0" + } + }, "node_modules/enhanced-resolve": { "version": "5.12.0", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz", @@ -3687,6 +3804,14 @@ "node": ">=0.10.0" } }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "engines": { + "node": ">=6" + } + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -3891,6 +4016,11 @@ "tslib": "^2.1.0" } }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -3992,6 +4122,11 @@ "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" } }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==" + }, "node_modules/glob": { "version": "7.1.7", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", @@ -4162,6 +4297,25 @@ "react-is": "^16.7.0" } }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/ignore": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.1.tgz", @@ -4207,6 +4361,11 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, "node_modules/internal-slot": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.4.tgz", @@ -4667,6 +4826,17 @@ "node": ">= 0.6" } }, + "node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/mini-svg-data-uri": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/mini-svg-data-uri/-/mini-svg-data-uri-1.4.4.tgz", @@ -4694,6 +4864,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -4710,6 +4885,11 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/napi-build-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", + "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -4796,6 +4976,22 @@ } } }, + "node_modules/node-abi": { + "version": "3.30.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.30.0.tgz", + "integrity": "sha512-qWO5l3SCqbwQavymOmtTVuCWZE23++S+rxyoHjXqUmPyzRcaoI4lA2gO55/drddGnedAyjA7sk76SfQ5lfUMnw==", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-addon-api": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.0.0.tgz", + "integrity": "sha512-CvkDw2OEnme7ybCykJpVcKH+uAOLV2qLqiyla128dN9TkEWfrYmxG6C2boDe5KcNQqZF3orkqzGgOMvZ/JNekA==" + }, "node_modules/node-releases": { "version": "2.0.8", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.8.tgz", @@ -5292,6 +5488,31 @@ "preact": ">=10" } }, + "node_modules/prebuild-install": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz", + "integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==", + "dependencies": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -5352,6 +5573,15 @@ "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, "node_modules/punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -5390,6 +5620,28 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/rc/node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/react": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", @@ -5539,6 +5791,19 @@ "pify": "^2.3.0" } }, + "node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -5651,6 +5916,25 @@ "queue-microtask": "^1.2.2" } }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/safe-regex-test": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", @@ -5686,6 +5970,28 @@ "node": ">=10" } }, + "node_modules/sharp": { + "version": "0.31.3", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.31.3.tgz", + "integrity": "sha512-XcR4+FCLBFKw1bdB+GEhnUNXNXvnt0tDo4WsBsraKymuo/IAuPuCBVAL2wIkUw2r/dwFW5Q5+g66Kwl2dgDFVg==", + "hasInstallScript": true, + "dependencies": { + "color": "^4.2.3", + "detect-libc": "^2.0.1", + "node-addon-api": "^5.0.0", + "prebuild-install": "^7.1.1", + "semver": "^7.3.8", + "simple-get": "^4.0.1", + "tar-fs": "^2.1.1", + "tunnel-agent": "^0.6.0" + }, + "engines": { + "node": ">=14.15.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -5718,6 +6024,62 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "node_modules/simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "dependencies": { + "is-arrayish": "^0.3.1" + } + }, + "node_modules/simple-swizzle/node_modules/is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" + }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -5742,6 +6104,14 @@ "node": ">=0.10.0" } }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, "node_modules/string.prototype.matchall": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.8.tgz", @@ -5982,6 +6352,32 @@ "node": ">=6" } }, + "node_modules/tar-fs": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", + "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -6060,6 +6456,17 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -8256,11 +8663,26 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, "binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==" }, + "bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "requires": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -8289,6 +8711,15 @@ "update-browserslist-db": "^1.0.9" } }, + "buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, "call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", @@ -8347,6 +8778,11 @@ } } }, + "chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" + }, "client-only": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", @@ -8357,6 +8793,15 @@ "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz", "integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==" }, + "color": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "requires": { + "color-convert": "^2.0.1", + "color-string": "^1.9.0" + } + }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -8370,6 +8815,15 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, + "color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "requires": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, "color2k": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/color2k/-/color2k-2.0.0.tgz", @@ -8469,6 +8923,19 @@ "ms": "2.1.2" } }, + "decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "requires": { + "mimic-response": "^3.1.0" + } + }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" + }, "deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -8498,6 +8965,11 @@ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" }, + "detect-libc": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", + "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==" + }, "detect-node-es": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/detect-node-es/-/detect-node-es-1.1.0.tgz", @@ -8549,6 +9021,14 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "requires": { + "once": "^1.4.0" + } + }, "enhanced-resolve": { "version": "5.12.0", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz", @@ -8946,6 +9426,11 @@ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" }, + "expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==" + }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -9100,6 +9585,11 @@ "tslib": "^2.1.0" } }, + "fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -9167,6 +9657,11 @@ "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.2.0.tgz", "integrity": "sha512-X8u8fREiYOE6S8hLbq99PeykTDoLVnxvF4DjWKJmz9xy2nNRdUcV8ZN9tniJFeKyTU3qnC9lL8n4Chd6LmVKHg==" }, + "github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==" + }, "glob": { "version": "7.1.7", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", @@ -9289,6 +9784,11 @@ "react-is": "^16.7.0" } }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + }, "ignore": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.1.tgz", @@ -9322,6 +9822,11 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, "internal-slot": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.4.tgz", @@ -9640,6 +10145,11 @@ "mime-db": "1.52.0" } }, + "mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==" + }, "mini-svg-data-uri": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/mini-svg-data-uri/-/mini-svg-data-uri-1.4.4.tgz", @@ -9658,6 +10168,11 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==" }, + "mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -9668,6 +10183,11 @@ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==" }, + "napi-build-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", + "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" + }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -9714,6 +10234,19 @@ "uuid": "^8.3.2" } }, + "node-abi": { + "version": "3.30.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.30.0.tgz", + "integrity": "sha512-qWO5l3SCqbwQavymOmtTVuCWZE23++S+rxyoHjXqUmPyzRcaoI4lA2gO55/drddGnedAyjA7sk76SfQ5lfUMnw==", + "requires": { + "semver": "^7.3.5" + } + }, + "node-addon-api": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.0.0.tgz", + "integrity": "sha512-CvkDw2OEnme7ybCykJpVcKH+uAOLV2qLqiyla128dN9TkEWfrYmxG6C2boDe5KcNQqZF3orkqzGgOMvZ/JNekA==" + }, "node-releases": { "version": "2.0.8", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.8.tgz", @@ -10032,6 +10565,25 @@ "pretty-format": "^3.8.0" } }, + "prebuild-install": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz", + "integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==", + "requires": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + } + }, "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -10072,6 +10624,15 @@ "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -10087,6 +10648,24 @@ "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==" }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==" + } + } + }, "react": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", @@ -10180,6 +10759,16 @@ "pify": "^2.3.0" } }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, "readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -10244,6 +10833,11 @@ "queue-microtask": "^1.2.2" } }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, "safe-regex-test": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", @@ -10270,6 +10864,21 @@ "lru-cache": "^6.0.0" } }, + "sharp": { + "version": "0.31.3", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.31.3.tgz", + "integrity": "sha512-XcR4+FCLBFKw1bdB+GEhnUNXNXvnt0tDo4WsBsraKymuo/IAuPuCBVAL2wIkUw2r/dwFW5Q5+g66Kwl2dgDFVg==", + "requires": { + "color": "^4.2.3", + "detect-libc": "^2.0.1", + "node-addon-api": "^5.0.0", + "prebuild-install": "^7.1.1", + "semver": "^7.3.8", + "simple-get": "^4.0.1", + "tar-fs": "^2.1.1", + "tunnel-agent": "^0.6.0" + } + }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -10293,6 +10902,36 @@ "object-inspect": "^1.9.0" } }, + "simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==" + }, + "simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "requires": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "requires": { + "is-arrayish": "^0.3.1" + }, + "dependencies": { + "is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" + } + } + }, "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -10308,6 +10947,14 @@ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==" }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } + }, "string.prototype.matchall": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.8.tgz", @@ -10465,6 +11112,29 @@ "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==" }, + "tar-fs": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", + "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "requires": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "requires": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + } + }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -10533,6 +11203,14 @@ } } }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, "type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", diff --git a/website/package.json b/website/package.json index bfec87c7..7fa59848 100644 --- a/website/package.json +++ b/website/package.json @@ -33,6 +33,7 @@ "react": "18.2.0", "react-dom": "18.2.0", "react-icons": "^4.7.1", + "sharp": "^0.31.3", "swr": "^2.0.0", "tailwindcss": "^3.2.4", "use-debounce": "^9.0.2" diff --git a/website/prisma/migrations/20221215064332_initialized/migration.sql b/website/prisma/migrations/20221215064332_initialized/migration.sql deleted file mode 100644 index 7ae4196d..00000000 --- a/website/prisma/migrations/20221215064332_initialized/migration.sql +++ /dev/null @@ -1,66 +0,0 @@ --- CreateTable -CREATE TABLE "Account" ( - "id" TEXT NOT NULL, - "userId" TEXT NOT NULL, - "type" TEXT NOT NULL, - "provider" TEXT NOT NULL, - "providerAccountId" TEXT NOT NULL, - "refresh_token" TEXT, - "access_token" TEXT, - "expires_at" INTEGER, - "token_type" TEXT, - "scope" TEXT, - "id_token" TEXT, - "session_state" TEXT, - - CONSTRAINT "Account_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Session" ( - "id" TEXT NOT NULL, - "sessionToken" TEXT NOT NULL, - "userId" TEXT NOT NULL, - "expires" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "Session_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "User" ( - "id" TEXT NOT NULL, - "name" TEXT, - "email" TEXT, - "emailVerified" TIMESTAMP(3), - "image" TEXT, - - CONSTRAINT "User_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "VerificationToken" ( - "identifier" TEXT NOT NULL, - "token" TEXT NOT NULL, - "expires" TIMESTAMP(3) NOT NULL -); - --- CreateIndex -CREATE UNIQUE INDEX "Account_provider_providerAccountId_key" ON "Account"("provider", "providerAccountId"); - --- CreateIndex -CREATE UNIQUE INDEX "Session_sessionToken_key" ON "Session"("sessionToken"); - --- CreateIndex -CREATE UNIQUE INDEX "User_email_key" ON "User"("email"); - --- CreateIndex -CREATE UNIQUE INDEX "VerificationToken_token_key" ON "VerificationToken"("token"); - --- CreateIndex -CREATE UNIQUE INDEX "VerificationToken_identifier_token_key" ON "VerificationToken"("identifier", "token"); - --- AddForeignKey -ALTER TABLE "Account" ADD CONSTRAINT "Account_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Session" ADD CONSTRAINT "Session_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/website/prisma/migrations/20221215101838_record_labeler_id/migration.sql b/website/prisma/migrations/20221215101838_record_labeler_id/migration.sql deleted file mode 100644 index acbdbf8d..00000000 --- a/website/prisma/migrations/20221215101838_record_labeler_id/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- AlterTable -ALTER TABLE "User" ADD COLUMN "labelerId" INTEGER; diff --git a/website/prisma/migrations/migration_lock.toml b/website/prisma/migrations/migration_lock.toml deleted file mode 100644 index 99e4f200..00000000 --- a/website/prisma/migrations/migration_lock.toml +++ /dev/null @@ -1,3 +0,0 @@ -# Please do not edit this file manually -# It should be added in your version-control system (i.e. Git) -provider = "postgresql" diff --git a/website/src/pages/auth/signup.tsx b/website/src/pages/auth/signup.tsx index 4afc3102..4c890fcd 100644 --- a/website/src/pages/auth/signup.tsx +++ b/website/src/pages/auth/signup.tsx @@ -1,18 +1,25 @@ import { Button, Input, Stack } from "@chakra-ui/react"; import Head from "next/head"; -import { FaDiscord, FaEnvelope, FaGithub } from "react-icons/fa"; +import Link from "next/link"; import { getCsrfToken, getProviders, signIn } from "next-auth/react"; import { useRef } from "react"; -import Link from "next/link"; +import { FaDiscord, FaEnvelope, FaGithub } from "react-icons/fa"; import { AuthLayout } from "src/components/AuthLayout"; export default function Signin({ csrfToken, providers }) { const { discord, email, github } = providers; const emailEl = useRef(null); + + const signinWithDiscord = () => { + signIn(discord.id, { callbackUrl: "/" }); + }; const signinWithEmail = () => { signIn(email.id, { callbackUrl: "/", email: emailEl.current.value }); }; + const signinWithGithub = () => { + signIn(github.id, { callbackUrl: "/" }); + }; return ( <> @@ -25,13 +32,7 @@ export default function Signin({ csrfToken, providers }) { {email && ( - @@ -46,8 +47,7 @@ export default function Signin({ csrfToken, providers }) { size="lg" leftIcon={} color="white" - onClick={() => signIn(discord, { callbackUrl: "/" })} - // isDisabled="false" + onClick={signinWithDiscord} > Continue with Discord @@ -62,7 +62,7 @@ export default function Signin({ csrfToken, providers }) { size={"lg"} leftIcon={} colorScheme="blue" - // isDisabled="false" + onClick={signinWithGithub} > Continue with Github From 24eaed269c4de6e1cce5d744f3910812778aed84 Mon Sep 17 00:00:00 2001 From: Keith Stevens Date: Mon, 26 Dec 2022 13:57:03 +0900 Subject: [PATCH 3/8] Adding description for why skipping some copilot yaml files --- .pre-commit-config.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c388cc43..cc858eea 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,6 +10,10 @@ repos: - id: trailing-whitespace - id: check-ast - id: check-yaml + # Always check YAML but skip a few YAML files that are auto-generated + # and which break the standard YAML check. The alternative would be to + # skip any unsafe errors (and thus break YAML compatibility) or use + # some other checker that may not work in general. exclude: copilot/web/addons/* - id: check-json - id: check-case-conflict From 87342053ea679903d1689fca81c9a9d77862002d Mon Sep 17 00:00:00 2001 From: Keith Stevens Date: Mon, 26 Dec 2022 14:49:47 +0900 Subject: [PATCH 4/8] Adding documentation for how to prep and use copilot for deployment --- copilot/README.md | 93 +++++++++++++++++++ .../open-assistant-main/buildspec.yml | 71 ++++++++++++++ .../open-assistant-main/manifest.yml | 17 ++++ docker/Dockerfile.prisma | 7 ++ 4 files changed, 188 insertions(+) create mode 100644 copilot/README.md create mode 100644 copilot/pipelines/open-assistant-main/buildspec.yml create mode 100644 copilot/pipelines/open-assistant-main/manifest.yml create mode 100644 docker/Dockerfile.prisma diff --git a/copilot/README.md b/copilot/README.md new file mode 100644 index 00000000..b4748c0a --- /dev/null +++ b/copilot/README.md @@ -0,0 +1,93 @@ +# Deploying on AWS + +## Introduction + +[Copilot](https://aws.github.io/copilot-cli/) helps simplify AWS resources and +automate deploymnents for projects. + +This sample configuration runs the Open Assistant web app as an ECS Fargate +services backed by a Serverless Aurora Postgres database. + +## To Setup + +Setup requires a few steps: + +```sh +copilot app init --domain your_domain.tls +``` + +This will initialize and register a variety of URls with your domain. + +```sh +copilot env deploy +``` + +This will create a variety of aws roles and services needed for deployment. + +```sh +copilot deploy +``` + +This will depoy the services but it won't be 100% ready for usage. Before +being ready, we have to inspect the AWS Secrets manager and extract out the +database credentials. Read those credentials then put them, and a few other +secrets, in a `secrets.yml` file like the following: + +```yaml +DATABASE_URL: + staging: postgres://postgres:${db_password}@${db_host}:${db_port}/${db_name} +DISCORD_CLIENT_ID: + staging: ... +DISCORD_CLIENT_SECRET: + staging: ... +EMAIL_SERVER_HOST: + staging: ... +EMAIL_SERVER_PORT: + staging: ... +EMAIL_SERVER_USER: + staging: ... +EMAIL_SERVER_PASSWORD: + staging: ... +EMAIL_FROM: + staging: ... +FASTAPI_URL: + staging: ... +FASTAPI_KEY: + staging: ... +NEXTAUTH_SECRET: + staging: ... +``` + +Then, upload the secrets to AWS with: + +```sh +copilot secret init --cli-input-yaml secrets.yml +``` + +Now, finally deploy: + +```sh +copilot deploy +``` + +If we documented everything correctly, the site should work properly. + +## To Update Manually + +First, make sure the database is updated with any schema changes: + +```sh +copilot task run \ + --app open-assistant --env staging \ + -n prisma-push \ + --dockerfile docker/Dockerfile.prisma --build-context "./" \ + --secrets DATABASE_URL=/copilot/open-assistant/staging/secrets/DATABASE_URL +``` + +Next, deploy everything: + +```sh +copilot deploy +``` + +TODO: Make this a pipeline once github and aws are fully connected. diff --git a/copilot/pipelines/open-assistant-main/buildspec.yml b/copilot/pipelines/open-assistant-main/buildspec.yml new file mode 100644 index 00000000..e1cab4d5 --- /dev/null +++ b/copilot/pipelines/open-assistant-main/buildspec.yml @@ -0,0 +1,71 @@ +# Buildspec runs in the build stage of your pipeline. +version: 0.2 +phases: + install: + runtime-versions: + docker: 19 + ruby: 2.6 + commands: + - echo "cd into $CODEBUILD_SRC_DIR" + - cd $CODEBUILD_SRC_DIR + # Download the copilot linux binary. + - wget -q https://ecs-cli-v2-release.s3.amazonaws.com/copilot-linux-v1.24.0 + - mv ./copilot-linux-v1.24.0 ./copilot-linux + - chmod +x ./copilot-linux + build: + commands: + - echo "Run your tests" + # - make test + post_build: + commands: + - ls -l + - export COLOR="false" + - pipeline=$(cat $CODEBUILD_SRC_DIR/copilot/pipelines/open-assistant-main/manifest.yml | ruby -ryaml -rjson -e 'puts JSON.pretty_generate(YAML.load(ARGF))') + - pl_envs=$(echo $pipeline | jq -r '.stages[].name') + # Find all the local services in the workspace. + - svc_ls_result=$(./copilot-linux svc ls --local --json) + - svc_list=$(echo $svc_ls_result | jq '.services') + - > + if [ ! "$svc_list" = null ]; then + svcs=$(echo $svc_ls_result | jq -r '.services[].name'); + fi + # Find all the local jobs in the workspace. + - job_ls_result=$(./copilot-linux job ls --local --json) + - job_list=$(echo $job_ls_result | jq '.jobs') + - > + if [ ! "$job_list" = null ]; then + jobs=$(echo $job_ls_result | jq -r '.jobs[].name'); + fi + # Raise error if no services or jobs are found. + - > + if [ "$svc_list" = null ] && [ "$job_list" = null ]; then + echo "No services or jobs found for the pipeline to deploy. Please create at least one service or job and push the manifest to the remote." 1>&2; + exit 1; + fi + # Generate the cloudformation templates. + # The tag is the build ID but we replaced the colon ':' with a dash '-'. + # We truncate the tag (from the front) to 128 characters, the limit for Docker tags + # (https://docs.docker.com/engine/reference/commandline/tag/) + # Check if the `svc package` commanded exited with a non-zero status. If so, echo error msg and exit. + - > + for env in $pl_envs; do + tag=$(echo ${CODEBUILD_BUILD_ID##*:}-$env | sed 's/:/-/g' | rev | cut -c 1-128 | rev) + for svc in $svcs; do + ./copilot-linux svc package -n $svc -e $env --output-dir './infrastructure' --tag $tag --upload-assets; + if [ $? -ne 0 ]; then + echo "Cloudformation stack and config files were not generated. Please check build logs to see if there was a manifest validation error." 1>&2; + exit 1; + fi + done; + for job in $jobs; do + ./copilot-linux job package -n $job -e $env --output-dir './infrastructure' --tag $tag --upload-assets; + if [ $? -ne 0 ]; then + echo "Cloudformation stack and config files were not generated. Please check build logs to see if there was a manifest validation error." 1>&2; + exit 1; + fi + done; + done; + - ls -lah ./infrastructure +artifacts: + files: + - "infrastructure/*" diff --git a/copilot/pipelines/open-assistant-main/manifest.yml b/copilot/pipelines/open-assistant-main/manifest.yml new file mode 100644 index 00000000..25be4c75 --- /dev/null +++ b/copilot/pipelines/open-assistant-main/manifest.yml @@ -0,0 +1,17 @@ +# The manifest for the "open-assistant-main" pipeline. +# This YAML file defines your pipeline: the source repository it tracks and the order of the environments to deploy to. +# For more info: https://aws.github.io/copilot-cli/docs/manifest/pipeline/ + +name: open-assistant-main + +version: 1 + +source: + provider: GitHub + properties: + branch: 24-web-deploy-aws + repository: https://github.com/LAION-AI/Open-Assistant + +stages: + - name: staging + test_commands: [npx prisma db push --schema website/prisma/schema.prisma] diff --git a/docker/Dockerfile.prisma b/docker/Dockerfile.prisma new file mode 100644 index 00000000..b6a0def0 --- /dev/null +++ b/docker/Dockerfile.prisma @@ -0,0 +1,7 @@ +FROM --platform=linux/amd64 node:16.18.0 AS runner + +WORKDIR /app + +COPY ./website/ . + +CMD ["npx", "prisma", "db", "push"] From 911872986ccef96c223a49a375632d7b5d57b286 Mon Sep 17 00:00:00 2001 From: Keith Stevens Date: Mon, 26 Dec 2022 14:50:47 +0900 Subject: [PATCH 5/8] Removing the not-yet-ready-pipelines --- .../open-assistant-main/buildspec.yml | 71 ------------------- .../open-assistant-main/manifest.yml | 17 ----- 2 files changed, 88 deletions(-) delete mode 100644 copilot/pipelines/open-assistant-main/buildspec.yml delete mode 100644 copilot/pipelines/open-assistant-main/manifest.yml diff --git a/copilot/pipelines/open-assistant-main/buildspec.yml b/copilot/pipelines/open-assistant-main/buildspec.yml deleted file mode 100644 index e1cab4d5..00000000 --- a/copilot/pipelines/open-assistant-main/buildspec.yml +++ /dev/null @@ -1,71 +0,0 @@ -# Buildspec runs in the build stage of your pipeline. -version: 0.2 -phases: - install: - runtime-versions: - docker: 19 - ruby: 2.6 - commands: - - echo "cd into $CODEBUILD_SRC_DIR" - - cd $CODEBUILD_SRC_DIR - # Download the copilot linux binary. - - wget -q https://ecs-cli-v2-release.s3.amazonaws.com/copilot-linux-v1.24.0 - - mv ./copilot-linux-v1.24.0 ./copilot-linux - - chmod +x ./copilot-linux - build: - commands: - - echo "Run your tests" - # - make test - post_build: - commands: - - ls -l - - export COLOR="false" - - pipeline=$(cat $CODEBUILD_SRC_DIR/copilot/pipelines/open-assistant-main/manifest.yml | ruby -ryaml -rjson -e 'puts JSON.pretty_generate(YAML.load(ARGF))') - - pl_envs=$(echo $pipeline | jq -r '.stages[].name') - # Find all the local services in the workspace. - - svc_ls_result=$(./copilot-linux svc ls --local --json) - - svc_list=$(echo $svc_ls_result | jq '.services') - - > - if [ ! "$svc_list" = null ]; then - svcs=$(echo $svc_ls_result | jq -r '.services[].name'); - fi - # Find all the local jobs in the workspace. - - job_ls_result=$(./copilot-linux job ls --local --json) - - job_list=$(echo $job_ls_result | jq '.jobs') - - > - if [ ! "$job_list" = null ]; then - jobs=$(echo $job_ls_result | jq -r '.jobs[].name'); - fi - # Raise error if no services or jobs are found. - - > - if [ "$svc_list" = null ] && [ "$job_list" = null ]; then - echo "No services or jobs found for the pipeline to deploy. Please create at least one service or job and push the manifest to the remote." 1>&2; - exit 1; - fi - # Generate the cloudformation templates. - # The tag is the build ID but we replaced the colon ':' with a dash '-'. - # We truncate the tag (from the front) to 128 characters, the limit for Docker tags - # (https://docs.docker.com/engine/reference/commandline/tag/) - # Check if the `svc package` commanded exited with a non-zero status. If so, echo error msg and exit. - - > - for env in $pl_envs; do - tag=$(echo ${CODEBUILD_BUILD_ID##*:}-$env | sed 's/:/-/g' | rev | cut -c 1-128 | rev) - for svc in $svcs; do - ./copilot-linux svc package -n $svc -e $env --output-dir './infrastructure' --tag $tag --upload-assets; - if [ $? -ne 0 ]; then - echo "Cloudformation stack and config files were not generated. Please check build logs to see if there was a manifest validation error." 1>&2; - exit 1; - fi - done; - for job in $jobs; do - ./copilot-linux job package -n $job -e $env --output-dir './infrastructure' --tag $tag --upload-assets; - if [ $? -ne 0 ]; then - echo "Cloudformation stack and config files were not generated. Please check build logs to see if there was a manifest validation error." 1>&2; - exit 1; - fi - done; - done; - - ls -lah ./infrastructure -artifacts: - files: - - "infrastructure/*" diff --git a/copilot/pipelines/open-assistant-main/manifest.yml b/copilot/pipelines/open-assistant-main/manifest.yml deleted file mode 100644 index 25be4c75..00000000 --- a/copilot/pipelines/open-assistant-main/manifest.yml +++ /dev/null @@ -1,17 +0,0 @@ -# The manifest for the "open-assistant-main" pipeline. -# This YAML file defines your pipeline: the source repository it tracks and the order of the environments to deploy to. -# For more info: https://aws.github.io/copilot-cli/docs/manifest/pipeline/ - -name: open-assistant-main - -version: 1 - -source: - provider: GitHub - properties: - branch: 24-web-deploy-aws - repository: https://github.com/LAION-AI/Open-Assistant - -stages: - - name: staging - test_commands: [npx prisma db push --schema website/prisma/schema.prisma] From cfa5e444821b2e5506fdc1cf265f181efb077be4 Mon Sep 17 00:00:00 2001 From: Keith Stevens Date: Mon, 26 Dec 2022 14:55:55 +0900 Subject: [PATCH 6/8] Adding some helpful documentation --- docker/Dockerfile.prisma | 3 +++ docker/Dockerfile.website | 3 +++ 2 files changed, 6 insertions(+) diff --git a/docker/Dockerfile.prisma b/docker/Dockerfile.prisma index b6a0def0..63d6f5e2 100644 --- a/docker/Dockerfile.prisma +++ b/docker/Dockerfile.prisma @@ -1,3 +1,6 @@ +# This docker file will update the web database with schema changes. Later it +# will be updated to do prisma migrations. + FROM --platform=linux/amd64 node:16.18.0 AS runner WORKDIR /app diff --git a/docker/Dockerfile.website b/docker/Dockerfile.website index a9a677bc..56e55039 100644 --- a/docker/Dockerfile.website +++ b/docker/Dockerfile.website @@ -1,3 +1,6 @@ +# Note: node:16.18.0 works most reliably when using different platforms (namely +# Mac M1) and avoids recent Prisma docker bugs that lead to segfaults. + # Install dependencies only when needed FROM node:16.18.0 AS deps WORKDIR /app From c6cb38ba0dabc91507d949b96f6478013f902c83 Mon Sep 17 00:00:00 2001 From: Keith Stevens Date: Tue, 27 Dec 2022 07:49:24 +0900 Subject: [PATCH 7/8] Enhancing the readme --- copilot/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/copilot/README.md b/copilot/README.md index b4748c0a..406490fa 100644 --- a/copilot/README.md +++ b/copilot/README.md @@ -13,10 +13,11 @@ services backed by a Serverless Aurora Postgres database. Setup requires a few steps: ```sh -copilot app init --domain your_domain.tls +copilot app init --domain your_domain.com ``` -This will initialize and register a variety of URls with your domain. +This will initialize and register a variety of URLs with your +`your_domain.com`. Replace with a proper domain to setup SSL certificates. ```sh copilot env deploy From f3ef32c26b11e720eaf44fd154dbd6afc52bbd44 Mon Sep 17 00:00:00 2001 From: Keith Stevens Date: Wed, 28 Dec 2022 08:07:34 +0900 Subject: [PATCH 8/8] fixing whitespace on signup page --- website/src/pages/auth/signup.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/src/pages/auth/signup.tsx b/website/src/pages/auth/signup.tsx index e34fcd05..31ee25d6 100644 --- a/website/src/pages/auth/signup.tsx +++ b/website/src/pages/auth/signup.tsx @@ -16,12 +16,12 @@ export default function Signin({ csrfToken, providers }) { const signinWithDiscord = () => { signIn(discord.id, { callbackUrl: "/" }); }; - + const signinWithEmail = (ev: React.FormEvent) => { ev.preventDefault(); signIn(email.id, { callbackUrl: "/", email: emailEl.current.value }); }; - + const signinWithGithub = () => { signIn(github.id, { callbackUrl: "/" }); };