Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
seagreencube
YunoHost Apps
directus_ynh
Commits
81e9fcd2
Commit
81e9fcd2
authored
4 years ago
by
Pat
Browse files
Options
Download
Email Patches
Plain Diff
remove references to unneeded variable
parent
96ee8096
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
check_process
+0
-4
check_process
scripts/actions/create_database
+2
-6
scripts/actions/create_database
scripts/actions/remove_database
+1
-9
scripts/actions/remove_database
scripts/install
+5
-12
scripts/install
scripts/restore
+4
-6
scripts/restore
with
12 additions
and
37 deletions
+12
-37
check_process
View file @
81e9fcd2
...
...
@@ -4,10 +4,8 @@
; Manifest
domain="domain.tld" (DOMAIN)
path="/path" (PATH)
with_sftp=1
password="myreallystrengthpassword"
is_public=1 (PUBLIC|public=1|private=0)
with_mysql=1
; Checks
pkg_linter=1
setup_sub_dir=1
...
...
@@ -28,7 +26,6 @@
with_sftp=0
password=""
is_public=1 (PUBLIC|public=1|private=0)
with_mysql=1
; Checks
setup_sub_dir=1
upgrade=1
...
...
@@ -40,7 +37,6 @@
with_sftp=1
password="myreallystrengthpassword"
is_public=1 (PUBLIC|public=1|private=0)
with_mysql=0
; Checks
setup_sub_dir=1
upgrade=1
...
...
This diff is collapsed.
Click to expand it.
scripts/actions/create_database
View file @
81e9fcd2
...
...
@@ -13,7 +13,6 @@ source /usr/share/yunohost/helpers
# RETRIEVE ARGUMENTS
#=================================================
with_mysql
=
$(
ynh_app_setting_get
--app
=
$app
--key
=
with_mysql
)
final_path
=
$(
ynh_app_setting_get
--app
=
$app
--key
=
final_path
)
app
=
${
YNH_APP_INSTANCE_NAME
:-
$YNH_APP_ID
}
...
...
@@ -33,10 +32,8 @@ app=${YNH_APP_INSTANCE_NAME:-$YNH_APP_ID}
#=================================================
ynh_script_progression
--message
=
"Removing the previous database..."
--weight
=
6
if
[
$with_mysql
-eq
1
]
then
yunohost app action run
$app
remove_database
fi
yunohost app action run
$app
remove_database
#=================================================
# CREATE A NEW DATABASE
...
...
@@ -54,7 +51,6 @@ echo -e "# MySQL Database
name:
${
db_name
}
\n
user:
${
db_name
}
\n
pass:
${
db_pwd
}
"
>
"
$final_path
/db_access.txt"
# Update the config of the app
ynh_app_setting_set
--app
=
$app
--key
=
with_mysql
--value
=
1
ynh_app_setting_set
--app
=
$app
--key
=
db_name
--value
=
$db_name
#=================================================
...
...
This diff is collapsed.
Click to expand it.
scripts/actions/remove_database
View file @
81e9fcd2
...
...
@@ -13,8 +13,6 @@ source /usr/share/yunohost/helpers
# RETRIEVE ARGUMENTS
#=================================================
with_mysql
=
$(
ynh_app_setting_get
--app
=
$app
--key
=
with_mysql
)
app
=
${
YNH_APP_INSTANCE_NAME
:-
$YNH_APP_ID
}
#=================================================
...
...
@@ -25,10 +23,7 @@ app=${YNH_APP_INSTANCE_NAME:-$YNH_APP_ID}
# CHECK IF AN ACTION HAS TO BE DONE
#=================================================
if
[
$with_mysql
-eq
0
]
then
ynh_die
--message
=
"There's no database to remove."
--ret_code
=
0
fi
ynh_die
--message
=
"There's no database to remove."
--ret_code
=
0
#=================================================
# SPECIFIC ACTION
...
...
@@ -40,9 +35,6 @@ ynh_script_progression --message="Removing the database..." --weight=9
db_name
=
$(
ynh_app_setting_get
--app
=
$app
--key
=
db_name
)
ynh_mysql_remove_db
--db_user
=
$db_name
--db_name
=
$db_name
# Update the config of the app
ynh_app_setting_set
--app
=
$app
--key
=
with_mysql
--value
=
0
#=================================================
# END OF SCRIPT
#=================================================
...
...
This diff is collapsed.
Click to expand it.
scripts/install
View file @
81e9fcd2
...
...
@@ -99,14 +99,12 @@ fi
mkdir
-p
"
$final_path
/www"
if
[
$with_mysql
-eq
1
]
;
then
# Store the database access
echo
-e
"# MySQL Database
# Store the database access
echo
-e
"# MySQL Database
name:
${
db_name
}
\n
user:
${
db_user
}
\n
pass:
${
db_pwd
}
"
>
../sources/db_access.txt
# Copy files to the right place
cp
-r
"../sources/db_access.txt"
"
$final_path
/db_access.txt"
fi
# Copy files to the right place
cp
-r
"../sources/db_access.txt"
"
$final_path
/db_access.txt"
# Copy files to the right place
cp
"../sources/www/index.js"
"
$final_path
/www/
$entry_point
"
...
...
@@ -174,15 +172,10 @@ ynh_systemd_action --service_name=nginx --action=reload
# Get main domain and buid the url of the admin panel of the app.
admin_panel
=
"https://
$(
grep
portal_domain /etc/ssowat/conf.json |
cut
-d
'"'
-f4
)
/yunohost/admin/#/apps/
$app
"
if
[
$with_mysql
-eq
1
]
then
sql_infos
=
"
sql_infos
=
"
You've asked for a database, please find here the information about this SQL database.
$(
cat
"
$final_path
/db_access.txt"
)
"
else
sql_infos
=
""
fi
if
[
$with_sftp
-eq
1
]
then
...
...
This diff is collapsed.
Click to expand it.
scripts/restore
View file @
81e9fcd2
...
...
@@ -61,13 +61,11 @@ ynh_restore_file --origin_path="$final_path"
# RESTORE THE MYSQL DATABASE
#=================================================
if
[
$with_mysql
-eq
1
]
;
then
ynh_script_progression
--message
=
"Restoring the MySQL database..."
ynh_script_progression
--message
=
"Restoring the MySQL database..."
db_pwd
=
$(
ynh_app_setting_get
--app
=
$app
--key
=
mysqlpwd
)
ynh_mysql_setup_db
--db_user
=
$db_name
--db_name
=
$db_name
--db_pwd
=
$db_pwd
ynh_mysql_connect_as
--user
=
$db_name
--password
=
$db_pwd
--database
=
$db_name
< ./db.sql
fi
db_pwd
=
$(
ynh_app_setting_get
--app
=
$app
--key
=
mysqlpwd
)
ynh_mysql_setup_db
--db_user
=
$db_name
--db_name
=
$db_name
--db_pwd
=
$db_pwd
ynh_mysql_connect_as
--user
=
$db_name
--password
=
$db_pwd
--database
=
$db_name
< ./db.sql
#=================================================
# RECREATE THE DEDICATED USER
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help