-
Notifications
You must be signed in to change notification settings - Fork 7
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
Css 4587 backport generic fixes #965
Changes from all commits
ca6d495
5bcd936
2ed1141
c6e30d2
1d1b03c
41595eb
0c58c30
bd4cb61
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ tmp_dir = "tmp" | |
|
||
[log] | ||
time = false | ||
main_only = true | ||
|
||
[misc] | ||
clean_on_exit = false | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,15 +3,6 @@ | |
|
||
echo "Entrypoint being overriden for local environment." | ||
|
||
# Grab curl quickly. | ||
apt update | ||
apt install curl -y | ||
/root/candidsrv /etc/candid/config.yaml & | ||
|
||
# Pseudo readiness probe such that we can continue local dev setup. | ||
until eval curl --output /dev/null --silent --fail http://localhost:8081/debug/status; do | ||
printf '.' | ||
sleep 1 | ||
done | ||
echo "Server appears to have started." | ||
# If any further configuration to the IdP is required, it can now be done via this script. | ||
wait | ||
exec /root/candidsrv /etc/candid/config.yaml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This now ensures candid immediately exits when you kill the compose because the shell isn't running Candid as a background job. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah sounds good to me, what would be better is a proper compose healthcheck ideally though |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
# RUN THIS SCRIPT FROM PROJECT ROOT! | ||
# | ||
# This script adds a local controller to your compose JIMM instance. | ||
# Due to TLS SANs we need to modify JIMMs /etc/hosts to map to the SANs a controller certificate has. | ||
# | ||
# For completeness sake, the SANs are: DNS:anything, DNS:localhost, DNS:juju-apiserver, DNS:juju-mongodb | ||
# "juju-apiserver" feels most appropriate, so we use this. | ||
# | ||
# Requirements to run this script: | ||
# - yq (snap) | ||
set -eux | ||
|
||
JIMM_CONTROLLER_NAME="${JIMM_CONTROLLER_NAME:-jimm-dev}" | ||
CONTROLLER_NAME="${CONTROLLER_NAME:-qa-controller}" | ||
CONTROLLER_YAML_PATH="${CONTROLLER_NAME}".yaml | ||
CLIENT_CREDENTIAL_NAME="${CLIENT_CREDENTIAL_NAME:-localhost}" | ||
|
||
echo | ||
echo "JIMM controller name is: $JIMM_CONTROLLER_NAME" | ||
echo "Target controller name is: $CONTROLLER_NAME" | ||
echo "Target controller path is: $CONTROLLER_YAML_PATH" | ||
echo | ||
echo "Building jimmctl..." | ||
# Build jimmctl so we may add a controller. | ||
go build ./cmd/jimmctl | ||
echo "Built." | ||
echo | ||
echo "Switching juju controller to $JIMM_CONTROLLER_NAME" | ||
juju switch "$JIMM_CONTROLLER_NAME" | ||
echo | ||
echo "Retrieving controller info for $CONTROLLER_NAME" | ||
./jimmctl controller-info "$CONTROLLER_NAME" "$CONTROLLER_YAML_PATH" | ||
if [[ -f "$CONTROLLER_YAML_PATH" ]]; then | ||
echo "Controller info retrieved." | ||
else | ||
echo "Controller info couldn't be created, exiting..." | ||
exit 1 | ||
fi | ||
echo | ||
echo "Adding controller from path: $CONTROLLER_YAML_PATH" | ||
./jimmctl add-controller "$CONTROLLER_YAML_PATH" | ||
echo | ||
echo "Updating cloud credentials for: $JIMM_CONTROLLER_NAME, from client credential: $CLIENT_CREDENTIAL_NAME" | ||
juju update-credentials "$CLIENT_CREDENTIAL_NAME" --controller "$JIMM_CONTROLLER_NAME" |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a new script I added that automates the setup of the juju controller. We should bring these improvements to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice nice |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
# RUN THIS SCRIPT FROM PROJECT ROOT! | ||
# It will bootstrap a Juju controller and configure the necessary config to enable the controller | ||
# to communicate with the docker compose | ||
|
||
set -ux | ||
|
||
CONTROLLER_NAME="${CONTROLLER_NAME:-qa-controller}" | ||
|
||
echo "Bootstrapping controller" | ||
juju bootstrap localhost "${CONTROLLER_NAME}" --config allow-model-access=true --config identity-url=https://candid.localhost | ||
CONTROLLER_ID=$(juju show-controller --format json | jq --arg name "${CONTROLLER_NAME}" '.[$name]."controller-machines"."0"."instance-id"' | tr -d '"') | ||
echo "Adding proxy to LXC instance ${CONTROLLER_ID}" | ||
lxc config device add "${CONTROLLER_ID}" myproxy proxy listen=tcp:0.0.0.0:443 connect=tcp:127.0.0.1:443 bind=instance | ||
echo "Pushing local CA" | ||
lxc file push local/traefik/certs/ca.crt "${CONTROLLER_ID}"/usr/local/share/ca-certificates/ | ||
lxc exec "${CONTROLLER_ID}" -- update-ca-certificates | ||
echo "Restarting controller" | ||
lxc stop "${CONTROLLER_ID}" | ||
lxc start "${CONTROLLER_ID}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this because it felt unnecessary to show in the readme and just made it longer and harder to scan for the section you need.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah fair, it was a bit too "full" i agree