merge Release_2.1

MACOSINST-33
Andreas Buff 2 years ago
commit 008a06368c

6
.gitignore vendored

@ -88,6 +88,12 @@ test/EngineTests
test/googletest
test/tmp/*
src/commit_hash.h
.idea/
venv/
venv2/
cleangit.py
# Xcode related ignores
build/
DerivedData/

@ -0,0 +1,22 @@
.ensure_docker: &ensure_docker
# Check for docker and install if missing
- 'which docker || ( sudo apt-get update -y && sudo apt-get install docker.io -y )'
.ensure_rsync: &ensure_rsync
# Install rsync and deps if missing
- 'which ssh-agent || ( sudo apt-get update -y && sudo apt-get install openssh-client -y )'
- 'which rsync || ( sudo apt-get update -y && sudo apt-get install rsync -y )'
- 'which make || ( sudo apt-get update -y && sudo apt-get install make -y )'
.standard_job:
tags: [kvm]
before_script:
- *ensure_docker
- *ensure_rsync
.make_in_docker:
extends: .standard_job
script:
- docker login -u ${DOCKER_REGISTRY_USER} -p ${DOCKER_REGISTRY_PASS} ${DOCKER_REGISTRY_HOST}
- cd scripts/${CI_DISTRO_TARGET}
- make

@ -0,0 +1,27 @@
include:
- '.gitlab-ci-files/common-prepare.yml'
stages:
- build
# Debian
debian10:build:
extends: .make_in_docker
stage: build
variables:
CI_DISTRO_TARGET: "debian10"
DEBIAN_FRONTEND: "noninteractive"
rules:
- if: '$CI_COMMIT_TAG !~ /^Release_[0-9]+\.[0-9]+\.[0-9]+$/'
debian10:tagged-build:
extends: .make_in_docker
stage: build
variables:
CI_DISTRO_TARGET: "debian10"
DEBIAN_FRONTEND: "noninteractive"
TAGGED_BUILD: "true"
rules:
- if: '$CI_COMMIT_TAG =~ /^Release_[0-9]+\.[0-9]+\.[0-9]+$/'

@ -0,0 +1,4 @@
# 1st Party Dependencies
## Prefer git tags instead of SHA hashes when possible.
sequoia=365d00a08bec6a5a48d48a7c7893d78c27092b59

@ -125,6 +125,7 @@
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\src\aux_mime_msg.c" />
<ClCompile Include="..\src\base64.c" />
<ClCompile Include="..\src\baseprotocol.c" />
<ClCompile Include="..\src\blacklist.c" />
@ -151,6 +152,7 @@
<ClCompile Include="..\src\pgp_sequoia.c" />
<ClCompile Include="..\src\platform_windows.cpp" />
<ClCompile Include="..\src\resource_id.c" />
<ClCompile Include="..\src\security_checks.c" />
<ClCompile Include="..\src\sqlite3.c" />
<ClCompile Include="..\src\stringlist.c" />
<ClCompile Include="..\src\stringpair.c" />
@ -166,11 +168,14 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\asn1_helper.h" />
<ClInclude Include="..\src\aux_mime_msg.h" />
<ClInclude Include="..\src\base64.h" />
<ClInclude Include="..\src\baseprotocol.h" />
<ClInclude Include="..\src\blacklist.h" />
<ClInclude Include="..\src\bloblist.h" />
<ClInclude Include="..\src\commit_hash.h" />
<ClInclude Include="..\src\cryptotech.h" />
<ClInclude Include="..\src\distribution_codec.h" />
<ClInclude Include="..\src\dynamic_api.h" />
<ClInclude Include="..\src\email.h" />
<ClInclude Include="..\src\etpan_mime.h" />
@ -179,6 +184,7 @@
<ClInclude Include="..\src\identity_list.h" />
<ClInclude Include="..\src\internal_format.h" />
<ClInclude Include="..\src\keymanagement.h" />
<ClInclude Include="..\src\keyreset_command.h" />
<ClInclude Include="..\src\KeySync_fsm.h" />
<ClInclude Include="..\src\key_reset.h" />
<ClInclude Include="..\src\labeled_int_list.h" />
@ -196,7 +202,9 @@
<ClInclude Include="..\src\platform_windows.h" />
<ClInclude Include="..\src\resource.h" />
<ClInclude Include="..\src\resource_id.h" />
<ClInclude Include="..\src\security_checks.h" />
<ClInclude Include="..\src\sqlite3.h" />
<ClInclude Include="..\src\status_to_string.h" />
<ClInclude Include="..\src\stringlist.h" />
<ClInclude Include="..\src\stringpair.h" />
<ClInclude Include="..\src\sync_api.h" />

@ -129,6 +129,12 @@
<ClCompile Include="..\src\internal_format.c">
<Filter>Quelldateien</Filter>
</ClCompile>
<ClCompile Include="..\src\aux_mime_msg.c">
<Filter>Quelldateien</Filter>
</ClCompile>
<ClCompile Include="..\src\security_checks.c">
<Filter>Quelldateien</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\keymanagement.h">
@ -272,13 +278,29 @@
<ClInclude Include="..\src\internal_format.h">
<Filter>Headerdateien</Filter>
</ClInclude>
<ClInclude Include="..\src\commit_hash.h">
<Filter>Headerdateien</Filter>
</ClInclude>
<ClInclude Include="..\src\aux_mime_msg.h">
<Filter>Headerdateien</Filter>
</ClInclude>
<ClInclude Include="..\src\distribution_codec.h">
<Filter>Headerdateien</Filter>
</ClInclude>
<ClInclude Include="..\src\keyreset_command.h">
<Filter>Headerdateien</Filter>
</ClInclude>
<ClInclude Include="..\src\security_checks.h">
<Filter>Headerdateien</Filter>
</ClInclude>
<ClInclude Include="..\src\status_to_string.h">
<Filter>Headerdateien</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Text Include="..\LICENSE.txt" />
</ItemGroup>
<ItemGroup>
<None Include="generate_code.cmd">
<Filter>Quelldateien</Filter>
</None>
<None Include="generate_code.cmd" />
</ItemGroup>
</Project>

@ -0,0 +1,27 @@
include ../../DEPENDENCIES
export
PEP_MACHINE_DIR= $(PKG_INSTALL_PATH)/share/pEp
SEQUOIA_VERSION=${sequoia}
CURRENT_DISTRO=$(shell basename $(shell pwd))
IMAGE_NAME=${DOCKER_REGISTRY_HOST}/pep-$(CURRENT_DISTRO)-engine
DOCKERFILE=pEpEngine.$(CURRENT_DISTRO).Dockerfile
IS_TAGGED=${TAGGED_BUILD}
ifeq ($(IS_TAGGED), true)
# $CI_COMMIT_TAG is a predefined environment variable from Gitlab
PEPENGINE_VERSION=${CI_COMMIT_TAG}
else
PEPENGINE_VERSION=$(shell git rev-parse --short=8 HEAD)
endif
all:
-docker pull $(IMAGE_NAME):latest
cd ../../ && docker build --build-arg CURRENT_DISTRO=$(CURRENT_DISTRO) \
--build-arg DOCKER_REGISTRY_HOST=${DOCKER_REGISTRY_HOST} \
--build-arg PEPENGINE_VERSION=$(PEPENGINE_VERSION) \
--build-arg SEQUOIA_VERSION=$(SEQUOIA_VERSION) \
--build-arg PEP_MACHINE_DIR=$(PEP_MACHINE_DIR) \
--cache-from $(IMAGE_NAME):latest \
--tag=$(IMAGE_NAME):$(PEPENGINE_VERSION) \
--tag=$(IMAGE_NAME):latest \
-f scripts/${CURRENT_DISTRO}/$(DOCKERFILE) .
docker push $(IMAGE_NAME):$(PEPENGINE_VERSION)
docker push $(IMAGE_NAME):latest

@ -0,0 +1,25 @@
#!/usr/bin/env sh
set -exo
export LC_ALL=en_US.UTF-8
cat >local.conf <<__LOCAL__
PREFIX=${INSTPREFIX}
SQLITE3_FROM_OS=""
PER_MACHINE_DIRECTORY=${PEP_MACHINE_DIR}
YML2_PATH=${INSTPREFIX}/yml2
YML2_PROC=${INSTPREFIX}/yml2/yml2proc
ETPAN_LIB=-L${INSTPREFIX}/libetpan/lib
ETPAN_INC=-I${INSTPREFIX}/libetpan/include
ASN1C=${INSTPREFIX}/asn1c/bin/asn1c
ASN1C_INC=-I${INSTPREFIX}/asn1c/share/asn1c
OPENPGP=SEQUOIA
SEQUOIA_LIB=-L${INSTPREFIX}/lib
SEQUOIA_INC=-I${INSTPREFIX}/include
LDFLAGS += -L${INSTPREFIX}/lib -L${INSTPREFIX}/libetpan/lib -L${INSTPREFIX}/pep/lib -nostartfiles
__LOCAL__
cat local.conf
export PKG_CONFIG_PATH=$INSTPREFIX/share/pkgconfig/
make all && make db && make install

@ -0,0 +1,31 @@
#!/usr/bin/env sh
set -exo
### YML2
cd $INSTPREFIX
wget https://fdik.org/yml2.tar.bz2
tar -xf yml2.tar.bz2
rm yml2.tar.bz2
### libetpan
git clone https://github.com/fdik/libetpan $BUILDROOT/libetpan
cd $BUILDROOT/libetpan
test -f configure || NOCONFIGURE=absolutely ./autogen.sh
./configure --prefix=${INSTPREFIX}/libetpan \
--without-openssl --without-gnutls --without-sasl \
--without-curl --without-expat --without-zlib \
--disable-dependency-tracking
make -j$(nproc)
make install
echo "${libetpan_ver}">${INSTPREFIX}/libetpan.ver
### ASN1c
git clone https://github.com/vlm/asn1c.git $BUILDROOT/asn1c
cd $BUILDROOT/asn1c
git checkout tags/v0.9.28 -b pep-engine
test -f configure || autoreconf -iv
./configure --prefix=${INSTPREFIX}/asn1c
make -j$(nproc) && make install
echo "${asn1c_ver}">${INSTPREFIX}/asn1c.ver

@ -0,0 +1,9 @@
#!/usr/bin/env sh
set -exo
# Install systemdb (need to be root depending on the path)
cd $BUILDROOT/pEpEngine
export LC_ALL=en_US.UTF-8
export PKG_CONFIG_PATH=$INSTPREFIX/share/pkgconfig/
echo "Setup DB"
make -C db install

@ -0,0 +1,38 @@
ARG DOCKER_REGISTRY_HOST
ARG CURRENT_DISTRO
ARG PEPENGINE_VERSION
FROM ${DOCKER_REGISTRY_HOST}/pep-${CURRENT_DISTRO}-sequoia:latest
ENV BUILDROOT /build
ENV INSTPREFIX /install
ENV OUTDIR /out
ARG PEP_MACHINE_DIR
### Setup working directory
RUN mkdir ${BUILDROOT}/pEpEngine
COPY . ${BUILDROOT}/pEpEngine
USER root
RUN chown -R pep-builder:pep-builder ${BUILDROOT}/pEpEngine
WORKDIR ${BUILDROOT}/pEpEngine
ARG ENGINE_VERSION
ARG CURRENT_DISTRO
RUN apt-get update && apt-get install -y wget bzip2 && \
rm -rf /var/lib/apt/lists/*
### Build pEpEngine dependencies
USER pep-builder
RUN sh ./scripts/${CURRENT_DISTRO}/build_pEpEngine_deps.sh
### Build pEpEngine
RUN sh ./scripts/${CURRENT_DISTRO}/build_pEpEngine.sh
### Install Systemdb
USER root
RUN sh ./scripts/${CURRENT_DISTRO}/install_pEpEngine_systemdb.sh && \
rm -rf ${BUILDROOT}/*

@ -0,0 +1,6 @@
#! /bin/sh
# Commit hash header file - if we don't run this, it won't build.
commit_hash="$(git rev-parse HEAD)"
sed "s/\(PEP_CURRENT_COMMIT_HASH\ =\).*/\1\"$commit_hash\"/" templates/commit_hash.h > src/commit_hash.h

@ -0,0 +1,6 @@
#! /bin/sh
# Commit hash header file - if we don't run this, it won't build.
commit_hash="$(git rev-parse HEAD)"
sed "s/\(PEP_CURRENT_COMMIT_HASH\ =\).*/\1\"$commit_hash\"/" templates/commit_hash.h > src/commit_hash.h

@ -0,0 +1,6 @@
#! /bin/sh
# Commit hash header file - if we don't run this, it won't build.
commit_hash="$(git rev-parse HEAD)"
sed "s/\(PEP_CURRENT_COMMIT_HASH\ =\).*/\1\"$commit_hash\"/" templates/commit_hash.h > src/commit_hash.h

@ -0,0 +1,3 @@
#! /bin/sh
rm src/commit_hash.h

@ -43,6 +43,10 @@ else
$(error I do not know how to make for $(BUILD_FOR) on $(BUILD_ON))
endif
ifeq (,$(wildcard commit_hash.h))
$(shell cp ../templates/commit_hash.h ./commit_hash.h)
endif
ifdef SQLITE3_FROM_OS
NO_SOURCE+= sqlite3.c
CFLAGS+= -DSQLITE3_FROM_OS

@ -974,7 +974,7 @@ static message* wrap_message_as_attachment(message* envelope,
else {
_envelope->longmsg = strdup(
"This message was encrypted with p≡p (https://pep.software). If you are seeing this message,\n"
"your client does not support raising message attachments. Please click on the message attachment to\n"
"your client does not support raising message attachments. Please click on the message attachment\n"
"to view it, or better yet, consider using p≡p!\n"
);
}

@ -22,10 +22,10 @@ extern "C" {
// RELEASE version this targets
// (string: major.minor.patch)
#define PEP_ENGINE_VERSION "2.1.14"
#define PEP_ENGINE_VERSION "2.1.15"
#define PEP_ENGINE_VERSION_MAJOR 2
#define PEP_ENGINE_VERSION_MINOR 1
#define PEP_ENGINE_VERSION_PATCH 14
#define PEP_ENGINE_VERSION_PATCH 15
#define PEP_ENGINE_VERSION_RC 0

@ -7,6 +7,21 @@
#ifndef PEP_INTERNAL_H
#define PEP_INTERNAL_H
#if defined __has_include
# if __has_include ("commit_hash.h")
# include "commit_hash.h"
# else
# define PEP_CURRENT_COMMIT_HASH="DUMMY_COMMIT_HASH_ERROR"
# endif
#else
// Well, we tried. Better hope the git setup is correct.
// IF NOT, or you aren't using git, please copy the commit_hash.h file from
// templates/ into src/ if this include fails.
# include "commit_hash.h"
#endif
#include "commit_hash.h" // We need this everywhere. So.
// maximum attachment size to import as key 25MB, maximum of 20 attachments
#define MAX_KEY_SIZE (25 * 1024 * 1024)
#define MAX_KEYS_TO_IMPORT 20

@ -0,0 +1,7 @@
#ifndef COMMIT_HASH_H
#define COMMIT_HASH_H
#define PEP_CURRENT_COMMIT_HASH = "DUMMY_COMMIT_HASH_ERROR"
#endif
Loading…
Cancel
Save