diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index bddeffc..4f45164 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -4,6 +4,7 @@ on: push: branches: - master + - main paths: - "docs/**" - ".github/workflows/sync-docs.yml" @@ -23,6 +24,11 @@ jobs: env: DOCS_TOKEN: ${{ secrets.DOCS_SYNC_PAT || secrets.GH_PAT || secrets.GITHUB_TOKEN }} run: | + if [ -z "$DOCS_TOKEN" ]; then + echo "::error::DOCS_SYNC_PAT or GITHUB_TOKEN is not configured." + exit 1 + fi + git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" diff --git a/.github/workflows/wiki-sync.yml b/.github/workflows/wiki-sync.yml deleted file mode 100644 index bc301af..0000000 --- a/.github/workflows/wiki-sync.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Sync Wiki - -on: - push: - branches: - - master - paths: - - "wiki/**" - - ".github/workflows/wiki-sync.yml" - workflow_dispatch: - -permissions: - contents: write - -jobs: - sync-wiki: - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Sync to GitHub Wiki - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - # Clone the wiki repository (fallback if not yet initialized) - git config --global user.name "github-actions[bot]" - git config --global user.email "github-actions[bot]@users.noreply.github.com" - - WIKI_URL="https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.wiki.git" - - if git clone "$WIKI_URL" wiki-repo 2>/dev/null; then - echo "Wiki repo cloned successfully." - cd wiki-repo - rm -rf * - cp -r ../wiki/* . - git add . - if git diff-index --quiet HEAD; then - echo "No wiki changes to commit." - else - git commit -m "docs(wiki): synchronize wiki pages from master [skip ci]" - git push origin master - fi - else - echo "Notice: Wiki repository is not yet initialized on GitHub." - echo "Please visit https://github.com/${{ github.repository }}/wiki and click 'Create the first page' to initialize the wiki repository." - fi diff --git a/README.md b/README.md index 971af42..e7bc19e 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ [![MongoDB](https://img.shields.io/badge/Database-MongoDB-47A248?style=flat-square&logo=mongodb)](https://www.mongodb.com/) [![Tailwind CSS v4](https://img.shields.io/badge/Tailwind-CSS_v4-38B2AC?style=flat-square&logo=tailwind-css)](https://tailwindcss.com/) -[⚑ Quick Start](#-quick-start-1-command) β€’ [πŸš€ Deploy on PaaS](#-1-click-paas-deployment) β€’ [✨ Key Features](#-key-features) β€’ [πŸ“– Documentation](#-documentation--wiki) β€’ [πŸ› οΈ Configuration](#%EF%B8%8F-configuration) +[⚑ Quick Start](#-quick-start-1-command) β€’ [πŸš€ Deploy on PaaS](#-1-click-paas-deployment) β€’ [✨ Key Features](#-key-features) β€’ [πŸ“– Documentation](#-documentation) β€’ [πŸ› οΈ Configuration](#%EF%B8%8F-configuration) @@ -139,10 +139,11 @@ This project follows an automated semantic CI/CD versioning lifecycle directly c --- -## πŸ“– Documentation & Wiki +## πŸ“– Documentation -Detailed guides are available in the [`/docs`](docs/) directory: +Comprehensive guides and interactive documentation are hosted on the **[Documentation Website](https://instagram-saved-posts.app/docs)** and maintained in the [`/docs`](docs/) directory as the single source of truth: +- 🌐 **[Interactive Documentation Website](https://instagram-saved-posts.app/docs)** - πŸ”‘ [How to Get Your Instagram Cookie](docs/getting-started/how-to-get-instagram-cookie.md) - 🐳 [Docker Compose Deployment Guide](docs/deployment/docker-compose.md) - 🟣 [Dokploy Self-Hosting Guide](docs/deployment/dokploy.md) diff --git a/docs/deployment/coolify.md b/docs/deployment/coolify.md index a26d5e0..5cf1825 100644 --- a/docs/deployment/coolify.md +++ b/docs/deployment/coolify.md @@ -17,7 +17,7 @@ description: "Deploy Instagram Saved Posts Tracker on Coolify PaaS with 1-click 3. Select **Docker Compose**. ### Step 2: Paste Configuration -Paste the contents of [`coolify-compose.yml`](../../coolify-compose.yml): +Paste the contents of [`coolify-compose.yml`](https://github.com/gitnasr/Instagram-Saved-Posts/blob/master/coolify-compose.yml): ```yaml version: "3.8" diff --git a/docs/deployment/dokploy.md b/docs/deployment/dokploy.md index b204f8d..d2606cf 100644 --- a/docs/deployment/dokploy.md +++ b/docs/deployment/dokploy.md @@ -17,7 +17,7 @@ description: "Deploy as a multi-service stack with automated Traefik SSL on Dokp 3. Click **Add Service** -> Select **Compose**. ### Step 2: Configure Compose Stack -1. In the Compose Configuration editor, paste the contents of [`dokploy-compose.yml`](../../dokploy-compose.yml): +1. In the Compose Configuration editor, paste the contents of [`dokploy-compose.yml`](https://github.com/gitnasr/Instagram-Saved-Posts/blob/master/dokploy-compose.yml): ```yaml version: "3.8" diff --git a/docs/index.md b/docs/index.md index 1236d70..f2d5b21 100644 --- a/docs/index.md +++ b/docs/index.md @@ -42,8 +42,8 @@ Saved Posts Tracker addresses every one of these problems with a unified, self-h ## Next Steps -- Check out the [Quickstart Guide](/docs/quickstart) to deploy in 5 minutes. -- Learn about the [System Architecture](/docs/architecture). +- Check out the [Quickstart Guide](/docs/getting-started/quickstart) to deploy in 5 minutes. +- Learn about the [System Architecture](/docs/architecture/system-overview). --- ## πŸ—ΊοΈ Documentation Index diff --git a/wiki/Backup-and-Database-Migration.md b/wiki/Backup-and-Database-Migration.md deleted file mode 100644 index 7aba604..0000000 --- a/wiki/Backup-and-Database-Migration.md +++ /dev/null @@ -1,43 +0,0 @@ -# πŸ’Ύ Backup & Database Migration Guide - -This guide covers backing up your MongoDB database, restoring data, and migrating your InstaSave instance between servers. - ---- - -## πŸ“¦ Backing Up Your Database - -To create a complete snapshot of all profiles, accounts, posts, timelines, settings, and scrape history: - -### 1-Line Backup Command -```bash -docker exec -t instagram_saved_posts_mongo mongodump --db instagram --archive=/data/db/backup_$(date +%Y%m%d_%H%M%S).archive -``` - -### Copying the Backup to Your Host Machine -```bash -docker cp instagram_saved_posts_mongo:/data/db/backup_latest.archive ./backup_latest.archive -``` - ---- - -## πŸ”„ Restoring from Backup - -To restore an archive into a running container: - -```bash -# 1. Copy the archive into the MongoDB container -docker cp ./backup_latest.archive instagram_saved_posts_mongo:/data/db/backup_restore.archive - -# 2. Restore into MongoDB -docker exec -t instagram_saved_posts_mongo mongorestore --db instagram --archive=/data/db/backup_restore.archive --drop -``` - ---- - -## 🚚 Migrating to a New Server - -1. Run the backup command on your old server. -2. Transfer `backup_latest.archive` and `docker-compose.yml` to the new server via `scp` or `rsync`. -3. Run `docker compose up -d` on the new server to initialize containers and MongoDB replica set. -4. Run the restore command on the new server. -5. All profiles, session cookies, Cloudinary credentials, and post archives are restored seamlessly! diff --git a/wiki/Cloudinary-Permanent-Media-CDN.md b/wiki/Cloudinary-Permanent-Media-CDN.md deleted file mode 100644 index 978ebd0..0000000 --- a/wiki/Cloudinary-Permanent-Media-CDN.md +++ /dev/null @@ -1,52 +0,0 @@ -# ☁️ Cloudinary Permanent Media CDN - -By default, Instagram media CDN URLs expire after a few days or weeks. To ensure your saved post images and profile pictures remain accessible forever, InstaSave Tracker includes first-class **Cloudinary integration**. - ---- - -## 🎯 Why Use Cloudinary? - -- **Permanent URLs**: Images are cloned and served directly from Cloudinary's global high-speed CDN. -- **Configurable directly from the UI**: No need to edit `.env` or recreate containers. Enter credentials directly in the **Onboarding Wizard** or **Settings** page. -- **Live Account Statistics**: Track your storage usage, asset count, bandwidth consumption, and plan limits in real time. -- **Automatic Background Sync**: Newly discovered media during scrapes is automatically uploaded to your Cloudinary storage. -- **Generous Free Tier**: Cloudinary provides 25 monthly credits (~25GB storage/bandwidth), sufficient for tens of thousands of saved posts. - ---- - -## πŸš€ Setup Instructions - -### 1. Create a Free Cloudinary Account -Sign up for free at [cloudinary.com](https://cloudinary.com/users/register_free). - -### 2. Retrieve Your API Credentials -From your [Cloudinary Console Dashboard](https://console.cloudinary.com/) (under **Settings** → **Access Keys**), copy: -- **Cloud Name** -- **API Key** -- **API Secret** - -### 3. Enter Credentials in InstaSave Tracker -You can configure Cloudinary at any time in two places: -1. **During Onboarding**: Step 3 ("Cloudinary CDN") provides an interactive setup form with live verification. -2. **From Settings**: Go to **Settings** → **Cloudinary CDN** in the dashboard. - -Click **Test & Save Connection**. InstaSave Tracker will validate the credentials directly against Cloudinary and display your live account quota! - ---- - -## πŸ“Š Live Usage Metrics - -Once connected, the Settings page displays real-time statistics: -- **Storage Used / Limit**: Visual progress bar showing consumed storage against your quota. -- **Total Assets**: Count of media assets stored in Cloudinary. -- **Bandwidth Usage**: Monthly egress metrics. -- **Account Plan**: Active tier (e.g. Free, Plus, Advanced). - ---- - -## πŸ”„ Syncing Existing Media - -If you previously scraped posts before connecting Cloudinary: -1. Open **Settings** → **Cloudinary CDN**. -2. Click **Sync All Media to Cloudinary**. -3. Watch real-time progress for profile pictures, post thumbnails, and carousel slides! diff --git a/wiki/Coolify-Self-Hosting-Guide.md b/wiki/Coolify-Self-Hosting-Guide.md deleted file mode 100644 index 17ef0f0..0000000 --- a/wiki/Coolify-Self-Hosting-Guide.md +++ /dev/null @@ -1,68 +0,0 @@ -# πŸ”· Coolify Self-Hosting Guide - -[Coolify](https://coolify.io) is an all-in-one self-hostable PaaS with support for multi-server setups, push-to-deploy, and automated Let's Encrypt SSL certificates. - ---- - -## πŸš€ Deployment Steps in Coolify - -### Step 1: Add New Resource -1. Open your **Coolify Dashboard**. -2. Navigate to your Project / Environment and click **+ New Resource**. -3. Select **Docker Compose**. - -### Step 2: Paste Configuration -Paste the contents of `coolify-compose.yml`: - -```yaml -version: "3.8" - -services: - app: - image: ghcr.io/gitnasr/instagram-saved-posts:latest - pull_policy: always - restart: unless-stopped - expose: - - "3000" - environment: - - DATABASE_URL=mongodb://mongo:27017/instagram?replicaSet=rs0&directConnection=true - - NODE_ENV=production - - PORT=3000 - - HOSTNAME=0.0.0.0 - depends_on: - mongo: - condition: service_healthy - - mongo: - image: mongo:7.0 - restart: unless-stopped - command: ["--replSet", "rs0", "--bind_ip_all", "--port", "27017"] - volumes: - - mongo_data:/data/db - healthcheck: - test: > - mongosh --port 27017 --eval " - try { - rs.status().ok - } catch (e) { - rs.initiate({ - _id: 'rs0', - members: [{ _id: 0, host: 'mongo:27017' }] - }).ok - } - " || exit 1 - interval: 5s - timeout: 5s - retries: 10 - start_period: 2s - -volumes: - mongo_data: -``` - -### Step 3: Domain & Routing -1. In the Coolify resource view, enter your **FQDN / Domain** (e.g. `https://instagram.example.com`). -2. Set the destination port to `3000`. - -### Step 4: Deploy -Click **Deploy**. Coolify will orchestrate the containers, provision Traefik routing, issue Let's Encrypt certificates, and make your app accessible securely over HTTPS! diff --git a/wiki/Docker-Compose-Deployment.md b/wiki/Docker-Compose-Deployment.md deleted file mode 100644 index 9b9594f..0000000 --- a/wiki/Docker-Compose-Deployment.md +++ /dev/null @@ -1,94 +0,0 @@ -# 🐳 Docker Compose Deployment Guide - -Deploying **Instagram Saved Posts Tracker** using Docker Compose is the recommended method for standalone servers, home labs, and VPS instances. - ---- - -## πŸ“‹ Prerequisites - -- Docker Engine (v24.0+ recommended) -- Docker Compose (v2.0+) - -Verify your installation: -```bash -docker --version -docker compose version -``` - ---- - -## πŸš€ Production Deployment - -### 1. Create a Project Directory -```bash -mkdir -p ~/instagram-saved-posts && cd ~/instagram-saved-posts -``` - -### 2. Download `docker-compose.yml` -```bash -curl -fsSL https://raw.githubusercontent.com/gitnasr/Instagram-Saved-Posts/master/docker-compose.yml -o docker-compose.yml -``` - -### 3. Launch the Stack -```bash -docker compose up -d -``` - -### 4. Verify Running Containers -```bash -docker compose ps -``` - -You will see: -- `instagram_saved_posts_app`: Next.js web application and scraper engine (port 3000). -- `instagram_saved_posts_mongo`: MongoDB 7.0 database configured with replica set `rs0` (healthy). - -> [!NOTE] -> The compose configuration uses `pull_policy: always` for the `app` service. This ensures `docker compose up -d` always checks and pulls the latest container image from GHCR when tracking `:latest` or `:beta`. - -Access your dashboard at `http://localhost:3000` (or your server's IP address) to start the onboarding wizard! - ---- - -## βš™οΈ Volume & Data Persistence - -The MongoDB database stores all profiles, saved posts, carousel media, account history, and notes inside the Docker volume `instagram_saved_posts_mongo_data`. - -To inspect volume storage: -```bash -docker volume inspect instagram_saved_posts_mongo_data -``` - ---- - -## πŸ”„ Automatic Updates with Watchtower - -To keep your instance automatically updated whenever a new version is released: - -```yaml - watchtower: - image: containrrr/watchtower - container_name: watchtower_instasave - restart: unless-stopped - volumes: - - /var/run/docker.sock:/var/run/docker.sock - command: --interval 86400 --cleanup instagram_saved_posts_app -``` - ---- - -## πŸ›‘ Common Management Commands - -```bash -# View live application logs -docker compose logs -f app - -# Restart application -docker compose restart app - -# Stop the stack -docker compose down - -# Update to latest version manually -docker compose pull && docker compose up -d -``` diff --git a/wiki/Dokploy-Self-Hosting-Guide.md b/wiki/Dokploy-Self-Hosting-Guide.md deleted file mode 100644 index 66b3bda..0000000 --- a/wiki/Dokploy-Self-Hosting-Guide.md +++ /dev/null @@ -1,70 +0,0 @@ -# 🟣 Dokploy Self-Hosting Guide - -[Dokploy](https://dokploy.com) is a modern, lightweight, open-source alternative to Heroku and Portainer with built-in Traefik reverse proxy and automatic SSL certificates. - ---- - -## πŸš€ 1-Click Compose Deployment in Dokploy - -### Step 1: Create a Project & Service -1. Log in to your **Dokploy Dashboard**. -2. Click **Create Project** (e.g. `InstaSave`). -3. Click **Add Service** → Select **Compose**. - -### Step 2: Configure Compose Stack -In the Compose editor, paste the contents of `dokploy-compose.yml`: - -```yaml -version: "3.8" - -services: - app: - image: ghcr.io/gitnasr/instagram-saved-posts:latest - pull_policy: always - restart: unless-stopped - ports: - - "3000:3000" - environment: - - DATABASE_URL=mongodb://mongo:27017/instagram?replicaSet=rs0&directConnection=true - - NODE_ENV=production - - PORT=3000 - - HOSTNAME=0.0.0.0 - depends_on: - mongo: - condition: service_healthy - - mongo: - image: mongo:7.0 - restart: unless-stopped - command: ["--replSet", "rs0", "--bind_ip_all", "--port", "27017"] - volumes: - - mongo_data:/data/db - healthcheck: - test: > - mongosh --port 27017 --eval " - try { - rs.status().ok - } catch (e) { - rs.initiate({ - _id: 'rs0', - members: [{ _id: 0, host: 'mongo:27017' }] - }).ok - } - " || exit 1 - interval: 5s - timeout: 5s - retries: 10 - start_period: 2s - -volumes: - mongo_data: -``` - -### Step 3: Configure Domain & SSL -1. Open the **Domains** tab for the `app` service in Dokploy. -2. Add your custom domain (e.g. `instagram.yourdomain.com`). -3. Set Port to `3000`. -4. Enable **HTTPS (Let's Encrypt)**. - -### Step 4: Deploy -Click **Deploy**. Dokploy will pull the container images, verify MongoDB replica set health, and launch the application behind Traefik SSL! diff --git a/wiki/Home.md b/wiki/Home.md deleted file mode 100644 index 977b158..0000000 --- a/wiki/Home.md +++ /dev/null @@ -1,37 +0,0 @@ -# πŸ“š InstaSave Tracker Wiki - -Welcome to the official **Instagram Saved Posts Tracker** Wiki! Here you'll find comprehensive guides for setup, self-hosting deployments, cloud integrations, and operational best practices. - ---- - -## ⚑ Quick Navigation - -| Section | Description | Link | -| :--- | :--- | :--- | -| πŸš€ **Getting Started** | Extract your session cookie & start tracking | [[How to Get Your Instagram Cookie\|How-to-Get-Your-Instagram-Cookie]] | -| ☁️ **Media & CDN** | Configure permanent Cloudinary media storage & view live stats | [[Cloudinary Permanent Media CDN\|Cloudinary-Permanent-Media-CDN]] | -| 🐳 **Docker Compose** | Production deployment with MongoDB ReplicaSet on bare-metal / VPS | [[Docker Compose Deployment\|Docker-Compose-Deployment]] | -| 🟣 **Dokploy Guide** | 1-Click stack deployment with automated SSL on Dokploy | [[Dokploy Self-Hosting Guide\|Dokploy-Self-Hosting-Guide]] | -| πŸ”· **Coolify Guide** | Push-to-deploy multi-service setup on Coolify | [[Coolify Self-Hosting Guide\|Coolify-Self-Hosting-Guide]] | -| πŸ”’ **Reverse Proxy & SSO** | Protect your instance with Authentik ForwardAuth and viewer mode | [[Reverse Proxy and Authentik SSO\|Reverse-Proxy-and-Authentik-SSO]] | -| πŸ’Ύ **Backup & Restore** | Database backup snapshots and server migration guide | [[Backup and Database Migration\|Backup-and-Database-Migration]] | -| ❓ **Troubleshooting & FAQ** | Fix P2031 replica sets, rate limits, and common issues | [[Troubleshooting and FAQ\|Troubleshooting-and-FAQ]] | - ---- - -## 🌟 Key Architecture & Highlights - -- **Multi-Profile Support**: Track multiple Instagram accounts independently in a single dashboard. -- **Onboarding-First UX**: Guided setup wizard validates database health, tests session cookies, and links Cloudinary. -- **Resumable Scraping Engine**: Automatically recovers from rate limits with exponential backoff and checkpoint resumption. -- **Permanent Media Archiving**: Direct integration with Cloudinary permanent CDN or standalone on-demand proxy caching. -- **Role-Based Access Control**: Built-in support for header-based ForwardAuth SSO (Authentik / Authelia) with viewer role restrictions. - ---- - -## πŸ”— Official Links - -- **Repository**: [github.com/gitnasr/Instagram-Saved-Posts](https://github.com/gitnasr/Instagram-Saved-Posts) -- **Container Registry**: [ghcr.io/gitnasr/instagram-saved-posts](https://github.com/gitnasr/Instagram-Saved-Posts/pkgs/container/instagram-saved-posts) -- **Issues & Support**: [github.com/gitnasr/Instagram-Saved-Posts/issues](https://github.com/gitnasr/Instagram-Saved-Posts/issues) -- **Releases**: [github.com/gitnasr/Instagram-Saved-Posts/releases](https://github.com/gitnasr/Instagram-Saved-Posts/releases) diff --git a/wiki/How-to-Get-Your-Instagram-Cookie.md b/wiki/How-to-Get-Your-Instagram-Cookie.md deleted file mode 100644 index 94768e3..0000000 --- a/wiki/How-to-Get-Your-Instagram-Cookie.md +++ /dev/null @@ -1,77 +0,0 @@ -# πŸ”‘ How to Get Your Instagram Cookie - -This guide explains how to extract your Instagram session cookie to authenticate the scraper. - ---- - -## πŸ“Œ Important Security Notes - -> [!IMPORTANT] -> - Your cookie acts like a digital password for your Instagram session. **Never share it publicly.** -> - Do **NOT** log out of Instagram in the browser where you extracted the cookie, as logging out immediately revokes the session ID. Simply close the tab instead. -> - Using a secondary burner Instagram account or exporting from a dedicated browser profile is recommended for extra isolation. - ---- - -## 🌐 Method 1: Using Browser DevTools (Recommended) - -Works on **Google Chrome**, **Brave**, **Microsoft Edge**, and **Firefox**. - -### Step-by-Step Walkthrough - -1. **Log in to Instagram**: - Open [https://www.instagram.com](https://www.instagram.com) on your desktop browser and ensure you are logged in. - -2. **Open Developer Tools**: - Press `F12` (or right-click anywhere on the page and select **Inspect** / `Ctrl+Shift+I` on Windows/Linux, `Cmd+Option+I` on macOS). - -3. **Navigate to the Network Tab**: - - Click the **Network** tab at the top of the Developer Tools panel. - - In the filter box, type `graphql` or `instagram.com`. - -4. **Trigger a Request**: - - Refresh the page (`F5` or `Cmd+R`) or click on your profile/saved tab. - - You will see multiple network requests populate in the list. - -5. **Copy the Cookie**: - - Click on any request made to `instagram.com` (e.g. `graphql/query` or `feed/saved/`). - - In the right-hand panel, select the **Headers** tab. - - Scroll down to the **Request Headers** section. - - Locate `cookie:` or `Cookie:`. - - Right-click the value and select **Copy value** (or select all text and copy). - -``` -β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” -β”‚ Request Headers β”‚ -β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ -β”‚ accept: */* β”‚ -β”‚ cookie: csrftoken=...; ds_user_id=123456789; sessionid=123456%3A...; β”‚ -β”‚ user-agent: Mozilla/5.0 ... β”‚ -β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ -``` - -6. **Paste into InstaSave Tracker**: - Paste the full cookie string into the **Onboarding Wizard** or **Settings** page and click **Test & Verify Cookie**. - ---- - -## 🧩 Method 2: Using a Cookie Extension (Alternative) - -If you prefer using an extension: - -1. Install a reputable cookie manager like [Cookie-Editor](https://cookie-editor.cgagnier.ca/) (available for Chrome and Firefox). -2. Navigate to [instagram.com](https://www.instagram.com). -3. Click the Cookie-Editor icon in your browser toolbar. -4. Click **Export** -> **Export as Header String**. -5. Paste the exported string into InstaSave Tracker. - ---- - -## πŸ” Required Cookie Tokens - -For successful scraping, the cookie string must contain at least: -- `sessionid`: Your active Instagram session token. -- `ds_user_id`: Your Instagram numeric user ID. -- `csrftoken`: The CSRF verification token. - -If any of these are missing, Instagram will reject the request with `login_required`. diff --git a/wiki/Reverse-Proxy-and-Authentik-SSO.md b/wiki/Reverse-Proxy-and-Authentik-SSO.md deleted file mode 100644 index 360dba1..0000000 --- a/wiki/Reverse-Proxy-and-Authentik-SSO.md +++ /dev/null @@ -1,71 +0,0 @@ -# πŸ”’ Reverse Proxy & Authentik SSO Guide - -InstaSave Tracker is designed to sit cleanly behind any reverse proxy and supports header-based SSO authentication with built-in role enforcement. - ---- - -## πŸ›‘οΈ Authentik Integration & Viewer Mode - -InstaSave Tracker detects the `x-authentik-groups` header forwarded by Authentik Forward Auth or Traefik Middleware. - -### Role Permissions - -| Authentik Group | Permission Level | -| :--- | :--- | -| Any standard group / admin | **Full Access**: Can add profiles, update cookies, trigger scrapes, edit notes, configure Cloudinary, and export CSVs. | -| `viewer` or `viewers` | **Read-Only Mode**: Can browse accounts, view saved posts, read timelines, but cannot edit settings, modify credentials, or initiate scrapes. | - -### Traefik ForwardAuth Middleware Example -```yaml -http: - middlewares: - authentik: - forwardAuth: - address: "https://authentik.yourdomain.com/outpost.goauthentik.io/auth/traefik" - trustForwardHeader: true - authResponseHeaders: - - "x-authentik-username" - - "x-authentik-groups" - - "x-authentik-email" -``` - ---- - -## 🌐 Nginx Proxy Manager / Nginx Configuration - -```nginx -server { - listen 80; - server_name instagram.yourdomain.com; - return 301 https://$host$request_uri; -} - -server { - listen 443 ssl http2; - server_name instagram.yourdomain.com; - - ssl_certificate /path/to/fullchain.pem; - ssl_certificate_key /path/to/privkey.pem; - - location / { - proxy_pass http://127.0.0.1:3000; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection 'upgrade'; - proxy_set_header Host $host; - proxy_cache_bypass $http_upgrade; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - } -} -``` - ---- - -## ☁️ Cloudflare Tunnels (Zero Trust) - -If using Cloudflare Tunnels: -1. In Cloudflare Zero Trust → **Access** → **Tunnels**, create a tunnel. -2. Add a Public Hostname pointing to `http://localhost:3000` (or `http://app:3000` if on docker network). -3. Optional: Add Cloudflare Access Applications for email OTP or OAuth authentication. diff --git a/wiki/Troubleshooting-and-FAQ.md b/wiki/Troubleshooting-and-FAQ.md deleted file mode 100644 index 336a520..0000000 --- a/wiki/Troubleshooting-and-FAQ.md +++ /dev/null @@ -1,50 +0,0 @@ -# ❓ Troubleshooting & Frequently Asked Questions - -Common questions, error resolutions, and operational tips. - ---- - -## 🚫 Scraping & Cookie Errors - -### 1. `login_required` or `checkpoint_required` -- **Cause**: Instagram expired the session or flagged the IP/session. -- **Solution**: - 1. Open [instagram.com](https://www.instagram.com) in your browser. - 2. If a challenge/captcha appears, solve it. - 3. Extract a fresh cookie (see [[How to Get Your Instagram Cookie|How-to-Get-Your-Instagram-Cookie]]). - 4. Paste the new cookie in **Settings** or the **Profile Picker**. - -### 2. `rate_limited` or "Please wait a few minutes" -- **Cause**: Scraping too many pages rapidly from a datacenter IP. -- **Solution**: - - The built-in scraper has automatic exponential backoff with jitter and pauses before retrying. - - If a scrape run halts due to rate limits, it is marked as **Resumable**. You can click **Resume Scrape** anytime from the Scrape page to continue from the exact page where it stopped without duplicating posts! - ---- - -## 🐳 Docker & Database Issues - -### 1. `Prisma needs to perform transactions, which requires your MongoDB server to be run as a replica set (P2031)` -- **Cause**: Prisma uses MongoDB transactions for multi-document operations and profile initialization, requiring a replica set (`rs0`). -- **Fix**: Ensure your MongoDB container runs with `--replSet rs0` and has been initiated via `rs.initiate()`. The included `docker-compose.yml`, `dokploy-compose.yml`, and `coolify-compose.yml` templates automatically configure and initialize this on first startup. If running MongoDB manually, execute: - ```bash - docker exec mongosh --eval "rs.initiate()" - ``` - And ensure your connection string includes `?replicaSet=rs0&directConnection=true`. - -### 2. Missing Images / Broken Post Thumbnails -- **Explanation**: Instagram URLs include temporary CDN tokens that expire after several days. -- **Fix**: Connect a free Cloudinary account in **Settings** → **Cloudinary CDN** (or during initial Onboarding) and run **Sync All Media** to permanently mirror all media assets to Cloudinary. - ---- - -## ❓ Frequently Asked Questions - -**Q: Can I run multiple Instagram accounts?** -A: Yes! Click on the profile switcher in the top navigation or sidebar to create additional profiles. Each profile maintains its own session cookie, bookmarks, timeline, and scrape runs independently. - -**Q: Will scraping get my Instagram account banned?** -A: The scraper operates in read-only mode, only requesting the `/feed/saved/` endpoint at human-like intervals. However, using a secondary burner account to save posts is always good practice. - -**Q: Can I export my saved accounts to CSV?** -A: Yes! On the Accounts page, click **Export CSV** to download a complete spreadsheet of all discovered accounts, follower status, verification, and saved post counts. diff --git a/wiki/_Footer.md b/wiki/_Footer.md deleted file mode 100644 index dee30c6..0000000 --- a/wiki/_Footer.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -

- InstaSave Tracker • Self-hosted archive & intelligence dashboard for saved Instagram posts.
- GitHub • - Releases • - Report an Issue -

diff --git a/wiki/_Sidebar.md b/wiki/_Sidebar.md deleted file mode 100644 index 125c3cb..0000000 --- a/wiki/_Sidebar.md +++ /dev/null @@ -1,26 +0,0 @@ -### [🏠 Home](Home) - ---- - -### πŸš€ Getting Started -- [πŸ”‘ Instagram Cookie](How-to-Get-Your-Instagram-Cookie) - -### ☁️ Features & Media -- [☁️ Cloudinary CDN](Cloudinary-Permanent-Media-CDN) - -### 🚒 Deployment -- [🐳 Docker Compose](Docker-Compose-Deployment) -- [🟣 Dokploy Setup](Dokploy-Self-Hosting-Guide) -- [πŸ”· Coolify Setup](Coolify-Self-Hosting-Guide) -- [πŸ”’ Reverse Proxy & SSO](Reverse-Proxy-and-Authentik-SSO) - -### πŸ› οΈ Operations -- [πŸ’Ύ Backup & Restore](Backup-and-Database-Migration) -- [❓ Troubleshooting & FAQ](Troubleshooting-and-FAQ) - ---- - -### πŸ”— Links -- [GitHub Repo](https://github.com/gitnasr/Instagram-Saved-Posts) -- [Releases](https://github.com/gitnasr/Instagram-Saved-Posts/releases) -- [Issues](https://github.com/gitnasr/Instagram-Saved-Posts/issues)