<commit_before>#!/bin/bash
#
# SwiftGate Debian Deployment Script
# ==================================
#
# This file is part of SwiftGate.
#
# SwiftGate is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# SwiftGate is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with SwiftGate.  If not, see <http://www.gnu.org/licenses/>.

# Add the RabbitMQ public key to the trusted key list.
wget -qO- http://www.rabbitmq.com/rabbitmq-signing-key-public.asc | apt-key add -
	 	
# Add the RabbitMQ repository to the sources.
echo deb http://www.rabbitmq.com/debian/ testing main >> /etc/apt/sources.list

# Update the sources.
apt-get update

# Upgrade the existing packages.
apt-get upgrade -y

# Install the other necessary Debian packages.
apt-get install -y apache2 libapache2-mod-wsgi python-pip rabbitmq-server git

# Install the necessary Python packages.
pip install flask python-memcached pika

# Create a user for SwiftGate processes to run as.
adduser --disabled-password --gecos "" swiftgate

# Create a local clone of the application.
git clone https://github.com/ushahidi/swiftgate.git /var/www/swiftgate

# Replace the default Apache configuration with the bundled one.
cp /var/www/swiftgate/deploy/debian/apache.conf /etc/apache2/sites-enabled/000-default

# Tell Apache to reload its configuration.
/etc/init.d/apache2 reload

# Download Membase.
wget -O /tmp/membase-server-community_x86_64_1.7.1.deb http://packages.couchbase.com/releases/1.7.1/membase-server-community_x86_64_1.7.1.deb

# Install Membase.
dpkg -i /tmp/membase-server-community_x86_64_1.7.1.deb

# Remove the Membase installer.
rm -f /tmp/membase-server-community_x86_64_1.7.1.deb
<commit_msg>Added RabbitMQ Management.<commit_after>#!/bin/bash
#
# SwiftGate Debian Deployment Script
# ==================================
#
# This file is part of SwiftGate.
#
# SwiftGate is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# SwiftGate is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with SwiftGate.  If not, see <http://www.gnu.org/licenses/>.

# Add the RabbitMQ public key to the trusted key list.
wget -qO- http://www.rabbitmq.com/rabbitmq-signing-key-public.asc | apt-key add -
	 	
# Add the RabbitMQ repository to the sources.
echo deb http://www.rabbitmq.com/debian/ testing main >> /etc/apt/sources.list

# Update the sources.
apt-get update

# Upgrade the existing packages.
apt-get upgrade -y

# Install the other necessary Debian packages.
apt-get install -y apache2 libapache2-mod-wsgi python-pip rabbitmq-server git

# Install the necessary Python packages.
pip install flask python-memcached pika

# Create a user for SwiftGate processes to run as.
adduser --disabled-password --gecos "" swiftgate

# Create a local clone of the application.
git clone https://github.com/ushahidi/swiftgate.git /var/www/swiftgate

# Replace the default Apache configuration with the bundled one.
cp /var/www/swiftgate/deploy/debian/apache.conf /etc/apache2/sites-enabled/000-default

# Tell Apache to reload its configuration.
/etc/init.d/apache2 reload

# Install RabbitMQ management plugins.
wget -O /tmp/mochiweb-1.3-rmq2.5.1-git9a53dbd.ez http://www.rabbitmq.com/releases/plugins/v2.5.1/mochiweb-1.3-rmq2.5.1-git9a53dbd.ez
mv /tmp/mochiweb-1.3-rmq2.5.1-git9a53dbd.ez /usr/lib/rabbitmq/lib/rabbitmq_server-*/plugins/
wget -O /tmp/webmachine-1.7.0-rmq2.5.1-hg0c4b60a.ez http://www.rabbitmq.com/releases/plugins/v2.5.1/webmachine-1.7.0-rmq2.5.1-hg0c4b60a.ez
mv /tmp/webmachine-1.7.0-rmq2.5.1-hg0c4b60a.ez /usr/lib/rabbitmq/lib/rabbitmq_server-*/plugins/
wget -O /tmp/rabbitmq_mochiweb-2.5.1.ez http://www.rabbitmq.com/releases/plugins/v2.5.1/rabbitmq_mochiweb-2.5.1.ez
mv /tmp/rabbitmq_mochiweb-2.5.1.ez /usr/lib/rabbitmq/lib/rabbitmq_server-*/plugins/
wget -O /tmp/amqp_client-2.5.1.ez http://www.rabbitmq.com/releases/plugins/v2.5.1/amqp_client-2.5.1.ez
mv /tmp/amqp_client-2.5.1.ez /usr/lib/rabbitmq/lib/rabbitmq_server-*/plugins/
wget -O /tmp/rabbitmq_management_agent-2.5.1.ez http://www.rabbitmq.com/releases/plugins/v2.5.1/rabbitmq_management_agent-2.5.1.ez
mv /tmp/rabbitmq_management_agent-2.5.1.ez /usr/lib/rabbitmq/lib/rabbitmq_server-*/plugins/
wget -O /tmp/rabbitmq_management-2.5.1.ez http://www.rabbitmq.com/releases/plugins/v2.5.1/rabbitmq_management-2.5.1.ez
mv /tmp/rabbitmq_management-2.5.1.ez /usr/lib/rabbitmq/lib/rabbitmq_server-*/plugins/

# Create RabbitMQ administrative user.
rabbitmqctl add_user swiftgate swiftgate
rabbitmqctl set_admin swiftgate

# Reload RabbitMQ.
/etc/init.d/rabbitmq-server reload

# Download Membase.
wget -O /tmp/membase-server-community_x86_64_1.7.1.deb http://packages.couchbase.com/releases/1.7.1/membase-server-community_x86_64_1.7.1.deb

# Install Membase.
dpkg -i /tmp/membase-server-community_x86_64_1.7.1.deb

# Remove the Membase installer.
rm -f /tmp/membase-server-community_x86_64_1.7.1.deb

{'fraction_non_alphanumeric': 0.1209116214335421, 'fraction_numerical': 0.032359081419624215, 'mean_word_length': 3.9991304347826087, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 16, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6505202', 'n_tokens_mistral': 2125, 'n_tokens_neox': 1945, 'n_words': 535}