mirror of
https://github.com/YunoHost-Apps/ttrss_ynh.git
synced 2024-10-01 13:34:46 +02:00
42 lines
1.4 KiB
Bash
42 lines
1.4 KiB
Bash
#!/bin/bash
|
|
|
|
domain=$(sudo yunohost app setting ttrss domain)
|
|
path=$(sudo yunohost app setting ttrss path)
|
|
|
|
db_user=ttrss
|
|
db_pwd=$(sudo yunohost app setting ttrss mysqlpwd)
|
|
<<<<<<< HEAD
|
|
=======
|
|
#db_file=../source/schema/versions/mysql/$(ls -vr ../source/schema/versions/mysql | head -1)
|
|
|
|
#mysql -u $db_user -p$db_pwd $db_user < $db_file
|
|
>>>>>>> f6f84fd2b073b67a92eaed31b51016470a2e0d4e
|
|
|
|
final_path=/var/www/ttrss
|
|
sudo mkdir -p $final_path
|
|
|
|
sudo cp -a ../source/* $final_path
|
|
sudo cp ../conf/config.php $final_path/
|
|
sudo cp ../conf/ttrss.diff $final_path/
|
|
sudo patch -p0 $final_path/ttrss.diff
|
|
|
|
|
|
# Change variables in ttrss configuration
|
|
sudo sed -i "s/yunouser/$db_user/g" $final_path/config.php
|
|
sudo sed -i "s/yunopass/$db_pwd/g" $final_path/config.php
|
|
sudo sed -i "s/yunobase/$db_user/g" $final_path/config.php
|
|
sudo sed -i "s,yunopath,https://$domain$path,g" $final_path/config.php
|
|
|
|
sudo chown -R www-data: $final_path
|
|
|
|
# Modify Nginx configuration file and copy it to Nginx conf directory
|
|
sudo sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
|
|
sudo sed -i "s@ALIASTOCHANGE@$final_path/@g" ../conf/nginx.conf
|
|
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/ttrss.conf
|
|
|
|
sudo service nginx reload
|
|
sudo yunohost app ssowatconf
|
|
sudo yunohost app setting ttrss skipped_uris -v "/public.php,/api"
|
|
|
|
# Update database schema
|
|
sudo su - www-data -c "$final_path/update.php --update-schema"
|