Open emrahcom opened 3 months ago
Version 16 is recommended.
I deleted node 20
and installed node 16
.
My current /etc/apt/sources.list.d/nodesource.list
:
deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x nodistro main
The versions:
% nodejs --version
v16.20.2
% npm --version
8.19.4
% yarn --version
1.22.22
I removed the old clone and cloned the repo again, installed Python modules. Now I have the following for dashboard
:
% pwd
/home/upstage/upstage/dashboard
% yarn
yarn install v1.22.22
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.34s.
% yarn build
ERROR Failed to compile with 2 errors 4:51:29 PM
error
Template execution failed: ReferenceError: VUE_APP_JITSI_ENDPOINT is not defined
ReferenceError: VUE_APP_JITSI_ENDPOINT is not defined
- index.html:108
/home/upstage/upstage/dashboard/public/index.html:108:11
- index.html:111 0971.module.exports
/home/upstage/upstage/dashboard/public/index.html:111:3
- index.js:284
[dashboard]/[html-webpack-plugin]/index.js:284:18
ERROR Build failed with errors.
error Command failed with exit code 1.
That is OK, I think I should set some environment variables before building. I will check it later.
For studio
:
% pwd
/home/upstage/upstage/studio
% yarn
yarn install v1.22.22
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.18s.
% yarn genql
yarn run v1.22.22
$ genql --endpoint $(grep VITE_GRAPHQL_ENDPOINT .env)studio_graphql/ --output ./src/genql/studio && genql --endpoint $(grep VITE_GRAPHQL_ENDPOINT .env)config_graphql/ --output ./src/genql/config
grep: .env: No such file or directory
/home/upstage/upstage/studio/node_modules/yargs/build/lib/usage.js:12
const stringWidth = require("string-width");
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/upstage/upstage/studio/node_modules/string-width/index.js from /home/upstage/upstage/studio/node_modules/yargs/build/lib/usage.js not supported.
Instead change the require of index.js in /home/upstage/upstage/studio/node_modules/yargs/build/lib/usage.js to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (/home/upstage/upstage/studio/node_modules/yargs/build/lib/usage.js:12:21)
at Object.<anonymous> (/home/upstage/upstage/studio/node_modules/yargs/build/lib/yargs.js:7:17)
at Object.<anonymous> (/home/upstage/upstage/studio/node_modules/yargs/yargs.js:7:27)
at Object.<anonymous> (/home/upstage/upstage/studio/node_modules/yargs/index.js:5:15)
at Object.<anonymous> (/home/upstage/upstage/studio/node_modules/@genql/cli/dist/cli.js:9:33) {
code: 'ERR_REQUIRE_ESM'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
What should I do now to fix this?
You're missing an .env file in the studio dir, which looks like this:
VITE_API_ENDPOINT=http://localhost/api/ VITE_GRAPHQL_ENDPOINT=http://localhost/api/ VITE_STATIC_ASSETS_ENDPOINT=http://localhost/static/assets/ VITE_STUDIO_ENDPOINT=/stages/ VITE_MQTT_NAMESPACE=dev VITE_MQTT_ENDPOINT= VITE_MQTT_USERNAME= VITE_MQTT_PASSWORD= VITE_STREAMING_PUBLISH_ENDPOINT=not_used VITE_STREAMING_SUBSCRIBE_ENDPOINT=not_used VITE_STREAMING_USERNAME= VITE_STREAMING_PASSWORD= VITE_JITSI_ENDPOINT= VITE_CLOUDFLARE_CAPTCHA_SITEKEY=
yarn genql
has still the same error (Error [ERR_REQUIRE_ESM]...
) after creating .env
inside /home/upstage/upstage/studio
I am not sure what is wrong here, and I don't have time right now to look into it. This installation is going to be difficult. It may not be worth your time. We are eventually going to dockerize it, but that hasn't happened yet.
FYI: Adding resolution
to package.json looks like fix this error.
"devDependencies": {
"@genql/cli": "^6.2.1",
"@tailwindcss/typography": "^0.5.10",
"@types/object-hash": "^3.0.6",
"@vitejs/plugin-vue": "^4.5.2",
"sass": "^1.26.5",
"sass-loader": "^8.0.2",
"typescript": "^5.2.2",
"vite": "^4.4.9",
"vite-tsconfig-paths": "^4.2.1",
"vue-tsc": "^1.8.26"
},
"resolutions": {
"string-width": "4.2.3"
}
}
But now, I have this:
% yarn genql
yarn run v1.22.22
$ genql --endpoint $(grep VITE_GRAPHQL_ENDPOINT .env)studio_graphql/ --output ./src/genql/studio && genql --endpoint $(grep VITE_GRAPHQL_ENDPOINT .env)config_graphql/ --output ./src/genql/config
❯ generating the client in `./src/genql/studio`
✖ Failed to parse URL from VITE_GRAPHQL_ENDPOINT=http://localhost/api/studio_graphql/
◼ preparing client directory
◼ writing files
Cannot generate, got an error:
undefined
error Command failed with exit code 1.
Does it wait for a working graphql at built time? By the way, I'm not waiting for a quick response.
Sorry, those instructions need to be updated. Run this: yarn fix_genql_urls instead of running genql We use a custom script for this now.
Yes, it works now. The built is completed
Fantastic! Thank you.
I will start installing services (such as postgres, mqtt) and integrating them with upstage
.
I want to continue here for the future problems.
So, please don't close this issue.
It will remain open until you close it.
Yes, it works now. The built is completed
that's great to hear! thanks so much for persisting :smiley:
For future readers, dashboard
was also built after creating .env
by cloning .env.localhost
As a note: I need to create /home/upstage/uwsgi_sockets
and /var/log/uwsgi
and set upstage
as owner of them to start uwsgi
.
As root
:
mkdir -p /home/upstage/uwsgi_sockets
mkdir -p /var/log/uwsgi
chown upstage: /home/upstage/uwsgi_sockets
chown upstage: /var/log/uwsgi
As note, before starting uwsgi
:
cd /home/upstage/upstage/config
cp your_hostname.py $(hostname).py
Looks like JWT_SECRET_KEY
must be set in somewhere and the correct place for it is /home/upstage/upstage/config/$(hostname).py
I have questions related with CIPHER_KEY
and SECRET_KEY
.
IIUC, I should generate the cipher key like the following:
% cd /home/upstage/upstage/core/auth
% python3 fernet_crypto.py
gAAAAABm1JnXOQq4z0taafajjQS7mhF9h-RKNxSK0LPjdyX1f86PkxdbjHMwedCHSlfWA7PZuufd4-mBtuJIKZidYYMaPig2pw==
Copy-paste this key: b'WHmdmtWq4PzXRdPz1Mk1K83xyaiTRcUcSM9te5j-uzw='
and I should set this value as CIPHER_KEY
. According to this example, I think it should be:
CIPHER_KEY = b'WHmdmtWq4PzXRdPz1Mk1K83xyaiTRcUcSM9te5j-uzw='
Is this correct?
How should I generate SECRET_KEY
?
That is correct, and SECRET_KEY can be manually generated with keystrokes.
As a note, Mosquitto should support websockets
:
/etc/mosquitto/mosquitto.conf
listener 1883
listener 9002
protocol websockets
# for a quick test without authentication
allow_anonymous true
Nginx location block for websockets:
location /mqtt {
proxy_pass http://127.0.0.1:9002;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
tcp_nodelay on;
}
/stages
started working after updating base
in /home/upstage/upstage/studio/vite.config.ts
:
// base: "/".
base: "./",
And related Nginx block is:
location /stages {
alias /home/upstage/upstage/studio/dist;
try_files $uri $uri/ /index.html;
}
I have an up-to-date Debian 12 Bookworm VM. I installed
nodejs
andyarn
.My
/etc/apt/sources.list.d/nodesource.list
:My
/etc/apt/sources.list.d/yarn.list
These are the installed versions:
I cloned the repo and installed Python modules without any problem. I ran the followings by using a normal user account (which is
upstage
in my case):When I tried to build
dashboard
, it failed. Looks like it doesn't supportnode 20
When I tried to build
studio
, I had the following issues:So, how can I install it? Should I use a specific version of
nodejs
or Linux distribution?