detect installation in a better way

This commit is contained in:
Sebastian Hugentobler 2018-01-30 11:11:38 +01:00
parent 2bd9546f47
commit 9b3d6ef7ef
3 changed files with 4 additions and 65 deletions

View File

@ -1,6 +0,0 @@
[template]
src = "config.php.tmpl"
dest = "/var/lib/nextcloud/config/config.php.sample"
gid = 101
uid = 100
mode = "0660"

View File

@ -1,57 +0,0 @@
<?php
$CONFIG = array(
'trusted_domains' =>
array (
'{{getenv "DOMAIN"}}'
),
'datadirectory' => '/var/lib/nextcloud/data',
'dbtype' => 'pgsql',
'dbhost' => '{{getenv "DB_HOST"}}',
'dbname' => '{{getenv "DB_NAME"}}',
'dbuser' => '{{getenv "DB_USER"}}',
'dbpassword' => '{{getenv "DB_PASSWORD"}}',
'dbtableprefix' => '{{getenv "DB_TABLE_PREFIX"}}',
'skeletondirectory' => '',
'mail_domain' => '{{getenv "MAIL_DOMAIN"}}',
'mail_from_address' => '{{getenv "MAIL_FROM"}}',
'mail_smtpdebug' => false,
'mail_smtpmode' => 'smtp',
'mail_smtphost' => '{{getenv "MAIL_SMTP_HOST"}}',
'mail_smtpport' => {{getenv "MAIL_SMTP_PORT" "587"}},
'mail_smtptimeout' => 10,
'mail_smtpsecure' => '{{getenv "MAIL_SMTP_SECURITY" "tls"}}',
'mail_smtpauth' => {{getenv "MAIL_SMTP_AUTH" "true"}},
'mail_smtpauthtype' => '{{getenv "MAIL_SMTP_AUTH_TYPE" "PLAIN"}}',
'mail_smtpname' => '{{getenv "MAIL_SMTP_NAME"}}',
'mail_smtppassword' => '{{getenv "MAIL_SMTP_PASSWORD"}}',
'overwritehost' => '{{getenv "DOMAIN"}}',
'overwriteprotocol' => 'https',
'overwritewebroot' => '',
'overwrite.cli.url' => 'https://{{getenv "DOMAIN"}}',
'apps_paths' => array(
array(
'path'=> '/var/lib/nextcloud/apps',
'url' => '/apps',
'writable' => true,
),
),
'supportedDatabases' => array(
'pgsql',
),
'memcache.local' => '\OC\Memcache\APCu',
'assetdirectory' => '/var/lib/nextcloud',
'mount_file' => '/var/lib/nextcloud/data/mount.json',
'installed' => true,
'version' => '12.0.0.29',
);

View File

@ -3,9 +3,9 @@ set -ex
cd /usr/share/webapps/nextcloud
PGPASSWORD=$DB_PASSWORD psql -h $DB_HOST -U $DB_USER -d $DB_NAME -c "SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_name = '${DB_TABLE_PREFIX}appconfig')" | grep f
#PGPASSWORD=$DB_PASSWORD psql -h $DB_HOST -U $DB_USER -d $DB_NAME -c "SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_name = '${DB_TABLE_PREFIX}appconfig')" | grep f
if [ $? -ne 1 ]; then
if [ ! -f /var/lib/nextcloud/data/.installed ]; then
s6-setuidgid nginx ./occ maintenance:install \
--database=pgsql \
--database-host=$DB_HOST \
@ -24,6 +24,8 @@ if [ $? -ne 1 ]; then
s6-setuidgid nginx ./occ app:enable files_texteditor
s6-setuidgid nginx ./occ app:enable files_pdfviewer
s6-setuidgid nginx ./occ app:enable theming
touch /var/lib/nextcloud/data/.installed
fi
s6-setuidgid nginx ./occ config:system:set --value "https://$DOMAIN" overwrite.cli.url