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
|
||||
|
||||
return array (
|
||||
'environment' => 'production',
|
||||
'salt' => 'yunosalt',
|
||||
|
@ -18,4 +19,5 @@ return array (
|
|||
'allow_anonymous_refresh' => false,
|
||||
'unsafe_autologin_enabled' => false,
|
||||
'api_enabled' => true,
|
||||
'extensions_enabled' => array(),
|
||||
);
|
|
@ -16,7 +16,8 @@ then
|
|||
echo "Detected wallabag"
|
||||
wallabagPath=$(sudo yunohost app setting wallabag path)
|
||||
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
|
||||
|
||||
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
|
||||
#remove temp sql
|
||||
sudo rm /tmp/$myuser-install.sql
|
||||
|
||||
#copy default conf
|
||||
sudo mkdir $app_path/data/$myuser/
|
||||
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
|
||||
sudo cp -r $app_path/data/users/_ $app_path/data/users/$myuser/
|
||||
sudo mv $app_path/data/users/$myuser/config.default.php $app_path/data/users/$myuser/config.php
|
||||
#add wallabag sharing
|
||||
sudo sed -i "s@sharingArrayYnh@$sharingWallabag@g" $app_path/data/users/$myuser/config.php
|
||||
touch $app_path/data/users/$myuser/log.txt
|
||||
chown www-data: $app_path/data/users/$myuser -R
|
||||
if [[ $sharingEnable -eq 1 ]]; then
|
||||
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/
|
||||
done
|
||||
fi
|
|
@ -12,7 +12,8 @@ if [[ $(sudo yunohost app list -f wallabag | /bin/grep -q "installed: True") -eq
|
|||
echo "Detected wallabag"
|
||||
$wallabagPath=$(sudo yunohost app setting wallabag path)
|
||||
$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
|
||||
|
||||
|
||||
|
@ -25,12 +26,10 @@ mysql -u $db_user -p$db_pwd $db_user < /tmp/$myuser-install.sql
|
|||
#remove temp sql
|
||||
sudo rm /tmp/$myuser-install.sql
|
||||
#copy default conf
|
||||
#copy default conf
|
||||
sudo mkdir $app_path/data/users/$myuser/
|
||||
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
|
||||
sudo cp -r $app_path/data/users/_ $app_path/data/users/$myuser/
|
||||
sudo mv $app_path/data/users/$myuser/config.default.php $app_path/data/users/$myuser/config.php
|
||||
#add wallabag sharing
|
||||
sudo sed -i "s/sharingArrayYnh/$sharingWallabag/g" $app_path/data/users/$myuser/config.php
|
||||
sudo touch $app_path/data/users/users/$myuser/log.txt
|
||||
if [[ $sharingEnable -eq 1 ]]; then
|
||||
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/
|
Loading…
Reference in a new issue