• Stars
    star
    190
  • Rank 203,711 (Top 5 %)
  • Language
    Rust
  • License
    GNU General Publi...
  • Created over 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Turtl's logic core, built in Rust. Made for embedding in other platforms (desktop, mobile, possibly browser w/ Emscripten).

Turtl core-rs

(the failing New York Test)

Opening an issue? See the Turtl project tracker

This is the Rust core for Turtl. It houses the logic for Turtl's main client operations and is meant to be embedded as a shared/static library that is standard across all platforms. The idea is, if it can go in the core, it should go in the core. Pretty much everything except UI goes here:

  • User join/login/deletion
  • Talking to the server/syncing data
  • Encryption/Decryption of data
  • In-memory storage of profile data
  • Permissions checking
  • Searching of notes
  • Sharing/Collaboration handling
  • Local storage
  • Bookmark handling

When building a UI (Android/iOS/Desktop/etc etc) you should have to worry about two things: loading/talking to the core and building the interface around the core. All logic (syncing/crypto/storage) lives in the core.

Although the core project is posted, the new server it talks to (NodeJS/Postgres) is not yet public (yes, a fond farewell to Lisp). Stay tuned!

This project is unfinished and alpha status. I won't be responding to issues or bug reports on it yet. Use at your own risk.

Building the core

Let's go over how to build the Turtl core.

Prerequisites

  • Rust >= 1.27.0
  • OpenSSL 1.0.x (shared or static)
  • Libsodium 1.0.16 (static preferred)

Compiling

make

The Makefile includes (optionally) a non-versioned file called vars.mk which can be used to house any ENV vars specific to your build environment:

# Example vars.mk
export PATH := $(PATH):/your/custom/path
export RUSTFLAGS := -L/opt/lib64 -lmylib
export SODIUM_LIB_DIR := /opt/libsodium/lib
export SODIUM_STATIC := static
export OPENSSL_LIB_DIR=/usr/lib/openssl-1.0
export OPENSSL_INCLUDE_DIR=/usr/include/openssl-1.0

NOTE: If your system uses OpenSSL 1.1.0, you need to install OpenSSL 1.0.0 and tell make to use it with OPENSSL_LIB_DIR=/usr/lib/openssl-1.0 OPENSSL_INCLUDE_DIR=/usr/include/openssl-1.0 make for example. This would be a good place to use vars.mk.

NOTE 2: If your system has libsodium version different than 1.0.16 and your build fails, do this:

cargo build
wget https://download.libsodium.org/libsodium/releases/old/libsodium-1.0.16.tar.gz
tar xzf libsodium-1.0.16.tar.gz
cd libsodium-1.0.16
./configure
make
cp -r src/libsodium/.libs/* ../target/debug/deps/
cargo build

After every cargo clean or make clean you should do the last command

Using

This section is a work in progress. To use the Turtl core embedded library, you'll have to know two things:

  • How to interface: see turtl_core.h
  • How to use: see dispatch.rs for a list of commands you can send the core, and also check the integration tests for example usage. The integration tests strive for complete coverage of all the publicly-exported capabilities of the core library, so they should help somewhat with documentation (I know it's not a substitute, but I'd rather release the project then toil away on docs than the other way around).

Notes

This is a haphazard collection of random notes with no real organization. Sorry.

  • If you want to build the core for linux or android, see buildo.
  • When building turtl core for iOS, you need to use a libsodium.a that was compiled without --enable-minimal!! This is worth noting because libsodium/src/dist-build/ios.sh uses --enable-minimal when building...remove these directives before building libsodium!

Projects using the core

More Repositories

1

desktop

Turtl's desktop app
JavaScript
679
star
2

server

The new Turtl server
JavaScript
602
star
3

js

Turtl's main app interface.
JavaScript
514
star
4

api

(Deprecated) Turtl API. This is the server that responds to all client requests.
Common Lisp
232
star
5

android

Holds the wrappers (cordova) to run Turtl on Android
Java
126
star
6

tracker

This project is for tracking issues, bug reports, and progress on the entire Turtl project.
67
star
7

browser-extension

THE Turtl bookmarking extension.
JavaScript
51
star
8

core-cl

(experimental, deprecated) Common Lisp core for Turtl. The goal is to put all logic in lisp, and embed in other runtimes (Node-webkit, Android, iOS). Note that most desktop/mobile browsers now support the features that turt/js needs to run, so turtl/core has reached the end of its life. It remains as a reference or as a great place to pick up from if lisp is needed in the future.
Common Lisp
48
star
9

fdroid

An auto-generated repository for the FDroid project so they don't have to deal with a Cordova build system
JavaScript
24
star
10

www

Turtl website/marketing site/link endpoint
JavaScript
17
star
11

chrome-bookmarker

(Deprecated)
JavaScript
17
star
12

ios

Holds the wrappers (cordova) to run Turtl on iOS
JavaScript
10
star
13

ui

No, Turtl is not dead.
JavaScript
5
star
14

desktop-ff

(experimental, deprecated) Firefox version of the desktop app
JavaScript
3
star
15

chrome

(Deprecated) Turtl chrome extension
JavaScript
2
star
16

buildo

A collection of Makefiles and Dockerfiles to create Turtl builds
Shell
2
star
17

firefox

(Deprecated) Turtl firefox add-on
JavaScript
2
star
18

lib-permissions

Common permissions between server/core
Rust
2
star
19

tp2p

A limited-state library for p2p interactions between trusted nodes to exchange data
Rust
1
star