mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-16 23:01:28 +03:00
Removed "use encryption" options, if you'd like to encrypt your web page, use a reverse proxy
This commit is contained in:
@@ -128,7 +128,6 @@ users_db.defaults(
|
|||||||
var frontendUrl = null;
|
var frontendUrl = null;
|
||||||
var backendUrl = null;
|
var backendUrl = null;
|
||||||
var backendPort = null;
|
var backendPort = null;
|
||||||
var usingEncryption = null;
|
|
||||||
var basePath = null;
|
var basePath = null;
|
||||||
var audioFolderPath = null;
|
var audioFolderPath = null;
|
||||||
var videoFolderPath = null;
|
var videoFolderPath = null;
|
||||||
@@ -140,7 +139,6 @@ var subscriptionsCheckInterval = null;
|
|||||||
var archivePath = path.join(__dirname, 'appdata', 'archives');
|
var archivePath = path.join(__dirname, 'appdata', 'archives');
|
||||||
|
|
||||||
// other needed values
|
// other needed values
|
||||||
var options = null; // encryption options
|
|
||||||
var url_domain = null;
|
var url_domain = null;
|
||||||
var updaterStatus = null;
|
var updaterStatus = null;
|
||||||
|
|
||||||
@@ -256,18 +254,10 @@ async function startServer() {
|
|||||||
// set config to port
|
// set config to port
|
||||||
await setPortItemFromENV();
|
await setPortItemFromENV();
|
||||||
}
|
}
|
||||||
if (usingEncryption)
|
|
||||||
{
|
app.listen(backendPort,function(){
|
||||||
https.createServer(options, app).listen(backendPort, function() {
|
logger.info(`YoutubeDL-Material ${CONSTS['CURRENT_VERSION']} started on PORT ${backendPort}`);
|
||||||
logger.info(`YoutubeDL-Material ${CONSTS['CURRENT_VERSION']} started on port ${backendPort} - using SSL`);
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
app.listen(backendPort,function(){
|
|
||||||
logger.info(`YoutubeDL-Material ${CONSTS['CURRENT_VERSION']} started on PORT ${backendPort}`);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function restartServer() {
|
async function restartServer() {
|
||||||
@@ -604,7 +594,6 @@ async function loadConfig() {
|
|||||||
function loadConfigValues() {
|
function loadConfigValues() {
|
||||||
url = !debugMode ? config_api.getConfigItem('ytdl_url') : 'http://localhost:4200';
|
url = !debugMode ? config_api.getConfigItem('ytdl_url') : 'http://localhost:4200';
|
||||||
backendPort = config_api.getConfigItem('ytdl_port');
|
backendPort = config_api.getConfigItem('ytdl_port');
|
||||||
usingEncryption = config_api.getConfigItem('ytdl_use_encryption');
|
|
||||||
audioFolderPath = config_api.getConfigItem('ytdl_audio_folder_path');
|
audioFolderPath = config_api.getConfigItem('ytdl_audio_folder_path');
|
||||||
videoFolderPath = config_api.getConfigItem('ytdl_video_folder_path');
|
videoFolderPath = config_api.getConfigItem('ytdl_video_folder_path');
|
||||||
downloadOnlyMode = config_api.getConfigItem('ytdl_download_only_mode');
|
downloadOnlyMode = config_api.getConfigItem('ytdl_download_only_mode');
|
||||||
@@ -619,20 +608,6 @@ function loadConfigValues() {
|
|||||||
customDownloadingAgent = null;
|
customDownloadingAgent = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (usingEncryption)
|
|
||||||
{
|
|
||||||
var certFilePath = path.resolve(config_api.getConfigItem('ytdl_cert_file_path'));
|
|
||||||
var keyFilePath = path.resolve(config_api.getConfigItem('ytdl_key_file_path'));
|
|
||||||
|
|
||||||
var certKeyFile = fs.readFileSync(keyFilePath);
|
|
||||||
var certFile = fs.readFileSync(certFilePath);
|
|
||||||
|
|
||||||
options = {
|
|
||||||
key: certKeyFile,
|
|
||||||
cert: certFile
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// empty url defaults to default URL
|
// empty url defaults to default URL
|
||||||
if (!url || url === '') url = 'http://example.com'
|
if (!url || url === '') url = 'http://example.com'
|
||||||
url_domain = new URL(url);
|
url_domain = new URL(url);
|
||||||
@@ -1828,10 +1803,6 @@ app.post('/api/setConfig', optionalJwt, function(req, res) {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get('/api/using-encryption', function(req, res) {
|
|
||||||
res.send(usingEncryption);
|
|
||||||
});
|
|
||||||
|
|
||||||
app.post('/api/tomp3', optionalJwt, async function(req, res) {
|
app.post('/api/tomp3', optionalJwt, async function(req, res) {
|
||||||
var url = req.body.url;
|
var url = req.body.url;
|
||||||
var options = {
|
var options = {
|
||||||
|
|||||||
@@ -4,11 +4,6 @@
|
|||||||
"url": "http://example.com",
|
"url": "http://example.com",
|
||||||
"port": "17442"
|
"port": "17442"
|
||||||
},
|
},
|
||||||
"Encryption": {
|
|
||||||
"use-encryption": false,
|
|
||||||
"cert-file-path": "/etc/letsencrypt/live/example.com/fullchain.pem",
|
|
||||||
"key-file-path": "/etc/letsencrypt/live/example.com/privkey.pem"
|
|
||||||
},
|
|
||||||
"Downloader": {
|
"Downloader": {
|
||||||
"path-audio": "audio/",
|
"path-audio": "audio/",
|
||||||
"path-video": "video/",
|
"path-video": "video/",
|
||||||
|
|||||||
@@ -4,11 +4,6 @@
|
|||||||
"url": "https://example.com",
|
"url": "https://example.com",
|
||||||
"port": "17442"
|
"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": {
|
"Downloader": {
|
||||||
"path-audio": "audio/",
|
"path-audio": "audio/",
|
||||||
"path-video": "video/",
|
"path-video": "video/",
|
||||||
|
|||||||
@@ -181,11 +181,6 @@ DEFAULT_CONFIG = {
|
|||||||
"url": "http://example.com",
|
"url": "http://example.com",
|
||||||
"port": "17442"
|
"port": "17442"
|
||||||
},
|
},
|
||||||
"Encryption": {
|
|
||||||
"use-encryption": false,
|
|
||||||
"cert-file-path": "/etc/letsencrypt/live/example.com/fullchain.pem",
|
|
||||||
"key-file-path": "/etc/letsencrypt/live/example.com/privkey.pem"
|
|
||||||
},
|
|
||||||
"Downloader": {
|
"Downloader": {
|
||||||
"path-audio": "audio/",
|
"path-audio": "audio/",
|
||||||
"path-video": "video/",
|
"path-video": "video/",
|
||||||
|
|||||||
@@ -9,20 +9,6 @@ let CONFIG_ITEMS = {
|
|||||||
'path': 'YoutubeDLMaterial.Host.port'
|
'path': 'YoutubeDLMaterial.Host.port'
|
||||||
},
|
},
|
||||||
|
|
||||||
// Encryption
|
|
||||||
'ytdl_use_encryption': {
|
|
||||||
'key': 'ytdl_use_encryption',
|
|
||||||
'path': 'YoutubeDLMaterial.Encryption.use-encryption'
|
|
||||||
},
|
|
||||||
'ytdl_cert_file_path': {
|
|
||||||
'key': 'ytdl_cert_file_path',
|
|
||||||
'path': 'YoutubeDLMaterial.Encryption.cert-file-path'
|
|
||||||
},
|
|
||||||
'ytdl_key_file_path': {
|
|
||||||
'key': 'ytdl_key_file_path',
|
|
||||||
'path': 'YoutubeDLMaterial.Encryption.key-file-path'
|
|
||||||
},
|
|
||||||
|
|
||||||
// Downloader
|
// Downloader
|
||||||
'ytdl_audio_folder_path': {
|
'ytdl_audio_folder_path': {
|
||||||
'key': 'ytdl_audio_folder_path',
|
'key': 'ytdl_audio_folder_path',
|
||||||
|
|||||||
@@ -42,26 +42,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
<div *ngIf="new_config" class="container-fluid">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-12 mt-3">
|
|
||||||
<mat-checkbox color="accent" [(ngModel)]="new_config['Encryption']['use-encryption']"><ng-container i18n="Use encryption setting">Use encryption</ng-container></mat-checkbox>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-12">
|
|
||||||
<mat-form-field class="text-field" color="accent">
|
|
||||||
<input [disabled]="!new_config['Encryption']['use-encryption']" [(ngModel)]="new_config['Encryption']['cert-file-path']" matInput placeholder="Cert file path" i18n-placeholder="Cert file path input placeholder">
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-12">
|
|
||||||
<mat-form-field class="text-field" color="accent">
|
|
||||||
<input [disabled]="!new_config['Encryption']['use-encryption']" [(ngModel)]="new_config['Encryption']['key-file-path']" matInput placeholder="Key file path" i18n-placeholder="Key file path input placeholder">
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<mat-divider></mat-divider>
|
|
||||||
<div *ngIf="new_config" class="container-fluid">
|
<div *ngIf="new_config" class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 mt-3">
|
<div class="col-12 mt-3">
|
||||||
@@ -73,7 +53,7 @@
|
|||||||
<mat-hint><ng-container i18n="Subscriptions base path setting input hint">Base path for videos from your subscribed channels and playlists. It is relative to YTDL-Material's root folder.</ng-container></mat-hint>
|
<mat-hint><ng-container i18n="Subscriptions base path setting input hint">Base path for videos from your subscribed channels and playlists. It is relative to YTDL-Material's root folder.</ng-container></mat-hint>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 mt-5">
|
<div class="col-12 mt-5 mb-3">
|
||||||
<mat-form-field class="text-field" color="accent">
|
<mat-form-field class="text-field" color="accent">
|
||||||
<input [disabled]="!new_config['Subscriptions']['allow_subscriptions']" [(ngModel)]="new_config['Subscriptions']['subscriptions_check_interval']" matInput placeholder="Check interval" i18n-placeholder="Check interval input setting placeholder">
|
<input [disabled]="!new_config['Subscriptions']['allow_subscriptions']" [(ngModel)]="new_config['Subscriptions']['subscriptions_check_interval']" matInput placeholder="Check interval" i18n-placeholder="Check interval input setting placeholder">
|
||||||
<mat-hint><ng-container i18n="Check interval setting input hint">Unit is seconds, only include numbers.</ng-container></mat-hint>
|
<mat-hint><ng-container i18n="Check interval setting input hint">Unit is seconds, only include numbers.</ng-container></mat-hint>
|
||||||
|
|||||||
@@ -4,11 +4,6 @@
|
|||||||
"url": "http://localhost",
|
"url": "http://localhost",
|
||||||
"port": "17442"
|
"port": "17442"
|
||||||
},
|
},
|
||||||
"Encryption": {
|
|
||||||
"use-encryption": false,
|
|
||||||
"cert-file-path": "/etc/letsencrypt/live/example.com/fullchain.pem",
|
|
||||||
"key-file-path": "/etc/letsencrypt/live/example.com/privkey.pem"
|
|
||||||
},
|
|
||||||
"Downloader": {
|
"Downloader": {
|
||||||
"path-audio": "audio/",
|
"path-audio": "audio/",
|
||||||
"path-video": "video/",
|
"path-video": "video/",
|
||||||
|
|||||||
Reference in New Issue
Block a user