fix: install updater alongside startup script
Download the update helper during install and expose it from the cloud server so new hosts can run manual updates immediately.
This commit is contained in:
@@ -50,7 +50,9 @@ const audioStationDir = path.join(audioRootDir, 'station');
|
||||
const listFilePath = path.join(appRootDir, 'list.txt');
|
||||
const tempBroadcastDir = path.join(appRootDir, 'temp-broadcast');
|
||||
const stationScriptPath = path.join(appRootDir, 'station_broadcast.lua');
|
||||
const stationUpdateScriptPath = path.join(appRootDir, 'update_station_broadcast.lua');
|
||||
const STATION_SCRIPT_DOWNLOAD_PATH = '/downloads/station_broadcast.lua';
|
||||
const STATION_UPDATE_SCRIPT_DOWNLOAD_PATH = '/downloads/update_station_broadcast.lua';
|
||||
const STREAMABLE_AUDIO_EXTENSIONS = ['.wav', '.mp3', '.ogg', '.flac', '.m4a', '.aac', '.opus'];
|
||||
const MUSIC_AUDIO_EXTENSIONS = [...STREAMABLE_AUDIO_EXTENSIONS, '.dfpwm'];
|
||||
|
||||
@@ -2190,6 +2192,13 @@ app.get(STATION_SCRIPT_DOWNLOAD_PATH, (req, res) => {
|
||||
return res.sendFile(stationScriptPath);
|
||||
});
|
||||
|
||||
app.get(STATION_UPDATE_SCRIPT_DOWNLOAD_PATH, (req, res) => {
|
||||
if (!fs.existsSync(stationUpdateScriptPath)) {
|
||||
return res.status(404).send('update_station_broadcast.lua not found');
|
||||
}
|
||||
return res.sendFile(stationUpdateScriptPath);
|
||||
});
|
||||
|
||||
app.get('/api/streams', (req, res) => {
|
||||
const streams = [];
|
||||
const seen = new Set();
|
||||
|
||||
Reference in New Issue
Block a user