Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
feat: Add documentation for S3 config creation + new release (v0.3.1-alpha.25)
Richie McIlroy353790900026
diff --git a/apps/desktop/src-tauri/src/lib.rs b/apps/desktop/src-tauri/src/lib.rsindex 94f790452..8d122be09 100644--- a/apps/desktop/src-tauri/src/lib.rs+++ b/apps/desktop/src-tauri/src/lib.rs@@ -1431,49 +1431,82 @@ struct RecordingMetaChanged {#[tauri::command(async)]#[specta::specta]-fn get_recording_meta(app: AppHandle, id: String, file_type: String) -> RecordingMeta {+fn get_recording_meta(+ app: AppHandle,+ id: String,+ file_type: String,+) -> Result<RecordingMeta, String> {let meta_path = match file_type.as_str() {"recording" => recording_path(&app, &id),"screenshot" => screenshot_path(&app, &id),- _ => panic!("Invalid file type: {}", file_type),+ _ => return Err("Invalid file type".to_string()),};- RecordingMeta::load_for_project(&meta_path).unwrap()+ RecordingMeta::load_for_project(&meta_path)+ .map_err(|e| format!("Failed to load recording meta: {}", e))}+#[tauri::command]#[specta::specta]fn list_recordings(app: AppHandle) -> Result<Vec<(String, PathBuf, RecordingMeta)>, String> {let recordings_dir = recordings_path(&app);+ // First check if directory exists+ if !recordings_dir.exists() {+ return Ok(Vec::new());+ }+let mut result = std::fs::read_dir(&recordings_dir).map_err(|e| format!("Failed to read recordings directory: {}", e))?.filter_map(|entry| {- let entry = entry.ok()?;+ let entry = match entry {+ Ok(e) => e,+ Err(_) => return None,+ };+let path = entry.path();- if path.is_dir() && path.extension().and_then(|s| s.to_str()) == Some("cap") {- let id = path.file_stem()?.to_str()?.to_string();- let meta = get_recording_meta(app.clone(), id.clone(), "recording".to_string());- Some((id, path.clone(), meta))- } else {- None++ // Multiple validation checks+ if !path.is_dir() {+ return None;+ }++ let extension = match path.extension().and_then(|s| s.to_str()) {+ Some("cap") => "cap",+ _ => return None,+ };++ let id = match path.file_stem().and_then(|s| s.to_str()) {+ Some(stem) => stem.to_string(),+ None => return None,+ };++ // Try to get recording meta, skip if it fails+ match get_recording_meta(app.clone(), id.clone(), "recording".to_string()) {+ Ok(meta) => Some((id, path.clone(), meta)),+ Err(_) => None,}}).collect::<Vec<_>>();// Sort the result by creation date of the actual file, newest firstresult.sort_by(|a, b| {- b.1.metadata()- .and_then(|m| m.created())- .unwrap_or(std::time::SystemTime::UNIX_EPOCH)- .cmp(- &a.1.metadata()- .and_then(|m| m.created())- .unwrap_or(std::time::SystemTime::UNIX_EPOCH),- )+ let b_time =+ b.1.metadata()+ .and_then(|m| m.created())+ .unwrap_or(std::time::SystemTime::UNIX_EPOCH);++ let a_time =+ a.1.metadata()+ .and_then(|m| m.created())+ .unwrap_or(std::time::SystemTime::UNIX_EPOCH);++ b_time.cmp(&a_time)});Ok(result)}+#[tauri::command]#[specta::specta]fn list_screenshots(app: AppHandle) -> Result<Vec<(String, PathBuf, RecordingMeta)>, String> {@@ -1486,7 +1519,11 @@ fn list_screenshots(app: AppHandle) -> Result<Vec<(String, PathBuf, RecordingMetlet path = entry.path();if path.is_dir() && path.extension().and_then(|s| s.to_str()) == Some("cap") {let id = path.file_stem()?.to_str()?.to_string();- let meta = get_recording_meta(app.clone(), id.clone(), "screenshot".to_string());+ let meta =+ match get_recording_meta(app.clone(), id.clone(), "screenshot".to_string()) {+ Ok(meta) => meta,+ Err(_) => return None, // Skip this entry if metadata can't be loaded+ };// Find the nearest .png file inside the .cap folderlet png_path = std::fs::read_dir(&path)@@ -2006,24 +2043,26 @@ pub async fn run() {.run(|handle, event| match event {#[cfg(target_os = "macos")]tauri::RunEvent::Reopen { .. } => {- // Check if any editor window is open- let has_editor = handle+ // Check if any editor or settings window is open+ let has_editor_or_settings = handle.webview_windows().iter()- .any(|(label, _)| label.starts_with("editor-"));+ .any(|(label, _)| label.starts_with("editor-") || label.as_str() == "settings");- if has_editor {- // Find and focus the editor window- if let Some(editor_window) = handle+ if has_editor_or_settings {+ // Find and focus the editor or settings window+ if let Some(window) = handle.webview_windows().iter()- .find(|(label, _)| label.starts_with("editor-"))+ .find(|(label, _)| {+ label.starts_with("editor-") || label.as_str() == "settings"+ }).map(|(_, window)| window.clone()){- editor_window.set_focus().ok();+ window.set_focus().ok();}} else {- // No editor window open, show main window+ // No editor or settings window open, show main windowopen_main_window(handle.clone());}}@@ -2096,7 +2135,9 @@ async fn create_editor_instance_impl(app: &AppHandle, video_id: String) -> Arc<E// use EditorInstance.project_path instead of thisfn recordings_path(app: &AppHandle) -> PathBuf {- app.path().app_data_dir().unwrap().join("recordings")+ let path = app.path().app_data_dir().unwrap().join("recordings");+ std::fs::create_dir_all(&path).unwrap_or_default();+ path}fn recording_path(app: &AppHandle, recording_id: &str) -> PathBuf {@@ -2104,7 +2145,9 @@ fn recording_path(app: &AppHandle, recording_id: &str) -> PathBuf {}fn screenshots_path(app: &AppHandle) -> PathBuf {- app.path().app_data_dir().unwrap().join("screenshots")+ let path = app.path().app_data_dir().unwrap().join("screenshots");+ std::fs::create_dir_all(&path).unwrap_or_default();+ path}fn screenshot_path(app: &AppHandle, screenshot_id: &str) -> PathBuf {diff --git a/apps/desktop/src/routes/(window-chrome)/settings/apps/s3-config.tsx b/apps/desktop/src/routes/(window-chrome)/settings/apps/s3-config.tsxindex ac0dbe2a6..76d78920c 100644--- a/apps/desktop/src/routes/(window-chrome)/settings/apps/s3-config.tsx+++ b/apps/desktop/src/routes/(window-chrome)/settings/apps/s3-config.tsx@@ -38,6 +38,7 @@ export default function S3ConfigPage() {const [loading, setLoading] = createSignal(true);const [deleting, setDeleting] = createSignal(false);const [hasConfig, setHasConfig] = createSignal(false);+ const [testing, setTesting] = createSignal(false);const resetForm = () => {setProvider(DEFAULT_CONFIG.provider);@@ -182,6 +183,66 @@ export default function S3ConfigPage() {}};+ const handleTest = async () => {+ setTesting(true);+ try {+ const controller = new AbortController();+ const timeoutId = setTimeout(() => controller.abort(), 5500); // 5.5s timeout (slightly longer than backend)++ const response = await makeAuthenticatedRequest(+ "/api/desktop/s3/config/test",+ {+ method: "POST",+ headers: {+ "Content-Type": "application/json",+ },+ body: JSON.stringify({+ provider: provider(),+ accessKeyId: accessKeyId(),+ secretAccessKey: secretAccessKey(),+ endpoint: endpoint(),+ bucketName: bucketName(),+ region: region(),+ }),+ signal: controller.signal,+ }+ );++ clearTimeout(timeoutId);++ if (response) {+ await commands.globalMessageDialog(+ "S3 configuration test successful! Connection is working."+ );+ }+ } catch (error) {+ console.error("Failed to test S3 config:", error);+ let errorMessage =+ "Failed to connect to S3. Please check your settings and try again.";++ if (error instanceof Error) {+ if (error.name === "AbortError") {+ errorMessage =+ "Connection test timed out after 5 seconds. Please check your endpoint URL and network connection.";+ } else if ("response" in error) {+ try {+ const errorResponse = (error as { response: Response }).response;+ const errorData = await errorResponse.json();+ if (errorData?.error) {+ errorMessage = errorData.error;+ }+ } catch (e) {+ // If we can't parse the error response, use the default message+ }+ }+ }++ await commands.globalMessageDialog(errorMessage);+ } finally {+ setTesting(false);+ }+ };+const renderInput = (label: string,value: () => string,@@ -294,36 +355,60 @@ export default function S3ConfigPage() {</div><div class="flex-shrink-0 p-4 border-t">- <div- class={`flex ${- hasConfig() ? "justify-between" : "justify-end"- } items-center`}- >- {hasConfig() && (+ <div class="flex justify-between items-center">+ <div class="flex gap-2">+ {hasConfig() && (+ <Button+ variant="destructive"+ onClick={handleDelete}+ disabled={deleting() || loading() || saving() || testing()}+ class={+ deleting() || loading() || saving() || testing()+ ? "opacity-50 cursor-not-allowed"+ : ""+ }+ >+ {deleting() ? "Removing..." : "Remove Config"}+ </Button>+ )}<Button- variant="destructive"- onClick={handleDelete}- disabled={deleting() || loading() || saving()}+ variant="secondary"+ onClick={handleTest}+ disabled={+ saving() ||+ loading() ||+ deleting() ||+ testing() ||+ !accessKeyId() ||+ !secretAccessKey() ||+ !bucketName()+ }class={- deleting() || loading() || saving()+ saving() ||+ loading() ||+ deleting() ||+ testing() ||+ !accessKeyId() ||+ !secretAccessKey() ||+ !bucketName()? "opacity-50 cursor-not-allowed": ""}>- {deleting() ? "Removing..." : "Remove Config"}+ {testing() ? "Testing..." : "Test Connection"}</Button>- )}+ </div><Buttonvariant="primary"onClick={handleSave}- disabled={saving() || loading() || deleting()}+ disabled={saving() || loading() || deleting() || testing()}class={- saving() || loading() || deleting()+ saving() || loading() || deleting() || testing()? "opacity-50 cursor-not-allowed": ""}>- {saving() ? "Exporting..." : "Export"}+ {saving() ? "Saving..." : "Save"}</Button></div></div>diff --git a/apps/desktop/src/routes/(window-chrome)/settings/recordings.tsx b/apps/desktop/src/routes/(window-chrome)/settings/recordings.tsxindex f61416f95..7441fb176 100644--- a/apps/desktop/src/routes/(window-chrome)/settings/recordings.tsx+++ b/apps/desktop/src/routes/(window-chrome)/settings/recordings.tsx@@ -2,7 +2,7 @@ import { createQuery } from "@tanstack/solid-query";import { For, Show, Suspense, createSignal } from "solid-js";import { convertFileSrc } from "@tauri-apps/api/core";-import { commands, events } from "~/utils/tauri";+import { commands, events, type RecordingMeta } from "~/utils/tauri";type MediaEntry = {id: string;@@ -18,10 +18,7 @@ export default function Recordings() {queryFn: async () => {const result = await commands.listRecordings()- .catch(- () =>- Promise.resolve([]) as ReturnType<typeof commands.listRecordings>- );+ .catch(() => [] as [string, string, RecordingMeta][]);const recordings = await Promise.all(result.map(async (file) => {@@ -62,7 +59,9 @@ export default function Recordings() {<Showwhen={fetchRecordings.data && fetchRecordings.data.length > 0}fallback={- <p class="text-center text-[--text-tertiary]">No recordings found</p>+ <p class="text-center text-[--text-tertiary]">+ No recordings found+ </p>}><For each={fetchRecordings.data}>diff --git a/apps/desktop/src/routes/prev-recordings.tsx b/apps/desktop/src/routes/prev-recordings.tsxindex 07060ccdb..52308fd00 100644--- a/apps/desktop/src/routes/prev-recordings.tsx+++ b/apps/desktop/src/routes/prev-recordings.tsx@@ -521,7 +521,7 @@ export default function () {if (!save.isPending) save.reset();}, 2000);- return "Saved!";+ return "Exported!";}}</Match></Switch>@@ -771,7 +771,7 @@ function createRecordingMutations(renderProgress: 0,totalFrames: 0,message: isRecording- ? "Choose where to save video..."+ ? "Choose where to export video...": "Choose where to save image...",mediaPath: media.path,stage: "rendering",@@ -861,7 +861,7 @@ function createRecordingMutations(progress: 100,renderProgress: 100,totalFrames: 100,- message: "Saved successfully!",+ message: "Exported successfully!",mediaPath: media.path,stage: "rendering",});diff --git a/apps/web/app/api/desktop/s3/config/test/route.ts b/apps/web/app/api/desktop/s3/config/test/route.tsnew file mode 100644index 000000000..2d441c589--- /dev/null+++ b/apps/web/app/api/desktop/s3/config/test/route.ts@@ -0,0 +1,132 @@+import { type NextRequest } from "next/server";+import { getCurrentUser } from "@cap/database/auth/session";+import { cookies } from "next/headers";+import { S3Client, HeadBucketCommand } from "@aws-sdk/client-s3";++const TIMEOUT_MS = 5000; // 5 second timeout++export async function POST(request: NextRequest) {+ try {+ const token = request.headers.get("authorization")?.split(" ")[1];+ if (token) {+ cookies().set({+ name: "next-auth.session-token",+ value: token,+ path: "/",+ sameSite: "none",+ secure: true,+ httpOnly: true,+ });+ }++ const user = await getCurrentUser();+ const origin = request.headers.get("origin") as string;++ if (!user) {+ return new Response(JSON.stringify({ error: "Unauthorized" }), {+ status: 401,+ headers: {+ "Access-Control-Allow-Origin": origin,+ "Access-Control-Allow-Credentials": "true",+ },+ });+ }++ const data = await request.json();++ // Create an AbortController with timeout+ const controller = new AbortController();+ const timeoutId = setTimeout(() => controller.abort(), TIMEOUT_MS);++ const s3Client = new S3Client({+ endpoint: data.endpoint,+ region: data.region,+ credentials: {+ accessKeyId: data.accessKeyId,+ secretAccessKey: data.secretAccessKey,+ },+ forcePathStyle: true,+ requestHandler: {+ abortSignal: controller.signal+ }+ });++ try {+ // Test the connection by trying to access the bucket+ await s3Client.send(+ new HeadBucketCommand({+ Bucket: data.bucketName,+ })+ );++ clearTimeout(timeoutId);+ } catch (error) {+ clearTimeout(timeoutId);+ let errorMessage = "Failed to connect to S3";++ if (error instanceof Error) {+ if (error.name === "AbortError" || error.name === "TimeoutError") {+ errorMessage = "Connection timed out after 5 seconds. Please check the endpoint URL and your network connection.";+ } else if (error.name === "NoSuchBucket") {+ errorMessage = `Bucket '${data.bucketName}' does not exist`;+ } else if (error.name === "NetworkingError") {+ errorMessage = "Network error. Please check the endpoint URL and your network connection.";+ } else if (error.name === "InvalidAccessKeyId") {+ errorMessage = "Invalid Access Key ID";+ } else if (error.name === "SignatureDoesNotMatch") {+ errorMessage = "Invalid Secret Access Key";+ } else if (error.name === "AccessDenied") {+ errorMessage = "Access denied. Please check your credentials and bucket permissions.";+ }+ }++ return new Response(+ JSON.stringify({+ error: errorMessage,+ details: error instanceof Error ? error.message : String(error)+ }),+ {+ status: 500,+ headers: {+ "Access-Control-Allow-Origin": origin,+ "Access-Control-Allow-Credentials": "true",+ },+ }+ );+ }++ return new Response(JSON.stringify({ success: true }), {+ headers: {+ "Access-Control-Allow-Origin": origin,+ "Access-Control-Allow-Credentials": "true",+ },+ });+ } catch (error) {+ console.error("Error testing S3 config:", error);+ return new Response(+ JSON.stringify({+ error: "Failed to connect to S3",+ details: error instanceof Error ? error.message : String(error)+ }),+ {+ status: 500,+ headers: {+ "Access-Control-Allow-Origin": request.headers.get("origin") as string,+ "Access-Control-Allow-Credentials": "true",+ },+ }+ );+ }+}++export async function OPTIONS(request: NextRequest) {+ return new Response(null, {+ status: 200,+ headers: {+ "Access-Control-Allow-Origin": request.headers.get("origin") as string,+ "Access-Control-Allow-Methods": "POST, OPTIONS",+ "Access-Control-Allow-Headers": "Content-Type, Authorization",+ "Access-Control-Allow-Credentials": "true",+ },+ });+}\ No newline at end of filediff --git a/apps/web/app/docs/[slug]/page.tsx b/apps/web/app/docs/[slug]/page.tsxnew file mode 100644index 000000000..ecc4a8d0e--- /dev/null+++ b/apps/web/app/docs/[slug]/page.tsx@@ -0,0 +1,80 @@+import { notFound } from "next/navigation";+import Image from "next/image";+import { MDXRemote } from "next-mdx-remote/rsc";+import { getDocs } from "@/utils/updates";+import type { Metadata } from "next";++interface DocProps {+ params: {+ slug: string;+ };+}++export async function generateMetadata({+ params,+}: DocProps): Promise<Metadata | undefined> {+ let doc = getDocs().find((doc) => doc.slug === params.slug);+ if (!doc) {+ return;+ }++ let { title, summary: description, image } = doc.metadata;+ let ogImage = image ? `${process.env.NEXT_PUBLIC_URL}${image}` : undefined;++ return {+ title,+ description,+ openGraph: {+ title,+ description,+ type: "article",+ url: `${process.env.NEXT_PUBLIC_URL}/docs/${doc.slug}`,+ ...(ogImage && {+ images: [+ {+ url: ogImage,+ },+ ],+ }),+ },+ twitter: {+ card: "summary_large_image",+ title,+ description,+ ...(ogImage && { images: [ogImage] }),+ },+ };+}++export default async function DocPage({ params }: DocProps) {+ const doc = getDocs().find((doc) => doc.slug === params.slug);++ if (!doc) {+ notFound();+ }++ return (+ <article className="py-8 prose mx-auto">+ {doc.metadata.image && (+ <div className="relative mb-12 h-[345px] w-full">+ <Image+ className="m-0 w-full rounded-lg object-contain sm:object-cover"+ src={doc.metadata.image}+ alt={doc.metadata.title}+ fill+ priority+ sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw"+ />+ </div>+ )}++ <div className="wrapper">+ <header>+ <h1 className="mb-2">{doc.metadata.title}</h1>+ </header>+ <hr className="my-6" />+ <MDXRemote source={doc.content} />+ </div>+ </article>+ );+}diff --git a/apps/web/app/docs/_components/DocPage.tsx b/apps/web/app/docs/_components/DocPage.tsxnew file mode 100644index 000000000..4dbeb94d8--- /dev/null+++ b/apps/web/app/docs/_components/DocPage.tsx@@ -0,0 +1,36 @@+"use client";++import Image from "next/image";+import { MDXRemote } from "next-mdx-remote/rsc";+import { getDocs } from "@/utils/updates";++export const DocPage = ({ docSlug }: { docSlug: string }) => {+ const doc = getDocs().find((doc) => doc.slug === docSlug);++ if (!doc) {+ return null;+ }++ return (+ <article className="py-8 prose mx-auto">+ {doc.metadata.image && (+ <div className="relative mb-12 h-[345px] w-full">+ <Image+ className="m-0 w-full rounded-lg object-cover"+ src={doc.metadata.image}+ alt={doc.metadata.title}+ fill+ priority+ sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw"+ />+ </div>+ )}++ <header>+ <h1 className="mb-2">{doc.metadata.title}</h1>+ </header>+ <hr className="my-6" />+ <MDXRemote source={doc.content} />+ </article>+ );+};diff --git a/apps/web/app/docs/page.tsx b/apps/web/app/docs/page.tsxnew file mode 100644index 000000000..c895f0c43--- /dev/null+++ b/apps/web/app/docs/page.tsx@@ -0,0 +1,10 @@+import { DocsPage } from "@/components/pages/DocsPage";+import { Metadata } from "next";++export const metadata: Metadata = {+ title: "Documentation — Cap",+};++export default function App() {+ return <DocsPage />;+}diff --git a/apps/web/app/globals.css b/apps/web/app/globals.cssindex e6ec2a486..fd11c26af 100644--- a/apps/web/app/globals.css+++ b/apps/web/app/globals.css@@ -79,6 +79,11 @@ html {@apply max-w-5xl;}+.prose :where(blockquote p:first-of-type):not(:where([class~="not-prose"],[class~="not-prose"] *))::before {+ content: "“" !important;+ display: none;+}+*,*:before,*:after {diff --git a/apps/web/components/Footer.tsx b/apps/web/components/Footer.tsxindex 821d9952b..7c4b44da2 100644--- a/apps/web/components/Footer.tsx+++ b/apps/web/components/Footer.tsx@@ -51,6 +51,9 @@ export const Footer = () => {<li><a href="/updates">Updates</a></li>+ <li>+ <a href="/docs">Docs</a>+ </li><li><a href="/pricing">Pricing</a></li>diff --git a/apps/web/components/Navbar.tsx b/apps/web/components/Navbar.tsxindex 627b9c706..60f47ca92 100644--- a/apps/web/components/Navbar.tsx+++ b/apps/web/components/Navbar.tsx@@ -139,6 +139,9 @@ export const Navbar = ({ auth }: { auth: boolean }) => {</NavigationMenuTrigger><NavigationMenuContent><ul className="grid gap-3 p-6 md:w-[400px] lg:w-[500px] lg:grid-cols-[.75fr_1fr]">+ <ListItem href="/docs" title="Documentation">+ Documentation for using Cap.+ </ListItem><ListItem href="/faq" title="FAQs">Frequently asked questions about Cap.</ListItem>diff --git a/apps/web/components/pages/DocsPage.tsx b/apps/web/components/pages/DocsPage.tsxnew file mode 100644index 000000000..efb301db5--- /dev/null+++ b/apps/web/components/pages/DocsPage.tsx@@ -0,0 +1,57 @@+import Link from "next/link";+import Image from "next/image";+import { getDocs } from "@/utils/updates";++export const DocsPage = () => {+ const allDocs = getDocs();++ return (+ <div className="wrapper wrapper-sm py-20">+ <div className="text-center page-intro mb-14">+ <h1>Documentation</h1>+ </div>+ <div className="grid grid-cols-1 md:grid-cols-2 gap-8">+ <div className="space-y-8">+ {allDocs.map((doc) => (+ <article+ key={doc.slug}+ className="w-full rounded-xl overflow-hidden border"+ >+ <Link href={"/docs/" + doc.slug}>+ {doc.metadata.image && (+ <div className="w-full border-b">+ <Image+ src={doc.metadata.image}+ width={900}+ height={400}+ objectFit="cover"+ alt={doc.metadata.title}+ className="w-full h-auto"+ />+ </div>+ )}+ <div className="p-10 space-y-4">+ <h2 className="text-xl md:text-4xl text-gray-500">+ {doc.metadata.title}+ </h2>+ <p className="text-gray-600">{doc.metadata.summary}</p>+ <div className="flex space-x-2">+ {doc.metadata.tags &&+ doc.metadata.tags.split(", ").map((tag) => (+ <p+ key={tag}+ className="rounded-md bg-gray-200 font-medium px-2 py-0.5 text-sm text-gray-500"+ >+ {tag}+ </p>+ ))}+ </div>+ </div>+ </Link>+ </article>+ ))}+ </div>+ </div>+ </div>+ );+};diff --git a/apps/web/content/changelog/20.mdx b/apps/web/content/changelog/20.mdxnew file mode 100644index 000000000..f6434d364--- /dev/null+++ b/apps/web/content/changelog/20.mdx@@ -0,0 +1,11 @@+---+title: Test S3 Config connection, misc changes+app: Cap Desktop+publishedAt: "2024-11-28"+version: 0.3.1-alpha.25+image:+---++- New "Test Connection" button in S3 Config app+- Updated "Save" button to "Export" in previous recording thumbnails+- Fixed issue with Previous Recordings window in Settings\ No newline at end of filediff --git a/apps/web/content/docs/s3-config.mdx b/apps/web/content/docs/s3-config.mdxnew file mode 100644index 000000000..df9f43e4e--- /dev/null+++ b/apps/web/content/docs/s3-config.mdx@@ -0,0 +1,160 @@+---+title: "Cap Apps: S3 Config (AWS)"+summary: "Connect your own S3 bucket to Cap and maintain 100% ownership over your data."+tags: "Cap Apps"+image: "/docs/s3-config.jpg"+---++# Connecting Your Amazon S3 Bucket to Cap Desktop++> **TL;DR**: Open Cap Desktop → Cap Apps → S3 Config → Configure → Select Amazon S3 → Enter your AWS credentials → Configure bucket permissions → Save and test with a shareable link upload.+>+> **Note**: While this guide focuses on AWS S3, Cap supports any S3-compatible storage service (like MinIO, DigitalOcean Spaces, or Backblaze B2). The setup process is similar - you'll just need the appropriate endpoint URL and credentials from your provider.++## Step 1: Launch Cap Desktop and Access Cap Apps++1. **Open the Cap Desktop App**: Click the Cap icon on your desktop or find it in your applications folder to launch the app.++2. **Navigate to Cap Apps**: Once the app is open, locate the 'Cap Apps' tab in Settings.++## Step 2: Click on S3 Config, and then Configure++1. Click on S3 config++2. Click on Configure++3. Select Amazon S3 from the list of available services.++## Step 3: Configure AWS Resources++1. **Create S3 Bucket First**:++ - Log into the [AWS Management Console](https://console.aws.amazon.com)+ - Navigate to S3+ - Click "Create bucket"+ - Enter a unique bucket name (e.g., "my-cap-uploads")+ - Choose your preferred AWS Region+ - Under "Object Ownership", select "ACLs disabled"+ - Under "Block Public Access settings", keep "Block all public access" enabled (recommended)+ - Under "Bucket Versioning", select "Disable"+ - Under "Default encryption", enable "Server-side encryption with Amazon S3 managed keys (SSE-S3)"+ - Enable "Bucket Key"+ - Keep all other settings as default+ - Click "Create bucket" at the bottom of the page++2. **Create IAM Policy**:++ - Go to IAM in AWS Console+ - Click "Policies" → "Create policy"+ - Switch to the JSON editor+ - Replace `BUCKET_NAME` with your bucket name and paste:++ ```json+ {+ "Version": "2012-10-17",+ "Statement": [+ {+ "Effect": "Allow",+ "Action": [+ "s3:PutObject",+ "s3:GetObject",+ "s3:ListBucket",+ "s3:PutObjectAcl"+ ],+ "Resource": ["arn:aws:s3:::BUCKET_NAME", "arn:aws:s3:::BUCKET_NAME/*"]+ }+ ]+ }+ ```++ - Click "Next"+ - Name the policy "CapAppS3Access"+ - Add tags if desired+ - Click "Create policy"++3. **Create IAM User**:++ - Still in IAM, click "Users" → "Create user"+ - Set username as "cap-app-user"+ - Click "Next"+ - Choose "Attach policies directly"+ - Search for and select the "CapAppS3Access" policy you just created+ - Click through to review+ - Create the user+ - After creation, click on the username "cap-app-user" to open user details+ - Scroll down to "Security credentials" section+ - Click "Create access key"+ - Choose "Application running outside AWS"+ - Click "Next"+ - (Optional) Add a description tag+ - Click "Create access key"+ - **IMPORTANT**: Save both the Access Key ID and Secret Access Key immediately - you won't be able to see the Secret Access Key again!+ - Click "Done"++4. **Configure Bucket Policy**:++ - Return to your S3 bucket+ - Go to "Permissions" tab+ - Click "Edit" under "Bucket policy"+ - Add this policy (replace `BUCKET_NAME` and `YOUR_ACCOUNT_ID`):++ ```json+ {+ "Version": "2012-10-17",+ "Statement": [+ {+ "Sid": "CapDesktopAppAccess",+ "Effect": "Allow",+ "Principal": {+ "AWS": "arn:aws:iam::YOUR_ACCOUNT_ID:user/cap-app-user"+ },+ "Action": ["s3:PutObject", "s3:GetObject", "s3:ListBucket"],+ "Resource": ["arn:aws:s3:::BUCKET_NAME", "arn:aws:s3:::BUCKET_NAME/*"]+ }+ ]+ }+ ```++5. **Configure CORS Settings**:++ - In the same "Permissions" tab, scroll down to "Cross-origin resource sharing (CORS)"+ - Click "Edit"+ - Add the following CORS configuration:++ ```json+ [+ {+ "AllowedHeaders": ["*"],+ "AllowedMethods": ["GET", "HEAD", "PUT"],+ "AllowedOrigins": [+ "https://cap.so",+ "https://www.cap.so",+ "https://cap.link",+ "https://www.cap.link"+ ],+ "ExposeHeaders": [],+ "MaxAgeSeconds": 3000+ }+ ]+ ```++ - Click "Save changes"++## Step 4: Configure Cap Desktop++1. Open Cap Desktop and navigate to S3 Config+2. Enter the following details:+ - Access Key ID (from IAM user creation)+ - Secret Access Key (from IAM user creation)+ - Endpoint (you can most likely keep this as default)+ - Bucket Name: Your bucket name+ - Region: Your bucket's region (e.g., us-east-1)++## Step 5: Test and Save the Connection++1. Test the Connection: Click on the 'Test Connection' button to verify that Cap can successfully connect to your S3 bucket.+2. Save the Configuration: If the test is successful, save the connection settings. Your Amazon S3 bucket is now integrated with Cap Desktop.++## Accessing Your S3 Files in Cap++Once the connection is established and you have saved your configuration, all new shareable links you create will serve images and videos directly from your configured S3 bucket, giving you full control over your content delivery and storage.diff --git a/apps/web/content/guides/cap-public-beta-launch.mdx b/apps/web/content/guides/cap-public-beta-launch.mdxnew file mode 100644index 000000000..fd80957c1--- /dev/null+++ b/apps/web/content/guides/cap-public-beta-launch.mdx@@ -0,0 +1,55 @@+---+title: Cap Public Beta Release+description: After 6 long months of development, Cap has officially launched in public beta.+publishedAt: "2024-04-25"+category: Release+image: /updates/cap-beta-release.jpg+author: Richie McIlroy+tags: News, Updates, Release+---++After six months of development, I am proud to announce that Cap has officially launched in public beta.++This launch marks the beginning of an exciting journey, and your feedback is more important than ever.++The goal isn't to just create a Loom alternative, but to build the world's best screen recording and sharing tool.++Through the power of community and open source, we'll get there.++**Let's dive into what you can currently do with Cap...**++Right now, you can use Cap in two different ways. Either via the browser app, or the macOS app. They work fairly similarly, although the browser app currently has more functionality. The macOS app is built with [Tauri](https://tauri.app/), and we're working towards future releases for Windows and Linux.++With either the browser or macOS app, you select your recording options (webcam, screen, microphone), you record your video, and then on recording stop you'll receive your Cap link. With your Cap link, you're able to receive comments and reactions, and view the analytics data from sharing it.++## Cap Browser App++You can access the Cap browser app on any desktop computer (Windows, Linux, macOS). This is the easiest way to get started with Cap, and requires no download. You can record your entire screen or just a specific window or tab, with your webcam overlayed. It's also very easy to resize and change the position of it in your recording.++++## Cap macOS App++It's still very early days for the macOS app, but after a bunch of testing, the app is now stable enough to reliably take screen recordings of your desktop. Right now you can only record the entire screen, but more options are coming soon, as well as Windows and Linux releases. If you'd like to contribute to the Windows release, we are always looking for more [contributors](https://github.com/CapSoftware/Cap).++++## Upcoming Features++- Automatic transcription (releasing very soon)+- Custom scenes (branded videos, automatic zoom)+- Video editing+- Cap AI (generated description, title, etc)+- Password protected videos+- Custom domains+- Embeddable videos+- API access+- Team sharing++Cap is still a little rough around the edges in some areas, but I'm working day and night to ship regular updates.++Please feel free to send me as much feedback as you like. My inbox is always open.++This is just the beginning.++[@richiemcilroy](https://twitter.com/richiemcilroy) - Founder of Capdiff --git a/apps/web/content/guides/cap-v03-launch.mdx b/apps/web/content/guides/cap-v03-launch.mdxnew file mode 100644index 000000000..0b258a5d0--- /dev/null+++ b/apps/web/content/guides/cap-v03-launch.mdx@@ -0,0 +1,66 @@+---+title: Cap v0.3.0 - A New Direction+description: 4 months ago I announced Cap's public beta launch, and today I'm excited to announce Cap v0.3.0. A brand new, reimagined version of Cap.+publishedAt: "2024-09-28"+category: Release+image: /updates/cap-v3-announce.jpg+author: Richie McIlroy+tags: News, Updates, Release+---++Hey everyone,++It's been four months since we launched Cap's public beta, and I'm excited to announce the release of Cap v0.3.0. This is a completely new version of Cap, rebuilt from the ground up based on your feedback and our vision for the future.++## What's New in v0.3.0?++We've rebuilt the entire app from the ground up, focusing on+what matters most: making screen recording and sharing as effortless and powerful as possible.++### 1. Video Editing++One of the biggest additions is the ability to edit your recordings. You can now trim and completely customise your recordings with custom padding, backgrounds and more. We've worked hard to make these features intuitive and easy to use, even if you've never edited a video before.++### 2. Local-First Approach++We've shifted to a local-first approach, prioritising your privacy and speed. Your recordings and edits now happen locally, giving you full control and faster performance.++### 3. Improved User Interface++We've refined the Cap interface to make it even more user-friendly. The new design is clean, modern, and focuses on what matters most - creating and sharing great videos.++### 4. Quick Sharing++Sharing your recordings is now even easier. Once you're happy with your video, you can get a shareable link with just one click.++### 5. Screenshots++We've added a new feature that allows you to take screenshots of your desktop. Just like sharing screen recordings, you can easily share your screenshots with a single click.++## What's Coming Next?++We're not stopping here. We're already working on some exciting features for future releases:++- Cap AI (for generating descriptions and titles)+- Password protected videos+- Custom domains+- Embeddable videos+- Team sharing (Slack, Discord integrations, etc)+- Screenshot editor+- Automatic zoom / pan to focus++## Your Feedback is Crucial++Cap is open source, built with our community in mind, and your input is invaluable. I'd love to hear what you think about v0.3.0 and what you'd like to see in future updates. Join the [Cap Discord](https://discord.gg/y8gdQ3WRN3) to chat with me and other users.++## Try Cap v0.3.0 Today++You can download the latest version of Cap at [Cap.so/download](https://cap.so/download). Whether you're creating tutorials, presentations, or just want to share a quick idea, we hope Cap v0.3.0 makes the process smooth and enjoyable.++Thank you for being part of the Cap journey. We're just getting started, and I'm thrilled to have you along for the ride.++As always, feel free to reach out with any thoughts or feedback. My inbox is always open.++Cheers,++Richie McIlroy — Founder of Cap\ No newline at end of filediff --git a/apps/web/public/docs/s3-config.jpg b/apps/web/public/docs/s3-config.jpgnew file mode 100644index 000000000..72d650754Binary files /dev/null and b/apps/web/public/docs/s3-config.jpg differdiff --git a/apps/web/utils/updates.ts b/apps/web/utils/updates.tsindex 853b8a0e2..87ece9cb6 100644--- a/apps/web/utils/updates.ts+++ b/apps/web/utils/updates.ts@@ -10,6 +10,13 @@ export type PostMetadata = {image?: string;};+export type DocMetadata = {+ title: string;+ summary: string;+ tags?: string;+ image?: string;+};+function parseFrontmatter(fileContent: string) {let frontmatterRegex = /---\s*([\s\S]*?)\s*---/;let match = frontmatterRegex.exec(fileContent);@@ -53,3 +60,7 @@ function getMDXData(dir: string) {export function getBlogPosts() {return getMDXData(path.join(process.cwd(), "content/updates"));}++export function getDocs() {+ return getMDXData(path.join(process.cwd(), "content/docs"));+}