summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Allnutt2015-11-23 00:15:04 +0000
committerJack Allnutt2015-11-23 00:19:37 +0000
commitab3fdb818ef40b69bc5b763ca3f4710050fd9068 (patch)
treec2d07ac710da4a7d3f47a83a4fdda8ccd24e4361
parent984137f79b25886957bbe837cfce20d8cd28850c (diff)
downloadaur-ab3fdb818ef40b69bc5b763ca3f4710050fd9068.tar.gz
Kiwi IRC v0.9.2
-rw-r--r--.SRCINFO12
-rw-r--r--PKGBUILD13
-rw-r--r--kiwi.patch129
-rw-r--r--kiwi.patch.225
4 files changed, 86 insertions, 93 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 038cc3aa2f38..93cf7a679b59 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = kiwiirc
pkgdesc = A hand-crafted web-based IRC client that you can enjoy
- pkgver = 0.9.1
- pkgrel = 2
+ pkgver = 0.9.2
+ pkgrel = 1
url = https://kiwiirc.com/
install = kiwiirc.install
arch = any
@@ -12,13 +12,15 @@ pkgbase = kiwiirc
options = emptydirs
options = !strip
backup = etc/kiwiirc/config.js
- source = https://github.com/prawnsalad/KiwiIRC/archive/v0.9.1.tar.gz
+ source = https://github.com/prawnsalad/KiwiIRC/archive/v0.9.2.tar.gz
source = kiwi.patch
+ source = kiwi.patch.2
source = kiwiirc.service
source = kiwiirc.conf.sysusers
source = kiwiirc.conf.tmpfiles
- md5sums = 06c18949f5254262379bc2ba5b29b10a
- md5sums = 3c417d55e5cdbc27fadf8d8b9af1ed76
+ md5sums = d0c34961067b41da944fa0dae2db283d
+ md5sums = 88e6837254d192eb300a3974eeb5d588
+ md5sums = 7da1e40fdaa46d73f9deaecfeef26068
md5sums = bcb28ddb7f0bcc3be830b8045969eb2c
md5sums = 593da856bcf9036bc51380b74d9df394
md5sums = 803080337de27be8921edd76f15c763c
diff --git a/PKGBUILD b/PKGBUILD
index 49f8aec61d12..b14c7371d55a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Jack Allnutt <jack@allnutt.eu>
pkgname=kiwiirc
-pkgver=0.9.1
-pkgrel=2
+pkgver=0.9.2
+pkgrel=1
pkgdesc="A hand-crafted web-based IRC client that you can enjoy"
arch=('any')
url="https://kiwiirc.com/"
@@ -13,11 +13,13 @@ install=('kiwiirc.install')
backup=('etc/kiwiirc/config.js')
source=(https://github.com/prawnsalad/KiwiIRC/archive/v$pkgver.tar.gz
'kiwi.patch'
+ 'kiwi.patch.2'
'kiwiirc.service'
'kiwiirc.conf.sysusers'
'kiwiirc.conf.tmpfiles')
-md5sums=('06c18949f5254262379bc2ba5b29b10a'
- '3c417d55e5cdbc27fadf8d8b9af1ed76'
+md5sums=('d0c34961067b41da944fa0dae2db283d'
+ '88e6837254d192eb300a3974eeb5d588'
+ '7da1e40fdaa46d73f9deaecfeef26068'
'bcb28ddb7f0bcc3be830b8045969eb2c'
'593da856bcf9036bc51380b74d9df394'
'803080337de27be8921edd76f15c763c')
@@ -27,7 +29,8 @@ build() {
cp kiwiirc.conf.sysusers "$srcdir/KiwiIRC-$pkgver/"
cp kiwiirc.conf.tmpfiles "$srcdir/KiwiIRC-$pkgver/"
cd "$srcdir/KiwiIRC-$pkgver"
- git apply --whitespace=fix ../kiwi.patch
+ patch -p1 -l < ../kiwi.patch
+ patch -p1 -l < ../kiwi.patch.2
npm -q install
npm -q dedupe
}
diff --git a/kiwi.patch b/kiwi.patch
index 2c90cd1e4ec7..41b02689f18d 100644
--- a/kiwi.patch
+++ b/kiwi.patch
@@ -1,5 +1,5 @@
diff --git a/config.example.js b/config.example.js
-index d1f21e7..ad64d34 100644
+index f432409..1049700 100644
--- a/config.example.js
+++ b/config.example.js
@@ -6,7 +6,7 @@ conf.group = "";
@@ -20,7 +20,7 @@ index d1f21e7..ad64d34 100644
// Transports available to the client.
// Behind an Apache reverse proxy? Uncomment the below - Apache does not support websockets!
-@@ -105,7 +105,7 @@ conf.client_plugins = [
+@@ -122,7 +122,7 @@ conf.client_plugins = [
// Directory to find the server modules
@@ -28,9 +28,9 @@ index d1f21e7..ad64d34 100644
+conf.module_dir = "/usr/lib/kiwiirc/server_modules/";
// Which modules to load
- conf.modules = [];
+ conf.modules = [
diff --git a/kiwi b/kiwi
-index 3ac269e..dca2dcc 100755
+index ddcdfdf..dca2dcc 100755
--- a/kiwi
+++ b/kiwi
@@ -1,11 +1,6 @@
@@ -41,95 +41,45 @@ index 3ac269e..dca2dcc 100755
- *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
-esac
-
--node $basedir/server/helpers/launcher.js "$@"
+-$(command -v nodejs || command -v node) $basedir/server/helpers/launcher.js "$@"
+node /usr/share/kiwiirc/server/helpers/launcher.js "$@"
ret=$?
exit $ret
-diff --git a/server/helpers/launcher.js b/server/helpers/launcher.js
-index b4d8ec3..18e74f2 100644
---- a/server/helpers/launcher.js
-+++ b/server/helpers/launcher.js
-@@ -1,5 +1,5 @@
- var kiwi_app = '../kiwi.js';
--var pidfile = '../../kiwiirc.pid';
-+var pidfile = '/run/kiwiirc/kiwiirc.pid';
- var pidfile_arg;
-
- // Check if a pidfile has been set as an argument
-@@ -16,6 +16,13 @@ if (process.argv.indexOf('-p') > -1) {
- }
- }
-
-+try {
-+ process.setgid('kiwiirc');
-+ process.setuid('kiwiirc');
-+} catch (e) {
-+ console.error('Cannot switch to user kiwiirc. Try running as root.')
-+ process.exit();
-+}
-
- var daemon = require('daemonize2').setup({
- main: kiwi_app,
-diff --git a/server/httphandler.js b/server/httphandler.js
-index d89ecad..5c9b78c 100644
---- a/server/httphandler.js
-+++ b/server/httphandler.js
-@@ -14,7 +14,7 @@ var cached_available_locales = null;
-
-
- var HttpHandler = function (config) {
-- var public_http = config.public_http || 'client/';
-+ var public_http = config.public_http || global.config.public_http || 'client/';
- this.file_server = new node_static.Server(public_http);
-
- if (!cached_available_locales) {
-diff --git a/server/settingsgenerator.js b/server/settingsgenerator.js
-index 6f70be1..f420819 100644
---- a/server/settingsgenerator.js
-+++ b/server/settingsgenerator.js
-@@ -112,7 +112,7 @@ function addThemes() {
- return (config.get().client_themes || ['relaxed']).reduce(function (prom, theme) {
- return prom.then(function (themes) {
- return new Promise(function readThemeInfo(resolve, reject) {
-- fs.readFile(__dirname + '/../client/assets/themes/' + theme.toLowerCase() + '/theme.json', function (err, theme_json) {
-+ fs.readFile(global.config.public_http + '/assets/themes/' + theme.toLowerCase() + '/theme.json', function (err, theme_json) {
- var theme;
- if (err) {
- return reject(err);
-@@ -134,7 +134,7 @@ function addThemes() {
-
- function addTranslations() {
- return new Promise(function (resolve, reject) {
-- fs.readFile(__dirname + '/../client/src/translations/translations.json', function readTranslations(err, translations) {
-+ fs.readFile(global.config.public_http + '/src/translations/translations.json', function readTranslations(err, translations) {
- if (err) {
- return reject(err);
- }
-@@ -145,7 +145,7 @@ function addTranslations() {
- return reject(e);
- }
-
-- fs.readdir(__dirname + '/../client/src/translations/', function readTranslationFile(err, pofiles) {
-+ fs.readdir(global.config.public_http + '/src/translations/', function readTranslationFile(err, pofiles) {
- var trans = [];
-
- if (err) {
+diff --git a/server_modules/client_file_watcher.js b/server_modules/client_file_watcher.js
+index 2c3a017..47ad093 100644
+--- a/server_modules/client_file_watcher.js
++++ b/server_modules/client_file_watcher.js
+@@ -6,12 +6,12 @@
+
+ var fs = require('fs');
+ var path = require('path');
+-var kiwiModules = require('../server/modules');
++var kiwiModules = require('/usr/share/kiwiirc/server/modules');
+
+ var module = new kiwiModules.Module('client_file_watcher');
+
+ // Watch the common stylesheets
+-fs.watch('client/assets/css', alertClients);
++fs.watch('/var/lib/kiwiirc/assets/css', alertClients);
+
+
+ // Watch the theme stylesheets
diff --git a/server_modules/control.js b/server_modules/control.js
-index c1e5517..3fb3ef7 100644
+index d1c9cbf..1e187ec 100644
--- a/server_modules/control.js
+++ b/server_modules/control.js
@@ -5,8 +5,8 @@
- */
-
- var net = require('net'),
-- kiwiModules = require('../server/modules'),
-- ControlInterface = require('../server/controlinterface.js'),
+ */
+
+ var net = require('net'),
+- kiwiModules = require('../server/modules'),
+- ControlInterface = require('../server/controlinterface.js'),
+ kiwiModules = require('/usr/share/kiwiirc/server/modules'),
+ ControlInterface = require('/usr/share/kiwiirc/server/controlinterface.js'),
- _ = require('lodash'),
- winston = require('winston');
-
+ _ = require('lodash'),
+ winston = require('winston');
+
diff --git a/server_modules/dnsbl.js b/server_modules/dnsbl.js
index 1a2c718..54a4300 100644
--- a/server_modules/dnsbl.js
@@ -153,6 +103,19 @@ index d880c19..575dc5f 100644
var module = new kiwiModules.Module('Example Module');
+diff --git a/server_modules/force_https.js b/server_modules/force_https.js
+index 9ca8362..512ffed 100644
+--- a/server_modules/force_https.js
++++ b/server_modules/force_https.js
+@@ -4,7 +4,7 @@
+ * Keep users secure by redirecting them to HTTPS if not already
+ */
+
+-var kiwiModules = require('../server/modules');
++var kiwiModules = require('/usr/share/kiwiirc/server/modules');
+
+ var module = new kiwiModules.Module('force_https');
+
diff --git a/server_modules/proxychecker.js b/server_modules/proxychecker.js
index 660defc..7fb96e6 100644
--- a/server_modules/proxychecker.js
diff --git a/kiwi.patch.2 b/kiwi.patch.2
new file mode 100644
index 000000000000..ca91ef315a67
--- /dev/null
+++ b/kiwi.patch.2
@@ -0,0 +1,25 @@
+diff --git a/server/helpers/launcher.js b/server/helpers/launcher.js
+index a1f1208..47770b6 100644
+--- a/server/helpers/launcher.js
++++ b/server/helpers/launcher.js
+@@ -1,5 +1,5 @@
+ var kiwi_app = '../kiwi.js';
+-var pidfile = '../../kiwiirc.pid';
++var pidfile = '/run/kiwiirc/kiwiirc.pid';
+ var pidfile_arg;
+
+ // Check if a pidfile has been set as an argument
+@@ -16,6 +16,13 @@ if (process.argv.indexOf('-p') > -1) {
+ }
+ }
+
++try {
++ process.setgid('kiwiirc');
++ process.setuid('kiwiirc');
++} catch (e) {
++ console.error('Cannot switch to user kiwiirc. Try running as root.')
++ process.exit();
++}
+
+ var daemon = require('daemonize2').setup({
+ main: kiwi_app,