Skip to content

Commit

Permalink
Fix encryption values
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Oct 31, 2024
1 parent fdf1d2d commit 6df84b5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions persist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,21 @@ cron.schedule('0,10,20,30,40,50 * * * * *', async () => {
const base = await globalConfig();
const paths = await globalPaths();

base.paths = paths;
base.paths = {};

const config = YAML.stringify(base, (key, value) => {
if (typeof value === 'boolean') {
if (['encryption', 'rtmpEncryption'].includes(key)) {
return `"${value}"`
} else if (typeof value === 'boolean') {
return value === true ? 'yes' : 'no'
} else {
return value
}
})

console.log('PATHS', paths);
console.log(config);

await fs.writeFile('/opt/mediamtx/mediamtx.yml', config);
} catch (err) {
console.error(err);
Expand Down

0 comments on commit 6df84b5

Please sign in to comment.