From 682c1c95555f8b40b3bf82bf676f24fe852790d1 Mon Sep 17 00:00:00 2001 From: Javier Arias Date: Mon, 2 Nov 2020 18:12:04 +0000 Subject: [PATCH 1/7] Update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5c4e6972..56a7f565 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@

- Travis Info + Travis Info Thoth Releases Crate Info License Info From 82f65019b25b572132050ad14386b5a499f96484 Mon Sep 17 00:00:00 2001 From: Javier Arias Date: Tue, 3 Nov 2020 16:03:53 +0000 Subject: [PATCH 2/7] Set arg env properly in docker --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6762414a..ae91ac5b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,8 @@ ARG THOTH_API FROM ${BASE_IMAGE} as build +ENV THOTH_API=${THOTH_API} + # Install build dependencies RUN sudo apt-get update && sudo apt-get -y install pkg-config npm RUN sudo npm install -g npm@6.14.8 @@ -17,7 +19,7 @@ COPY --chown=rust:rust ./src ./src COPY --chown=rust:rust ./thoth-api ./thoth-api COPY --chown=rust:rust ./thoth-client ./thoth-client COPY --chown=rust:rust ./thoth-app ./thoth-app -ENV THOTH_API ${THOTH_API} + RUN wasm-pack build thoth-app/ \ --target web \ --release From 49755ebad590a77767421f2676071a87a915d727 Mon Sep 17 00:00:00 2001 From: Javier Arias Date: Tue, 3 Nov 2020 16:04:09 +0000 Subject: [PATCH 3/7] Add docker build instructions to README --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 56a7f565..ca931b0d 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,14 @@ wasm-pack build thoth-app/ --target web \ && cargo run start app ``` +### Building with docker + +The wasm APP needs to know the endpoint the API will be running at compile time, we must provide `THOTH_API` as a build argument to the docker daemon upon build: + +``` +docker build --build-arg THOTH_API=https://api.thoth.openbookpublishers.com . -t openbookpublishers/thoth +``` + ## Acknowledgements Thoth is being developed as part of the [COPIM](https://www.copim.ac.uk) project, an international effort to build community-owned, open systems and infrastructures to enable Open Access book publishing to flourish. COPIM is funded by the [Research England Development Fund](https://re.ukri.org/funding/our-funds-overview/research-england-development-red-fund/) (REDFund) and [Arcadia](https://www.arcadiafund.org.uk/). From cba394b638b709b50954d90ae8d19bfec62f3c54 Mon Sep 17 00:00:00 2001 From: Javier Arias Date: Tue, 3 Nov 2020 16:04:24 +0000 Subject: [PATCH 4/7] Compile graphiql URL from API URL --- thoth-app/src/component/navbar.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/thoth-app/src/component/navbar.rs b/thoth-app/src/component/navbar.rs index 9cc42943..f2c008bc 100644 --- a/thoth-app/src/component/navbar.rs +++ b/thoth-app/src/component/navbar.rs @@ -7,6 +7,7 @@ use crate::route::AdminRoute; use crate::route::AppRoute; use crate::service::cookie::CookieService; use crate::SESSION_COOKIE; +use crate::THOTH_API; pub struct NavbarComponent {} @@ -73,7 +74,7 @@ impl Component for NavbarComponent { { "Timeline" }

- + { "GraphiQL" } From cfc4e5fe674f8ee07703cd5c2da9207ebd3d5475 Mon Sep 17 00:00:00 2001 From: Javier Arias Date: Tue, 3 Nov 2020 16:43:30 +0000 Subject: [PATCH 5/7] Define arg after base image in docker file --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ae91ac5b..0491e2d4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ ARG BASE_IMAGE=ekidd/rust-musl-builder:1.44.1 -ARG THOTH_API FROM ${BASE_IMAGE} as build +ARG THOTH_API ENV THOTH_API=${THOTH_API} # Install build dependencies From 2afe0ad1ed70e312a5f8757d9e549266296f1816 Mon Sep 17 00:00:00 2001 From: Javier Arias Date: Tue, 3 Nov 2020 17:54:11 +0000 Subject: [PATCH 6/7] Update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3975e3bf..5a58d3d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to thoth will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [[0.2.2]](https://github.com/thoth-pub/thoth/releases/tag/v0.2.2) - 2020-11-03 +### Changed + - Set `THOTH_API` on build via docker + ## [[0.2.1]](https://github.com/thoth-pub/thoth/releases/tag/v0.2.1) - 2020-11-02 ### Changed - Redirect to relevant routes upon save and create actions in APP From 7030fe164c75c69f961ff10b5ae941f292192945 Mon Sep 17 00:00:00 2001 From: Javier Arias Date: Tue, 3 Nov 2020 17:57:51 +0000 Subject: [PATCH 7/7] Bump version v0.2.2 --- Cargo.lock | 16 ++++++++-------- Cargo.toml | 6 +++--- thoth-api/Cargo.toml | 2 +- thoth-app/Cargo.toml | 4 ++-- thoth-client/Cargo.toml | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 672f4534..79c9a8b0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3284,7 +3284,7 @@ dependencies = [ [[package]] name = "thoth" -version = "0.2.1" +version = "0.2.2" dependencies = [ "actix-cors 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "actix-http 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3303,8 +3303,8 @@ dependencies = [ "serde 1.0.115 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.115 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.57 (registry+https://github.com/rust-lang/crates.io-index)", - "thoth-api 0.2.1", - "thoth-client 0.2.1", + "thoth-api 0.2.2", + "thoth-client 0.2.2", "tokio 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", "xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3312,7 +3312,7 @@ dependencies = [ [[package]] name = "thoth-api" -version = "0.2.1" +version = "0.2.2" dependencies = [ "actix-web 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "argon2rs 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3340,14 +3340,14 @@ dependencies = [ [[package]] name = "thoth-app" -version = "0.2.1" +version = "0.2.2" dependencies = [ "anyhow 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.115 (registry+https://github.com/rust-lang/crates.io-index)", "stdweb 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror 1.0.20 (registry+https://github.com/rust-lang/crates.io-index)", - "thoth-api 0.2.1", + "thoth-api 0.2.2", "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-logger 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3359,13 +3359,13 @@ dependencies = [ [[package]] name = "thoth-client" -version = "0.2.1" +version = "0.2.2" dependencies = [ "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "graphql_client 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.115 (registry+https://github.com/rust-lang/crates.io-index)", - "thoth-api 0.2.1", + "thoth-api 0.2.2", "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/Cargo.toml b/Cargo.toml index 8dcb1c75..f3a007c9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "thoth" -version = "0.2.1" +version = "0.2.2" authors = ["Javier Arias "] edition = "2018" license = "Apache-2.0" @@ -16,8 +16,8 @@ maintenance = { status = "actively-developed" } members = ["thoth-api", "thoth-app", "thoth-client"] [dependencies] -thoth-api = {version = "0.2.1", path = "thoth-api", features = ["backend"] } -thoth-client = {version = "0.2.1", path = "thoth-client" } +thoth-api = {version = "0.2.2", path = "thoth-api", features = ["backend"] } +thoth-client = {version = "0.2.2", path = "thoth-client" } actix-http = "1.0.1" actix-rt = "1.0.0" actix-web = "3.0.0" diff --git a/thoth-api/Cargo.toml b/thoth-api/Cargo.toml index 2ff0e2d9..0321aea5 100644 --- a/thoth-api/Cargo.toml +++ b/thoth-api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "thoth-api" -version = "0.2.1" +version = "0.2.2" authors = ["Javier Arias "] edition = "2018" license = "Apache-2.0" diff --git a/thoth-app/Cargo.toml b/thoth-app/Cargo.toml index d8591fa7..d5dfb304 100644 --- a/thoth-app/Cargo.toml +++ b/thoth-app/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "thoth-app" -version = "0.2.1" +version = "0.2.2" authors = ["Javier Arias "] edition = "2018" license = "Apache-2.0" @@ -30,4 +30,4 @@ wasm-logger = "0.2.0" stdweb = "0.4.20" serde = { version = "1.0.115", features = ["derive"] } url = "2.1.1" -thoth-api = { version = "0.2.1", path = "../thoth-api" } +thoth-api = { version = "0.2.2", path = "../thoth-api" } diff --git a/thoth-client/Cargo.toml b/thoth-client/Cargo.toml index 36a39087..0da775af 100644 --- a/thoth-client/Cargo.toml +++ b/thoth-client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "thoth-client" -version = "0.2.1" +version = "0.2.2" authors = ["Javier Arias "] edition = "2018" license = "Apache-2.0" @@ -9,7 +9,7 @@ repository = "https://github.com/thoth-pub/thoth" readme = "README.md" [dependencies] -thoth-api = {version = "0.2.1", path = "../thoth-api" } +thoth-api = {version = "0.2.2", path = "../thoth-api" } graphql_client = "0.9.0" chrono = { version = "0.4", features = ["serde"] } reqwest = { version = "0.10", features = ["json"] }