fix: Resolve mc config permission error and add MinIO setup documentation
- Replace read-only host mount with dedicated Docker volume for mc config - Add init-mc-config.sh to initialize mc configuration with proper permissions - Create setup-mc-alias.sh script to configure MinIO connection - Add comprehensive MINIO_SETUP.md documentation - Update docker-compose.dev.yml to use mc-config volume - Update Dockerfile to run mc config initialization - Document bcrypt architecture workaround in FIX_ENV_TRUNCATION.md The mc client can now write to its configuration directory, resolving the "permission denied" error when connecting to MinIO servers. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -38,10 +38,20 @@ This script will:
|
||||
2. Use password: `admin123`
|
||||
3. You should be able to log in successfully
|
||||
|
||||
## Known Issue: bcrypt Architecture
|
||||
|
||||
Due to architecture differences (ARM vs x86), bcrypt may need to be rebuilt after container restart:
|
||||
|
||||
```bash
|
||||
# Fix bcrypt after container restart
|
||||
docker exec minio-webui-backend-dev sh -c 'rm -rf /app/node_modules/bcrypt && cd /app && npm install bcrypt' && docker restart minio-webui-backend-dev
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
If issues persist:
|
||||
1. Check that .env file exists and has proper quotes around values with special characters
|
||||
1. Check that .env file exists and has double dollar signs ($$) for escaping
|
||||
2. Ensure Docker containers were rebuilt: `docker compose -f docker-compose.dev.yml up -d --build`
|
||||
3. Check logs: `docker logs minio-webui-backend-dev`
|
||||
4. Run debug script: `./scripts/debug-auth.sh`
|
||||
4. Run debug script: `./scripts/debug-auth.sh`
|
||||
5. If bcrypt error occurs, run the fix command above
|
||||
@@ -0,0 +1,93 @@
|
||||
# MinIO Configuration for MinIO WebUI
|
||||
|
||||
## Overview
|
||||
|
||||
The MinIO WebUI requires access to a MinIO server to manage buckets and objects. You need to configure the MinIO connection details in the `.env` file.
|
||||
|
||||
## Configuration Steps
|
||||
|
||||
### 1. Update MinIO Connection Details
|
||||
|
||||
Edit your `.env` file and update the MinIO configuration:
|
||||
|
||||
```bash
|
||||
# MinIO Configuration
|
||||
DEFAULT_MINIO_ALIAS=kopiaminio # Alias name for the MinIO server
|
||||
MINIO_ENDPOINT=https://your-minio.com # Your MinIO server URL
|
||||
MINIO_ACCESS_KEY=your-access-key # MinIO access key
|
||||
MINIO_SECRET_KEY=your-secret-key # MinIO secret key
|
||||
```
|
||||
|
||||
### 2. Common MinIO Endpoints
|
||||
|
||||
- **Local MinIO**: `http://localhost:9000` or `http://host.docker.internal:9000` (from Docker)
|
||||
- **MinIO Docker**: `http://minio:9000` (if MinIO is in the same Docker network)
|
||||
- **Remote MinIO**: `https://your-minio-server.com`
|
||||
|
||||
### 3. Set Up the MinIO Alias
|
||||
|
||||
After updating the `.env` file, restart the containers and run:
|
||||
|
||||
```bash
|
||||
./scripts/setup-mc-alias.sh
|
||||
```
|
||||
|
||||
This script will:
|
||||
- Configure the MinIO client (mc) with your connection details
|
||||
- Test the connection
|
||||
- Show any connection errors
|
||||
|
||||
### 4. Troubleshooting
|
||||
|
||||
#### Permission Denied Error
|
||||
If you see "permission denied" errors, the mc config has been fixed with a dedicated volume.
|
||||
|
||||
#### Connection Refused
|
||||
- Ensure your MinIO server is running
|
||||
- Check the endpoint URL is correct
|
||||
- Verify network connectivity from the Docker container
|
||||
|
||||
#### Invalid Credentials
|
||||
- Double-check your access key and secret key
|
||||
- Ensure they match your MinIO server configuration
|
||||
|
||||
### 5. Testing the Connection
|
||||
|
||||
You can manually test the connection:
|
||||
|
||||
```bash
|
||||
# List buckets
|
||||
docker exec minio-webui-backend-dev mc ls kopiaminio
|
||||
|
||||
# Create a test bucket
|
||||
docker exec minio-webui-backend-dev mc mb kopiaminio/test-bucket
|
||||
|
||||
# Remove test bucket
|
||||
docker exec minio-webui-backend-dev mc rb kopiaminio/test-bucket
|
||||
```
|
||||
|
||||
## Example: Local MinIO Setup
|
||||
|
||||
If you're running MinIO locally:
|
||||
|
||||
1. Start MinIO:
|
||||
```bash
|
||||
docker run -p 9000:9000 -p 9001:9001 \
|
||||
-e MINIO_ROOT_USER=minioadmin \
|
||||
-e MINIO_ROOT_PASSWORD=minioadmin \
|
||||
minio/minio server /data --console-address ":9001"
|
||||
```
|
||||
|
||||
2. Update `.env`:
|
||||
```bash
|
||||
DEFAULT_MINIO_ALIAS=local-minio
|
||||
MINIO_ENDPOINT=http://host.docker.internal:9000
|
||||
MINIO_ACCESS_KEY=minioadmin
|
||||
MINIO_SECRET_KEY=minioadmin
|
||||
```
|
||||
|
||||
3. Run setup:
|
||||
```bash
|
||||
docker compose -f docker-compose.dev.yml restart backend
|
||||
./scripts/setup-mc-alias.sh
|
||||
```
|
||||
Reference in New Issue
Block a user