Skip to content
This repository has been archived by the owner on Jan 27, 2020. It is now read-only.

Commit

Permalink
Merge branch 'testing-v0.26c-merge'
Browse files Browse the repository at this point in the history
  • Loading branch information
jirislav committed Feb 20, 2018
2 parents 2be1cf3 + 7999821 commit ee06587
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 27 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
CHANGELOG
=========

v0.26c (February 13, 2018)
--------------------------

Setup:

* Upgrades from v0.21c (February 1, 2017) or earlier were broken because the intermediate versions of ownCloud used in setup were no longer available from ownCloud.
* Some download errors had no output --- there is more output on error now.

Control Panel:

* The background service for the control panel was not restarting on updates, leaving the old version running. This was broken in v0.26 and is now fixed.
* Installing your own TLS/SSL certificate had been broken since v0.24 because the new version of openssl became stricter about CSR generation parameters.
* Fixed password length help text.

Contacts/Calendar:

* Upgraded Nextcloud from 12.0.3 to 12.0.5.

v0.26b (January 25, 2018)
-------------------------

Expand Down
47 changes: 47 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,50 @@
# Contributing

Mail-in-a-Box is an open source project. Your contributions and pull requests are welcome.

## Development

To start developing Mail-in-a-Box, [clone the repository](https://github.com/mail-in-a-box/mailinabox) and familiarize yourself with the code.

$ git clone https://github.com/mail-in-a-box/mailinabox

### Vagrant and VirtualBox

We recommend you use [Vagrant](https://www.vagrantup.com/intro/getting-started/install.html) and [VirtualBox](https://www.virtualbox.org/wiki/Downloads) for development. Please install them first.

With Vagrant set up, the following should boot up Mail-in-a-Box inside a virtual machine:

$ vagrant up --provision

_If you're seeing an error message about your *IP address being listed in the Spamhaus Block List*, simply uncomment the `export SKIP_NETWORK_CHECKS=1` line in `Vagrantfile`. It's normal, you're probably using a dynamic IP address assigned by your Internet provider–they're almost all listed._

### Modifying your `hosts` file

After a while, Mail-in-a-Box will be available at `192.168.50.4` (unless you changed that in your `Vagrantfile`). To be able to use the web-based bits, we recommend to add a hostname to your `hosts` file:

$ echo "192.168.50.4 mailinabox.lan" | sudo tee -a /etc/hosts

You should now be able to navigate to https://mailinabox.lan/admin using your browser. There should be an initial admin user with the name `[email protected]` and the password `12345678`.

### Making changes

Your working copy of Mail-in-a-Box will be mounted inside your VM at `/vagrant`. Any change you make locally will appear inside your VM automatically.

Running `vagrant up --provision` again will repeat the installation with your modifications.

Alternatively, you can also ssh into the VM using:

$ vagrant ssh

Once inside the VM, you can re-run individual parts of the setup like in this example:

vm$ cd /vagrant
vm$ sudo setup/owncloud.sh # replace with script you'd like to re-run

### Tests

Mail-in-a-Box needs more tests. If you're still looking for a way to help out, writing and contributing tests would be a great start!

## Public domain

This project is in the public domain. Copyright and related rights in the work worldwide are waived through the [CC0 1.0 Universal public domain dedication][CC0]. See the LICENSE file in this directory.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Quick Install
git clone https://github.com/jirislav/mailinabox.git
cd mailinabox

git checkout v0.26b-ubuntu16
git checkout v0.26c-ubuntu16

# Run installation
setup/start.sh
Expand Down
2 changes: 1 addition & 1 deletion management/ssl_certificates.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ def create_csr(domain, ssl_key, country_code, env):
"openssl", "req", "-new",
"-key", ssl_key,
"-sha256",
"-subj", "/C=%s/ST=/L=/O=/CN=%s" % (country_code, domain)])
"-subj", "/C=%s/CN=%s" % (country_code, domain)])

def install_cert(domain, ssl_cert, ssl_chain, env, raw=False):
# Write the combined cert+chain to a temporary path and validate that it is OK.
Expand Down
4 changes: 4 additions & 0 deletions management/templates/ssl.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@ <h3 id="ssl_install_header">Install certificate</h3>
}

function show_csr() {
// Can't show a CSR until both inputs are entered.
if ($('#ssldomain').val() == "") return;
if ($('#sslcc').val() == "") return;

// Scroll to it and fetch.
$('#csr_info').slideDown();
$('#ssl_csr').text('Loading...');
api(
Expand Down
2 changes: 1 addition & 1 deletion management/templates/users.html
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ <h4>Examples:</h4>

show_modal_confirm(
"Set Password",
$("<p>Set a new password for <b>" + email + "</b>?</p> <p><label for='users_set_password_pw' style='display: block; font-weight: normal'>New Password:</label><input type='password' id='users_set_password_pw'></p><p><small>Passwords must be at least four characters and may not contain spaces.</small>" + yourpw + "</p>"),
$("<p>Set a new password for <b>" + email + "</b>?</p> <p><label for='users_set_password_pw' style='display: block; font-weight: normal'>New Password:</label><input type='password' id='users_set_password_pw'></p><p><small>Passwords must be at least eight characters and may not contain spaces.</small>" + yourpw + "</p>"),
"Set Password",
function() {
api(
Expand Down
2 changes: 1 addition & 1 deletion setup/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#########################################################

if [ -z "$TAG" ]; then
TAG=v0.26b
TAG=v0.26c
fi

# Are we running as root?
Expand Down
2 changes: 1 addition & 1 deletion setup/management.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ rm -f /usr/local/bin/mailinabox-daemon # old path
cat > $inst_dir/start <<EOF;
#!/bin/bash
source $venv/bin/activate
python `pwd`/management/daemon.py
exec python `pwd`/management/daemon.py
EOF
chmod +x $inst_dir/start
rm -f /etc/init.d/mailinabox
Expand Down
59 changes: 37 additions & 22 deletions setup/owncloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ fi

SuggestInstallationWithoutNextant() {
echo
echo "--------------------------------------------"
echo " You might want to try this command instead:"
echo "---------------------------------------------"
echo " You might want to omit Nextant installation:"
echo "INSTALL_NEXTANT=no setup/start.sh"
echo "--------------------------------------------"
echo "---------------------------------------------"
}

# Assume Solr was not installed
Expand All @@ -63,6 +63,10 @@ InstallSolr() {

local SOLR_PATH="/usr/local/lib/solr"
local SOLR_DATA="${STORAGE_ROOT}/solr/data"

# Before the solr installation begins, first kill running solr instance
ps faux | grep "solr\.home=${SOLR_PATH}" | awk '{print $2}' | xargs -I {} sh -c 'kill {} || kill -9 {}' &>/dev/null

wget_verify "${APACHE_FTP_MIRROR}/lucene/solr/${SOLR_VERSION}/solr-${SOLR_VERSION}.tgz" "${SOLR_HASH}" /tmp/solr.tgz

if test $? -ne 0; then
Expand Down Expand Up @@ -162,7 +166,7 @@ EOF
su solr -c "${SOLR_PATH}/bin/solr start"

echo "Creating index for nextant ..."
su solr -c "${SOLR_PATH}/bin/solr create -c nextant"
su solr -c "${SOLR_PATH}/bin/solr create -c nextant" || echo "nextant core is probably already created #TODO"

echo "Shutting down solr ..."
su solr -c "${SOLR_PATH}/bin/solr stop"
Expand Down Expand Up @@ -210,8 +214,9 @@ ResetNextAntConfig() {

# Only set INSTALL_NEXTANT if not set previously (e.g. while running setup/start.sh)
# Note: nextant is a Nextcloud plugin to provide fulltext search even in images
# Note2: Nextant installation is being no longer supported by setup/start.sh script - if you want to install it manually, you can inspire from the code around here ..
if test ! -v INSTALL_NEXTANT; then
INSTALL_NEXTANT="yes"
INSTALL_NEXTANT="no"
fi

InstallNextcloud() {
Expand Down Expand Up @@ -264,6 +269,10 @@ InstallNextcloud() {
wget_verify https://github.com/nextcloud/nextant/releases/download/v${NEXTANT_VERSION}/nextant-${NEXTANT_VERSION}.tar.gz "${NEXTANT_HASH}" /tmp/nextant.tgz || exit 1
tar xf /tmp/nextant.tgz -C /usr/local/lib/owncloud/apps/
rm /tmp/nextant.tgz
elif systemctl list-unit-files | grep -q solr.service; then
# Stop & disable solr service so that our resources are more available
systemctl stop solr.service &>/dev/null
systemctl disable solr.service &>/dev/null
fi


Expand Down Expand Up @@ -309,12 +318,12 @@ InstallOwncloud() {
rm -rf /usr/local/lib/owncloud

# Download and verify
wget_verify https://download.owncloud.org/community/owncloud-$version.zip $hash /tmp/owncloud.zip || exit 1
wget_verify https://download.owncloud.org/community/owncloud-$version.tar.bz2 $hash /tmp/owncloud.tar.bz2 || exit 1


# Extract ownCloud
unzip -q /tmp/owncloud.zip -d /usr/local/lib
rm -f /tmp/owncloud.zip
tar xjf /tmp/owncloud.tar.bz2 -C /usr/local/lib
rm -f /tmp/owncloud.tar.bz2

# The two apps we actually want are not in Nextcloud core. Download the releases from
# their github repositories.
Expand Down Expand Up @@ -356,8 +365,8 @@ InstallOwncloud() {
fi
}

owncloud_ver=12.0.3
owncloud_hash=beab41f6a748a43f0accfa6a9808387aef718c61
owncloud_ver=12.0.5
owncloud_hash=d25afbac977a4e331f5e38df50aed0844498ca86

# Check if Nextcloud dir exist, and check if version matches owncloud_ver (if either doesn't - install/upgrade)
if [ ! -d /usr/local/lib/owncloud/ ] \
Expand Down Expand Up @@ -385,13 +394,13 @@ if [ ! -d /usr/local/lib/owncloud/ ] \
# We only need to check if we do upgrades when owncloud/Nextcloud was previously installed
if [ -e /usr/local/lib/owncloud/version.php ]; then
if grep -q "OC_VersionString = '8\.1\.[0-9]" /usr/local/lib/owncloud/version.php; then
echo "We are running 8.1.x, upgrading to 8.2.3 first"
InstallOwncloud 8.2.3 bfdf6166fbf6fc5438dc358600e7239d1c970613
echo "We are running 8.1.x, upgrading to 8.2.11 first"
InstallOwncloud 8.2.11 e4794938fc2f15a095018ba9d6ee18b53f6f299c
fi

# If we are upgrading from 8.2.x we should go to 9.0 first. Owncloud doesn't support skipping minor versions
if grep -q "OC_VersionString = '8\.2\.[0-9]" /usr/local/lib/owncloud/version.php; then
echo "We are running version 8.2.x, upgrading to 9.0.2 first"
echo "We are running version 8.2.x, upgrading to 9.0.11 first"

# We need to disable memcached. The upgrade and install fails
# with memcached
Expand All @@ -409,8 +418,8 @@ if [ ! -d /usr/local/lib/owncloud/ ] \
EOF
chown www-data.www-data ${STORAGE_ROOT}/owncloud/config.php

# We can now install owncloud 9.0.2
InstallOwncloud 9.0.2 72a3d15d09f58c06fa8bee48b9e60c9cd356f9c5
# We can now install owncloud 9.0.11
InstallOwncloud 9.0.11 fc8bad8a62179089bc58c406b28997fb0329337b

# The owncloud 9 migration doesn't migrate calendars and contacts
# The option to migrate these are removed in 9.1
Expand All @@ -427,20 +436,26 @@ EOF

# If we are upgrading from 9.0.x we should go to 9.1 first.
if grep -q "OC_VersionString = '9\.0\.[0-9]" /usr/local/lib/owncloud/version.php; then
echo "We are running ownCloud 9.0.x, upgrading to ownCloud 9.1.4 first"
InstallOwncloud 9.1.4 e637cab7b2ca3346164f3506b1a0eb812b4e841a
echo "We are running ownCloud 9.0.x, upgrading to ownCloud 9.1.7 first"
InstallOwncloud 9.1.7 1307d997d0b23dc42742d315b3e2f11423a9c808
fi

# If we are upgrading from 9.1.x we should go to Nextcloud 10.0 first.
# Newer ownCloud 9.1.x versions cannot be upgraded to Nextcloud 10 and have to be
# upgraded to Nextcloud 11 straight away, see:
# https://github.com/nextcloud/server/issues/2203
# However, for some reason, upgrading to the latest Nextcloud 11.0.7 doesn't
# work either. Therefore, we're upgrading to Nextcloud 11.0.0 in the interim.
# This should not be a problem since we're upgrading to the latest Nextcloud 12
# in the next step.
if grep -q "OC_VersionString = '9\.1\.[0-9]" /usr/local/lib/owncloud/version.php; then
echo "We are running ownCloud 9.1.x, upgrading to Nextcloud 10.0.5 first"
InstallNextcloud 10.0.5 686f6a8e9d7867c32e3bf3ca63b3cc2020564bf6
echo "We are running ownCloud 9.1.x, upgrading to Nextcloud 11.0.0 first"
InstallNextcloud 11.0.0 e8c9ebe72a4a76c047080de94743c5c11735e72e
fi

# If we are upgrading from 10.0.x we should go to Nextcloud 11.0 first.
if grep -q "OC_VersionString = '10\.0\.[0-9]" /usr/local/lib/owncloud/version.php; then
echo "We are running Nextcloud 10.0.x, upgrading to Nextcloud 11.0.3 first"
InstallNextcloud 11.0.3 a396aaa1c9f920099a90a86b4a9cd0ec13083c99
echo "We are running Nextcloud 10.0.x, upgrading to Nextcloud 11.0.7 first"
InstallNextcloud 11.0.7 f936ddcb2ae3dbb66ee4926eb8b2ebbddc3facbe
fi
fi

Expand Down
1 change: 1 addition & 0 deletions setup/spamassassin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ chmod a+x /usr/local/bin/sa-learn-pipe.sh

# Create empty bayes training data (if it doesn't exist). Once the files exist,
# ensure they are group-writable so that the Dovecot process has access.
echo " - launching spam learning process (this might take a while)"
sudo -u spampd /usr/bin/sa-learn --sync 2>/dev/null
chmod -R 660 $STORAGE_ROOT/mail/spamassassin
chmod 770 $STORAGE_ROOT/mail/spamassassin
Expand Down

0 comments on commit ee06587

Please sign in to comment.