mirror of
https://github.com/YunoHost-Apps/freshrss_ynh.git
synced 2024-09-03 18:36:33 +02:00
[fix]use defaut config in hooks
This commit is contained in:
parent
3a994b7a3b
commit
7d2f564ae4
3 changed files with 19 additions and 17 deletions
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
return array (
|
return array (
|
||||||
'environment' => 'production',
|
'environment' => 'production',
|
||||||
'salt' => 'yunosalt',
|
'salt' => 'yunosalt',
|
||||||
|
@ -18,4 +19,5 @@ return array (
|
||||||
'allow_anonymous_refresh' => false,
|
'allow_anonymous_refresh' => false,
|
||||||
'unsafe_autologin_enabled' => false,
|
'unsafe_autologin_enabled' => false,
|
||||||
'api_enabled' => true,
|
'api_enabled' => true,
|
||||||
|
'extensions_enabled' => array(),
|
||||||
);
|
);
|
|
@ -16,7 +16,8 @@ then
|
||||||
echo "Detected wallabag"
|
echo "Detected wallabag"
|
||||||
wallabagPath=$(sudo yunohost app setting wallabag path)
|
wallabagPath=$(sudo yunohost app setting wallabag path)
|
||||||
wallabagUrl=$domain$wallabagPath
|
wallabagUrl=$domain$wallabagPath
|
||||||
sharingWallabag="array('type' => 'wallabag','name' => 'Wallabag','url' => 'https://$wallabagUrl',),"
|
sharingWallabag="'sharing' => \n\tarray( \n\t\t0 => \n\t\tarray(\n\t\t\t'type' => 'wallabag',\n\t\t\t'name' => 'Wallabag',\n\t\t\t'url' => 'https://$wallabagUrl',\n\t\t),"
|
||||||
|
sharingEnable=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for myuser in $(echo "$new_users" | sed "s/,/ /g")
|
for myuser in $(echo "$new_users" | sed "s/,/ /g")
|
||||||
|
@ -30,14 +31,14 @@ then
|
||||||
mysql -u $db_user -p$db_pwd $db_user < /tmp/$myuser-install.sql
|
mysql -u $db_user -p$db_pwd $db_user < /tmp/$myuser-install.sql
|
||||||
#remove temp sql
|
#remove temp sql
|
||||||
sudo rm /tmp/$myuser-install.sql
|
sudo rm /tmp/$myuser-install.sql
|
||||||
|
|
||||||
#copy default conf
|
#copy default conf
|
||||||
sudo mkdir $app_path/data/$myuser/
|
sudo cp -r $app_path/data/users/_ $app_path/data/users/$myuser/
|
||||||
sudo cp $app_path/data/user.php.dist $app_path/data/users/$myuser/config.php
|
sudo mv $app_path/data/users/$myuser/config.default.php $app_path/data/users/$myuser/config.php
|
||||||
#change username
|
#add wallabag sharing
|
||||||
sudo sed -i "s/YnoUser/$myuser/g" $app_path/data/users/$myuser/config.php
|
if [[ $sharingEnable -eq 1 ]]; then
|
||||||
#add wallabag sharing
|
sudo sed -i "s@'sharing'\ =>\ array\ (@$sharingWallabag@g" $app_path/data/users/$myuser/config.php
|
||||||
sudo sed -i "s@sharingArrayYnh@$sharingWallabag@g" $app_path/data/users/$myuser/config.php
|
fi
|
||||||
touch $app_path/data/users/$myuser/log.txt
|
sudo chown -R www-data: $app_path/data/users/$myuser/
|
||||||
chown www-data: $app_path/data/users/$myuser -R
|
|
||||||
done
|
done
|
||||||
fi
|
fi
|
|
@ -12,7 +12,8 @@ if [[ $(sudo yunohost app list -f wallabag | /bin/grep -q "installed: True") -eq
|
||||||
echo "Detected wallabag"
|
echo "Detected wallabag"
|
||||||
$wallabagPath=$(sudo yunohost app setting wallabag path)
|
$wallabagPath=$(sudo yunohost app setting wallabag path)
|
||||||
$wallabagUrl=$domain$wallabagPath
|
$wallabagUrl=$domain$wallabagPath
|
||||||
$sharingWallabag="array('type' => 'wallabag','name' => 'Wallabag','url' => 'https://$wallabagUrl',),"
|
$sharingWallabag="'sharing' => \n\tarray( \n\t\t0 => \n\t\tarray(\n\t\t\t'type' => 'wallabag',\n\t\t\t'name' => 'Wallabag',\n\t\t\t'url' => 'https://$wallabagUrl',\n\t\t),"
|
||||||
|
$sharingEnable=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,12 +26,10 @@ mysql -u $db_user -p$db_pwd $db_user < /tmp/$myuser-install.sql
|
||||||
#remove temp sql
|
#remove temp sql
|
||||||
sudo rm /tmp/$myuser-install.sql
|
sudo rm /tmp/$myuser-install.sql
|
||||||
#copy default conf
|
#copy default conf
|
||||||
#copy default conf
|
sudo cp -r $app_path/data/users/_ $app_path/data/users/$myuser/
|
||||||
sudo mkdir $app_path/data/users/$myuser/
|
sudo mv $app_path/data/users/$myuser/config.default.php $app_path/data/users/$myuser/config.php
|
||||||
sudo cp $app_path/data/user.php.dist $app_path/data/users/$myuser/config.php
|
|
||||||
#change username
|
|
||||||
sudo sed -i "s/YnoUser/$myuser/g" $app_path/data/users/$myuser/config.php
|
|
||||||
#add wallabag sharing
|
#add wallabag sharing
|
||||||
sudo sed -i "s/sharingArrayYnh/$sharingWallabag/g" $app_path/data/users/$myuser/config.php
|
if [[ $sharingEnable -eq 1 ]]; then
|
||||||
sudo touch $app_path/data/users/users/$myuser/log.txt
|
sudo sed -i "s@'sharing'\ =>\ array\ (@$sharingWallabag@g" $app_path/data/users/$myuser/config.php
|
||||||
|
fi
|
||||||
sudo chown -R www-data: $app_path/data/users/$myuser/
|
sudo chown -R www-data: $app_path/data/users/$myuser/
|
Loading…
Reference in a new issue