From ea3b2d6a2ef6f0aca9a5fb605f39701ab9ea0ed1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Oct 2023 21:21:14 +0000 Subject: [PATCH 1/7] Bump postcss from 8.4.14 to 8.4.31 Bumps [postcss](https://github.com/postcss/postcss) from 8.4.14 to 8.4.31. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss/compare/8.4.14...8.4.31) --- updated-dependencies: - dependency-name: postcss dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5b7427d..aa85f4c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1863,9 +1863,15 @@ "integrity": "sha512-Wm2/nFOm2y9HtJfgOLnctGbfvF23FcQZeyUZqDD8JQG3zO5kXh3MkQKiUaA68mJiVWrOzLFkAV1u6bC8P52DJA==" }, "node_modules/nanoid": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", - "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", + "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -2085,9 +2091,9 @@ } }, "node_modules/postcss": { - "version": "8.4.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz", - "integrity": "sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "funding": [ { "type": "opencollective", @@ -2096,10 +2102,14 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { - "nanoid": "^3.3.4", + "nanoid": "^3.3.6", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" }, @@ -4420,9 +4430,9 @@ "integrity": "sha512-Wm2/nFOm2y9HtJfgOLnctGbfvF23FcQZeyUZqDD8JQG3zO5kXh3MkQKiUaA68mJiVWrOzLFkAV1u6bC8P52DJA==" }, "nanoid": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", - "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==" + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", + "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==" }, "negotiator": { "version": "0.6.3", @@ -4579,11 +4589,11 @@ "integrity": "sha512-UfDtlscNialXfmVEwEPm0t/5qtM0xPK025eYWd/ilv89hxLIhVQmt3QIzMHincLO2MBtZyww0386pt13J4aIhQ==" }, "postcss": { - "version": "8.4.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz", - "integrity": "sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "requires": { - "nanoid": "^3.3.4", + "nanoid": "^3.3.6", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" } From f1ec9cd3e934b1bb0f28c33463f5c68051d4d4b1 Mon Sep 17 00:00:00 2001 From: Lucas Date: Mon, 6 Nov 2023 23:46:45 +0100 Subject: [PATCH 2/7] Update README.md to include default credentials --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a0b6910..368e702 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ Server code to manage piSignage players in a LAN or Private Network or to setup just get the file https://raw.githubusercontent.com/colloqi/pisignage-server/master/docker-compose.yml - docker-compose up -d - Use the url http://localhost:3000 to launch web application +- Default credentials: Username:Passwword = `pi:pi` - To generate your own Docker image, please goto docker-build branch and modify Dockerfile. Also use docker-compose.prod.yml From 8339130078dd1aee031f0e766fa5e3eec33d671f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 11 Nov 2023 10:35:13 +0000 Subject: [PATCH 3/7] Bump axios from 1.3.3 to 1.6.0 Bumps [axios](https://github.com/axios/axios) from 1.3.3 to 1.6.0. - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) - [Commits](https://github.com/axios/axios/compare/v1.3.3...v1.6.0) --- updated-dependencies: - dependency-name: axios dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index aa85f4c..fe9f5b8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "919.socket.io": "https://github.com/colloqi/socket.io.git#0.9.x", "async": "^3.2.3", "atob": ">=2.1.0", - "axios": "^1.3.3", + "axios": "^1.6.0", "body-parser": "^1.18.3", "bson": ">=4.6.5", "cookie-parser": "~1.4.3", @@ -256,9 +256,9 @@ } }, "node_modules/axios": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.3.3.tgz", - "integrity": "sha512-eYq77dYIFS77AQlhzEL937yUBSepBfPIe8FcgEDN35vMNZKMrs81pgnyrQpwfy4NF4b4XWX1Zgx7yX+25w8QJA==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.0.tgz", + "integrity": "sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg==", "dependencies": { "follow-redirects": "^1.15.0", "form-data": "^4.0.0", @@ -3231,9 +3231,9 @@ "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" }, "axios": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.3.3.tgz", - "integrity": "sha512-eYq77dYIFS77AQlhzEL937yUBSepBfPIe8FcgEDN35vMNZKMrs81pgnyrQpwfy4NF4b4XWX1Zgx7yX+25w8QJA==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.0.tgz", + "integrity": "sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg==", "requires": { "follow-redirects": "^1.15.0", "form-data": "^4.0.0", diff --git a/package.json b/package.json index 9adba19..2fe5b19 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "919.socket.io": "https://github.com/colloqi/socket.io.git#0.9.x", "async": "^3.2.3", "atob": ">=2.1.0", - "axios": "^1.3.3", + "axios": "^1.6.0", "body-parser": "^1.18.3", "bson": ">=4.6.5", "cookie-parser": "~1.4.3", From 59d9fb6b238c00a2ba6d166cd58c444f738416bf Mon Sep 17 00:00:00 2001 From: Ravi Bail Date: Thu, 7 Dec 2023 16:33:32 +0530 Subject: [PATCH 4/7] Adding system_notice file to playlist selection --- public/app/js/services/assets.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/app/js/services/assets.js b/public/app/js/services/assets.js index d6428df..f821f2d 100644 --- a/public/app/js/services/assets.js +++ b/public/app/js/services/assets.js @@ -165,7 +165,10 @@ angular.module('piAssets.services', []) $http.get(piUrls.files, {}) .success(function (data, status) { if (data.success) { - assetLoader.asset.files = data.data.files; + assetLoader.asset.files = data.data.files || []; + if (data.data.systemAssets) { + assetLoader.asset.files = assetLoader.asset.files.concat(data.data.systemAssets) + } if (data.data.dbdata) { assetLoader.asset.filesDetails = {}; data.data.dbdata.forEach(function (dbdata) { From 412644350ac2c553e3952df2617e0c37c105035f Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Thu, 4 Jan 2024 18:29:39 +0100 Subject: [PATCH 5/7] Clean up README Fixed some typos and formatting --- README.md | 143 +++++++++++++++++++++++++++--------------------------- 1 file changed, 71 insertions(+), 72 deletions(-) diff --git a/README.md b/README.md index 368e702..5cee0a8 100644 --- a/README.md +++ b/README.md @@ -2,26 +2,26 @@ Server code to manage piSignage players in a LAN or Private Network or to setup your own server! - run npm install command after git pull and before starting the server +Run the `npm install` command after `git pull` and before starting the server ## Docker image available - beta - Install docker from https://docs.docker.com/get-docker/ -- Install git if needed & issue `git clone https://github.com/colloqi/pisignage-server` - - OR - +- Install git if needed & issue `git clone https://github.com/colloqi/pisignage-server` + + OR + just get the file https://raw.githubusercontent.com/colloqi/pisignage-server/master/docker-compose.yml -- docker-compose up -d +- `docker compose up -d` - Use the url http://localhost:3000 to launch web application -- Default credentials: Username:Passwword = `pi:pi` -- To generate your own Docker image, please goto docker-build branch and modify Dockerfile. Also use docker-compose.prod.yml +- Default credentials: Username:Password = `pi:pi` +- To generate your own Docker image, please goto docker-build branch and modify Dockerfile. Also use `docker-compose.prod.yml` #### Changes to Docker application from server code (it is built in docker-build brnach and you could watch the different as well Dockerfile there) 1. media and data dir are docker volumes (instead of ../media and ./data) 2. in config/end/production.js: https is false and port is 3000, db is changed to pisignage-server-dev for compatibility and mongo network is changed from 127.0.0.1 to mongo) -## Recommended Server configuration +## Recommended Server configuration - Intel CPU based VM or server - 2GB minimum memory - 30GB+ SSD or hard disk @@ -35,7 +35,7 @@ Server code to manage piSignage players in a LAN or Private Network or to setup 3. Apply your code changes if any 4. rm package-lock.json 5. rm -rf node_modules (entire directory and its contents) -6. Do "npm install" +6. Do "npm install" 7. Start the pisignage-server and go to url localhost:3000 8. Enter the username of yours at pisignage.com (not the email ID) (or change under settings, otherwise player license will not be enabled) 9. Default authentication credentials for player webUI has been changed to pi:pi @@ -47,53 +47,52 @@ Server code to manage piSignage players in a LAN or Private Network or to setup ## Getting Started - Note: Instructions may change, please refer to the respective package/OS websites for the latest, + Note: Instructions may change, please refer to the respective package/OS websites for the latest, Write to us at support@pisignage.com for help. 1. Install mongodb - open-source document database - Refer mongodb install guides to install mongodb. + Refer mongodb install guides to install mongodb. - Windows: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/ - Linux: https://docs.mongodb.com/manual/administration/install-on-linux/ - - Mac OS X: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/ - + - Mac OS X: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/ + 2. Install node.js and npm - open source server framework https://nodejs.org/en/download/package-manager/ - + 3. Install ffmpeg - video converter https://www.ffmpeg.org/download.html - 4. Install imagemagick - tool for image edit, conversion https://www.imagemagick.org/script/download.php - + 5. Install Git - distributed version control system https://git-scm.com/downloads -5. Clone this reporsitory and run follwing commands +5. Clone this repository and run the following commands - - git clone https://github.com/colloqi/pisignage-server + - git clone https://github.com/colloqi/pisignage-server - mkdir media - mkdir media/_thumbnails - cd pisignage-server - npm install - + 6. Currently network port is configured as 3000 in local server. Modify in the file `config/env/development.js` for the port 7. Run node server with `node server.js` 8. Open Chrome browser and check at [http://localhost:3000](http://localhost:3000) **OR** `http://[your-ip]:3000` (ex: 192.168.1.30:3000, 10.50.16.110:3000) -9. Do the following configuration before you start - - Under settings, configure the username to be same as that of your signin username at pisignage.com (it is **not** your email id) - - Download the license files either from email or from pisignage.com, upload them to your local server under settings - - You can upgrade your players directly from your local server +9. Do the following configuration before you start + - Under settings, configure the username to be same as that of your signin username at pisignage.com (it is **not** your email id) + - Download the license files either from email or from pisignage.com, upload them to your local server under settings + - You can upgrade your players directly from your local server - authentication is pi & pi, you can change this under settings **NOTE:** Please make sure **mongod** process is running and **/data/db** owenership is changed to regular user. If not use, ``` sudo chown -R your-username:user-group /data``` @@ -103,65 +102,65 @@ Server code to manage piSignage players in a LAN or Private Network or to setup 1. Download the pisignage player software and prepare SD card as per [instructions](https://github.com/colloqi/piSignage#method-1-download-image-and-prepare-the-sd-card) -2. After player boots, configure admin and media server to your local address and port using one of the below methods +2. After player boots, configure admin and media server to your local address and port using one of the below methods a. Using the webUI of the player at http://[player IP]:8000/settings - - b. Connect Keyboard and press Ctrl-N or F6 - * Change config and media server to `http://[your server ip]:port` (ex: 192.168.1.30:3000, 10.50.16.110:3000) - * Open terminal `ctrl+Alt+ t` and delete any existing _config.json and _settings.json file from `/home/pi/piSignagePro/config` directory - + + b. Connect Keyboard and press Ctrl-N or F6 + * Change config and media server to `http://[your server ip]:port` (ex: 192.168.1.30:3000, 10.50.16.110:3000) + * Open terminal `ctrl+Alt+ t` and delete any existing _config.json and _settings.json file from `/home/pi/piSignagePro/config` directory + c. Connect through ssh - * Edit `/home/pi/piSignagePro/package.json` for admin and media server configuration - * delete any existing _config.json and _settings.json file from `/home/pi/piSignagePro/config` directory - -## Features - -1. Player management - - Auto discovery of players in a network - - Monitor Players - -2. Group management - create groups and assign players to groups - - Display settings - 1080p/720p and landscape or portrait mode - - Deploy default playlist, scheduled playlists and advt playlist - - Assign Players to Groups - -3. Assets Management - - Upload assets (video,mp3,html/zip,images, links, google calendar feed) - - Videos are automatically converted to mp4 using ffmpeg - - Thumbnail creation for videos and video metadat extraction to store in data base - - Add labels to manage assets - - View Details of files - - rename or delete files - - view assets locally - - auto label creation for uploaded time (in coming releases) - -4. Playlist management - - Create, rename or delete playlists - - Assign assets & drag to change order - - assign duration for non-video assets - - select a layout to show (1,2a,2b,3a,3b,4,4b,2ab) - - Enable ticker & set Ticker text - - Make it ad playlist with configurable interval timer - + * Edit `/home/pi/piSignagePro/package.json` for admin and media server configuration + * delete any existing _config.json and _settings.json file from `/home/pi/piSignagePro/config` directory + +## Features + +1. Player management + - Auto discovery of players in a network + - Monitor Players + +2. Group management - create groups and assign players to groups + - Display settings - 1080p/720p and landscape or portrait mode + - Deploy default playlist, scheduled playlists and advt playlist + - Assign Players to Groups + +3. Assets Management + - Upload assets (video,mp3,html/zip,images, links, google calendar feed) + - Videos are automatically converted to mp4 using ffmpeg + - Thumbnail creation for videos and video metadat extraction to store in data base + - Add labels to manage assets + - View Details of files + - rename or delete files + - view assets locally + - auto label creation for uploaded time (in coming releases) + +4. Playlist management + - Create, rename or delete playlists + - Assign assets & drag to change order + - assign duration for non-video assets + - select a layout to show (1,2a,2b,3a,3b,4,4b,2ab) + - Enable ticker & set Ticker text + - Make it ad playlist with configurable interval timer + ### Points to remember -1. angularjs-dropdown-multiselect is taken directly from - https://github.com/dotansimha/angularjs-dropdown-multiselect/pull/23/files instead of bower (for close-on-select to work) +1. angularjs-dropdown-multiselect is taken directly from + https://github.com/dotansimha/angularjs-dropdown-multiselect/pull/23/files instead of bower (for close-on-select to work) -2. Requires following programs to work - - ffmpeg >= 0.9 (in certain OS, these may have to be compiled since the package does not exist, - please see the issue #9) - - ffprobe associated with ffmpeg needed to convert videos +2. Requires following programs to work + - ffmpeg >= 0.9 (in certain OS, these may have to be compiled since the package does not exist, + please see the issue #9) + - ffprobe associated with ffmpeg needed to convert videos - imagemagick creates thumbnails - + 3. Two directories are created by the program ../media and ../media/_thumbnails. If these directories are not created server won't work as expected (for e.g. thumbnails won't be created if _thumbnails directory does not exit). In that case create those directories manually. 4. You can also manage players using Browser(http://playerip:8000) or downloading Chrome app -5. Make sure installation under settings page is same as your username (not email) at pisignage.com +5. Make sure installation under settings page is same as your username (not email) at pisignage.com + - -***Please raise an issue for problems or send us email at support@pisignage.com*** +***Please raise an issue for problems or send us email at support@pisignage.com*** From 6e1e03ec2aa73768c11d4724c210543918805a33 Mon Sep 17 00:00:00 2001 From: Ravi Bail Date: Wed, 10 Jan 2024 11:19:00 +0530 Subject: [PATCH 6/7] Download player v20 files --- app/controllers/scheduler.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/app/controllers/scheduler.js b/app/controllers/scheduler.js index 6a989a5..0c63bee 100644 --- a/app/controllers/scheduler.js +++ b/app/controllers/scheduler.js @@ -113,7 +113,7 @@ var checkAndDownloadImage = function() { function (async_cb) { //read version, different from local one if (!update) { - fs.access(path.join(config.releasesDir,"piimage"+serverVersion_p2+"-p2-v14.zip"), (fs.constants || fs).F_OK, function(err) { + fs.access(path.join(config.releasesDir,"piimage"+serverVersion_p2+"-p2-v20.zip"), (fs.constants || fs).F_OK, function(err) { if (err) { update = true; console.log(err); @@ -141,7 +141,10 @@ var checkAndDownloadImage = function() { linkFileV14 = path.join(config.releasesDir,"pi-image-v14.zip"), serverLink_p2 = "http://pisignage.com/releases/piimage"+serverVersion_p2+"-p2-v14.zip", imageFile_p2 = path.join(config.releasesDir,"piimage"+serverVersion_p2+"-p2-v14.zip"), - linkFile_p2 = path.join(config.releasesDir,"pi-image-p2.zip"); + linkFile_p2 = path.join(config.releasesDir,"pi-image-p2-v14.zip"), + serverLink_p2_v20 = "http://pisignage.com/releases/piimage"+serverVersion_p2+"-p2-v20.zip", + imageFile_p2_v20 = path.join(config.releasesDir,"piimage"+serverVersion_p2+"-p2-v20.zip"), + linkFile_p2_v20 = path.join(config.releasesDir,"pi-image-p2-v20.zip"); download(serverLink, imageFile, function (err) { @@ -163,6 +166,11 @@ var checkAndDownloadImage = function() { if(err){ console.log(err) } else { + download(serverLink_p2_v20, + imageFile_p2_v20, function(err){ + if(err){ + console.log(err) + } else { //create the symbolic link pi-image.zip to the the donwloaded zip file fs.unlink(linkFile, function (err) { fs.symlink(imageFile, linkFile, function (err) { @@ -196,6 +204,11 @@ var checkAndDownloadImage = function() { if (err) console.log(err) }) }) + fs.unlink(linkFile_p2_v20, function (err) { + fs.symlink(imageFile_p2_v20, linkFile_p2_v20, function (err) { + if (err) console.log(err) + }) + }) fs.unlink(packageJsonFile_p2, function (err) { fs.rename(serverFile_p2, packageJsonFile_p2, function (err) { if (err) console.log(err) From f08f883357f94eeedaecbfcdcfcf3b0325c651c5 Mon Sep 17 00:00:00 2001 From: Ravi Bail Date: Wed, 10 Jan 2024 11:26:22 +0530 Subject: [PATCH 7/7] player images for node v20 --- app/controllers/scheduler.js | 105 ++++++++++++++++++----------------- 1 file changed, 53 insertions(+), 52 deletions(-) diff --git a/app/controllers/scheduler.js b/app/controllers/scheduler.js index 0c63bee..2b7863c 100644 --- a/app/controllers/scheduler.js +++ b/app/controllers/scheduler.js @@ -158,70 +158,71 @@ var checkAndDownloadImage = function() { } else { download(serverLinkV14, imageFileV14, function (err) { - if (err){ + if (err) { console.log(err); } else { download(serverLink_p2, - imageFile_p2, function(err){ - if(err){ + imageFile_p2, function (err) { + if (err) { console.log(err) } else { download(serverLink_p2_v20, - imageFile_p2_v20, function(err){ - if(err){ - console.log(err) - } else { - //create the symbolic link pi-image.zip to the the donwloaded zip file - fs.unlink(linkFile, function (err) { - fs.symlink(imageFile, linkFile, function (err) { - if (err) console.log(err) - }) + imageFile_p2_v20, function (err) { + if (err) { + console.log(err) + } else { + //create the symbolic link pi-image.zip to the the donwloaded zip file + fs.unlink(linkFile, function (err) { + fs.symlink(imageFile, linkFile, function (err) { + if (err) console.log(err) + }) + }) + fs.unlink(linkFileV6, function (err) { + fs.symlink(imageFileV6, linkFileV6, function (err) { + if (err) console.log(err) + }) + }) + fs.unlink(linkFileV6_2, function (err) { + fs.symlink(imageFileV6, linkFileV6_2, function (err) { + if (err) console.log(err) + }) + }) + fs.unlink(linkFileV14, function (err) { + fs.symlink(imageFileV14, linkFileV14, function (err) { + if (err) console.log(err); + }); + }); + // update local package.json with the downloaded one + fs.unlink(packageJsonFile, function (err) { + fs.rename(serverFile, packageJsonFile, function (err) { + if (err) console.log(err) + }) + }) + console.log("piSignage image updated to " + serverVersion); + fs.unlink(linkFile_p2, function (err) { + fs.symlink(imageFile_p2, linkFile_p2, function (err) { + if (err) console.log(err) + }) + }) + fs.unlink(linkFile_p2_v20, function (err) { + fs.symlink(imageFile_p2_v20, linkFile_p2_v20, function (err) { + if (err) console.log(err) + }) + }) + fs.unlink(packageJsonFile_p2, function (err) { + fs.rename(serverFile_p2, packageJsonFile_p2, function (err) { + if (err) console.log(err) + }) + }) + console.log("player 2 image updated to " + serverVersion_p2); + } }) - fs.unlink(linkFileV6, function (err) { - fs.symlink(imageFileV6, linkFileV6, function (err) { - if (err) console.log(err) - }) - }) - fs.unlink(linkFileV6_2, function (err) { - fs.symlink(imageFileV6, linkFileV6_2, function (err) { - if (err) console.log(err) - }) - }) - fs.unlink(linkFileV14, function (err) { - fs.symlink(imageFileV14, linkFileV14, function (err) { - if (err) console.log(err); - }); - }); - // update local package.json with the downloaded one - fs.unlink(packageJsonFile, function (err) { - fs.rename(serverFile, packageJsonFile, function (err) { - if (err) console.log(err) - }) - }) - console.log("piSignage image updated to " + serverVersion); - fs.unlink(linkFile_p2, function (err) { - fs.symlink(imageFile_p2, linkFile_p2, function (err) { - if (err) console.log(err) - }) - }) - fs.unlink(linkFile_p2_v20, function (err) { - fs.symlink(imageFile_p2_v20, linkFile_p2_v20, function (err) { - if (err) console.log(err) - }) - }) - fs.unlink(packageJsonFile_p2, function (err) { - fs.rename(serverFile_p2, packageJsonFile_p2, function (err) { - if (err) console.log(err) - }) - }) - console.log("player 2 image updated to " + serverVersion_p2); } }) } }) - } - }) + }) } }) })