Skip to content

Commit f524b2c

Browse files
authored
Merge pull request #49 from TBosak/extensions
feat: Chrome extension support +
2 parents 7cbcac3 + 974a2b8 commit f524b2c

14 files changed

+1240
-517
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,5 @@ truenas/
3535
# Build artifacts that shouldn't be in Docker
3636
dist/
3737
build/
38+
public/feeds
39+
configs/

.env.example

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ ENCRYPTION_KEY=your_encryption_key_here
1313
# Optional: Enable SSL (true/false)
1414
SSL=false
1515

16+
# Optional: Server port (defaults to 5000)
17+
PORT=5000
18+
19+
# Optional: Path to Chrome extensions directory for advanced scraping
20+
# Place unpacked extensions in subdirectories within this path
21+
# Example: /app/extensions/extension1, /app/extensions/extension2
22+
# Defaults to /app/extensions if not set
23+
# Docker: /app/extensions (default - no need to set this)
24+
# Local: /full/path/to/mkfd/extensions
25+
# CHROME_EXTENSIONS_PATH=/app/extensions
26+
1627
# Optional: Override default 4GB memory allocation for IMAP processes
1728
# Uncomment and adjust if you have large mailboxes
1829
# NODE_OPTIONS=--max-old-space-size=8192

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,7 @@ dist
169169
.pnp.*
170170
public/feeds/
171171
configs/
172-
feed-history/
172+
feed-history/
173+
truenas/
174+
extensions/
175+
.claude/settings.local.json

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,57 @@ docker run -p 5000:5000 -v /local/mount/path:/app/configs \
8888

8989
Alternatively, use [Autoheal](https://github.com/willfarrell/docker-autoheal) to automatically restart unhealthy containers in docker-compose setups.
9090

91+
## 🔌 Chrome Extensions for Advanced Scraping
92+
93+
Mkfd supports loading Chrome extensions when using advanced scraping mode (Playwright).
94+
95+
### 📁 Setting Up Extensions
96+
97+
1. **Prepare your extensions**: Create a directory for unpacked Chrome extensions. Each extension should be in its own subdirectory.
98+
99+
```
100+
extensions/
101+
├── extension1/
102+
│ ├── manifest.json
103+
│ └── ... (other extension files)
104+
└── extension2/
105+
├── manifest.json
106+
└── ... (other extension files)
107+
```
108+
109+
2. **Configure the path**: Set the `CHROME_EXTENSIONS_PATH` environment variable to point to your extensions directory.
110+
This is optional, the default path is "/app/extensions".
111+
112+
### 🐳 Docker Setup
113+
114+
When using Docker or Docker Compose, mount your extensions directory as a volume:
115+
116+
**Docker Run:**
117+
```bash
118+
docker run -p 5000:5000 \
119+
-v /local/mount/path:/app/configs \
120+
-v /path/to/extensions:/app/extensions \
121+
-e PASSKEY=your_passkey \
122+
-e COOKIE_SECRET=your_cookie_secret \
123+
-e ENCRYPTION_KEY=your_encryption_key \
124+
tbosk/mkfd:latest
125+
```
126+
127+
**Docker Compose:**
128+
129+
The included `docker-compose.yml` already has extensions support configured:
130+
- Extensions directory: `./extensions` (in the same directory as docker-compose.yml)
131+
- Environment variable is set automatically
132+
133+
Simply place your unpacked extensions in `./extensions/` and they will be loaded when using advanced scraping mode.
134+
135+
### ⚙️ How It Works
136+
137+
- Extensions are automatically discovered and loaded when using advanced scraping mode
138+
- Each subdirectory in the extensions path is treated as a separate extension
139+
- Extensions only load when "Advanced Scraping" is enabled for a feed
140+
- If no extensions are found or the path doesn't exist, advanced scraping works normally without extensions
141+
91142
## 📧 Email Feeds
92143

93144
Mkfd supports email feeds via IMAP. You can use any email provider that supports IMAP, such as Gmail, Yahoo, or Outlook. To set up an email feed, you need to provide the following information:

docker-compose.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,19 @@ services:
55
image: tbosk/mkfd:latest
66
container_name: mkfd
77
ports:
8-
- "0.0.0.0:5000:5000"
8+
- "${PORT:-5000}:5000"
99
volumes:
1010
- ./configs:/app/configs
11+
# Mount Chrome extensions directory (optional)
12+
# Place unpacked extensions in ./extensions/
13+
- ./extensions:/app/extensions
1114
environment:
1215
- PASSKEY=${PASSKEY:-your_passkey_here}
1316
- COOKIE_SECRET=${COOKIE_SECRET:-your_cookie_secret_here}
1417
- ENCRYPTION_KEY=${ENCRYPTION_KEY:-your_encryption_key_here}
1518
- SSL=${SSL:-false}
19+
# Path to Chrome extensions directory for advanced scraping
20+
- CHROME_EXTENSIONS_PATH=${CHROME_EXTENSIONS_PATH:-/app/extensions}
1621
# Uncomment to override default 4GB memory allocation for IMAP processes
1722
# - NODE_OPTIONS=--max-old-space-size=8192
1823
restart: unless-stopped

dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN curl -fsSL https://deb.nodesource.com/setup_23.x | bash - \
88
&& apt-get install -y nodejs
99

1010
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
11-
RUN bunx patchright install --with-deps chrome
11+
RUN bunx patchright install --with-deps chromium
1212

1313
WORKDIR /app
1414

@@ -17,9 +17,13 @@ RUN bun install
1717

1818
COPY . .
1919

20+
# Create directories for volumes
21+
RUN mkdir -p /app/configs /app/extensions && \
22+
chmod -R 755 /app/configs /app/extensions
23+
2024
EXPOSE 5000
2125

22-
VOLUME ["/app/configs"]
26+
VOLUME ["/app/configs", "/app/extensions"]
2327

2428
HEALTHCHECK --interval=5m --timeout=10s --start-period=1m --retries=3 \
2529
CMD curl -f http://localhost:5000/ || exit 1

0 commit comments

Comments
 (0)