mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-13 18:40:50 +08:00
explorer: Remove the env var config
- Remove custom-environment-variables.json: nothing sets its variables, and PREFERRED_SEEDS mapped to a key the app never reads - Remove deploymentId: only Vercel set it, and we don't deploy there - Always show the self-hosting hint in parse errors, as before - Document local.json as the way to configure a build
This commit is contained in:
+3
-13
@@ -42,10 +42,10 @@ There are several ways to deploy the UI publicly. Here are two common options:
|
||||
`explorer/` to create a build for deployment
|
||||
2. Configure your web server to serve the contents of the `/build` directory
|
||||
|
||||
**Using Vercel (or similar static file hosting):**
|
||||
**Using static file hosting:**
|
||||
|
||||
1. Fork this repository to create your own version
|
||||
2. Configure your Vercel account to deploy the forked repository
|
||||
2. Configure your hosting provider to deploy the forked repository
|
||||
|
||||
**Add Rewrite Rules for Client-Side Routing**
|
||||
|
||||
@@ -74,21 +74,12 @@ There are two ways to configure the UI: **at build time** and **at run time**.
|
||||
|
||||
### Build-Time Configuration
|
||||
|
||||
This method is recommended when deploying to static hosting platforms such as
|
||||
Vercel.
|
||||
|
||||
#### Option 1: Create a `local.json` file
|
||||
This method is recommended when deploying to static hosting platforms.
|
||||
|
||||
1. Copy [`default.json`][def] to a new file in the same directory called
|
||||
`local.json`.
|
||||
2. Modify the properties in `local.json` to suit your setup.
|
||||
|
||||
#### Option 2: Use environment variables
|
||||
|
||||
1. Refer to [`custom-environment-variables.json`][env] for a list of supported
|
||||
environment variables.
|
||||
2. Set the desired variables in your environment before building the UI.
|
||||
|
||||
> For advanced configuration options, refer to the [`node-config`][nco]
|
||||
> documentation.
|
||||
|
||||
@@ -230,7 +221,6 @@ The UI is distributed under the terms of GPLv3. See [LICENSE][lic] for details.
|
||||
[app]: https://radicle.network
|
||||
[con]: ../CONTRIBUTING.md
|
||||
[def]: ./config/default.json
|
||||
[env]: ./config/custom-environment-variables.json
|
||||
[iss]:
|
||||
https://radicle.network/nodes/iris.radicle.network/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5/issues
|
||||
[lic]: ./LICENSE
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"nodes": {
|
||||
"fallbackPublicExplorer": "FALLBACK_PUBLIC_EXPLORER",
|
||||
"defaultHttpdPort": "DEFAULT_HTTPD_PORT",
|
||||
"defaultLocalHttpdPort": "DEFAULT_LOCAL_HTTPD_PORT",
|
||||
"defaultHttpdScheme": "DEFAULT_HTTPD_SCHEME"
|
||||
},
|
||||
"source": {
|
||||
"commitsPerPage": "COMMITS_PER_PAGE"
|
||||
},
|
||||
"supportWebsite": "SUPPORT_WEBSITE",
|
||||
"deploymentId": "VERCEL_DEPLOYMENT_ID",
|
||||
"fallbackPreferredSeed": {
|
||||
"__name": "PREFERRED_SEEDS",
|
||||
"__format": "json"
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,6 @@
|
||||
"commitsPerPage": 30
|
||||
},
|
||||
"supportWebsite": "https://radicle.zulipchat.com",
|
||||
"deploymentId": null,
|
||||
"preferredSeeds": [
|
||||
{
|
||||
"hostname": "rosa.radicle.network",
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
import type { ZodIssue, ZodType, TypeOf } from "zod";
|
||||
|
||||
import config from "@app/lib/config";
|
||||
import {
|
||||
isOutdated,
|
||||
minimumSupportedVersion,
|
||||
@@ -68,11 +67,8 @@ export class ResponseParseError extends Error {
|
||||
? ` It runs radicle-httpd ${releaseNumber(nodeVersion)}, but explorer needs ${minimumSupportedVersion} or newer. Its operator should upgrade it.`
|
||||
: "";
|
||||
this.description =
|
||||
`${node} sent a response that radicle-explorer can’t parse.${outdated}`.concat(
|
||||
config.deploymentId
|
||||
? ""
|
||||
: " If you are self-hosting radicle-explorer, try to clear the browser’s localStorage and the cache.",
|
||||
);
|
||||
`${node} sent a response that radicle-explorer can’t parse.${outdated}` +
|
||||
" If you are self-hosting radicle-explorer, try to clear the browser’s localStorage and the cache.";
|
||||
|
||||
this.method = method;
|
||||
this.path = path;
|
||||
@@ -115,11 +111,6 @@ export class Fetcher {
|
||||
params: FetchParams,
|
||||
schema: T,
|
||||
): Promise<TypeOf<T>> {
|
||||
if (config.deploymentId) {
|
||||
params.query ||= {};
|
||||
params.query["deployment_id"] = config.deploymentId;
|
||||
}
|
||||
|
||||
const response = await this.fetch(params);
|
||||
|
||||
if (!response.ok) {
|
||||
|
||||
Vendored
-1
@@ -15,7 +15,6 @@ declare const buildTimeConfig: {
|
||||
source: {
|
||||
commitsPerPage: number;
|
||||
};
|
||||
deploymentId: string | null;
|
||||
reactions: string[];
|
||||
supportWebsite: string;
|
||||
preferredSeeds: BaseUrl[];
|
||||
|
||||
Reference in New Issue
Block a user