950a8fc441
Build and Push Outline MCP Docker Image / build (push) Successful in 14s
Implement 3 new MCP tools: - attach_file_to_document(document_id, file_path) - upload_image_to_document(image_path, document_id, alt_text) - import_file_to_outline(file_path, collection_id, parent_document_id) Security: - Restrict file access to /tmp via _validate_file_path with realpath - 50MB max file size enforced client-side - Symlink traversal blocked Technical: - Extract shared _upload_attachment() helper - Stream files to presigned URLs instead of loading into memory - Add combined lifespan to close OutlineClient on shutdown - Update CI workflow with modern action versions and PR triggers Tests: - Add 28 tests covering path validation, size limits, upload flow, error handling, symlink traversal, and multipart imports
50 lines
1.1 KiB
YAML
50 lines
1.1 KiB
YAML
name: Build and Push Outline MCP Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- master
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: docker
|
|
container:
|
|
image: catthehacker/ubuntu:act-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install uv
|
|
uv sync --extra dev
|
|
|
|
- name: Run tests
|
|
run: uv run pytest tests/ -v
|
|
|
|
- name: Login to Gitea Container Registry
|
|
if: github.event_name == 'push'
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: gitea.ext.ben.io
|
|
username: ${{ gitea.actor }}
|
|
password: ${{ secrets.CR_PAT }}
|
|
|
|
- name: Build and Push
|
|
if: github.event_name == 'push'
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: gitea.ext.ben.io/${{ gitea.repository }}:latest
|