diff --git a/.env b/.env index ed844815..90f4c1da 100644 --- a/.env +++ b/.env @@ -13,8 +13,10 @@ VITE_PLATFORM_PUBKEY=8ec86ac9e10979998652068ee6b00223b8e3265aabb3fe28fb6b3b6e294 VITE_FORCE_GROUP= VITE_PLATFORM_RELAYS= VITE_ENABLE_ZAPS=true -VITE_LOGO_URL= VITE_APP_NAME=Coracle +VITE_APP_URL=https://app.coracle.social +VITE_APP_LOGO=/images/logo.png +VITE_APP_DESCRIPTION="A nostr client for regular people" VITE_CLIENT_NAME=Coracle VITE_CLIENT_ID=31990:97c70a44366a6535c145b333f973ea86dfdc2d7a99da618c40c64705ad98e322:1685968093690 VITE_BUGSNAG_API_KEY= diff --git a/.gitignore b/.gitignore index aa128496..a314de0b 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,11 @@ ssl scratch.md psql-tmux.json sandbox.sql + +# Generated on build +public/icons +public/images/apple-touch-icon-180x180.png +public/images/favicon.ico +public/images/maskable-icon-512x512.png +public/images/pwa-* + diff --git a/README.md b/README.md index 8ab263c5..271e06be 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@ Coracle is a web client for the Nostr protocol focused on pushing the boundaries of what's unique about nostr, including relay selection and management, web-of-trust based moderation and content recommendations, and privacy protection. Check it out at [coracle.social](https://coracle.social). -[Dufflepud](https://github.com/coracle-social/dufflepud) is a companion server which you can self-host. It helps Coracle with things like link previews and image uploads. - If you like Coracle and want to support its development, you can donate sats via [Geyser](https://geyser.fund/project/coracle). # Features @@ -56,5 +54,36 @@ You can find a more complete changelog [here](./CHANGELOG.md). - Clone the project repository: `git clone https://github.com/coracle-social/coracle.git` - Navigate to the project directory: `cd coracle` - Install dependencies: `yarn` -- Customize configuration in `.env` (optional) +- Customize configuration in `.env` (optional, see below) - Start the development server: `yarn dev` + +# Customization + +Coracle is intended to be fully white-labeled by groups of various kinds. The following environment variables can be set in `.env.local` to customize Coracle's appearance and behavior: + +- `VITE_DARK_THEME` and `VITE_LIGHT_THEME` are comma-separate lists of key/value pairs defining theme colors. +- `VITE_DVM_RELAYS` is a comma-separated list of relays to use when making requests against DVMs. +- `VITE_SEARCH_RELAYS` is a comma-separated list of relays to use when using NIP 50 search. +- `VITE_DEFAULT_RELAYS` is a comma-separated list of relays to use as defaults/fallbacks. +- `VITE_DEFAULT_FOLLOWS` is a comma-separated list of hex pubkeys to fetch content from when the user isn't following anyone. +- `VITE_ONBOARDING_LISTS` is a comma-separated list of `kind:30003` person lists to populate onboarding with. +- `VITE_NIP96_URLS` is a comma-separated list of default upload providers. +- `VITE_IMGPROXY_URL` is an [imgproxy](https://imgproxy.net) instance url for protecting user privacy and reducing bandwidth use. +- `VITE_DUFFLEPUD_URL` is a [Dufflepud](https://github.com/coracle-social/dufflepud) instance url, which helps Coracle with things like link previews and image uploads. +- `VITE_PLATFORM_ZAP_SPLIT` is a decimal between 0 and 1 defining the default zap split percent. +- `VITE_PLATFORM_PUBKEY` is the pubkey of the platform owner. This gets zapped when using the platform zap split. +- `VITE_FORCE_GROUP` is an optional `kind:34550` or `kind:35834` address. If provided, the home page of Coracle will be the home page for the group, and most views will be filtered down to the group's scope. +- `VITE_PLATFORM_RELAYS` is an optional comma-separated list of relay urls to use for feeds. If provided, most UI components related to relay selection will be hidden from the user. +- `VITE_ENABLE_ZAPS` can be set to `false` to disable zaps. +- `VITE_APP_NAME` is the app's name. +- `VITE_APP_URL` is the app's url. Used to generate open graph meta tags. +- `VITE_APP_LOGO` is the path for the app's logo relative to the `public` directory, starting with a trailing slash. Used to generate favicons and manifest. +- `VITE_APP_DESCRIPTION` is the app's description. +- `VITE_CLIENT_NAME` is the client's name. Only change this if you have forked Coracle. +- `VITE_CLIENT_ID` is the client's NIP 89 handler id. Only change this if you have forked Coracle. +- `VITE_BUGSNAG_API_KEY` is your [bugsnag](https://www.bugsnag.com/) api key. +- `VITE_BUILD_HASH` can be set during build to indicate the software version on the about page. +- `VITE_LOG_LEVEL` can be set to `info`, `warn`, or `error`. This controls how much shows up in the console. +- `VITE_ENABLE_MARKET` can be set to `false` to disable the marketplace tab. + +See `.env` for default values. diff --git a/index.html b/index.html index 40ee52ca..439557fa 100644 --- a/index.html +++ b/index.html @@ -5,94 +5,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - Coracle
diff --git a/package.json b/package.json index b2d3e22e..e75a7560 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,7 @@ "type": "module", "scripts": { "dev": "vite --host", - "build": "vite build", - "preview": "vite preview", + "build": "yarn add sharp -D --ignore-engines && pwa-assets-generator && vite build", "check:es": "eslint 'src/**/*.{js,ts,svelte}' --quiet", "check:ts": "svelte-check --tsconfig ./tsconfig.json --threshold error", "check:fmt": "prettier --check $(git diff head --name-only --diff-filter d | grep -E '(js|ts|svelte)$' | xargs)", @@ -27,19 +26,24 @@ "@types/throttle-debounce": "^5.0.2", "@typescript-eslint/eslint-plugin": "^6.13.1", "@typescript-eslint/parser": "^6.13.1", + "@vite-pwa/assets-generator": "^0.2.4", "autoprefixer": "^10.4.16", "cypress": "^13.6.0", + "dotenv": "^16.4.5", "eslint": "^8.54.0", "eslint-plugin-svelte3": "^4.0.0", + "favicons": "^7.1.5", "madge": "^6.1.0", "postcss": "^8.4.31", "prettier": "^3.1.0", "prettier-plugin-svelte": "^3.1.2", "prettier-plugin-tailwindcss": "^0.5.11", + "sharp": "^0.33.2", "svelte-preprocess": "^5.1.1", "tailwindcss": "^3.3.5", "typescript": "^5.3.2", "vite": "^5.0.4", + "vite-plugin-html-config": "^1.0.11", "vite-plugin-mkcert": "^1.17.1", "vite-plugin-node-polyfills": "^0.17.0", "vite-plugin-pwa": "^0.17.2" @@ -65,7 +69,7 @@ "normalize-url": "^8.0.0", "nostr-tools": "^2.1.5", "npm-run-all": "^4.1.5", - "paravel": "^0.5.0", + "paravel": "^0.5.1", "qr-scanner": "^1.4.2", "qrcode": "^1.5.3", "ramda": "^0.29.1", diff --git a/public/images/favicon.png b/public/images/favicon.png deleted file mode 100644 index ece1b69a..00000000 Binary files a/public/images/favicon.png and /dev/null differ diff --git a/public/images/favicon/android-icon-144x144.png b/public/images/favicon/android-icon-144x144.png deleted file mode 100644 index d09a7185..00000000 Binary files a/public/images/favicon/android-icon-144x144.png and /dev/null differ diff --git a/public/images/favicon/android-icon-192x192.png b/public/images/favicon/android-icon-192x192.png deleted file mode 100644 index 5cfbbeda..00000000 Binary files a/public/images/favicon/android-icon-192x192.png and /dev/null differ diff --git a/public/images/favicon/android-icon-36x36.png b/public/images/favicon/android-icon-36x36.png deleted file mode 100644 index 6aff1a80..00000000 Binary files a/public/images/favicon/android-icon-36x36.png and /dev/null differ diff --git a/public/images/favicon/android-icon-48x48.png b/public/images/favicon/android-icon-48x48.png deleted file mode 100644 index b053c95a..00000000 Binary files a/public/images/favicon/android-icon-48x48.png and /dev/null differ diff --git a/public/images/favicon/android-icon-72x72.png b/public/images/favicon/android-icon-72x72.png deleted file mode 100644 index 0cd5790b..00000000 Binary files a/public/images/favicon/android-icon-72x72.png and /dev/null differ diff --git a/public/images/favicon/android-icon-96x96.png b/public/images/favicon/android-icon-96x96.png deleted file mode 100644 index 81aa1aae..00000000 Binary files a/public/images/favicon/android-icon-96x96.png and /dev/null differ diff --git a/public/images/favicon/apple-icon-114x114.png b/public/images/favicon/apple-icon-114x114.png deleted file mode 100644 index 71c29547..00000000 Binary files a/public/images/favicon/apple-icon-114x114.png and /dev/null differ diff --git a/public/images/favicon/apple-icon-120x120.png b/public/images/favicon/apple-icon-120x120.png deleted file mode 100644 index 446afead..00000000 Binary files a/public/images/favicon/apple-icon-120x120.png and /dev/null differ diff --git a/public/images/favicon/apple-icon-144x144.png b/public/images/favicon/apple-icon-144x144.png deleted file mode 100644 index d09a7185..00000000 Binary files a/public/images/favicon/apple-icon-144x144.png and /dev/null differ diff --git a/public/images/favicon/apple-icon-152x152.png b/public/images/favicon/apple-icon-152x152.png deleted file mode 100644 index 8bfd2b2b..00000000 Binary files a/public/images/favicon/apple-icon-152x152.png and /dev/null differ diff --git a/public/images/favicon/apple-icon-180x180.png b/public/images/favicon/apple-icon-180x180.png deleted file mode 100644 index fa51be75..00000000 Binary files a/public/images/favicon/apple-icon-180x180.png and /dev/null differ diff --git a/public/images/favicon/apple-icon-57x57.png b/public/images/favicon/apple-icon-57x57.png deleted file mode 100644 index 027eff01..00000000 Binary files a/public/images/favicon/apple-icon-57x57.png and /dev/null differ diff --git a/public/images/favicon/apple-icon-60x60.png b/public/images/favicon/apple-icon-60x60.png deleted file mode 100644 index 3e83c4bb..00000000 Binary files a/public/images/favicon/apple-icon-60x60.png and /dev/null differ diff --git a/public/images/favicon/apple-icon-72x72.png b/public/images/favicon/apple-icon-72x72.png deleted file mode 100644 index 0cd5790b..00000000 Binary files a/public/images/favicon/apple-icon-72x72.png and /dev/null differ diff --git a/public/images/favicon/apple-icon-76x76.png b/public/images/favicon/apple-icon-76x76.png deleted file mode 100644 index 5583eba8..00000000 Binary files a/public/images/favicon/apple-icon-76x76.png and /dev/null differ diff --git a/public/images/favicon/apple-icon-precomposed.png b/public/images/favicon/apple-icon-precomposed.png deleted file mode 100644 index 311c3c17..00000000 Binary files a/public/images/favicon/apple-icon-precomposed.png and /dev/null differ diff --git a/public/images/favicon/apple-icon.png b/public/images/favicon/apple-icon.png deleted file mode 100644 index 311c3c17..00000000 Binary files a/public/images/favicon/apple-icon.png and /dev/null differ diff --git a/public/images/favicon/browserconfig.xml b/public/images/favicon/browserconfig.xml deleted file mode 100644 index c5541482..00000000 --- a/public/images/favicon/browserconfig.xml +++ /dev/null @@ -1,2 +0,0 @@ - -#ffffff \ No newline at end of file diff --git a/public/images/favicon/favicon-16x16.png b/public/images/favicon/favicon-16x16.png deleted file mode 100644 index 7206d30d..00000000 Binary files a/public/images/favicon/favicon-16x16.png and /dev/null differ diff --git a/public/images/favicon/favicon-32x32.png b/public/images/favicon/favicon-32x32.png deleted file mode 100644 index e4d6d2dc..00000000 Binary files a/public/images/favicon/favicon-32x32.png and /dev/null differ diff --git a/public/images/favicon/favicon-96x96.png b/public/images/favicon/favicon-96x96.png deleted file mode 100644 index 81aa1aae..00000000 Binary files a/public/images/favicon/favicon-96x96.png and /dev/null differ diff --git a/public/images/favicon/favicon.ico b/public/images/favicon/favicon.ico deleted file mode 100644 index 61fcf0d3..00000000 Binary files a/public/images/favicon/favicon.ico and /dev/null differ diff --git a/public/images/favicon/ms-icon-144x144.png b/public/images/favicon/ms-icon-144x144.png deleted file mode 100644 index d09a7185..00000000 Binary files a/public/images/favicon/ms-icon-144x144.png and /dev/null differ diff --git a/public/images/favicon/ms-icon-150x150.png b/public/images/favicon/ms-icon-150x150.png deleted file mode 100644 index 8b6295ff..00000000 Binary files a/public/images/favicon/ms-icon-150x150.png and /dev/null differ diff --git a/public/images/favicon/ms-icon-310x310.png b/public/images/favicon/ms-icon-310x310.png deleted file mode 100644 index 8ea4c8f0..00000000 Binary files a/public/images/favicon/ms-icon-310x310.png and /dev/null differ diff --git a/public/images/favicon/ms-icon-70x70.png b/public/images/favicon/ms-icon-70x70.png deleted file mode 100644 index 29d27525..00000000 Binary files a/public/images/favicon/ms-icon-70x70.png and /dev/null differ diff --git a/public/images/logo.svg b/public/images/logo.svg deleted file mode 100644 index 1cb68800..00000000 --- a/public/images/logo.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/pwa-assets.config.js b/pwa-assets.config.js new file mode 100644 index 00000000..15ee0d5f --- /dev/null +++ b/pwa-assets.config.js @@ -0,0 +1,10 @@ +import dotenv from 'dotenv' +import {defineConfig, minimalPreset as preset} from '@vite-pwa/assets-generator/config' + +dotenv.config({path: '.env.local'}) +dotenv.config({path: '.env'}) + +export default defineConfig({ + preset, + images: ['public' + process.env.VITE_APP_LOGO], +}) diff --git a/src/app/MenuDesktop.svelte b/src/app/MenuDesktop.svelte index 3755c296..7a0dc015 100644 --- a/src/app/MenuDesktop.svelte +++ b/src/app/MenuDesktop.svelte @@ -54,8 +54,8 @@ class="mb-4 mt-4 flex items-center gap-2 pl-6" external href="https://info.coracle.social"> - App Logo -

+ App Logo +

{appName}

diff --git a/src/app/shared/Note.svelte b/src/app/shared/Note.svelte index 3b92e780..74456470 100644 --- a/src/app/shared/Note.svelte +++ b/src/app/shared/Note.svelte @@ -1,10 +1,10 @@