+2
CHANGELOG.md
+2
CHANGELOG.md
···
5
5
- **Improve audio playback, processing and error handling**.
6
6
- **Added collections, an alternative to playlists**. Tracks can only appear once in a collection and cannot be ordered.
7
7
- **Basic setup for themes**.
8
+
- **Deprecated Google Drive support**. Google Drive sources can still be used, but no longer added through the UI.
9
+
- Removed BTFS support.
8
10
- No longer resets shuffle history when the collection or search changes.
9
11
- WebDAV improvements.
10
12
- Command palette improvements.
+1
-2
README.md
+1
-2
README.md
···
21
21
- [Azure Blob Storage](https://azure.microsoft.com/en-us/services/storage/blobs/)
22
22
- [Azure File Storage](https://azure.microsoft.com/en-us/services/storage/files/)
23
23
- [Dropbox](https://dropbox.com/)
24
-
- [Google Drive](https://drive.google.com/)
25
24
- [IPFS](https://ipfs.io/)
26
25
- [WebDAV](https://en.wikipedia.org/wiki/WebDAV)
27
26
···
41
40
42
41
Diffuse is a static web application, which means it's just HTML, CSS, and Javascript. No REST API, database, or anything backend-related involved. The app uses a hash (aka. fragment-based) routing system, so you don't need any special server rules for routing. You can download a pre-build web-only version of Diffuse on the [releases](https://github.com/icidasset/diffuse/releases) page. Diffuse uses service workers, so you may need HTTPS for it to work smoothly in certain browsers.
43
42
44
-
I should also note that some source services use OAuth, so you'll need to use your own application credentials (eg. Google Drive client ID + secret). That said, if you're working locally, you can use `http://localhost:8000` or `http://127.0.0.1:44999` to use the default ones, that's what the old Electron app was using.
43
+
I should also note that some source services use OAuth, so you'll need to use your own application credentials (eg. Dropbox). That said, if you're working locally, you can use `http://localhost:8000` or `http://127.0.0.1:44999` to use the default ones, that's what the old Electron app was using.
45
44
46
45
In short:
47
46
- Diffuse is a static, serverless web application
-13
src/Core/Themes/Sunrise/Sources/Form.elm
-13
src/Core/Themes/Sunrise/Sources/Form.elm
···
226
226
AzureFile ->
227
227
corsWarning "CORS__Azure"
228
228
229
-
Btfs ->
230
-
corsWarning "CORS__BTFS"
231
-
232
229
Dropbox ->
233
230
[]
234
231
···
414
411
415
412
AzureFile ->
416
413
nothing
417
-
418
-
Btfs ->
419
-
howNote
420
-
[ inline [ "font-semibold" ] [ text "Diffuse will try to use the default local gateway" ]
421
-
, text "."
422
-
, lineBreak
423
-
, text "If you would like to use another gateway, please provide it below."
424
-
, lineBreak
425
-
, text "This is basically the same as the IPFS implementation, just with a different prefix."
426
-
]
427
414
428
415
Dropbox ->
429
416
howNote
-5
src/Library/Sources.elm
-5
src/Library/Sources.elm
···
43
43
= AmazonS3
44
44
| AzureBlob
45
45
| AzureFile
46
-
| Btfs
47
46
| Dropbox
48
47
| Google
49
48
| Ipfs
···
59
58
, ( "azure_blob", AzureBlob )
60
59
, ( "azurefile", AzureFile )
61
60
, ( "azure_file", AzureFile )
62
-
, ( "btfs", Btfs )
63
61
, ( "dropbox", Dropbox )
64
62
, ( "google", Google )
65
63
, ( "ipfs", Ipfs )
···
105
103
106
104
AzureFile ->
107
105
False
108
-
109
-
Btfs ->
110
-
True
111
106
112
107
Dropbox ->
113
108
False
-36
src/Library/Sources/Services.elm
-36
src/Library/Sources/Services.elm
···
9
9
import Sources.Services.AmazonS3 as AmazonS3
10
10
import Sources.Services.AzureBlob as AzureBlob
11
11
import Sources.Services.AzureFile as AzureFile
12
-
import Sources.Services.Btfs as Btfs
13
12
import Sources.Services.Dropbox as Dropbox
14
13
import Sources.Services.Google as Google
15
14
import Sources.Services.Ipfs as Ipfs
···
33
32
AzureFile ->
34
33
AzureFile.initialData
35
34
36
-
Btfs ->
37
-
Btfs.initialData
38
-
39
35
Dropbox ->
40
36
Dropbox.initialData
41
37
···
61
57
AzureFile ->
62
58
AzureFile.makeTrackUrl
63
59
64
-
Btfs ->
65
-
Btfs.makeTrackUrl
66
-
67
60
Dropbox ->
68
61
Dropbox.makeTrackUrl
69
62
···
95
88
AzureFile ->
96
89
AzureFile.makeTree
97
90
98
-
Btfs ->
99
-
Btfs.makeTree
100
-
101
91
Dropbox ->
102
92
Dropbox.makeTree
103
93
···
123
113
AzureFile ->
124
114
AzureFile.parseErrorResponse
125
115
126
-
Btfs ->
127
-
Btfs.parseErrorResponse
128
-
129
116
Dropbox ->
130
117
Dropbox.parseErrorResponse
131
118
···
151
138
AzureFile ->
152
139
AzureFile.parsePreparationResponse
153
140
154
-
Btfs ->
155
-
Btfs.parsePreparationResponse
156
-
157
141
Dropbox ->
158
142
Dropbox.parsePreparationResponse
159
143
···
179
163
AzureFile ->
180
164
AzureFile.parseTreeResponse
181
165
182
-
Btfs ->
183
-
Btfs.parseTreeResponse
184
-
185
166
Dropbox ->
186
167
Dropbox.parseTreeResponse
187
168
···
206
187
207
188
AzureFile ->
208
189
AzureFile.postProcessTree
209
-
210
-
Btfs ->
211
-
Btfs.postProcessTree
212
190
213
191
Dropbox ->
214
192
Dropbox.postProcessTree
···
241
219
AzureFile ->
242
220
AzureFile.prepare
243
221
244
-
Btfs ->
245
-
Btfs.prepare
246
-
247
222
Dropbox ->
248
223
Dropbox.prepare
249
224
···
269
244
AzureFile ->
270
245
AzureFile.properties
271
246
272
-
Btfs ->
273
-
Btfs.properties
274
-
275
247
Dropbox ->
276
248
Dropbox.properties
277
249
···
301
273
"AzureFile" ->
302
274
Just AzureFile
303
275
304
-
"Btfs" ->
305
-
Just Btfs
306
-
307
276
"Dropbox" ->
308
277
Just Dropbox
309
278
···
332
301
AzureFile ->
333
302
"AzureFile"
334
303
335
-
Btfs ->
336
-
"Btfs"
337
-
338
304
Dropbox ->
339
305
"Dropbox"
340
306
···
356
322
[ ( typeToKey AmazonS3, "Amazon S3" )
357
323
, ( typeToKey AzureBlob, "Azure Blob Storage" )
358
324
, ( typeToKey AzureFile, "Azure File Storage" )
359
-
, ( typeToKey Btfs, "BTFS" )
360
325
, ( typeToKey Dropbox, "Dropbox" )
361
-
, ( typeToKey Google, "Google Drive" )
362
326
, ( typeToKey Ipfs, "IPFS" )
363
327
, ( typeToKey WebDav, "WebDAV" )
364
328
]
-121
src/Library/Sources/Services/Btfs.elm
-121
src/Library/Sources/Services/Btfs.elm
···
1
-
module Sources.Services.Btfs exposing (..)
2
-
3
-
{-| BTFS Service.
4
-
5
-
Resources:
6
-
7
-
- <https://docs.btfs.io/>
8
-
9
-
-}
10
-
11
-
import Dict
12
-
import Sources exposing (Property, SourceData)
13
-
import Sources.Processing exposing (..)
14
-
import Sources.Services.Ipfs as Ipfs
15
-
import Time
16
-
17
-
18
-
19
-
-- PROPERTIES
20
-
-- 📟
21
-
22
-
23
-
defaults =
24
-
{ gateway = ""
25
-
, name = "Music from BTFS"
26
-
}
27
-
28
-
29
-
defaultGateway =
30
-
"http://127.0.0.1:8080"
31
-
32
-
33
-
{-| The list of properties we need from the user.
34
-
35
-
Tuple: (property, label, placeholder, isPassword)
36
-
Will be used for the forms.
37
-
38
-
-}
39
-
properties : List Property
40
-
properties =
41
-
[ { key = "directoryHash"
42
-
, label = "Directory object hash / DNSLink domain"
43
-
, placeholder = "QmVLDAhCY3X9P2u"
44
-
, password = False
45
-
}
46
-
, { key = "gateway"
47
-
, label = "Gateway (Optional)"
48
-
, placeholder = defaultGateway
49
-
, password = False
50
-
}
51
-
]
52
-
53
-
54
-
{-| Initial data set.
55
-
-}
56
-
initialData : SourceData
57
-
initialData =
58
-
Dict.fromList
59
-
[ ( "directoryHash", "" )
60
-
, ( "name", defaults.name )
61
-
, ( "gateway", defaults.gateway )
62
-
]
63
-
64
-
65
-
66
-
-- PREPARATION
67
-
68
-
69
-
prepare =
70
-
Ipfs.prepare
71
-
72
-
73
-
74
-
-- TREE
75
-
76
-
77
-
{-| Create a directory tree.
78
-
-}
79
-
makeTree =
80
-
Ipfs.makeTree
81
-
82
-
83
-
{-| Re-export parser functions.
84
-
-}
85
-
parsePreparationResponse =
86
-
Ipfs.parsePreparationResponse
87
-
88
-
89
-
parseTreeResponse =
90
-
Ipfs.parseTreeResponse
91
-
92
-
93
-
parseErrorResponse =
94
-
Ipfs.parseErrorResponse
95
-
96
-
97
-
98
-
-- POST
99
-
100
-
101
-
{-| Post process the tree results.
102
-
103
-
!!! Make sure we only use music files that we can use.
104
-
105
-
-}
106
-
postProcessTree =
107
-
Ipfs.postProcessTree
108
-
109
-
110
-
111
-
-- TRACK URL
112
-
113
-
114
-
{-| Create a public url for a file.
115
-
116
-
We need this to play the track.
117
-
118
-
-}
119
-
makeTrackUrl : Time.Posix -> String -> SourceData -> HttpMethod -> String -> String
120
-
makeTrackUrl _ _ srcData _ path =
121
-
Ipfs.extractGateway srcData ++ "/btfs/" ++ Ipfs.rootHash srcData ++ "/" ++ Ipfs.encodedPath path
-34
src/Static/About/CORS.md
-34
src/Static/About/CORS.md
···
42
42
]
43
43
```
44
44
45
-
<div id="CORS__BTFS" />
46
-
47
-
#### BTFS
48
-
49
-
Add the domain of the app, with the protocol, to the __list of allowed origins__.
50
-
51
-
```shell
52
-
btfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["https://diffuse.sh", "http://diffuse.sh.ipns.localhost:8080", "http://127.0.0.1:44999"]'
53
-
```
54
-
55
-
You can also make this change in the Web UI, you'll find it under "Settings → BTFS Config".
56
-
57
-
```javascript
58
-
{
59
-
"API": {
60
-
"HTTPHeaders": {
61
-
"Access-Control-Allow-Origin": [
62
-
... // Default BTFS values
63
-
64
-
"https://diffuse.sh", // 🎵 Default
65
-
"http://diffuse.sh.ipns.localhost:8080", // IPNS
66
-
"http://127.0.0.1:44999" // Electron app
67
-
]
68
-
}
69
-
}
70
-
}
71
-
```
72
-
73
45
<div id="CORS__Dropbox" />
74
46
75
47
#### Dropbox
76
-
77
-
_Not necessary._
78
-
79
-
<div id="CORS__Google-Drive" />
80
-
81
-
#### Google Drive
82
48
83
49
_Not necessary._
84
50
-32
src/Static/About/Dev.md
-32
src/Static/About/Dev.md
···
60
60
directoryPath
61
61
```
62
62
63
-
### BTFS
64
-
65
-
```yaml
66
-
kind:
67
-
btfs
68
-
69
-
data:
70
-
# Required
71
-
directoryHash
72
-
name
73
-
74
-
# Optional
75
-
gateway
76
-
```
77
-
78
63
### Dropbox
79
64
80
65
```yaml
···
89
74
90
75
# Optional
91
76
directoryPath
92
-
```
93
-
94
-
### Google
95
-
96
-
```yaml
97
-
kind:
98
-
google
99
-
100
-
data:
101
-
# Required
102
-
authCode
103
-
clientId
104
-
clientSecret
105
-
name
106
-
107
-
# Optional
108
-
folderId
109
77
```
110
78
111
79
### IPFS
-1
src/Static/About/Index.md
-1
src/Static/About/Index.md
···
20
20
- [Azure Blob Storage](https://azure.microsoft.com/en-us/services/storage/blobs/)
21
21
- [Azure File Storage](https://azure.microsoft.com/en-us/services/storage/files/)
22
22
- [Dropbox](https://dropbox.com/)
23
-
- [Google Drive](https://drive.google.com/)
24
23
- [IPFS](https://ipfs.io/) <small>(supports DNSLink & IPNS)</small>
25
24
- [WebDAV](https://en.wikipedia.org/wiki/WebDAV)
26
25