Scheduling infrastructure for absolutely everyone.
Formatting
zomarsdbfc1477aa52
diff --git a/README.md b/README.mdindex 7197a8db766..29c19e40b01 100644--- a/README.md+++ b/README.md@@ -285,9 +285,8 @@ You can deploy Cal on [Railway](https://railway.app/) using the button above. Th<!-- ROADMAP -->## Roadmap-- <a href="https://cal.com/roadmap"><img src="https://user-images.githubusercontent.com/8019099/176388295-25081ca4-207e-4468-8079-37b195fa8e59.png" alt="Cal.com Roadmap" /></a>+<a href="https://cal.com/roadmap"><img src="https://user-images.githubusercontent.com/8019099/176388295-25081ca4-207e-4468-8079-37b195fa8e59.png" alt="Cal.com Roadmap" /></a>See the [roadmap project](https://cal.com/roadmap) for a list of proposed features (and known issues). You can change the view to see planned tagged releases.diff --git a/SECURITY.md b/SECURITY.mdindex 45e909fe464..734a6f4e6d7 100644--- a/SECURITY.md+++ b/SECURITY.md@@ -1,4 +1,5 @@# Security+Contact: [email protected]Based on [https://supabase.com/.well-known/security.txt](https://supabase.com/.well-known/security.txt)@@ -9,30 +10,30 @@ If you discover a vulnerability, we would like to know about it so we can take s## Out of scope vulnerabilities:-* Clickjacking on pages with no sensitive actions.-* Unauthenticated/logout/login CSRF.-* Attacks requiring MITM or physical access to a user's device.-* Any activity that could lead to the disruption of our service (DoS).-* Content spoofing and text injection issues without showing an attack vector/without being able to modify HTML/CSS.-* Email spoofing-* Missing DNSSEC, CAA, CSP headers-* Lack of Secure or HTTP only flag on non-sensitive cookies-* Deadlinks+- Clickjacking on pages with no sensitive actions.+- Unauthenticated/logout/login CSRF.+- Attacks requiring MITM or physical access to a user's device.+- Any activity that could lead to the disruption of our service (DoS).+- Content spoofing and text injection issues without showing an attack vector/without being able to modify HTML/CSS.+- Email spoofing+- Missing DNSSEC, CAA, CSP headers+- Lack of Secure or HTTP only flag on non-sensitive cookies+- Deadlinks## Please do the following:-* E-mail your findings to [[email protected]](mailto:[email protected]).-* Do not run automated scanners on our infrastructure or dashboard. If you wish to do this, contact us and we will set up a sandbox for you.-* Do not take advantage of the vulnerability or problem you have discovered, for example by downloading more data than necessary to demonstrate the vulnerability or deleting or modifying other people's data,-* Do not reveal the problem to others until it has been resolved,-* Do not use attacks on physical security, social engineering, distributed denial of service, spam or applications of third parties,-* Do provide sufficient information to reproduce the problem, so we will be able to resolve it as quickly as possible. Usually, the IP address or the URL of the affected system and a description of the vulnerability will be sufficient, but complex vulnerabilities may require further explanation.+- E-mail your findings to [[email protected]](mailto:[email protected]).+- Do not run automated scanners on our infrastructure or dashboard. If you wish to do this, contact us and we will set up a sandbox for you.+- Do not take advantage of the vulnerability or problem you have discovered, for example by downloading more data than necessary to demonstrate the vulnerability or deleting or modifying other people's data,+- Do not reveal the problem to others until it has been resolved,+- Do not use attacks on physical security, social engineering, distributed denial of service, spam or applications of third parties,+- Do provide sufficient information to reproduce the problem, so we will be able to resolve it as quickly as possible. Usually, the IP address or the URL of the affected system and a description of the vulnerability will be sufficient, but complex vulnerabilities may require further explanation.## What we promise:-* We will respond to your report within 3 business days with our evaluation of the report and an expected resolution date,-* If you have followed the instructions above, we will not take any legal action against you in regard to the report,-* We will handle your report with strict confidentiality, and not pass on your personal details to third parties without your permission,-* We will keep you informed of the progress towards resolving the problem,-* In the public information concerning the problem reported, we will give your name as the discoverer of the problem (unless you desire otherwise), and-* We strive to resolve all problems as quickly as possible, and we would like to play an active role in the ultimate publication on the problem after it is resolved.+- We will respond to your report within 3 business days with our evaluation of the report and an expected resolution date,+- If you have followed the instructions above, we will not take any legal action against you in regard to the report,+- We will handle your report with strict confidentiality, and not pass on your personal details to third parties without your permission,+- We will keep you informed of the progress towards resolving the problem,+- In the public information concerning the problem reported, we will give your name as the discoverer of the problem (unless you desire otherwise), and+- We strive to resolve all problems as quickly as possible, and we would like to play an active role in the ultimate publication on the problem after it is resolved.diff --git a/package.json b/package.jsonindex 1f2e12512c3..588299e2b83 100644--- a/package.json+++ b/package.json@@ -29,6 +29,7 @@"format": "prettier --write \"**/*.{ts,tsx,md}\"","heroku-postbuild": "turbo run @calcom/web#build","lint": "turbo run lint",+ "lint:fix": "turbo run lint:fix","lint:report": "turbo run lint:report","postinstall": "turbo run post-install","pre-commit": "lint-staged",diff --git a/packages/app-store/slackmessaging/lib/actions/createEvent.ts b/packages/app-store/slackmessaging/lib/actions/createEvent.tsindex a6f952daeb5..7b5ff97b5dd 100644--- a/packages/app-store/slackmessaging/lib/actions/createEvent.ts+++ b/packages/app-store/slackmessaging/lib/actions/createEvent.ts@@ -1,8 +1,8 @@import { WebClient } from "@slack/web-api";-import dayjs from "@calcom/dayjs";import { NextApiRequest, NextApiResponse } from "next";import { z } from "zod";+import dayjs from "@calcom/dayjs";import { WEBAPP_URL } from "@calcom/lib/constants";import db from "@calcom/prisma";import type { BookingCreateBody } from "@calcom/prisma/zod-utils";diff --git a/packages/app-store/slackmessaging/lib/showTodayMessage.ts b/packages/app-store/slackmessaging/lib/showTodayMessage.tsindex 83517e7b9ac..b7e2eb32e42 100644--- a/packages/app-store/slackmessaging/lib/showTodayMessage.ts+++ b/packages/app-store/slackmessaging/lib/showTodayMessage.ts@@ -1,7 +1,7 @@import { BookingStatus } from "@prisma/client";-import dayjs from "@calcom/dayjs";import { NextApiRequest, NextApiResponse } from "next";+import dayjs from "@calcom/dayjs";import prisma from "@calcom/prisma";import { WhereCredsEqualsId } from "./WhereCredsEqualsID";diff --git a/packages/app-store/slackmessaging/lib/slackVerify.ts b/packages/app-store/slackmessaging/lib/slackVerify.tsindex f7915f5e4aa..8079db0223a 100644--- a/packages/app-store/slackmessaging/lib/slackVerify.ts+++ b/packages/app-store/slackmessaging/lib/slackVerify.ts@@ -1,8 +1,9 @@import { createHmac } from "crypto";-import dayjs from "@calcom/dayjs";import { NextApiRequest, NextApiResponse } from "next";import { stringify } from "querystring";+import dayjs from "@calcom/dayjs";+import { getSlackAppKeys } from "./utils";export default async function slackVerify(req: NextApiRequest, res: NextApiResponse) {diff --git a/packages/app-store/slackmessaging/lib/views/ShowLinks.ts b/packages/app-store/slackmessaging/lib/views/ShowLinks.tsindex 1d59c90bf49..7f44db94438 100644--- a/packages/app-store/slackmessaging/lib/views/ShowLinks.ts+++ b/packages/app-store/slackmessaging/lib/views/ShowLinks.ts@@ -1,6 +1,6 @@-import dayjs from "@calcom/dayjs";import { Blocks, Elements, Message } from "slack-block-builder";+import dayjs from "@calcom/dayjs";import { WEBAPP_URL } from "@calcom/lib/constants";interface IEventTypes {diff --git a/packages/app-store/slackmessaging/lib/views/TodayMessage.ts b/packages/app-store/slackmessaging/lib/views/TodayMessage.tsindex 90c8f4101c7..9fe52c0a371 100644--- a/packages/app-store/slackmessaging/lib/views/TodayMessage.ts+++ b/packages/app-store/slackmessaging/lib/views/TodayMessage.ts@@ -1,7 +1,7 @@import { Booking } from "@prisma/client";-import dayjs from "@calcom/dayjs";import { Blocks, Elements, Message } from "slack-block-builder";+import dayjs from "@calcom/dayjs";import { WEBAPP_URL } from "@calcom/lib/constants";const TodayMessage = (bookings: Booking[]) => {diff --git a/packages/app-store/vital/api/webhook.ts b/packages/app-store/vital/api/webhook.tsindex 4af3461f166..6592c2a79eb 100644--- a/packages/app-store/vital/api/webhook.ts+++ b/packages/app-store/vital/api/webhook.ts@@ -1,8 +1,8 @@import { BookingStatus, Prisma } from "@prisma/client";-import dayjs from "@calcom/dayjs";import type { NextApiRequest, NextApiResponse } from "next";import queue from "queue";+import dayjs from "@calcom/dayjs";import { IS_PRODUCTION } from "@calcom/lib/constants";import { getErrorFromUnknown } from "@calcom/lib/errors";import { HttpError as HttpCode } from "@calcom/lib/http-error";diff --git a/packages/app-store/vital/lib/reschedule.ts b/packages/app-store/vital/lib/reschedule.tsindex efd306972b0..2ec90964afc 100644--- a/packages/app-store/vital/lib/reschedule.ts+++ b/packages/app-store/vital/lib/reschedule.ts@@ -1,11 +1,11 @@import { Booking, BookingReference, BookingStatus, User } from "@prisma/client";-import dayjs from "@calcom/dayjs";import type { TFunction } from "next-i18next";import EventManager from "@calcom/core/EventManager";import { CalendarEventBuilder } from "@calcom/core/builders/CalendarEvent/builder";import { CalendarEventDirector } from "@calcom/core/builders/CalendarEvent/director";import { deleteMeeting } from "@calcom/core/videoClient";+import dayjs from "@calcom/dayjs";import { sendRequestRescheduleEmail } from "@calcom/emails";import logger from "@calcom/lib/logger";import { getTranslation } from "@calcom/lib/server/i18n";diff --git a/packages/app-store/wipemycalother/components/confirmDialog.tsx b/packages/app-store/wipemycalother/components/confirmDialog.tsxindex fd586c5ca13..f5b6d464111 100644--- a/packages/app-store/wipemycalother/components/confirmDialog.tsx+++ b/packages/app-store/wipemycalother/components/confirmDialog.tsx@@ -1,9 +1,9 @@import { ClockIcon, XIcon } from "@heroicons/react/outline";-import dayjs from "@calcom/dayjs";import { Dispatch, SetStateAction } from "react";import { useState } from "react";import { useMutation } from "react-query";+import dayjs from "@calcom/dayjs";import { useLocale } from "@calcom/lib/hooks/useLocale";import logger from "@calcom/lib/logger";import showToast from "@calcom/lib/notification";diff --git a/packages/app-store/wipemycalother/lib/reschedule.ts b/packages/app-store/wipemycalother/lib/reschedule.tsindex 23cbc23384e..8ffb389f04e 100644--- a/packages/app-store/wipemycalother/lib/reschedule.ts+++ b/packages/app-store/wipemycalother/lib/reschedule.ts@@ -1,11 +1,11 @@import { Booking, BookingReference, BookingStatus, User } from "@prisma/client";-import dayjs from "@calcom/dayjs";import type { TFunction } from "next-i18next";import EventManager from "@calcom/core/EventManager";import { CalendarEventBuilder } from "@calcom/core/builders/CalendarEvent/builder";import { CalendarEventDirector } from "@calcom/core/builders/CalendarEvent/director";import { deleteMeeting } from "@calcom/core/videoClient";+import dayjs from "@calcom/dayjs";import { sendRequestRescheduleEmail } from "@calcom/emails";import logger from "@calcom/lib/logger";import { getTranslation } from "@calcom/lib/server/i18n";diff --git a/packages/ee/lib/core/checkPremiumUsername.ts b/packages/ee/lib/core/checkPremiumUsername.tsindex cf32fd8b814..2d2a015a2a0 100644--- a/packages/ee/lib/core/checkPremiumUsername.ts+++ b/packages/ee/lib/core/checkPremiumUsername.ts@@ -1,5 +1,5 @@-import slugify from "@calcom/lib/slugify";import { WEBSITE_URL } from "@calcom/lib/constants";+import slugify from "@calcom/lib/slugify";interface ResponseUsernameApi {available: boolean;@@ -10,7 +10,7 @@ interface ResponseUsernameApi {export async function checkPremiumUsername(_username: string): Promise<ResponseUsernameApi> {const username = slugify(_username);- const response = await fetch(`${ WEBSITE_URL }/api/username`, {+ const response = await fetch(`${WEBSITE_URL}/api/username`, {credentials: "include",headers: {"Content-Type": "application/json",diff --git a/packages/lib/constants.ts b/packages/lib/constants.tsindex 8000a43d7ab..ae9fc198236 100644--- a/packages/lib/constants.ts+++ b/packages/lib/constants.ts@@ -2,10 +2,7 @@ const VERCEL_URL = process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}`const RAILWAY_STATIC_URL = process.env.RAILWAY_STATIC_URL ? `https://${process.env.RAILWAY_STATIC_URL}` : "";const HEROKU_URL = process.env.HEROKU_APP_NAME ? `https://${process.env.HEROKU_APP_NAME}.herokuapp.com` : "";export const WEBAPP_URL =- process.env.NEXT_PUBLIC_WEBAPP_URL ||- VERCEL_URL ||- RAILWAY_STATIC_URL ||- HEROKU_URL;+ process.env.NEXT_PUBLIC_WEBAPP_URL || VERCEL_URL || RAILWAY_STATIC_URL || HEROKU_URL;/** @deprecated use `WEBAPP_URL` */export const BASE_URL = WEBAPP_URL;export const WEBSITE_URL = process.env.NEXT_PUBLIC_WEBSITE_URL || "https://cal.com";diff --git a/turbo.json b/turbo.jsonindex 2f6019b706e..da28ca3d9bf 100644--- a/turbo.json+++ b/turbo.json@@ -99,6 +99,10 @@"cache": false,"outputs": []},+ "lint:fix": {+ "cache": false,+ "outputs": []+ },"lint:report": {"cache": false,"outputs": ["lint-results"]