Replace readme with password store
This commit is contained in:
parent
4ade699856
commit
c3630f4900
|
@ -145,18 +145,6 @@ function install_batman {
|
|||
exit 72524
|
||||
fi
|
||||
|
||||
if ! grep -q "Mesh Networking (B.A.T.M.A.N)" /home/$MY_USERNAME/README; then
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo 'Mesh Networking (B.A.T.M.A.N)' >> /home/$MY_USERNAME/README
|
||||
echo '=============================' >> /home/$MY_USERNAME/README
|
||||
echo "Mesh ESSID: $WIFI_SSID" >> /home/$MY_USERNAME/README
|
||||
echo "Mesh cell ID: $BATMAN_CELLID" >> /home/$MY_USERNAME/README
|
||||
echo "Mesh wifi channel: $WIFI_CHANNEL" >> /home/$MY_USERNAME/README
|
||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
|
||||
chmod 600 /home/$MY_USERNAME/README
|
||||
fi
|
||||
|
||||
function_check configure_firewall_for_batman
|
||||
configure_firewall_for_batman
|
||||
APP_INSTALLED=1
|
||||
|
|
|
@ -61,7 +61,7 @@ function install_interactive_dokuwiki {
|
|||
}
|
||||
|
||||
function change_password_dokuwiki {
|
||||
echo -n ''
|
||||
${PROJECT_NAME}-pass -u $1 -a dokuwiki -p "$2"
|
||||
}
|
||||
|
||||
function reconfigure_dokuwiki {
|
||||
|
@ -203,21 +203,12 @@ function remove_dokuwiki {
|
|||
fi
|
||||
remove_completion_param "install_dokuwiki"
|
||||
remove_completion_param "dokuwiki domain"
|
||||
sed -i '/Dokuwiki/d' /home/$MY_USERNAME/README
|
||||
sed -i '/dokuwiki/d' $COMPLETION_FILE
|
||||
|
||||
function_check remove_ddns_domain
|
||||
remove_ddns_domain $DOKUWIKI_DOMAIN_NAME
|
||||
}
|
||||
|
||||
function get_dokuwiki_admin_password {
|
||||
if [ -f /home/$MY_USERNAME/README ]; then
|
||||
if grep -q "Dokuwiki password" /home/$MY_USERNAME/README; then
|
||||
DOKUWIKI_ADMIN_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "Dokuwiki password:" | awk -F ':' '{print $2}' | sed 's/^ *//')
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function install_dokuwiki {
|
||||
if [ ! $DOKUWIKI_DOMAIN_NAME ]; then
|
||||
return
|
||||
|
@ -277,8 +268,6 @@ function install_dokuwiki {
|
|||
echo "\$conf['authtype'] = 'authplain';" >> /etc/dokuwiki/local.php
|
||||
fi
|
||||
|
||||
function_check get_dokuwiki_admin_password
|
||||
get_dokuwiki_admin_password
|
||||
if [ -f $IMAGE_PASSWORD_FILE ]; then
|
||||
DOKUWIKI_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
|
||||
else
|
||||
|
@ -477,18 +466,7 @@ function install_dokuwiki {
|
|||
function_check add_ddns_domain
|
||||
add_ddns_domain $DOKUWIKI_DOMAIN_NAME
|
||||
|
||||
# add some post-install instructions
|
||||
if ! grep -q $"Dokuwiki password" /home/$MY_USERNAME/README; then
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo $'# Dokuwiki' >> /home/$MY_USERNAME/README
|
||||
echo $"Dokuwiki onion domain: ${DOKUWIKI_ONION_HOSTNAME}" >> /home/$MY_USERNAME/README
|
||||
echo $"Dokuwiki username: $MY_USERNAME" >> /home/$MY_USERNAME/README
|
||||
echo $"Dokuwiki password: $DOKUWIKI_ADMIN_PASSWORD" >> /home/$MY_USERNAME/README
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
|
||||
chmod 600 /home/$MY_USERNAME/README
|
||||
fi
|
||||
${PROJECT_NAME}-pass -u $MY_USERNAME -a dokuwiki -p "$DOKUWIKI_ADMIN_PASSWORD"
|
||||
|
||||
APP_INSTALLED=1
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ etherpad_variables=(ETHERPAD_COMMIT
|
|||
MY_USERNAME)
|
||||
|
||||
function change_password_etherpad {
|
||||
echo -n ''
|
||||
${PROJECT_NAME}-pass -u $1 -a dokuwiki -p "$2"
|
||||
}
|
||||
|
||||
function etherpad_create_database {
|
||||
|
@ -179,6 +179,7 @@ function create_etherpad_settings {
|
|||
function remove_user_etherpad {
|
||||
remove_username="$1"
|
||||
read_config_param ETHERPAD_DOMAIN_NAME
|
||||
${PROJECT_NAME}-pass -u $remove_username --rmapp etherpad
|
||||
|
||||
if ! grep -q "\"${remove_username}\": {" /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json; then
|
||||
sed -i "/\"${remove_username}\": {/,/},/d" /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
|
||||
|
@ -188,6 +189,7 @@ function remove_user_etherpad {
|
|||
function add_user_etherpad {
|
||||
new_username="$1"
|
||||
new_user_password="$2"
|
||||
${PROJECT_NAME}-pass -u $new_username -a etherpad -p "$new_user_password"
|
||||
read_config_param ETHERPAD_DOMAIN_NAME
|
||||
if ! grep -q "\"${new_username}\": {" /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json; then
|
||||
sed -i "/\"users\": {/a \"${new_username}\": {
|
||||
|
@ -420,7 +422,6 @@ function remove_etherpad {
|
|||
remove_app etherpad
|
||||
remove_completion_param install_etherpad
|
||||
sed -i '/etherpad/d' $COMPLETION_FILE
|
||||
sed -i '/Etherpad/d' /home/$MY_USERNAME/README
|
||||
remove_backup_database_local etherpad
|
||||
deluser --remove-all-files etherpad
|
||||
remove_nodejs etherpad
|
||||
|
@ -595,30 +596,7 @@ function install_etherpad {
|
|||
|
||||
ETHERPAD_ONION_HOSTNAME=$(add_onion_service etherpad 80 ${ETHERPAD_ONION_PORT})
|
||||
|
||||
# some post-install instructions for the user
|
||||
if ! grep -q $"Etherpad administrator" /home/$MY_USERNAME/README; then
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo $'# Etherpad' >> /home/$MY_USERNAME/README
|
||||
echo $"Etherpad administrator nickname: $MY_USERNAME" >> /home/$MY_USERNAME/README
|
||||
echo $"Etherpad administrator password: $ETHERPAD_ADMIN_PASSWORD" >> /home/$MY_USERNAME/README
|
||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
|
||||
chmod 600 /home/$MY_USERNAME/README
|
||||
else
|
||||
if [ -f /home/$MY_USERNAME/README ]; then
|
||||
sed -i "s|Etherpad administrator password.*|Etherpad administrator password: $ETHERPAD_ADMIN_PASSWORD|g" /home/$MY_USERNAME/README
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! grep -q "Etherpad onion domain" /home/$MY_USERNAME/README; then
|
||||
echo $"Etherpad onion domain: ${ETHERPAD_ONION_HOSTNAME}" >> /home/$MY_USERNAME/README
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
|
||||
chmod 600 /home/$MY_USERNAME/README
|
||||
else
|
||||
if [ -f /home/$MY_USERNAME/README ]; then
|
||||
sed -i "s|Etherpad onion domain.*|Etherpad onion domain: ${ETHERPAD_ONION_HOSTNAME}|g" /home/$MY_USERNAME/README
|
||||
fi
|
||||
fi
|
||||
${PROJECT_NAME}-pass -u $MY_USERNAME -a etherpad -p "$ETHERPAD_ADMIN_PASSWORD"
|
||||
|
||||
function_check add_ddns_domain
|
||||
add_ddns_domain $ETHERPAD_DOMAIN_NAME
|
||||
|
|
|
@ -230,21 +230,11 @@ function remove_ghost {
|
|||
remove_completion_param "install_ghost"
|
||||
sed -i '/Ghost/d' $COMPLETION_FILE
|
||||
sed -i '/ghost/d' $COMPLETION_FILE
|
||||
sed -i '/ghost/d' /home/$MY_USERNAME/README
|
||||
sed -i '/Ghost/d' /home/$MY_USERNAME/README
|
||||
|
||||
function_check remove_ddns_domain
|
||||
remove_ddns_domain $GHOST_DOMAIN_NAME
|
||||
}
|
||||
|
||||
function get_ghost_admin_password {
|
||||
if [ -f /home/$MY_USERNAME/README ]; then
|
||||
if grep -q "Your ghost password is" /home/$MY_USERNAME/README; then
|
||||
GHOST_ADMIN_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "Your ghost password is" | awk -F ':' '{print $2}' | sed 's/^ *//')
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function ghost_create_config {
|
||||
ghost_config=/var/www/${GHOST_DOMAIN_NAME}/htdocs/config.js
|
||||
|
||||
|
@ -467,12 +457,7 @@ function install_ghost {
|
|||
|
||||
systemctl restart nginx
|
||||
|
||||
if ! grep -q "Ghost onion domain" /home/$MY_USERNAME/README; then
|
||||
echo $"Ghost onion domain: ${GHOST_ONION_HOSTNAME}" >> /home/$MY_USERNAME/README
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
|
||||
chmod 600 /home/$MY_USERNAME/README
|
||||
fi
|
||||
${PROJECT_NAME}-pass -u $MY_USERNAME -a ghost -p "$GHOST_ADMIN_PASSWORD"
|
||||
|
||||
function_check add_ddns_domain
|
||||
add_ddns_domain $GHOST_DOMAIN_NAME
|
||||
|
|
|
@ -77,6 +77,8 @@ gnusocial_variables=(GNUSOCIAL_COMMIT
|
|||
function remove_user_gnusocial {
|
||||
remove_username="$1"
|
||||
|
||||
${PROJECT_NAME}-pass -u $remove_username --rmapp gnusocial
|
||||
|
||||
function_check get_completion_param
|
||||
GNUSOCIAL_DOMAIN_NAME=$(get_completion_param "gnusocial domain")
|
||||
if [ -d /var/www/$GNUSOCIAL_DOMAIN_NAME ]; then
|
||||
|
@ -89,6 +91,8 @@ function add_user_gnusocial {
|
|||
new_username="$1"
|
||||
new_user_password="$2"
|
||||
|
||||
${PROJECT_NAME}-pass -u $new_username -a gnusocial -p "$new_user_password"
|
||||
|
||||
GNUSOCIAL_DOMAIN_NAME=$(get_completion_param "gnusocial domain")
|
||||
if [ -d /var/www/${GNUSOCIAL_DOMAIN_NAME}/htdocs ]; then
|
||||
cd /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs
|
||||
|
@ -185,23 +189,10 @@ function install_interactive_gnusocial {
|
|||
}
|
||||
|
||||
function change_password_gnusocial {
|
||||
echo -n ''
|
||||
}
|
||||
|
||||
function get_mariadb_gnusocial_admin_password {
|
||||
if [ -f /home/$MY_USERNAME/README ]; then
|
||||
if grep -q "MariaDB gnusocial admin password" /home/$MY_USERNAME/README; then
|
||||
GNUSOCIAL_ADMIN_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "MariaDB gnusocial admin password" | awk -F ':' '{print $2}' | sed 's/^ *//')
|
||||
fi
|
||||
if grep -q "gnusocial administrator password" /home/$MY_USERNAME/README; then
|
||||
GNUSOCIAL_ADMIN_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "gnusocial administrator password" | awk -F ':' '{print $2}' | sed 's/^ *//')
|
||||
fi
|
||||
fi
|
||||
${PROJECT_NAME}-pass -u $1 -a gnusocial -p "$2"
|
||||
}
|
||||
|
||||
function gnusocial_create_database {
|
||||
function_check get_mariadb_gnusocial_admin_password
|
||||
get_mariadb_gnusocial_admin_password
|
||||
if [ -f $IMAGE_PASSWORD_FILE ]; then
|
||||
GNUSOCIAL_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
|
||||
else
|
||||
|
@ -489,7 +480,6 @@ function remove_gnusocial {
|
|||
if [ -f /etc/cron.hourly/gnusocial-daemons ]; then
|
||||
rm /etc/cron.hourly/gnusocial-daemons
|
||||
fi
|
||||
sed -i '/Gnusocial/d' /home/$MY_USERNAME/README
|
||||
remove_backup_database_local gnusocial
|
||||
|
||||
function_check remove_ddns_domain
|
||||
|
@ -742,31 +732,7 @@ function install_gnusocial_main {
|
|||
|
||||
${PROJECT_NAME}-addemail -u $MY_USERNAME -e "noreply@$GNUSOCIAL_DOMAIN_NAME" -g gnusocial --public no
|
||||
|
||||
# some post-install instructions for the user
|
||||
if ! grep -q $"Gnusocial administrator" /home/$MY_USERNAME/README; then
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo $'# Gnusocial' >> /home/$MY_USERNAME/README
|
||||
echo $"Gnusocial administrator nickname: $MY_USERNAME" >> /home/$MY_USERNAME/README
|
||||
echo $"Gnusocial administrator password: $GNUSOCIAL_ADMIN_PASSWORD" >> /home/$MY_USERNAME/README
|
||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
|
||||
chmod 600 /home/$MY_USERNAME/README
|
||||
else
|
||||
if [ -f /home/$MY_USERNAME/README ]; then
|
||||
sed -i "s|Gnusocial administrator password.*|Gnusocial administrator password: $GNUSOCIAL_ADMIN_PASSWORD|g" /home/$MY_USERNAME/README
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! grep -q "Gnusocial onion domain" /home/$MY_USERNAME/README; then
|
||||
echo $"Gnusocial onion domain: ${GNUSOCIAL_ONION_HOSTNAME}" >> /home/$MY_USERNAME/README
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
|
||||
chmod 600 /home/$MY_USERNAME/README
|
||||
else
|
||||
if [ -f /home/$MY_USERNAME/README ]; then
|
||||
sed -i "s|Gnusocial onion domain.*|Gnusocial onion domain: ${GNUSOCIAL_ONION_HOSTNAME}|g" /home/$MY_USERNAME/README
|
||||
fi
|
||||
fi
|
||||
${PROJECT_NAME}-pass -u $MY_USERNAME -a gnusocial -p "$GNUSOCIAL_ADMIN_PASSWORD"
|
||||
|
||||
set_completion_param "gnusocial domain" "$GNUSOCIAL_DOMAIN_NAME"
|
||||
|
||||
|
|
|
@ -115,18 +115,7 @@ function gogs_parameters {
|
|||
GOGS_BIN="https://github.com/gogits/gogs/releases/download/v${GOGS_VERSION}/linux_${CURR_ARCH}.tar.gz"
|
||||
}
|
||||
|
||||
function get_mariadb_git_admin_password {
|
||||
if [ -f /home/${MY_USERNAME}/README ]; then
|
||||
if grep -q "Gogs admin user password" /home/${MY_USERNAME}/README; then
|
||||
GIT_ADMIN_PASSWORD=$(cat /home/${MY_USERNAME}/README | grep "Gogs admin user password" | awk -F ':' '{print $2}' | sed 's/^ *//')
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function gogs_create_database {
|
||||
function_check get_mariadb_git_admin_password
|
||||
get_mariadb_git_admin_password
|
||||
|
||||
if [ -f ${IMAGE_PASSWORD_FILE} ]; then
|
||||
GIT_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
|
||||
else
|
||||
|
@ -580,13 +569,6 @@ function install_gogs {
|
|||
systemctl restart php5-fpm
|
||||
systemctl restart nginx
|
||||
|
||||
if ! grep -q "Gogs onion domain" /home/${MY_USERNAME}/README; then
|
||||
echo "Gogs onion domain: ${GIT_ONION_HOSTNAME}" >> /home/${MY_USERNAME}/README
|
||||
echo '' >> /home/${MY_USERNAME}/README
|
||||
chown ${MY_USERNAME}:${MY_USERNAME} /home/${MY_USERNAME}/README
|
||||
chmod 600 /home/${MY_USERNAME}/README
|
||||
fi
|
||||
|
||||
set_completion_param "gogs domain" "$GIT_DOMAIN_NAME"
|
||||
set_completion_param "gogs onion domain" "$GIT_ONION_HOSTNAME"
|
||||
|
||||
|
@ -594,14 +576,8 @@ function install_gogs {
|
|||
add_ddns_domain ${GIT_DOMAIN_NAME}
|
||||
|
||||
# obtain the secret key
|
||||
GOGS_SECRET_KEY=
|
||||
if grep -q "Gogs secret key:" /home/${MY_USERNAME}/README; then
|
||||
GOGS_SECRET_KEY=$(cat /home/${MY_USERNAME}/README | grep "Gogs secret key:" | awk -F ':' '{print $2}' | sed 's/^ *//')
|
||||
else
|
||||
GOGS_SECRET_KEY="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
|
||||
echo "Gogs secret key:${GOGS_SECRET_KEY}" >> /home/${MY_USERNAME}/README
|
||||
chown $MY_USERNAME:$MY_USERNAME /home/${MY_USERNAME}/README
|
||||
fi
|
||||
GOGS_SECRET_KEY="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
|
||||
${PROJECT_NAME}-pass -u $MY_USERNAME -a gogs -p "*"
|
||||
|
||||
# create the configuration
|
||||
GOGS_CONFIG_PATH=/home/${GOGS_USERNAME}/custom/conf
|
||||
|
|
|
@ -94,6 +94,8 @@ function set_avatar_from_url {
|
|||
function remove_user_htmly {
|
||||
remove_username="$1"
|
||||
|
||||
${PROJECT_NAME}-pass -u $remove_username --rmapp htmly
|
||||
|
||||
if [ -f /var/www/${HTMLY_DOMAIN_NAME}/htdocs/config/users/${remove_username}.ini ]; then
|
||||
rm /var/www/${HTMLY_DOMAIN_NAME}/htdocs/config/users/${remove_username}.ini
|
||||
fi
|
||||
|
@ -108,6 +110,8 @@ function add_user_htmly {
|
|||
new_username="$1"
|
||||
new_user_password="$2"
|
||||
|
||||
${PROJECT_NAME}-pass -u $new_username -a htmly -p "$new_user_password"
|
||||
|
||||
if [ ! -d /var/www/$HTMLY_DOMAIN_NAME/htdocs/config/users ]; then
|
||||
echo '2'
|
||||
return
|
||||
|
@ -175,6 +179,7 @@ function change_password_htmly {
|
|||
echo $'Htmly password is too short'
|
||||
return
|
||||
fi
|
||||
${PROJECT_NAME}-pass -u $HTMLY_USERNAME -a htmly -p "$HTMLY_PASSWORD"
|
||||
HTMLY_PASSWORD_HASH=$(${PROJECT_NAME}-sec --htmlyhash "$HTMLY_PASSWORD")
|
||||
if [ ${#HTMLY_PASSWORD_HASH} -lt 8 ]; then
|
||||
echo $'Htmly admin password could not be hashed'
|
||||
|
@ -352,21 +357,11 @@ function remove_htmly {
|
|||
remove_completion_param "install_htmly"
|
||||
sed -i '/Htmly/d' $COMPLETION_FILE
|
||||
sed -i '/htmly/d' $COMPLETION_FILE
|
||||
sed -i '/htmly/d' /home/$MY_USERNAME/README
|
||||
sed -i '/Htmly/d' /home/$MY_USERNAME/README
|
||||
|
||||
function_check remove_ddns_domain
|
||||
remove_ddns_domain $HTMLY_DOMAIN_NAME
|
||||
}
|
||||
|
||||
function get_htmly_admin_password {
|
||||
if [ -f /home/$MY_USERNAME/README ]; then
|
||||
if grep -q "Your htmly password is" /home/$MY_USERNAME/README; then
|
||||
HTMLY_ADMIN_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "Your htmly password is" | awk -F ':' '{print $2}' | sed 's/^ *//')
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function install_htmly_social_networks {
|
||||
# set social networks
|
||||
if grep -q "social.hubzilla" /var/www/$HTMLY_DOMAIN_NAME/htdocs/config/config.ini; then
|
||||
|
@ -386,18 +381,10 @@ function install_htmly_social_networks {
|
|||
|
||||
function install_htmly_user {
|
||||
# create a user password
|
||||
function_check get_htmly_admin_password
|
||||
get_htmly_admin_password
|
||||
if [ -f $IMAGE_PASSWORD_FILE ]; then
|
||||
HTMLY_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
|
||||
fi
|
||||
if [ ! $HTMLY_ADMIN_PASSWORD ]; then
|
||||
else
|
||||
HTMLY_ADMIN_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
|
||||
echo $'# htmly' >> /home/$MY_USERNAME/README
|
||||
echo $"Your htmly username: $MY_USERNAME" >> /home/$MY_USERNAME/README
|
||||
echo $"Your htmly password is: $HTMLY_ADMIN_PASSWORD" >> /home/$MY_USERNAME/README
|
||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
|
||||
chmod 600 /home/$MY_USERNAME/README
|
||||
fi
|
||||
|
||||
# create a user
|
||||
|
@ -644,13 +631,7 @@ function install_htmly {
|
|||
systemctl restart php5-fpm
|
||||
systemctl restart nginx
|
||||
|
||||
if ! grep -q "Htmly onion domain" /home/$MY_USERNAME/README; then
|
||||
echo $"Htmly onion domain: ${HTMLY_ONION_HOSTNAME}" >> /home/$MY_USERNAME/README
|
||||
echo $"Log into your htmly at https://${HTMLY_ONION_HOSTNAME}/login" >> /home/$MY_USERNAME/README
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
|
||||
chmod 600 /home/$MY_USERNAME/README
|
||||
fi
|
||||
${PROJECT_NAME}-pass -u $MY_USERNAME -a htmly -p "$HTMLY_ADMIN_PASSWORD"
|
||||
|
||||
function_check add_ddns_domain
|
||||
add_ddns_domain $HTMLY_DOMAIN_NAME
|
||||
|
|
|
@ -55,6 +55,7 @@ hubzilla_variables=(ONION_ONLY
|
|||
|
||||
function remove_user_hubzilla {
|
||||
remove_username="$1"
|
||||
${PROJECT_NAME}-pass -u $remove_username --rmapp hubzilla
|
||||
}
|
||||
|
||||
function add_user_hubzilla {
|
||||
|
@ -65,7 +66,7 @@ function add_user_hubzilla {
|
|||
|
||||
new_username="$1"
|
||||
new_user_password="$2"
|
||||
|
||||
${PROJECT_NAME}-pass -u $new_username -a hubzilla -p "$new_user_password"
|
||||
echo '0'
|
||||
}
|
||||
|
||||
|
@ -166,39 +167,17 @@ function install_interactive_hubzilla {
|
|||
}
|
||||
|
||||
function change_password_hubzilla {
|
||||
echo -n ''
|
||||
}
|
||||
|
||||
function get_mariadb_hubzilla_admin_password {
|
||||
if [ -f /home/$MY_USERNAME/README ]; then
|
||||
if grep -q "MariaDB Hubzilla admin password" /home/$MY_USERNAME/README; then
|
||||
HUBZILLA_ADMIN_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "MariaDB Hubzilla admin password" | awk -F ':' '{print $2}' | sed 's/^ *//')
|
||||
fi
|
||||
fi
|
||||
${PROJECT_NAME}-pass -u $1 -a hubzilla -p "$2"
|
||||
}
|
||||
|
||||
function hubzilla_create_database {
|
||||
function_check get_mariadb_hubzilla_admin_password
|
||||
get_mariadb_hubzilla_admin_password
|
||||
if [ -f $IMAGE_PASSWORD_FILE ]; then
|
||||
HUBZILLA_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
|
||||
fi
|
||||
if [ ! $HUBZILLA_ADMIN_PASSWORD ]; then
|
||||
HUBZILLA_ADMIN_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
|
||||
if ! grep "# Hubzilla" /home/$MY_USERNAME/README; then
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo '# Hubzilla' >> /home/$MY_USERNAME/README
|
||||
if [[ $ONION_ONLY == 'no' ]]; then
|
||||
echo $"Open https://$HUBZILLA_DOMAIN_NAME and register a new user" >> /home/$MY_USERNAME/README
|
||||
else
|
||||
echo $"Open http://$HUBZILLA_ONION_HOSTNAME and register a new user" >> /home/$MY_USERNAME/README
|
||||
fi
|
||||
echo $"Your MariaDB Hubzilla admin password is: $HUBZILLA_ADMIN_PASSWORD" >> /home/$MY_USERNAME/README
|
||||
fi
|
||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
|
||||
chmod 600 /home/$MY_USERNAME/README
|
||||
fi
|
||||
${PROJECT_NAME}-pass -u $MY_USERNAME -a hubzilla -p "$HUBZILLA_ADMIN_PASSWORD"
|
||||
if [ ! $HUBZILLA_ADMIN_PASSWORD ]; then
|
||||
return
|
||||
fi
|
||||
|
@ -308,8 +287,6 @@ function remove_hubzilla {
|
|||
function_check remove_onion_service
|
||||
remove_onion_service hubzilla ${HUBZILLA_ONION_PORT}
|
||||
sed -i '/hubzilla/d' $COMPLETION_FILE
|
||||
sed -i '/hubzilla/d' /home/$MY_USERNAME/README
|
||||
sed -i '/Hubzilla/d' /home/$MY_USERNAME/README
|
||||
sed -i '/poller.php/d' /etc/crontab
|
||||
|
||||
function_check remove_ddns_domain
|
||||
|
|
|
@ -161,6 +161,8 @@ function remove_user_irc_bouncer {
|
|||
function remove_user_irc {
|
||||
remove_username="$1"
|
||||
|
||||
${PROJECT_NAME}-pass -u $remove_username --rmapp irc
|
||||
|
||||
remove_user_irc_bouncer ${remove_username}
|
||||
if [ -d /home/${remove_username}/.irssi ]; then
|
||||
rm -rf /home/${remove_username}/.irssi
|
||||
|
@ -178,6 +180,8 @@ function add_user_irc_bouncer {
|
|||
is_admin='false'
|
||||
fi
|
||||
|
||||
${PROJECT_NAME}-pass -u $new_username -a irc -p "$new_user_password"
|
||||
|
||||
if [[ $(is_valid_user "$new_username") == "0" ]]; then
|
||||
return
|
||||
fi
|
||||
|
@ -344,8 +348,9 @@ function irc_set_global_password {
|
|||
# change the server password
|
||||
sed -i "s|Server = 127.0.0.1.*|Server = 127.0.0.1 ${IRC_PORT} ${NEW_IRC_PASSWORD}|g" /home/znc/.znc/configs/znc.conf
|
||||
|
||||
# Update the password in the readme
|
||||
sed -i "s|IRC login password.*|IRC login password: $NEW_IRC_PASSWORD|g" /home/$MY_USERNAME/README
|
||||
# Update the password
|
||||
${PROJECT_NAME}-pass -u $MY_USERNAME -a irc -p "$NEW_IRC_PASSWORD"
|
||||
|
||||
|
||||
if [ -f $INSTALL_DIR/matrix_irc_bridge/config.yaml ]; then
|
||||
sed -i "s|password: .*|password: \"$NEW_IRC_PASSWORD\"|g" $INSTALL_DIR/matrix_irc_bridge/config.yaml
|
||||
|
@ -400,7 +405,7 @@ function install_interactive_irc {
|
|||
}
|
||||
|
||||
function change_password_irc {
|
||||
echo -n ''
|
||||
${PROJECT_NAME}-pass -u $1 -a irc -p "$2"
|
||||
}
|
||||
|
||||
function reconfigure_irc {
|
||||
|
@ -451,7 +456,6 @@ function remove_irc {
|
|||
if [ -d /home/znc ]; then
|
||||
userdel -r znc
|
||||
fi
|
||||
sed -i '/IRC login/d' /home/$MY_USERNAME/README
|
||||
}
|
||||
|
||||
function configure_firewall_for_irc {
|
||||
|
@ -506,12 +510,7 @@ function install_irc_server {
|
|||
IRC_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
|
||||
fi
|
||||
|
||||
if ! grep -q "IRC login password: $IRC_PASSWORD" /home/$MY_USERNAME/README; then
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo "IRC login password: $IRC_PASSWORD" >> /home/$MY_USERNAME/README
|
||||
else
|
||||
sed -i "s|IRC login password.*|IRC login password: $IRC_PASSWORD|g" /home/$MY_USERNAME/README
|
||||
fi
|
||||
${PROJECT_NAME}-pass -u $MY_USERNAME -a irc -p "$IRC_PASSWORD"
|
||||
|
||||
echo '**************************************************' > /etc/ngircd/motd
|
||||
echo $'* F R E E D O M B O N E I R C *' >> /etc/ngircd/motd
|
||||
|
|
|
@ -86,21 +86,6 @@ function can_install_videobridge {
|
|||
fi
|
||||
}
|
||||
|
||||
function create_jitsi_subdomains {
|
||||
JITSI_ONION_HOSTNAME=$(add_onion_service jitsi 80 ${JITSI_ONION_PORT})
|
||||
|
||||
if ! grep -q "Jitsi onion domain" /home/${MY_USERNAME}/README; then
|
||||
echo $"Jitsi onion domain: ${JITSI_ONION_HOSTNAME}" >> /home/${MY_USERNAME}/README
|
||||
echo '' >> /home/${MY_USERNAME}/README
|
||||
chown ${MY_USERNAME}:${MY_USERNAME} /home/${MY_USERNAME}/README
|
||||
chmod 600 /home/${MY_USERNAME}/README
|
||||
else
|
||||
if [ -f /home/${MY_USERNAME}/README ]; then
|
||||
sed -i "s|Jitsi onion domain.*|Jitsi onion domain: ${JITSI_ONION_HOSTNAME}|g" /home/${MY_USERNAME}/README
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function remove_jitsi_subdomains {
|
||||
function_check remove_onion_service
|
||||
remove_onion_service jitsi ${JITSI_ONION_PORT}
|
||||
|
@ -213,7 +198,6 @@ function remove_jitsi {
|
|||
remove_app jitsi
|
||||
remove_completion_param install_jitsi
|
||||
sed -i '/jitsi/d' ${COMPLETION_FILE}
|
||||
sed -i '/Jitsi/d' /home/${MY_USERNAME}/README
|
||||
|
||||
function_check remove_ddns_domain
|
||||
remove_ddns_domain $JITSI_DOMAIN_NAME
|
||||
|
@ -255,8 +239,7 @@ function install_jitsi {
|
|||
wget -qO - https://download.jitsi.org/nightly/deb/${jitsi_deb_repo}/archive.key | apt-key add -
|
||||
apt-get update
|
||||
|
||||
# create onion domains
|
||||
create_jitsi_subdomains
|
||||
JITSI_ONION_HOSTNAME=$(add_onion_service jitsi 80 ${JITSI_ONION_PORT})
|
||||
|
||||
# videobridge
|
||||
if [[ $ONION_ONLY == 'no' ]]; then
|
||||
|
|
|
@ -48,26 +48,15 @@ lychee_variables=(LYCHEE_REPO
|
|||
MY_USERNAME)
|
||||
|
||||
|
||||
function get_mariadb_git_admin_password {
|
||||
if [ -f /home/${MY_USERNAME}/README ]; then
|
||||
if grep -q "Lychee admin user password" /home/${MY_USERNAME}/README; then
|
||||
GIT_ADMIN_PASSWORD=$(cat /home/${MY_USERNAME}/README | grep "Lychee admin user password" | awk -F ':' '{print $2}' | sed 's/^ *//')
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function lychee_create_database {
|
||||
function_check get_mariadb_git_admin_password
|
||||
get_mariadb_git_admin_password
|
||||
|
||||
if [ -f ${IMAGE_PASSWORD_FILE} ]; then
|
||||
GIT_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
|
||||
LYCHEE_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
|
||||
else
|
||||
if [ ! ${GIT_ADMIN_PASSWORD} ]; then
|
||||
GIT_ADMIN_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
|
||||
if [ ! ${LYCHEE_ADMIN_PASSWORD} ]; then
|
||||
LYCHEE_ADMIN_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
|
||||
fi
|
||||
fi
|
||||
if [ ! $GIT_ADMIN_PASSWORD ]; then
|
||||
if [ ! $LYCHEE_ADMIN_PASSWORD ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
|
@ -78,6 +67,7 @@ function lychee_create_database {
|
|||
function remove_user_lychee {
|
||||
remove_username="$1"
|
||||
|
||||
${PROJECT_NAME}-pass -u $remove_username --rmapp lychee
|
||||
}
|
||||
|
||||
function add_user_lychee {
|
||||
|
@ -89,6 +79,8 @@ function add_user_lychee {
|
|||
new_username="$1"
|
||||
new_user_password="$2"
|
||||
|
||||
${PROJECT_NAME}-pass -u $new_username -a lychee -p "$new_user_password"
|
||||
|
||||
echo '0'
|
||||
}
|
||||
|
||||
|
@ -117,6 +109,7 @@ function change_password_lychee {
|
|||
echo $'Lychee password is too short'
|
||||
return
|
||||
fi
|
||||
${PROJECT_NAME}-pass -u $LYCHEE_USERNAME -a lychee -p "$LYCHEE_PASSWORD"
|
||||
}
|
||||
|
||||
function reconfigure_lychee {
|
||||
|
@ -219,21 +212,11 @@ function remove_lychee {
|
|||
remove_completion_param "install_lychee"
|
||||
sed -i '/Lychee/d' $COMPLETION_FILE
|
||||
sed -i '/lychee/d' $COMPLETION_FILE
|
||||
sed -i '/lychee/d' /home/$MY_USERNAME/README
|
||||
sed -i '/Lychee/d' /home/$MY_USERNAME/README
|
||||
|
||||
function_check remove_ddns_domain
|
||||
remove_ddns_domain $LYCHEE_DOMAIN_NAME
|
||||
}
|
||||
|
||||
function get_lychee_admin_password {
|
||||
if [ -f /home/$MY_USERNAME/README ]; then
|
||||
if grep -q "Your lychee password is" /home/$MY_USERNAME/README; then
|
||||
LYCHEE_ADMIN_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "Your lychee password is" | awk -F ':' '{print $2}' | sed 's/^ *//')
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function install_lychee_website {
|
||||
function_check nginx_http_redirect
|
||||
nginx_http_redirect $LYCHEE_DOMAIN_NAME
|
||||
|
@ -434,13 +417,7 @@ function install_lychee {
|
|||
systemctl restart php5-fpm
|
||||
systemctl restart nginx
|
||||
|
||||
if ! grep -q "Lychee onion domain" /home/$MY_USERNAME/README; then
|
||||
echo $"Lychee onion domain: ${LYCHEE_ONION_HOSTNAME}" >> /home/$MY_USERNAME/README
|
||||
echo $"Log into your lychee at https://${LYCHEE_ONION_HOSTNAME}/login" >> /home/$MY_USERNAME/README
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
|
||||
chmod 600 /home/$MY_USERNAME/README
|
||||
fi
|
||||
${PROJECT_NAME}-pass -u $MY_USERNAME -a lychee -p "$LYCHEE_ADMIN_PASSWORD"
|
||||
|
||||
function_check add_ddns_domain
|
||||
add_ddns_domain $LYCHEE_DOMAIN_NAME
|
||||
|
|
|
@ -50,10 +50,11 @@ mailpile_variables=(MAILPILE_REPO
|
|||
|
||||
function remove_user_mailpile {
|
||||
remove_username="$1"
|
||||
${PROJECT_NAME}-pass -u $remove_username --rmapp mailpile
|
||||
}
|
||||
|
||||
function add_user_mailpile {
|
||||
echo '0'
|
||||
${PROJECT_NAME}-pass -u $1 -a mailpile -p "$2"
|
||||
}
|
||||
|
||||
function install_interactive_mailpile {
|
||||
|
@ -72,7 +73,7 @@ function install_interactive_mailpile {
|
|||
}
|
||||
|
||||
function change_password_mailpile {
|
||||
echo -n ''
|
||||
${PROJECT_NAME}-pass -u $1 -a mailpile -p "$2"
|
||||
}
|
||||
|
||||
function reconfigure_mailpile {
|
||||
|
@ -233,8 +234,6 @@ function remove_mailpile {
|
|||
|
||||
sed -i '/Mailpile/d' $COMPLETION_FILE
|
||||
sed -i '/mailpile/d' $COMPLETION_FILE
|
||||
sed -i '/mailpile/d' /home/$MY_USERNAME/README
|
||||
sed -i '/Mailpile/d' /home/$MY_USERNAME/README
|
||||
}
|
||||
|
||||
function install_mailpile {
|
||||
|
@ -386,16 +385,7 @@ function install_mailpile {
|
|||
function_check nginx_ensite
|
||||
nginx_ensite $MAILPILE_DOMAIN_NAME
|
||||
|
||||
if ! grep -q "Mailpile onion domain" /home/$MY_USERNAME/README; then
|
||||
echo $"Mailpile onion domain: ${MAILPILE_ONION_HOSTNAME}" >> /home/$MY_USERNAME/README
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
|
||||
chmod 600 /home/$MY_USERNAME/README
|
||||
else
|
||||
if [ -f /home/$MY_USERNAME/README ]; then
|
||||
sed -i "s|Mailpile onion domain.*|Mailpile onion domain: ${MAILPILE_ONION_HOSTNAME}|g" /home/$MY_USERNAME/README
|
||||
fi
|
||||
fi
|
||||
${PROJECT_NAME}-pass -u $MY_USERNAME -a mailpile -p "*"
|
||||
|
||||
function_check add_ddns_domain
|
||||
add_ddns_domain $MAILPILE_DOMAIN_NAME
|
||||
|
|
|
@ -54,7 +54,7 @@ function install_interactive_mumble {
|
|||
}
|
||||
|
||||
function change_password_mumble {
|
||||
echo -n ''
|
||||
${PROJECT_NAME}-pass -u $1 -a mumble -p "$2"
|
||||
}
|
||||
|
||||
function reconfigure_mumble {
|
||||
|
@ -170,17 +170,6 @@ function remove_mumble {
|
|||
function_check remove_onion_service
|
||||
remove_onion_service mumble ${MUMBLE_PORT}
|
||||
sed -i '/mumble/d' $COMPLETION_FILE
|
||||
sed -i '/Mumble/d' /home/$MY_USERNAME/README
|
||||
}
|
||||
|
||||
function get_mumble_server_password {
|
||||
if [ -f /home/$MY_USERNAME/README ]; then
|
||||
if grep -q "Mumble server password" /home/$MY_USERNAME/README; then
|
||||
if [ ! $MUMBLE_SERVER_PASSWORD ]; then
|
||||
MUMBLE_SERVER_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "Mumble server password" | awk -F ':' '{print $2}' | sed 's/^ *//')
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function configure_firewall_for_mumble {
|
||||
|
@ -197,12 +186,10 @@ function configure_firewall_for_mumble {
|
|||
function install_mumble {
|
||||
apt-get -yq install mumble-server
|
||||
|
||||
function_check get_mumble_server_password
|
||||
get_mumble_server_password
|
||||
if [ ! $MUMBLE_SERVER_PASSWORD ]; then
|
||||
if [ -f $IMAGE_PASSWORD_FILE ]; then
|
||||
MUMBLE_SERVER_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
|
||||
else
|
||||
if [ -f $IMAGE_PASSWORD_FILE ]; then
|
||||
MUMBLE_SERVER_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
|
||||
else
|
||||
if [ ! $MUMBLE_SERVER_PASSWORD ]; then
|
||||
MUMBLE_SERVER_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
|
||||
if [ ${#MUMBLE_SERVER_PASSWORD} -lt $MINIMUM_PASSWORD_LENGTH ]; then
|
||||
MUMBLE_SERVER_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
|
||||
|
@ -271,16 +258,7 @@ function install_mumble {
|
|||
update_default_domain
|
||||
systemctl restart mumble-server
|
||||
|
||||
if ! grep -q $"Mumble Server" /home/$MY_USERNAME/README; then
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo $'# Mumble Server' >> /home/$MY_USERNAME/README
|
||||
echo $"Mumble onion domain:$MUMBLE_ONION_HOSTNAME" >> /home/$MY_USERNAME/README
|
||||
echo $'Mumble server username: mumble-server' >> /home/$MY_USERNAME/README
|
||||
echo $"Mumble server password: $MUMBLE_SERVER_PASSWORD" >> /home/$MY_USERNAME/README
|
||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
|
||||
chmod 600 /home/$MY_USERNAME/README
|
||||
fi
|
||||
${PROJECT_NAME}-pass -u $MY_USERNAME -a mumble -p "$MUMBLE_SERVER_PASSWORD"
|
||||
|
||||
function_check configure_firewall_for_mumble
|
||||
configure_firewall_for_mumble
|
||||
|
|
|
@ -53,6 +53,8 @@ postactiv_variables=(POSTACTIV_COMMIT
|
|||
function remove_user_postactiv {
|
||||
remove_username="$1"
|
||||
|
||||
${PROJECT_NAME}-pass -u $remove_username --rmapp postactiv
|
||||
|
||||
function_check get_completion_param
|
||||
POSTACTIV_DOMAIN_NAME=$(get_completion_param "postactiv domain")
|
||||
if [ -d /var/www/$POSTACTIV_DOMAIN_NAME ]; then
|
||||
|
@ -65,6 +67,8 @@ function add_user_postactiv {
|
|||
new_username="$1"
|
||||
new_user_password="$2"
|
||||
|
||||
${PROJECT_NAME}-pass -u $new_username -a postactiv -p "$new_user_password"
|
||||
|
||||
POSTACTIV_DOMAIN_NAME=$(get_completion_param "postactiv domain")
|
||||
if [ -d /var/www/${POSTACTIV_DOMAIN_NAME}/htdocs ]; then
|
||||
cd /var/www/$POSTACTIV_DOMAIN_NAME/htdocs
|
||||
|
@ -145,20 +149,7 @@ function change_password_postactiv {
|
|||
echo -n ''
|
||||
}
|
||||
|
||||
function get_mariadb_postactiv_admin_password {
|
||||
if [ -f /home/$MY_USERNAME/README ]; then
|
||||
if grep -q "MariaDB postactiv admin password" /home/$MY_USERNAME/README; then
|
||||
POSTACTIV_ADMIN_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "MariaDB postactiv admin password" | awk -F ':' '{print $2}' | sed 's/^ *//')
|
||||
fi
|
||||
if grep -q "postactiv administrator password" /home/$MY_USERNAME/README; then
|
||||
POSTACTIV_ADMIN_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "postactiv administrator password" | awk -F ':' '{print $2}' | sed 's/^ *//')
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function postactiv_create_database {
|
||||
function_check get_mariadb_postactiv_admin_password
|
||||
get_mariadb_postactiv_admin_password
|
||||
if [ -f $IMAGE_PASSWORD_FILE ]; then
|
||||
POSTACTIV_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
|
||||
else
|
||||
|
@ -333,7 +324,6 @@ function remove_postactiv {
|
|||
if [ -f /etc/cron.hourly/postactiv-daemons ]; then
|
||||
rm /etc/cron.hourly/postactiv-daemons
|
||||
fi
|
||||
sed -i '/Postactiv/d' /home/$MY_USERNAME/README
|
||||
remove_backup_database_local postactiv
|
||||
|
||||
function_check remove_ddns_domain
|
||||
|
@ -588,31 +578,7 @@ function install_postactiv_main {
|
|||
|
||||
${PROJECT_NAME}-addemail -u $MY_USERNAME -e "noreply@$POSTACTIV_DOMAIN_NAME" -g postactiv --public no
|
||||
|
||||
# some post-install instructions for the user
|
||||
if ! grep -q $"Postactiv administrator" /home/$MY_USERNAME/README; then
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo $'# Postactiv' >> /home/$MY_USERNAME/README
|
||||
echo $"Postactiv administrator nickname: $MY_USERNAME" >> /home/$MY_USERNAME/README
|
||||
echo $"Postactiv administrator password: $POSTACTIV_ADMIN_PASSWORD" >> /home/$MY_USERNAME/README
|
||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
|
||||
chmod 600 /home/$MY_USERNAME/README
|
||||
else
|
||||
if [ -f /home/$MY_USERNAME/README ]; then
|
||||
sed -i "s|Postactiv administrator password.*|Postactiv administrator password: $POSTACTIV_ADMIN_PASSWORD|g" /home/$MY_USERNAME/README
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! grep -q "Postactiv onion domain" /home/$MY_USERNAME/README; then
|
||||
echo $"Postactiv onion domain: ${POSTACTIV_ONION_HOSTNAME}" >> /home/$MY_USERNAME/README
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
|
||||
chmod 600 /home/$MY_USERNAME/README
|
||||
else
|
||||
if [ -f /home/$MY_USERNAME/README ]; then
|
||||
sed -i "s|Postactiv onion domain.*|Postactiv onion domain: ${POSTACTIV_ONION_HOSTNAME}|g" /home/$MY_USERNAME/README
|
||||
fi
|
||||
fi
|
||||
${PROJECT_NAME}-pass -u $MY_USERNAME -a postactiv -p "$POSTACTIV_ADMIN_PASSWORD"
|
||||
|
||||
set_completion_param "postactiv domain" "$POSTACTIV_DOMAIN_NAME"
|
||||
|
||||
|
|
|
@ -52,6 +52,9 @@ radicale_variables=(ONION_ONLY
|
|||
|
||||
function remove_user_radicale {
|
||||
remove_username="$1"
|
||||
|
||||
${PROJECT_NAME}-pass -u $remove_username --rmapp radicale
|
||||
|
||||
if grep "${remove_username}:" ${RADICALE_USERS}; then
|
||||
sed -i "/${remove_username}:/d" ${RADICALE_USERS}
|
||||
if [ -d /var/www/radicale/collections/${remove_username} ]; then
|
||||
|
@ -68,6 +71,8 @@ function add_user_radicale {
|
|||
new_username="$1"
|
||||
new_user_password="$2"
|
||||
|
||||
${PROJECT_NAME}-pass -u $new_username -a radicale -p "$new_user_password"
|
||||
|
||||
if [ ! -f ${RADICALE_USERS} ]; then
|
||||
touch ${RADICALE_USERS}
|
||||
fi
|
||||
|
@ -94,6 +99,8 @@ function change_password_radicale {
|
|||
existing_username="$1"
|
||||
new_user_password="$2"
|
||||
|
||||
${PROJECT_NAME}-pass -u $existing_username -a radicale -p "$new_user_password"
|
||||
|
||||
if grep "${existing_username}:" ${RADICALE_USERS}; then
|
||||
sed -i "/${existing_username}:/d" ${RADICALE_USERS}
|
||||
htpasswd -bd ${RADICALE_USERS} "$existing_username" "$new_user_password"
|
||||
|
@ -118,7 +125,8 @@ function reconfigure_radicale {
|
|||
RADICALE_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
|
||||
fi
|
||||
add_user_radicale "$MY_USERNAME" "$RADICALE_PASSWORD"
|
||||
sed -i "s|Your Radicale password is.*|Your Radicale password is: ${RADICALE_PASSWORD}|g" /home/$MY_USERNAME/README
|
||||
|
||||
${PROJECT_NAME}-pass -u $MY_USERNAME -a radicale -p "$RADICALE_PASSWORD"
|
||||
|
||||
touch /var/log/radicale/radicale.log
|
||||
chown -R www-data:www-data /var/log/radicale
|
||||
|
@ -294,7 +302,6 @@ function remove_radicale {
|
|||
|
||||
remove_completion_param install_radicale
|
||||
sed -i '/radicale/d' $COMPLETION_FILE
|
||||
sed -i '/Radicale/d' /home/$MY_USERNAME/README
|
||||
sed -i '/location \/radicale/,/}/d' /etc/nginx/sites-available/${DEFAULT_DOMAIN_NAME}
|
||||
systemctl restart nginx
|
||||
}
|
||||
|
@ -487,15 +494,7 @@ function install_radicale {
|
|||
|
||||
systemctl restart nginx
|
||||
|
||||
if ! grep -q "# Radicale" /home/$MY_USERNAME/README; then
|
||||
echo $'# Radicale' >> /home/$MY_USERNAME/README
|
||||
echo $"Your Radicale password is: ${RADICALE_PASSWORD}" >> /home/$MY_USERNAME/README
|
||||
echo $"Radicale is accessible via https://${DEFAULT_DOMAIN_NAME}/radicale/" >> /home/$MY_USERNAME/README
|
||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
|
||||
chmod 600 /home/$MY_USERNAME/README
|
||||
else
|
||||
sed -i "s|Your Radicale password is.*|Your Radicale password is: ${RADICALE_PASSWORD}|g" /home/$MY_USERNAME/README
|
||||
fi
|
||||
${PROJECT_NAME}-pass -u $MY_USERNAME -a radicale -p "$RADICALE_PASSWORD"
|
||||
|
||||
# keep track of the version so we can check for upgrades
|
||||
if ! grep -q "radicale version:" ${COMPLETION_FILE}; then
|
||||
|
|
|
@ -60,20 +60,10 @@ function install_interactive_rss {
|
|||
}
|
||||
|
||||
function change_password_rss {
|
||||
echo -n ''
|
||||
}
|
||||
|
||||
function get_mariadb_rss_admin_password {
|
||||
if [ -f /home/$MY_USERNAME/README ]; then
|
||||
if grep -q "RSS reader admin password" /home/$MY_USERNAME/README; then
|
||||
RSS_READER_ADMIN_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "RSS reader admin password" | awk -F ':' '{print $2}' | sed 's/^ *//')
|
||||
fi
|
||||
fi
|
||||
${PROJECT_NAME}-pass -u $1 -a rss -p "$2"
|
||||
}
|
||||
|
||||
function rss_create_database {
|
||||
function_check get_mariadb_rss_admin_password
|
||||
get_mariadb_rss_admin_password
|
||||
if [ -f $IMAGE_PASSWORD_FILE ]; then
|
||||
RSS_READER_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
|
||||
else
|
||||
|
@ -267,7 +257,6 @@ function remove_rss {
|
|||
remove_completion_param install_rss
|
||||
sed -i '/RSS /d' $COMPLETION_FILE
|
||||
sed -i '/rss /d' $COMPLETION_FILE
|
||||
sed -i '/RSS reader/d' /home/$MY_USERNAME/README
|
||||
remove_backup_database_local ttrss
|
||||
}
|
||||
|
||||
|
@ -496,19 +485,7 @@ function install_rss_main {
|
|||
systemctl daemon-reload
|
||||
systemctl start ttrss
|
||||
|
||||
# some post-install instructions for the user
|
||||
if ! grep -q $"RSS Reader" /home/$MY_USERNAME/README; then
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo $'# RSS Reader' >> /home/$MY_USERNAME/README
|
||||
echo $"RSS reader domain: ${RSS_READER_DOMAIN_NAME}" >> /home/$MY_USERNAME/README
|
||||
echo $"RSS reader onion domain: ${RSS_READER_ONION_HOSTNAME}" >> /home/$MY_USERNAME/README
|
||||
echo $"RSS reader admin username: admin" >> /home/$MY_USERNAME/README
|
||||
echo $"RSS reader admin password: ${RSS_READER_ADMIN_PASSWORD}" >> /home/$MY_USERNAME/README
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
|
||||
chmod 600 /home/$MY_USERNAME/README
|
||||
fi
|
||||
${PROJECT_NAME}-pass -u $MY_USERNAME -a rss -p "$RSS_READER_ADMIN_PASSWORD"
|
||||
|
||||
install_completed rss_main
|
||||
}
|
||||
|
|
|
@ -54,6 +54,8 @@ function remove_user_sip {
|
|||
remove_username="$1"
|
||||
${PROJECT_NAME}-rmsipuser ${remove_username}
|
||||
|
||||
${PROJECT_NAME}-pass -u $remove_username --rmapp sip
|
||||
|
||||
# remove user from SIP TURN/STUN
|
||||
if [ -f /etc/turnserver/turnusers.txt ]; then
|
||||
sed -i "/${remove_username}:/d" /etc/turnserver/turnusers.txt
|
||||
|
@ -64,6 +66,8 @@ function add_user_sip {
|
|||
new_username="$1"
|
||||
new_user_password="$2"
|
||||
|
||||
${PROJECT_NAME}-pass -u $new_username -a sip -p "$new_user_password"
|
||||
|
||||
SIP_EXTENSION=$(${PROJECT_NAME}-sipfreeext)
|
||||
${PROJECT_NAME}-addsipuser -u $new_username -e $SIP_EXTENSION -p "$new_user_password"
|
||||
if [ ! "$?" = "0" ]; then
|
||||
|
@ -93,7 +97,7 @@ function install_interactive_sip {
|
|||
}
|
||||
|
||||
function change_password_sip {
|
||||
echo -n ''
|
||||
${PROJECT_NAME}-pass -u $1 -a sip -p "$2"
|
||||
}
|
||||
|
||||
function reconfigure_sip {
|
||||
|
@ -177,7 +181,6 @@ function remove_sip {
|
|||
remove_completion_param install_sip
|
||||
remove_completion_param configure_firewall_for_turn
|
||||
remove_completion_param configure_firewall_for_sip4
|
||||
sed -i '/SIP /d' /home/$MY_USERNAME/README
|
||||
}
|
||||
|
||||
function configure_firewall_for_turn {
|
||||
|
@ -197,16 +200,6 @@ function configure_firewall_for_sip4 {
|
|||
firewall_add "SIP TLS" ${SIP_TLS_PORT}
|
||||
}
|
||||
|
||||
function get_sip_server_password {
|
||||
if [ -f /home/$MY_USERNAME/README ]; then
|
||||
if grep -q "sip server password" /home/$MY_USERNAME/README; then
|
||||
if [ ! $SIP_SERVER_PASSWORD ]; then
|
||||
SIP_SERVER_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "sip server password" | awk -F ':' '{print $2}' | sed 's/^ *//')
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function update_sipwitch_daemon {
|
||||
if [ ! -f /etc/init.d/sipwitch ]; then
|
||||
return
|
||||
|
@ -251,12 +244,10 @@ function install_sip_main {
|
|||
|
||||
apt-get -yq install sipwitch
|
||||
|
||||
function_check get_sip_server_password
|
||||
get_sip_server_password
|
||||
if [ ! $SIP_SERVER_PASSWORD ]; then
|
||||
if [ -f $IMAGE_PASSWORD_FILE ]; then
|
||||
SIP_SERVER_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
|
||||
else
|
||||
if [ -f $IMAGE_PASSWORD_FILE ]; then
|
||||
SIP_SERVER_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
|
||||
else
|
||||
if [ ! $SIP_SERVER_PASSWORD ]; then
|
||||
SIP_SERVER_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
|
||||
fi
|
||||
fi
|
||||
|
@ -310,17 +301,7 @@ function install_sip_main {
|
|||
|
||||
SIP_ONION_HOSTNAME=$(add_onion_service sip ${SIP_PORT} ${SIP_PORT})
|
||||
|
||||
if ! grep -q $"SIP Server" /home/$MY_USERNAME/README; then
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo $'# SIP Server' >> /home/$MY_USERNAME/README
|
||||
echo $"SIP onion_domain: $SIP_ONION_HOSTNAME" >> /home/$MY_USERNAME/README
|
||||
echo $"SIP server username: $MY_USERNAME" >> /home/$MY_USERNAME/README
|
||||
echo $"SIP server extension: 201" >> /home/$MY_USERNAME/README
|
||||
echo $"SIP server password: $SIP_SERVER_PASSWORD" >> /home/$MY_USERNAME/README
|
||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
|
||||
chmod 600 /home/$MY_USERNAME/README
|
||||
fi
|
||||
${PROJECT_NAME}-pass -u $MY_USERNAME -a sip -p "$SIP_SERVER_PASSWORD"
|
||||
|
||||
function_check configure_firewall_for_sip4
|
||||
configure_firewall_for_sip4
|
||||
|
|
|
@ -189,6 +189,9 @@ function can_install_synapse {
|
|||
|
||||
function remove_user_synapse {
|
||||
remove_username="$1"
|
||||
|
||||
${PROJECT_NAME}-pass -u $remove_username --rmapp synapse
|
||||
|
||||
# TODO
|
||||
}
|
||||
|
||||
|
@ -196,6 +199,8 @@ function add_user_synapse {
|
|||
new_username="$1"
|
||||
new_user_password="$2"
|
||||
|
||||
${PROJECT_NAME}-pass -u $new_username -a synapse -p "$new_user_password"
|
||||
|
||||
cd $SYNAPSE_DIR
|
||||
register_new_matrix_user -c homeserver.yaml https://localhost:${SYNAPSE_PORT} -u "${new_username}" -p "${new_user_password}" -a
|
||||
echo '0'
|
||||
|
@ -207,7 +212,7 @@ function install_interactive_synapse {
|
|||
}
|
||||
|
||||
function change_password_synapse {
|
||||
echo -n ''
|
||||
${PROJECT_NAME}-pass -u $1 -a synapse -p "$2"
|
||||
}
|
||||
|
||||
function reconfigure_synapse {
|
||||
|
@ -324,7 +329,6 @@ function remove_synapse {
|
|||
|
||||
remove_completion_param install_synapse
|
||||
sed -i '/synapse/d' $COMPLETION_FILE
|
||||
sed -i '/Synapse/d' /home/$MY_USERNAME/README
|
||||
}
|
||||
|
||||
function install_synapse {
|
||||
|
@ -383,17 +387,6 @@ function install_synapse {
|
|||
firewall_add synapse ${SYNAPSE_PORT}
|
||||
|
||||
SYNAPSE_ONION_HOSTNAME=$(add_onion_service synapse ${SYNAPSE_PORT} ${SYNAPSE_PORT})
|
||||
if ! grep -q "Synapse onion domain" /home/$MY_USERNAME/README; then
|
||||
echo $"Synapse onion domain: ${SYNAPSE_ONION_HOSTNAME}" >> /home/$MY_USERNAME/README
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
|
||||
chmod 600 /home/$MY_USERNAME/README
|
||||
else
|
||||
if [ -f /home/$MY_USERNAME/README ]; then
|
||||
sed -i "s|Synapse onion domain.*|Synapse onion domain: ${SYNAPSE_ONION_HOSTNAME}|g" /home/$MY_USERNAME/README
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! ${SYNAPSE_PASSWORD} ]; then
|
||||
if [ -f ${IMAGE_PASSWORD_FILE} ]; then
|
||||
SYNAPSE_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
|
||||
|
@ -404,19 +397,6 @@ function install_synapse {
|
|||
|
||||
add_user_synapse "${MY_USERNAME}" "${SYNAPSE_PASSWORD}"
|
||||
|
||||
if ! grep -q $"Synapse administrator" /home/${MY_USERNAME}/README; then
|
||||
echo '' >> /home/${MY_USERNAME}/README
|
||||
echo $'# Synapse' >> /home/${MY_USERNAME}/README
|
||||
echo $"Synapse administrator nickname: $MY_USERNAME" >> /home/${MY_USERNAME}/README
|
||||
echo $"Synapse administrator password: $SYNAPSE_PASSWORD" >> /home/${MY_USERNAME}/README
|
||||
chown ${MY_USERNAME}:${MY_USERNAME} /home/${MY_USERNAME}/README
|
||||
chmod 600 /home/${MY_USERNAME}/README
|
||||
else
|
||||
if [ -f /home/${MY_USERNAME}/README ]; then
|
||||
sed -i "s|Synapse administrator password.*|Synapse administrator password: $SYNAPSE_PASSWORD|g" /home/${MY_USERNAME}/README
|
||||
fi
|
||||
fi
|
||||
|
||||
#install_matrix_irc_bridge
|
||||
|
||||
APP_INSTALLED=1
|
||||
|
|
|
@ -254,8 +254,6 @@ function remove_tox_node {
|
|||
fi
|
||||
remove_completion_param install_tox_node
|
||||
remove_completion_param configure_firewall_for_tox
|
||||
sed -i '/Tox' /home/$MY_USERNAME/README
|
||||
sed -i '/tox ' /home/$MY_USERNAME/README
|
||||
}
|
||||
|
||||
function remove_tox_avahi {
|
||||
|
@ -374,16 +372,6 @@ function install_tox_node {
|
|||
function_check configure_firewall_for_tox
|
||||
configure_firewall_for_tox
|
||||
|
||||
if ! grep -q $"Your Tox node public key is" /home/$MY_USERNAME/README; then
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo '# Tox' >> /home/$MY_USERNAME/README
|
||||
echo $"tox onion domain: ${TOX_ONION_HOSTNAME}" >> /home/$MY_USERNAME/README
|
||||
echo $"Your Tox node public key is: $TOX_PUBLIC_KEY" >> /home/$MY_USERNAME/README
|
||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
|
||||
chmod 600 /home/$MY_USERNAME/README
|
||||
fi
|
||||
|
||||
function_check configure_firewall_for_tox
|
||||
configure_firewall_for_tox
|
||||
install_completed tox_node
|
||||
|
|
|
@ -51,6 +51,7 @@ xmpp_variables=(ONION_ONLY
|
|||
|
||||
function remove_user_xmpp {
|
||||
remove_username="$1"
|
||||
${PROJECT_NAME}-pass -u $remove_username --rmapp xmpp
|
||||
${PROJECT_NAME}-rmxmpp -e "${remove_username}@$HOSTNAME"
|
||||
}
|
||||
|
||||
|
@ -58,6 +59,8 @@ function add_user_xmpp {
|
|||
new_username="$1"
|
||||
new_user_password="$2"
|
||||
|
||||
${PROJECT_NAME}-pass -u $new_username -a xmpp -p "$new_user_password"
|
||||
|
||||
${PROJECT_NAME}-addxmpp -e "$new_username@$HOSTNAME" -p "$new_user_password"
|
||||
if [ ! "$?" = "0" ]; then
|
||||
echo '1'
|
||||
|
@ -286,7 +289,6 @@ function remove_xmpp {
|
|||
|
||||
remove_completion_param install_xmpp
|
||||
sed -i '/xmpp/d' $COMPLETION_FILE
|
||||
sed -i '/XMPP/d' /home/$MY_USERNAME/README
|
||||
}
|
||||
|
||||
function xmpp_email_headers {
|
||||
|
@ -461,7 +463,6 @@ function install_xmpp_main {
|
|||
sed -i "s/example.com/$DEFAULT_DOMAIN_NAME/g" /etc/prosody/prosody.cfg.lua
|
||||
|
||||
update_default_domain
|
||||
touch /home/$MY_USERNAME/README
|
||||
|
||||
if [ ! -d /var/lib/tor ]; then
|
||||
echo $'No Tor installation found. xmpp onion site cannot be configured.'
|
||||
|
@ -489,23 +490,16 @@ function install_xmpp_main {
|
|||
fi
|
||||
set_completion_param "xmpp onion domain" "${XMPP_ONION_HOSTNAME}"
|
||||
|
||||
if ! grep -q "Your XMPP password is" /home/$MY_USERNAME/README; then
|
||||
if [ -f $IMAGE_PASSWORD_FILE ]; then
|
||||
XMPP_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
|
||||
else
|
||||
if [ ${#XMPP_PASSWORD} -lt 8 ]; then
|
||||
if [ -f $IMAGE_PASSWORD_FILE ]; then
|
||||
XMPP_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
|
||||
else
|
||||
XMPP_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
|
||||
fi
|
||||
XMPP_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
|
||||
fi
|
||||
prosodyctl register $MY_USERNAME $DEFAULT_DOMAIN_NAME $XMPP_PASSWORD
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo $'# XMPP' >> /home/$MY_USERNAME/README
|
||||
echo $"XMPP onion domain: ${XMPP_ONION_HOSTNAME}" >> /home/$MY_USERNAME/README
|
||||
echo $"Your XMPP password is: $XMPP_PASSWORD" >> /home/$MY_USERNAME/README
|
||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
|
||||
chmod 600 /home/$MY_USERNAME/README
|
||||
fi
|
||||
prosodyctl register $MY_USERNAME $DEFAULT_DOMAIN_NAME $XMPP_PASSWORD
|
||||
|
||||
${PROJECT_NAME}-pass -u $MY_USERNAME -a xmpp -p "$XMPP_PASSWORD"
|
||||
|
||||
function_check configure_firewall_for_xmpp
|
||||
configure_firewall_for_xmpp
|
||||
|
|
|
@ -135,7 +135,6 @@ function remove_zeronet {
|
|||
remove_completion_param install_zeronet
|
||||
remove_completion_param configure_firewall_for_zeronet
|
||||
sed -i '/zeronet/d' $COMPLETION_FILE
|
||||
sed -i '/ZeroNet/d' /home/$MY_USERNAME/README
|
||||
}
|
||||
|
||||
function configure_firewall_for_zeronet {
|
||||
|
@ -153,14 +152,6 @@ function install_zeronet_blog {
|
|||
return
|
||||
fi
|
||||
|
||||
if [ ! -f /home/$MY_USERNAME/README ]; then
|
||||
touch /home/$MY_USERNAME/README
|
||||
fi
|
||||
|
||||
if grep -q "ZeroNet Blog address" /home/$MY_USERNAME/README; then
|
||||
return
|
||||
fi
|
||||
|
||||
if [ ! -d /etc/avahi ]; then
|
||||
echo $'Avahi is not installed'
|
||||
exit 736
|
||||
|
@ -236,12 +227,6 @@ function install_zeronet_blog {
|
|||
fi
|
||||
echo "${ZERONET_URL}/${ZERONET_BLOG_ADDRESS}" > /home/$MY_USERNAME/.config/zeronet/myblog
|
||||
|
||||
if ! grep -q "ZeroNet Blog address" /home/$MY_USERNAME/README; then
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo "ZeroNet Blog address: $ZERONET_BLOG_ADDRESS" >> /home/$MY_USERNAME/README
|
||||
echo "ZeroNet Blog private key: $ZERONET_BLOG_PRIVATE_KEY" >> /home/$MY_USERNAME/README
|
||||
fi
|
||||
|
||||
install_completed zeronet_blog
|
||||
}
|
||||
|
||||
|
@ -250,14 +235,6 @@ function install_zeronet_mail {
|
|||
return
|
||||
fi
|
||||
|
||||
if [ ! -f /home/$MY_USERNAME/README ]; then
|
||||
touch /home/$MY_USERNAME/README
|
||||
fi
|
||||
|
||||
if grep -q "ZeroNet Mail address" /home/$MY_USERNAME/README; then
|
||||
return
|
||||
fi
|
||||
|
||||
if [ ! -d /etc/avahi ]; then
|
||||
echo 'Avahi is not installed'
|
||||
exit 736
|
||||
|
@ -333,12 +310,6 @@ function install_zeronet_mail {
|
|||
fi
|
||||
echo "${ZERONET_URL}/${ZERONET_MAIL_ADDRESS}" > /home/$MY_USERNAME/.config/zeronet/mymail
|
||||
|
||||
if ! grep -q $"ZeroNet Mail address" /home/$MY_USERNAME/README; then
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo $"ZeroNet Mail address: $ZERONET_MAIL_ADDRESS" >> /home/$MY_USERNAME/README
|
||||
echo $"ZeroNet Mail private key: $ZERONET_MAIL_PRIVATE_KEY" >> /home/$MY_USERNAME/README
|
||||
fi
|
||||
|
||||
install_completed zeronet_mail
|
||||
}
|
||||
|
||||
|
@ -347,14 +318,6 @@ function install_zeronet_forum {
|
|||
return
|
||||
fi
|
||||
|
||||
if [ ! -f /home/$MY_USERNAME/README ]; then
|
||||
touch /home/$MY_USERNAME/README
|
||||
fi
|
||||
|
||||
if grep -q "ZeroNet Forum address" /home/$MY_USERNAME/README; then
|
||||
return
|
||||
fi
|
||||
|
||||
if [ ! -d /etc/avahi ]; then
|
||||
echo $'Avahi is not installed'
|
||||
exit 736
|
||||
|
@ -424,12 +387,6 @@ function install_zeronet_forum {
|
|||
fi
|
||||
echo "${ZERONET_URL}/${ZERONET_FORUM_ADDRESS}" > /home/$MY_USERNAME/.config/zeronet/myforum
|
||||
|
||||
if ! grep -q $"ZeroNet Forum address" /home/$MY_USERNAME/README; then
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo $"ZeroNet Forum address: $ZERONET_FORUM_ADDRESS" >> /home/$MY_USERNAME/README
|
||||
echo $"ZeroNet Forum private key: $ZERONET_FORUM_PRIVATE_KEY" >> /home/$MY_USERNAME/README
|
||||
fi
|
||||
|
||||
install_completed zeronet_forum
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,9 @@ export TEXTDOMAINDIR="/usr/share/locale"
|
|||
|
||||
MY_BACKUP_KEY_ID=
|
||||
CURR_USERNAME=
|
||||
REMOVE_USERNAME=
|
||||
CURR_APP=
|
||||
REMOVE_APP=
|
||||
CURR_PASSWORD=""
|
||||
|
||||
function get_backup_key_id {
|
||||
|
@ -76,6 +78,14 @@ function pass_show_help {
|
|||
echo $''
|
||||
echo $" ${PROJECT_NAME}-pass -u [username] -a [app]"
|
||||
echo ''
|
||||
echo $'To remove passwords for a user:'
|
||||
echo $''
|
||||
echo $" ${PROJECT_NAME}-pass -r [username]"
|
||||
echo ''
|
||||
echo $'To remove an application password for a user:'
|
||||
echo $''
|
||||
echo $" ${PROJECT_NAME}-pass --u [username] --rmapp [name]"
|
||||
echo ''
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
@ -95,6 +105,14 @@ do
|
|||
shift
|
||||
CURR_USERNAME="${1}"
|
||||
;;
|
||||
-r|--rm|--remove)
|
||||
shift
|
||||
REMOVE_USERNAME="${1}"
|
||||
;;
|
||||
--rmapp|--removeapp)
|
||||
shift
|
||||
REMOVE_APP="${1}"
|
||||
;;
|
||||
-a|--app|--application)
|
||||
shift
|
||||
CURR_APP="${1}"
|
||||
|
@ -110,6 +128,13 @@ do
|
|||
shift
|
||||
done
|
||||
|
||||
if [ ${REMOVE_USERNAME} ]; then
|
||||
if [ -d ~/.passwords/${REMOVE_USERNAME} ]; then
|
||||
rm -rf ~/.passwords/${REMOVE_USERNAME}
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
get_backup_key_id
|
||||
|
||||
# Use the backups private key as a symmetric passphrase
|
||||
|
@ -125,6 +150,13 @@ if [ ! -d /home/$CURR_USERNAME ]; then
|
|||
exit 2
|
||||
fi
|
||||
|
||||
if [ ${REMOVE_APP} ]; then
|
||||
if [ -d ~/.passwords/${CURR_USERNAME}/${REMOVE_APP} ]; then
|
||||
shred -zu ~/.passwords/${CURR_USERNAME}/${REMOVE_APP}
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ ! $CURR_APP ]; then
|
||||
echo $'No app name given'
|
||||
exit 3
|
||||
|
|
|
@ -114,16 +114,8 @@ function backup_database_local {
|
|||
}
|
||||
|
||||
function get_mariadb_password {
|
||||
if [ -f /home/$MY_USERNAME/README ]; then
|
||||
if grep -q "MariaDB password" /home/$MY_USERNAME/README; then
|
||||
if [ -f $DATABASE_PASSWORD_FILE ]; then
|
||||
MARIADB_PASSWORD=$(cat $DATABASE_PASSWORD_FILE)
|
||||
else
|
||||
MARIADB_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "MariaDB password" | awk -F ':' '{print $2}' | sed 's/^ *//')
|
||||
echo "$MARIADB_PASSWORD" > $DATABASE_PASSWORD_FILE
|
||||
chmod 600 $DATABASE_PASSWORD_FILE
|
||||
fi
|
||||
fi
|
||||
if [ -f $DATABASE_PASSWORD_FILE ]; then
|
||||
MARIADB_PASSWORD=$(cat $DATABASE_PASSWORD_FILE)
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -145,14 +137,6 @@ function install_mariadb {
|
|||
fi
|
||||
echo "$MARIADB_PASSWORD" > $DATABASE_PASSWORD_FILE
|
||||
chmod 600 $DATABASE_PASSWORD_FILE
|
||||
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
echo '# MariaDB / MySql' >> /home/$MY_USERNAME/README
|
||||
echo $"Your MariaDB password is: $MARIADB_PASSWORD" >> /home/$MY_USERNAME/README
|
||||
echo '' >> /home/$MY_USERNAME/README
|
||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
|
||||
chmod 600 /home/$MY_USERNAME/README
|
||||
fi
|
||||
|
||||
debconf-set-selections <<< "mariadb-server mariadb-server/root_password password $MARIADB_PASSWORD"
|
||||
|
|
Loading…
Reference in New Issue