mirror of
https://github.com/darkwire/darkwire.io.git
synced 2025-09-02 09:22:21 +00:00
Fix env loading
This commit is contained in:
parent
d2846e1605
commit
6d0b703102
6
build.sh
6
build.sh
@ -9,11 +9,7 @@ fi
|
|||||||
|
|
||||||
echo "building client..."
|
echo "building client..."
|
||||||
cd client
|
cd client
|
||||||
yarn --production=false
|
yarn --production=false
|
||||||
VITE_COMMIT_SHA=$SOURCE_VERSION \
|
|
||||||
VITE_API_HOST=$api_host \
|
|
||||||
VITE_API_PROTOCOL=$API_PROTOCOL \
|
|
||||||
VITE_API_PORT=$API_PORT \
|
|
||||||
yarn build
|
yarn build
|
||||||
cd ../
|
cd ../
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ let host;
|
|||||||
let protocol;
|
let protocol;
|
||||||
let port;
|
let port;
|
||||||
|
|
||||||
switch (import.meta.env.NODE_ENV) {
|
switch (import.meta.env.MODE) {
|
||||||
case 'staging':
|
case 'staging':
|
||||||
host = import.meta.env.VITE_API_HOST;
|
host = import.meta.env.VITE_API_HOST;
|
||||||
protocol = import.meta.env.VITE_API_PROTOCOL || 'https';
|
protocol = import.meta.env.VITE_API_PROTOCOL || 'https';
|
||||||
|
@ -12,7 +12,6 @@ import 'bootstrap/dist/js/bootstrap.bundle.min.js';
|
|||||||
import configureStore from '@/store/';
|
import configureStore from '@/store/';
|
||||||
import Home from '@/components/Home/';
|
import Home from '@/components/Home/';
|
||||||
import { hasTouchSupport } from '@/utils/dom';
|
import { hasTouchSupport } from '@/utils/dom';
|
||||||
import { AlertTriangle } from 'react-feather';
|
|
||||||
|
|
||||||
const store = configureStore();
|
const store = configureStore();
|
||||||
|
|
||||||
@ -44,13 +43,14 @@ const Main = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const root = createRoot(document.getElementById('root') as HTMLElement);
|
|
||||||
|
|
||||||
if (!window.crypto || !window.crypto.subtle) {
|
if (!window.crypto || !window.crypto.subtle) {
|
||||||
window.alert("You must access Darkwire from a secure HTTPS connection.")
|
window.alert("You must access Darkwire from a secure HTTPS connection.")
|
||||||
throw new Error("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(
|
root.render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<Main />
|
<Main />
|
||||||
|
@ -7,16 +7,16 @@ set -e
|
|||||||
|
|
||||||
echo "
|
echo "
|
||||||
TZ=UTC
|
TZ=UTC
|
||||||
REACT_APP_API_HOST=$REACT_APP_API_HOST
|
VITE_API_HOST=$VITE_API_HOST
|
||||||
REACT_APP_API_PROTOCOL=$REACT_APP_API_PROTOCOL
|
VITE_API_PROTOCOL=$VITE_API_PROTOCOL
|
||||||
REACT_APP_API_PORT=$REACT_APP_API_PORT
|
VITE_API_PORT=$VITE_API_PORT
|
||||||
REACT_APP_COMMIT_SHA=$REACT_APP_COMMIT_SHA
|
VITE_COMMIT_SHA=$VITE_COMMIT_SHA
|
||||||
|
|
||||||
# To display darkwire version
|
# 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
|
# 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
|
" > client/.env
|
||||||
|
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ MAILGUN_DOMAIN=$MAILGUN_DOMAIN
|
|||||||
ABUSE_TO_EMAIL_ADDRESS=$ABUSE_TO_EMAIL_ADDRESS
|
ABUSE_TO_EMAIL_ADDRESS=$ABUSE_TO_EMAIL_ADDRESS
|
||||||
ABUSE_FROM_EMAIL_ADDRESS=$ABUSE_FROM_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
|
ROOM_HASH_SECRET=$ROOM_HASH_SECRET
|
||||||
|
|
||||||
|
@ -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:
|
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
|
nvm use
|
||||||
npm install yarn -g
|
npm install yarn -g # To install yarn
|
||||||
```
|
```
|
||||||
|
|
||||||
Install dependencies
|
Install dependencies
|
||||||
|
@ -4,7 +4,7 @@ MAILGUN_DOMAIN=darkwire.io
|
|||||||
ABUSE_TO_EMAIL_ADDRESS=abuse@darkwire.io
|
ABUSE_TO_EMAIL_ADDRESS=abuse@darkwire.io
|
||||||
ABUSE_FROM_EMAIL_ADDRESS=Darkwire <no-reply@darkwire.io>
|
ABUSE_FROM_EMAIL_ADDRESS=Darkwire <no-reply@darkwire.io>
|
||||||
|
|
||||||
CLIENT_DIST_DIRECTORY='client/dist/path'
|
CLIENT_DIST_DIRECTORY='client/dist'
|
||||||
|
|
||||||
ROOM_HASH_SECRET='some-uuid'
|
ROOM_HASH_SECRET='some-uuid'
|
||||||
|
|
||||||
|
@ -385,7 +385,7 @@ rxjs@^6.5.2:
|
|||||||
dependencies:
|
dependencies:
|
||||||
tslib "^1.9.0"
|
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"
|
version "5.7.1"
|
||||||
resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz"
|
resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz"
|
||||||
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
|
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
|
||||||
|
Loading…
x
Reference in New Issue
Block a user