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
066a5c76
Commit
066a5c76
authored
9 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Control panel option to enable IRC access via onion address
parent
9676af67
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-controlpanel
+37
-3
37 additions, 3 deletions
src/freedombone-controlpanel
with
37 additions
and
3 deletions
src/freedombone-controlpanel
+
37
−
3
View file @
066a5c76
...
...
@@ -49,6 +49,9 @@ VOIP_ONION_PORT=8095
SSH_PORT
=
2222
IRC_PORT
=
6697
IRC_ONION_PORT
=
8093
USB_DRIVE
=
sdb
# get default USB from config file
CONFIGURATION_FILE
=
/root/
${
PROJECT_NAME
}
.cfg
...
...
@@ -62,6 +65,9 @@ if [ -f $CONFIGURATION_FILE ]; then
if
grep
-q
"SSH_PORT="
$CONFIGURATION_FILE
;
then
SSH_PORT
=
$(
cat
$CONFIGURATION_FILE
|
grep
"SSH_PORT="
|
awk
-F
'='
'{print $2}'
)
fi
if
grep
-q
"IRC_PORT="
$CONFIGURATION_FILE
;
then
IRC_PORT
=
$(
cat
$CONFIGURATION_FILE
|
grep
"IRC_PORT="
|
awk
-F
'='
'{print $2}'
)
fi
fi
# Mirrors settings
...
...
@@ -571,6 +577,32 @@ function change_ssh_public_key {
esac
}
function
irc_via_onion
{
dialog
--title
$"IRC Server"
\
--backtitle
$"Freedombone Control Panel"
\
--defaultno
\
--yesno
$"
\n
Access the IRC server via an onion address?"
8 60
sel
=
$?
irc_onion
=
'no'
case
$sel
in
0
)
irc_onion
=
'yes'
;;
255
)
return
;;
esac
if
[[
$irc_onion
==
'no'
]]
;
then
sed
-i
":a;N;
\$
!ba;s/;Ports =.*/;Ports =
$IRC_PORT
,
$IRC_ONION_PORT
/1"
/etc/ngircd/ngircd.conf
sed
-i
":a;N;
\$
!ba;s/;Ports =.*/Ports =
$IRC_PORT
/2"
/etc/ngircd/ngircd.conf
systemctl restart ngircd
dialog
--title
$"IRC Server"
\
--msgbox
$"The IRC server can now be accessed via SSL at your main domain name"
8 50
else
sed
-i
":a;N;
\$
!ba;s/;Ports =.*/Ports =
$IRC_PORT
,
$IRC_ONION_PORT
/1"
/etc/ngircd/ngircd.conf
sed
-i
":a;N;
\$
!ba;s/;Ports =.*/Ports =
$IRC_PORT
/2"
/etc/ngircd/ngircd.conf
systemctl restart ngircd
dialog
--title
$"IRC Server"
\
--msgbox
$"The IRC server can now be accessed via its onion address without SSL"
8 50
fi
}
function
remove_user_from_mailing_list
{
select_user
if
[
!
$SELECTED_USERNAME
]
;
then
...
...
@@ -1612,9 +1644,10 @@ function menu_irc {
trap
"rm -f
$data
"
0 1 2 5 15
dialog
--backtitle
$"Freedombone Control Panel"
\
--title
$"IRC Menu"
\
--radiolist
$"Choose an operation:"
1
3
70
3
\
--radiolist
$"Choose an operation:"
1
4
70
4
\
1
$"Set a password for all IRC users"
off
\
2
$"Exit"
on 2>
$data
2
$"Access via the onion address"
off
\
3
$"Exit"
on 2>
$data
sel
=
$?
case
$sel
in
1
)
break
;;
...
...
@@ -1622,7 +1655,8 @@ function menu_irc {
esac
case
$(
cat
$data
)
in
1
)
irc_set_global_password
;;
2
)
break
;;
2
)
irc_via_onion
;;
3
)
break
;;
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