nioc / xmpp-web

Lightweight web chat client for XMPP server
GNU Affero General Public License v3.0
143 stars 20 forks source link

Better "install from source" documentation, please? #83

Closed anae-git closed 1 year ago

anae-git commented 1 year ago

Could someone flesh out the install from source documentation a bit, please?

I think it is something along the lines of (but I am probably missing something):

git clone https://github.com/nioc/xmpp-web.git
cd xmpp-web
edit public/local.js
 - set at least the websocket url and defaultDomain
npm run build
npm run dev

along with an nginx proxy config and the bare minimum prosody config would be really nice to see broken out.

nioc commented 1 year ago

Hello, yes it is the following:

git clone https://github.com/nioc/xmpp-web.git
cd xmpp-web
edit public/local.js
npm ci
npm run build

Then you will have a dist folder which contains all the assets to put on a web server (Apache, Nginx, ...).

anae-git commented 1 year ago

Thank you very much. One thing I found strange was that I had to go through and fix a bunch of ternaries because of:

$ npm run build

> xmpp-web@0.9.6 build
> vite build

failed to load config from /var/www/xmpp-web/vite.config.js
error during build:
/var/www/xmpp-web/node_modules/vite-plugin-pwa/dist/index.js:107
    const swType = options2.devOptions.type ?? "classic";
                                             ^

As in, turn that into const swType = options2.devOptions.type ? options2.devOptions.type : "classic"; many times in that file to make it work. I assume I have the wrong version of something installed that doesn't support ?? but I am on an up to date Debian 11.6 VM.

anae-git commented 1 year ago

Looks like Debian 11's Node 12.22 is too old. I manually installed Node 16.19.0 to fix it.

nioc commented 1 year ago

"Node 12" 😱 Many libraries won't works with older node versions (current LTS version is 18 😉).

nioc commented 1 year ago

I recommend you install LTS version from this script:

curl -fsSL https://deb.nodesource.com/setup_18.x | bash - &&\
apt-get install -y nodejs