FileShare is a Rails application for uploading files and sharing them with private, internal, or public visibility. Users sign in with Microsoft Entra ID, uploads are stored with Active Storage, and expired uploads are removed by a scheduled Solid Queue job.
- Ruby 4.0.5, as configured in
mise.toml - Bundler
- Yarn
- SQLite 3
- libvips, for Active Storage image processing
Install dependencies and prepare the database:
bin/setup --skip-serverCreate a local .env file for development secrets. At minimum, Entra authentication needs:
ENTRA_CLIENT_ID=your-client-id
ENTRA_CLIENT_SECRET=your-client-secret
ENTRA_TENANT_ID=your-tenant-idENTRA_TENANT_ID can be omitted to use common, but a tenant-specific value is usually preferred for an organization-owned app.
Start the Rails server, CSS watcher, and Solid Queue worker:
bin/devThe app runs at http://localhost:3000 by default. Override the port with:
PORT=3001 bin/devRun the test suite:
bin/rails testRun CI checks:
bin/ciThe project uses Solid Queue. In development, Procfile.dev starts the worker with:
bin/jobsconfig/recurring.yml schedules FileCleanupJob in development to delete uploads with expires_at before the current date.
Development and test use local disk storage.
Production defaults to Azure Blob Storage through:
ACTIVE_STORAGE_SERVICE=azureThe Azure container name is configured as fileshare in config/storage.yml.
| Name | Required when | Description |
|---|---|---|
ENTRA_CLIENT_ID |
Development and production authentication | Microsoft Entra application client ID used by OmniAuth. |
ENTRA_CLIENT_SECRET |
Development and production authentication | Microsoft Entra application client secret used by OmniAuth. |
RAILS_MASTER_KEY |
Production | Decrypts Rails credentials. Required by the production Docker image and Rails encrypted credentials. |
AZ_STORAGE_ACCOUNT |
Production when ACTIVE_STORAGE_SERVICE=azure |
Azure Storage account name for Active Storage. |
AZ_STORAGE_ACCESS_KEY |
Production when ACTIVE_STORAGE_SERVICE=azure |
Azure Storage account access key for Active Storage. |
| Name | Default | Description |
|---|---|---|
ENTRA_TENANT_ID |
common |
Microsoft Entra tenant ID. Use a tenant-specific value to restrict sign-in to one tenant. |
ACTIVE_STORAGE_SERVICE |
azure in production |
Active Storage service name. Set to local for disk-backed production storage if needed. |
RAILS_MAX_THREADS |
5 |
Database connection pool size and Rails thread count input. |
PORT |
3000 in development |
Local server port used by bin/dev. |
WEB_CONCURRENCY |
unset | Puma worker count. |
SOLID_QUEUE_IN_PUMA |
unset | Enables the Solid Queue Puma plugin when present. |
PIDFILE |
unset | Puma PID file path. |
CI |
unset | Enables eager loading in the test environment when present. |
Check Entra environment configuration:
ruby script/check_entra_config.rbBuild CSS once:
yarn build:cssRun only the file cleanup job test:
bin/rails test test/jobs/file_cleanup_job_test.rb