Skip to content
Snippets Groups Projects
Verified Commit c7bfbcc0 authored by Martin Weise's avatar Martin Weise
Browse files

Added more envs

parent 999a61e8
Branches
Tags
4 merge requests!231CI: Remove build for log-service,!228Better error message handling in the frontend,!223Release of version 1.4.0,!190Resolve "More env variables for Azure deployment"
......@@ -46,7 +46,7 @@ ENV KC_DB_USERNAME=${AUTH_USERNAME}
ENV KC_DB_PASSWORD=${AUTH_PASSWORD}
ENV KC_HOSTNAME_STRICT_HTTPS=false
ENV KC_HOSTNAME_PATH=/api/auth
ENV KC_HOSTNAME_ADMIN_URL=http://localhost/api/auth
ENV KC_HOSTNAME_ADMIN_URL=http://localhost/auth
ENV KEYCLOAK_IMPORT=/opt/keycloak/data/import/dbrepo-realm.json
ENV KEYCLOAK_ADMIN=fda
......
......@@ -11,4 +11,7 @@ COPY ./pubkey.pem ./pubkey.pem
RUN rabbitmq-plugins enable --offline rabbitmq_prometheus rabbitmq_mqtt rabbitmq_auth_backend_oauth2 rabbitmq_auth_mechanism_ssl
EXPOSE 5672
EXPOSE 15672
HEALTHCHECK --interval=10s --timeout=5s --retries=12 CMD wget --spider http://localhost:15672/broker/
......@@ -34,16 +34,6 @@ server {
listen 80 default_server;
server_name _;
location /api/auth {
rewrite /api/auth/(.*) /$1 break;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://authentication;
proxy_read_timeout 90;
}
location /api/broker {
rewrite /api/broker/(.*) /api/$1 break;
proxy_set_header Host $host;
......@@ -91,6 +81,16 @@ server {
proxy_read_timeout 90;
}
location /api/auth {
rewrite /api/auth/(.*) /$1 break;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://authentication;
proxy_read_timeout 90;
}
location /retrieve {
rewrite /retrieve/(.*) /$1 break;
proxy_set_header Host $host;
......
......@@ -42,6 +42,8 @@ EXPOSE 9100
ENV BROKER_USERNAME="fda"
ENV BROKER_PASSWORD="fda"
ENV BROKER_LOGIN_URL="/broker/"
ENV KEYCLOAK_LOGIN_URL="/api/auth/"
ENV SHARED_FILESYSTEM="/tmp"
ENV LOGO="/logo.png"
ENV SEARCH_USERNAME="admin"
......
const config = {}
config.title = process.env.TITLE || 'Database Repository'
config.icon = process.env.ICON || '/favicon.ico'
config.brokerUsername = process.env.BROKER_USERNAME || 'fda'
config.brokerPassword = process.env.BROKER_PASSWORD || 'fda'
config.sharedFilesystem = process.env.SHARED_FILESYSTEM || '/tmp'
config.version = process.env.VERSION || 'latest'
config.logo = process.env.LOGO || '/logo.png'
config.tokenMax = process.env.TOKEN_MAX || 5
config.searchUsername = process.env.SEARCH_USERNAME || 'admin'
config.searchPassword = process.env.SEARCH_PASSWORD || 'admin'
config.clientId = process.env.DBREPO_CLIENT_ID || 'dbrepo-client'
config.clientSecret = process.env.DBREPO_CLIENT_SECRET || 'MUwRc7yfXSJwX8AdRMWaQC3Nep1VjwgG'
config.defaultPublisher = process.env.DEFAULT_PID_PUBLISHER || 'Example University'
config.doiUrl = process.env.DOI_URL || 'https://doi.org'
config.uploadPath = process.env.UPLOAD_PATH || '/tmp/'
config.title = process.env.TITLE || null
config.icon = process.env.ICON || null
config.brokerUsername = process.env.BROKER_USERNAME || null
config.brokerPassword = process.env.BROKER_PASSWORD || null
config.brokerLoginUrl = process.env.BROKER_LOGIN_URL || null
config.keycloakLoginUrl = process.env.KEYCLOAK_LOGIN_URL || null
config.sharedFilesystem = process.env.SHARED_FILESYSTEM || null
config.version = process.env.VERSION || null
config.logo = process.env.LOGO || null
config.tokenMax = process.env.TOKEN_MAX || null
config.searchUsername = process.env.SEARCH_USERNAME || null
config.searchPassword = process.env.SEARCH_PASSWORD || null
config.clientId = process.env.DBREPO_CLIENT_ID || null
config.clientSecret = process.env.DBREPO_CLIENT_SECRET || null
config.defaultPublisher = process.env.DEFAULT_PID_PUBLISHER || null
config.doiUrl = process.env.DOI_URL || null
config.uploadPath = process.env.UPLOAD_PATH || null
module.exports = config
......@@ -9,12 +9,8 @@
</div>
<v-list-item class="mt-2">
<v-list-item-content>
<v-list-item-subtitle>
{{ version }}
</v-list-item-subtitle>
<v-list-item-title class="text-h6">
Database Repository
</v-list-item-title>
<v-list-item-subtitle v-text="version" />
<v-list-item-title class="text-h6" v-text="title" />
</v-list-item-content>
</v-list-item>
<v-list nav>
......@@ -182,6 +178,9 @@ export default {
version () {
return this.$config.version
},
title () {
return this.$config.title
},
canListOntologies () {
if (!this.roles) {
return false
......@@ -310,6 +309,8 @@ export default {
this.$router.push({ path: '/search', query: { q: this.search } })
},
initEnvironment () {
this.$store.commit('SET_TITLE', this.$config.title)
this.$store.commit('SET_ICON', this.$config.icon)
this.$store.commit('SET_CLIENT_ID', this.$config.clientId)
this.$store.commit('SET_CLIENT_SECRET', this.$config.clientSecret)
this.$store.commit('SET_BROKER_USERNAME', this.$config.brokerUsername)
......@@ -317,6 +318,7 @@ export default {
this.$store.commit('SET_SEARCH_USERNAME', this.$config.searchUsername)
this.$store.commit('SET_SEARCH_PASSWORD', this.$config.searchPassword)
this.$store.commit('SET_UPLOAD_PATH', this.$config.uploadPath)
console.debug('runtime config', this.$config)
}
}
}
......
import path from 'path'
import colors from 'vuetify/es5/util/colors'
import { icon, clientSecret, title, logo, version, defaultPublisher, doiUrl, clientId, uploadPath, brokerUsername, brokerPassword, searchUsername, searchPassword } from './config'
import { icon, clientSecret, title, logo, version, defaultPublisher, doiUrl, clientId, uploadPath, brokerUsername, brokerPassword, searchUsername, searchPassword, brokerLoginUrl, keycloakLoginUrl } from './config'
const proxy = {}
......@@ -98,6 +98,7 @@ export default {
proxy,
publicRuntimeConfig: {
title,
version,
logo,
clientId,
......@@ -105,6 +106,8 @@ export default {
defaultPublisher,
brokerUsername,
brokerPassword,
brokerLoginUrl,
keycloakLoginUrl,
searchUsername,
searchPassword,
doiUrl,
......
......@@ -51,11 +51,19 @@
Login
</v-btn>
</v-card-actions>
<v-card-text class="text-right">
<a href="/api/auth/">Admin Login</a>
</v-card-text>
</v-card>
</v-form>
<v-toolbar v-if="!token" flat>
<v-spacer />
<v-toolbar-title>
<v-btn v-if="rabbitMqUrl" color="orange" plain :href="rabbitMqUrl">
<v-icon left>mdi-rabbit</v-icon> RabbitMQ
</v-btn>
<v-btn v-if="keycloakUrl" color="secondary" plain :href="keycloakUrl">
<v-icon left>mdi-key</v-icon> Keycloak
</v-btn>
</v-toolbar-title>
</v-toolbar>
</div>
</template>
......@@ -82,6 +90,12 @@ export default {
},
user () {
return this.$store.state.user
},
keycloakUrl () {
return this.$config.keycloakLoginUrl
},
rabbitMqUrl () {
return this.$config.brokerLoginUrl
}
},
mounted () {
......
dbrepo-ui/static/favicon_alt.ico

14.7 KiB

dbrepo-ui/static/favicon_alt.png

1.75 KiB

......@@ -11,6 +11,8 @@ Vue.use(Vuex)
// https://github.com/hua1995116/webchat/blob/7c6544d3defd41cb7cf68306accea97800858bc3/client/src/store/index.js#L293
const store = new Store({
state: {
title: null,
icon: null,
token: null,
refreshToken: null,
roles: [],
......@@ -30,6 +32,8 @@ const store = new Store({
uploadPath: null
},
getters: {
getTitle: state => state.title,
getIcon: state => state.icon,
getToken: state => state.token,
getRefreshToken: state => state.refreshToken,
getRoles: state => state.roles,
......@@ -49,6 +53,12 @@ const store = new Store({
getUploadPath: state => state.uploadPath
},
mutations: {
SET_TITLE (state, title) {
state.title = title
},
SET_ICON (state, icon) {
state.icon = icon
},
SET_TOKEN (state, token) {
state.token = token
},
......
#!/bin/bash
if [ `whoami` -neq "root" ]; then
echo "This script needs sudo privileges!"
exit 1
fi
docker info > /dev/null
if [ $? -ne 0 ]; then
echo "Docker is not installed (or accessible in bash) on your system:"
echo ""
echo " - install docker from https://docs.docker.com/desktop/install/linux-install/"
echo " - make sure the docker executable is in \$PATH"
exit 2
fi
echo "Gathering environment ..."
curl -sSL -o .env https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/dev/.env.unix.example
curl -sSL -o docker-compose.yml https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/dev/docker-compose.prod.yml
curl -sSL -o dbrepo.conf https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/master/dbrepo.conf
curl -sSL -o setup-schema_local.sql https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/dev/dbrepo-metadata-db/setup-schema_local.sql
echo "Pulling images ..."
docker compose pull
MAX_MAP_COUNT=$(cat /proc/sys/vm/max_map_count)
if [ "$MAX_MAP_COUNT" -lt 262144 ]; then
echo "Preparing environment ..."
echo "vm.max_map_count=262144" >> /etc/sysctl.conf
sysctl -p
fi
echo "Starting DBRepo ..."
docker compose up -d
if [ $? -eq 0 ]; then
echo "Successfully started. You can now inspect the logs with:"
echo ""
echo "docker compose logs -f"
fi
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment