diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 8527313..54b21d0 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -25,6 +25,23 @@ jobs:
cd backend
npm install
sudo npm install -g @angular/cli
+ - name: prepare localization
+ run: |
+ sudo npm install -g xliff-to-json
+ xliff-to-json ./src/assets/i18n
+ - name: Set hash
+ id: vars
+ run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
+ - name: Get current date
+ id: date
+ run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
+ - name: create-json
+ id: create-json
+ uses: jsdaniell/create-json@1.1.2
+ with:
+ name: "version.json"
+ json: '{"type": "autobuild", "tag": "N/A", "commit": "${{ steps.vars.outputs.sha_short }}", "date": "${{ steps.date.outputs.date }}"}'
+ dir: 'backend/'
- name: build
run: ng build --prod
- name: prepare artifact upload
diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml
index 96ec2c8..aae7fb3 100644
--- a/.github/workflows/docker-release.yml
+++ b/.github/workflows/docker-release.yml
@@ -13,6 +13,23 @@ jobs:
steps:
- name: checkout code
uses: actions/checkout@v2
+ - name: prepare localization
+ run: |
+ sudo npm install -g xliff-to-json
+ xliff-to-json ./src/assets/i18n
+ - name: Set hash
+ id: vars
+ run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
+ - name: Get current date
+ id: date
+ run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
+ - name: create-json
+ id: create-json
+ uses: jsdaniell/create-json@1.1.2
+ with:
+ name: "version.json"
+ json: '{"type": "docker", "tag": "latest", "commit": "${{ steps.vars.outputs.sha_short }}", "date": "${{ steps.date.outputs.date }}"}'
+ dir: 'backend/'
- name: setup platform emulator
uses: docker/setup-qemu-action@v1
- name: setup multi-arch docker build
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index c74f29b..9e0049b 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -10,6 +10,23 @@ jobs:
steps:
- name: checkout code
uses: actions/checkout@v2
+ - name: prepare localization
+ run: |
+ sudo npm install -g xliff-to-json
+ xliff-to-json ./src/assets/i18n
+ - name: Set hash
+ id: vars
+ run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
+ - name: Get current date
+ id: date
+ run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
+ - name: create-json
+ id: create-json
+ uses: jsdaniell/create-json@1.1.2
+ with:
+ name: "version.json"
+ json: '{"type": "docker", "tag": "nightly", "commit": "${{ steps.vars.outputs.sha_short }}", "date": "${{ steps.date.outputs.date }}"}'
+ dir: 'backend/'
- name: setup platform emulator
uses: docker/setup-qemu-action@v1
- name: setup multi-arch docker build
diff --git a/backend/app.js b/backend/app.js
index 7404f3c..33363d9 100644
--- a/backend/app.js
+++ b/backend/app.js
@@ -142,6 +142,14 @@ var validDownloadingAgents = [
const subscription_timeouts = {};
+let version_info = null;
+if (fs.existsSync('version.json')) {
+ version_info = fs.readJSONSync('version.json');
+ logger.verbose(`Version info: ${JSON.stringify(version_info, null, 2)}`);
+} else {
+ version_info = {'type': 'N/A', 'tag': 'N/A', 'commit': 'N/A', 'date': 'N/A'};
+}
+
// don't overwrite config if it already happened.. NOT
// let alreadyWritten = db.get('configWriteFlag').value();
let writeConfigMode = process.env.write_ytdl_config;
@@ -932,6 +940,10 @@ app.post('/api/setConfig', optionalJwt, function(req, res) {
}
});
+app.get('/api/versionInfo', (req, res) => {
+ res.send({version_info: version_info});
+});
+
app.post('/api/restartServer', optionalJwt, (req, res) => {
// delayed by a little bit so that the client gets a response
setTimeout(() => {restartServer()}, 100);
diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index cadd7ca..6780813 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -118,6 +118,10 @@ export class AppComponent implements OnInit, AfterViewInit {
}
this.postsService.reloadCategories();
+
+ this.postsService.getVersionInfo().subscribe(res => {
+ this.postsService.version_info = res['version_info'];
+ });
}
// theme stuff
diff --git a/src/app/dialogs/about-dialog/about-dialog.component.html b/src/app/dialogs/about-dialog/about-dialog.component.html
index ddf28f0..c869b8d 100644
--- a/src/app/dialogs/about-dialog/about-dialog.component.html
+++ b/src/app/dialogs/about-dialog/about-dialog.component.html
@@ -21,6 +21,17 @@
+
+
+
+