mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-31 01:35:15 +02:00
fix: rename containers
This commit is contained in:
parent
b5e3316040
commit
74e962d84b
@ -1,7 +1,6 @@
|
|||||||
FROM php:7.4.30-apache-bullseye
|
FROM php:7.4.30-apache-bullseye
|
||||||
|
|
||||||
COPY dist /var/www/html
|
COPY dist /var/www/html
|
||||||
COPY fix-https-reverse-proxy.diff /var/www/html
|
|
||||||
|
|
||||||
RUN ls;
|
RUN ls;
|
||||||
|
|
||||||
@ -15,9 +14,9 @@ RUN set -ex; \
|
|||||||
docker-php-ext-install imap; \
|
docker-php-ext-install imap; \
|
||||||
a2enmod rewrite; \
|
a2enmod rewrite; \
|
||||||
chmod 777 /var/www/html/api/config.php /var/www/html/api/files; \
|
chmod 777 /var/www/html/api/config.php /var/www/html/api/files; \
|
||||||
chmod -R 777 /var/www/html/api/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/; \
|
chmod -R 777 /var/www/html/api/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/;
|
||||||
patch /var/www/html/index.php < /var/www/html/fix-https-reverse-proxy.diff;
|
|
||||||
|
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
|
EXPOSE 9000
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
CMD ["apache2-foreground"]
|
CMD ["apache2-foreground"]
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
version: '2'
|
version: '2'
|
||||||
services:
|
services:
|
||||||
mariadb:
|
mysql:
|
||||||
image: 'mysql:8.0'
|
image: 'mysql:8.0'
|
||||||
ports:
|
ports:
|
||||||
- '3306:3306'
|
- '3306:3306'
|
||||||
environment:
|
environment:
|
||||||
MYSQL_ROOT_PASSWORD: 'adminpassword'
|
MYSQL_ROOT_PASSWORD: 'adminpassword'
|
||||||
MYSQL_DATABASE: 'opensupports'
|
MYSQL_DATABASE: 'opensupports'
|
||||||
MYSQL_USER: 'admin'
|
MYSQL_USER: 'admin'
|
||||||
MYSQL_PASSWORD: 'adminpassword'
|
MYSQL_PASSWORD: 'adminpassword'
|
||||||
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
|
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
|
||||||
volumes:
|
volumes:
|
||||||
- ./database:/var/lib/mysql
|
- ./database:/var/lib/mysql
|
||||||
|
|
||||||
website:
|
website:
|
||||||
build: .
|
build: .
|
||||||
@ -19,6 +19,6 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "8080:80"
|
- "8080:80"
|
||||||
volumes:
|
volumes:
|
||||||
- ./config:/config
|
- ./config:/config
|
||||||
depends_on:
|
depends_on:
|
||||||
- mariadb
|
- mysql
|
||||||
|
@ -1,84 +0,0 @@
|
|||||||
diff --git a/index.php b/index.php
|
|
||||||
index 8d1b211..1c707b6 100755
|
|
||||||
--- a/index.php
|
|
||||||
+++ b/index.php
|
|
||||||
@@ -1,35 +1,52 @@
|
|
||||||
<?php
|
|
||||||
- $path = rtrim(str_replace('\\','/',dirname($_SERVER['PHP_SELF'])), '/');
|
|
||||||
- $url = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $path;
|
|
||||||
- header('X-Frame-Options: DENY');
|
|
||||||
+function isHttps()
|
|
||||||
+{
|
|
||||||
+ if (array_key_exists("HTTPS", $_SERVER) && 'on' === $_SERVER["HTTPS"]) {
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+ if (array_key_exists("SERVER_PORT", $_SERVER) && 443 === (int)$_SERVER["SERVER_PORT"]) {
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+ if (array_key_exists("HTTP_X_FORWARDED_SSL", $_SERVER) && 'on' === $_SERVER["HTTP_X_FORWARDED_SSL"]) {
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+ if (array_key_exists("HTTP_X_FORWARDED_PROTO", $_SERVER) && 'https' === $_SERVER["HTTP_X_FORWARDED_PROTO"]) {
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+ return false;
|
|
||||||
+}
|
|
||||||
+$path = rtrim(str_replace('\\','/',dirname($_SERVER['PHP_SELF'])), '/');
|
|
||||||
+$url_host = getenv("HOST", false) !== false ? getenv("HOST", false) : $_SERVER['HTTP_HOST'];
|
|
||||||
+$url = ( isHttps() ? 'https://' : 'http://' ) . $url_host . $path;
|
|
||||||
+header('X-Frame-Options: DENY');
|
|
||||||
?>
|
|
||||||
<!doctype html>
|
|
||||||
<html class="no-js" lang="">
|
|
||||||
- <head>
|
|
||||||
- <meta charset="utf-8">
|
|
||||||
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
||||||
- <meta name="description" content="">
|
|
||||||
- <meta name="viewport" content="width=device-width">
|
|
||||||
+<head>
|
|
||||||
+ <meta charset="utf-8">
|
|
||||||
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
||||||
+ <meta name="description" content="">
|
|
||||||
+ <meta name="viewport" content="width=device-width">
|
|
||||||
|
|
||||||
- <title>OpenSupports</title>
|
|
||||||
+ <title>OpenSupports</title>
|
|
||||||
|
|
||||||
- <link rel="icon" type="image/x-icon" href="<?=$url ?>/images/icon.png">
|
|
||||||
- <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css">
|
|
||||||
- <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.4/css/v4-shims.css">
|
|
||||||
- </head>
|
|
||||||
- <body>
|
|
||||||
- <div id="app"></div>
|
|
||||||
+ <link rel="icon" type="image/x-icon" href="<?=$url ?>/images/icon.png">
|
|
||||||
+ <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css">
|
|
||||||
+ <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.4/css/v4-shims.css">
|
|
||||||
+</head>
|
|
||||||
+<body>
|
|
||||||
+<div id="app"></div>
|
|
||||||
|
|
||||||
- <script>
|
|
||||||
- opensupports_version = '4.11.0';
|
|
||||||
- root = "<?=$url ?>";
|
|
||||||
- apiRoot = '<?=$url ?>/api';
|
|
||||||
- globalIndexPath = "<?=$path ?>";
|
|
||||||
- showLogs = false;
|
|
||||||
- </script>
|
|
||||||
- <?php if (preg_match('~MSIE|Internet Explorer~i', $_SERVER['HTTP_USER_AGENT']) || (strpos($_SERVER['HTTP_USER_AGENT'], 'Trident/7.0; rv:11.0') !== false)): ?>
|
|
||||||
- <script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=String.prototype.startsWith,Array.from,Array.prototype.fill,Array.prototype.keys,Array.prototype.find,Array.prototype.findIndex,Array.prototype.includes,String.prototype.repeat,Number.isInteger,Promise&flags=gated"></script>
|
|
||||||
- <?php endif; ?>
|
|
||||||
- <script src="<?=$url ?>/bundle.js"></script>
|
|
||||||
- </body>
|
|
||||||
+<script>
|
|
||||||
+ opensupports_version = '4.11.0';
|
|
||||||
+ root = "<?=$url ?>";
|
|
||||||
+ apiRoot = '<?=$url ?>/api';
|
|
||||||
+ globalIndexPath = "<?=$path ?>";
|
|
||||||
+ showLogs = true;
|
|
||||||
+</script>
|
|
||||||
+<?php if (preg_match('~MSIE|Internet Explorer~i', $_SERVER['HTTP_USER_AGENT']) || (strpos($_SERVER['HTTP_USER_AGENT'], 'Trident/7.0; rv:11.0') !== false)): ?>
|
|
||||||
+ <script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=String.prototype.startsWith,Array.from,Array.prototype.fill,Array.prototype.keys,Array.prototype.find,Array.prototype.findIndex,Array.prototype.includes,String.prototype.repeat,Number.isInteger,Promise&flags=gated"></script>
|
|
||||||
+<?php endif; ?>
|
|
||||||
+<script src="<?=$url ?>/bundle.js"></script>
|
|
||||||
+</body>
|
|
||||||
</html>
|
|
Loading…
x
Reference in New Issue
Block a user