diff --git a/build.sh b/build.sh index 8992a82..55ae7a3 100755 --- a/build.sh +++ b/build.sh @@ -9,11 +9,7 @@ fi echo "building client..." cd client -yarn --production=false -VITE_COMMIT_SHA=$SOURCE_VERSION \ -VITE_API_HOST=$api_host \ -VITE_API_PROTOCOL=$API_PROTOCOL \ -VITE_API_PORT=$API_PORT \ +yarn --production=false yarn build cd ../ diff --git a/client/src/api/config.js b/client/src/api/config.js index c0c127d..dbb5bb6 100644 --- a/client/src/api/config.js +++ b/client/src/api/config.js @@ -3,7 +3,7 @@ let host; let protocol; let port; -switch (import.meta.env.NODE_ENV) { +switch (import.meta.env.MODE) { case 'staging': host = import.meta.env.VITE_API_HOST; protocol = import.meta.env.VITE_API_PROTOCOL || 'https'; diff --git a/client/src/main.tsx b/client/src/main.tsx index 6dfd446..65da1e5 100644 --- a/client/src/main.tsx +++ b/client/src/main.tsx @@ -12,7 +12,6 @@ import 'bootstrap/dist/js/bootstrap.bundle.min.js'; import configureStore from '@/store/'; import Home from '@/components/Home/'; import { hasTouchSupport } from '@/utils/dom'; -import { AlertTriangle } from 'react-feather'; const store = configureStore(); @@ -44,13 +43,14 @@ const Main = () => { ); }; -const root = createRoot(document.getElementById('root') as HTMLElement); if (!window.crypto || !window.crypto.subtle) { window.alert("You must access Darkwire from a secure HTTPS connection.") throw new Error("You must access Darkwire from a secure HTTPS connection.") } +const root = createRoot(document.getElementById('root') as HTMLElement); + root.render(
diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index bf7bcaf..d73d431 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -7,16 +7,16 @@ set -e echo " TZ=UTC -REACT_APP_API_HOST=$REACT_APP_API_HOST -REACT_APP_API_PROTOCOL=$REACT_APP_API_PROTOCOL -REACT_APP_API_PORT=$REACT_APP_API_PORT -REACT_APP_COMMIT_SHA=$REACT_APP_COMMIT_SHA +VITE_API_HOST=$VITE_API_HOST +VITE_API_PROTOCOL=$VITE_API_PROTOCOL +VITE_API_PORT=$VITE_API_PORT +VITE_COMMIT_SHA=$VITE_COMMIT_SHA # To display darkwire version -REACT_APP_COMMIT_SHA=$REACT_APP_COMMIT_SHA +VITE_COMMIT_SHA=$VITE_COMMIT_SHA # Set max transferable file size in MB -REACT_APP_MAX_FILE_SIZE=$REACT_APP_MAX_FILE_SIZE +VITE_MAX_FILE_SIZE=$VITE_MAX_FILE_SIZE " > client/.env @@ -26,7 +26,7 @@ MAILGUN_DOMAIN=$MAILGUN_DOMAIN ABUSE_TO_EMAIL_ADDRESS=$ABUSE_TO_EMAIL_ADDRESS ABUSE_FROM_EMAIL_ADDRESS=$ABUSE_FROM_EMAIL_ADDRESS -CLIENT_DIST_DIRECTORY='client/dist/path' +CLIENT_DIST_DIRECTORY='client/dist/' ROOM_HASH_SECRET=$ROOM_HASH_SECRET diff --git a/readme.md b/readme.md index 29d1a1c..c170df0 100644 --- a/readme.md +++ b/readme.md @@ -30,9 +30,9 @@ API which is accessible only on localhost and behind a https connection. You can use nvm to install the right version of node using this command: ``` -nvm install # If not already installed +nvm install # If the right node version is not already installed nvm use -npm install yarn -g +npm install yarn -g # To install yarn ``` Install dependencies diff --git a/server/.env.dist b/server/.env.dist index 81e5f1e..9af25fb 100644 --- a/server/.env.dist +++ b/server/.env.dist @@ -4,7 +4,7 @@ MAILGUN_DOMAIN=darkwire.io ABUSE_TO_EMAIL_ADDRESS=abuse@darkwire.io ABUSE_FROM_EMAIL_ADDRESS=Darkwire -CLIENT_DIST_DIRECTORY='client/dist/path' +CLIENT_DIST_DIRECTORY='client/dist' ROOM_HASH_SECRET='some-uuid' diff --git a/yarn.lock b/yarn.lock index 8da8cc9..44c3ece 100644 --- a/yarn.lock +++ b/yarn.lock @@ -385,7 +385,7 @@ rxjs@^6.5.2: dependencies: tslib "^1.9.0" -semver@^5.5.0, "semver@2 || 3 || 4 || 5": +"semver@2 || 3 || 4 || 5", semver@^5.5.0: version "5.7.1" resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==