diff --git a/.env b/.env index 517b5fd2..6a6d39b2 100644 --- a/.env +++ b/.env @@ -1,5 +1,6 @@ VITE_DEFAULT_PUBKEYS=06639a386c9c1014217622ccbcf40908c4f1a0c33e23f8d6d68f4abf655f8f71,266815e0c9210dfa324c6cba3573b14bee49da4209a9456f9484e5106cd408a5,391819e2f2f13b90cac7209419eb574ef7c0d1f4e81867fc24c47a3ce5e8a248,3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d,3f770d65d3a764a9c5cb503ae123e62ec7598ad035d836e2a810f3877a745b24,55f04590674f3648f4cdc9dc8ce32da2a282074cd0b020596ee033d12d385185,58c741aa630c2da35a56a77c1d05381908bd10504fdd2d8b43f725efa6d23196,61066504617ee79387021e18c89fb79d1ddbc3e7bff19cf2298f40466f8715e9,6389be6491e7b693e9f368ece88fcd145f07c068d2c1bbae4247b9b5ef439d32,63fe6318dc58583cfe16810f86dd09e18bfd76aabc24a0081ce2856f330504ed,6e75f7972397ca3295e0f4ca0fbc6eb9cc79be85bafdd56bd378220ca8eee74e,76c71aae3a491f1d9eec47cba17e229cda4113a0bbb6e6ae1776d7643e29cafa,7fa56f5d6962ab1e3cd424e758c3002b8665f7b0d8dcee9fe9e288d7751ac194,82341f882b6eabcd2ba7f1ef90aad961cf074af15b9ef44a09f9d2a8fbfbe6a2,84dee6e676e5bb67b4ad4e042cf70cbd8681155db535942fcc6a0533858a7240,97c70a44366a6535c145b333f973ea86dfdc2d7a99da618c40c64705ad98e322,b676ded7c768d66a757aa3967b1243d90bf57afb09d1044d3219d8d424e4aea0,dace63b00c42e6e017d00dd190a9328386002ff597b841eb5ef91de4f1ce8491,eeb11961b25442b16389fe6c7ebea9adf0ac36dd596816ea7119e521b8821b9e,fe7f6bc6f7338b76bbf80db402ade65953e20b2f23e66e898204b63cc42539a3 VITE_DEFAULT_BLOSSOM_SERVERS=https://blossom.primal.net/ +VITE_DEFAULT_SPACES=https://chat.flotilla.social/ VITE_POMADE_SIGNERS=https://pomade.coracle.social,https://pomade.fiatjaf.com,https://pomade.nostrver.se,https://pomade.scuttle.works VITE_PLATFORM_URL=https://app.flotilla.social VITE_PLATFORM_TERMS=https://flotilla.social/terms diff --git a/README.md b/README.md index 529588c4..72053fe3 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,34 @@ If you would like to be interoperable with Flotilla, please check out this guide You can also optionally create an `.env.local` file and populate it with the following environment variables (see `.env.template` for examples): -- `VITE_DEFAULT_PUBKEYS` - A comma-separated list of hex pubkeys for bootstrapping web of trust +**Platform branding** - `VITE_PLATFORM_URL` - The url where the app will be hosted - `VITE_PLATFORM_NAME` - The name of the app - `VITE_PLATFORM_LOGO` - A logo url for the app. Can be a local path or https link. Must be a PNG file. -- `VITE_PLATFORM_RELAYS` - A list of comma-separated relay urls that will make flotilla operate in "platform mode". Disables all space browse/add/select functionality and makes the first platform relay the home page. - `VITE_PLATFORM_ACCENT` - A hex color for the app's accent color - `VITE_PLATFORM_DESCRIPTION` - A description of the app +- `VITE_PLATFORM_TERMS` - URL to your terms of service page +- `VITE_PLATFORM_PRIVACY` - URL to your privacy policy page + +**Platform mode** +- `VITE_PLATFORM_RELAYS` - A comma-separated list of relay urls that will make flotilla operate in "platform mode". Disables all space browse/add/select functionality and makes the first platform relay the home page. + +**Defaults** +- `VITE_DEFAULT_PUBKEYS` - A comma-separated list of hex pubkeys for bootstrapping web of trust +- `VITE_DEFAULT_SPACES` - A comma-separated list of relay urls that new users will be automatically joined to on signup +- `VITE_DEFAULT_RELAYS` - A comma-separated list of relay urls used as default outbox/inbox relays +- `VITE_DEFAULT_MESSAGING_RELAYS` - A comma-separated list of relay urls used for encrypted direct messages +- `VITE_DEFAULT_BLOSSOM_SERVERS` - A comma-separated list of blossom server urls used for file uploads + +**Infrastructure** +- `VITE_INDEXER_RELAYS` - A comma-separated list of relay urls used for user profile/key lookup +- `VITE_SIGNER_RELAYS` - A comma-separated list of relay urls used for NIP-55 remote signers +- `VITE_BLOCKED_RELAYS` - A comma-separated list of relay urls that will be blocked +- `VITE_PUSH_SERVER` - URL of the push notification server +- `VITE_PUSH_BRIDGE` - WebSocket URL of the push notification relay bridge +- `VITE_VAPID_PUBLIC_KEY` - VAPID public key for web push notifications +- `VITE_POMADE_SIGNERS` - A comma-separated list of Pomade signer server URLs (3+ required to enable email signup) +- `VITE_THUMBNAIL_URL` - URL of the image thumbnail service These values **won't** be used for a built version. Instead, env variables should be provided to `build.sh` directly or to the built container. diff --git a/src/app/components/SignUp.svelte b/src/app/components/SignUp.svelte index 5fa9bc51..16e92176 100644 --- a/src/app/components/SignUp.svelte +++ b/src/app/components/SignUp.svelte @@ -22,8 +22,10 @@ INDEXER_RELAYS, DEFAULT_RELAYS, DEFAULT_MESSAGING_RELAYS, + DEFAULT_SPACES, } from "@app/env" import {setChecked} from "@app/notifications" + import {setSpaces} from "@app/groups" import {loginWithPomade} from "@app/pomade" import {pushModal, clearModals} from "@app/modal" @@ -52,6 +54,9 @@ // Save the user's profile initProfile(getKey("signup.profile")!) + // Auto-join default spaces + setSpaces(DEFAULT_SPACES) + // Don't show any notifications for old content setChecked("*") diff --git a/src/app/env.ts b/src/app/env.ts index c37ecd89..b5b635d0 100644 --- a/src/app/env.ts +++ b/src/app/env.ts @@ -46,6 +46,8 @@ export const POMADE_SIGNERS = fromCsv(import.meta.env.VITE_POMADE_SIGNERS) export const DEFAULT_BLOSSOM_SERVERS = fromCsv(import.meta.env.VITE_DEFAULT_BLOSSOM_SERVERS) +export const DEFAULT_SPACES = fromCsv(import.meta.env.VITE_DEFAULT_SPACES).map(normalizeRelayUrl) + export const DEFAULT_PUBKEYS = import.meta.env.VITE_DEFAULT_PUBKEYS export const DUFFLEPUD_URL = "https://dufflepud.onrender.com" diff --git a/src/app/groups.ts b/src/app/groups.ts index 6eb441de..8ef0ec21 100644 --- a/src/app/groups.ts +++ b/src/app/groups.ts @@ -311,7 +311,7 @@ export const removeSpace = async (url: string) => { return publishThunk({event, relays}) } -export const setSpaceOrder = async (urls: string[]) => { +export const setSpaces = async (urls: string[]) => { const list = get(userGroupList) || makeList({kind: ROOMS}) const orderedUrls = uniq(urls.map(normalizeRelayUrl)) const relayTags = list.publicTags.filter(t => t[0] === "r") diff --git a/src/routes/spaces/+page.svelte b/src/routes/spaces/+page.svelte index 0ccba90f..eb748ff7 100644 --- a/src/routes/spaces/+page.svelte +++ b/src/routes/spaces/+page.svelte @@ -26,7 +26,7 @@ import SpaceAdd from "@app/components/SpaceAdd.svelte" import SpaceInviteAccept from "@app/components/SpaceInviteAccept.svelte" import SpaceJoin from "@app/components/SpaceJoin.svelte" - import {userSpaceUrls, loadUserGroupList, groupListPubkeysByUrl, setSpaceOrder} from "@app/groups" + import {userSpaceUrls, loadUserGroupList, groupListPubkeysByUrl, setSpaces} from "@app/groups" import {PLATFORM_RELAYS, DEFAULT_RELAYS} from "@app/env" import {bootstrapPubkeys} from "@app/social" import {parseInviteLink} from "@app/invites" @@ -128,7 +128,7 @@ lastDragTarget = undefined if (dragStartOrder && !isSameOrder(dragStartOrder, orderedSpaceUrls)) { - void setSpaceOrder(orderedSpaceUrls).catch(console.error) + void setSpaces(orderedSpaceUrls).catch(console.error) } dragStartOrder = undefined