Skip to content

Commit

Permalink
Merge pull request #111 from uklotzde/release_0.3.9
Browse files Browse the repository at this point in the history
Release v0.3.9
  • Loading branch information
flosse authored Oct 24, 2018
2 parents 62f7551 + cfaea22 commit 0ca8a7b
Show file tree
Hide file tree
Showing 7 changed files with 122 additions and 33 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## v0.3.9 (2018-10-24)

- new(web): auto-complete URL fields
- fix(email): consistent corporate naming "Karte von morgen"
- fix(email): write RFC 2047 Subject header
- chore(db): add indexes for foreign key relations
- chore(*): update various dependencies

## v0.3.8 (2018-08-27)

- new(db): add image URL fields to entries
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 21 additions & 22 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
[package]
name = "openfairdb"
version = "0.3.8"
authors = ["Markus Kohlhase <[email protected]>"]
version = "0.3.9"
authors = ["Markus Kohlhase <[email protected]>", "slowtec GmbH <[email protected]>"]
license = "AGPL-3.0-or-later"

[dependencies]
# clap 3 is supposed to introduce breaking changes
chrono = "*"
clap = "2"
log = "0.4"
env_logger = "0.5"
uuid = { version = "0.7", features = ["v4"] }
url = "1"
quick-error = "1"
csv = "*"
diesel = { version = "*", features = ["sqlite", "r2d2"] }
diesel_migrations = { version = "*", features = ["sqlite"] }
dotenv = "*"
env_logger = "*"
fast_chemail = "*"
lazy_static = "*"
log = "*"
pwhash = "*"
quick-error = "*"
quoted_printable = "*"
regex = "*"
rocket = "*"
rocket_codegen = "*"
rocket_contrib = "*"
serde = "1"
serde_json = "1"
serde_derive = "1"
chrono = "0.4"
lazy_static = "1"
regex = "1"
pwhash = "0.2"
fast_chemail = "0.9"
quoted_printable = "0.4"
toml = "0.4"
dotenv = "0.13"
diesel = { version = "1.3", features = ["sqlite", "r2d2"] }
diesel_migrations = { version = "1.3", features = ["sqlite"] }
libsqlite3-sys = { version = "*", features = ["bundled"] }
csv = "1"
serde = { version = "*", features = ["derive"] }
serde_json = "*"
toml = "*"
url = "*"
uuid = { version = "*", features = ["v4"] }

[features]
default = ["email"]
Expand Down
34 changes: 34 additions & 0 deletions Makefile.x86_64-unknown-linux-musl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
BUILD_PROJECT=openfairdb

BUILD_TARGET_BIN=openfairdb
BUILD_TARGET_ARCH=x86_64-unknown-linux-musl

BUILD_IMAGE=clux/muslrust:$(file < rust-toolchain)

BUILD_ROOT=/tmp/muslrust
BUILD_CARGO_CACHE=$(BUILD_ROOT)/cargo-cache
BUILD_PROJECT_ROOT=$(BUILD_ROOT)/$(BUILD_PROJECT)

.PHONY: default
default: build

# Pull the build image from DockerHub (initially or update)
pre-build:
docker pull docker.io/$(BUILD_IMAGE)

build:
mkdir -p "$(BUILD_CARGO_CACHE)"
mkdir -p "$(BUILD_PROJECT_ROOT)"
rsync -av --chown `id -gn`:`id -un` --progress . "$(BUILD_PROJECT_ROOT)" --exclude target --exclude .git
docker run --rm \
-it $(BUILD_IMAGE) \
rustc --version
docker run --rm \
-v "$(BUILD_CARGO_CACHE)":/root/.cargo:Z \
-v "$(BUILD_PROJECT_ROOT)":/volume:Z \
-w /volume \
-it $(BUILD_IMAGE) \
cargo build --bin=$(BUILD_TARGET_BIN) --release
strip "$(BUILD_PROJECT_ROOT)/target/$(BUILD_TARGET_ARCH)/release/$(BUILD_TARGET_BIN)"
mkdir -p bin/$(BUILD_TARGET_ARCH)
cp "$(BUILD_PROJECT_ROOT)/target/$(BUILD_TARGET_ARCH)/release/$(BUILD_TARGET_BIN)" bin/$(BUILD_TARGET_ARCH)
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ For the following requests one must be logged in:
`bbox-subscriptions` are subscriptions to a certain map area (bounding box,`bbox`): whenever a new entry is created or an entry is changed within that area, an email notification is sent to the user.

### Entry Export
**Example**: Export all entries in Germany:
**Example**: Export all entries in Germany:
http://api.ofdb.io/v0/export/entries.csv?bbox=47.497972542230855,0.7996758709088782,54.63407558981465,18.307256321725717

If you want to find out the coordinates for other map areas, open "network" in the "developer tools" in your browser and look at the search request under at the value of `bbox`.
Expand Down Expand Up @@ -230,6 +230,34 @@ On NixOS you can build the project with:
nix-build -E '(import <nixpkgs>{}).callPackage ./default.nix {}'
```

### Docker Build

The bundled Makefile can be used to build a static executable without installing any dependencies locally.

Depending on the permissions of your local Docker installation you may need to use `sudo` for the invocation of `make`.

#### Pull Build Image

The build requires the [muslrust](https://hub.docker.com/r/clux/muslrust/tags/) Docker image with the corresponding Rust toolchain:

```sh
make -f Makefile.x86_64-unknown-linux-musl pre-build
```

This command has to be executed at least once and can be repeated for updating the `muslrust` build image.

#### Execute Build

Use the following command from the project directory to start the build:

```sh
make -f Makefile.x86_64-unknown-linux-musl
```

The source folder is copied into `/tmp` and mounted as a volume into the Docker container. The Cargo cache is also stored in `/tmp` and reused on subsequent invocations.

The resulting executable is copied into the folder `bin/x86_64-unknown-linux-musl` after the build has completed successfully.

## Logging

RUST_LOG=debug ./target/debug/openfairdb
Expand Down
2 changes: 1 addition & 1 deletion rustc-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rustc 1.31.0-nightly (14f42a732 2018-10-14)
rustc 1.31.0-nightly (a66dc8a14 2018-10-22)
30 changes: 25 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,58 @@

#![feature(plugin, custom_derive, test, transpose_result)]
#![plugin(rocket_codegen)]
#![recursion_limit = "256"]

extern crate chrono;

extern crate clap;

extern crate csv;

#[macro_use]
extern crate diesel;

#[macro_use]
extern crate diesel_migrations;

extern crate dotenv;

extern crate env_logger;

extern crate fast_chemail;

#[macro_use]
extern crate lazy_static;

#[macro_use]
extern crate log;

extern crate pwhash;

#[macro_use]
extern crate quick_error;

extern crate quoted_printable;

extern crate regex;

extern crate rocket;

extern crate rocket_contrib;

#[macro_use]
extern crate serde_derive;
extern crate csv;
extern crate serde;

extern crate serde_json;
#[cfg(test)]
extern crate test;

extern crate toml;

extern crate url;

extern crate uuid;

#[cfg(test)]
extern crate test;

mod adapters;
mod core;
mod infrastructure;
Expand Down

0 comments on commit 0ca8a7b

Please sign in to comment.