Skip to content

SemanticLab/block-editor

Repository files navigation

S3 File Manager with Wikibase Authentication

A Node.js Express application for managing text files in AWS S3 with Wikibase authentication, running in Docker.

Features

  • Browse and navigate S3 bucket folders
  • Search for files within the current directory
  • Edit and save text files directly in the browser
  • Authentication via Wikibase (base.semlab.io)
  • Dockerized deployment with volume mounting

Prerequisites

  • Docker and Docker Compose
  • AWS Account with S3 access
  • Wikibase account at base.semlab.io

Setup

  1. Clone this repository

  2. Create a .env file from the example:

    cp .env.example .env
  3. Configure your .env file with:

    • AWS credentials (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
    • AWS region (AWS_REGION)
    • S3 bucket name (S3_BUCKET_NAME)
    • Session secret (SESSION_SECRET)
    • Wikibase URL (default: https://base.semlab.io)

Running with Docker Compose

Build and start the container:

docker-compose up --build

The application will be available at http://localhost:3000

To run in detached mode:

docker-compose up -d --build

To stop the application:

docker-compose down

Development

For local development without Docker:

  1. Install dependencies:

    npm install
  2. Start the development server:

    npm run dev

Application Structure

  • / - Main file browser interface (requires authentication)
  • /login - Login page with Wikibase authentication
  • /api/s3/* - API endpoints for S3 operations

Security Notes

  • Always use strong session secrets in production
  • Ensure AWS credentials have minimal required permissions
  • The application authenticates against the configured Wikibase instance
  • All S3 operations require authentication

AWS S3 Permissions

The AWS credentials need the following permissions for the configured bucket:

  • s3:ListBucket
  • s3:GetObject
  • s3:PutObject
  • s3:DeleteObject

Troubleshooting

  • Login issues: Verify your Wikibase credentials and that the WIKIBASE_URL is correct
  • S3 access errors: Check AWS credentials and bucket permissions
  • Docker issues: Ensure Docker daemon is running and ports are not in use

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published