Compare commits

..

29 Commits

Author SHA1 Message Date
8cd2d62e22 Mark project as complete - CarPlay audio streaming server fully operational 2025-12-08 00:25:51 +00:00
8e44de6bb5 Add LIBRARY_PATH environment variable for Docker to override config.json path 2025-12-08 00:21:37 +00:00
ee433157f4 Fix Docker volume mounts and database path for proper persistence 2025-12-08 00:14:44 +00:00
159d2be52d Fix docker-compose volume mounts to not overwrite app directory 2025-12-08 00:13:11 +00:00
2ca35620d9 Add Docker support with Dockerfile, docker-compose, and deployment documentation 2025-12-07 23:47:07 +00:00
4f954d9b15 Update tasks - full Subsonic API implementation complete 2025-12-07 23:41:51 +00:00
4c5db557b2 Add all remaining Subsonic API endpoints for full Amperfy compatibility 2025-12-07 23:41:42 +00:00
75e4675110 Add artist artwork support using album covers from their tracks 2025-12-07 23:36:41 +00:00
c9a54191f3 Update tasks - music streaming working 2025-12-07 23:32:23 +00:00
f9f0d10042 Add getSong endpoint and complete CarPlay audio streaming server 2025-12-07 23:32:20 +00:00
9f29f94ae4 Add missing path import to subsonic.js 2025-12-07 23:30:51 +00:00
43bcaa88a6 Fix stream endpoint to use configured library path 2025-12-07 23:28:38 +00:00
48bfa048a0 Fix getCoverArt to properly lookup artwork by album ID 2025-12-07 23:27:19 +00:00
e0ca158bbb Add getGenres endpoint 2025-12-07 23:25:43 +00:00
4ca8547a3f Add getAlbumList and getAlbumList2 endpoints for Albums view 2025-12-07 23:24:40 +00:00
42df9a3c04 Add getArtists endpoint for ID3-based artist browsing 2025-12-07 23:21:20 +00:00
c377cb7833 Remove duplicate isDir attribute from song XML 2025-12-07 23:18:52 +00:00
6d06f7621c Fix directory structure and add isDir flags for proper Amperfy navigation 2025-12-07 23:17:27 +00:00
12a8faea53 Add getMusicDirectory endpoint for folder-based browsing in Amperfy 2025-12-07 23:14:41 +00:00
c7b66ce7ab Fix getAlbum endpoint to return only tracks for specific album instead of all tracks 2025-12-07 23:11:58 +00:00
aa720323b5 Mark Amperfy connection and CarPlay server as complete 2025-12-07 23:07:42 +00:00
a846370325 Add request logging to debug Amperfy connection issues 2025-12-07 23:04:35 +00:00
b7679eb65c Complete server setup with Cloudflare Tunnel and working Subsonic API 2025-12-07 22:58:43 +00:00
7f31e49e56 Add detailed logging for Subsonic authentication debugging 2025-12-07 22:49:13 +00:00
9b782c357d Fix scanner to read library path from config.json 2025-12-07 22:44:58 +00:00
b22e3f9f7e Auto-create audio_library folder and improve scanner error handling 2025-12-07 22:43:38 +00:00
427f229d69 Fix library path saving - auto-create directory and improve error handling 2025-12-07 22:41:09 +00:00
1392bc9f12 Add example config file 2025-12-07 22:40:12 +00:00
d87af1383d Add configurable library path with settings API and UI 2025-12-07 22:40:06 +00:00
206 changed files with 4250 additions and 32 deletions

12
.dockerignore Normal file
View File

@@ -0,0 +1,12 @@
node_modules
npm-debug.log
.git
.gitignore
*.md
.DS_Store
audio_library
artwork
*.db
.env
config.json
data

1
.gitignore vendored
View File

@@ -4,3 +4,4 @@ node_modules/
audio_library/
uploads/
.DS_Store
config.json

30
Dockerfile Normal file
View File

@@ -0,0 +1,30 @@
# Use Node.js LTS
FROM node:20-alpine
# Install dependencies for native modules
RUN apk add --no-cache python3 make g++
# Create app directory
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci --only=production
# Copy application code
COPY . .
# Create directories for data
RUN mkdir -p /data/artwork /data/music
# Expose port
EXPOSE 4000
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD node -e "require('http').get('http://localhost:4000/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"
# Start the server
CMD ["npm", "start"]

158
README.Docker.md Normal file
View File

@@ -0,0 +1,158 @@
# Docker Deployment Guide
## Quick Start
### 1. Build the Docker image
```bash
docker build -t carplay-audio-server .
```
### 2. Run with Docker Compose (Recommended)
Edit `docker-compose.yml` and update the music library path:
```yaml
volumes:
- /path/to/your/music:/data/music:ro # Change this!
```
Then start:
```bash
docker-compose up -d
```
### 3. Run with Docker directly
```bash
docker run -d \
--name carplay-audio \
-p 4000:4000 \
-v /path/to/your/music:/data/music:ro \
-v $(pwd)/data/artwork:/app/artwork \
-v $(pwd)/data/database:/app \
carplay-audio-server
```
## Initial Setup
### Scan your library
```bash
# Using docker-compose
docker-compose exec carplay-audio npm run scan
# Using docker
docker exec carplay-audio npm run scan
```
### Access the admin panel
Open your browser to: `http://localhost:4000`
### Configure Amperfy
- **Server URL**: `http://YOUR-SERVER-IP:4000`
- **Username**: `admin`
- **Password**: `admin`
## Configuration
### Environment Variables
- `PORT` - Server port (default: 4000)
- `NODE_ENV` - Environment (production/development)
- `SCAN_ON_START` - Set to "true" to scan library on container start
### Volumes
- `/data/music` - Your music library (read-only)
- `/app/artwork` - Extracted album artwork
- `/app/audio_server.db` - SQLite database
- `/app/config.json` - Server configuration
## Management
### View logs
```bash
docker-compose logs -f carplay-audio
```
### Restart server
```bash
docker-compose restart carplay-audio
```
### Stop server
```bash
docker-compose down
```
### Update and rebuild
```bash
git pull
docker-compose down
docker-compose build
docker-compose up -d
```
## Behind Reverse Proxy
If using nginx or Cloudflare Tunnel, configure it to proxy to `http://localhost:4000`.
Example nginx config:
```nginx
location / {
proxy_pass http://localhost:4000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
```
## Troubleshooting
### Container won't start
Check logs:
```bash
docker-compose logs carplay-audio
```
### Music not showing
Rescan the library:
```bash
docker-compose exec carplay-audio npm run scan
```
### Permission issues
Ensure the music directory is readable:
```bash
chmod -R 755 /path/to/your/music
```
## Production Deployment
1. **Change default credentials** in `src/routes/subsonic.js`
2. **Use HTTPS** via reverse proxy
3. **Set up automatic backups** of the database
4. **Monitor logs** for errors
5. **Set resource limits** in docker-compose.yml:
```yaml
deploy:
resources:
limits:
cpus: '2'
memory: 1G
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

Some files were not shown because too many files have changed in this diff Show More