Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Commit

Permalink
add static hosting instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
IncognitoTGT committed Apr 2, 2024
1 parent ca6cdeb commit c7dbd10
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This is the defualt configurations for Ephemeral's configurations. Feel free to modify these but DO NOT commit them
MASQR=false
PORT=8080
# for static hosting set the below env
WISP_SERVER=
# for static hosting set the below env to a wisp server
VITE_WISP_SERVER=
LICENSE_SERVER_URL=https://example.com/validate?license=
WHITELISTED_DOMAINS = ["ephemeral.lol", "localhost:8080"]
4 changes: 3 additions & 1 deletion src/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ type Config = {

const defaultConfig: Config = {
proxy: {
wispServer: `${location.protocol.replace("http", "ws")}//${location.hostname}:${location.port}/wisp/`,
wispServer:
import.meta.env.VITE_WISP_SERVER ||
`${location.protocol.replace("http", "ws")}//${location.host}/wisp/`,
transport: "libcurl",
},
cloak: {
Expand Down
8 changes: 8 additions & 0 deletions src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/// <reference types="vite/client" />

declare const __BUILD_DATE__: Date;
interface ImportMetaEnv {
readonly VITE_WISP_SERVER: string;
// more env variables...
}

interface ImportMeta {
readonly env: ImportMetaEnv;
}
1 change: 0 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,5 @@ export default defineConfig({
},
define: {
__BUILD_DATE__: JSON.stringify(new Date()),
__DEFAULT_WISP_SERVER__: process.env.WISP_SERVER,
},
});

0 comments on commit c7dbd10

Please sign in to comment.