From 0ab4febfdf98fbf5609feaf1139393f7689f302a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20S=C3=A4nger?= Date: Wed, 9 Sep 2020 04:59:41 +0200 Subject: [PATCH] fix: added packaging --- Jenkinsfile | 87 ++++++++++++++++++++++ conf.template/prosody-muc-rest.js | 1 + conf.template/prosody-muc-rest.js.template | 21 ++++++ conf.template/prosody-muc-rest.nginx | 59 +++++++++++++++ debian/changelog | 5 ++ debian/compat | 1 + debian/control | 13 ++++ debian/copyright | 19 +++++ debian/install | 4 + debian/rules | 7 ++ 10 files changed, 217 insertions(+) create mode 100644 Jenkinsfile create mode 120000 conf.template/prosody-muc-rest.js create mode 100644 conf.template/prosody-muc-rest.js.template create mode 100644 conf.template/prosody-muc-rest.nginx create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/install create mode 100755 debian/rules diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..630c171 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,87 @@ +#!groovy + +pipeline { + agent none + + environment { + git_commit_message = '' + git_commit_diff = '' + git_commit_author = '' + git_commit_author_name = '' + git_commit_author_email = '' + ANDROID_HOME = '/opt/android-sdk/' + } + + stages { + + // --- BUILD --- + stage('Build') { + agent { + label 'vncportal' + } + steps { + parallel( + 'frontend': { + node('vncportal') { + deleteDir() + checkout scm + sh 'yarn cache clean' + sh 'yarn install' + sh "tar cfz frontend.tgz node_modules" + stash includes: 'frontend.tgz', name: 'frontend' + deleteDir() + } + }, + ) + } + } + + + stage('Packaging') { + agent { + label 'master' + } + steps { + sh "echo 'Packaging'" + deleteDir() + checkout scm + sh "git fetch --tags" + sh "makechangelog.uxf > debian/changelog" + sh "cat debian/changelog" + sh "mkdir src" + sh "sed -n 1p debian/changelog | grep -oP '\\((.*?)\\)' > src/version.txt" + sh "echo '####################################################'" + sh "cat src/version.txt" + sh "echo '####################################################'" + + sh 'rm config/prosody-muc-rest.js' + sh 'cp -P conf.template/prosody-muc-rest.js config/prosody-muc-rest.js' + // yarn fails on node4 with kurento stuff + unstash 'frontend' + sh 'tar xfz frontend.tgz' + lock('debianbuild') { + sh "cd debian; debuild --check-dirname-level 0 --no-tgz-check --no-lintian -kjenkins@vnc.biz -p'gpg --no-tty --passphrase q3tx65wurstbrot'; cd .." + } + sh "mkdir -p ../pkgarchive/" + sh "scp ../*.deb repo@factorypackages.rz.vnc.biz:/srv/repo/apt/incoming/" + sh "ssh repo@factorypackages.rz.vnc.biz /srv/repo/bin/import-new-packages.sh" + sh "mv ../*.deb ../pkgarchive/" + sh "rm ../*.dsc" + sh "rm ../*amd64.build" + sh "rm ../*amd64.changes" + } + } + } + + post { + always { + emailext ( + to: 'stefan.saenger@vnc.biz', + subject: "${env.JOB_NAME} #${env.BUILD_NUMBER}", + body: "Build URL: ${env.BUILD_URL}.", + attachLog: false, + ) + } + } + +} diff --git a/conf.template/prosody-muc-rest.js b/conf.template/prosody-muc-rest.js new file mode 120000 index 0000000..e2a0fe7 --- /dev/null +++ b/conf.template/prosody-muc-rest.js @@ -0,0 +1 @@ +/etc/prosody-muc-rest.js \ No newline at end of file diff --git a/conf.template/prosody-muc-rest.js.template b/conf.template/prosody-muc-rest.js.template new file mode 100644 index 0000000..0125054 --- /dev/null +++ b/conf.template/prosody-muc-rest.js.template @@ -0,0 +1,21 @@ +module.exports = { + development: { + servicePort: 9511, + telnet: { + host: "127.0.0.1", + port: 5582, + negotiationMandatory: false, + timeout: 1500 + }, + database: { + host: "127.0.0.1", + port: 5432, + name: "prosody", + user: "postgres", + pass: "postgres", + idleTimeoutMillis: 10000, + connectionTimeoutMillis: 10000 + }, + mucDomain: "conference.demo.vnc.de" + } +}; diff --git a/conf.template/prosody-muc-rest.nginx b/conf.template/prosody-muc-rest.nginx new file mode 100644 index 0000000..f8d9c00 --- /dev/null +++ b/conf.template/prosody-muc-rest.nginx @@ -0,0 +1,59 @@ +server { + listen 9534 default_server; + + server_name xmpp.vnc.biz; + + #root ${VNCTALK_PATH}; + root /usr/share/nginx/html; + index index.html index.htm; + + ssl on; + ssl_certificate /etc/ssl/vnc.biz.fullchain.pem; + ssl_certificate_key /etc/ssl/wildcard.vnc.biz.key; + ssl_session_timeout 5m; + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_prefer_server_ciphers on; + ssl_ciphers "EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA256:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EDH+aRSA+AESGCM:EDH+aRSA+SHA256:EDH+aRSA:EECDH:!aNULL:!eNULL:!MEDIUM:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!SEED"; + + add_header Strict-Transport-Security "max-age=31536000"; + client_max_body_size 10M; + + location ~ /api(.*)$ { + auth_basic "xmpp rest"; + auth_basic_user_file /etc/nginx/.htpasswd; + proxy_pass http://localhost:9535; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header Host demo.vnc.de; + proxy_buffering off; + proxy_read_timeout 300s; + proxy_connect_timeout 60s; + } + +} + +server +{ + #listen 127.0.0.1:9535; + listen 9535 default_server; + server_name muc-rest; + client_max_body_size 0; + + access_log /var/log/nginx/muc-access.log; + error_log /var/log/nginx/error.log; + + root /usr/share/prosody-muc-rest/; + index index.html index.htm; + + # Turn on Passenger + passenger_enabled on; + #passenger_min_instances 5; + #passenger_max_requests 3000; + # Tell Passenger that your app is a Node.js app + passenger_app_type node; + passenger_sticky_sessions on; + passenger_app_root /usr/share/prosody-muc-rest; + passenger_env_var NODE_ENV development; + passenger_startup_file app/app.js; + +} diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..1fbd6ec --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +prosody-muc-rest (0.1.1-trusty) unstable; urgency=low + + * initial packaging + + -- Stefan Sänger Fri, 08 Jul 2016 15:54:24 +0200 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..992fa33 --- /dev/null +++ b/debian/control @@ -0,0 +1,13 @@ +Source: prosody-muc-rest +Section: misc +Priority: optional +Maintainer: Stefan Sänger +Build-Depends: cdbs, debhelper (>= 5), nodejs +Standards-Version: 3.8.0 +Homepage: http://www.vnc.biz + +Package: prosody-muc-rest +Architecture: all +Depends: ${shlibs:Depends}, ${misc:Depends}, nginx, passenger +Description: VNCtalk Prosody MUC REST api + prosody-muc-rest diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..bfbbd72 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,19 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: vnctalk-hybrid-authenticator2 +Source: https://gitlab.vnc.biz/uxf/vnctalk-hybrid-authenticator2 +Copyright: VNC AG +License: AGPL-3+ + +License: AGPL-3+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..68485cf --- /dev/null +++ b/debian/install @@ -0,0 +1,4 @@ +app /usr/share/prosody-muc-rest/ +conf.template /usr/share/prosody-muc-rest/ +config /usr/share/prosody-muc-rest/ +node_modules /usr/share/prosody-muc-rest/ diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..657234c --- /dev/null +++ b/debian/rules @@ -0,0 +1,7 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +%: + dh $@