Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge upstream - #2 #416

Merged
merged 23 commits into from
Jul 24, 2020
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0d021ed
Improve recent and favourites display (#4421)
nwmac Jul 9, 2020
73ce075
Add line-height to favourite and recent entity labels (#4438)
richard-cox Jul 9, 2020
6baf89f
Autoscaler e2e tests: Give better failure error when the test can't f…
nwmac Jul 10, 2020
05b2b1a
Helm Chart: Remove encryption key volume (#4355)
nwmac Jul 10, 2020
53f6ca5
Improve the logout experience (#4439)
nwmac Jul 10, 2020
eb211ce
Add request for version info to github issues template (#4443)
richard-cox Jul 10, 2020
6c66209
Merge downstream (#4441)
richard-cox Jul 20, 2020
4a27727
Show all favorites for an endpoint favorite if there is only one (#4440)
nwmac Jul 20, 2020
6199434
Merge downstream - JSON Viewer with dark mode & Header Fixes (#4444)
richard-cox Jul 20, 2020
a82e5d9
Fix issues with tests not running if build upload fails (#4453)
nwmac Jul 21, 2020
d6398ea
Merge remote-tracking branch 'upstream/master' into merge-upstream
richard-cox Jul 21, 2020
568f638
Improve autoscaler e2e logging (#4456)
richard-cox Jul 21, 2020
0016843
Fix check-e2e-pr.sh for pr's from other repos (#4459)
richard-cox Jul 21, 2020
a081975
Convert Client Secret Input Fields to `password` (#4455)
richard-cox Jul 21, 2020
a8a4d79
Insecure tlsv10 and tlsv11 ciphers in Stratos UI, bsc#1173295 (#411) …
richard-cox Jul 21, 2020
7a7c7fd
[Security] Bump codecov from 3.7.0 to 3.7.1 (#4457)
dependabot-preview[bot] Jul 21, 2020
a4dfca3
Bump lodash from 4.17.15 to 4.17.19 (#4452)
dependabot[bot] Jul 21, 2020
e19ae6c
Convert scripts to nodejs so they work on Windows (#4462)
nwmac Jul 23, 2020
67c6d75
Shorten file paths containing `cloudfoundry`/`cloud-foundry` (#4466)
richard-cox Jul 23, 2020
88b44cc
Fix log out page when there's a custom log in page
richard-cox Jul 23, 2020
2c538db
Fix log out page given previous commit changes
richard-cox Jul 23, 2020
40f3bd1
Merge remote-tracking branch 'upstream/master' into merge-upstream
richard-cox Jul 23, 2020
5a1b1f3
Merge remote-tracking branch 'origin/master' into merge-upstream2
nwmac Jul 24, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
40 changes: 40 additions & 0 deletions build/clean-symlinks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Clean any symlinks from a pre 4.0 Stratos
// These are no longer used for customization and need to be removed

// Implemented as a single script here so that it works on Windows, Linux and Mac

const path = require('path');
const fs = require('fs');

// __dirname is the folder where build.js is located
const STRATOS_DIR= path.resolve(__dirname, '..');

function processFile(filepath) {
if (fs.existsSync(filepath)) {
const stats = fs.lstatSync(filepath);
if (stats.isSymbolicLink()) {
console.log(`Removing symlink ${filepath}`);
fs.unlinkSync(filepath);
}
}
}

function processFolder(dir) {
if (!fs.existsSync(dir)) {
return
}
fs.readdirSync(dir).forEach( f => {
let dirPath = path.join(dir, f);
const realPath = fs.realpathSync(dirPath);
const stats = fs.lstatSync(realPath);
if (stats.isDirectory()) {
processFolder(dirPath);
} else {
processFile(dirPath);
}
});
};

processFolder(path.join(STRATOS_DIR, 'src', 'frontend', 'packages', 'core', 'sass'));
processFolder(path.join(STRATOS_DIR, 'src', 'frontend', 'packages', 'core', 'assets'));
processFile(path.join(STRATOS_DIR, 'src', 'frontend', 'packages', 'core', 'favicon.ico'));
28 changes: 0 additions & 28 deletions build/clean-symlinks.sh

This file was deleted.

30 changes: 30 additions & 0 deletions build/dev-setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copy files required for developer quick start
// Implemented as a single script here so that it works on Windows, Linux and Mac

const path = require('path');
const fs = require('fs');

// __dirname is the folder where build.js is located
const STRATOS_DIR= path.resolve(__dirname, '..');

// Only copy files if they are not already there - just make sure initial versions are in place for developer

// Proxy config file
const PROXY_CONF = path.join(STRATOS_DIR, 'proxy.conf.js');
if (!fs.existsSync(PROXY_CONF)) {
let err = fs.copyFileSync(path.join(__dirname, 'proxy.conf.localdev.js'), PROXY_CONF);
if (err) {
console.log(err);
}
}

// config.properties
const BACKEND_DIR = path.join(STRATOS_DIR, 'src', 'jetstream');
const BACKEND_CONF = path.join(BACKEND_DIR, 'config.properties');
const BACKEND_CONF_DEV = path.join(BACKEND_DIR, 'config.dev');
if (!fs.existsSync(BACKEND_CONF)) {
let err = fs.copyFileSync(BACKEND_CONF_DEV, BACKEND_CONF);
if (err) {
console.log(err);
}
}
82 changes: 0 additions & 82 deletions build/fe-build.js

This file was deleted.

14 changes: 0 additions & 14 deletions build/gulp.config.js

This file was deleted.

16 changes: 16 additions & 0 deletions build/prebuild-zip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Zip the dist folder
// Implemented as a single script here so that it works on Windows, Linux and Mac

const path = require('path');
const fs = require('fs');
const AdmZip = require('adm-zip');

// __dirname is the folder where build.js is located
const STRATOS_DIR= path.resolve(__dirname, '..');
const DIST_DIR= path.join(STRATOS_DIR, 'dist');
const ZIP_FILE= path.join(STRATOS_DIR, 'stratos-frontend-prebuild.zip');

var zip = new AdmZip();

zip.addLocalFolder(DIST_DIR);
zip.writeZip(path.join(ZIP_FILE));
38 changes: 38 additions & 0 deletions build/store-git-metadata.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Generate the git metadata file

// Implemented as a single script here so that it works on Windows, Linux and Mac

const path = require('path');
const fs = require('fs');
const execSync = require('child_process').execSync;

// __dirname is the folder where build.js is located
const STRATOS_DIR = path.resolve(__dirname, '..');
const GIT_FOLDER = path.join(STRATOS_DIR, '.git');
const GIT_METADATA = path.join(STRATOS_DIR, '.stratos-git-metadata.json');

function execGit(cmd) {
try {
var response = execSync(cmd);
return response.toString().trim();
} catch (e) {
console.log(e)
return '';
}
}

// We can only do this if we have a git repository checkout
// We'll store this in a file which we will then use - when in environments like Docker, we will run this
// in the host environment so that we can pick it up when we're running in the Docker world
// Do we have a git folder?
if (!fs.existsSync(GIT_FOLDER)) {
console.log(' + Unable to store git repository metadata - .git folder not found');
return;
}
var gitMetadata = {
project: execGit('git config --get remote.origin.url'),
branch: execGit('git rev-parse --abbrev-ref HEAD'),
commit: execGit('git rev-parse HEAD')
};

fs.writeFileSync(GIT_METADATA, JSON.stringify(gitMetadata, null, 2));
4 changes: 2 additions & 2 deletions deploy/ci/travis/check-e2e-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

if [ -n "${TRAVIS_PULL_REQUEST}" ]; then
if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
echo "Checking labels on ${TRAVIS_PULL_REQUEST_SLUG} #${TRAVIS_PULL_REQUEST}"
LABEL=$(curl -s "https://api.github.com/repos/${TRAVIS_PULL_REQUEST_SLUG}/pulls/${TRAVIS_PULL_REQUEST}" | jq -r '.labels[] | select(.name == "e2e-debug") | .name')
echo "Checking labels on ${TRAVIS_REPO_SLUG} #${TRAVIS_PULL_REQUEST}"
LABEL=$(curl -s "https://api.github.com/repos/${TRAVIS_REPO_SLUG}/pulls/${TRAVIS_PULL_REQUEST}" | jq -r '.labels[] | select(.name == "e2e-debug") | .name')
if [ "${LABEL}" == "e2e-debug" ]; then
echo "PR has the 'e2e-debug' label - enabling debug logging for E2E tests"
export STRATOS_E2E_DEBUG=true
Expand Down
19 changes: 11 additions & 8 deletions deploy/ci/travis/e2e-build-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function tryGetExistingBuild() {
fi
}

# Need S3 endpoint - if we don't have it, we don't have the Travis env vars
if [ -n "${AWS_ENDPOINT}" ]; then
tryGetExistingBuild
fi
Expand All @@ -68,14 +69,16 @@ else
npm run build
npm run build-backend

set +e
tar cvfz ${GZIP_NAME} dist/* src/jetstream/jetstream
# Only try to upload if we have the S3 configuration
if [ -n "${AWS_ENDPOINT}" ]; then
set +e
tar cvfz ${GZIP_NAME} dist/* src/jetstream/jetstream

# Upload
mc cp -q --insecure ${GZIP_NAME} ${MC_HOST}/${S3_BUILDS_BUCKET}

# Ignore error from uploading - should not fail build if we can't upload the build archive
# This just means we won't be able to us this cache next build
exit 0
# Upload
mc cp -q --insecure ${GZIP_NAME} ${MC_HOST}/${S3_BUILDS_BUCKET}

# Ignore error from uploading - should not fail build if we can't upload the build archive
# This just means we won't be able to us this cache next build
echo "Uploaded builds"
fi
fi
3 changes: 2 additions & 1 deletion deploy/ci/travis/e2e-mc-helper.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Helper for mc command

mc version > /dev/null
# Check if mc command is available (don't log error if it is not)
mc version > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "mc command already installed and confgiured"
else
Expand Down
30 changes: 3 additions & 27 deletions deploy/containers/config-init/config-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ echo "RELEASE_NAME : ${RELEASE_NAME}"
echo "RELEASE_REVISION : ${RELEASE_REVISION}"
echo "IS_UPGRADE : ${IS_UPGRADE}"
echo "CONSOLE_TLS_SECRET_NAME : ${CONSOLE_TLS_SECRET_NAME}"
echo "ENCRYPTION_KEY_VOLUME : ${ENCRYPTION_KEY_VOLUME}"
echo "ENCRYPTION_KEY_FILENAME : ${ENCRYPTION_KEY_FILENAME}"
echo "CONSOLE_PROXY_CERT_PATH : ${CONSOLE_PROXY_CERT_PATH}"
echo "CONSOLE_PROXY_CERT_KEY_PATH : ${CONSOLE_PROXY_CERT_KEY_PATH}"
echo ""
echo "============================================"
echo ""
Expand Down Expand Up @@ -44,15 +40,6 @@ EOF
}

function generateCert {
if [ -n "${CONSOLE_PROXY_CERT_PATH}" ] && [ -n "${CONSOLE_PROXY_CERT_KEY_PATH}" ]; then
if [ -f "${CONSOLE_PROXY_CERT_PATH}" ] && [ -f "${CONSOLE_PROXY_CERT_KEY_PATH}" ]; then
echo "Found existing certificate on encryption key volume - going to use it"
CERT_CRT=$(cat ${CONSOLE_PROXY_CERT_PATH} | base64 -w 0)
CERT_KEY=$(cat ${CONSOLE_PROXY_CERT_KEY_PATH} | base64 -w 0)
return
fi
fi

echo "Using cert generator to generate a self-signed certificate ..."
export CERTS_PATH=./certs
export DEV_CERTS_DOMAIN=tls
Expand Down Expand Up @@ -97,20 +84,9 @@ if [ $EXISTS -eq 0 ]; then
else
echo "Fresh installation - generating a new Encryption Key secret"

# Migrate existing key from the legacy encryption key volume if there is one
if [ ${ENCRYPTION_KEY_VOLUME} -a ${ENCRYPTION_KEY_FILENAME} ]; then
ekFile="${ENCRYPTION_KEY_VOLUME}/${ENCRYPTION_KEY_FILENAME}"
if [ -f "${ekFile}" ]; then
echo "Found encryption key file on the legacy encryption key volume"
KEY=$(cat ${ekFile} | base64 -w 0)
fi
fi

if [ -z $KEY ]; then
# Generate a random encryption key
echo "Generating a new Encryption Key ..."
KEY=$(openssl enc -aes-256-cbc -k secret -P -md sha1 | grep key | cut -d '=' -f2 | base64 -w 0)
fi
# Generate a random encryption key
echo "Generating a new Encryption Key ..."
KEY=$(openssl enc -aes-256-cbc -k secret -P -md sha1 | grep key | cut -d '=' -f2 | base64 -w 0)

# We will create a new secret for the encryption key
cat << EOF > create-key-secret.yaml
Expand Down
16 changes: 0 additions & 16 deletions deploy/kubernetes/console/templates/config-init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,26 +118,14 @@ spec:
value: "{{ .Chart.AppVersion }}"
- name: "HELM_CHART"
value: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
- name: ENCRYPTION_KEY_VOLUME
value: "/{{ .Release.Name }}-encryption-key-volume"
- name: ENCRYPTION_KEY_FILENAME
value: key
- name: CONSOLE_TLS_SECRET_NAME
value: "{{ default "" .Values.console.tlsSecretName }}"
- name: CONSOLE_PROXY_CERT_PATH
value: "/{{ .Release.Name }}-encryption-key-volume/console.crt"
- name: CONSOLE_PROXY_CERT_KEY_PATH
value: "/{{ .Release.Name }}-encryption-key-volume/console.key"
image: {{.Values.kube.registry.hostname}}/{{.Values.kube.organization}}/{{default "stratos-config-init" .Values.images.configInit}}:{{.Values.consoleVersion}}
command: ["/config-init.sh"]
imagePullPolicy: {{.Values.imagePullPolicy}}
livenessProbe: ~
name: "config-init"
readinessProbe: ~
volumeMounts:
- mountPath: "/{{ .Release.Name }}-encryption-key-volume"
name: "{{ .Release.Name }}-encryption-key-volume"
readOnly: true
{{- if and .Values.kube.registry.username .Values.kube.registry.password }}
imagePullSecrets:
- name: {{.Values.dockerRegistrySecret}}
Expand All @@ -147,10 +135,6 @@ spec:
serviceAccountName: "config-init"
{{- end }}
terminationGracePeriodSeconds: 600
volumes:
- name: "{{ .Release.Name }}-encryption-key-volume"
persistentVolumeClaim:
claimName: "{{ .Release.Name }}-encryption-key-volume"
---
{{- if .Values.autoCleanup }}
# Cleanup job will delete the created secret when the release is deleted
Expand Down
Loading