Compare commits
17 commits
Author | SHA1 | Date | |
---|---|---|---|
Morgan McMillian | 7d6f6f232c | ||
Morgan McMillian | cb1aa162ce | ||
3eaf32d215 | |||
51b7dea71b | |||
a36c12ad5c | |||
e428dd9776 | |||
4d465d09da | |||
92f3105ac8 | |||
d41345adaa | |||
e25e526ec1 | |||
3aa5494e7d | |||
be7e59e0fe | |||
a602478ccb | |||
e253f575be | |||
b0c720d079 | |||
808fefb4be | |||
fe755f4c05 |
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,3 +1,5 @@
|
|||
build/
|
||||
pantalaimon-arm64
|
||||
pantalaimon-armhf
|
||||
panctl-arm64
|
||||
panctl-armhf
|
||||
|
|
|
@ -94,7 +94,7 @@ Page {
|
|||
Label {
|
||||
width: parent.width
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: i18n.tr("Pantalaimon v0.9.1")
|
||||
text: i18n.tr("Pantalaimon v0.10.3")
|
||||
wrapMode: Text.WordWrap
|
||||
fontSize: "large"
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ execute_process(
|
|||
set(QT_IMPORTS_DIR "lib/${ARCH_TRIPLET}")
|
||||
|
||||
set(APP_NAME "Pantalaimon UT")
|
||||
set(APP_VERSION "0.5.0")
|
||||
set(APP_VERSION "0.6.0")
|
||||
set(PROJECT_NAME "pantalaimon")
|
||||
set(FULL_PROJECT_NAME "pantalaimon.thrrgilag")
|
||||
set(CMAKE_INSTALL_PREFIX /)
|
||||
|
@ -41,7 +41,7 @@ endif()
|
|||
|
||||
configure_file(manifest.json.in ${CMAKE_CURRENT_BINARY_DIR}/manifest.json)
|
||||
configure_file(AboutPage.qml.in ${CMAKE_CURRENT_BINARY_DIR}/AboutPage.qml)
|
||||
configure_file(pantalaimon.sh.in ${CMAKE_CURRENT_BINARY_DIR}/pantalaimon.sh)
|
||||
# NOTE: cross-build: configure_file(pantalaimon.sh.in ${CMAKE_CURRENT_BINARY_DIR}/pantalaimon.sh)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
install(FILES ${PROJECT_NAME}.apparmor DESTINATION ${DATA_DIR})
|
||||
install(DIRECTORY assets DESTINATION ${DATA_DIR})
|
||||
|
@ -49,13 +49,14 @@ install(DIRECTORY src DESTINATION ${DATA_DIR})
|
|||
|
||||
install(DIRECTORY qml DESTINATION ${DATA_DIR})
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/AboutPage.qml DESTINATION ${DATA_DIR}qml/)
|
||||
# TODO: example config file for local testing
|
||||
# NOTE: example config file for local testing
|
||||
# install(FILES example.conf DESTINATION ${CMAKE_INSTALL_PREFIX} RENAME pantalaimon.conf)
|
||||
|
||||
file(GLOB_RECURSE OLM_SO_FILES "$ENV{OLM_LIB_INSTALL_DIR}/lib/libolm.so*")
|
||||
install(FILES ${OLM_SO_FILES} DESTINATION ${QT_IMPORTS_DIR})
|
||||
install(PROGRAMS build/${ARCH_TRIPLET}/pantalaimon/dist/pantalaimon DESTINATION ${CMAKE_INSTALL_PREFIX} RENAME pantalaimonexec)
|
||||
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/pantalaimon.sh DESTINATION ${CMAKE_INSTALL_PREFIX} RENAME pantalaimon)
|
||||
# NOTE: cross-build: thesse are used for the cross compiled package
|
||||
# file(GLOB_RECURSE OLM_SO_FILES "$ENV{OLM_LIB_INSTALL_DIR}/lib/libolm.so*")
|
||||
# install(FILES ${OLM_SO_FILES} DESTINATION ${QT_IMPORTS_DIR})
|
||||
# install(PROGRAMS build/${ARCH_TRIPLET}/pantalaimon/dist/pantalaimon DESTINATION ${CMAKE_INSTALL_PREFIX} RENAME pantalaimonexec)
|
||||
# install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/pantalaimon.sh DESTINATION ${CMAKE_INSTALL_PREFIX} RENAME pantalaimon)
|
||||
|
||||
# Translations
|
||||
file(GLOB_RECURSE I18N_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/po qml/*.qml qml/*.js)
|
||||
|
@ -78,6 +79,11 @@ add_custom_target(${DESKTOP_FILE_NAME} ALL
|
|||
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE_NAME} DESTINATION ${DATA_DIR})
|
||||
|
||||
# NOTE: dev-build: these are used for the dev-build package
|
||||
install(PROGRAMS pantalaimon-${CLICK_ARCH} DESTINATION ${CMAKE_INSTALL_PREFIX} RENAME pantalaimon)
|
||||
install(PROGRAMS panctl-${CLICK_ARCH} DESTINATION ${CMAKE_INSTALL_PREFIX} RENAME panctl)
|
||||
# TODO: not needed? install(PROGRAMS build/${ARCH_TRIPLET}/pantalaimon/dist/pantalaimon DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
|
||||
add_subdirectory(po)
|
||||
|
||||
# Make source files visible in qtcreator
|
||||
|
|
54
README.md
54
README.md
|
@ -1,11 +1,12 @@
|
|||
# Pantalaimon UT
|
||||
|
||||
*This project is no longer in active development.*
|
||||
|
||||
End-to-end encryption aware Matrix reverse proxy daemon for Ubuntu Touch.
|
||||
|
||||
[source code](https://git.sr.ht/~thrrgilag/pantalaimon-ut) -
|
||||
[issue tracker](https://todo.sr.ht/~thrrgilag/pantalaimon-ut) -
|
||||
[mailing list](https://lists.sr.ht/~thrrgilag/pantalaimon-ut) -
|
||||
[releases](https://git.sr.ht/~thrrgilag/pantalaimon-ut/refs)
|
||||
[source code](https://git.dreamfall.space/thrrgilag/pantalaimon-ut) -
|
||||
[issue tracker](https://git.dreamfall.space/thrrgilag/pantalaimon-ut/issues) -
|
||||
[releases](https://git.dreamfall.space/thrrgilag/pantalaimon-ut/releases)
|
||||
|
||||
## TODO
|
||||
|
||||
|
@ -13,42 +14,35 @@ End-to-end encryption aware Matrix reverse proxy daemon for Ubuntu Touch.
|
|||
- [x] App icon
|
||||
- [x] Fix image fetching (fixed in fluffychat)
|
||||
- [x] Cross compile python+pantalaimon
|
||||
- [ ] Import/export keys
|
||||
- [ ] Ability to verify, ignore, or blacklist devices
|
||||
- [ ] Release on open-store.io
|
||||
- [x] Import/export keys (panctl only)
|
||||
- [x] Ability to verify, ignore, or blacklist devices (panctl only)
|
||||
|
||||
## Known Issues
|
||||
|
||||
* Previously encrypted messages cannot be decrypted
|
||||
* No user interaction to verify, ignore, or blacklist devices
|
||||
- Previously encrypted messages may not be decrypted
|
||||
- Slow to sync on certain devices
|
||||
|
||||
## Build for armhf
|
||||
## panctl
|
||||
|
||||
```sh
|
||||
git clone https://git.sr.ht/~thrrgilag/pantalaimon-ut
|
||||
git submodule update --init
|
||||
clickable build-libs --arch armhf
|
||||
clickable --arch armhf
|
||||
```
|
||||
The ability to verify, ignore, or blacklist devices is currently limited to the use of the panctl utility which can be accessed using the Terminal app by running `/opt/click.ubuntu.com/pantalaimon.thrrgilag/current/panctl`. See the [man](https://github.com/matrix-org/pantalaimon/blob/master/docs/man/panctl.md) for details on how to use it.
|
||||
|
||||
## Build for arm64
|
||||
## Build pantalaimon and panctl
|
||||
|
||||
```sh
|
||||
git clone https://git.sr.ht/~thrrgilag/pantalaimon-ut
|
||||
git submodule update --init
|
||||
clickable build-libs --arch arm64
|
||||
clickable --arch arm64
|
||||
```
|
||||
The background daemon (pantalaimon) and shell utility (panctl) are built directly on device due to complications with cross compiling dependencies. You'll need a device with sufficient space free on the system partition to install all of the required packages. For the most recent release I utilized a Raspberry Pi 4 to create the binaries for arm64 and armhf.
|
||||
|
||||
1. Put the dev-build.sh script in /home/phablet on the target device and execute `./dev-build.sh`
|
||||
2. Pull the ~/pantalaimon-build/dist/pantalaimon and ~/pantalaimon-build/dist/panctl to your local source tree
|
||||
3. Rename the files to add -{ARCH} *(e.g. mv pantalaimon pantalaimon-arm64)*
|
||||
|
||||
## Build click package
|
||||
|
||||
- Install or update [clickable](https://clickable-ut.dev/en/latest/install.html)
|
||||
- For ARM64 devices run `clickable --arch=arm64`
|
||||
- For ARMHF devices run `clickable --arch=armhf`
|
||||
|
||||
## Contributing
|
||||
|
||||
Send patches to
|
||||
[~thrrgilag/pantalaimon-ut@lists.sr.ht](https://lists.sr.ht/~thrrgilag/pantalaimon-ut)
|
||||
|
||||
A tutorial for git send-email can be found at [git-send-email.io](https://git-send-email.io/)
|
||||
if you're not familiar with this method.
|
||||
|
||||
Bugs can be filed at https://todo.sr.ht/~thrrgilag/pantalaimon-ut
|
||||
Report bugs or send patches to morgan@mcmillian.dev.
|
||||
|
||||
## License
|
||||
|
||||
|
|
|
@ -3,13 +3,12 @@
|
|||
PYTHON_VERSION="3.7.7"
|
||||
CRYPTOGRAPHY_VERSION="3.2.1"
|
||||
|
||||
echo "...building python..."
|
||||
cd ${BUILD_DIR}
|
||||
wget -qO- "https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz" | tar -xz
|
||||
|
||||
echo
|
||||
echo "...building python..."
|
||||
echo
|
||||
wget -qO- "https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz" | tar -xz
|
||||
cd Python-${PYTHON_VERSION}
|
||||
./configure --prefix="${INSTALL_DIR}" --enable-shared
|
||||
make
|
||||
|
@ -22,19 +21,21 @@ echo
|
|||
echo "...installing pyinstaller..."
|
||||
echo
|
||||
${INSTALL_DIR}/bin/pip3 install --upgrade pyinstaller
|
||||
# dirty hack to work around pyinstaller locating the bootloader when building for armhf
|
||||
ln -s ${INSTALL_DIR}/lib/python3.7/site-packages/PyInstaller/bootloader/Linux-32bit-unknown ${INSTALL_DIR}/lib/python3.7/site-packages/PyInstaller/bootloader/Linux-32bit-arm
|
||||
|
||||
export CRYPTOGRAPHY_ALLOW_OPENSSL_102="yes"
|
||||
echo
|
||||
echo "...installing cryptography..."
|
||||
echo
|
||||
export CRYPTOGRAPHY_ALLOW_OPENSSL_102="yes"
|
||||
${INSTALL_DIR}/bin/pip3 install --upgrade cryptography==${CRYPTOGRAPHY_VERSION}
|
||||
|
||||
export LD_LIBRARY_PATH=${ROOT}/build/${ARCH_TRIPLET}/olm/install/lib/${ARCH_TRIPLET}:${LD_LIBRARY_PATH}
|
||||
export CFLAGS=-I${ROOT}/build/${ARCH_TRIPLET}/olm/install/include
|
||||
export LDFLAGS=-L${ROOT}/build/${ARCH_TRIPLET}/olm/install/lib/${ARCH_TRIPLET}
|
||||
echo
|
||||
echo "...installing pantalaimon..."
|
||||
echo
|
||||
export LD_LIBRARY_PATH=${ROOT}/build/${ARCH_TRIPLET}/olm/install/lib/${ARCH_TRIPLET}:${LD_LIBRARY_PATH}
|
||||
export CFLAGS=-I${ROOT}/build/${ARCH_TRIPLET}/olm/install/include
|
||||
export LDFLAGS=-L${ROOT}/build/${ARCH_TRIPLET}/olm/install/lib/${ARCH_TRIPLET}
|
||||
${INSTALL_DIR}/bin/pip3 install --upgrade pantalaimon
|
||||
|
||||
export PATH=/usr/${ARCH_TRIPLET}/bin:${PATH}
|
||||
|
|
24
clickable-cross-build.json
Normal file
24
clickable-cross-build.json
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"clickable_minimum_required": "6.12.2",
|
||||
"builder": "cmake",
|
||||
"libraries": {
|
||||
"olm": {
|
||||
"builder": "cmake",
|
||||
"build_args": [ "-Bbuild",
|
||||
"-DOLM_TESTS=OFF",
|
||||
"-DBUILD_SHARED_LIBS=ON"
|
||||
],
|
||||
"prebuild": "git submodule update --init --recursive"
|
||||
},
|
||||
"pantalaimon": {
|
||||
"builder": "custom",
|
||||
"dependencies_target": [
|
||||
"libffi-dev",
|
||||
"libssl-dev",
|
||||
"libsqlite3-dev"
|
||||
],
|
||||
"build": "${ROOT}/build-python.sh"
|
||||
}
|
||||
},
|
||||
"kill": "qmlscene"
|
||||
}
|
|
@ -1,24 +1,6 @@
|
|||
{
|
||||
"clickable_minimum_required": "6.12.2",
|
||||
"builder": "cmake",
|
||||
"libraries": {
|
||||
"olm": {
|
||||
"builder": "cmake",
|
||||
"build_args": [ "-Bbuild",
|
||||
"-DOLM_TESTS=OFF",
|
||||
"-DBUILD_SHARED_LIBS=ON"
|
||||
],
|
||||
"prebuild": "git submodule update --init --recursive"
|
||||
},
|
||||
"pantalaimon": {
|
||||
"builder": "custom",
|
||||
"dependencies_target": [
|
||||
"libffi-dev",
|
||||
"libssl-dev",
|
||||
"libsqlite3-dev"
|
||||
],
|
||||
"build": "${ROOT}/build-python.sh"
|
||||
}
|
||||
},
|
||||
"kill": "qmlscene"
|
||||
"always_clean": true,
|
||||
"clickable_minimum_required": "7",
|
||||
"kill": "qmlscene",
|
||||
"builder": "cmake"
|
||||
}
|
||||
|
|
73
dev-build.sh
73
dev-build.sh
|
@ -3,37 +3,21 @@
|
|||
PROJECT_DIR=~/pantalaimon-build
|
||||
TMP_DIR="${PROJECT_DIR}/tmp"
|
||||
|
||||
VIRTENV_DIR="${PROJECT_DIR}/virtenv"
|
||||
|
||||
OLM_DIR="${PROJECT_DIR}/olm"
|
||||
PANTALAIMON_DIR="${PROJECT_DIR}/pantalaimon"
|
||||
|
||||
PYTHON_VERSION_MINOR="3.7"
|
||||
PYTHON_VERSION_PATCH="7"
|
||||
PYTHON_VERSION_MINOR="3.8"
|
||||
PYTHON_VERSION_PATCH="12"
|
||||
PYTHON_VERSION="${PYTHON_VERSION_MINOR}.${PYTHON_VERSION_PATCH}"
|
||||
PYTHON_DIR="${PROJECT_DIR}/python"
|
||||
PYTHON_SRC_DIR="${TMP_DIR}/Python-${PYTHON_VERSION}"
|
||||
PYTHON="${PYTHON_DIR}/bin/python${PYTHON_VERSION_MINOR}"
|
||||
PIP="${PYTHON_DIR}/bin/pip3"
|
||||
|
||||
mkdir -p "${PROJECT_DIR}"
|
||||
mkdir -p "${TMP_DIR}"
|
||||
|
||||
PACKAGES="make cmake build-essential zlibc python3-venv libffi-dev ppa-purge libssl-dev libsqlite3-dev"
|
||||
|
||||
PANTALAIMON_PATCH_CONTENT="
|
||||
diff --git a/pantalaimon/main.py b/pantalaimon/main.py
|
||||
index 896d29e..3e0fee8 100644
|
||||
--- a/pantalaimon/main.py
|
||||
+++ b/pantalaimon/main.py
|
||||
@@ -32,6 +32,7 @@ from pantalaimon.log import logger
|
||||
from pantalaimon.thread_messages import DaemonResponse
|
||||
from pantalaimon.ui import UI_ENABLED
|
||||
|
||||
+keyring.core.set_keyring(keyring.core.load_keyring('keyring.backends.SecretService.Keyring'))
|
||||
|
||||
def create_dirs(data_dir, conf_dir):
|
||||
try:
|
||||
"
|
||||
PACKAGES="make cmake build-essential zlibc python3-venv libffi-dev ppa-purge libssl-dev libsqlite3-dev zlib1g-dev rustc cargo libgirepository1.0-dev libdbus-1-dev libcairo2-dev"
|
||||
|
||||
echo "Remounting RootFS writable..."
|
||||
sudo mount -o remount,rw /
|
||||
|
@ -42,56 +26,69 @@ echo "Installing dependencies..."
|
|||
sudo apt update
|
||||
sudo apt install -y ${PACKAGES}
|
||||
|
||||
if [ ! -e "${OLM_DIR}/usr/local/lib/libolm.so" ]; then
|
||||
OLMCK=${OLM_DIR}/usr/local/lib/libolm.so
|
||||
if test -f ${OLMCK}; then
|
||||
echo "olm found, skipping..."
|
||||
else
|
||||
cd "${TMP_DIR}"
|
||||
echo "Downloading Olm..."
|
||||
wget -qO- "https://gitlab.matrix.org/matrix-org/olm/-/archive/master/olm-master.tar.gz" | tar -xz
|
||||
|
||||
echo "Building Olm..."
|
||||
echo "Building olm..."
|
||||
cd olm-master
|
||||
cmake . -Bbuild
|
||||
cmake --build build
|
||||
|
||||
echo "Installing Olm..."
|
||||
cd build
|
||||
make install DESTDIR="${OLM_DIR}"
|
||||
else
|
||||
echo "Olm found. Skipping Olm Install..."
|
||||
fi
|
||||
|
||||
if [ ! -e "${PYTHON}" ]; then
|
||||
if test -f ${PYTHON}; then
|
||||
echo "python found, skipping..."
|
||||
else
|
||||
echo "Downloading Python..."
|
||||
cd "${TMP_DIR}"
|
||||
wget -qO- "https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz" | tar -xz
|
||||
|
||||
echo "Installing Python..."
|
||||
echo "Installing python..."
|
||||
cd "${PYTHON_SRC_DIR}"
|
||||
#./configure --prefix="${PYTHON_DIR}" --with-openssl=${OPENSSL_DIR} --enable-shared
|
||||
./configure --prefix="${PYTHON_DIR}" --enable-shared
|
||||
make
|
||||
make install
|
||||
else
|
||||
echo "Python found. Skipping Python Install..."
|
||||
fi
|
||||
|
||||
LD_LIBRARY_PATH=${PYTHON_DIR}/lib:${OLM_DIR}/usr/local/lib:${LD_LIBRARY_PATH}
|
||||
export LD_LIBRARY_PATH
|
||||
|
||||
echo "Installing PyInstaller..."
|
||||
${PYTHON} -m pip install --upgrade pyinstaller
|
||||
echo "Updating setuptools..."
|
||||
${PIP} install --upgrade setuptools
|
||||
${PIP} install --upgrade wheel
|
||||
|
||||
echo "Installing cryptography 3.2.1"
|
||||
${PYTHON} -m pip install cryptography==3.2.1
|
||||
echo "Installing PyInstaller..."
|
||||
${PIP} install --upgrade pyinstaller
|
||||
# dirty hack to work around pyinstaller locating the bootloader when building for armhf
|
||||
ln -s ${PYTHON_DIR}/lib/python3.7/site-packages/PyInstaller/bootloader/Linux-32bit-unknown ${PYTHON_DIR}/lib/python3.7/site-packages/PyInstaller/bootloader/Linux-32bit-arm
|
||||
|
||||
# NOTE: Newer versions of cryptography require rustc+cargo to build. While the
|
||||
# new version builds fine with rust on arm64 it fails on armhf
|
||||
echo "Installing cryptography..."
|
||||
export CRYPTOGRAPHY_ALLOW_OPENSSL_102="yes"
|
||||
${PIP} install cryptography==3.2.1
|
||||
|
||||
echo "Installing pycairo..."
|
||||
${PIP} install pycairo==1.19.1
|
||||
|
||||
echo "Installing pygobject..."
|
||||
PYGOBJECT_WITHOUT_PYCAIRO=1 ${PIP} install --no-build-isolation pygobject==3.38
|
||||
|
||||
echo "Installing Pantalaimon..."
|
||||
CFLAGS=-I"${OLM_DIR}/usr/local/include -I${OLM_DIR}/usr/local/include" LDFLAGS="-L${OLM_DIR}/usr/local/lib" ${PYTHON} -m pip install --upgrade pantalaimon
|
||||
CFLAGS=-I${OLM_DIR}/usr/local/include LDFLAGS=-L${OLM_DIR}/usr/local/lib ${PIP} install --upgrade pantalaimon[ui]
|
||||
|
||||
echo "Bundling Pantalaimon..."
|
||||
cd ${PROJECT_DIR}
|
||||
echo "${PANTALAIMON_PATCH_CONTENT}" > main.patch
|
||||
patch ${PYTHON_DIR}/lib/python${PYTHON_VERSION_MINOR}/site-packages/pantalaimon/main.py main.patch
|
||||
${PYTHON_DIR}/bin/pyinstaller --onefile ${PYTHON_DIR}/bin/pantalaimon
|
||||
${PYTHON_DIR}/bin/pyinstaller --onefile ${PYTHON_DIR}/bin/panctl
|
||||
|
||||
echo "Cleaning up, reverting changes to RootFS..."
|
||||
sudo apt autoremove -y ${PACKAGES}
|
||||
sudo apt clean
|
||||
|
||||
|
|
2
libs/olm
2
libs/olm
|
@ -1 +1 @@
|
|||
Subproject commit bcb89bcc243688f063a059b8fd7afd220588efd6
|
||||
Subproject commit e1aa1b32770c93919692438bee212186500020d3
|
|
@ -97,6 +97,11 @@ Page {
|
|||
onDelegateClicked: {
|
||||
loglevel_idx = index;
|
||||
saveConfig();
|
||||
if (is_running) {
|
||||
py.call('service.stop', [], function(result) {});
|
||||
py.call('service.start', [], function(result) {});
|
||||
get_status();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -57,6 +57,11 @@ def save(defaults, data):
|
|||
'loglevel': defobj['loglevel']
|
||||
}
|
||||
|
||||
if defobj['loglevel'] == 'debug':
|
||||
config['Default']['DebugEncryption'] = 'true'
|
||||
else:
|
||||
config['Default']['DebugEncryption'] = 'false'
|
||||
|
||||
for item in dataobj:
|
||||
if item['ssl']:
|
||||
sslval = 'true'
|
||||
|
|
Loading…
Reference in a new issue