Compare commits

...

29 Commits

Author SHA1 Message Date
positron 6b4c00cfea Merge pull request 'fix compatibility with recent versions of Boost' (#14) from positron-boost-compatibility-fix into master
Reviewed-on: #14
1 month ago
positron b20512b190 fix compatibility with recent versions of Boost 2 months ago
heck c699ca76b6 pEpEngine=v3.2.0-RC23
libpEpAdapter= v3.2.0-RC3
4 months ago
heck 838acc62dd renamed usage of _inject_sync_event
the functions has been renamed in libpEpAdater since v3.2.0-RC3
4 months ago
heck f44250dd61 Build: added -lstdc++ to LDFLAGS
Clang14 requires -lstdc++
4 months ago
heck cca75dbdb3 Build: Add the DEPENDENCIES file
oh my god...
6 months ago
heck 365ca8fc56 Initialize the session correctly using libpEpAdapter for main thread 6 months ago
heck a7145a0ad4 Release the session correctly using libpEpAdapter 6 months ago
heck 36b0ded115 Init the session correctly using libpEpAdapter 6 months ago
heck 0e48b56391 Remove error handling libpEpAdapter does that now. 6 months ago
heck c316aabc36 Test: 'make test' - use HOME=. to avoid using the users "real" .pEp folder. 7 months ago
heck 581e58900b DOC: Update README.md
* Generally outdated, invalid information.
* A lot has been simplified without sacrificing flexibility.
* Less is more
7 months ago
heck 7dcb9d8404 Build: Fix broken macOS build and streamline build config with other components
* build was broken
* build structure and config now compatible with other components
* You can use System dependencies now without any hacks.
7 months ago
heck 5f46bd0795 Build: Formatting only 7 months ago
heck ef41d0ec3c Build: consolidate multiple .PHONY declarations
its untidy and bad style
7 months ago
heck 16b3db8320 Build: Remove make local.conf
Lets use a local.conf.example, to unclutter the Makefile
7 months ago
roker f0caac7dbb Build: remove superfluous constructs 7 months ago
positron b09ae2cc58 documentation change: html/index.html 9 months ago
positron 24f7ae0d76 HTML interface improvements
Replace old jquery with new version, which appears to be compatible.  Update
user suggestions in the HTML file, explaining a way to workaround CORS policy
problems.
9 months ago
positron a4554fa11a html: add symlink 9 months ago
positron f9de8160a2 make the interactive web-based interface to the JSON server work again, with a kludge...
...and explain the kludge in the web interface itself.  It is the first time I
see this thing work at all --- and I definitely like it.
9 months ago
roker 550420b4c4 implement toggle() which was missing for whatever reason. :-O 9 months ago
roker 90a76c093c update NFC data from Unicode 13.0.0 to Unicode 14.0.0. 9 months ago
roker 150b69fef5 JSON-197: CallbackDispatcher -> Adapter 9 months ago
positron 87c7279291 JSON-197: remove blacklist_*(), add adapter_group_*(): FIXME: clarify ownership!!! – bump API version to 3.1.0. 9 months ago
positron 6616c9589e minor README.md updates 9 months ago
roker c7be4b8f0f document that we now need Engine Release_3.1 9 months ago
positron b499ebba0c switch from slurp, now removed from libpEpAdapter, to std_utils from libpepcxx11 9 months ago
positron d92a5d3116 build system: link with libz, which helps with static builds and is harmless 9 months ago

@ -0,0 +1,6 @@
# 1st Party Dependencies
## Prefer git tags instead of SHA hashes always
pEpEngine=v3.2.0-RC23
libpEpAdapter= v3.2.0-RC3
libpEpCxx=v3.2.0-RC0

@ -7,18 +7,26 @@ any client.
## Requirements
In order to use the p≡p JSON Server Adapter, you need to build and run it.
Currently, Linux (Debian 9, Ubuntu 16.04) and MacOS (10.11, 10.12) are
supported, Windows is about to follow. Newer versions should also work
(file a bug report if not) but are not in our main focus, yet.
Currently, Linux (Debian 10, Ubuntu 18.04.6 LTS) and MacOS (10.11, 10.12) are
supported. The build for windows is in `build-windows`
## Dependencies
* C++ compiler: tested with g++ 4.8, 4.9, 8.3 and clang++ 2.8. Newer versions should work, too.
* C++ compiler: tested with g++ 4.8, 4.9, 8.3, 11, 12 and clang++ 2.8. Newer
versions should work, too.
* GNU make
* libboost-thread-dev (tested with 1.58, 1.62, 1.67, 1.70 and 1.74)
* libboost-program-options-dev
* libboost-filesystem-dev
* [p≡p Engine](https://gitea.pep.foundation/pEp.foundation/pEpEngine/)
(which needs sequoia, a patched libetpan, libboost-system-dev)
a p≡p Engine in the 3.x series, not released yet as of 2022-09; at the
time of writing this is the Engine master branch
(with its own dependencies, in particular:
* libpEpTransport
* libpepcxx11
* pEpEngineSequoiaBackend
* a patched libetpan
* libboost-system-dev
)
* [libpEpAdapter](https://gitea.pep.foundation/pEp.foundation/libpEpAdapter/)
* [webserver](https://gitea.pep.foundation/fdik/webserver)
* OSSP libuuid
@ -65,61 +73,10 @@ cd ~/code/json-ad/server
| :warning: FIXME: The following instructions refer to the old Makefile system that built a dynamically linked binary. This old Makefile was replaced by a hack to create a static binary. Unfortunately the config flexibility of the old Makefile system was removed in this change. |
| ------ |
| There is now also an ad-hoc created `Makefile.Linux`, which also can only be configured directly by editing the file. :-( |
| ------ |
| TODO: Re-create a more flexible build system with a `Makefile` (which is under revision control) and a `local.conf` (which is not, but contains your local-only config settings) |
| ------ |
Edit the build configuration to your needs in `./Makefile.conf`, or create a
`./local.conf` that sets any of the make variables documented in
`./Makefile.conf`.
If a dependency is not found in your system's default include or library
paths, you will have to specify the according paths in a make variable.
Typically, this has to be done at least for the pEp Engine, libetpan and
libevent.
Below are two sample `./local.conf` files, for orientation.
macOS 10.12, 10.13:
~~~~~
PREFIX=$(HOME)/code/json-ad/build
HTML_DIRECTORY=$(PREFIX)/share/pEp/json-adapter/html
GTEST_DIR=$(HOME)/code/gtest/googletest
BOOST_INC=-I$(HOME)/Cellar/boost/1.65.1/include
BOOST_LIB=-L$(HOME)/Cellar/boost/1.65.1/lib
ENGINE_INC=-I$(HOME)/code/engine/build/include
ENGINE_LIB=-L$(HOME)/code/engine/build/lib
ETPAN_INC=-I$(HOME)/code/libetpan/build/include
ETPAN_LIB=-L$(HOME)/code/libetpan/build/lib
GPGME_INC=-I$(HOME)/Cellar/gpgme/1.9.0_1/include
GPGME_LIB=-L$(HOME)/Cellar/gpgme/1.9.0_1/lib
UUID_INC=-I$(HOME)/Cellar/ossp-uuid/1.6.2_2/include
UUID_LIB=-L$(HOME)/Cellar/ossp-uuid/1.6.2_2/lib
~~~~~
Debian 9/10:
~~~~~
PREFIX=$(HOME)/code/json-ad/build
HTML_DIRECTORY=$(PREFIX)/share/pEp/json-adapter/html
GTEST_DIR=/usr/src/googletest/googletest/
ENGINE_INC=-I$(HOME)/code/engine/build/include
ENGINE_LIB=-L$(HOME)/code/engine/build/lib
ETPAN_INC=-I$(HOME)/code/libetpan/build/include
ETPAN_LIB=-L$(HOME)/code/libetpan/build/lib
~~~~~
Make copy of the `local.conf.example` and call it `local.conf`
Adjust the values in `local.conf` to your needs. Most likely, at least the PREFIX option.
Now, build and install the server:
@ -128,10 +85,10 @@ make all
make install
~~~~~
TODO: verify this
If you only want to build the JsonAdapter library, run `make lib` and you'll get
a libjson-adapter.a
With `make test` you can execute the server's tests.

@ -20,7 +20,12 @@
pre.red {white-space:pre; background-color:#d99; }
</style>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="pEp_functions.js"></script>
<!-- positron 2022-09-07: I hardwired this path, which is "wrong" but at least
works with the default settings. I had never been able to see this HTML
interface working!
KLUDGE -->
<script type="text/javascript" src="http://127.0.0.1:4223/pEp_functions.js"></script>
<script type="text/javascript" src="interactive.js"></script>
<script type="text/javascript" src="unittests.js"></script>
<script type="text/javascript" src="test-encode-decode.js"></script>
@ -76,6 +81,29 @@
<button type="button" name="btn_doc" onclick="create_doc()">Create!</button></dd>
</form>
<h2>Ugly kludge</h2>
<p>
Notice that <code>pEp_functions.js</code> is loaded from the same server
providing the JSON API, and is not a file. I hardwired the URI to its default
value in the <code>&lt;script&gt;</code> element above:
<code>"http://127.0.0.1:4223/pEp_functions.js"</code>
In case you want to change, search for <code>KLUDGE</code> in this
<code>index.html</code>
<br/>
(But now this nice interface at least is usable.)
</p>
<p>
To circumvent errors such as
<pre>Access to XMLHttpRequest at 'http://127.0.0.1:4223/ja/0.1/callFunction' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.</pre>
I run a separate instance of my web browser, like this:
<pre>
[luca@moore ~]$ chromium --no-remote --disable-web-security --user-data-dir=$HOME/.config/chromium/Default ~/pep-src/pEpJSONServerAdapter/html/index.html</pre>
</p>
<p>
--positron, 2022-09
</p>
<div id="doc_out" style="background-color:white;border:1px black solid; padding:10px;"></div>
<script type="text/javascript">

File diff suppressed because one or more lines are too long

10909
html/jquery-3.6.1.js vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

1
html/jquery.js vendored

@ -0,0 +1 @@
jquery-3.6.1.js

@ -89,4 +89,37 @@ function handleFileSelect(evt)
}
// stolen from Stackoverflow
// https://stackoverflow.com/questions/9153718/change-the-style-of-an-entire-css-class-using-javascript
function cssrules() {
var rules = {};
for (var i=0; i<document.styleSheets.length; ++i) {
var cssRules = document.styleSheets[i].cssRules;
for (var j=0; j<cssRules.length; ++j)
rules[cssRules[j].selectorText] = cssRules[j];
}
return rules;
}
function css_getclass(name) {
var rules = cssrules();
if (!rules.hasOwnProperty(name))
throw 'TODO: deal_with_notfound_case: name="' + name + '"';
return rules[name];
}
// end of stackoverflow.
function toggle(name)
{
var ts = css_getclass('.' + name);
if(ts.style.display=='none')
{
ts.style.display='table-row';
}else{
ts.style.display='none';
}
}
document.getElementById('files').addEventListener('change', handleFileSelect, false);

@ -8,22 +8,20 @@ endif
# set to 'etpan' or 'pEpMIME'
MIME_LIB?=etpan
PREFIX?=$(HOME)/local
# where pEp stuff is installed into:
# pEp Dependencies
PEP_INC_PATH?=$(PREFIX)/include
PEP_LIB_PATH?=$(PREFIX)/lib
PEP_INCLUDE?=$(PREFIX)/include
# where libs from the packages systems are installed into:
LIBRARY_PATH?=/usr/local/lib
# System Dependencies
SYS_INC_PATH?=/usr/local/include
SYS_LIB_PATH?=/usr/local/lib
CFLAGS+=-std=c14 -fvisibility=hidden
CXXFLAGS+= -I$(PEP_INCLUDE) -std=c++14 -fvisibility=hidden
LDFLAGS+=-std=c++14 -L$(PEP_LIB_PATH) -L$(LIBRARY_PATH)
LDLIBS+= -lpEpEngine -lpEpAdapter -lpEpwebserver -lasn1 \
-lpep_engine_sequoia_backend -lhogweed -lnettle -lgmp \
-lz -lsqlite3
CXXFLAGS+=-I$(SYS_INC_PATH) -I$(PEP_INC_PATH) -std=c++14 -fvisibility=hidden
LDFLAGS+=-std=c++14 -L$(PEP_LIB_PATH) -L$(SYS_LIB_PATH)
LDLIBS+= -lpEpEngine -lpEpAdapter -lpEpwebserver -lhogweed -lnettle -lgmp -lz -lsqlite3 -lpEpCxx11 -lstdc++
# Boost naming postfix
BOOST_MT?=-mt
@ -32,24 +30,14 @@ BOOST_MT?=-mt
BUILD_ON:=$(shell uname)
BUILD_FOR=$(BUILD_ON)
ifeq ($(BUILD_ON),Darwin)
ifeq ($(BUILD_FOR),Darwin)
LDLIBS+= -liconv -lobjc -framework Foundation -framework Security
LDLIBS+= -lboost_filesystem$(BOOST_MT) -lboost_program_options$(BOOST_MT) -lboost_system$(BOOST_MT) -lboost_thread$(BOOST_MT) -lboost_regex$(BOOST_MT)
# ASAN is not strictly a MacOS/clang feature, but won't work with musl.
CXXFLAGS+= -fsanitize=address
LDFLAGS+= -fsanitize=address
else
$(error I do not know how to make for $(BUILD_FOR) on $(BUILD_ON))
endif
else ifeq ($(BUILD_ON),Linux)
ifeq ($(BUILD_FOR),Linux)
LDLIBS+= -luuid \
-lboost_filesystem -lboost_program_options -lboost_system -lboost_thread -lboost_regex -lpthread -ldl
LDLIBS+= -liconv -lobjc -framework Foundation -framework Security
LDLIBS+= -lboost_filesystem$(BOOST_MT) -lboost_program_options$(BOOST_MT) -lboost_system$(BOOST_MT) -lboost_thread$(BOOST_MT) -lboost_regex$(BOOST_MT)
else
$(error I do not know how to make for $(BUILD_FOR) on $(BUILD_ON))
endif
# ASAN is not strictly a MacOS/clang feature, but won't work with musl.
CXXFLAGS+= -fsanitize=address
LDFLAGS+= -fsanitize=address
else ifeq ($(BUILD_ON),Linux)
LDLIBS+= -luuid -lboost_filesystem -lboost_program_options -lboost_system -lboost_thread -lboost_regex -lpthread -ldl
else
$(error I do not know how to make for $(BUILD_FOR) on $(BUILD_ON))
endif
@ -69,7 +57,7 @@ TARGET=pEp-mini-json-adapter
LIB_TARGET=libjson-adapter.a
ifeq ($(MIME_LIB),etpan)
LDLIBS+=-letpan
LDLIBS+=-letpan -lz
OMIT_NFC_SOURCE=
else ifeq ($(MIME_LIB),pEpMIME)
LDLIBS+=-lpEpMIME
@ -98,9 +86,10 @@ SPIRIT_OBJECTS=$(subst .cc,.o,$(SPIRIT_SOURCE))
TEST_SOURCE=$(wildcard unittest_*.cc)
TEST_OBJECTS=$(subst .cc,.o,$(TEST_SOURCE))
.PHONY: all
all: $(TARGET)
.PHONY: all test clean uninstall install
all: $(TARGET)
%.d: %.cc
@set -e; rm -f $@; \
@ -121,10 +110,7 @@ $(LIB_TARGET): $(LIB_OBJECTS)
$(AR) -cr $@ $^
$(TARGET): $(LIB_TARGET) $(MA_OBJECTS) $(SPIRIT_OBJECTS)
$(CXX) $(LDFLAGS) \
$(MA_OBJECTS) $(SPIRIT_OBJECTS) $(LIB_TARGET) \
-o "$@" $(LDLIBS)
$(CXX) $(LDFLAGS) $(MA_OBJECTS) $(SPIRIT_OBJECTS) $(LIB_TARGET) -o "$@" $(LDLIBS)
unittests: $(TEST_OBJECTS) $(LIB_TARGET) $(SPIRIT_OBJECTS)
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS) -lgtest -lgtest_main
@ -132,10 +118,8 @@ unittests: $(TEST_OBJECTS) $(LIB_TARGET) $(SPIRIT_OBJECTS)
parse_mail: parse_mail.o nfc.o $(LIB_TARGET) $(SPIRIT_OBJECTS)
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
.PHONY: test clean uninstall install
test: unittests
./unittests
HOME=.; ./unittests
install: $(TARGET)
mkdir -p $(DESTDIR)$(PREFIX)/include/pEp
@ -150,47 +134,3 @@ uninstall:
clean:
rm -vf *.a *.o */*.o *.d *.d.* $(TARGET) $(TESTS) encode_decode
local.conf:
@echo "# these are installation directories" >> local.conf
@echo "# ----------------------------------" >> local.conf
@echo >> local.conf
@echo "# pEp installation header file directory" >> local.conf
@echo "PEP_INCLUDE=$(PEP_INCLUDE)" >> local.conf
@echo >> local.conf
@echo "# installation destination for make install" >> local.conf
@echo "PREFIX?=$(PREFIX)" >> local.conf
@echo >> local.conf
@echo "# Additional options" >> local.conf
@echo "# ------------------" >> local.conf
@echo >> local.conf
@echo "# for a dynamically linked binary (for development) remove this." >> local.conf
@echo "# also add -L<path> here if .a or .so files from non-standard paths are needed." >> local.conf
@echo "# If you are using clang, it's \"-static\", but that will fail if you did not compile a static version of libcrt0 and libc[++] yourself." >> local.conf
@echo "LDFLAGS+=--static" >> local.conf
@echo >> local.conf
@echo "# Building BOOST yourself, the artefact names are not postfixed by deafult" >> local.conf
@echo "# E.g. lib is named \"libboost_regex.a\", not \"libboost_regex-mt.a\"." >> local.conf
@echo "# Set to empty string if this is the case for you." >> local.conf
@echo "BOOST_MT=\"-mt\"" >> local.conf
@echo >> local.conf
@echo "# Path where pEp libraries are installed." >> local.conf
@echo "PEP_LIB_PATH=$(PEP_LIB_PATH)" >> local.conf
@echo >> local.conf
@echo "# Path where system libraries are installed." >> local.conf
@echo "LIBRARY_PATH=$(LIBRARY_PATH)" >> local.conf
@echo >> local.conf
@echo "# remove this for a debug build." >> local.conf
@echo "NDEBUG=yes" >> local.conf
help:
@echo "usage:"
@echo " make local.conf # optional"
@echo " generate a local.conf with default paths"
@echo
@echo " make libjson-adapter.a"
@echo " build adapter library"
@echo
@echo " make pEp-mini-json-adapter # default"
@echo " compile and link mini adapter"
@echo

@ -20,8 +20,9 @@
// libpEpAdapter:
#include <pEp/Adapter.hh>
#include <pEp/status_to_string.hh>
#include <pEp/slurp.hh>
#include <pEp/std_utils.hh>
#include <pEp/message_cache.hh>
#include <pEp/group_manager_api.h> // Yes, .h because it is a C API in libpEpAdapter!
#include <boost/filesystem.hpp>
#include "json_spirit/json_spirit_reader.h"
@ -184,7 +185,7 @@ const FunctionMap functions = {
FP( "revoke" , new FuncPC<PEP_STATUS, In_Pep_Session, In<c_string>, In<c_string>> ( &revoke_key) ),
FP( "key_expired" , new FuncPC<PEP_STATUS, In_Pep_Session, In<c_string>, In<time_t>, Out<bool>> ( &key_expired) ),
FP( "from blacklist.h & OpenPGP_compat.h", new Separator),
FP( "from openpgp_compat.h", new Separator),
FP( "OpenPGP_list_keyinfo", new FuncPC<PEP_STATUS, In_Pep_Session, In<c_string>, Out<stringpair_list_t*>> ( &OpenPGP_list_keyinfo) ),
FP( "Event Listener & Results", new Separator ),
@ -201,13 +202,23 @@ const FunctionMap functions = {
FP( "enable_identity_for_sync" , new FuncPC<PEP_STATUS, In_Pep_Session, InOut<pEp_identity*>> (&enable_identity_for_sync)),
FP( "disable_identity_for_sync", new FuncPC<PEP_STATUS, In_Pep_Session, InOut<pEp_identity*>> (&disable_identity_for_sync)),
FP( "disable_all_sync_channels", new Func<PEP_STATUS, In_Pep_Session> (&disable_all_sync_channels)),
FP( "Group Manager API", new Separator),
FP( "adapter_group_create" , new Func<PEP_STATUS, In_Pep_Session, InOut<pEp_identity*>, InOut<pEp_identity*>, InOut<identity_list*>> (&adapter_group_create)),
FP( "adapter_group_dissolve" , new Func<PEP_STATUS, In_Pep_Session, In<pEp_identity*>, In<pEp_identity*>> (&adapter_group_dissolve)),
FP( "adapter_group_invite_member", new Func<PEP_STATUS, In_Pep_Session, In<pEp_identity*>, In<pEp_identity*>> (&adapter_group_invite_member)),
FP( "adapter_group_remove_member", new Func<PEP_STATUS, In_Pep_Session, In<pEp_identity*>, In<pEp_identity*>> (&adapter_group_remove_member)),
FP( "adapter_group_join" , new Func<PEP_STATUS, In_Pep_Session, In<pEp_identity*>, In<pEp_identity*>> (&adapter_group_join)),
FP( "adapter_group_query_groups" , new Func<PEP_STATUS, In_Pep_Session, Out<identity_list*>> (&adapter_group_query_groups)),
FP( "adapter_group_query_manager", new Func<PEP_STATUS, In_Pep_Session, In<const pEp_identity*>, Out<pEp_identity*>> (&adapter_group_query_manager)),
FP( "adapter_group_query_members", new Func<PEP_STATUS, In_Pep_Session, In<const pEp_identity*>, Out<identity_list*>> (&adapter_group_query_members)),
#ifndef JSON_ADAPTER_LIBRARY
FP( "startSync", new Func<void> (&pEp::mini::startSync) ),
FP( "stopSync" , new Func<void> (&pEp::mini::stopSync) ),
#else
FP( "startSync", new Func<void> (&pEp::CallbackDispatcher::start_sync) ),
FP( "stopSync" , new Func<void> (&pEp::CallbackDispatcher::stop_sync) ),
FP( "startSync", new Func<void> (&pEp::Adapter::start_sync) ),
FP( "stopSync" , new Func<void> (&pEp::Adapter::stop_sync) ),
#endif
// my own example function that does something useful. :-)
FP( "Other", new Separator ),
@ -258,7 +269,7 @@ pEp::Webserver::response ev_server::sendReplyString(const pEp::Webserver::reques
pEp::Webserver::response ev_server::sendFile(const pEp::Webserver::request& req, const char* mimeType, const fs::path& fileName)
{
// not the best for big files, but this server does not send big files. :-)
std::string fileContent = pEp::slurp(fileName.string());
std::string fileContent = pEp::Utils::file_read(fileName.string());
return sendReplyString(req, mimeType, std::move(fileContent));
}
@ -280,9 +291,9 @@ pEp::Webserver::response ev_server::OnOtherRequest(boost::cmatch match, const pE
{ "/favicon.ico" , {"image/vnd.microsoft.icon", path_to_html / "json-test.ico"} },
};
const std::string path = req.target().to_string(); // NB: is percent-encoded! does not relevant for the supported paths above.
const std::string path = std::string(req.target()); // NB: is percent-encoded! does not relevant for the supported paths above.
DEBUG_LOG( Log() ) << "** Request: [" << req.method_string().to_string() << "] " << "Path: [" + path + "]";
DEBUG_LOG( Log() ) << "** Request: [" << std::string(req.method_string()) << "] " << "Path: [" + path + "]";
try{
const auto q = files.find(path);
@ -407,7 +418,7 @@ void ev_server::addSharks()
void ev_server::thread_init()
{
// nothing to do, yet.
pEp::Adapter::session.initialize();
}

@ -1,21 +1,41 @@
# This is an Example build config file (local.conf)
# you might not need this file, but if the defaults dont work for you
# You can override them here.
# Tweak the values to your needs and rename it to local.conf
# The example values reflect the defaults.
# Rename this file to local.conf and tweak the values to your needs,
# if you need to override anything. (Most likely PREFIX)
######### C++ Compiler #########
# Should work with clang and g++
# CXX=g++
# Toolchain
# ---------
# Should work with `g++` and `clang`
# CXX=
# You might use /usr/bin/ar on MacOS explicitly if you have GNU ar installed via HomeBrew,
# because it is installed in /usr/local/bin and therefore used by default.
# AR=ar
# DIRS
# ----
# PREFIX=$(HOME)/local
# pEp Dependencies
# PEP_INC_PATH=$(PREFIX)/include
# PEP_LIB_PATH=$(PREFIX)/lib
# System Dependencies
# SYS_INC_PATH=/usr/local/include
# SYS_LIB_PATH=/usr/local/lib
# Additional Options
# ------------------
# DEBUG=1 # DEBUG Build (Default)
# DEBUG=0 # RELEASE Build
############# DIRS #############
# PREFIX=$(HOME)/local
# Static/Dynamic Linkage
# for a dynamically linked binary (for development) leave this empty.
# If you are using clang, use "-static", but that will fail if you did not compile a static
# version of libcrt0 and libc[++] yourself.
# LDFLAGS+=
# where the other pEp-specific includes (e.g. pEpEngine, libpEpAdapter) are installed
# PEP_INCLUDE=$(PREFIX)/include
# Building BOOST yourself, the artefact names are not postfixed by default
# E.g. lib is named "libboost_regex.a", not "libboost_regex-mt.a".
# Set to empty string if this is the case for you.
# BOOST_MT="-mt"

@ -20,7 +20,7 @@ namespace mini {
protected:
virtual inject_sync_event_t getInjectSyncEvent() const override
{
return &::pEp::Adapter::_inject_sync_event;
return &::pEp::Adapter::_cb_inject_sync_event_enqueue_sync_event;
}
};

@ -127,22 +127,10 @@ try
if( debug_mode == false && !foreground )
daemonize (!debug_mode, (const uintptr_t) status_handle);
pEp::callback_dispatcher.add(JsonAdapter::messageToSend, JsonAdapter::notifyHandshake);
// create a dummy session just to see whether the Engine is functional.
// reason: here we still can log errors to stderr, because prepare_run() is called before daemonize().
PEP_STATUS status = pEp::call_with_lock(&init, &first_session, pEp::CallbackDispatcher::messageToSend, pEp::Adapter::_inject_sync_event, pEp::Adapter::_ensure_passphrase);
if(status != PEP_STATUS_OK || first_session==nullptr)
{
const std::string error_msg = "Cannot create first session! PEP_STATUS: " + ::pEp::status_to_string(status) + ".";
std::cerr << error_msg << std::endl; // Log to stderr intentionally, so Enigmail can grab that error message easily.
if( ! ignore_missing_session)
{
throw std::runtime_error(error_msg);
}
}
pEp::Adapter::session.initialize();
pEp::callback_dispatcher.add(JsonAdapter::messageToSend, JsonAdapter::notifyHandshake);
JsonAdapter& ja = pEp::mini::Adapter::createInstance();
ja.ignore_session_errors( ignore_missing_session)
.deliver_html( !no_html )
@ -177,8 +165,8 @@ try
}
ja.shutdown(nullptr);
ja.Log() << "Good bye. :-)";
pEp::call_with_lock(&release, first_session);
pEp::callback_dispatcher.remove(JsonAdapter::messageToSend);
pEp::Adapter::session.release();
pEp::callback_dispatcher.remove(JsonAdapter::messageToSend);
}
catch(std::exception const& e)
{

@ -416,6 +416,23 @@ const std::map<unsigned, unsigned char> NFC_CombiningClass = {
{0x0859, 220},
{0x085A, 220},
{0x085B, 220},
{0x0898, 230},
{0x0899, 220},
{0x089A, 220},
{0x089B, 220},
{0x089C, 230},
{0x089D, 230},
{0x089E, 230},
{0x089F, 230},
{0x08CA, 230},
{0x08CB, 230},
{0x08CC, 230},
{0x08CD, 230},
{0x08CE, 230},
{0x08CF, 220},
{0x08D0, 220},
{0x08D1, 220},
{0x08D2, 220},
{0x08D3, 220},
{0x08D4, 230},
{0x08D5, 230},
@ -476,6 +493,7 @@ const std::map<unsigned, unsigned char> NFC_CombiningClass = {
{0x0B3C, 7},
{0x0B4D, 9},
{0x0BCD, 9},
{0x0C3C, 7},
{0x0C4D, 9},
{0x0C55, 84},
{0x0C56, 91},
@ -526,6 +544,7 @@ const std::map<unsigned, unsigned char> NFC_CombiningClass = {
{0x135E, 230},
{0x135F, 230},
{0x1714, 9},
{0x1715, 9},
{0x1734, 9},
{0x17D2, 9},
{0x17DD, 230},
@ -561,6 +580,20 @@ const std::map<unsigned, unsigned char> NFC_CombiningClass = {
{0x1ABD, 220},
{0x1ABF, 220},
{0x1AC0, 220},
{0x1AC1, 230},
{0x1AC2, 230},
{0x1AC3, 220},
{0x1AC4, 220},
{0x1AC5, 230},
{0x1AC6, 230},
{0x1AC7, 230},
{0x1AC8, 230},
{0x1AC9, 230},
{0x1ACA, 220},
{0x1ACB, 230},
{0x1ACC, 230},
{0x1ACD, 230},
{0x1ACE, 230},
{0x1B34, 7},
{0x1B44, 9},
{0x1B6B, 230},
@ -663,6 +696,7 @@ const std::map<unsigned, unsigned char> NFC_CombiningClass = {
{0x1DF7, 228},
{0x1DF8, 228},
{0x1DF9, 220},
{0x1DFA, 218},
{0x1DFB, 230},
{0x1DFC, 233},
{0x1DFD, 220},
@ -840,7 +874,12 @@ const std::map<unsigned, unsigned char> NFC_CombiningClass = {
{0x10F4E, 220},
{0x10F4F, 220},
{0x10F50, 220},
{0x10F82, 230},
{0x10F83, 220},
{0x10F84, 230},
{0x10F85, 220},
{0x11046, 9},
{0x11070, 9},
{0x1107F, 9},
{0x110B9, 9},
{0x110BA, 7},
@ -989,6 +1028,7 @@ const std::map<unsigned, unsigned char> NFC_CombiningClass = {
{0x1E134, 230},
{0x1E135, 230},
{0x1E136, 230},
{0x1E2AE, 230},
{0x1E2EC, 230},
{0x1E2ED, 230},
{0x1E2EE, 230},

@ -102,6 +102,12 @@ Out<identity_list*>::~Out()
value=nullptr;
}
template<>
In<identity_list*>::~In()
{
free_identity_list(value);
}
template<>
In<const identity_list*>::~In()
{

@ -2,7 +2,7 @@
#include <pEp/mime.h>
#include <pEp/status_to_string.hh>
#include <pEp/slurp.hh>
#include <pEp/std_utils.hh>
#include "pEp-types.hh"
#include <string>
#include <iostream>

@ -8,7 +8,7 @@
#include <boost/algorithm/string/trim.hpp>
#include "json_spirit/json_spirit_reader.h"
#include <pEp/slurp.hh>
#include <pEp/std_utils.hh>
namespace js = json_spirit;
@ -81,8 +81,14 @@ static const std::string VersionName =
// "(47a) Erfurt-Ost"; // JSON-160, JSON-172, JSON-179.
// "(47b) Erfurt-Vieselbach"; // JSON-183: "Provide an API for pEp4Tb to communicate whether the message subject should be hidden (replaced with pEp)"
// "(48) Nohra"; // FPMAIL-412, P4TB-400: add import_key_with_fpr_return()
"(49) Weimar"; // (forthcoming) P4TB-414: new decrypt_message arg, new message field rating
// "(49) Weimar"; // (forthcoming) P4TB-414: new decrypt_message arg, new message field rating
//////////////////////
// 49...55 are skipped for futher Releases of the 2.1 branch, if necessary.
//////////////////////
"(56a) Hermsdorfer Kreuz"; // JSON-197: Group Encryption, Engine 3.1 branch.
} // end of anonymous namespace
////////////////////////////////////////////////////////////////////////////
@ -131,7 +137,10 @@ const ServerVersion& server_version()
// version using a specific series (2.x or 3.x) while both series evolve in
// parallel, even in incompatible ways.
static const ServerVersion sv(3,22,4); // (forthcoming) P4TB-414: new decrypt_message arg, new message field rating
//static const ServerVersion sv(3,1,0); // JSON-197: Group Encryption. 3.1 branch of Engine & JSON Adapter
//static const ServerVersion sv(3,22,4); // (forthcoming) P4TB-414: new decrypt_message arg, new message field rating
static const ServerVersion sv(3,22,5); // cherry-picking JSON changes from Release_3.1 before retiring the branch
return sv;
}
@ -150,7 +159,7 @@ ServerVersion::ServerVersion(unsigned maj, unsigned min, unsigned p)
const std::string file_content =
boost::algorithm::trim_copy(
pEp::slurp("PackageVersion")
pEp::Utils::file_read("PackageVersion")
);
try{

Loading…
Cancel
Save