non working experimental status

version-1
Marc Wäckerlin 9 years ago
parent d7bf59444e
commit 787eefc67c
  1. 5
      ChangeLog
  2. 2
      cordova/platforms/android/AndroidManifest.xml
  3. 21
      cordova/platforms/android/assets/www/cordova_plugins.js
  4. 9
      cordova/platforms/android/res/xml/config.xml
  5. 6
      html/login.php
  6. 15
      html/opendb.php
  7. 20
      html/safechat.js
  8. 2
      html/send.php
  9. 6
      test/makefile.am
  10. 29
      test/runtests.sh
  11. 4
      test/settings.wt

@ -1,3 +1,8 @@
2015-12-04 08:36 marc
* COPYING, ChangeLog, INSTALL, build-in-docker.conf,
build-in-docker.sh: distinguish by hw arch
2015-12-04 07:05 marc
* COPYING, ChangeLog, INSTALL, build-in-docker.conf,

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="359" android:versionName="0.3.59" package="ch.safechat" xmlns:android="http://schemas.android.com/apk/res/android">
<manifest android:hardwareAccelerated="true" android:versionCode="361" android:versionName="0.3.61" package="ch.safechat" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

@ -3,33 +3,30 @@ module.exports = [
{
"file": "plugins/cordova-plugin-whitelist/whitelist.js",
"id": "cordova-plugin-whitelist.whitelist",
"pluginId": "cordova-plugin-whitelist",
"runs": true
},
{
"file": "plugins/cordova-plugin-device/www/device.js",
"id": "cordova-plugin-device.device",
"pluginId": "cordova-plugin-device",
"clobbers": [
"device"
]
},
{
"file": "plugins/de.appplant.cordova.plugin.background-mode/www/background-mode.js",
"id": "de.appplant.cordova.plugin.background-mode.BackgroundMode",
"pluginId": "de.appplant.cordova.plugin.background-mode",
"clobbers": [
"cordova.plugins.backgroundMode",
"plugin.backgroundMode"
]
},
{
"file": "plugins/cordova-plugin-device/www/device.js",
"id": "cordova-plugin-device.device",
"clobbers": [
"device"
]
}
];
module.exports.metadata =
// TOP OF METADATA
{
"cordova-plugin-whitelist": "1.0.0",
"cordova-plugin-device": "1.1.0",
"de.appplant.cordova.plugin.background-mode": "0.6.4"
"de.appplant.cordova.plugin.background-mode": "0.6.4",
"cordova-plugin-device": "1.1.0"
}
// BOTTOM OF METADATA
});

@ -1,17 +1,10 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="ch.safechat" version="0.3.59" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="ch.safechat" version="0.3.61" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<preference name="loglevel" value="DEBUG" />
<feature name="Whitelist">
<param name="android-package" value="org.apache.cordova.whitelist.WhitelistPlugin" />
<param name="onload" value="true" />
</feature>
<feature name="Device">
<param name="android-package" value="org.apache.cordova.device.Device" />
</feature>
<feature name="BackgroundMode">
<param name="android-package" value="de.appplant.cordova.plugin.background.BackgroundMode" />
</feature>
<preference name="KeepRunning" value="true" />
<allow-intent href="market:*" />
<name>SafeChat</name>
<description>

@ -24,12 +24,14 @@
function login($user, $pubkey) {
try {
require_once("opendb.php");
if (!$db) error("database access failed");
if ($user=="safechat") error("username safechat is reserved for server");
$verify = gnupg_import($pgp, $pubkey);
if (!$verify) error("wrong identity");
//$verify = gnupg_import($pgp, $pubkey);
//if (!$verify) error("wrong identity");
$user = $db->real_escape_string($user);
$pubkey = $db->real_escape_string($pubkey);
$q = $db->query("select * from user where name='$user' and pubkey='$pubkey';");
if (!$q) error("database query failed");
if ($q->num_rows==1) {
success("user $user found on server");
} elseif ($q->num_rows==0) {

@ -11,6 +11,7 @@
mysqli_report(MYSQLI_REPORT_STRICT);
require_once("functions.php");
/*
try {
if (!isset($pgp)) {
$pgp = gnupg_init();
@ -19,17 +20,23 @@ try {
} catch (Exception $e) {
error('cannot start pgp on server');
}
*/
try {
if (!isset($db)) {
$db = new mysqli("mysql", "root", $_SERVER["MYSQL_ENV_MYSQL_ROOT_PASSWORD"]);
if (!$db) error("database connection failed on server");
$db->query("create database if not exists safechat;");
if (!$db) error("cannot create database");
$db->select_db("safechat");
if (!$db) error("cannot create database for safechat");
$db->query(file_get_contents("schema.sql"));
if (!$db) error("cannot select database");
$query = file_get_contents("schema.sql");
if (!$query) error("cannot load database schema");
foreach (split(";\n", $query) as $create) {
if ($create) {
$db->query($create);
if (!$db) error("cannot create database tables");
}
}
} catch (Exception $e) {
error('database error on server');
error('database error on server: '+$e->getMessage());
}
?>

@ -294,7 +294,8 @@ function createkeypair(user, pwd) {
localStorage["privKey"] = keyPair.privateKeyArmored;
login();
}).catch(function(e) {
error(e);
console.log(e.stack);
error("generating key pairs failed");
});
}
@ -668,10 +669,26 @@ function newuser() {
});
}
/// Check if local storage is available
function checkLocalStorage() {
var test = 'test';
try {
localStorage.setItem(test, test);
localStorage.removeItem(test);
return true;
} catch(e) {
status("<p>No access to local storage. Please allow "+window.location.hostname
+" to access localhost, i.e. do not block cookies.<p>");
error("local storage not available");
}
return false;
}
/// Initial Function: Startup
/** Decide whether to login or to create a new user */
function start() {
$("#menu").hide();
if (checkLocalStorage())
try {
status("Starting up ...");
if (!userid()) {
@ -680,6 +697,7 @@ function start() {
login();
}
} catch (m) {
console.log(m.stack);
error(m);
}
}

@ -29,8 +29,10 @@ function send($user, $msg) {
if (strlen($_REQUEST['msg'])>100000) error("message is too long");
$q = $db->query("select pubkey from user where name='$user';");
if (!$q || $q->num_rows!=1) error("user not found on server");
/*
$pubkey = gnupg_import($pgp, $q->fetch_row()[0]);
if (!$pubkey) error("wrong identity");
*/
$q = $db->query("insert into message (user, msg) values ('$user', '$msg');");
if (!$q) {
error_log("Error storing message: ".$db->error);

@ -8,8 +8,8 @@
## 1 2 3 4 5 6 7 8
## 45678901234567890123456789012345678901234567890123456789012345678901234567890
TESTS =
dist_check_DATA = settings.wt testcase.wt
dist_check_SCRIPTS = runtests.sh
TESTS = $(dist_check_SCRIPTS)
MAINTAINERCLEANFILES = makefile.in

@ -1,4 +1,4 @@
#!/bin/bash -e
#!/bin/bash
#check for a text in a docker volume log
function check() {
@ -41,17 +41,24 @@ fi
# option checks
NEED_XVFB=0
NEED_DOCKER=0
NEED_DOCKER=1
NEED_WEBTESTER=0
PORT=
while test $# -gt 0; do
case "$1" in
(--help|-h)
echo "$0 [OPTIONS] [PORTS <port>]"
echo "$0 [OPTIONS]"
echo
echo "OPTIONS:"
echo
echo " -p <PORT> don't run, just prepare test on port <PORT>"
echo
exit 0
;;
(-p|--port)
shift
PORT=$1
;;
(*) echo "**** ERROR: unknown option '$1', try --help"; exit 1;;
esac
if test $# -eq 0; then
@ -120,6 +127,18 @@ set -x
# Add tests here
MYSQL=$(docker run -d -e MYSQL_ROOT_PASSWORD=TopSecretLOL mysql)
PHP=$(docker run -d --volume $(pwd)/../html:/usr/share/nginx/html:ro --link ${MYSQL}:mysql mwaeckerlin/php-fpm)
NGINX=$(docker run -d --volumes-from ${PHP} --link ${PHP}:php -p 8080:80 mwaeckerlin/nginx)
if test -z "${PORT}"; then
NGINX=$(docker run -d --volumes-from ${PHP} --link ${PHP}:php mwaeckerlin/nginx)
trap "docker rm -f ${NGINX} ${PHP} ${MYSQL}" INT TERM EXIT
docker pull mwaeckerlin/webtester
set -e
countdown 10 20 wait_for_mysql ${MYSQL}
docker run --rm --link ${NGINX}:safechat -u $(id -u) -v $(pwd):/tests -e WEBRUNNER_SCRIPTS="settings.wt testcase.wt" mwaeckerlin/webtester
else
NGINX=$(docker run -d -p ${PORT}:80 --volumes-from ${PHP} --link ${PHP}:php mwaeckerlin/nginx)
trap "docker rm -f ${NGINX} ${PHP} ${MYSQL}" INT TERM EXIT
sleep 60
set +x
echo "Ready to test; press enter to end"
read
set -x
fi

@ -1 +1,3 @@
set SAFECHAT-URL=http://localhost:8080
set SAFECHAT-URL=http://safechat
set SAFECHAT-URL=http://localhost:8888
offline-storage-path /tmp/safechat-test
Loading…
Cancel
Save