Compare commits

..

No commits in common. "master" and "wip" have entirely different histories.
master ... wip

3 changed files with 14 additions and 23 deletions

View File

@ -5,9 +5,9 @@ name: default
steps:
- name: backend
image: harbor.k-space.ee/k-space/drone-kaniko
image: plugins/docker
settings:
repo: ${DRONE_REPO}
repo: harbor.k-space.ee/${DRONE_REPO}
registry: harbor.k-space.ee
context: backend/
dockerfile: backend/Dockerfile
@ -16,9 +16,9 @@ steps:
password:
from_secret: docker_password
- name: frontend
image: harbor.k-space.ee/k-space/drone-kaniko
image: plugins/docker
settings:
repo: ${DRONE_REPO}-frontend
repo: harbor.k-space.ee/${DRONE_REPO}-frontend
registry: harbor.k-space.ee
context: frontend/
dockerfile: frontend/Dockerfile

View File

@ -8,12 +8,8 @@ const mongoCollection = process.env.MONGO_COLLECTION || 'eventlog';
const mongoUri = process.env.MONGO_URI || 'mongodb://127.0.0.1:27017/default?replicaSet=rs0';
// Minio set-up variables
const minioAccessKey = process.env.MINIO_ACCESS_KEY || 'kspace-mugshot';
const minioSecretKey = process.env.MINIO_SECRET_KEY || '2mSI6HdbJ8';
const minioHostname = process.env.MINIO_HOSTNAME || '127.0.0.1';
const minioPort = process.env.MINIO_PORT || 9000;
const minioScheme = process.env.MINIO_SCHEME || 'http';
const minioBucket = process.env.MINIO_BUCKET || 'kspace-mugshot';
const minioURI = new URL(process.env.MINIO_URI || 'http://kspace-mugshot:2mSI6HdbJ8@127.0.0.1:9000/kspace-mugshot');
const minioBucket = minioURI.pathname.substring(1);
console.info("Using bucket:", minioBucket);
const historyNumber = parseInt(process.env.HISTORY_AMOUNT) || 10;
@ -38,18 +34,15 @@ async function run() {
changeStream = collection.watch(pipeline, options);
console.log("Started watching changes in database");
console.log("Minio hostname:", minioHostname);
console.log("Minio port:", minioPort);
console.log("Minio protocol:", minioScheme);
// Triggers on GET at /event route
app.get('/events', async function (request, response) {
let minioClient = new minio.Client({
endPoint: minioHostname,
port: parseInt(minioPort),
useSSL: minioScheme == 'https',
accessKey: minioAccessKey,
secretKey: minioSecretKey
endPoint: minioURI.hostname,
port: parseInt(minioURI.port) || (minioURI.protocol == 'https:' ? 443 : 80),
useSSL: minioURI.protocol == 'https:',
accessKey: minioURI.username,
secretKey: minioURI.password
});
async function wrapEvent(doc) {

View File

@ -9,8 +9,8 @@ x-common: &common
ME_CONFIG_MONGODB_ENABLE_ADMIN: 'true'
ME_CONFIG_MONGODB_SERVER: '127.0.0.1'
ME_CONFIG_MONGODB_AUTH_DATABASE: admin
MINIO_ROOT_USER: kspace-mugshot
MINIO_ROOT_PASSWORD: 2mSI6HdbJ8
MINIO_ACCESS_KEY: kspace-mugshot
MINIO_SECRET_KEY: 2mSI6HdbJ8
MINIO_DEFAULT_BUCKETS: kspace-mugshot:download
MINIO_URI: 'http://kspace-mugshot:2mSI6HdbJ8@127.0.0.1:9000/kspace-mugshot'
@ -28,8 +28,6 @@ services:
volumes:
- ./mongo-init.sh:/docker-entrypoint-initdb.d/mongo-init.sh:ro
command: mongod --replSet rs0 --bind_ip 127.0.0.1
logging:
driver: none
node-server:
restart: always
@ -37,7 +35,7 @@ services:
build:
context: ./backend
environment: *common
nginx-react:
restart: always
network_mode: host