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
c7300a44
Commit
c7300a44
authored
6 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Add whitelist capability to pleroma
parent
572bc033
No related branches found
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-pleroma
+46
-2
46 additions, 2 deletions
src/freedombone-app-pleroma
with
46 additions
and
2 deletions
src/freedombone-app-pleroma
+
46
−
2
View file @
c7300a44
...
...
@@ -749,6 +749,48 @@ function pleroma_add_emoji {
--msgbox $"Custom emoji :${shortcode}: has been added" 6 70
}
function pleroma_whitelist {
whitelist_filename=$PLEROMA_DIR/whitelist.txt
if [ ! -f $whitelist_filename ]; then
{ echo '
# Domain whitelist
';
echo '';
echo '
# If you add domains to this list then pleroma will be
';
echo '
# restricted to federating only with those domains
';
echo ''; } > $whitelist_filename
fi
editor $whitelist_filename
first_line=1
domain_list=
while read -r domain; do
if [[ "$domain" == *'
#
'* || "$domain" != *'
.
'* ]]; then
continue
fi
if [ ! $first_line ]; then
domain_list="${domain_list}, \"$domain\""
else
domain_list="\"$domain\""
fi
first_line=
done <$whitelist_filename
if [ ! "$domain_list" ]; then
sed -i "s|accept: .*|accept: [],|g" $pleroma_secret
else
sed -i "s|accept: .*|accept: [ ${domain_list} ],|g" $pleroma_secret
fi
pleroma_recompile
if [ "$domain_list" ]; then
dialog --title $"Pleroma Whitelist" \
--msgbox $"You are now only federating with the whitelisted domains" 6 70
fi
}
function configure_interactive_pleroma {
read_config_param PLEROMA_DOMAIN_NAME
read_config_param PLEROMA_EXPIRE_MONTHS
...
...
@@ -772,10 +814,11 @@ function configure_interactive_pleroma {
4 $"Add a custom emoji"
5 $"Set post expiry period (currently $PLEROMA_EXPIRE_MONTHS months)"
6 "$enablechatstr"
7 "$pleromatorstr")
7 "$pleromatorstr"
8 $'
Domain
whitelist
')
# shellcheck disable=SC2068
selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Pleroma" --menu $"Choose an operation, or ESC to exit:" 1
4
60
7
"${W[@]}" 3>&2 2>&1 1>&3)
selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Pleroma" --menu $"Choose an operation, or ESC to exit:" 1
5
60
8
"${W[@]}" 3>&2 2>&1 1>&3)
if [ ! "$selection" ]; then
break
...
...
@@ -799,6 +842,7 @@ function configure_interactive_pleroma {
pleroma_enable_tor
fi
;;
8) pleroma_whitelist;;
esac
done
}
...
...
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