Skip to content
Snippets Groups Projects
Commit 62f94f27 authored by Léopold Chappuis's avatar Léopold Chappuis Committed by Léopold Chappuis
Browse files

packaging: add build and installation script

Add scripts to generate the bare minimum files needed to run the application, approximately 25 MB. External dependencies are not included at this stage; the server must have npm installed to run the application and manage daemon dependencies.

Change-Id: I989d9561300b94c897b832a74965a5ff5975e6a0
parent 625edb48
Branches
Tags
No related merge requests found
...@@ -14,3 +14,6 @@ server/*jami.node ...@@ -14,3 +14,6 @@ server/*jami.node
client/cypress/videos/ client/cypress/videos/
client/cypress/screenshots/ client/cypress/screenshots/
client/**/cypress.env.json client/**/cypress.env.json
jami-web-production
jami-web.tar.gz
\ No newline at end of file
build.sh 0 → 100755
#!/bin/sh
# This script assumes that all daemon dependencies have been successfully installed.
# If they are not, please visit https://git.jami.net/savoirfairelinux/jami-daemon/ for further information.
# ===========Building daemon===============
echo "Building daemon …"
git submodule update --init --recursive
cd daemon
mkdir build
cd build
cmake .. -DJAMI_NODEJS=ON -DBUILD_TESTING=OFF
make -j4
cd ..
cp bin/nodejs/build/Release/jamid.node ../server
cd ..
# ============Cleaning the app==============
echo "Cleaning the app…"
npm run clean:all
# =======Installing node dependencies=======
echo "Installing node dependencies…"
npm install
# ============Building the app==============
echo "Building the app…"
npm run build
echo "Copying files to production folder…"
mkdir jami-web-production jami-web-production/client jami-web-production/server jami-web-production/common
cp -r server/dist jami-web-production/server
cp -r common/dist jami-web-production/common
cp -r client/dist jami-web-production/client
cp package*.json jami-web-production
cp server/package*.json jami-web-production/server
cp common/package*.json jami-web-production/common
cp client/package*.json jami-web-production/client
cp server/tsconfig.tsbuildinfo jami-web-production/server
cp client/tsconfig.tsbuildinfo jami-web-production/client
cp common/tsconfig.tsbuildinfo jami-web-production/common
cp -r server/scripts jami-web-production/server
cp server/jamid.node jami-web-production/server
cp server/.env jami-web-production/server
cp install.sh jami-web-production
cp jami-web.service jami-web-production
echo "Creating archive…"
tar -czvf jami-web.tar.gz jami-web-production
\ No newline at end of file
#!/bin/sh
# Default installation on a debian based system
# Warning: This script requires root privileges to
# install dependencies and configure the service/user.
# ===========Installing dependencies===============
echo "Installing dependencies…\n"
sudo apt-get update
sudo apt install autoconf automake autopoint bison libsecp256k1-1 build-essential cmake curl git nasm pkg-config yasm nodejs npm -y
npm install -g node-gyp
npm install
# ===========Setting up the application =============
echo "\nSetting up the service…"
sudo cp jami-web.service /etc/systemd/system/jami-web.service
cd ..
sudo mv jami-web-production /srv/jami-web
sudo useradd -m -d /srv/jami-web/data jamid
sudo chown -R jamid:jamid /srv/jami-web
sudo systemctl daemon-reload
sudo systemctl enable jami-web.service
sudo systemctl start jami-web.service
echo "\nInstallation successfully completed!"
echo "Jami Web is now active and running on port 8080 on the system."
\ No newline at end of file
# jami-web.service /etc/systemd/system
# systemctl enable jami-web.service
# systemctl start jami-web.service
# systemctl status jami-web.service
# systemctl stop jami-web.service
# this service file assume that jami-web
# is installed in /srv/jami-web
# and that the user www-data is used to run the service.
[Unit]
Description=Jami Web Service
After=syslog.target network.target network-online.target
[Service]
Type=simple
WorkingDirectory=/srv/jami-web/server
ExecStart=/usr/bin/node /srv/jami-web/server/dist/index.js
Restart=always
RestartSec=10
User=jamid
Group=jamid
Environment=NODE_ENV=production
[Install]
WantedBy=multi-user.target
\ No newline at end of file
...@@ -3,6 +3,11 @@ server { ...@@ -3,6 +3,11 @@ server {
location / { location / {
proxy_pass http://localhost:8080; proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment