docs(config): Update README with JSON configuration format #24

Merged
maj merged 1 commits from setup-build-config-system into develop 2026-01-28 18:34:02 +00:00
Owner

Overview

Updates documentation to reflect the actual JSON-based configuration system that was already implemented. Resolves Issue #6.

Changes

Updated README.md

  • Quick Start: Changed config example from INI-style to JSON format
  • Configuration Section: Complete rewrite with:
    • JSON configuration structure examples
    • Detailed environment variable override documentation
    • CI/CD usage examples
    • All supported environment variables documented

Configuration System Features

Files

  • config.example.json - Template configuration with all options
  • scripts/load-config.sh - Loads JSON and exports environment variables
  • scripts/validate-config.sh - Validates required fields and formats
  • docs/configuration.md - Comprehensive configuration guide

Supported Environment Variables

  • NEXTCLOUD_URL - Nextcloud server URL (required)
  • NEXTCLOUD_USER - Username for authentication (required)
  • NEXTCLOUD_PASSWORD - Password or app password (required)
  • MAX_RECENT_FOLDERS - Number of recent folders to track (default: 5)
  • UPLOAD_CHUNK_SIZE - Upload chunk size in bytes (default: 10MB)
  • CONFIG_FILE - Path to config file (default: config.json)

Key Features

  • 🔒 Environment variables take precedence over JSON values
  • Validation catches missing required fields
  • URL format validation (enforces http:// or https://)
  • ⚠️ Warns when using insecure HTTP
  • Numeric field validation
  • 🎯 CI/CD friendly with env var injection

Testing

All acceptance criteria verified:

✓ config.example.json created and documented
✓ load-config.sh correctly parses JSON
✓ Environment variables take precedence over JSON
✓ Validation script catches missing required fields
✓ Documentation clear for new developers
✓ CI can inject credentials via env vars

Test Results

  1. Load configuration: Successfully loads from JSON
  2. Environment override: Env vars correctly override JSON values
  3. Validation failure: Properly fails when required fields missing
  4. URL validation: Enforces protocol and warns on HTTP
  5. Numeric validation: Catches non-numeric values

Usage Examples

Local development:

cp config.example.json config.json
# Edit config.json with credentials
source scripts/load-config.sh
./scripts/validate-config.sh

CI/CD pipeline:

export NEXTCLOUD_URL=https://cloud.example.com
export NEXTCLOUD_USER=ci-user
export NEXTCLOUD_PASSWORD=ci-password
source scripts/load-config.sh
make test

Closes #6


Note: The configuration scripts were already implemented; this PR only updates the documentation to match the actual implementation.

## Overview Updates documentation to reflect the actual JSON-based configuration system that was already implemented. Resolves Issue #6. ## Changes ### Updated README.md - **Quick Start**: Changed config example from INI-style to JSON format - **Configuration Section**: Complete rewrite with: - JSON configuration structure examples - Detailed environment variable override documentation - CI/CD usage examples - All supported environment variables documented ## Configuration System Features ### Files - ✅ `config.example.json` - Template configuration with all options - ✅ `scripts/load-config.sh` - Loads JSON and exports environment variables - ✅ `scripts/validate-config.sh` - Validates required fields and formats - ✅ `docs/configuration.md` - Comprehensive configuration guide ### Supported Environment Variables - `NEXTCLOUD_URL` - Nextcloud server URL (required) - `NEXTCLOUD_USER` - Username for authentication (required) - `NEXTCLOUD_PASSWORD` - Password or app password (required) - `MAX_RECENT_FOLDERS` - Number of recent folders to track (default: 5) - `UPLOAD_CHUNK_SIZE` - Upload chunk size in bytes (default: 10MB) - `CONFIG_FILE` - Path to config file (default: config.json) ### Key Features - 🔒 Environment variables take precedence over JSON values - ✅ Validation catches missing required fields - ✅ URL format validation (enforces http:// or https://) - ⚠️ Warns when using insecure HTTP - ✅ Numeric field validation - 🎯 CI/CD friendly with env var injection ## Testing All acceptance criteria verified: ```bash ✓ config.example.json created and documented ✓ load-config.sh correctly parses JSON ✓ Environment variables take precedence over JSON ✓ Validation script catches missing required fields ✓ Documentation clear for new developers ✓ CI can inject credentials via env vars ``` ### Test Results 1. **Load configuration**: Successfully loads from JSON 2. **Environment override**: Env vars correctly override JSON values 3. **Validation failure**: Properly fails when required fields missing 4. **URL validation**: Enforces protocol and warns on HTTP 5. **Numeric validation**: Catches non-numeric values ## Usage Examples **Local development:** ```bash cp config.example.json config.json # Edit config.json with credentials source scripts/load-config.sh ./scripts/validate-config.sh ``` **CI/CD pipeline:** ```bash export NEXTCLOUD_URL=https://cloud.example.com export NEXTCLOUD_USER=ci-user export NEXTCLOUD_PASSWORD=ci-password source scripts/load-config.sh make test ``` ## Related Issues Closes #6 --- **Note**: The configuration scripts were already implemented; this PR only updates the documentation to match the actual implementation.
maj added 9 commits 2026-01-27 16:53:26 +00:00
Update documentation to reflect the actual JSON-based configuration
system instead of the old INI-style format.

Changes:
- Updated Quick Start section to reference config.example.json
- Rewrote Configuration section with JSON examples
- Added detailed environment variable override documentation
- Included CI/CD usage examples
- Documented all supported environment variables

All acceptance criteria from Issue #6 verified:
✓ config.example.json created and documented
✓ load-config.sh correctly parses JSON
✓ Environment variables take precedence over JSON
✓ Validation script catches missing required fields
✓ Documentation clear for new developers
✓ CI can inject credentials via env vars

Related: #6
maj merged commit 2ed2177577 into develop 2026-01-28 18:34:02 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: maj/nextcloud-share#24