1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/freshrss_ynh.git synced 2024-09-03 18:36:33 +02:00

Partage par wallabag si installé

This commit is contained in:
plopoyop 2014-07-30 15:58:09 +02:00
parent 579fd5d278
commit 58d2852070
5 changed files with 26 additions and 9 deletions

View file

@ -6,8 +6,5 @@ FreshRSS for YunoHost
TODO:
* Default users
* If wallabag is installed add it to users default settings
* User email doesn't is the username
* Finish Yunohost theme
* update scripts

View file

@ -53,7 +53,7 @@
'bottomline_date' => true,
'bottomline_link' => true,
'sharing' =>
array (),
array (sharingArrayYnh),
'queries' =>
array (
),

View file

@ -6,6 +6,15 @@ db_pwd=$(sudo yunohost app setting freshrss mysqlpwd)
myuser=$1
#check wallabag
if [[ $(sudo yunohost app list -f wallabag | /bin/grep -q "installed: True") -eq 0 ]]; then
echo "Detected wallabag"
$wallabagPath=$(sudo yunohost app setting wallabag path)
$wallabagUrl=$domain$wallabagPath
$sharingWallabag="array('type' => 'wallabag','name' => 'Wallabag','url' => 'https://$wallabagUrl',),"
fi
#copy sql
sudo cp /var/www/freshrss/app/SQL/install_ynh.sql /tmp/$myuser-install.sql
#change username in sql
@ -17,8 +26,9 @@ sudo rm /tmp/$myuser-install.sql
#copy default conf
sudo cp /var/www/freshrss/data/user.php.dist /var/www/freshrss/data/$myuser\_user.php
#change email
user_email=$(ldapsearch -h localhost -b uid=$myuser,ou=users,dc=yunohost,dc=org -x objectClass=mailAccount mail | grep mail: | head -n 1| sed 's/mail: //')
#user_email=$(ldapsearch -h localhost -b uid=$myuser,ou=users,dc=yunohost,dc=org -x objectClass=mailAccount mail | grep mail: | head -n 1| sed 's/mail: //')
sudo sed -i "s/ynoUserEmail/$user_email/g" /var/www/freshrss//data/$myuser\_user.php
#change username
sudo sed -i "s/YnoUser/$myuser/g" /var/www/freshrss/data/$myuser\_user.php
sudo sed -i "s/sharingArrayYnh/$sharingWallabag/g" $final_path/data/$myuser\_user.php

View file

@ -32,8 +32,8 @@
{
"name": "admin",
"ask": {
"en": "Choose the default user (must be an existing YunoHost user)",
"fr": "Choisissez l'utilisateur par defaut (doit être un utiliser YunoHost existant)"
"en": "Choose the default user (must be an existing YunoHost user) leave empty if none",
"fr": "Choisissez l'utilisateur par defaut (doit être un utiliser YunoHost existant) laisser vide pour aucun"
},
"example": "homer"
}

View file

@ -37,6 +37,15 @@ sudo sed -i "s@yunopath@$path@g" $final_path/data/config.php
sudo sed -i "s/yunoadminuser/$admin_user/g" $final_path/data/config.php
# Add users
#check wallabag
if [[ $(sudo yunohost app list -f wallabag | /bin/grep -q "installed: True") -eq 0 ]]; then
echo "Detected wallabag"
$wallabagPath=$(sudo yunohost app setting wallabag path)
$wallabagUrl=$domain$wallabagPath
$sharingWallabag="array('type' => 'wallabag','name' => 'Wallabag','url' => 'https://$wallabagUrl',),"
fi
freshrss_users=$(ldapsearch -h localhost -b ou=users,dc=yunohost,dc=org -x objectClass=mailAccount uid | grep uid: | sed 's/uid: //' | xargs)
for myuser in $freshrss_users
do
@ -50,11 +59,12 @@ do
sudo rm /tmp/$myuser-install.sql
#copy default conf
sudo cp ../conf/dist_user.conf $final_path/data/$myuser\_user.php
#change email
user_email=$(ldapsearch -h localhost -b uid=$myuser,ou=users,dc=yunohost,dc=org -x objectClass=mailAccount mail | grep mail: | head -n 1| sed 's/mail: //')
#change email - utilise seulement par persona - non necessaire pour ynh
#user_email=$(ldapsearch -h localhost -b uid=$myuser,ou=users,dc=yunohost,dc=org -x objectClass=mailAccount mail | grep mail: | head -n 1| sed 's/mail: //')
sudo sed -i "s/ynoUserEmail/$user_email/g" $final_path/data/$myuser\_user.php
#change username
sudo sed -i "s/YnoUser/$myuser/g" $final_path/data/$myuser\_user.php
sudo sed -i "s/sharingArrayYnh/$sharingWallabag/g" $final_path/data/$myuser\_user.php
done
#copy defaut user conf for futur users
sudo cp ../conf/dist_user.conf $final_path/data/user.php.dist