mirror of
https://github.com/YunoHost-Apps/mineweb_ynh.git
synced 2024-09-03 19:45:54 +02:00
add db
This commit is contained in:
parent
f047e921c5
commit
957d19c7a9
2 changed files with 24 additions and 13 deletions
|
@ -5,9 +5,9 @@ class DATABASE_CONFIG {
|
|||
'datasource' => 'Database/Mysql',
|
||||
'persistent' => false,
|
||||
'host' => 'localhost',
|
||||
'login' => 'LOGIN1',
|
||||
'password' => 'PASSWORD1',
|
||||
'database' => 'DATABASE1',
|
||||
'login' => '__DBUSER__',
|
||||
'password' => '__DBPWD__',
|
||||
'database' => '__DBNAME__',
|
||||
'encoding' => 'utf8',
|
||||
];
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
|
||||
### If the app uses nginx as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app".
|
||||
### If the app provides an internal web server (or uses another application server such as uwsgi), the final path should be "/opt/yunohost/$app"
|
||||
final_path=/opt/yunohost/$app
|
||||
final_path=/var/www/$app
|
||||
test ! -e "$final_path" || ynh_die "This path already contains a folder"
|
||||
|
||||
# Normalize the url path syntax
|
||||
|
@ -81,6 +81,20 @@ port=$(ynh_find_port 8096)
|
|||
yunohost firewall allow --no-upnp TCP $port 2>&1
|
||||
ynh_app_setting_set $app port $port
|
||||
|
||||
#=================================================
|
||||
# CREATE A MYSQL DATABASE
|
||||
#=================================================
|
||||
# If your app uses a MySQL database, you can use these lines to bootstrap
|
||||
# a database, an associated user and save the password in app settings
|
||||
|
||||
db_name=$(ynh_sanitize_dbid $app)
|
||||
ynh_app_setting_set $app db_name $db_name
|
||||
ynh_mysql_setup_db $db_name $db_name
|
||||
|
||||
|
||||
'login' => '',
|
||||
'password' => '',
|
||||
'database' => '',
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
|
@ -89,12 +103,6 @@ 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"
|
||||
|
||||
#==============================================
|
||||
# INSTALL EMBY
|
||||
#==============================================
|
||||
|
||||
dpkg --install $final_path/emby-server-deb*
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -112,9 +120,12 @@ ynh_system_user_create $app
|
|||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
#cp -a ../conf/onlyoffice-documentserver.conf /etc/onlyoffice/documentserver/nginx/onlyoffice-documentserver.conf
|
||||
#ynh_replace_string "__NEXTCLOUDDOMAIN__" "$nextcloud_domain" "/etc/loolwsd/loolwsd.xml"
|
||||
#ynh_replace_string "__PASSWORD__" "$password" "/etc/loolwsd/loolwsd.xml"
|
||||
|
||||
cp -a ../conf/database.php $final_path/database.php
|
||||
|
||||
ynh_replace_string "__DBUSER__" "$db_name" "$final_path/config.json"
|
||||
ynh_replace_string "__DBPWD__" "$db_pwd" "$final_path/config.json"
|
||||
ynh_replace_string "__DBNAME__" "$db_name" "$final_path/config.json"
|
||||
|
||||
#=================================================
|
||||
# STORE THE CONFIG FILE CHECKSUM
|
||||
|
|
Loading…
Add table
Reference in a new issue