Diffuse
A music player that connects to your cloud & distributed storage
Return to the application
About
CORS
There’s only one thing you need to do yourself so that the service you chose will work with the application, and that’s setting up CORS (Cross-Origin Resource Sharing). Here are the instructions you’ll need for each service:
Amazon S3
You can find the CORS configuration editor under the “Permissions” tab, on the S3 AWS Console.
[
{
"AllowedHeaders": [
"Range"
],
"AllowedMethods": [
"GET",
"HEAD"
],
"AllowedOrigins": [
"*"
],
"ExposeHeaders": [
"Content-Length",
"Content-Type"
],
"MaxAgeSeconds": 31536000
}
]
BTFS
Add the domain of the app, with the protocol, to the list of allowed origins.
btfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["https://diffuse.sh", "http://diffuse.sh.ipns.localhost:8080", "http://127.0.0.1:44999"]'
You can also make this change in the Web UI, you’ll find it under “Settings → BTFS Config”.
{
"API": {
"HTTPHeaders": {
"Access-Control-Allow-Origin": [
... // Default BTFS values
"https://diffuse.sh", // 🎵 Default
"http://diffuse.sh.ipns.localhost:8080", // IPNS
"http://127.0.0.1:44999" // Electron app
]
}
}
}
Dropbox
Not necessary.
Google Drive
Not necessary.
IPFS
Add the domain of the app, with the protocol, to the list of allowed origins.
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["https://diffuse.sh", "http://diffuse.sh.ipns.localhost:8080", "http://127.0.0.1:44999"]'
You can also make this change in the Web UI, you’ll find it under “Settings → IPFS Config”.
{
"API": {
"HTTPHeaders": {
"Access-Control-Allow-Origin": [
... // Default IPFS values
"https://diffuse.sh", // 🎵 Default
"http://diffuse.sh.ipns.localhost:8080", // IPNS through IPFS Companion
"http://127.0.0.1:44999" // Electron app
]
}
}
}
Microsoft Azure Storage
You can find the CORS configuration under the “Settings -> CORS”.
Then fill in the following in the input boxes (left to right):
ALLOWED ORIGINS *
ALLOWED METHODS GET, HEAD
ALLOWED HEADERS Range
EXPOSED HEADERS Content-Length, Content-Range
MAX AGE 0
WebDAV
Depends on your WebDAV server.
Example setup for Henrique Dias’s WebDAV server:
cors:
enabled: true
credentials: true
allowed_headers:
- Authorization
- Content-Type
- Depth
- Range
allowed_methods:
- GET
- HEAD
- PROPFIND
allowed_hosts:
- https://diffuse.sh
- http://127.0.0.1:44999
exposed_headers:
- Content-Length
- Content-Type