forked from EVerest/everest-demo
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request EVerest#82 from US-JOET/simplify_demo_script
♻️ 🔥 🔒 🐛 Clean up the demo script before start the upgrade
- Loading branch information
Showing
12 changed files
with
219 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "No patches to apply" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "Build and run" | ||
|
||
echo "CitrineOS does not currently build due to issues with npm dependencies. It is disabled until we roll forward. Apologies for the inconvenience!" | ||
exit 1 | ||
|
||
pushd Server || exit 1 | ||
|
||
docker compose build | ||
if ! docker compose --project-name "${DEMO_CSMS}"-csms up -d --wait; then | ||
echo "Failed to start ${DEMO_CSMS}" | ||
exit 1 | ||
fi | ||
|
||
popd || exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env bash | ||
|
||
mkdir -p Server/data/certificates | ||
|
||
echo "Copying certs into ${DEMO_DIR}/citrineos-csms/Server/data/certificates" | ||
tar xf cached_certs_correct_name_emaid.tar.gz | ||
|
||
# Leaf key | ||
cp dist/etc/everest/certs/client/csms/CSMS_LEAF.key Server/data/certificates/leafKey.pem | ||
|
||
#Cert chain | ||
cat dist/etc/everest/certs/client/csms/CSMS_LEAF.pem \ | ||
dist/etc/everest/certs/ca/csms/CPO_SUB_CA2.pem \ | ||
dist/etc/everest/certs/ca/csms/CPO_SUB_CA1.pem \ | ||
> Server/data/certificates/certChain.pem | ||
|
||
# SubCA | ||
cp dist/etc/everest/certs/ca/csms/CPO_SUB_CA2.key Server/data/certificates/subCAKey.pem | ||
|
||
#TrustedSubCAChain | ||
cat dist/etc/everest/certs/ca/csms/CPO_SUB_CA2.pem \ | ||
dist/etc/everest/certs/ca/csms/CPO_SUB_CA1.pem \ | ||
> Server/data/certificates/rootCertificate.pem | ||
|
||
#Actual root cert | ||
cp dist/etc/everest/certs/ca/v2g/V2G_ROOT_CA.pem Server/data/certificates/root-V2G-cert.pem | ||
|
||
#ACME key | ||
cp ../everest-demo/citrineos/acme_account_key.pem Server/data/certificates/acme_account_key.pem | ||
|
||
echo "Validating that the certificates are set up correctly" | ||
openssl verify -show_chain \ | ||
-CAfile Server/data/certificates/root-V2G-cert.pem \ | ||
-untrusted Server/data/certificates/rootCertificate.pem \ | ||
Server/data/certificates/certChain.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "While running subscript, DEMO_VERSION is " $DEMO_VERSION | ||
|
||
if [[ "$DEMO_VERSION" =~ sp1 ]]; then | ||
echo "MaEVe CSMS started, adding charge station with Security Profile 1 (note: profiles in MaEVe start with 0 so SP-0 == OCPP SP-1)" | ||
curl http://localhost:9410/api/v0/cs/cp001 -H 'content-type: application/json' \ | ||
-d '{"securityProfile": 0, "base64SHA256Password": "3oGi4B5I+Y9iEkYtL7xvuUxrvGOXM/X2LQrsCwf/knA="}' | ||
elif [[ "$DEMO_VERSION" =~ sp2 ]]; then | ||
echo "MaEVe CSMS started, adding charge station with Security Profile 2 (note: profiles in MaEVe start with 0 so SP-1 == OCPP SP-2)" | ||
curl http://localhost:9410/api/v0/cs/cp001 -H 'content-type: application/json' \ | ||
-d '{"securityProfile": 1, "base64SHA256Password": "3oGi4B5I+Y9iEkYtL7xvuUxrvGOXM/X2LQrsCwf/knA="}' | ||
elif [[ "$DEMO_VERSION" =~ sp3 ]]; then | ||
echo "MaEVe CSMS started, adding charge station with Security Profile 3 (note: profiles in MaEVe start with 0 so SP-2 == OCPP SP-3)" | ||
curl http://localhost:9410/api/v0/cs/cp001 -H 'content-type: application/json' -d '{"securityProfile": 2}' | ||
fi | ||
|
||
echo "Charge station added, adding user token" | ||
|
||
curl http://localhost:9410/api/v0/token -H 'content-type: application/json' -d '{ | ||
"countryCode": "GB", | ||
"partyId": "TWK", | ||
"type": "RFID", | ||
"uid": "DEADBEEF", | ||
"contractId": "GBTWK012345678V", | ||
"issuer": "Thoughtworks", | ||
"valid": true, | ||
"cacheMode": "ALWAYS" | ||
}' | ||
|
||
curl http://localhost:9410/api/v0/token -H 'content-type: application/json' -d '{"countryCode": "UK", "partyId": "Switch", "contractId": "UKSWI123456789G", "uid": "UKSWI123456789G", "issuer": "Switch", "valid": true, "cacheMode": "ALWAYS"}' | ||
|
Oops, something went wrong.