[DRE-commits] [diaspora-installer] 01/02: remove diaspora user and data
Praveen Arimbrathodiyil
praveen at moszumanska.debian.org
Mon Mar 20 11:20:22 UTC 2017
This is an automated email from the git hooks/post-receive script.
praveen pushed a commit to branch master
in repository diaspora-installer.
commit 10643f34a4ba2e4add1b1d44a70cacc9195c221e
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date: Mon Mar 20 16:45:29 2017 +0530
remove diaspora user and data
---
debian/diaspora-common.postrm | 24 +++++++++++++++++++++++-
debian/diaspora-common.templates | 7 +++++++
2 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/debian/diaspora-common.postrm b/debian/diaspora-common.postrm
index 38eaa32..dc53840 100644
--- a/debian/diaspora-common.postrm
+++ b/debian/diaspora-common.postrm
@@ -19,7 +19,7 @@ case "$1" in
# been purged.
:
- rm -rf /var/libh/diaspora-common/diaspora.conf
+ rm -rf /var/lib/diaspora-common/diaspora.conf
rm -rf /var/lib/diaspora-common/database.yml
rm -rf /var/lib/diaspora-common/nginx-site-diaspora
rm -rf /var/cache/diaspora /var/log/diaspora
@@ -38,6 +38,27 @@ case "$1" in
if [ -e /usr/share/debconf/confmodule ]; then
# Source debconf library.
. /usr/share/debconf/confmodule
+
+ # Do you want to remove all data?
+ db_input high diaspora-common/purge_ data|| true
+ db_go
+
+ # Check if we should remove data?
+ db_get diaspora-common/purge_data
+ if [ "${RET}" = "true" ]; then
+ rm -f /etc/dbconfig-common/diaspora-common.conf
+ if which ucf >/dev/null 2>&1; then
+ ucf --purge /etc/dbconfig-common/diaspora-common.conf
+ ucfr --purge diaspora-common /etc/dbconfig-common/diaspora-common.conf
+ fi
+ rm -rf ${diaspora_user_home}/public
+ rm -rf ${diaspora_user_home}/app-assets
+ rm -rf ${diaspora_user_home}/Gemfile.lock
+ rm -rf ${diaspora_user_home}/.bundle
+ echo "Removing user: diaspora"
+ id -u diaspora && userdel -r diaspora
+ fi
+
# Remove my changes to the db.
db_purge
fi
@@ -57,6 +78,7 @@ case "$1" in
rm -f /etc/nginx/sites-available/diaspora
rm -f /etc/nginx/sites-enabled/diaspora
rm -rf /etc/diaspora/ssl
+ rm -rf /etc/diaspora
# and finally clear it out from the ucf database
if which ucf >/dev/null; then
diff --git a/debian/diaspora-common.templates b/debian/diaspora-common.templates
index 6feb6a9..f69bdd3 100644
--- a/debian/diaspora-common.templates
+++ b/debian/diaspora-common.templates
@@ -124,3 +124,10 @@ Template:diaspora-common/wordpress_secret
Type: password
_Description: Wordpress Secret:
Give your Wordpress Secret. This can not be blank.
+
+Template: diaspora-common/purge_data
+Type: boolean
+Default: true
+_Description: Remove all data?
+ This will permanently remove all data of this Diaspora instance such as
+ uploaded files and any customizations in homepage.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/diaspora-installer.git
More information about the Pkg-ruby-extras-commits
mailing list