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
fb1aba67
Commit
fb1aba67
authored
6 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
regex syntax
parent
c9b36449
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/freedombone-app-pleroma
+2
-2
2 additions, 2 deletions
src/freedombone-app-pleroma
src/freedombone-ignore
+4
-4
4 additions, 4 deletions
src/freedombone-ignore
src/freedombone-unignore
+12
-12
12 additions, 12 deletions
src/freedombone-unignore
with
18 additions
and
18 deletions
src/freedombone-app-pleroma
+
2
−
2
View file @
fb1aba67
...
...
@@ -413,9 +413,9 @@ function create_pleroma_blocklist {
echo
' # Create a filter string for the pleroma configuration'
;
echo
" blocked_regex=
\"
~r/
\$
{blocked}/iu
\"
"
;
echo
" if [
\"\$
muted_words_str
\"
]; then"
;
echo
" muted_words_str=
\"\$
{muted_words_str},
\\\"
\$
{blocked_regex}
\\\"
\"
"
;
echo
" muted_words_str=
\"\$
{muted_words_str},
[
\$
{blocked_regex}
]
\"
"
;
echo
' else'
;
echo
" muted_words_str=
\"
\\\"
\$
{blocked_regex}
\\\"
\"
"
;
echo
" muted_words_str=
\"
[
\$
{blocked_regex}
]
\"
"
;
echo
' fi'
;
echo
' fi'
;
echo
' fi'
;
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-ignore
+
4
−
4
View file @
fb1aba67
...
...
@@ -116,9 +116,9 @@ if [ "$ALL_TEXT" ]; then
recompile
=
if
[[
"
$lines
"
==
*
' reject: []'
*
]]
;
then
# first muted words
sed
-i
"/mrf_keyword/{N;s|reject:.*|reject: [
\"
$blocked_regex
\"
],|}"
"
$PLEROMA_CONFIG
"
sed
-i
"/mrf_keyword/{N;s|reject:.*|reject: [
[
$blocked_regex
]
],|}"
"
$PLEROMA_CONFIG
"
sed
-i
"/mrf_keyword/{N;N;s|federated_timeline_removal:.*|federated_timeline_removal: [
\"
$blocked_regex
\"
],|}"
"
$PLEROMA_CONFIG
"
sed
-i
"/mrf_keyword/{N;N;s|federated_timeline_removal:.*|federated_timeline_removal: [
[
$blocked_regex
]
],|}"
"
$PLEROMA_CONFIG
"
recompile
=
1
else
# subsequent muted words
...
...
@@ -127,8 +127,8 @@ if [ "$ALL_TEXT" ]; then
filter_words
=
$(
echo
-n
"
$curr_filter_words
"
|
sed
's| reject: [ ||g'
|
sed
's| ],||g'
)
# does it already exist?
if
[[
"
$filter_words
"
!=
*
"
\"
${
blocked_regex
}
\"
"
*
]]
;
then
sed
-i
"/mrf_keyword/{N;s|reject:.*|reject: [
${
filter_words
}
,
\"
$blocked_regex
\"
],|}"
"
$PLEROMA_CONFIG
"
sed
-i
"/mrf_keyword/{N;N;s|federated_timeline_removal:.*|federated_timeline_removal: [
${
filter_words
}
,
\"
$blocked_regex
\"
],|}"
"
$PLEROMA_CONFIG
"
sed
-i
"/mrf_keyword/{N;s|reject:.*|reject: [
${
filter_words
}
,
[
$blocked_regex
]
],|}"
"
$PLEROMA_CONFIG
"
sed
-i
"/mrf_keyword/{N;N;s|federated_timeline_removal:.*|federated_timeline_removal: [
${
filter_words
}
,
[
$blocked_regex
]
],|}"
"
$PLEROMA_CONFIG
"
recompile
=
1
fi
fi
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-unignore
+
12
−
12
View file @
fb1aba67
...
...
@@ -108,20 +108,20 @@ if [ "$ALL_TEXT" ]; then
if
[
"
$curr_filter_words
"
]
;
then
blocked_regex
=
"~r/
${
ALL_TEXT
}
/iu"
recompile
=
1
if
[[
"
$curr_filter_words
"
==
*
",
\"
${
blocked_regex
}
\"
"
*
]]
;
then
sed
-i
"/mrf_keyword/{N;s|,
\"
${
blocked_regex
}
\"
||}"
"
$PLEROMA_CONFIG
"
sed
-i
"/mrf_keyword/{N;N;s|,
\"
${
blocked_regex
}
\"
||}"
"
$PLEROMA_CONFIG
"
sed
-i
"/mrf_keyword/{N;N;N;s|,
\"
${
blocked_regex
}
\"
||}"
"
$PLEROMA_CONFIG
"
if
[[
"
$curr_filter_words
"
==
*
",
[
${
blocked_regex
}
]
"
*
]]
;
then
sed
-i
"/mrf_keyword/{N;s|,
[
${
blocked_regex
}
]
||}"
"
$PLEROMA_CONFIG
"
sed
-i
"/mrf_keyword/{N;N;s|,
[
${
blocked_regex
}
]
||}"
"
$PLEROMA_CONFIG
"
sed
-i
"/mrf_keyword/{N;N;N;s|,
[
${
blocked_regex
}
]
||}"
"
$PLEROMA_CONFIG
"
else
if
[[
"
$curr_filter_words
"
==
*
"
\"
${
blocked_regex
}
\"
,"
*
]]
;
then
sed
-i
"/mrf_keyword/{N;s|
\"
${
blocked_regex
}
\"
,||}"
"
$PLEROMA_CONFIG
"
sed
-i
"/mrf_keyword/{N;N;s|
\"
${
blocked_regex
}
\"
,||}"
"
$PLEROMA_CONFIG
"
sed
-i
"/mrf_keyword/{N;N;N;s|
\"
${
blocked_regex
}
\"
,||}"
"
$PLEROMA_CONFIG
"
if
[[
"
$curr_filter_words
"
==
*
"
[
${
blocked_regex
}
]
,"
*
]]
;
then
sed
-i
"/mrf_keyword/{N;s|
[
${
blocked_regex
}
]
,||}"
"
$PLEROMA_CONFIG
"
sed
-i
"/mrf_keyword/{N;N;s|
[
${
blocked_regex
}
]
,||}"
"
$PLEROMA_CONFIG
"
sed
-i
"/mrf_keyword/{N;N;N;s|
[
${
blocked_regex
}
]
,||}"
"
$PLEROMA_CONFIG
"
else
if
[[
"
$curr_filter_words
"
==
*
"
\"
${
blocked_regex
}
\"
"
*
]]
;
then
sed
-i
"/mrf_keyword/{N;s|
\"
${
blocked_regex
}
\"
||}"
"
$PLEROMA_CONFIG
"
sed
-i
"/mrf_keyword/{N;N;s|
\"
${
blocked_regex
}
\"
||}"
"
$PLEROMA_CONFIG
"
sed
-i
"/mrf_keyword/{N;N;N;s|
\"
${
blocked_regex
}
\"
||}"
"
$PLEROMA_CONFIG
"
if
[[
"
$curr_filter_words
"
==
*
"
[
${
blocked_regex
}
]
"
*
]]
;
then
sed
-i
"/mrf_keyword/{N;s|
[
${
blocked_regex
}
]
||}"
"
$PLEROMA_CONFIG
"
sed
-i
"/mrf_keyword/{N;N;s|
[
${
blocked_regex
}
]
||}"
"
$PLEROMA_CONFIG
"
sed
-i
"/mrf_keyword/{N;N;N;s|
[
${
blocked_regex
}
]
||}"
"
$PLEROMA_CONFIG
"
else
recompile
=
fi
...
...
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