Selaa lähdekoodia

Basic package fixes

Johannes Zellner 5 vuotta sitten
vanhempi
sitoutus
bd14818989
7 muutettua tiedostoa jossa 27 lisäystä ja 50 poistoa
  1. 3 2
      CloudronManifest.json
  2. 8 6
      Dockerfile
  3. 2 16
      apache/lamp.conf
  4. 3 1
      start.sh
  5. 0 10
      supervisor-apache2.conf
  6. 0 11
      supervisor/cron.conf
  7. 11 4
      website/DataBase/database.php

+ 3 - 2
CloudronManifest.json

@@ -9,12 +9,13 @@
   "httpPort": 80,
   "addons": {
     "localstorage": {},
+    "ldap": {},
     "mysql": {}
   },
   "minBoxVersion": "0.0.1",
-  "manifestVersion": 1,
+  "manifestVersion": 2,
   "website": "http://nebulon.de",
   "contactEmail": "johannes@nebulon.de",
   "icon": "",
-  "mediaLinks": [ ]
+  "mediaLinks": []
 }

+ 8 - 6
Dockerfile

@@ -13,22 +13,24 @@ RUN a2disconf other-vhosts-access-log
 RUN a2enmod rewrite headers rewrite expires cache
 
 # configure mod_php
+# default_charset is set due to https://www.saotn.org/php-56-default_charset-change-may-break-html-output/
 RUN crudini --set /etc/php/7.3/apache2/php.ini PHP upload_max_filesize 64M && \
     crudini --set /etc/php/7.3/apache2/php.ini PHP post_max_size 64M && \
     crudini --set /etc/php/7.3/apache2/php.ini PHP memory_limit 128M && \
-    crudini --set /etc/php/7.3/apache2/php.ini Session session.save_path /run/app/sessions && \
+    crudini --set /etc/php/7.3/apache2/php.ini Session session.save_path /run/sessions && \
     crudini --set /etc/php/7.3/apache2/php.ini Session session.gc_probability 1 && \
-    crudini --set /etc/php/7.3/apache2/php.ini Session session.gc_divisor 100
+    crudini --set /etc/php/7.3/apache2/php.ini Session session.gc_divisor 100 && \
+    crudini --set /etc/php/7.3/apache2/php.ini PHP default_charset ""
 
 # supervisor# configure supervisor
 ADD supervisor/ /etc/supervisor/conf.d/
 RUN sed -e 's,^logfile=.*$,logfile=/run/supervisord.log,' -i /etc/supervisor/supervisord.conf
 
-# copy app code
-ADD app /app/code/
+# copy website code mind the trailing slash to copy its content to /app/code/ not the folder itself
+ADD website/ /app/code/
 
-# copy website code
-ADD website /app/code/
+# copy app code
+ADD app /app/code/app
 
 RUN chown -R www-data.www-data /app/code
 

+ 2 - 16
apache/lamp.conf

@@ -1,10 +1,10 @@
 <VirtualHost *:80>
-    DocumentRoot /app/data/public
+    DocumentRoot /app/code
 
     ErrorLog "|/bin/cat"
     CustomLog "|/bin/cat" combined
 
-    <Directory /app/data/public>
+    <Directory /app/code>
         Options +FollowSymLinks
         AllowOverride All
         Require all granted
@@ -19,18 +19,4 @@
         RPAF_ForbidIfNotProxy   Off
     </IfModule>
 
-    ## PMA BEGIN
-
-    Alias /phpmyadmin /app/code/phpmyadmin
-
-    <Location /phpmyadmin>
-        AuthType Basic
-        AuthBasicProvider file
-        AuthName "LAMP App Authorization"
-        AuthUserFile /app/data/.phpmyadminauth
-        Require valid-user
-    </Location>
-
-    ## PMA END
-
 </VirtualHost>

+ 3 - 1
start.sh

@@ -2,7 +2,9 @@
 
 set -eux
 
-chown -R www-data:www-data /app/data /run/apache2 /run/app /tmp
+mkdir -p /run/sessions
+
+chown -R www-data:www-data /app/data /run /tmp
 
 echo "==> Starting Lamp stack"
 exec /usr/bin/supervisord --configuration /etc/supervisor/supervisord.conf --nodaemon -i Ursprung

+ 0 - 10
supervisor-apache2.conf

@@ -1,10 +0,0 @@
-[program:apache2]
-autorestart=true
-autostart=true
-command=/usr/bin/pidproxy /var/run/apache2/apache2.pid /bin/bash -c "source /etc/apache2/envvars && /usr/sbin/apache2 -DFOREGROUND"
-illasgroup=true
-priority=100
-stdout_logfile=/var/log/supervisor/%(program_name)s.log
-stderr_logfile=/var/log/supervisor/%(program_name)s.log
-stopasgroup=true
-

+ 0 - 11
supervisor/cron.conf

@@ -1,11 +0,0 @@
-[program:cron]
-directory=/
-command=/usr/sbin/cron -f -L 15
-user=root
-autostart=true
-autorestart=true
-stdout_logfile=/dev/stdout
-stdout_logfile_maxbytes=0
-stderr_logfile=/dev/stderr
-stderr_logfile_maxbytes=0
-

+ 11 - 4
website/DataBase/database.php

@@ -21,10 +21,17 @@ class Database
 
 	function connectToDb()
 	{
-		$host = "mysql5.nebulon.de";
-		$user = "db30675_9";
-		$password = "manda1337";
-		$db = "db30675_9";
+
+        $host = getenv('CLOUDRON_MYSQL_HOST');
+        $user = getenv('CLOUDRON_MYSQL_USERNAME');
+        $password = getenv('CLOUDRON_MYSQL_PASSWORD');
+        $db = getenv('CLOUDRON_MYSQL_DATABASE');
+        $port = getenv('CLOUDRON_MYSQL_PORT');
+
+		// $host = "mysql5.nebulon.de";
+		// $user = "db30675_9";
+		// $password = "manda1337";
+		// $db = "db30675_9";
 
 // 		$host = "localhost";
 // 		$user = "root";