diff --git a/apps/mailcatcher/README.md b/apps/mailcatcher/README.md index d2cfaf8f..5b216a95 100644 --- a/apps/mailcatcher/README.md +++ b/apps/mailcatcher/README.md @@ -1,12 +1,169 @@ # MailCatcher -## Run Image +MailCatcher is a simple SMTP server that catches any email sent to it and displays it in a web interface. It's perfect for testing email functionality in development environments without actually sending emails. -``` +## Features + +- ๐ง Catches all outbound emails in development +- ๐ Web interface to view caught emails +- ๐ Search and filter emails +- ๐ฑ Responsive design for mobile viewing +- ๐ Lightweight and fast +- ๐ณ Ready-to-use Docker container + +## Quick Start + +### Run with Docker + +```bash docker run -p 1080:1080 -p 1025:1025 --name mailcatcher-server philiplehmann/mailcatcher:latest ``` -## Ports +### Run with Docker Compose + +```yaml +services: + mailcatcher: + image: philiplehmann/mailcatcher:latest + ports: + - "1080:1080" # Web interface + - "1025:1025" # SMTP server + container_name: mailcatcher-server +``` + +## Configuration + +### Ports + +| Port | Service | Description | +|------|---------|-------------| +| 1025 | SMTP | Mail server for receiving emails | +| 1080 | HTTP | Web interface for viewing emails | + +### Environment Variables + +| Variable | Default | Description | +|----------|---------|-------------| +| `SMTP_PORT` | 1025 | SMTP server port (not used by the current Dockerfile `CMD` in `apps/mailcatcher/Dockerfile`; changes require rebuilding the image or modifying `CMD` to read `SMTP_PORT`) | +| `HTTP_PORT` | 1080 | Web interface port (not used by the current Dockerfile `CMD` in `apps/mailcatcher/Dockerfile`; changes require rebuilding the image or modifying `CMD` to read `HTTP_PORT`) | + +## Usage + +### Configure Your Application + +Point your application's SMTP settings to: +- **Host:** `localhost` (or your Docker container IP) +- **Port:** `1025` +- **Authentication:** None required + +### View Caught Emails + +Open your browser and navigate to: +```text +http://localhost:1080 +``` + +### Example Configuration + +#### Node.js (Nodemailer) +```javascript +const nodemailer = require('nodemailer'); + +const transporter = nodemailer.createTransport({ + host: 'localhost', + port: 1025, + secure: false, // No SSL/TLS + auth: null // No authentication +}); +``` + +#### Python (smtplib) +```python +import smtplib +from email.mime.text import MIMEText + +server = smtplib.SMTP('localhost', 1025) +# No authentication needed +``` + +#### PHP +```php +ini_set('SMTP', 'localhost'); +ini_set('smtp_port', 1025); +// Use mail() function as normal +``` + +## Development + +### Building the Image + +#### Using Nx (Recommended) +```bash +# Build the Docker image using Nx +nx docker-push mailcatcher + +# Or from the workspace root +npx nx docker-push mailcatcher +``` + +#### Using Docker directly +```bash +docker build -t mailcatcher -f apps/mailcatcher/Dockerfile . +``` + +### Running in Development Mode + +#### Using Nx +```bash +# Run the container using Nx +nx docker-run mailcatcher + +# Test the Docker build +nx docker-test mailcatcher + +# Run tests +nx test mailcatcher +``` + +#### Using Docker directly +```bash +# Run the container +docker run -p 1080:1080 -p 1025:1025 mailcatcher +``` + +## Troubleshooting + +### Common Issues + +**Port already in use:** +```bash +# Check what's using the port +lsof -i :1080 +lsof -i :1025 + +# Stop the container and try again +docker stop mailcatcher-server +docker rm mailcatcher-server +``` + +**Can't access web interface:** +- Ensure port 1080 is not blocked by firewall +- Check if Docker container is running: `docker ps` +- Verify port mapping: `docker port mailcatcher-server` + +**Emails not being caught:** +- Verify your application is configured to use `localhost:1025` +- Check container logs: `docker logs mailcatcher-server` +- Ensure no authentication is configured in your email client + +## Contributing + +1. Fork the repository +2. Create a feature branch +3. Make your changes +4. Test thoroughly +5. Submit a pull request + +## License -- SMTP 1025 -- HTTP 1080 +This project is licensed under the MIT License. diff --git a/apps/maildev/README.md b/apps/maildev/README.md index e9292f4c..46308cc0 100644 --- a/apps/maildev/README.md +++ b/apps/maildev/README.md @@ -1,12 +1,301 @@ -# maildev +# MailDev -## Run Image +MailDev, built on top of Node.js, is a simple way to test your project's generated emails during development with an easy-to-use web interface that runs on your machine. It's perfect for testing email functionality in development environments without actually sending emails. -``` +## Features + +- ๐ง Catches all outbound emails in development +- ๐ Clean, intuitive web interface +- ๐ฑ Responsive design for mobile viewing +- ๐ Search and filter emails by sender, subject, or content +- ๐ View HTML and plain text versions of emails +- ๐ Download email attachments +- ๐ Auto-refresh and real-time updates +- ๐๏ธ Delete individual emails or clear all +- ๐ Lightweight and fast +- ๐ณ Ready-to-use Docker container + +## Quick Start + +### Run with Docker + +```bash docker run -p 1080:1080 -p 1025:1025 --name maildev-server philiplehmann/maildev:latest ``` -## Ports +### Run with Docker Compose + +```yaml +services: + maildev: + image: philiplehmann/maildev:latest + ports: + - "1080:1080" # Web interface + - "1025:1025" # SMTP server + container_name: maildev-server + environment: + - MAILDEV_WEB_PORT=1080 + - MAILDEV_SMTP_PORT=1025 +``` + +### Run with Nx + +```bash +# Build the Docker image +nx docker-push maildev + +# Run the container +nx docker-run maildev + +# Test the Docker build +nx docker-test maildev +``` + +## Configuration + +### Ports + +| Port | Service | Description | +|------|---------|-------------| +| 1025 | SMTP | Mail server for receiving emails | +| 1080 | HTTP | Web interface for viewing emails | + +### Environment Variables + +| Variable | Default | Description | +|----------|---------|-------------| +| `MAILDEV_WEB_PORT` | 1080 | Web interface port | +| `MAILDEV_SMTP_PORT` | 1025 | SMTP server port | +| `MAILDEV_WEB_IP` | 0.0.0.0 | IP address to bind web interface | +| `MAILDEV_SMTP_IP` | 0.0.0.0 | IP address to bind SMTP server | +| `MAILDEV_BASE_PATHNAME` | / | Base path for web interface | +| `MAILDEV_DISABLE_DNS` | false | Disable DNS lookups | + +## Usage + +### Configure Your Application + +Point your application's SMTP settings to: +- **Host:** `localhost` (or your Docker container IP) +- **Port:** `1025` +- **Authentication:** None required +- **Encryption:** None (plain text) + +### View Caught Emails + +Open your browser and navigate to: +```text +http://localhost:1080 +``` + +### Example Configuration + +#### Node.js (Nodemailer) +```javascript +const nodemailer = require('nodemailer'); + +const transporter = nodemailer.createTransport({ + host: 'localhost', + port: 1025, + secure: false, // No SSL/TLS + auth: null, // No authentication + tls: { + rejectUnauthorized: false + } +}); + +// Send test email +transporter.sendMail({ + from: 'sender@example.com', + to: 'recipient@example.com', + subject: 'Test Email', + text: 'This is a test email', + html: '
This is a test email
' +}); +``` + +#### Python (smtplib) +```python +import smtplib +from email.mime.text import MIMEText +from email.mime.multipart import MIMEMultipart + +# Create message +msg = MIMEMultipart('alternative') +msg['Subject'] = 'Test Email' +msg['From'] = 'sender@example.com' +msg['To'] = 'recipient@example.com' + +# Add content +text = 'This is a test email' +html = 'This is a test email
' +msg.attach(MIMEText(text, 'plain')) +msg.attach(MIMEText(html, 'html')) + +# Send email +server = smtplib.SMTP('localhost', 1025) +server.send_message(msg) +server.quit() +``` + +#### PHP +```php + +``` + +#### Laravel (.env configuration) +```env +MAIL_MAILER=smtp +MAIL_HOST=localhost +MAIL_PORT=1025 +MAIL_USERNAME=null +MAIL_PASSWORD=null +MAIL_ENCRYPTION=null +MAIL_FROM_ADDRESS=test@example.com +MAIL_FROM_NAME="${APP_NAME}" +``` + +## Web Interface Features + +### Email List View +- View all caught emails in chronological order +- Filter by sender, recipient, or subject +- Quick preview of email content +- Attachment indicators + +### Email Detail View +- Toggle between HTML and plain text views +- Download individual attachments +- View email headers +- Copy email content + +### Toolbar Actions +- ๐ Refresh email list +- ๐๏ธ Delete individual emails +- ๐๏ธ Clear all emails +- ๐ Search functionality + +## Development + +### Building the Image + +#### Using Nx (Recommended) +```bash +# Build and push the Docker image using Nx +nx docker-push maildev + +# Or from the workspace root +npx nx docker-push maildev +``` + +#### Using Docker directly +```bash +docker build -t maildev -f apps/maildev/Dockerfile . +``` + +### Running in Development Mode + +#### Using Nx +```bash +# Run the container using Nx +nx docker-run maildev + +# Test the Docker build +nx docker-test maildev + +# Run tests +nx test maildev + +# Lint the code +nx lint maildev +``` + +#### Using Docker directly +```bash +# With custom configuration +docker run -p 1080:1080 -p 1025:1025 \ + -e MAILDEV_WEB_PORT=1080 \ + -e MAILDEV_SMTP_PORT=1025 \ + --name maildev-dev \ + philiplehmann/maildev:latest +``` + +## Troubleshooting + +### Common Issues + +**Port already in use:** +```bash +# Check what's using the port +lsof -i :1080 +lsof -i :1025 + +# Stop the container and try again +docker stop maildev-server +docker rm maildev-server +``` + +**Can't access web interface:** +- Ensure port 1080 is not blocked by firewall +- Check if Docker container is running: `docker ps` +- Verify port mapping: `docker port maildev-server` +- Check container logs: `docker logs maildev-server` + +**Emails not being caught:** +- Verify your application is configured to use `localhost:1025` +- Ensure no authentication is configured in your email client +- Check that TLS/SSL is disabled +- Verify SMTP settings in your application + +**Web interface shows no emails:** +- Check that emails are actually being sent by your application +- Verify the container is receiving SMTP connections +- Clear browser cache and refresh the page + +### Logging + +To see MailDev logs: +```bash +# View container logs +docker logs maildev-server + +# Follow logs in real-time +docker logs -f maildev-server +``` + +## Comparison with MailCatcher + +| Feature | MailDev | MailCatcher | +|---------|---------|-------------| +| Technology | Node.js | Ruby | +| Web Interface | Modern, responsive | Simple, functional | +| Real-time Updates | โ | โ | +| Attachment Support | โ | โ | +| Search Functionality | โ | โ | +| Mobile Responsive | โ | โ | +| Memory Usage | Higher | Lower | + +## Contributing + +1. Fork the repository +2. Create a feature branch +3. Make your changes +4. Test thoroughly with `nx test maildev` +5. Submit a pull request + +## License -- SMTP 1025 -- HTTP 1080 +This project is licensed under the MIT License. diff --git a/apps/nx-cache-server/README.md b/apps/nx-cache-server/README.md index ec12b8ed..3c7902d7 100644 --- a/apps/nx-cache-server/README.md +++ b/apps/nx-cache-server/README.md @@ -1,12 +1,45 @@ -# nx-cache-server node wrapper +# Nx Cache Server Node.js Wrapper -## Run Image +A containerized Node.js service that provides a remote cache endpoint for Nx builds, enabling faster CI and developer workflows by sharing cached artifacts across machines. -``` +## Features + +- โก **Remote Caching** - Share Nx build cache across teams and CI +- ๐ณ **Docker Ready** - Easy deployment with Docker +- ๐ง **Simple Setup** - Minimal configuration required +- ๐ฆ **Nx Compatible** - Designed for Nx remote cache workflows +- ๐ **HTTP Endpoint** - Works over standard HTTP + +## Quick Start + +### Run with Docker + +```bash docker run --rm -p 3000:3000 --name nx-cache-server philiplehmann/nx-cache-server:latest ``` +### Run with Docker Compose + +```yaml +services: + nx-cache-server: + image: philiplehmann/nx-cache-server:latest + ports: + - "3000:3000" + container_name: nx-cache-server +``` + +## Usage + +1. Start the server (see Quick Start). +2. Configure Nx to use the remote cache server URL. + +Refer to the official documentation for setup details and client configuration: + +- https://philiplehmann.github.io/nx-cache-server/ ## Ports -- HTTP 3000 +| Port | Service | Description | +|------|---------|-------------| +| 3000 | HTTP | Remote cache server | diff --git a/apps/pdftk/README.md b/apps/pdftk/README.md index d0ec362a..5eb884d2 100644 --- a/apps/pdftk/README.md +++ b/apps/pdftk/README.md @@ -1,110 +1,146 @@ -# pdftk node wrapper +# PDFTK Node.js Wrapper -## Run Image +A containerized Node.js service that provides a REST API for common PDF operations using PDFTK. -``` +## Features + +- ๐๏ธ **Compress/Uncompress** - Optimize PDF file size +- ๐ **Encrypt/Decrypt** - Secure PDFs with passwords and permissions +- ๐งพ **Form Data** - Extract or fill PDF form fields +- ๐ณ **Docker Ready** - Easy deployment with Docker +- ๐ง **REST API** - Simple HTTP interface + +## Quick Start + +### Run with Docker + +```bash docker run -p 3000:3000 --rm --name pdftk philiplehmann/pdftk:latest ``` -## compress pdf file +### Run with Docker Compose +```yaml +services: + pdftk: + image: philiplehmann/pdftk:latest + ports: + - "3000:3000" + container_name: pdftk ``` + +## API Endpoints + +### Compress PDF + +```bash curl -X POST \ -H 'content-type: application/x-www-form-urlencoded' \ --data-binary "@path/to/my/uncompressed.pdf" \ 'http://localhost:3000/compress' ``` -## uncompress pdf file +### Uncompress PDF -``` +```bash curl -X POST \ -H 'content-type: application/x-www-form-urlencoded' \ --data-binary "@path/to/my/compressed.pdf" \ 'http://localhost:3000/uncompress' ``` -## encrypt pdf file +### Encrypt PDF -``` +```bash curl -X POST \ -H 'content-type: application/x-www-form-urlencoded' \ --data-binary "@path/to/my/file.pdf" \ 'http://localhost:3000/encrypt?password=1234&userPassword=asdf&allow=Printing' ``` -options: - - password - String (required) - - userPassword - String - - allow - Enum - - Printing - - DegradedPrinting - - ModifyContents - - Assembly - - CopyContents - - ScreenReaders - - ModifyAnnotations - - FillIn - - AllFeatures - -## decrypt pdf file +**Options:** -``` +- `password` (required) - Owner password +- `userPassword` - User password +- `allow` - Permission enum: + - `Printing` + - `DegradedPrinting` + - `ModifyContents` + - `Assembly` + - `CopyContents` + - `ScreenReaders` + - `ModifyAnnotations` + - `FillIn` + - `AllFeatures` + +### Decrypt PDF + +```bash curl -X POST \ -H 'content-type: application/x-www-form-urlencoded' \ --data-binary "@path/to/my/encrypted.pdf" \ 'http://localhost:3000/decrypt?password=1234' ``` -## data fields pdf file -returns the pdf form fields as json +### Get Form Fields (JSON) -``` +Returns PDF form fields as JSON. + +```bash curl -X POST \ -H 'content-type: application/x-www-form-urlencoded' \ --data-binary "@path/to/my/pdf-form.pdf" \ 'http://localhost:3000/data/fields' ``` -## data dump pdf file -returns pdf file information as json +### Get Document Info (JSON) -``` +Returns PDF file information as JSON. + +```bash curl -X POST \ -H 'content-type: application/x-www-form-urlencoded' \ --data-binary "@path/to/my/file.pdf" \ 'http://localhost:3000/data/dump' ``` -## data fdf pdf file -returns pdf form fields as fdf format +### Get Form Fields (FDF) -``` +Returns PDF form fields in FDF format. + +```bash curl -X POST \ -H 'content-type: application/x-www-form-urlencoded' \ --data-binary "@path/to/my/pdf-form.pdf" \ 'http://localhost:3000/data/fdf' ``` -## form fill pdf file -fills pdf passed values +### Fill PDF Form -``` +Fills a PDF with the provided field values. + +```bash curl -X POST \ -H 'content-type: application/x-www-form-urlencoded' \ --data-binary "@path/to/my/pdf-form.pdf" \ 'http://localhost:3000/form/fill?field1=value1&field2=value2' ``` -arguments: - - flag - Enum - - need_appearances (default) - - flatten - - replacement_font (additional fontName can be defined) - - fontName - - - all form fields are passed with the name +**Arguments:** + +- `flag` - Enum: + - `need_appearances` (default) + - `flatten` + - `replacement_font` (requires `fontName`) +- `fontName` - Additional font name (when using `replacement_font`) +- All form fields are passed as query parameters by name ## Ports -- HTTP 3000 +| Port | Service | Description | +|------|---------|-------------| +| 3000 | HTTP | REST API server | + +## online test + +[](https://pdftk.api.datage.ch/) diff --git a/apps/poppler/README.md b/apps/poppler/README.md index 9759e7cd..3278d395 100644 --- a/apps/poppler/README.md +++ b/apps/poppler/README.md @@ -1,23 +1,51 @@ -# poppler node wrapper +# Poppler Node.js Wrapper -## Run Image +A containerized Node.js service that provides a REST API for converting PDF documents to text or HTML using Poppler utilities. -``` +## Features + +- ๐ **PDF to Text** - Extract plain text from PDFs +- ๐ **PDF to HTML** - Convert PDFs to HTML +- ๐ณ **Docker Ready** - Easy deployment with Docker +- ๐ง **REST API** - Simple HTTP interface + +## Quick Start + +### Run with Docker + +```bash docker run -p 3000:3000 --name poppler philiplehmann/poppler-server:latest ``` -## Convert pdf to text +### Run with Docker Compose +```yaml +services: + poppler: + image: philiplehmann/poppler-server:latest + ports: + - "3000:3000" + container_name: poppler ``` + +## API Endpoints + +### Convert PDF to Text + +Send the PDF as binary data in the request body with header `content-type: application/x-www-form-urlencoded`. + +```bash curl -X POST \ -H 'content-type: application/x-www-form-urlencoded' \ --data-binary "@path/to/my/document.pdf" \ 'http://localhost:3000/pdf-to-text' ``` -## Convert pdf to html +### Convert PDF to HTML -``` +Send the PDF as binary data in the request body with header `content-type: application/x-www-form-urlencoded`. + +```bash curl -X POST \ -H 'content-type: application/x-www-form-urlencoded' \ --data-binary "@path/to/my/document.pdf" \ @@ -26,4 +54,10 @@ curl -X POST \ ## Ports -- HTTP 3000 +| Port | Service | Description | +|------|---------|-------------| +| 3000 | HTTP | REST API server | + +## online test + +[](https://poppler.api.datage.ch/) diff --git a/apps/puppeteer/README.md b/apps/puppeteer/README.md index d04be5c0..8d4d1650 100644 --- a/apps/puppeteer/README.md +++ b/apps/puppeteer/README.md @@ -1,114 +1,383 @@ -# puppeteer node wrapper +# Puppeteer Node.js Wrapper -## Run Image +A containerized Node.js service that provides a REST API for converting web pages and HTML content to PDF documents and images using Puppeteer and headless Chrome. -``` -docker run -p 3000:3000 --name puppeteer philiplehmann/puppeteer:latest -``` +## Features + +- ๐ **URL to PDF** - Convert any web page to PDF +- ๐ **HTML to PDF** - Convert raw HTML content to PDF +- ๐ผ๏ธ **URL to Image** - Generate screenshots of web pages +- ๐จ **HTML to Image** - Convert HTML content to images +- โ๏ธ **Configurable** - Supports all Puppeteer PDF options +- ๐ **Fast & Lightweight** - Optimized for performance +- ๐ณ **Docker Ready** - Easy deployment with Docker +- ๐ง **REST API** - Simple HTTP interface -## Convert url to pdf +## Quick Start +### Run with Docker + +```bash +docker run -p 3000:3000 --name puppeteer-server philiplehmann/puppeteer:latest ``` -curl -X POST \ - -H 'content-type: application/json' \ - --data '{"url":"https://google.com"}' \ - 'http://localhost:3000/' + +### Run with Docker Compose + +```yaml +services: + puppeteer: + image: philiplehmann/puppeteer:latest + ports: + - "3000:3000" + container_name: puppeteer-server + environment: + - NODE_ENV=production ``` -or +### Run with Nx + +```bash +# Build the Docker image +nx build puppeteer +# Run the container +nx docker-run puppeteer + +# Serve locally for development +nx serve puppeteer ``` + +## API Endpoints + +### PDF Generation + +#### Convert URL to PDF + +```bash curl -X POST \ - -H 'content-type: application/json' \ + -H 'Content-Type: application/json' \ --data '{"url":"https://google.com"}' \ 'http://localhost:3000/pdf' ``` -## Convert html to pdf +#### Convert HTML to PDF -``` +```bash curl -X POST \ - -H 'content-type: application/json' \ - --data '{"html":"This is a test document.
"}' \ + 'http://localhost:3000/pdf' ``` -or +#### Advanced PDF Options -``` +```bash curl -X POST \ - -H 'content-type: application/json' \ - --data '{"html":"