config settings now just have url and port

fixed bug where multi download mode would not allow file card link clicking
This commit is contained in:
Isaac Grynsztein
2020-02-28 00:14:46 -05:00
parent 09bdae90e2
commit 5e331b9ffa
8 changed files with 28 additions and 35 deletions

View File

@@ -31,7 +31,7 @@ db.defaults(
// config values
var frontendUrl = null;
var backendUrl = null;
var backendPort = 17442;
var backendPort = null;
var usingEncryption = null;
var basePath = null;
var audioFolderPath = null;
@@ -85,7 +85,7 @@ function startServer() {
if (usingEncryption)
{
https.createServer(options, app).listen(backendPort, function() {
console.log('HTTPS: Anchor set on 17442');
console.log('HTTPS: Started on PORT ' + backendPort);
});
}
else
@@ -121,9 +121,9 @@ async function loadConfig() {
// get config library
// config = require('config');
frontendUrl = !debugMode ? config_api.getConfigItem('ytdl_frontend_url') : 'http://localhost:4200';
backendUrl = config_api.getConfigItem('ytdl_backend_url')
backendPort = 17442;
// frontendUrl = !debugMode ? config_api.getConfigItem('ytdl_frontend_url') : 'http://localhost:4200';
url = !debugMode ? config_api.getConfigItem('ytdl_url') : 'http://localhost:4200';
backendPort = config_api.getConfigItem('ytdl_port');
usingEncryption = config_api.getConfigItem('ytdl_use_encryption');
basePath = config_api.getConfigItem('ytdl_base_path');
audioFolderPath = config_api.getConfigItem('ytdl_audio_folder_path');
@@ -149,7 +149,7 @@ async function loadConfig() {
};
}
url_domain = new URL(frontendUrl);
url_domain = new URL(url);
// start the server here
startServer();

View File

@@ -1,8 +1,8 @@
{
"YoutubeDLMaterial": {
"Host": {
"frontendurl": "http://example.com",
"backendurl": "http://example.com:17442/"
"url": "http://example.com",
"port": "17442"
},
"Encryption": {
"use-encryption": false,
@@ -10,7 +10,7 @@
"key-file-path": "/etc/letsencrypt/live/example.com/privkey.pem"
},
"Downloader": {
"path-base": "http://example.com:17442/",
"path-base": "http://example.com:17442/api/",
"path-audio": "audio/",
"path-video": "video/"
},

View File

@@ -1,16 +1,16 @@
{
"YoutubeDLMaterial": {
"Host": {
"frontendurl": "https://example.com",
"backendurl": "https://example.com:17442/"
},
"Host": {
"url": "https://example.com",
"port": "17442"
},
"Encryption": {
"use-encryption": true,
"cert-file-path": "/etc/letsencrypt/live/example.com/fullchain.pem",
"key-file-path": "/etc/letsencrypt/live/example.com/privkey.pem"
},
"Downloader": {
"path-base": "https://example.com:17442/",
"path-base": "https://example.com:17442/api/",
"path-audio": "audio/",
"path-video": "video/"
},

View File

@@ -2,13 +2,13 @@ var config = require('config');
let CONFIG_ITEMS = {
// Host
'ytdl_frontend_url': {
'key': 'ytdl_frontend_url',
'path': 'YoutubeDLMaterial.Host.frontendurl'
'ytdl_url': {
'key': 'ytdl_url',
'path': 'YoutubeDLMaterial.Host.url'
},
'ytdl_backend_url': {
'key': 'ytdl_backend_url',
'path': 'YoutubeDLMaterial.Host.backendurl'
'ytdl_port': {
'key': 'ytdl_port',
'path': 'YoutubeDLMaterial.Host.port'
},
// Encryption