Compare commits

...

13 Commits

18 changed files with 322 additions and 379 deletions

View File

@ -1,42 +1,51 @@
ARG UBUNTU_VERSION=14.04
FROM ubuntu:$UBUNTU_VERSION
# CKAN user
RUN useradd -l -M -s /bin/bash -u 997 ckan
FROM harbor.d4science.org/external-services/ckan-legacy-269:latest
LABEL org.d4science.image.licenses="EUPL-1.2" \
org.d4science.image.source="https://code-repo.d4science.org/D4Science/ckan-2-6-legacy" \
org.d4science.image.source="https://code-repo.d4science.org/D4Science/ckan-2-6-legacy/src/branch/ckan-2-6-bluecloud" \
org.d4science.image.vendor="D4Science <https://www.d4science.org>" \
org.d4science.image.authors="Andrea Dell'Amico <andrea.dellamico@isti.cnr.it>, Alfredo Oliviero <alfredo.oliviero@isti.cnr.it>"
org.d4science.image.authors="Francesco Mangiacrapa <francesco.mangiacrapa@isti.cnr.it>"
# Aggiorna pacchetti e installa i servizi necessari
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get dist-upgrade -y \
&& apt-get install -y python python-pip \
&& apt-get install -y supervisor redis-server apache2 libapache2-mod-wsgi libapache2-mod-rpaf libapache2-mod-xsendfile nginx-full memcached \
&& apt-get install -y libedit2 libpq5 postgresql-client \
&& apt-get clean
#Catalogue git repository
ARG CATALOGUE_REPOSITORY=https://code-repo.d4science.org/CKAN-Extensions/ckanext-d4science_theme.git
ARG CATALOGUE_DEFAULT_THEME_BRANCH_NAME=ckan-default
# Configura Supervisor
RUN mkdir -p /var/log/supervisor /var/log/ckan && chown ckan /var/log/ckan
#!!!! Attention !!!!! Change this parameter for any CKAN intance !!!!!
#Catalogue custom git repository name for the specific instance.
ARG CATALOGUE_CUSTOM_THEME_BRANCH_NAME=ckan-bluecloud.d4science.org
#Customize this argument according to CKAN instance
ARG CATALOGUE_CUSTOM_HOSTNAME=${CATALOGUE_CUSTOM_THEME_BRANCH_NAME}
# Creazione del file di configurazione per Supervisor
COPY conf/supervisord.conf /etc/supervisor/supervisord.conf
COPY conf/supervisord-ckan-services.conf /etc/supervisor/conf.d/ckan-services.conf
COPY conf/supervisord-ckan-harvesting.conf /etc/supervisor/conf.d/ckan-harvesting.conf
# Services configuration
COPY conf/apache_ckan_virthost.conf /etc/apache2/sites-enabled/ckan.conf
COPY conf/apache_ckan_datapusher.conf /etc/apache2/sites-enabled/datapusher.conf
COPY conf/apache_ports.conf /etc/apache2/ports.conf
COPY conf/nginx_ckan_virtualhost.conf /etc/nginx/sites-enabled/ckan.conf
COPY conf/redis-server.conf /etc/redis/redis.conf
COPY conf/nginx.conf /etc/nginx/nginx.conf
RUN rm -f /etc/apache2/sites-enabled/000-default.conf /etc/apache2/sites-available/000-default.conf /etc/nginx/sites-enabled/default
ADD ckan-dist/ckan-2.69.tar.gz /
ADD ckan-dist/ckan-etc.tar.gz /
#CKAN filesystem paths
ARG USR_LOCAL_BIN=/usr/local/bin
ARG SRV_CUSTOMIZATIONS=/srv/ckan_customisations
# Definisce Supervisor come entrypoint
# CMD ["/usr/bin/supervisord", "-n", "-c /etc/supervisor/supervisord.conf"]
CMD ["/usr/bin/supervisord", "-n"]
# Environment variables
#ENV with path to the CKAN CUSTOMIZATION FOR THE SPECIFIC INSTANCE
ENV CKAN_CUSTOMIZATION_THEME=${CATALOGUE_CUSTOM_THEME_BRANCH_NAME}
ARG E_USR_LOCAL_BIN=${USR_LOCAL_BIN}
ARG E_SRV_CUSTOMIZATIONS=${SRV_CUSTOMIZATIONS}
# Install the git client (if not present in the base image)
# rm -rf /var/lib/apt/lists/* clean the apt cache, so reducing the final image dimension
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
# cleanup the path
RUN rm -rf $E_USR_LOCAL_BIN/*
# Clone the git repo of CKAN_DEFAULT_THEME in the Docker image
RUN git clone -b $CATALOGUE_DEFAULT_THEME_BRANCH_NAME $CATALOGUE_REPOSITORY $E_SRV_CUSTOMIZATIONS/$CATALOGUE_DEFAULT_THEME_BRANCH_NAME
# Clone the git repo of CKAN_CUSTOMIZATION_THEME in the Docker image
RUN git clone -b $CKAN_CUSTOMIZATION_THEME $CATALOGUE_REPOSITORY $E_SRV_CUSTOMIZATIONS/$CATALOGUE_CUSTOM_THEME_BRANCH_NAME
# Copy the files for the CKAN customisations
COPY conf/d4s-ckan-customizer $E_USR_LOCAL_BIN/
# Create the '/scripts' folder and copy the 'file_installer.sh' to apply the CKAN customisations
RUN mkdir $E_SRV_CUSTOMIZATIONS/scripts
COPY conf/file_installer.sh $E_SRV_CUSTOMIZATIONS/scripts/
RUN chmod +x $E_SRV_CUSTOMIZATIONS/scripts/file_installer.sh
RUN chown -R ckan:ckan $E_SRV_CUSTOMIZATIONS/
# Apply the CKAN customisations via 'file_installer.sh'
RUN $E_SRV_CUSTOMIZATIONS/scripts/file_installer.sh
CMD ["/usr/bin/supervisord", "-n"]

2
Jenkinsfile vendored
View File

@ -9,7 +9,7 @@ pipeline {
label 'docker'
}
environment {
imagename = "external-services/ckan-legacy-269"
imagename = "external-services/ckan-2-6-bluecloud"
hubname = "harbor.d4science.org"
registryUrl = "https://harbor.d4science.org"
registryCredential = 'harbor-ckan-legacy'

View File

View File

@ -1,3 +1,17 @@
# ckan-2-6-legacy
# ckan-2-6-bluecloud
Repository containing a customized version of CKAN 2.6 for `ckan-bluecloud` installable in a Docker environment.
The `Dockerfile` starts from the https://code-repo.d4science.org/D4Science/ckan-2-6-legacy image and builds an image:
* with the instance customizations downloaded from https://code-repo.d4science.org/CKAN-Extensions/ckanext-d4science_theme/src/branch/ckan-bluecloud.d4science.org
* installing and applying the customizations (lincenses, language, plugins and so on) via `file_installer.sh`
## Authors
* **Francesco Mangiacrapa** ([ORCID](https://orcid.org/0000-0002-6528-664X)) Computer Scientist at [ISTI-CNR Infrascience Group](http://nemis.isti.cnr.it/groups/infrascience)
## License
This project is licensed under the EUPL V.1.1 License - see the [LICENSE.md](LICENSE.md) file for details.
Repository that holds a copy of our latest installation of CKAN 2.6, to make it installable inside a Docker environment.

Binary file not shown.

Binary file not shown.

View File

@ -1,24 +0,0 @@
<VirtualHost 0.0.0.0:8800>
ServerName ckan
# this is our app
WSGIScriptAlias / /etc/ckan/datapusher.wsgi
# pass authorization info on (needed for rest api)
WSGIPassAuthorization On
# Deploy as a daemon (avoids conflicts between CKAN instances)
WSGIDaemonProcess datapusher display-name=demo processes=1 threads=15
WSGIProcessGroup datapusher
ErrorLog /var/log/apache2/datapusher.error.log
CustomLog /var/log/apache2/datapusher.custom.log combined
<Directory "/" >
Require all granted
</Directory>
</VirtualHost>

View File

@ -1,28 +0,0 @@
WSGISocketPrefix /var/run/wsgi
<VirtualHost 127.0.0.1:8080>
ServerName ckan.d4science.org
ServerAlias ckan-*.d4science.org
WSGIScriptAlias / /etc/ckan/default/apache.wsgi
# pass authorization info on (needed for rest api)
WSGIPassAuthorization On
# Deploy as a daemon (avoids conflicts between CKAN instances)
WSGIDaemonProcess ckan_default display-name=ckan_default processes=2 threads=15
WSGIProcessGroup ckan_default
ErrorLog /var/log/apache2/ckan_default.error.log
CustomLog /var/log/apache2/ckan_default.custom.log combined
<IfModule mod_rpaf.c>
RPAFenable On
RPAFsethostname On
RPAFproxy_ips 127.0.0.1
</IfModule>
<Directory />
Require all granted
</Directory>
</VirtualHost>

View File

@ -1,2 +0,0 @@
Listen 8080
Listen 8800

38
conf/d4s-ckan-customizer Normal file
View File

@ -0,0 +1,38 @@
#!/bin/bash
RETVAL=
BASE_DIR=/srv/ckan_customisations
DATE=$( date )
CUSTOMIZER_LOG_FILE=/var/log/ckan/customiser.log
echo "$DATE" > /var/log/ckan/file_installer.log
logger "d4s-ckan-customizer: starting"
logger "d4s-ckan-customizer: update the svn repositories"
logger "d4s-ckan-customizer: update the svn scripts repository"
cd $BASE_DIR/scripts && svn update >> "$CUSTOMIZER_LOG_FILE" 2>&1
logger "d4s-ckan-customizer: update the svn ckan-default repository"
cd $BASE_DIR/ckan-default && svn update >> "$CUSTOMIZER_LOG_FILE" 2>&1
logger "d4s-ckan-customizer: update the svn $CATALOGUE_CUSTOM_THEME_BRANCH_NAME repository"
cd $BASE_DIR/$CATALOGUE_CUSTOM_THEME_BRANCH_NAME && svn update >> "$CUSTOMIZER_LOG_FILE" 2>&1
logger "d4s-ckan-customizer: install the custom files if the script is present"
if [ -x $BASE_DIR/scripts/file_installer ] ; then
echo "Install the d4s customisations" >> /var/log/ckan/file_installer.log
$BASE_DIR/scripts/file_installer >> /var/log/ckan/file_installer.log 2>&1
echo "Done"
logger "d4s-ckan-customizer: done"
else
logger "d4s-ckan-customizer: the file_installer script does not exist"
fi
echo "---------------" >> /var/log/ckan/file_installer.log
logger "d4s-ckan-customizer: reload apache"
sudo /etc/init.d/apache2 reload >/dev/null 2>&1
logger "d4s-ckan-customizer: run the f2ds harvester script"
/usr/lib/ckan/default/src/ckanext-dcat/ckanext/dcat/f2ds_harvester_run.sh >> "$CUSTOMIZER_LOG_FILE" 2>&1
logger "d4s-ckan-customizer: Done"

224
conf/file_installer.sh Normal file
View File

@ -0,0 +1,224 @@
#!/bin/bash
GLOBAL_BASE_DIR=ckan-default
CUSTOM_BASE_DIR=$CKAN_CUSTOMIZATION_THEME
BASE_DIRECTORY=/srv/ckan_customisations
GLOBAL_DIR=${BASE_DIRECTORY}/${GLOBAL_BASE_DIR}
CUSTOM_DIR=${BASE_DIRECTORY}/${CUSTOM_BASE_DIR}
GCUBE_LICENSE=gcube-data-catalogue-licenses.json
GCUBE_LICENSE_DEST=/etc/ckan/default/gcube-data-catalogue-licenses.json
CKAN_PYTHON_DIR=/usr/lib/ckan/default/lib/python2.7/site-packages
CKAN_APP_DIR=/usr/lib/ckan/default/src
install_gcube_license() {
echo -e "\n*** Install_gcube_license called"
if [ -f "${CUSTOM_DIR}/${GCUBE_LICENSE}" ] ; then
cp -f "${CUSTOM_DIR}/${GCUBE_LICENSE}" "${GCUBE_LICENSE_DEST}"
else
cp -f "${GLOBAL_DIR}/${GCUBE_LICENSE}" "${GCUBE_LICENSE_DEST}"
fi
}
GCUBE_LANG_NAME=en_gcube
GCUBE_LANG_DEST_DIR=${CKAN_APP_DIR}/ckan/ckan/i18n/${GCUBE_LANG_NAME}/LC_MESSAGES
GCUBE_I18N_DEST_DIR=${CKAN_APP_DIR}/ckan/ckan/lib
GCUBE_SOURCE_LANG_DIR=languages/default
GCUBE_INIT_LANG=1
install_gcube_lang() {
echo -e "\n*** Install_gcube_lang called"
if [ ! -d ${GCUBE_LANG_DEST_DIR} ] ; then
mkdir -p ${GCUBE_LANG_DEST_DIR}
GCUBE_INIT_LANG=0
fi
if [ -d "${CUSTOM_DIR}/${GCUBE_SOURCE_LANG_DIR}" ] ; then
cp -f "${CUSTOM_DIR}/${GCUBE_SOURCE_LANG_DIR}/${GCUBE_LANG_NAME}/LC_MESSAGES/ckan.po" "${GCUBE_LANG_DEST_DIR}"
cp -f "${CUSTOM_DIR}/${GCUBE_SOURCE_LANG_DIR}/i18n.py" "${GCUBE_I18N_DEST_DIR}/i18n.py"
else
cp -f "${GLOBAL_DIR}/${GCUBE_SOURCE_LANG_DIR}/${GCUBE_LANG_NAME}/LC_MESSAGES/ckan.po" "${GCUBE_LANG_DEST_DIR}"
cp -f "${GLOBAL_DIR}/${GCUBE_SOURCE_LANG_DIR}/i18n.py" "${GCUBE_I18N_DEST_DIR}/i18n.py"
fi
. /usr/lib/ckan/default/bin/activate
cd "${CKAN_APP_DIR}/ckan"
python setup.py compile_catalog --locale ${GCUBE_LANG_NAME}
# INSTALL ONLY DURING INIT
#if [ $GCUBE_INIT_LANG -eq 0 ] ; then
# . /usr/lib/ckan/default/bin/activate
# cd "${CKAN_APP_DIR}/ckan"
# python setup.py compile_catalog --locale ${GCUBE_LANG_NAME}
#fi
}
# D4Science theme. Many changes
GCUBE_D4S_THEME_NAME=ckanext-d4science_theme
GCUBE_D4S_THEME_DIR=${CKAN_APP_DIR}/${GCUBE_D4S_THEME_NAME}
checkout_ckan_theme() {
echo -e "\n*** Checkout_ckan_theme called"
pushd ${GCUBE_D4S_THEME_DIR}
svn update --force >/dev/null 2>&1
}
# D4Science theme. rsync from CKAN CUSTOM TEMPLATE to CKAN DEFAULT TEMPLATE
GCUBE_D4S_CUSTOM_THEME_SRC=${CUSTOM_DIR}/${GCUBE_D4S_THEME_NAME}/ckanext/d4science_theme/
#GCUBE_D4S_CUSTOM_THEME_SRC=${CUSTOM_DIR}/${GCUBE_D4S_THEME_NAME}/ckanext/d4science_theme/
GCUBE_D4S_DEFAULT_THEME_DEST=${GCUBE_D4S_THEME_DIR}/ckanext/d4science_theme/
install_theme_customisations() {
echo -e "\n*** Install theme customisations called"
if [ -d "${GCUBE_D4S_CUSTOM_THEME_SRC}" ] ; then
echo "CUSTOM THEME EXISTS AT: " "${GCUBE_D4S_CUSTOM_THEME_SRC}"
if [ -d ${GCUBE_D4S_DEFAULT_THEME_DEST} ] ; then
echo "DEFAULT THEME EXISTS AT: " ${GCUBE_D4S_DEFAULT_THEME_DEST}
rsync -av "${GCUBE_D4S_CUSTOM_THEME_SRC}" ${GCUBE_D4S_DEFAULT_THEME_DEST}
else
echo "DEFAULT THEME DOES NOT EXIST AT: " ${GCUBE_D4S_DEFAULT_THEME_DEST}
fi
else
echo "CUSTOM THEME DOES NOT EXIST AT: " "${GCUBE_D4S_CUSTOM_THEME_SRC}"
fi
}
# privatedatasets (plugin)
GCUBE_D4S_SNIPPETS_PKG_DIR=plugins/privatedatasets
GCUBE_D4S_SNIPPETS_PKG_ITEM=${GCUBE_D4S_SNIPPETS_PKG_DIR}/package_item.html
SNIPPETS_PKG_ITEM_DEST=${CKAN_PYTHON_DIR}/ckanext/privatedatasets/templates/snippets/package_item.html
GCUBE_D4S_SNIPPETS_PY_FILES="plugin.py auth.py"
install_privatedatasets_customisations() {
echo -e "\n*** Install_privatedatasets_customisations called"
if [ -z "$1" ] ; then
GCUBE_D4S_SNIPPETS_PKG_ITEM=${GCUBE_D4S_SNIPPETS_PKG_DIR}/package_item.html
echo "No package_item file passed as parameter, using default: ${GCUBE_D4S_SNIPPETS_PKG_ITEM}"
else
GCUBE_D4S_SNIPPETS_PKG_ITEM=$1
echo "Target package_item file passed as parameter using it: ${GCUBE_D4S_SNIPPETS_PKG_ITEM}"
fi
if [ -d ${CKAN_PYTHON_DIR}/ckanext/privatedatasets ] ; then
if [ -f "${CUSTOM_DIR}/${GCUBE_D4S_SNIPPETS_PKG_ITEM}" ] ; then
cp -f "${CUSTOM_DIR}/${GCUBE_D4S_SNIPPETS_PKG_ITEM}" "${SNIPPETS_PKG_ITEM_DEST}"
echo "${CUSTOM_DIR}/${GCUBE_D4S_SNIPPETS_PKG_ITEM} copied to: ${SNIPPETS_PKG_ITEM_DEST}"
else
cp -f ${GLOBAL_DIR}/${GCUBE_D4S_SNIPPETS_PKG_ITEM} ${SNIPPETS_PKG_ITEM_DEST}
echo "${GLOBAL_DIR}/${GCUBE_D4S_SNIPPETS_PKG_ITEM} copied to: ${SNIPPETS_PKG_ITEM_DEST}"
fi
for pyfile in ${GCUBE_D4S_SNIPPETS_PY_FILES} ; do
if [ -f "${CUSTOM_DIR}/${GCUBE_D4S_SNIPPETS_PKG_DIR}/${pyfile}" ] ; then
cp -f "${CUSTOM_DIR}/${GCUBE_D4S_SNIPPETS_PKG_DIR}/${pyfile}" "${CKAN_PYTHON_DIR}/ckanext/privatedatasets/${pyfile}"
else
cp -f "${GLOBAL_DIR}/${GCUBE_D4S_SNIPPETS_PKG_DIR}/${pyfile}" "${CKAN_PYTHON_DIR}/ckanext/privatedatasets/${pyfile}"
fi
done
else
echo "install_privatedatasets_customisations: the directory ${CKAN_PYTHON_DIR}/ckanext/privatedatasets does not exist. Doing nothing"
fi
}
# privatedatasets (plugin), see #21867
# install privatedatasets customisations with open access to resources
# param $1: the ckan hostname where install
install_privatedatasets_customisations_with_open_access_to_resources() {
echo -e "\n*** Install_privatedatasets_customisations_with_open_access_to_resources called"
hs=`hostname`
echo "read hostname: ${hs}"
if [ -z "$1" ] ; then
echo "WARN: no ckan hostname as input parameters.. Doing nothing"
else
if [ "$1" = "$hs" ]; then
GCUBE_D4S_SNIPPETS_PKG_ITEM=${GCUBE_D4S_SNIPPETS_PKG_DIR}/package_item_open_access_to_resources.html
echo "The input parameter is matching the ckan hostname $1, going to install ${GCUBE_D4S_SNIPPETS_PKG_ITEM}"
install_privatedatasets_customisations "${GCUBE_D4S_SNIPPETS_PKG_ITEM}"
else
echo "WARN: the ckan hostname $1 does not matching with ${hs}. Doing nothing"
fi
fi
}
# install_plugin_customisations
install_plugin_customisations() {
echo -e "\n*** Installing customisations for plugin: $1"
if [ -d "$1" ] ; then
if [ -d "$2" ] ; then
if [ -d "$3" ] ; then
echo "RSYNC FROM: $2 TO: $3"
rsync -av "$2" "$3"
else
echo "ERROR: the plugin destion directory does not exist at: $3"
fi
else
echo "ERROR: the plugin default directory does not exist at: $2"
fi
else
echo "WARNING: the directory $1 does not exist. Doing nothing"
fi
}
# make the input file executable
make_file_executable() {
if [ -f "$1" ]; then
echo "$1 exists making it executable"
chmod +x "$1"
fi
}
########## Main ##########
# The gcube license needs root. Do not use for the time being
#install_gcube_license
install_gcube_lang
checkout_ckan_theme
install_theme_customisations
install_privatedatasets_customisations
install_privatedatasets_customisations_with_open_access_to_resources "ckan-d-d4s"
install_privatedatasets_customisations_with_open_access_to_resources "ckan-openscience.int.d4science.net"
# ckanext-geonetwork
install_plugin_customisations "${CKAN_APP_DIR}/ckanext-geonetwork" "${GLOBAL_DIR}/plugins/ckanext-geonetwork/ckanext/geonetwork/" "${CKAN_APP_DIR}/ckanext-geonetwork/ckanext/geonetwork/"
# ckanext-googleanalytics
#install_plugin_customisations "${CKAN_APP_DIR}/ckanext-googleanalytics" "${GLOBAL_DIR}/plugins/ckanext-googleanalytics/ckanext/googleanalytics/" "${CKAN_APP_DIR}/ckanext-googleanalytics/ckanext/googleanalytics/"
# ckanext-harvest
install_plugin_customisations "${CKAN_APP_DIR}/ckanext-harvest" "${GLOBAL_DIR}/plugins/ckanext-harvest/ckanext/harvest/" "${CKAN_APP_DIR}/ckanext-harvest/ckanext/harvest/"
# ckanext-hierarchy
install_plugin_customisations "${CKAN_APP_DIR}/ckanext-hierarchy" "${GLOBAL_DIR}/plugins/ckanext-hierarchy/ckanext/hierarchy/" "${CKAN_APP_DIR}/ckanext-hierarchy/ckanext/hierarchy/"
# ckanext-oaipm
install_plugin_customisations "${CKAN_APP_DIR}/ckanext-oaipm" "${GLOBAL_DIR}/plugins/ckanext-oaipm/ckanext/oaipmh/" "${CKAN_APP_DIR}/ckanext-oaipm/ckanext/oaipmh/"
# ckanext-spatial
install_plugin_customisations "${CKAN_APP_DIR}/ckanext-spatial" "${GLOBAL_DIR}/plugins/ckanext-spatial/ckanext/spatial/" "${CKAN_APP_DIR}/ckanext-spatial/ckanext/spatial/"
# ckanext-dcat
install_plugin_customisations "${CKAN_APP_DIR}/ckanext-dcat" "${GLOBAL_DIR}/plugins/ckanext-dcat/ckanext/dcat/" "${CKAN_APP_DIR}/ckanext-dcat/ckanext/dcat/"
FILE="${CKAN_APP_DIR}/ckanext-dcat/ckanext/dcat/f2ds_harvester.py"
make_file_executable "$FILE"
FILE="${CKAN_APP_DIR}/ckanext-dcat/ckanext/dcat/f2ds_harvester_run.sh"
make_file_executable "$FILE"
# TESTING
# ckanext-spatial
#install_plugin_customisations "${CKAN_APP_DIR}/ckanext-spatial" "${GLOBAL_DIR}/plugins/ckanext-spatial/ckanext/spatial/" "/home/francesco-mangiacrapa/CKAN/ckanext-spatial/ckanext/spatial/"
# ckanext-hierarchy
#install_plugin_customisations "${CKAN_APP_DIR}/ckanext-hierarchy" "${GLOBAL_DIR}/plugins/ckanext-hierarchy/ckanext/hierarchy/" "/home/francesco-mangiacrapa/CKAN/ckanext-hierarchy/ckanext/hierarchy/"
# ckanext-googleanalytics
#install_plugin_customisations "${CKAN_APP_DIR}/ckanext-googleanalytics" "${GLOBAL_DIR}/plugins/ckanext-googleanalytics/ckanext/googleanalytics/" "/home/francesco-mangiacrapa/CKAN/ckanext-googleanalytics/ckanext/googleanalytics/"
#
echo "Finished installation of plugin customisations"
# Esegui il comando passato come argomento
# es. Avvia supervisord in foreground come: exec /usr/bin/supervisord -n
echo "\nExecuting the input command: "+$@
exec "$@"

View File

@ -1,48 +0,0 @@
# memcached default config file
# 2003 - Jay Bonci <jaybonci@debian.org>
# This configuration file is read by the start-memcached script provided as
# part of the Debian GNU/Linux distribution.
# Run memcached as a daemon. This command is implied, and is not needed for the
# daemon to run. See the README.Debian that comes with this package for more
# information.
# -d
# Log memcached's output to /var/log/memcached
logfile /var/log/memcached.log
# Be verbose
# -v
# Be even more verbose (print client commands as well)
# -vv
# Start with a cap of 64 megs of memory. It's reasonable, and the daemon default
# Note that the daemon will grow to this size, but does not start out holding this much
# memory
-m 64
# Default connection port is 11211
-p 11211
# Run the daemon as root. The start-memcached will default to running as root if no
# -u command is present in this config file
-u memcache
# Specify which IP address to listen on. The default is to listen on all IP addresses
# This parameter is one of the only security measures that memcached has, so make sure
# it's listening on a firewalled interface.
-l 127.0.0.1
# Limit the number of simultaneous incoming connections. The daemon default is 1024
# -c 1024
# Lock down all paged memory. Consult with the README and homepage before you do this
# -k
# Return error when memory is exhausted (rather than removing items)
# -M
# Maximize core file limit
# -r

View File

@ -1,51 +0,0 @@
user www-data;
worker_processes 4;
pid /run/nginx.pid;
daemon off;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}

View File

@ -1,48 +0,0 @@
proxy_cache_path /tmp/nginx_cache levels=1:2 keys_zone=cache:30m max_size=250m;
proxy_temp_path /tmp/nginx_proxy 1 2;
server {
listen 80;
server_name _;
client_max_body_size 100M;
# Proxy parameters
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $remote_addr;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header nginx-request-uri $request_uri;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering on;
proxy_buffer_size 128k;
proxy_buffers 4 128k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 128k;
proxy_redirect off;
proxy_connect_timeout 30s;
proxy_read_timeout 480s;
proxy_send_timeout 120s;
location / {
add_header 'Access-Control-Allow-Origin' '$http_origin';
if ($request_method = OPTIONS ) {
return 204;
}
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With,Accept-Language,X-CustomHeader,Content-Range,Range,Observe';
add_header 'Access-Control-Expose-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With,Accept-Language,X-CustomHeader,Content-Range,Range,Observe';
proxy_pass http://127.0.0.1:8080/;
proxy_set_header X-Url-Scheme $scheme;
proxy_cache cache;
proxy_cache_bypass $cookie_auth_tkt;
proxy_no_cache $cookie_auth_tkt;
proxy_cache_valid 30m;
proxy_cache_key $host$scheme$proxy_host$request_uri;
# In emergency comment out line to force caching
# proxy_ignore_headers X-Accel-Expires Expires Cache-Control;
}
}

View File

@ -1,47 +0,0 @@
daemonize no
pidfile /var/run/redis/redis-server.pid
port 6379
bind 127.0.0.1
timeout 0
tcp-keepalive 60
loglevel notice
logfile /var/log/redis/redis-server.log
syslog-enabled no
# syslog-facility local0
databases 16
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir /var/lib/redis
slave-serve-stale-data yes
slave-read-only yes
repl-disable-tcp-nodelay no
slave-priority 100
appendonly no
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
lua-time-limit 5000
slowlog-log-slower-than 10000
slowlog-max-len 128
notify-keyspace-events ""
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-entries 512
list-max-ziplist-value 64
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit slave 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
aof-rewrite-incremental-fsync yes

View File

@ -1,32 +0,0 @@
; ===============================
; ckan harvester
; ===============================
[program:ckan_gather_consumer]
command=/usr/lib/ckan/default/bin/paster --plugin=ckanext-harvest harvester gather_consumer --config=/etc/ckan/default/production.ini
; user that owns virtual environment.
user=ckan
numprocs=1
stdout_logfile=/var/log/ckan/gather_consumer.log
stderr_logfile=/var/log/ckan/gather_consumer.log
autostart=true
autorestart=true
startsecs=10
[program:ckan_fetch_consumer]
command=/usr/lib/ckan/default/bin/paster --plugin=ckanext-harvest harvester fetch_consumer --config=/etc/ckan/default/production.ini
; user that owns virtual environment.
user=ckan
numprocs=1
stdout_logfile=/var/log/ckan/fetch_consumer.log
stderr_logfile=/var/log/ckan/fetch_consumer.log
autostart=true
autorestart=true
startsecs=10

View File

@ -1,32 +0,0 @@
[program:redis]
command=/etc/init.d/redis-server start
autostart=true
autorestart=true
stderr_logfile=/var/log/redis.err.log
stdout_logfile=/var/log/redis.out.log
[program:nginx]
command=/etc/init.d/nginx start
autostart=true
autorestart=true
stderr_logfile=/var/log/nginx.err.log
stdout_logfile=/var/log/nginx.out.log
[program:memcached]
command=/usr/bin/memcached -m 64 -p 11211 -u memcache -l 127.0.0.1
autostart=true
autorestart=true
stderr_logfile=/var/log/memcached.err.log
stdout_logfile=/var/log/memcached.out.log
[program:ckan]
command=/usr/bin/pidproxy /var/run/apache2/apache2.pid /bin/bash -c " . /etc/apache2/envvars && /usr/sbin/apache2 -DFOREGROUND -k start "
autostart=true
autorestart=true
stderr_logfile=/var/log/apache2.err.log
stdout_logfile=/var/log/apache2.out.log
redirect_stderr=true
user=root
killasgroup=true
stopasgroup=true

View File

@ -1,30 +0,0 @@
; supervisor config file
[unix_http_server]
file=/var/run/supervisor.sock ; (the path to the socket file)
chmod=0700 ; sockef file mode (default 0700)
[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP)
user=root
; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket
; The [include] section can just contain the "files" setting. This
; setting can list multiple files (separated by whitespace or
; newlines). It can also contain wildcards. The filenames are
; interpreted as relative to this file. Included files *cannot*
; include files themselves.
[include]
files = /etc/supervisor/conf.d/*.conf