Skip to content

Commit

Permalink
Add Force New Config
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Oct 30, 2024
1 parent eee9752 commit cc325b5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cloudformation/lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ const Resources = {
Environment: [
{ Name: 'StackName', Value: cf.stackName },
{ Name: 'MANAGEMENT_PASSWORD', Value: cf.sub('{{resolve:secretsmanager:${AWS::StackName}/api/secret:SecretString::AWSCURRENT}}') },
{ Name: 'FORCE_NEW_CONFIG', Value: cf.ref('ForceNewConfig') },
{ Name: 'AWS_DEFAULT_REGION', Value: cf.region }
],
LogConfiguration: {
Expand Down Expand Up @@ -384,6 +385,12 @@ export default cf.merge({
AllowedValues: ['true', 'false'],
Default: 'false'
},
ForceNewConfig: {
Description: 'Force a blank config file - permanently deleting current config',
Type: 'String',
AllowedValues: ['true', 'false'],
Default: 'false'
},
SSLCertificateIdentifier: {
Description: 'ACM SSL Certificate for HTTP Protocol',
Type: 'String'
Expand Down
4 changes: 4 additions & 0 deletions start
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ set -euo pipefail
echo "Contents:"
ls /opt/mediamtx/

if [[ ${FORCE_NEW_CONFIG} == "true" ]]; then
rm /opt/mediamtx/mediamtx.yml || true
fi

# Copy EFS Persisted certs to Let's Encrypt Dir
if [ ! -f "/opt/mediamtx/mediamtx.yml" ]; then
echo "NO CONFIG FOUND"
Expand Down

0 comments on commit cc325b5

Please sign in to comment.