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:
parent
579fd5d278
commit
58d2852070
5 changed files with 26 additions and 9 deletions
|
@ -6,8 +6,5 @@ FreshRSS for YunoHost
|
||||||
|
|
||||||
|
|
||||||
TODO:
|
TODO:
|
||||||
* Default users
|
|
||||||
* If wallabag is installed add it to users default settings
|
|
||||||
* User email doesn't is the username
|
|
||||||
* Finish Yunohost theme
|
* Finish Yunohost theme
|
||||||
* update scripts
|
* update scripts
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
'bottomline_date' => true,
|
'bottomline_date' => true,
|
||||||
'bottomline_link' => true,
|
'bottomline_link' => true,
|
||||||
'sharing' =>
|
'sharing' =>
|
||||||
array (),
|
array (sharingArrayYnh),
|
||||||
'queries' =>
|
'queries' =>
|
||||||
array (
|
array (
|
||||||
),
|
),
|
||||||
|
|
|
@ -6,6 +6,15 @@ db_pwd=$(sudo yunohost app setting freshrss mysqlpwd)
|
||||||
|
|
||||||
myuser=$1
|
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
|
#copy sql
|
||||||
sudo cp /var/www/freshrss/app/SQL/install_ynh.sql /tmp/$myuser-install.sql
|
sudo cp /var/www/freshrss/app/SQL/install_ynh.sql /tmp/$myuser-install.sql
|
||||||
#change username in sql
|
#change username in sql
|
||||||
|
@ -17,8 +26,9 @@ sudo rm /tmp/$myuser-install.sql
|
||||||
#copy default conf
|
#copy default conf
|
||||||
sudo cp /var/www/freshrss/data/user.php.dist /var/www/freshrss/data/$myuser\_user.php
|
sudo cp /var/www/freshrss/data/user.php.dist /var/www/freshrss/data/$myuser\_user.php
|
||||||
#change email
|
#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
|
sudo sed -i "s/ynoUserEmail/$user_email/g" /var/www/freshrss//data/$myuser\_user.php
|
||||||
#change username
|
#change username
|
||||||
sudo sed -i "s/YnoUser/$myuser/g" /var/www/freshrss/data/$myuser\_user.php
|
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
|
||||||
|
|
|
@ -32,8 +32,8 @@
|
||||||
{
|
{
|
||||||
"name": "admin",
|
"name": "admin",
|
||||||
"ask": {
|
"ask": {
|
||||||
"en": "Choose the default user (must be an existing YunoHost user)",
|
"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)"
|
"fr": "Choisissez l'utilisateur par defaut (doit être un utiliser YunoHost existant) laisser vide pour aucun"
|
||||||
},
|
},
|
||||||
"example": "homer"
|
"example": "homer"
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
sudo sed -i "s/yunoadminuser/$admin_user/g" $final_path/data/config.php
|
||||||
|
|
||||||
# Add users
|
# 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)
|
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
|
for myuser in $freshrss_users
|
||||||
do
|
do
|
||||||
|
@ -50,11 +59,12 @@ do
|
||||||
sudo rm /tmp/$myuser-install.sql
|
sudo rm /tmp/$myuser-install.sql
|
||||||
#copy default conf
|
#copy default conf
|
||||||
sudo cp ../conf/dist_user.conf $final_path/data/$myuser\_user.php
|
sudo cp ../conf/dist_user.conf $final_path/data/$myuser\_user.php
|
||||||
#change email
|
#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: //')
|
#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
|
sudo sed -i "s/ynoUserEmail/$user_email/g" $final_path/data/$myuser\_user.php
|
||||||
#change username
|
#change username
|
||||||
sudo sed -i "s/YnoUser/$myuser/g" $final_path/data/$myuser\_user.php
|
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
|
done
|
||||||
#copy defaut user conf for futur users
|
#copy defaut user conf for futur users
|
||||||
sudo cp ../conf/dist_user.conf $final_path/data/user.php.dist
|
sudo cp ../conf/dist_user.conf $final_path/data/user.php.dist
|
||||||
|
|
Loading…
Add table
Reference in a new issue