|
|
|
|
6472
|
CURRENT_DDNS_DOMAIN=
|
6472
|
CURRENT_DDNS_DOMAIN=
|
6473
|
}
|
6473
|
}
|
6474
|
|
6474
|
|
6475
|
-function configure_owncloud_onion_site {
|
|
|
6476
|
- if [ ! $OWNCLOUD_DOMAIN_NAME ]; then
|
|
|
6477
|
- return
|
|
|
6478
|
- fi
|
|
|
6479
|
- if [ ! -f /var/www/owncloud/config/config.php ]; then
|
|
|
6480
|
- return
|
|
|
6481
|
- fi
|
|
|
6482
|
- if [ ! -f /var/lib/tor/hidden_service_owncloud/hostname ]; then
|
|
|
6483
|
- return
|
|
|
6484
|
- fi
|
|
|
6485
|
- OWNCLOUD_ONION_HOSTNAME=$(cat /var/lib/tor/hidden_service_owncloud/hostname)
|
|
|
6486
|
- if ! grep -q "${OWNCLOUD_ONION_HOSTNAME}" /var/www/owncloud/config/config.php; then
|
|
|
6487
|
- sed -i "s|0 => '${OWNCLOUD_DOMAIN_NAME}',|0 => '${OWNCLOUD_DOMAIN_NAME}',
|
|
|
6488
|
- 1 => '${OWNCLOUD_ONION_HOSTNAME}',|g" /var/www/owncloud/config/config.php
|
|
|
6489
|
- sed -i "s|'writable' => false,|'writable' => false,
|
|
|
6490
|
- ),
|
|
|
6491
|
- 1 =>
|
|
|
6492
|
- array (
|
|
|
6493
|
- 'path' => '/var/www/owncloud/apps',
|
|
|
6494
|
- 'url' => '/apps',
|
|
|
6495
|
- 'writable' => false,|g" /var/www/owncloud/config/config.php
|
|
|
6496
|
- echo $'Owncloud configured for onion site'
|
|
|
6497
|
- fi
|
|
|
6498
|
-}
|
|
|
6499
|
-
|
|
|
6500
|
function upgrade_owncloud_start {
|
6475
|
function upgrade_owncloud_start {
|
6501
|
# copies data and config directories to a temporary upgrade directory
|
6476
|
# copies data and config directories to a temporary upgrade directory
|
6502
|
if [ ! -d /etc/owncloud ]; then
|
6477
|
if [ ! -d /etc/owncloud ]; then
|
|
|
|
|
6902
|
cp $OWNCLOUD_PATH/config/config.sample.php $OWNCLOUD_PATH/config/config.php
|
6877
|
cp $OWNCLOUD_PATH/config/config.sample.php $OWNCLOUD_PATH/config/config.php
|
6903
|
fi
|
6878
|
fi
|
6904
|
|
6879
|
|
6905
|
- if [ -f $OWNCLOUD_UPGRADE_PATH/config/config.php ]; then
|
|
|
|
|
6880
|
+ if [ -f $OWNCLOUD_PATH/config/config.php ]; then
|
6906
|
OWNCLOUD_INSTANCE_ID="$(openssl rand -base64 14 | cut -c1-12)"
|
6881
|
OWNCLOUD_INSTANCE_ID="$(openssl rand -base64 14 | cut -c1-12)"
|
6907
|
OWNCLOUD_PASSWORD_SALT="$(openssl rand -base64 32 | cut -c1-30)"
|
6882
|
OWNCLOUD_PASSWORD_SALT="$(openssl rand -base64 32 | cut -c1-30)"
|
6908
|
- OWNCLOUD_DATA_DIR='/var/www/owncloud/data'
|
|
|
|
|
6883
|
+ OWNCLOUD_DATA_DIR="$OWNCLOUD_PATH/data"
|
6909
|
OWNCLOUD_DBTYPE='mysql'
|
6884
|
OWNCLOUD_DBTYPE='mysql'
|
6910
|
OWNCLOUD_DBNAME='owncloud'
|
6885
|
OWNCLOUD_DBNAME='owncloud'
|
6911
|
OWNCLOUD_DBHOST='localhost'
|
6886
|
OWNCLOUD_DBHOST='localhost'
|
|
|
|
|
6913
|
OWNCLOUD_DBPASS="$OWNCLOUD_ADMIN_PASSWORD"
|
6888
|
OWNCLOUD_DBPASS="$OWNCLOUD_ADMIN_PASSWORD"
|
6914
|
OWNCLOUD_SECRET="$(openssl rand -base64 32 | cut -c1-30)$(openssl rand -base64 32 | cut -c1-30)$(openssl rand -base64 32 | cut -c1-30)$(openssl rand -base64 32 | cut -c1-30)"
|
6889
|
OWNCLOUD_SECRET="$(openssl rand -base64 32 | cut -c1-30)$(openssl rand -base64 32 | cut -c1-30)$(openssl rand -base64 32 | cut -c1-30)$(openssl rand -base64 32 | cut -c1-30)"
|
6915
|
|
6890
|
|
|
|
6891
|
+ sed -i "s|demo.example.org|${OWNCLOUD_DOMAIN_NAME}|g" $OWNCLOUD_PATH/config/config.php
|
|
|
6892
|
+ sed -i "s|otherdomain.example.org|${OWNCLOUD_ONION_HOSTNAME}|g" $OWNCLOUD_PATH/config/config.php
|
6916
|
sed -i "s|'instanceid'.*|'instanceid' => '$OWNCLOUD_INSTANCE_ID',|g" $OWNCLOUD_PATH/config/config.php
|
6893
|
sed -i "s|'instanceid'.*|'instanceid' => '$OWNCLOUD_INSTANCE_ID',|g" $OWNCLOUD_PATH/config/config.php
|
6917
|
sed -i "s|'passwordsalt'.*|'passwordsalt' => '$OWNCLOUD_PASSWORD_SALT',|g" $OWNCLOUD_PATH/config/config.php
|
6894
|
sed -i "s|'passwordsalt'.*|'passwordsalt' => '$OWNCLOUD_PASSWORD_SALT',|g" $OWNCLOUD_PATH/config/config.php
|
6918
|
sed -i "s|'datadirectory'.*|'datadirectory' => '$OWNCLOUD_DATA_DIR',|g" $OWNCLOUD_PATH/config/config.php
|
6895
|
sed -i "s|'datadirectory'.*|'datadirectory' => '$OWNCLOUD_DATA_DIR',|g" $OWNCLOUD_PATH/config/config.php
|
|
|
|
|
10904
|
configure_firewall_for_web_server
|
10881
|
configure_firewall_for_web_server
|
10905
|
install_owncloud_official_deb
|
10882
|
install_owncloud_official_deb
|
10906
|
install_owncloud_repo_music_app
|
10883
|
install_owncloud_repo_music_app
|
10907
|
-configure_owncloud_onion_site
|
|
|
10908
|
upgrade_golang
|
10884
|
upgrade_golang
|
10909
|
install_gogs
|
10885
|
install_gogs
|
10910
|
install_xmpp
|
10886
|
install_xmpp
|