Bläddra i källkod

Initial commit

Johannes Zellner 9 år sedan
incheckning
a19c037567
9 ändrade filer med 204 tillägg och 0 borttagningar
  1. 2 0
      .dockerignore
  2. 41 0
      CHANGELOG
  3. 25 0
      CloudronManifest.json
  4. 22 0
      DESCRIPTION.md
  5. 27 0
      Dockerfile
  6. 49 0
      README.md
  7. 27 0
      apache2-wordpress.conf
  8. BIN
      icon.png
  9. 11 0
      start.sh

+ 2 - 0
.dockerignore

@@ -0,0 +1,2 @@
+test/*
+.git/*

+ 41 - 0
CHANGELOG

@@ -0,0 +1,41 @@
+[0.2.0]
+- initial version
+
+[0.2.1]
+- Fix session path
+
+[0.3.0]
+- improved apache configuration
+
+[0.4.0]
+- set targetBoxVersion
+
+[0.5.0]
+- Update to version 4.4.1
+
+[0.5.1]
+- Fix bug where some plugins don't work
+
+[0.5.2]
+- Make permalink configuration work
+
+[0.5.3]
+- Update to version 4.4.2
+
+[0.5.4]
+- Change the sender email name
+
+[0.5.5]
+- Fix username login
+
+[0.6.0]
+- Update to Wordpress 4.5
+- Allow login via email
+
+[0.6.1]
+- Fix generation of emails when resetting admin credentials
+
+[0.6.2]
+- Enable SMTP auth
+- Update to WordPress 4.5.2
+

+ 25 - 0
CloudronManifest.json

@@ -0,0 +1,25 @@
+{
+  "id": "lamp.cloudronapp",
+  "title": "LAMP app",
+  "author": "Cloudron developers",
+  "description": "file://DESCRIPTION.md",
+  "tagline": "An empty LAMP app",
+  "version": "0.1.0",
+  "healthCheckPath": "/",
+  "httpPort": 8000,
+  "manifestVersion": 1,
+  "website": "https://cloudron.io/",
+  "contactEmail": "apps@cloudron.io",
+  "icon": "icon.png",
+  "addons": {
+    "mysql": {},
+    "localstorage": {},
+    "sendmail": {},
+    "ldap": {}
+  },
+  "tags": [ "apache", "php", "mysql", "linux" ],
+  "developmentMode": false,
+  "mediaLinks": [],
+  "changelog": "file://CHANGELOG",
+  "minBoxVersion": "0.13.3"
+}

+ 22 - 0
DESCRIPTION.md

@@ -0,0 +1,22 @@
+Empty LAMP Stack. Use `cloudron push` to copy files into `/app/data/` and `cloudron exec` to get a remote terminal.
+
+See https://cloudron.io/references/cli.html for how to get the `cloudron` command line tool.
+
+If you want to run for example a custom WordPress within this app, please note that the code will run behind a nginx proxy.
+Apps like WordPress require you to let the app know about that fact.
+For WordPress you would need to put this code into `wp-config.php`:
+
+```
+/*
+ http://cmanios.wordpress.com/2014/04/12/nginx-https-reverse-proxy-to-wordpress-with-apache-http-and-different-port/
+ http://wordpress.org/support/topic/compatibility-with-wordpress-behind-a-reverse-proxy
+ https://wordpress.org/support/topic/wp_home-and-wp_siteurl
+ */
+// If WordPress is behind reverse proxy which proxies https to http
+if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
+    $_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST'];
+
+    if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
+        $_SERVER['HTTPS']='on';
+}
+```

+ 27 - 0
Dockerfile

@@ -0,0 +1,27 @@
+FROM cloudron/base:0.8.1
+MAINTAINER Johannes Zellner <johannes@cloudron.io>
+
+RUN mkdir -p /app/data /app/code /run/wordpress/sessions
+WORKDIR /app/data
+
+# configure apache
+RUN rm /etc/apache2/sites-enabled/*
+RUN sed -e 's,^ErrorLog.*,ErrorLog "|/bin/cat",' -i /etc/apache2/apache2.conf
+RUN sed -e "s,MaxSpareServers[^:].*,MaxSpareServers 5," -i /etc/apache2/mods-available/mpm_prefork.conf
+
+RUN a2disconf other-vhosts-access-log
+ADD apache2-wordpress.conf /etc/apache2/sites-available/wordpress.conf
+RUN ln -sf /etc/apache2/sites-available/wordpress.conf /etc/apache2/sites-enabled/wordpress.conf
+RUN echo "Listen 8000" > /etc/apache2/ports.conf
+
+# configure mod_php
+RUN a2enmod php5
+RUN a2enmod rewrite
+RUN sed -e 's/upload_max_filesize = .*/upload_max_filesize = 8M/' \
+        -e 's,;session.save_path.*,session.save_path = "/run/wordpress/sessions",' \
+        -i /etc/php5/apache2/php.ini
+
+ADD installer.php /app/code/installer.php
+ADD start.sh /app/code/start.sh
+
+CMD [ "/app/code/start.sh" ]

+ 49 - 0
README.md

@@ -0,0 +1,49 @@
+# Wordpress Cloudron App
+
+This repository contains the Cloudron app package source for a plain LAMP stack.
+
+## Installation
+
+[![Install](https://cloudron.io/img/button.svg)](https://cloudron.io/button.html?app=org.wordpress.cloudronapp)
+
+or using the [Cloudron command line tooling](https://cloudron.io/references/cli.html)
+
+```
+cloudron install --appstore-id lamp.cloudronapp
+```
+
+## Building
+
+The app package can be built using the [Cloudron command line tooling](https://cloudron.io/references/cli.html).
+
+```
+cd wordpress-app
+
+cloudron build
+cloudron install
+```
+
+## Usage
+
+Use `cloudron push` to copy files into `/app/data/` and `cloudron exec` to get a remote terminal.
+
+See https://cloudron.io/references/cli.html for how to get the `cloudron` command line tool.
+
+If you want to run for example a custom WordPress within this app, please note that the code will run behind a nginx proxy.
+Apps like WordPress require you to let the app know about that fact.
+For WordPress you would need to put this code into `wp-config.php`:
+
+```
+/*
+ http://cmanios.wordpress.com/2014/04/12/nginx-https-reverse-proxy-to-wordpress-with-apache-http-and-different-port/
+ http://wordpress.org/support/topic/compatibility-with-wordpress-behind-a-reverse-proxy
+ https://wordpress.org/support/topic/wp_home-and-wp_siteurl
+ */
+// If WordPress is behind reverse proxy which proxies https to http
+if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
+    $_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST'];
+
+    if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
+        $_SERVER['HTTPS']='on';
+}
+```

+ 27 - 0
apache2-wordpress.conf

@@ -0,0 +1,27 @@
+<VirtualHost *:8000>
+    DocumentRoot /app/data
+
+    ErrorLog "|/bin/cat"
+    CustomLog "|/bin/cat" combined
+
+    <Directory /app/data/>
+        Options +FollowSymLinks
+        AllowOverride All
+        Require all granted
+
+        <IfModule mod_php5.c>
+            php_value memory_limit 64m
+        </IfModule>
+
+    </Directory>
+
+    # some directories must be protected
+   <Directory /app/data/wp-content>
+        DirectoryIndex Off
+        AllowOverride None
+        <IfModule mod_php5.c>
+            php_admin_flag engine off
+        </IfModule>
+    </Directory>
+</VirtualHost>
+

BIN
icon.png


+ 11 - 0
start.sh

@@ -0,0 +1,11 @@
+#!/bin/bash
+
+set -eu
+
+mkdir -p /app/data
+chown -R www-data:www-data /app/data /run/wordpress
+
+echo "Starting apache"
+APACHE_CONFDIR="" source /etc/apache2/envvars
+rm -f "${APACHE_PID_FILE}"
+exec /usr/sbin/apache2 -DFOREGROUND