Browse Source

made prep idempotent

www
Fernando Alegre 7 months ago
parent
commit
63afbd4d60
  1. 6
      nextcloud/data/ncconfig/host.config.php
  2. 3
      nextcloud/data/ncconfig/secret.config.php
  3. 30
      nextcloud/scripts/prep.sh

6
nextcloud/data/ncconfig/host.config.php

@ -2,11 +2,11 @@
$CONFIG = array(
'trusted_domains' =>
array (
0 => 'cloud.alemor.org',
0 => 'example.domain.com',
),
'overwriteprotocol' => 'https',
'overwritehost' => 'cloud.alemor.org',
'overwritehost' => 'example.domain.com',
### 'overwritewebroot' => '/nextcloud',
'overwrite.cli.url' => 'https://cloud.alemor.org/',
'overwrite.cli.url' => 'https://example.domain.com/',
'default_phone_region' => 'US'
);

3
nextcloud/data/ncconfig/secret.config.php

@ -1,8 +1,9 @@
<?php
$CONFIG = array(
/** After your first install, place the auto-generated values for these parameters here
and uncomment them, so that they persist across re-deploys. */
and uncomment them, so that they persist across re-deploys.
'passwordsalt' => 'Tor00eCxYW7hxUzeBhdzEU0+MJWwg/',
'secret' => 'jBL6XxrYZs7h5TQcLDB33vB5N4RzHxomGGgUEer25K4wdSwc',
'instanceid' => 'oc3sbo2jitqd',
*/
);

30
nextcloud/scripts/prep.sh

@ -1,16 +1,28 @@
#!/bin/sh
USE_HOST=cloud.alemor.org
DATADIR=$HOME/vol/nextcloud/data
FILEDIR=$HOME/vol/nextcloud/files
if [ -f env ]; then
. ./env
else
echo "Need env like:"
echo USE_HOST="<external host>"
exit 1
fi
if [ ! -d $DATADIR ]; then
mkdir -p $DATADIR/etc $DATADIR/ncconfig
cp data/ncconfig/* $DATADIR/ncconfig/
sed -e "s/example.domain.com/$USE_HOST/" \
data/ncconfig/host.config.php \
> $DATADIR/ncconfig/host.config.php
fi
if [ ! -d $FILEDIR ]; then
mkdir -p $FILEDIR
fi
mkdir -p $DATADIR/etc \
$DATADIR/ncconfig \
$HOME/vol/nextcloud/files
cp data/ncconfig/* $DATADIR/ncconfig/
sed -e "s/example.domain.com/$USE_HOST/" \
data/ncconfig/host.config.php \
> $DATADIR/ncconfig/host.config.php
mkdir -p assets/nextcloud
cd assets/nextcloud

Loading…
Cancel
Save