diff --git a/authentication/example-providers/sql-username-password/.env b/authentication/example-providers/sql-username-password/.env new file mode 100644 index 00000000000..62fc84e4d13 --- /dev/null +++ b/authentication/example-providers/sql-username-password/.env @@ -0,0 +1,5 @@ +COMPOSE_PROJECT_NAME=core-sql-username-password +DEEPHAVEN_PORT=10000 +DEEPHAVEN_CONSOLE_TYPE=python +DEEPHAVEN_APPLICATION_DIR=/data/app.d +DEEPHAVEN_SERVER_IMAGE=deephaven/server-jetty:local-build diff --git a/authentication/example-providers/sql-username-password/Dockerfile b/authentication/example-providers/sql-username-password/Dockerfile new file mode 100644 index 00000000000..e8c0d677f0c --- /dev/null +++ b/authentication/example-providers/sql-username-password/Dockerfile @@ -0,0 +1,4 @@ +ARG DEEPHAVEN_SERVER_IMAGE +FROM ${DEEPHAVEN_SERVER_IMAGE} + +COPY build/libs/deephaven-sql-username-password-authentication-provider-*-all.jar /apps/libs/deephaven-sql-username-password-authentication-provider.jar \ No newline at end of file diff --git a/authentication/example-providers/sql-username-password/README.md b/authentication/example-providers/sql-username-password/README.md index a6856b452fc..de358875955 100644 --- a/authentication/example-providers/sql-username-password/README.md +++ b/authentication/example-providers/sql-username-password/README.md @@ -6,9 +6,9 @@ to follow best practices in storing secure information like the password itself, rudimentary. ## Example database setup -In this directory, run `docker-compose up` to start a SQL database. The `init-users.sql` file will be used to initialize -this database, which has one user, named `admin`, with a password of `p@ssw0rd`. This docker-compose configuration is -designed to be fast to start and ephemeral, and is not meant for production use. +In this directory, run `docker-compose up`in this directory to start a SQL database. The `init-users.sql` file will be +used to initialize this database, which has one user, named `admin`, with a password of `p@ssw0rd`. This docker-compose +configuration is designed to be fast to start and ephemeral, and is not meant for production use. After that has run, there will be a docker container running with port 5432 exposed on localhost. The password for the postgres account is `password`. @@ -16,6 +16,11 @@ postgres account is `password`. ## Server setup To test this when building from gradle with `:server-jetty-app:run`, specify `-Psql-username-password` to enable this. +To run this from a sample docker-compose: + * First build the project, at least `./gradlew prepareCompose :authentication:example-providers:sql-username-password:assemble` + from the top-level directory of the project. + * Then run `docker-compose -f docker-compose.yml -f docker-compose-dh.yml up` in this directory. + To use this from a pre-built installation: * Add the sql-username-password-authentication-provider jar to your Deephaven installation's classpath: * If running the `bin/start` script, this can be accomplished by adding it to the `EXTRA_CLASSPATH` environment variable. diff --git a/authentication/example-providers/sql-username-password/docker-compose-dh.yml b/authentication/example-providers/sql-username-password/docker-compose-dh.yml new file mode 100644 index 00000000000..209b566c3f2 --- /dev/null +++ b/authentication/example-providers/sql-username-password/docker-compose-dh.yml @@ -0,0 +1,20 @@ +version: "3.4" + +services: + server: + extends: + file: ../../../docker-compose-common.yml + service: server + image: deephaven/server-jetty-sql-username-password:local-build + build: + context: . + args: + - DEEPHAVEN_SERVER_IMAGE=${DEEPHAVEN_SERVER_IMAGE} +# volumes: +# - ./build/libs/deephaven-sql-username-password-*-all.jar:/apps/libs/deephaven-sql-username-password.jar + environment: + JAVA_OPTS: > + -DAuthHandlers=io.deephaven.authentication.sql.BasicSqlAuthenticationHandler + -Dauthentication.basic.sql.jdbc.connection=jdbc:postgresql://postgres:5432/postgres + -Dauthentication.basic.sql.jdbc.user=postgres + -Dauthentication.basic.sql.jdbc.password=password diff --git a/docker/server-jetty/src/main/docker/Dockerfile b/docker/server-jetty/src/main/docker/Dockerfile index 2b25676b042..453b0727cd1 100644 --- a/docker/server-jetty/src/main/docker/Dockerfile +++ b/docker/server-jetty/src/main/docker/Dockerfile @@ -2,6 +2,7 @@ ARG BASE FROM $BASE as install COPY licenses/ / +RUN mkdir -p /apps/libs # Note: all of the pip installs have the --no-index flag, with the expectation that all external dependencies are # already satisfied via the base image. If that is not the case, we want the install to error out, and we'll need to