Merge pull request #6 from peterus/fixes

Fixes some issues
This commit is contained in:
Per Qvarforth 2022-02-12 16:46:10 +01:00 committed by GitHub
commit 47e92a6c96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 1 deletions

View File

@ -1,4 +1,14 @@
<?php require "../includes/bootstrap.php"; ?>
<?php
$isSecure = false;
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
$isSecure = true;
}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' || !empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on') {
$isSecure = true;
}
$REQUEST_PROTOCOL = $isSecure ? 'https' : 'http';
?>
<!DOCTYPE html>
<html lang="en">
@ -132,7 +142,7 @@
var supportsWebSockets = 'WebSocket' in window || 'MozWebSocket' in window;
if (supportsWebSockets) {
<?php if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') : ?>
<?php if ($REQUEST_PROTOCOL == 'https') : ?>
var wsServerUrl = 'wss://<?php echo $_SERVER['HTTP_HOST']; ?>:9000/ws';
<?php else : ?>
var wsServerUrl = 'ws://<?php echo $_SERVER['HTTP_HOST']; ?>:9000/ws';

View File

@ -20,5 +20,7 @@ RUN a2enmod rewrite
RUN chmod a+rx / && chmod a+rx -R /root
RUN chmod 777 /root/trackdirect/htdocs/public/symbols
RUN rm /root/trackdirect/config/trackdirect.ini
VOLUME /root/trackdirect/config/trackdirect.ini
VOLUME /root/trackdirect/htdocs/public/heatmaps

View File

@ -17,5 +17,7 @@ RUN wget http://jjguy.com/heatmap/heatmap-2.2.1.tar.gz && tar xzf heatmap-2.2.1.
COPY . /root/trackdirect
RUN rm /root/trackdirect/config/trackdirect.ini
VOLUME /root/trackdirect/config/trackdirect.ini
VOLUME /root/trackdirect/htdocs/public/heatmaps