Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
370e5a9e
Commit
370e5a9e
authored
6 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Tidying
parent
7c5b71c5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/freedombone-app-xmpp
+57
-27
57 additions, 27 deletions
src/freedombone-app-xmpp
with
57 additions
and
27 deletions
src/freedombone-app-xmpp
+
57
−
27
View file @
370e5a9e
...
...
@@ -676,6 +676,57 @@ function upgrade_xmppsend {
}
function
prosody_remove_module_from_config
{
remove_prosody_module_name
=
"
$1
"
prosody_config_file
=
"
$2
"
if
[
!
"
${
remove_prosody_module_name
}
"
]
;
then
return
fi
if
[
!
-f
"
${
prosody_config_file
}
"
]
;
then
echo
"Config file
${
prosody_config_file
}
not found when removing module
$remove_prosody_module_name
"
return
fi
if
grep
-q
"
\"
${
remove_prosody_module_name
}
\"
"
"
${
prosody_config_file
}
"
;
then
sed
-i
"/
\"
${
remove_prosody_module_name
}
\"
/d"
"
${
prosody_config_file
}
"
xmpp_restart
=
1
fi
}
function
prosody_remove_module
{
remove_prosody_module_name
=
"
$1
"
prosody_remove_module_from_config
"
${
remove_prosody_module_name
}
"
/etc/prosody/prosody.cfg.lua
prosody_remove_module_from_config
"
${
remove_prosody_module_name
}
"
/etc/prosody/conf.avail/xmpp.cfg.lua
}
function
prosody_add_module_to_config
{
new_prosody_module_name
=
"
$1
"
prosody_config_file
=
"
$2
"
if
[
!
"
${
new_prosody_module_name
}
"
]
;
then
return
fi
if
[
!
-f
"
${
prosody_config_file
}
"
]
;
then
echo
"Config file
${
prosody_config_file
}
not found when adding module
$new_prosody_module_name
"
return
fi
if
!
grep
-q
"
\"
${
new_prosody_module_name
}
\"
"
"
$prosody_config_file
"
;
then
sed
-i
"/
\"
pep
\"
/a
\"
${
new_prosody_module_name
}
\"
;"
"
$prosody_config_file
"
sed
-i
"s|
\"
${
new_prosody_module_name
}
\"
|
\"
${
new_prosody_module_name
}
\"
|g"
"
$prosody_config_file
"
xmpp_restart
=
1
fi
}
function
prosody_add_module
{
new_prosody_module_name
=
"
$1
"
prosody_add_module_to_config
"
${
new_prosody_module_name
}
"
/etc/prosody/prosody.cfg.lua
prosody_add_module_to_config
"
${
new_prosody_module_name
}
"
/etc/prosody/conf.avail/xmpp.cfg.lua
}
function
upgrade_xmpp
{
xmpp_restart
=
...
...
@@ -698,42 +749,21 @@ function upgrade_xmpp {
xmpp_server_blacklist /etc/prosody/prosody.cfg.lua
# add word filter to muc
if
!
grep
-q
'"filter_words"'
/etc/prosody/prosody.cfg.lua
;
then
sed
-i
'/"muc_limits"/a "filter_words";'
/etc/prosody/prosody.cfg.lua
sed
-i
's|"filter_words"| "filter_words"|g'
/etc/prosody/prosody.cfg.lua
xmpp_restart
=
1
fi
prosody_add_module
"filter_words"
if
!
grep
-q
'filter_words ='
/etc/prosody/prosody.cfg.lua
;
then
echo
'filter_words = {}'
>>
/etc/prosody/prosody.cfg.lua
xmpp_restart
=
1
fi
# add battery saving
if
grep
-q
'"csi_battery_saver"'
/etc/prosody/prosody.cfg.lua
;
then
sed
-i
'/"csi"/a "csi_battery_saver"; -- Extra CSI battery saving'
/etc/prosody/prosody.cfg.lua
sed
-i
's|"csi_battery_saver"| "csi_battery_saver"|g'
/etc/prosody/prosody.cfg.lua
xmpp_restart
=
1
fi
# extra battery saving
prosody_add_module
"csi_battery_saver"
# remove muc logging
if
grep
-q
'"muc_log"'
/etc/prosody/prosody.cfg.lua
;
then
sed
-i
'/"muc_log"/d'
/etc/prosody/prosody.cfg.lua
xmpp_restart
=
1
fi
if
grep
-q
'"muc_log_http"'
/etc/prosody/prosody.cfg.lua
;
then
sed
-i
'/"muc_log_http"/d'
/etc/prosody/prosody.cfg.lua
xmpp_restart
=
1
fi
prosody_remove_module
"muc_log"
prosody_remove_module
"muc_log_http"
# remove any broadcast settings
if
grep
-q
'"broadcast"'
/etc/prosody/prosody.cfg.lua
;
then
sed
-i
'/broadcast/d'
/etc/prosody/prosody.cfg.lua
xmpp_restart
=
1
fi
if
grep
-q
'"broadcast"'
/etc/prosody/conf.avail/xmpp.cfg.lua
;
then
sed
-i
'/broadcast/d'
/etc/prosody/conf.avail/xmpp.cfg.lua
xmpp_restart
=
1
fi
prosody_remove_module
"broadcast"
if
grep
-q
"/etc/ssl/certs/xmpp.dhparam"
/etc/prosody/prosody.cfg.lua
;
then
cp
/etc/ssl/certs/xmpp.dhparam /etc/prosody/xmpp.dhparam
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment