feat: imgproxy

This commit is contained in:
2023-01-31 14:41:21 +00:00
parent 02800defd5
commit c16d5d19e5
8 changed files with 154 additions and 44 deletions

View File

@ -4,6 +4,7 @@ import { DefaultRelays } from 'Const';
import { HexKey, TaggedRawEvent } from 'Nostr';
import { RelaySettings } from 'Nostr/Connection';
import type { AppDispatch, RootState } from "State/Store";
import { ImgProxySettings } from 'Feed/ImgProxy';
const PrivateKeyItem = "secret";
const PublicKeyItem = "pubkey";
@ -56,9 +57,9 @@ export interface UserPreferences {
fileUploader: "void.cat" | "nostr.build",
/**
* Use image proxy service to compress avatars
* Use imgproxy to optimize images
*/
useImageProxy: boolean,
imgProxyConfig: ImgProxySettings | null
}
export interface LoginStore {
@ -138,7 +139,7 @@ export interface LoginStore {
preferences: UserPreferences
};
const InitState = {
export const InitState = {
loggedOut: undefined,
publicKey: undefined,
privateKey: undefined,
@ -161,7 +162,11 @@ const InitState = {
showDebugMenus: false,
autoShowLatest: false,
fileUploader: "void.cat",
useImageProxy: true
imgProxyConfig: {
url: "https://imgproxy.snort.social",
key: "a82fcf26aa0ccb55dfc6b4bd6a1c90744d3be0f38429f21a8828b43449ce7cebe6bdc2b09a827311bef37b18ce35cb1e6b1c60387a254541afa9e5b4264ae942",
salt: "a897770d9abf163de055e9617891214e75a9016d748f8ef865e6ffbcb9ed932295659549773a22a019a5f06d0b440c320be411e3fddfe784e199e4f03d74bd9b"
}
}
} as LoginStore;