Commit 3defe4cd authored by Johannes Zellner's avatar Johannes Zellner

Initial commit

parents
.git
.gitignore
.dockerignore
test
CloudronManifest.json
README.md
DESCRIPTION.md
medialinks/
test/node_modules
[1.0.0]
* Initial release
{
"id": "prg.limesurvey.cloudronapp",
"title": "LimeSurvey",
"author": "LimeSurvey developers",
"contactEmail": "support@cloudron.io",
"description": "file://DESCRIPTION.md",
"tagline": "Professional online surveys",
"tags": [
"survey",
"polls"
],
"version": "1.0.0",
"healthCheckPath": "/",
"httpPort": 80,
"manifestVersion": 1,
"website": "https://www.limesurvey.org",
"icon": "file://logo.png",
"changelog": "file://CHANGELOG",
"addons": {
"mysql": {},
"localstorage": {}
},
"mediaLinks": [
],
"minBoxVersion": "1.8.1",
"documentationUrl": "https://cloudron.io/documentation/apps/limesurvey/"
}
### Overview
This app packages LimeSurvey <upstream>3.6.3</upstream>
FROM cloudron/base:0.10.0
RUN mkdir -p /app/code
WORKDIR /app/code
RUN apt-get update && apt-get install -y php-ldap php-zip php-imap && rm -r /var/cache/apt /var/lib/apt/lists
RUN curl -L "https://www.limesurvey.org/stable-release?download=2331:limesurvey362%20180406tarbz2" | tar -xj --strip-components 1 -f -
# configure apache
RUN rm /etc/apache2/sites-enabled/*
RUN sed -e 's,^ErrorLog.*,ErrorLog "|/bin/cat",' -i /etc/apache2/apache2.conf
COPY apache/mpm_prefork.conf /etc/apache2/mods-available/mpm_prefork.conf
RUN a2disconf other-vhosts-access-log && a2enmod rewrite
COPY apache/limesurvey.conf /etc/apache2/sites-enabled/limesurvey.conf
RUN crudini --set /etc/php/7.0/apache2/php.ini PHP upload_max_filesize 5G && \
crudini --set /etc/php/7.0/apache2/php.ini PHP post_max_size 5G && \
crudini --set /etc/php/7.0/apache2/php.ini opcache opcache.enable 1 && \
crudini --set /etc/php/7.0/apache2/php.ini opcache opcache.enable_cli 1 && \
crudini --set /etc/php/7.0/apache2/php.ini opcache opcache.interned_strings_buffer 8 && \
crudini --set /etc/php/7.0/apache2/php.ini opcache opcache.max_accelerated_files 10000 && \
crudini --set /etc/php/7.0/apache2/php.ini opcache opcache.memory_consumption 128 && \
crudini --set /etc/php/7.0/apache2/php.ini opcache opcache.save_comments 1 && \
crudini --set /etc/php/7.0/apache2/php.ini opcache opcache.revalidate_freq 1 && \
crudini --set /etc/php/7.0/apache2/php.ini Session session.save_path /run/sessions && \
crudini --set /etc/php/7.0/apache2/php.ini Session session.gc_probability 1 && \
crudini --set /etc/php/7.0/apache2/php.ini Session session.gc_divisor 100
RUN rm -rf /app/code/tmp && ln -s /run/tmp /app/code/tmp && \
rm -rf /app/code/upload && ln -s /app/data/upload /app/code/upload
ADD start.sh /app/
RUN chown -R www-data.www-data /app/code
CMD [ "/app/start.sh" ]
MIT License (MIT)
Copyright (c) 2016 Cloudron UG
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# LimeSurvey Cloudron App
This repository contains the Cloudron app package source for [LimeSurvey](https://www.limesurvey.org).
## Installation
[![Install](https://cloudron.io/img/button.svg)](https://cloudron.io/button.html?app=org.limesurvey.cloudronapp)
or using the [Cloudron command line tooling](https://cloudron.io/references/cli.html)
```
cloudron install --appstore-id org.limesurvey.cloudronapp
```
## Building
The app package can be built using the [Cloudron command line tooling](https://cloudron.io/references/cli.html).
```
cd limesurvey-app
cloudron build
cloudron install
```
## Testing
The e2e tests are located in the `test/` folder and require [nodejs](http://nodejs.org/).
```
cd limesurvey-app/test
npm install
USERNAME=<cloudron username> PASSWORD=<cloudron password> mocha test.js
```
<VirtualHost *:80>
DocumentRoot /app/code
ErrorLog "|/bin/cat"
CustomLog "|/bin/cat" combined
<Directory /app/code/>
Options +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
# some directories must be protected
<Directory /app/code/config>
Options -FollowSymLinks
AllowOverride None
<IfModule mod_php7.c>
php_admin_flag engine off
</IfModule>
</Directory>
<Directory /app/code/data>
Options -FollowSymLinks
AllowOverride None
<IfModule mod_php7.c>
php_admin_flag engine off
</IfModule>
</Directory>
</VirtualHost>
<IfModule mpm_prefork_module>
# On startup, start these many servers
StartServers 2
# At any given time, keep atleast these many servers
MinSpareServers 2
# At any given time, keep atmost these many idle servers (this is always >= MinSpareServers+1)
MaxSpareServers 3
# Maximum number of servers at any given instant. Requests will be queued after this
MaxRequestWorkers 150
# Recycle process after handling these many requests. This protected against accidental memory leaks
MaxConnectionsPerChild 100
</IfModule>
logo.png

47.5 KB

#!/bin/bash
set -eu
# Do not use tmp directly due to tmpreaper removeing built assets
mkdir -p /run/sessions /run/tmp/runtime /run/tmp/assets
chown -R www-data.www-data /run
echo "==> Configure database"
sed -e "s/'connectionString' => '.*',/'connectionString' => 'mysql:host=${MYSQL_HOST};port=${MYSQL_PORT};dbname=${MYSQL_DATABASE};',/" \
-e "s/'username' => '.*',/'username' => '${MYSQL_USERNAME}',/" \
-e "s/'password' => '.*',/'password' => '${MYSQL_PASSWORD}',/" \
/app/code/application/config/config-sample-mysql.php > /run/config.php
if [[ -z "$(ls -A /app/data)" ]]; then
echo "==> Run installation script"
sudo -u www-data php /app/code/application/commands/console.php install admin password Admin admin@example.com
fi
echo "==> Ensure folders"
mkdir -p /app/data/upload
echo "==> Ensure permissions"
chown -R www-data.www-data /app/data /run
echo "==> Run database schema update"
sudo -u www-data php /app/code/application/commands/console.php updatedb
echo "==> Start apache"
APACHE_CONFDIR="" source /etc/apache2/envvars
rm -f "${APACHE_PID_FILE}"
exec /usr/sbin/apache2 -DFOREGROUND
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment