|
@@ -99,9 +99,14 @@ flohmarkt_ynh_up_inst_couchdb() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
flohmarkt_ynh_dump_couchdb() {
|
|
flohmarkt_ynh_dump_couchdb() {
|
|
|
- ls -l ../settings/scripts/couchdb-dump/couchdb-dump.sh # debug
|
|
|
|
|
../settings/scripts/couchdb-dump/couchdb-dump.sh -b -H 127.0.0.1 -d "${app}" \
|
|
../settings/scripts/couchdb-dump/couchdb-dump.sh -b -H 127.0.0.1 -d "${app}" \
|
|
|
- -u admin -p "${password_couchdb_admin}" -f "${YNH_CWD}/${app}.json"
|
|
|
|
|
|
|
+ -q -u admin -p "${password_couchdb_admin}" -f "${YNH_CWD}/${app}.json"
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+flohmarkt_ynh_import_couchdb() {
|
|
|
|
|
+ ls -l ../settings/scripts/couchdb-dump/couchdb-dump.sh ${YNH_CWD}/${app}.json
|
|
|
|
|
+ ../settings/scripts/couchdb-dump/couchdb-dump.sh -r -c -H 127.0.0.1 -d "${app}" \
|
|
|
|
|
+ -q -u admin -p "${password_couchdb_admin}" -f "${YNH_CWD}/${app}.json"
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
flohmarkt_ynh_delete_couchdb_user() {
|
|
flohmarkt_ynh_delete_couchdb_user() {
|
|
@@ -116,27 +121,25 @@ flohmarkt_ynh_delete_couchdb_db() {
|
|
|
curl -s -X DELETE "http://127.0.0.1:5984/${app}" --user "admin:${password_couchdb_admin}"
|
|
curl -s -X DELETE "http://127.0.0.1:5984/${app}" --user "admin:${password_couchdb_admin}"
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-flohmarkt_ynh_import_couchdb() {
|
|
|
|
|
- ls -l ../settings/scripts/couchdb-dump/couchdb-dump.sh # debug
|
|
|
|
|
- ../settings/scripts/couchdb-dump/couchdb-dump.sh -r -c -H 127.0.0.1 -d "${app}" \
|
|
|
|
|
- -u admin -p "${password_couchdb_admin}" -f "${YNH_CWD}/${app}.json"
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
flohmarkt_ynh_create_couchdb_user() {
|
|
flohmarkt_ynh_create_couchdb_user() {
|
|
|
- curl -X PUT "http://127.0.0.1:5984/_users/org.couchdb.user:${app}" --user "admin:${password_couchdb_admin}"\
|
|
|
|
|
|
|
+ curl -s -X PUT "http://127.0.0.1:5984/_users/org.couchdb.user:${app}" --user "admin:${password_couchdb_admin}"\
|
|
|
-H "Accept: application/json" -H "Content-Type: application/json" \
|
|
-H "Accept: application/json" -H "Content-Type: application/json" \
|
|
|
- -d "\{\"name\": \"${app}\", \"${password_couchdb_flohmarkt}\": \"\", \"roles\": \[\], \"type\": \"user\"\}"
|
|
|
|
|
|
|
+ -d "{\"name\": \"${app}\", \"password\": \"${password_couchdb_flohmarkt}\", \"roles\": [], \"type\": \"user\"}"
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
flohmarkt_ynh_couchdb_user_permissions() {
|
|
flohmarkt_ynh_couchdb_user_permissions() {
|
|
|
- curl -X PUT "http://127.0.0.1:5984/${app}/_security" --user "admin:${password_couchdb_admin}"\
|
|
|
|
|
|
|
+ curl -s -X PUT "http://127.0.0.1:5984/${app}/_security" --user "admin:${password_couchdb_admin}"\
|
|
|
-H "Accept: application/json" -H "Content-Type: application/json" \
|
|
-H "Accept: application/json" -H "Content-Type: application/json" \
|
|
|
- -d "\{\"members\":\{\"names\": \[\"${app}\"\],\"roles\": \[\"editor\"\]\}\}"
|
|
|
|
|
|
|
+ -d "{\"members\":{\"names\": [\"${app}\"],\"roles\": [\"editor\"]}}"
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
flohmarkt_ynh_restore_couchdb() {
|
|
flohmarkt_ynh_restore_couchdb() {
|
|
|
# @@ todo for now we'll make sure dbuser and db do not exist
|
|
# @@ todo for now we'll make sure dbuser and db do not exist
|
|
|
|
|
+ # matrix:
|
|
|
|
|
+ # Is there a way to interact with the admin during the scripts/* run?
|
|
|
|
|
+ # absolutely not, and it's by design.
|
|
|
|
|
+ # at bear minimum if you use the manifest v2 and app helpers, the script should fail.
|
|
|
flohmarkt_ynh_delete_couchdb_user || true
|
|
flohmarkt_ynh_delete_couchdb_user || true
|
|
|
flohmarkt_ynh_delete_couchdb_db || true
|
|
flohmarkt_ynh_delete_couchdb_db || true
|
|
|
|
|
|