mirror of
https://github.com/WebTools-NG/WebTools-NG
synced 2024-11-26 13:00:18 +00:00
commit
9cf4735c26
6 changed files with 73 additions and 4 deletions
44
.github/workflows/env.yml
vendored
Normal file
44
.github/workflows/env.yml
vendored
Normal file
|
@ -0,0 +1,44 @@
|
|||
name: Create envfile
|
||||
|
||||
on: [ push ]
|
||||
|
||||
jobs:
|
||||
|
||||
create-envfile:
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
# os: [macos-latest, ubuntu-latest, windows-latest]
|
||||
# os: [macos-latest]
|
||||
# os: [ubuntu-latest, windows-latest]
|
||||
# os: [windows-latest]
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
# - name: Make envfile
|
||||
# uses: SpicyPizza/create-envfile@v1.3
|
||||
# with:
|
||||
# envkey_DEBUG: false
|
||||
# envkey_Key_tmdb: ${{ secrets.Key_tmdb }}
|
||||
# file_name: .env
|
||||
# fail_on_empty: false
|
||||
- name: see output
|
||||
run: echo "${{ secrets.KEY_TMDB }}"
|
||||
- name: Extract GH secrets
|
||||
run: 'echo "$KEY_TMDB" > key'
|
||||
shell: bash
|
||||
env:
|
||||
KEY_TMDB: ${{secrets.KEY_TMDB}}
|
||||
- name: Repo secrets
|
||||
run: |
|
||||
echo 'Hello World!'
|
||||
echo '$KEY_TMDB2 > key'
|
||||
echo ${{secrets.KEY_TMDB2}}
|
||||
echo "${{secrets.KEY_TMDB2}}22" > .env
|
||||
cat .env
|
||||
echo 'Hello again!'
|
||||
shell: bash
|
||||
env:
|
||||
KEY_TMDB2: ${{secrets.KEY_TMDB2}}
|
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
|
@ -27,6 +27,8 @@ jobs:
|
|||
run: npm install
|
||||
- name: see directory with dependencies
|
||||
run: ls
|
||||
- name: Add env file
|
||||
run: echo "${{secrets.KEY_TMDB2}}22" > .env
|
||||
- name: Deploy Releases
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
|
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "webtools-ng",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "webtools-ng",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"hasInstallScript": true,
|
||||
"license": "MPL-2.0",
|
||||
"dependencies": {
|
||||
|
|
|
@ -16,6 +16,20 @@ import {
|
|||
|
||||
const isDevelopment = process.env.NODE_ENV !== 'production'
|
||||
|
||||
// Return defined vars from .env.local
|
||||
ipcMain.on('getAPIKeys', function(event, arg) {
|
||||
switch( arg ) {
|
||||
case 'Key_tmdb':
|
||||
event.returnValue = process.env.Key_tmdb
|
||||
break;
|
||||
case 'Key_tvdb':
|
||||
event.returnValue = process.env.Key_tvdb
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
// Bad thing, but need to disable cert checks, since connecting via ip
|
||||
// to a cert issued for plex.direct
|
||||
app.commandLine.appendSwitch('ignore-certificate-errors', 'true');
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
//import store from '../../../store';
|
||||
//import { wtconfig } from './wtutils';
|
||||
import axios from 'axios';
|
||||
import { wtutils } from './wtutils';
|
||||
|
||||
const log = require('electron-log');
|
||||
const {JSONPath} = require('jsonpath-plus');
|
||||
|
@ -12,7 +13,7 @@ const tmdb = new class TMDB {
|
|||
constructor() {
|
||||
this.baseUrl = 'https://www.themoviedb.org/';
|
||||
this.baseAPIUrl = 'https://api.themoviedb.org';
|
||||
this.BearerKey = 'eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIwNzZjOTRlOTM5YThkNzhjOTg1NGY4MTc0YTI5NGVhYSIsInN1YiI6IjYyNTA5NjcxYzYxM2NlMDA1MWYwMjMyYSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.Ch9U33tcVeh5qbVUG12LZ7qX8ulbIZjURlyGuj3ULBk';
|
||||
// this.BearerKey = 'eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIwNzZjOTRlOTM5YThkNzhjOTg1NGY4MTc0YTI5NGVhYSIsInN1YiI6IjYyNTA5NjcxYzYxM2NlMDA1MWYwMjMyYSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.Ch9U33tcVeh5qbVUG12LZ7qX8ulbIZjURlyGuj3ULBk';
|
||||
this.apiKey = '076c94e939a8d78c9854f8174a294eaa';
|
||||
|
||||
}
|
||||
|
@ -35,7 +36,8 @@ const tmdb = new class TMDB {
|
|||
"Accept": "application/json"
|
||||
};
|
||||
log.info(`[tmdb.js] (getTMDBShowInfo) - Url is ${url}`)
|
||||
url = `${url}&api_key=${this.apiKey}`;
|
||||
const apiKey = wtutils.envVarLocal( 'Key_tmdb' );
|
||||
url = `${url}&api_key=${apiKey}`;
|
||||
const result = {};
|
||||
await axios({
|
||||
method: 'get',
|
||||
|
|
|
@ -7,6 +7,8 @@ that we use in our solution.
|
|||
|
||||
//storeStatus
|
||||
|
||||
import {ipcRenderer} from 'electron';
|
||||
|
||||
const log = require('electron-log');
|
||||
console.log = log.log;
|
||||
const electron = require('electron');
|
||||
|
@ -21,6 +23,11 @@ const wtutils = new class WTUtils {
|
|||
this.plexTVApi = 'https://plex.tv/api/';
|
||||
}
|
||||
|
||||
envVarLocal( envName ){
|
||||
const envVar = ipcRenderer.sendSync('getAPIKeys', envName);
|
||||
return envVar;
|
||||
}
|
||||
|
||||
get ConfigFileName(){
|
||||
var path = require('path');
|
||||
const configFileName = path.join( this.Home, this.AppName + '.json');
|
||||
|
|
Loading…
Reference in a new issue