Commit Graph

344 Commits

Author SHA1 Message Date
Jannis Mattheis
e8b88ab409 Merge pull request #356 from cyb3rko/images-basic-auth
Basic auth support for images
2024-07-07 09:12:54 +02:00
Jannis Mattheis
d741e678a8 refactor: remove user/pass replacement 2024-07-07 09:05:58 +02:00
Jannis Mattheis
337af76b58 fix: log image load errors and show placeholder on error 2024-06-22 13:21:09 +02:00
Niko Diamadis
7d6399b087 Replace image basic auth authenticator with interceptor 2024-06-20 10:08:36 +02:00
Niko Diamadis
0cd644ed0d Update library dependencies 2024-06-19 14:36:22 +02:00
Niko Diamadis
c6dfeda162 Add basic auth support for images via URL 2024-06-18 21:23:48 +02:00
Jannis Mattheis
ac27d9ec6d fix: image loading when using markdown img and bigImageUrl
When receiving a message with the same image in the markdown body and in
the extras client::notification.bigImageUrl, then there is a clash on
the file system.

One request succeeds and the other fails with the following error. This
commit ensures that there is only one coil image loader instance, so
that there shouldn't be file system race conditions.

    WebSocket(1): received message {"id":845,"appid":21,...}
    Failed - http://192.168.178.2:8000/1.jpg?v=1718369188 - java.lang.IllegalStateException: closed
    java.lang.IllegalStateException: closed
        at okio.RealBufferedSource.rangeEquals(RealBufferedSource.kt:466)
        at okio.RealBufferedSource.rangeEquals(RealBufferedSource.kt:130)
        at coil.decode.SvgDecodeUtils.isSvg(DecodeUtils.kt:19)
        at coil.decode.SvgDecoder$Factory.isApplicable(SvgDecoder.kt:104)
        at coil.decode.SvgDecoder$Factory.create(SvgDecoder.kt:99)
        at coil.ComponentRegistry.newDecoder(ComponentRegistry.kt:100)
        at coil.intercept.EngineInterceptor.decode(EngineInterceptor.kt:197)
        at coil.intercept.EngineInterceptor.access$decode(EngineInterceptor.kt:42)
        at coil.intercept.EngineInterceptor$execute$executeResult$1.invokeSuspend(EngineInterceptor.kt:131)
        at coil.intercept.EngineInterceptor$execute$executeResult$1.invoke(EngineInterceptor.kt)
        at coil.intercept.EngineInterceptor$execute$executeResult$1.invoke(EngineInterceptor.kt)
        at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78)
        at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:167)
        at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
        at coil.intercept.EngineInterceptor.execute(EngineInterceptor.kt:130)
        at coil.intercept.EngineInterceptor.access$execute(EngineInterceptor.kt:42)
        at coil.intercept.EngineInterceptor$execute$1.invokeSuspend(EngineInterceptor.kt)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
        at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
        at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
    Successful (NETWORK) - http://192.168.178.2:8000/1.jpg?v=1718369188
2024-06-14 15:18:55 +02:00
Jannis Mattheis
b9b767f5d7 Merge pull request #344 from cyb3rko/client-certificate-auth
Client certificate authentication (mTLS)
2024-06-13 21:43:18 +02:00
Jannis Mattheis
2dddbe4d8b Remove unused caCertCN setting 2024-06-13 21:32:29 +02:00
Niko Diamadis
cdb807c806 Close certificate InputStream after use 2024-06-11 21:13:04 +02:00
Niko Diamadis
9d2d49794b Keep AdvancedDialog button always enabled 2024-06-11 21:12:06 +02:00
Niko Diamadis
3ddba7aa52 Move AdvancedDialog initialization 2024-06-06 10:08:21 +02:00
Niko Diamadis
090edb75fc Improve client cert password handling 2024-06-06 00:42:36 +02:00
Niko Diamadis
4fac47f3b1 Simplify ssl settings initialization 2024-06-06 00:24:27 +02:00
Niko Diamadis
5b7aff0c23 Apply some smaller changes 2024-06-02 22:16:33 +02:00
Niko Diamadis
d74bca714c Move cert migration to GotifyApplication and synchronize calls 2024-06-02 22:05:12 +02:00
Jannis Mattheis
7b8e0ba1b3 Merge pull request #346 from cyb3rko/link-colours-fix
Adopt hyperlink color for non-markdown messages
2024-04-26 14:21:52 +02:00
Niko Diamadis
11448f7d2c Add reminder for mandatory client cert password 2024-04-24 00:21:31 +02:00
Niko Diamadis
2d70b94eb7 Merge branch 'master' into client-certificate-auth 2024-04-23 23:19:04 +02:00
Niko Diamadis
a3dd80cd20 Migrate legacy ca cert in newer version 2024-04-23 20:12:51 +02:00
Niko Diamadis
d3525ea614 Adopt hyperlink color for non-markdown messages 2024-04-22 20:57:06 +02:00
Niko Diamadis
4cc82267f8 Add SVG support 2024-04-22 20:33:04 +02:00
Niko Diamadis
60946e4e1e Fix client certificate-only usage 2024-04-22 00:59:19 +02:00
Niko Diamadis
79584c85c1 Replace denigrated call to certificate name 2024-04-19 02:15:33 +02:00
Niko Diamadis
380e209326 Remove unused utils methods 2024-04-19 02:15:33 +02:00
Niko Diamadis
23ef899564 Implement optional mTLS via client certificate option 2024-04-19 02:15:33 +02:00
Niko Diamadis
fdc9261df1 Clear and refresh image caches on swipe down 2024-04-16 18:39:45 +02:00
Niko Diamadis
9210919344 Simplify getImageFromUrl itself 2024-04-16 17:31:52 +02:00
Niko Diamadis
ad24aea709 Fix imports order 2024-03-15 18:41:29 +01:00
Niko Diamadis
c3971d179e Simplify getImageFromUrl call 2024-03-15 18:39:39 +01:00
Niko Diamadis
ddbbca7e62 Replace deprecated OkHttp methods 2024-03-14 06:44:13 +01:00
Niko Diamadis
12390f5b8a Remove Picasso request handler 2024-03-14 06:43:06 +01:00
Niko Diamadis
31649fa51b Replace Picasso with Coil 2024-03-14 06:42:30 +01:00
Niko Diamadis
5fe624c794 Bump dependency and gradle versions 2024-03-06 22:58:54 +01:00
Niko Diamadis
22feec66b0 Fix gradle deprecations 2024-03-06 22:56:00 +01:00
Niko Diamadis
07f931d330 Separate broadcasts to prevent duplicate messages (#327) 2023-12-01 11:10:40 +00:00
Jannis Mattheis
028e29af08 Merge pull request #325 from cyb3rko/update-build 2023-12-01 10:41:27 +00:00
Niko Diamadis
0b79ff62a5 Move foreground service type description to manifest 2023-11-29 18:22:06 +01:00
Niko Diamadis
eeb77352c8 Fill foreground service type description 2023-11-29 18:22:06 +01:00
Niko Diamadis
d7895c9383 Define websocket foreground service type 2023-11-29 18:22:06 +01:00
Niko Diamadis
537c34cc87 Apply Kotlinter 4.0.0 2023-11-29 18:22:06 +01:00
Niko Diamadis
203b3a76d5 Update targetSdk to 34 2023-11-29 18:22:06 +01:00
Niko Diamadis
2265e94882 Update dependencies 2023-11-20 20:50:40 +01:00
Niko Diamadis
83ef432456 Replace deprecated Gradle functions 2023-11-20 20:50:39 +01:00
Niko Diamadis
61747f170f Improve password manager autofill compatibility 2023-11-18 20:14:00 +01:00
Niko Diamadis
0d423c1ce4 Switch to ListAdapter (replacing RecyclerView.Adapter) (#321) 2023-11-18 14:13:44 +00:00
Niko Diamadis
c3327a6a8f Fix silent theme errors and warnings 2023-11-11 22:49:50 +01:00
Jannis Mattheis
2082e6d46e Version 2.7.1 2023-10-08 20:27:29 +02:00
Jannis Mattheis
b1be4d7b76 fix: remove probably unnecessary unregister
When the refresh button is clicked in the navigation drawer, then
startPushService is executed which registers the handler. The
WebSocketService itself is reused, thus isn't created again or
destroyed. From my tests the callback isn't registered twice after the
refresh. Thus, I'd expect the unregister isn't needed at all because
android somehow does this automagically.
2023-10-08 20:01:02 +02:00
Jannis Mattheis
5062031ed0 Add android application with onCreate hook 2023-10-08 10:21:40 +02:00