Clarify that the project implements *parts* of the OpenSubsonic API. Add a section detailing the current status and explicitly list implemented features. Update installation steps to include installing the Diesel CLI. Add an example for the `createUser.view` endpoint.
3.8 KiB
SoundSonic
A Rust-based server implementing parts of the OpenSubsonic API protocol.
Overview
SoundSonic is a lightweight server built with Rust that implements the OpenSubsonic API specification. The long-term goal is to support streaming a local music collection to OpenSubsonic-compatible clients.
Status
This project is under active development. Only a small subset of the OpenSubsonic API is implemented today (see API Endpoints).
Features
- OpenSubsonic Response Envelope: Consistent
subsonic-responseJSON format - OpenSubsonic Extensions Endpoint: Exposes supported extensions via
getOpenSubsonicExtensions - User Creation:
createUser.viewendpoint with role/permission fields - SQLite + Diesel: Lightweight local storage
- Axum + Tokio: Async HTTP server runtime
Technologies
- Rust (Edition 2024)
- Axum - Web framework
- Tokio - Async runtime
- Diesel - ORM with SQLite
- Serde - Serialization/deserialization
Prerequisites
- Rust (latest stable version)
- SQLite (system library)
- Diesel CLI (for database migrations)
Installation
- Clone the repository:
git clone <your-repository-url>
cd soundsonic
- Install Diesel CLI (SQLite):
cargo install diesel_cli --no-default-features --features sqlite
- Set up the database URL:
export DATABASE_URL=database.db
Or create a .env file:
DATABASE_URL=database.db
- Run database migrations:
diesel migration run
- Build and run the server:
cargo run
The server will start on http://0.0.0.0:3311.
API Endpoints
All endpoints are nested under the /rest prefix.
System
GET /rest/getOpenSubsonicExtensionsPOST /rest/getOpenSubsonicExtensions
User Management
GET /rest/createUser.viewPOST /rest/createUser.view(acceptsapplication/x-www-form-urlencoded)
Example:
curl -X POST 'http://localhost:3311/rest/createUser.view' \
-d 'username=alice&password=secret&email=alice@example.com&adminRole=true&streamRole=true'
Request/Response Format
All API responses follow the OpenSubsonic response format:
{
"subsonic-response": {
"status": "ok",
"version": "1.16.1",
"type": "SoundSonic",
"serverVersion": "1.16.1",
"openSubsonic": true
}
}
User Roles
Users can have the following permissions:
adminRole- Administrative privilegesstreamRole- Stream musicdownloadRole- Download musicuploadRole- Upload musicplaylistRole- Manage playlistscoverArtRole- Manage cover artcommentRole- Add commentspodcastRole- Access podcastsshareRole- Share contentjukeboxRole- Jukebox controlvideoConversionRole- Video conversionsettingsRole- Change settingsldapAuthenticated- LDAP authentication
Configuration
The server can be configured via environment variables:
DATABASE_URL- Path to the SQLite database file (required)
Development
Running in development mode:
cargo run
Building for production:
cargo build --release
Database schema changes:
diesel migration generate <migration_name>
diesel migration run
Supported OpenSubsonic Extensions
apiKeyAuthentication- API key-based authenticationformPost- Form-based POST requestsindexBasedQueue- Index-based queue managementsongLyrics- Song lyrics supporttranscodeOffset- Transcoding offset supporttranscoding- Audio transcoding capabilities
License
MIT (see LICENSE).
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Acknowledgments
- OpenSubsonic - The API specification this server implements
- Subsonic - The original music streaming server