mirror of
https://github.com/YunoHost-Apps/friendica_ynh.git
synced 2024-09-03 18:36:14 +02:00
Upgrade to 2018.09
This commit is contained in:
parent
33a67025e5
commit
69f8d6a816
6 changed files with 102 additions and 17 deletions
|
@ -6,7 +6,7 @@
|
|||
|
||||
|
||||
[Friendica](http://friendi.ca/) integration for YunoHost<br>
|
||||
**Version:2018.05**<br><br>
|
||||
**Version:2018.09**<br><br>
|
||||
|
||||
Current snapshot in *sources*:
|
||||
|
||||
|
|
33
conf/addon.ini.php
Normal file
33
conf/addon.ini.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php return <<<INI
|
||||
|
||||
; Copy this configuration file to addon.ini.php and edit it if you want to configure addons, see below example for the twitter addon
|
||||
|
||||
;[twitter]
|
||||
;consumerkey = localhost
|
||||
;consumersecret = mysqlusername
|
||||
|
||||
[ldapauth]
|
||||
// ldap hostname server - required
|
||||
ldap_server = localhost
|
||||
// dn to search users - required
|
||||
ldap_searchdn = ou=users,dc=yunohost,dc=org
|
||||
// attribute to find username - required
|
||||
ldap_userattr = uid
|
||||
|
||||
// admin dn - optional - only if ldap server dont have anonymous access
|
||||
//ldap_binddn = cn=admin,dc=example,dc=com
|
||||
// admin password - optional - only if ldap server dont have anonymous access
|
||||
//ldap_bindpw = password
|
||||
|
||||
// for create Friendica account if user exist in ldap
|
||||
// required an email and a simple (beautiful) nickname on user ldap object
|
||||
// active account creation - optional - default none
|
||||
ldap_autocreateaccount = true
|
||||
// attribute to get email - optional - default : 'mail'
|
||||
ldap_autocreateaccount_emailattribute = mail
|
||||
// attribute to get nickname - optional - default : 'givenName'
|
||||
ldap_autocreateaccount_nameattribute = givenName
|
||||
|
||||
|
||||
INI;
|
||||
// Keep this line
|
41
conf/local.ini.php
Normal file
41
conf/local.ini.php
Normal file
|
@ -0,0 +1,41 @@
|
|||
<?php return <<<INI
|
||||
|
||||
; If automatic system installation fails:
|
||||
|
||||
; Copy this file to local.ini.php
|
||||
|
||||
; Why local.ini.php? Because it contains sensitive information which could
|
||||
; give somebody complete control of your database. Apache's default
|
||||
; configuration will interpret any .php file as a script and won't show the values
|
||||
|
||||
; Then set the following for your MySQL installation
|
||||
|
||||
[database]
|
||||
hostname = localhost
|
||||
username = mysqlusername
|
||||
password = mysqlpassword
|
||||
database = mysqldatabasename
|
||||
charset = utf8mb4
|
||||
|
||||
|
||||
; ****************************************************************
|
||||
; The configuration below will be overruled by the admin panel.
|
||||
; Changes made below will only have an effect if the database does
|
||||
; not contain any configuration for the friendica system.
|
||||
; ****************************************************************
|
||||
|
||||
[config]
|
||||
admin_email =
|
||||
|
||||
sitename = Friendica Social Network
|
||||
|
||||
register_policy = REGISTER_OPEN
|
||||
register_text =
|
||||
|
||||
[system]
|
||||
default_timezone = UTC
|
||||
|
||||
language = en
|
||||
|
||||
INI;
|
||||
// Keep this line
|
|
@ -8,7 +8,7 @@
|
|||
},
|
||||
"url": "http://friendi.ca",
|
||||
"license": "free",
|
||||
"version": "2018.05",
|
||||
"version": "2018.09",
|
||||
"maintainer": {
|
||||
"name": "Anmol Sharma",
|
||||
"email": "anmol@datamol.org"
|
||||
|
|
|
@ -89,6 +89,7 @@ ynh_mysql_setup_db $db_name $db_name
|
|||
ynh_app_setting_set $app final_path $final_path
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source "$final_path"
|
||||
cp -f "$final_path/.htaccess-dist" "$final_path/.htaccess"
|
||||
|
||||
# 2 - Addons
|
||||
sudo mkdir $final_path/addon
|
||||
|
@ -103,20 +104,20 @@ ynh_add_nginx_config
|
|||
|
||||
|
||||
# configure friendica
|
||||
sudo cp "../conf/htconfig.php" "/var/www/$app/.htconfig.php"
|
||||
ynh_replace_string "your.mysqlhost.com" "localhost" "$final_path/.htconfig.php"
|
||||
ynh_replace_string "mysqlusername" "$db_name" "$final_path/.htconfig.php"
|
||||
ynh_replace_string "mysqldatabasename" "$db_name" "$final_path/.htconfig.php"
|
||||
ynh_replace_string "mysqlpassword" "$db_pwd" "$final_path/.htconfig.php"
|
||||
ynh_replace_string "__ADMIN_EMAIL__" "$admin_mail" "$final_path/.htconfig.php"
|
||||
ynh_replace_string "die('The configuration you did manually contains some mistakes. Please have a look at your .htconfig.php file.');" "// die('The configuration you did manually contains some mistakes. Please have a look at your .htconfig.php file.');" "$final_path/.htconfig.php"
|
||||
sudo cp -f "/var/www/$app/config/local-sample.ini.php" "/var/www/$app/config/local.ini.php"
|
||||
ynh_replace_string "your.mysqlhost.com" "localhost" "$final_path/config/local.ini.php"
|
||||
ynh_replace_string "mysqlusername" "$db_name" "$final_path/config/local.ini.php"
|
||||
ynh_replace_string "mysqldatabasename" "$db_name" "$final_path/config/local.ini.php"
|
||||
ynh_replace_string "mysqlpassword" "$db_pwd" "$final_path/config/local.ini.php"
|
||||
ynh_replace_string "admin_email =" "admin_email = $admin_mail" "$final_path/config/local.ini.php"
|
||||
ynh_replace_string "register_policy = REGISTER_OPEN" "register_policy = REGISTER_CLOSED" "$final_path/config/local.ini.php"
|
||||
|
||||
|
||||
# init db
|
||||
ynh_mysql_connect_as "$db_name" "$db_pwd" "$db_name" < "$final_path/database.sql"
|
||||
|
||||
# addon config
|
||||
sudo su -c "cat ../conf/conf.php >> $final_path/.htconfig.php"
|
||||
sudo cp "../conf/addon.ini.php" "$final_path/config/."
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
|
|
|
@ -39,10 +39,19 @@ ynh_install_app_dependencies 'php-mbstring|base-files(<<9.0)' php5-cli 'php5-ima
|
|||
# Create a temporary directory
|
||||
tmpdir="$(mktemp -d)"
|
||||
# Backup the config file in the temp dir
|
||||
cp -a "$final_path/.htconfig.php" "$tmpdir/.htconfig.php"
|
||||
if [ -f $final_path/.htaccess ]; then
|
||||
cp -a "$final_path/.htaccess" "$tmpdir/.htaccess"
|
||||
cp -af "$final_path/.htaccess" "$tmpdir/.htaccess"
|
||||
cp -af "$final_path/view/smarty3" "$tmpdir/view/smarty3"
|
||||
if [ -f $final_path/.htconfig.php ]; then
|
||||
rm "$final_path/.htconfig.php"
|
||||
cp -f "/var/www/$app/config/local-sample.ini.php" "/var/www/$app/config/local.ini.php"
|
||||
ynh_replace_string "your.mysqlhost.com" "localhost" "$final_path/config/local.ini.php"
|
||||
ynh_replace_string "mysqlusername" "$db_name" "$final_path/config/local.ini.php"
|
||||
ynh_replace_string "mysqldatabasename" "$db_name" "$final_path/config/local.ini.php"
|
||||
ynh_replace_string "mysqlpassword" "$db_pwd" "$final_path/config/local.ini.php"
|
||||
ynh_replace_string "admin_email =" "admin_email = $admin_mail" "$final_path/config/local.ini.php"
|
||||
ynh_replace_string "register_policy = REGISTER_OPEN" "register_policy = REGISTER_CLOSED" "$final_path/config/local.ini.php"
|
||||
fi
|
||||
cp -af "$final_path/config/local.ini.php" "$tmpdir/config/local.ini.php"
|
||||
rm -Rf "$final_path"
|
||||
|
||||
# If final_path doesn't exist, create it
|
||||
|
@ -60,10 +69,11 @@ path_url=$(ynh_normalize_url_path $path_url)
|
|||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source "$final_path"
|
||||
sudo cp -a "$tmpdir/.htconfig.php" "${final_path}"
|
||||
if [ -f $final_path/.htaccess ]; then
|
||||
cp -af "$tmpdir/.htaccess" "${final_path}"
|
||||
fi
|
||||
sudo cp -af "$tmpdir/.htaccess" "${final_path}"
|
||||
sudo cp -af "$tmpdir/view/smarty3" "${final_path}/view/smarty3"
|
||||
sudo cp -af "$tmpdir/config/local.ini.php" "${final_path}/config/local.ini.php"
|
||||
|
||||
|
||||
sudo rm -Rf "$tmpdir"
|
||||
|
||||
#Copy Addons
|
||||
|
|
Loading…
Add table
Reference in a new issue