Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d90a370
upgrade refreshVersions and fix kotlin version
DivineThreepwood Jan 16, 2022
7002e56
switch more deps to dep version manager.
DivineThreepwood Jan 16, 2022
82ca1c5
update jul submodule
DivineThreepwood Jan 18, 2022
e81b37f
downgrade gradle to version 6.9.2
DivineThreepwood Jan 18, 2022
69a01f9
try to fix lang
DivineThreepwood Jan 18, 2022
a918572
downgrade ubuntu version and limit bco start script to core runtime.
DivineThreepwood Jan 27, 2022
442efdb
reenable start scripts
DivineThreepwood Jan 27, 2022
253d80c
switch back to ubuntu latest.
DivineThreepwood Jan 28, 2022
c5a4a2e
only disable bco-visual-remote
DivineThreepwood Jan 28, 2022
e01dc1a
remove useless subfilter to provide downsteam images.
DivineThreepwood Jan 28, 2022
e571e9d
disabled non production required tools to improve build timing.
DivineThreepwood Jan 29, 2022
6e6fb60
Revert "switch back to ubuntu latest."
DivineThreepwood Jan 29, 2022
37eecfa
try to define timeouts via gradle config.
DivineThreepwood Jan 30, 2022
4712aa0
cleanup useless arguments
DivineThreepwood Jan 31, 2022
6997c87
disable pr filter for push action in docker deploy script.
DivineThreepwood Jan 31, 2022
05774de
update version plugin
DivineThreepwood Feb 1, 2022
4010a3a
add google as fallback repo
DivineThreepwood Feb 1, 2022
b5d35aa
upgrade most dep patch versions
DivineThreepwood Feb 1, 2022
7ec5234
upgrade spring and link rejoiner local
DivineThreepwood Feb 8, 2022
2411e0d
import rejoiner
DivineThreepwood Feb 8, 2022
047421f
remove unfinished docker deploy script
DivineThreepwood Feb 8, 2022
b45a14b
cleanup
DivineThreepwood Feb 8, 2022
1484fe9
reenable bins
DivineThreepwood Feb 8, 2022
c6264c4
cleanup CredentialStore
DivineThreepwood Feb 8, 2022
9c546b4
revert some changes
DivineThreepwood Feb 8, 2022
1f5ac7d
revert some changes
DivineThreepwood Feb 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/workflows/deploy-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,12 @@ jobs:
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
Expand All @@ -67,7 +65,7 @@ jobs:
context: .
file: docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
push: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'prebuild docker image') }}
tags: ${{ steps.bco-meta.outputs.tags }}
labels: ${{ steps.bco-meta.outputs.labels }}
env:
Expand Down Expand Up @@ -102,7 +100,7 @@ jobs:
BCO_BASE_IMAGE_VERSION=sha-${{ steps.short-sha.outputs.sha }}
file: ./docker/device-manager/openhab/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
push: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'prebuild docker image') }}
tags: ${{ steps.bco-device-meta.outputs.tags }}
labels: ${{ steps.bco-device-meta.outputs.labels }}
-
Expand Down Expand Up @@ -132,6 +130,6 @@ jobs:
BCO_BASE_IMAGE_VERSION=sha-${{ steps.short-sha.outputs.sha }}
file: ./docker/bco-demo/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
push: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'prebuild docker image') }}
tags: ${{ steps.bco-demo-meta.outputs.tags }}
labels: ${{ steps.bco-demo-meta.outputs.labels }}
2 changes: 2 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ plugins {

repositories {
// Use the plugin portal to apply community plugins in convention plugins.
mavenLocal()
gradlePluginPortal()
google()
mavenCentral()
}

Expand Down
5 changes: 3 additions & 2 deletions buildSrc/src/main/kotlin/org.openbase.bco.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ repositories {
maven {
url = uri("https://oss.sonatype.org/content/groups/public/")
}
google()
mavenCentral()
}

Expand All @@ -29,8 +30,8 @@ java {
}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.jetbrains.kotlin:kotlin-reflect:_")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:_")
testImplementation("org.junit.jupiter:junit-jupiter-api:[5.6,5.7-alpha)")
testImplementation("org.junit.vintage:junit-vintage-engine:[5.6,5.7-alpha)")
}
Expand Down
24 changes: 13 additions & 11 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Install dependencies
FROM ubuntu:latest AS builder
FROM ubuntu:focal-20211006 AS builder

ENV \
JAVA_OPTS="" \
LC_ALL="en_US.UTF-8" \
LANG="en_US.UTF-8" \
LANGUAGE="en_US.UTF-8" \
JAVA_VERSION="11"

WORKDIR /workspace

Expand All @@ -12,6 +19,8 @@ RUN apt update && \
git \
rsync \
curl \
locales \
locales-all \
wget && \
apt clean

Expand All @@ -25,16 +34,10 @@ RUN ./gradlew --version
RUN ./prepare.sh
RUN cd lib/jul && \
prefix="/tmp/" ./install.sh \
-Dmaven.javadoc.skip=true \
-Dmaven.wagon.http.retryHandler.count=3 \
-Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false \
-Dmaven.wagon.httpconnectionManager.ttlSeconds=120
-Dmaven.javadoc.skip=true

# Build bco
RUN ./gradlew :bco.app.util:installDist -x test -x javadoc --no-daemon --stacktrace \
-Dmaven.wagon.http.retryHandler.count=3 \
-Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false \
-Dmaven.wagon.httpconnectionManager.ttlSeconds=120
RUN ./gradlew :bco.app.util:installDist -x test -x javadoc --no-daemon --stacktrace

# Switch to baseline image
FROM ubuntu:latest
Expand Down Expand Up @@ -75,8 +78,7 @@ ENV \
BCO_LOGS="/home/bco/data/log" \
BCO_BINARY="/usr/bin/bco" \
BCO_OPTIONS="" \
JAVA_VERSION="11" \
JAVA_OPTS="--add-opens java.base/java.util=ALL-UNNAMED"
JAVA_VERSION="11"

# Basic build-time metadata as defined at http://label-schema.org
LABEL org.label-schema.build-date=$BUILD_DATE \
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Binary file added lib/external/rejoiner-0.5.0-bco.jar
Binary file not shown.
Binary file added lib/external/rejoiner-guice-0.5.0-bco.jar
Binary file not shown.
44 changes: 28 additions & 16 deletions module/api/graphql/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,29 +1,41 @@
import org.gradle.internal.impldep.org.junit.experimental.categories.Categories.CategoryFilter.exclude

plugins {
id("org.openbase.bco")
id("org.springframework.boot") version "2.6.1"
id("org.springframework.boot")
id("io.spring.dependency-management") version "1.0.11.RELEASE"
}

dependencies {

api(project(":bco.dal.remote"))
api("com.graphql-java-kickstart:graphql-spring-boot-starter:8.0.0") {
api("org.springframework.boot:spring-boot-starter-webflux:_")
api("com.graphql-java-kickstart:graphql-spring-boot-starter:_") {
exclude(group = "org.springframework.boot", module = "spring-boot-starter-tomcat")
}
api("org.springframework.boot:spring-boot-starter-jetty:2.6.1")
api("org.springframework.boot:spring-boot-starter-webflux:2.6.1")
api("org.springframework:spring-webmvc:5.3.13")
api("com.google.api.graphql:rejoiner:0.3.1") {
exclude(group = "com.google.inject", module = "guice")
exclude(group = "com.graphql-java", module = "graphql-java")
exclude(group = "com.google.inject.extensions", module = "guice-multibindings")
}
api("com.google.inject.extensions:guice-multibindings:4.2.3")
api("com.google.inject:guice:5.0.1")
api("com.google.guava:guava:28.0-jre")
api("net.javacrumbs.future-converter:future-converter-java8-guava:1.2.0")
api("org.jmdns:jmdns:3.5.6")
api("io.reactivex.rxjava2:rxjava:2.2.21")
api("org.springframework.boot:spring-boot-starter-jetty:_")
api(Spring.boot.webflux)
api("org.springframework:spring-webmvc:_")

api( rootProject.files("lib/external/rejoiner-0.5.0-bco.jar"))
api( rootProject.files("lib/external/rejoiner-guice-0.5.0-bco.jar"))
// disabled since rejoiner is linked locally.
// api("com.google.api.graphql:rejoiner-guice:_") {
// exclude(group = "com.google.inject", module = "guice")
// exclude(group = "com.graphql-java", module = "graphql-java")
// exclude(group = "com.google.inject.extensions", module = "guice-multibindings")
// }
// api("com.google.api.graphql:rejoiner:_") {
// exclude(group = "com.google.inject", module = "guice")
// exclude(group = "com.graphql-java", module = "graphql-java")
// exclude(group = "com.google.inject.extensions", module = "guice-multibindings")
// }
api("com.google.inject.extensions:guice-multibindings:_")
api("com.google.inject:guice:_")
api("com.google.guava:guava:_")
api("net.javacrumbs.future-converter:future-converter-java8-guava:_")
api("org.jmdns:jmdns:_")
api("io.reactivex.rxjava2:rxjava:_")
}

description = "BCO GraphQL API"
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,13 @@
import org.reactivestreams.Publisher;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
Expand Down Expand Up @@ -88,6 +93,23 @@ public class BcoGraphQlApiSpringBootApplication {
);
}

@Value("${graphql.url:/graphql}")
private String graphqlurl;

@Bean
public FilterRegistrationBean<CorsFilter> corsFilter() {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
CorsConfiguration config = new CorsConfiguration();
config.setAllowCredentials(false);
config.addAllowedOrigin("*");
config.addAllowedHeader("*");
config.addAllowedMethod("*");
source.registerCorsConfiguration(graphqlurl, config);
FilterRegistrationBean<CorsFilter> bean = new FilterRegistrationBean<>(new CorsFilter(source));
bean.setOrder(0);
return bean;
}

@Bean
GraphQLSchema schema() {
GraphQLSchema schema = injector.getInstance(Key.get(GraphQLSchema.class, Schema.class));
Expand Down
4 changes: 2 additions & 2 deletions module/app/base/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

plugins {
id("org.openbase.bco")
// id("org.graalvm.buildtools.native").version("0.9.4")
// id("org.graalvm.buildtools.native")
application
}

Expand Down Expand Up @@ -57,7 +57,7 @@ dependencies {
api(project(":bco.app.cloud.connector"))
api(project(":bco.app.influxdb.connector"))
api(project(":bco.api.graphql"))
api("commons-collections:commons-collections:3.2.2")
api("commons-collections:commons-collections:_")
testImplementation(project(":bco.dal.test"))
testImplementation("org.junit.jupiter:junit-jupiter:[5.6,5.7-alpha)")
}
Expand Down
2 changes: 1 addition & 1 deletion module/app/cloudconnector/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {

dependencies {
api(project(":bco.dal.control"))
api("io.socket:socket.io-client:1.0.0")
api("io.socket:socket.io-client:_")
testImplementation(project(":bco.authentication.test"))
}

Expand Down
5 changes: 2 additions & 3 deletions module/app/util/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ createAdditionalScript("bco-registry-validate") {
}

createAdditionalScript("bco-app-adhoc-generate-trainingdata") {
mainClass.set("org.openbase.bco.app.util.launch.BCOTrainDataGeneratorLauncher")
mainClass.set("org.openbase.bco.app.util.launch.BCOAdhocTrainDataGeneratorLauncher")
}

createAdditionalScript("bco-console") {
Expand Down Expand Up @@ -93,7 +93,6 @@ distributions {
}
}


tasks.register("deploy-bco-dist") {
dependsOn("installDist")
val bcoDist = System.getenv("BCO_DIST")?:"${System.getenv("HOME")}/usr"
Expand All @@ -118,7 +117,7 @@ dependencies {
api(project(":bco.app.influxdb.connector"))
api(project(":bco.api.graphql"))
api(project(":bco.dal.visual"))
api("commons-collections:commons-collections:3.2.2")
api("commons-collections:commons-collections:_")
testImplementation(project(":bco.dal.test"))
testImplementation("org.junit.jupiter:junit-jupiter:[5.6,5.7-alpha)")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
/*
* @author <a href="mailto:divine@openbase.org">Divine Threepwood</a>
*/
public class BCOTrainDataGeneratorLauncher {
public class BCOAdhocTrainDataGeneratorLauncher {

public static final Logger LOGGER = LoggerFactory.getLogger(BCOTrainDataGeneratorLauncher.class);
public static final Logger LOGGER = LoggerFactory.getLogger(BCOAdhocTrainDataGeneratorLauncher.class);
private static final Random random = new Random(System.currentTimeMillis());
public static final long TIMEOUT = 1000;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@

import org.openbase.bco.authentication.lib.AuthenticationService;
import org.openbase.bco.authentication.lib.BCO;
import org.openbase.bco.authentication.lib.jp.JPAuthenticationScope;
import org.openbase.bco.authentication.lib.jp.JPCredentialsDirectory;
import org.openbase.bco.authentication.lib.jp.JPResetCredentials;
import org.openbase.bco.authentication.lib.jp.JPSessionTimeout;
import org.openbase.bco.authentication.lib.jp.*;
import org.openbase.jps.core.JPService;
import org.openbase.jps.preset.JPPrefix;
import org.openbase.jul.exception.CouldNotPerformException;
import org.openbase.jul.exception.InstantiationException;
import org.openbase.jul.pattern.launch.AbstractLauncher;
Expand Down Expand Up @@ -45,7 +41,7 @@ public AuthenticatorLauncher() throws InstantiationException {

@Override
protected void loadProperties() {
JPService.registerProperty(JPPrefix.class);
JPService.registerProperty(JPBCODistributionDirectory.class);
JPService.registerProperty(JPAuthenticationScope.class);
JPService.registerProperty(JPResetCredentials.class);
JPService.registerProperty(JPCredentialsDirectory.class);
Expand All @@ -54,8 +50,8 @@ protected void loadProperties() {

/**
* @param args the command line arguments
* @throws java.lang.InterruptedException
* @throws org.openbase.jul.exception.CouldNotPerformException
* @throws java.lang.InterruptedException is thrown when the thread was externally interrupted.
* @throws org.openbase.jul.exception.CouldNotPerformException thrown in case the launcher could not be started.
*/
public static void main(final String[] args) throws InterruptedException, CouldNotPerformException {
BCO.printLogo();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public DT getEntry(final String id) throws NotAvailableException {
return map.get(id);
}

throw new NotAvailableException("Entry with key[" + id + "]");
throw new NotAvailableException("Entry with key[" + id + "].");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
Expand All @@ -24,6 +24,8 @@

import com.google.protobuf.ByteString;
import com.google.protobuf.Message;
import org.openbase.bco.authentication.lib.jp.JPResetCredentials;
import org.openbase.jps.core.JPService;
import org.openbase.jul.exception.CouldNotPerformException;
import org.openbase.jul.exception.CouldNotTransformException;
import org.openbase.jul.exception.NotAvailableException;
Expand Down Expand Up @@ -63,7 +65,13 @@ public CredentialStore() {
* @throws NotAvailableException if not credentials for the user are saved in the store.
*/
public LoginCredentials getCredentials(final String userId) throws NotAvailableException {
return getEntry(userId);
try {
return getEntry(userId);
} catch (NotAvailableException ex) {
throw new NotAvailableException("User", userId, "No credentials for user with Id[" + userId + "] found in credential store. " +
"This can be caused by a broken credential store. In this case try to reset the store by calling: " +
JPService.getApplicationName() + " " + JPResetCredentials.COMMAND_IDENTIFIERS[0]);
}
}

/**
Expand Down
Loading