diff --git a/.env b/.env index 787c8d7e..23232209 100644 --- a/.env +++ b/.env @@ -1,3 +1,4 @@ -VITE_CLIENT_NAME=Phanpy -VITE_CLIENT_ID=social.phanpy -VITE_WEBSITE=https://phanpy.social \ No newline at end of file +PHANPY_CLIENT_NAME=Phanpy +PHANPY_WEBSITE=https://phanpy.social +PHANPY_LINGVA_INSTANCES="lingva.phanpy.social lingva.lunar.icu lingva.garudalinux.org translate.plausibility.cloud" +PHANPY_PRIVACY_POLICY_URL="https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD" \ No newline at end of file diff --git a/README.md b/README.md index cc438a65..acb243ee 100644 --- a/README.md +++ b/README.md @@ -126,10 +126,66 @@ This is a **pure static web app**. You can host it anywhere you want. Two ways (choose one): -1. (Recommended) Go to [Releases](https://github.com/cheeaun/phanpy/releases) and download the latest `phanpy-dist.zip`. It's pre-built so don't need to run any install/build commands. Extract it. Serve the folder of extracted files. -2. Download or `git clone` this repository. Build it by running `npm run build` (after `npm install`). Serve the `dist` folder. +### Easy way -Try search for "how to self-host static sites" as there are many ways to do it. +Go to [Releases](https://github.com/cheeaun/phanpy/releases) and download the latest `phanpy-dist.zip` or `phanpy-dist.tar.gz`. It's pre-built so don't need to run any install/build commands. Extract it. Serve the folder of extracted files. + +### Custom-build way + +Download or `git clone` this repository. Build it by running `npm run build` (after `npm install`). Serve the `dist` folder. + +Customization can be done by passing environment variables to the build command. Examples: + +```bash +PHANPY_APP_TITLE="Phanpy Dev" \ + PHANPY_WEBSITE="https://dev.phanpy.social" \ + npm run build +``` + +```bash +PHANPY_DEFAULT_INSTANCE=hachyderm.io \ + PHANPY_DEFAULT_INSTANCE_REGISTRATION_URL=https://hachyderm.io/auth/sign_up \ + PHANPY_PRIVACY_POLICY_URL=https://hachyderm.io/privacy-policy \ + npm run build +``` + +It's also possible to set them in the `.env` file. + +Available variables: + +- `PHANPY_APP_TITLE` (optional, default: `Phanpy`) affects: + - Web page title, shown in the browser window or tab title + - App title, when installed as PWA, shown in the Home screen, macOS dock, Windows taskbar, etc + - OpenGraph card title, when shared on social networks + - Client name, when [registering the app for authentication](https://docs.joinmastodon.org/client/token/#app) and shown as client used on posts in some apps/clients +- `PHANPY_WEBSITE` (optional but recommended, default: `https://phanpy.social`) affects: + - Canonical URL of the website + - OpenGraph card URL, when shared on social networks + - Root path for the OpenGraph card image + - Client URL, when [registering the app for authentication](https://docs.joinmastodon.org/client/token/#app) and shown as client used on posts in some apps/clients +- `PHANPY_DEFAULT_INSTANCE` (optional, no defaults): + - e.g. 'mastodon.social', without `https://` + - Default instance for log-in + - When logging in, the user will be redirected instantly to the instance's authentication page instead of having to manually type the instance URL and submit +- `PHANPY_DEFAULT_INSTANCE_REGISTRATION_URL` (optional, no defaults): + - URL of the instance registration page + - E.g. `https://mastodon.social/auth/sign_up` +- `PHANPY_PRIVACY_POLICY_URL` (optional, default to official instance's privacy policy): + - URL of the privacy policy page + - May specify the instance's own privacy policy +- `PHANPY_LINGVA_INSTANCES` (optional, space-separated list, default: `lingva.phanpy.social [...hard-coded list of fallback instances]`): + - Specify a space-separated list of instances. First will be used as default before falling back to the subsequent instances. If there's only 1 instance, means no fallback. + - May specify a self-hosted Lingva instance, powered by either [lingva-translate](https://github.com/thedaviddelta/lingva-translate) or [lingva-api](https://github.com/cheeaun/lingva-api) + - List of fallback instances hard-coded in `/.env` + - [↗️ List of lingva-translate instances](https://github.com/thedaviddelta/lingva-translate?tab=readme-ov-file#instances) + +### Static site hosting + +Try online search for "how to self-host static sites" as there are many ways to do it. + +#### Lingva-translate or lingva-api hosting + +See documentation for [lingva-translate](https://github.com/thedaviddelta/lingva-translate) or [lingva-api](https://github.com/cheeaun/lingva-api). ## Community deployments diff --git a/compose/index.html b/compose/index.html index c4b3d5a1..53fdf971 100644 --- a/compose/index.html +++ b/compose/index.html @@ -4,7 +4,7 @@ -