Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Main
Synchronet
Commits
277da6d7
Commit
277da6d7
authored
1 year ago
by
Randy Sommerfeld
Browse files
Options
Downloads
Patches
Plain Diff
More .ini stuff
parent
5a00606b
No related branches found
No related tags found
1 merge request
!463
MRC mods by Codefenix (2024-10-20)
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
exec/load/ircd/config.js
+76
-6
76 additions, 6 deletions
exec/load/ircd/config.js
exec/load/ircd/core.js
+2
-2
2 additions, 2 deletions
exec/load/ircd/core.js
exec/load/ircd/server.js
+12
-1
12 additions, 1 deletion
exec/load/ircd/server.js
with
90 additions
and
9 deletions
exec/load/ircd/config.js
+
76
−
6
View file @
277da6d7
...
@@ -236,19 +236,21 @@ function Read_Config_File() {
...
@@ -236,19 +236,21 @@ function Read_Config_File() {
function
ini_sections
()
{
function
ini_sections
()
{
this
.
Info
=
ini_Info
;
this
.
Info
=
ini_Info
;
this
.
Port
=
ini_Port
;
this
.
Port
=
ini_Port
;
this
.
Connect
Class
=
ini_
Connect
Class
;
this
.
Class
=
ini_Class
;
this
.
Allow
=
ini_Allow
;
this
.
Allow
=
ini_Allow
;
this
.
Operator
=
ini_Operator
;
this
.
Operator
=
ini_Operator
;
this
.
Services
=
ini_Services
;
this
.
Services
=
ini_Services
;
this
.
Ban
=
ini_Ban
;
this
.
Ban
=
ini_Ban
;
this
.
Restrict
=
ini_Restrict
;
this
.
Restrict
=
ini_Restrict
;
this
.
RBL
=
ini_RBL
;
this
.
Server
=
ini_Server
;
this
.
Hub
=
ini_Hub
;
this
.
Hub
=
ini_Hub
;
}
}
function
ini_Info
(
arg
,
ini
)
{
function
ini_Info
(
arg
,
ini
)
{
ServerName
=
format
(
"
%s.synchro.net
"
,
system
.
qwk_id
.
toLowerCase
());
ServerName
=
format
(
"
%s.synchro.net
"
,
system
.
qwk_id
.
toLowerCase
());
if
(
ini
.
Hostn
ame
)
if
(
ini
.
ServerN
ame
)
ServerName
=
ini
.
Hostn
ame
;
ServerName
=
ini
.
ServerN
ame
;
ServerDesc
=
system
.
name
;
ServerDesc
=
system
.
name
;
if
(
ini
.
Description
)
if
(
ini
.
Description
)
ServerDesc
=
ini
.
Description
;
ServerDesc
=
ini
.
Description
;
...
@@ -413,7 +415,71 @@ function ini_Ban(arg, ini) {
...
@@ -413,7 +415,71 @@ function ini_Ban(arg, ini) {
function
ini_Hub
(
arg
,
ini
)
{
function
ini_Hub
(
arg
,
ini
)
{
HLines
.
push
(
new
HLine
(
HLines
.
push
(
new
HLine
(
"
*
"
,
/* servermask permitted */
"
*
"
,
/* servermask permitted */
ini
.
Server
/* servername */
ini
.
Servername
/* servername */
));
}
/* Former C:Line and N:Line */
function
ini_Server
(
arg
,
ini
)
{
var
ircclass
,
port
;
if
(
!
ini
.
Servername
||
!
ini
.
Hostname
||
!
ini
.
Port
||
!
ini
.
Password
||
!
ini
.
Class
)
{
log
(
LOG_WARNING
,
format
(
"
!WARNING Missing information from Server:%s. Section ignored.
"
,
arg
));
return
;
}
port
=
parseInt
(
ini
.
Port
);
if
(
port
!=
ini
.
Port
)
{
log
(
LOG_WARNING
,
format
(
"
!WARNING Malformed port in Server:%s. Using 6667.
"
,
arg
));
port
=
6667
;
}
ircclass
=
parseInt
(
ini
.
Class
);
if
(
ircclass
!=
ini
.
Class
)
{
log
(
LOG_WARNING
,
format
(
"
!WARNING Malformed IRC Class in Server:%s. Using default class of 0.
"
,
arg
));
ircclass
=
0
;
}
if
(
ini_false_true
(
ini
.
Hub
))
HLines
.
push
(
new
HLine
(
"
*
"
,
ini
.
Servername
));
CLines
.
push
(
new
CLine
(
ini
.
Hostname
,
ini
.
Password
,
ini
.
Servername
,
port
,
ircclass
));
NLines
.
push
(
new
NLine
(
ini
.
Hostname
,
ini
.
Password
,
ini
.
Servername
,
parse_nline_flags
(
ini
.
Flags
),
ircclass
));
}
/* Former Q:Lines */
function
ini_Restrict
(
arg
,
ini
)
{
if
(
!
ini
.
Mask
)
{
log
(
LOG_WARNING
,
format
(
"
!WARNING Missing Mask from Restrict:%s. Section ignored.
"
,
arg
));
return
;
}
QLines
.
push
(
new
QLine
(
ini
.
Mask
,
ini
.
Reason
?
ini
.
Reason
:
"
No reason provided.
"
));
));
}
}
...
@@ -483,9 +549,9 @@ function read_ini_config(conf) {
...
@@ -483,9 +549,9 @@ function read_ini_config(conf) {
continue
;
continue
;
if
(
!
ini_true_false
(
i
.
enabled
)
||
!
ini_true_false
(
i
.
Enabled
))
if
(
!
ini_true_false
(
i
.
enabled
)
||
!
ini_true_false
(
i
.
Enabled
))
continue
;
continue
;
s
=
i
.
name
.
split
(
"
:
"
);
s
=
i
ni
[
i
]
.
name
.
split
(
"
:
"
);
if
(
typeof
Sections
[
s
[
0
]]
===
'
function
'
)
if
(
typeof
Sections
[
s
[
0
]]
===
'
function
'
)
Sections
[
s
[
0
]](
s
[
1
],
i
);
Sections
[
s
[
0
]](
s
[
1
],
i
ni
[
i
]
);
}
}
}
}
...
@@ -522,6 +588,8 @@ function ini_int_min_max(str, min, max, def, desc) {
...
@@ -522,6 +588,8 @@ function ini_int_min_max(str, min, max, def, desc) {
}
}
function
ini_false_true
(
str
)
{
function
ini_false_true
(
str
)
{
if
(
typeof
str
===
"
boolean
"
)
return
str
;
if
(
typeof
str
!==
"
string
"
)
if
(
typeof
str
!==
"
string
"
)
return
false
;
return
false
;
str
=
str
.
toUpperCase
();
str
=
str
.
toUpperCase
();
...
@@ -536,6 +604,8 @@ function ini_false_true(str) {
...
@@ -536,6 +604,8 @@ function ini_false_true(str) {
}
}
function
ini_true_false
(
str
)
{
function
ini_true_false
(
str
)
{
if
(
typeof
str
===
"
boolean
"
)
return
str
;
if
(
typeof
str
!==
"
string
"
)
if
(
typeof
str
!==
"
string
"
)
return
true
;
return
true
;
str
=
str
.
toUpperCase
();
str
=
str
.
toUpperCase
();
...
...
This diff is collapsed.
Click to expand it.
exec/load/ircd/core.js
+
2
−
2
View file @
277da6d7
...
@@ -2817,7 +2817,7 @@ function accept_new_socket() {
...
@@ -2817,7 +2817,7 @@ function accept_new_socket() {
count
=
0
;
count
=
0
;
for
(
i
in
RBL
)
{
for
(
i
in
RBL
)
{
count
++
;
count
++
;
sock
.
send
(
format
(
"
:%s NOTICE * :Performing RBL check %u of %u. Please stand by.
"
,
sock
.
send
(
format
(
"
:%s NOTICE * :Performing RBL check %u of %u. Please stand by.
\r\n
"
,
ServerName
,
ServerName
,
count
,
count
,
num_rbls
num_rbls
...
@@ -2825,7 +2825,7 @@ function accept_new_socket() {
...
@@ -2825,7 +2825,7 @@ function accept_new_socket() {
dnsbl_result
=
check_dnsbl
(
sock
.
remote_ip_address
,
RBL
[
i
]);
dnsbl_result
=
check_dnsbl
(
sock
.
remote_ip_address
,
RBL
[
i
]);
if
(
dnsbl_result
)
{
if
(
dnsbl_result
)
{
sock
.
send
(
format
(
sock
.
send
(
format
(
"
:%s 463 * :Your IP address is on an RBL. Connection denied.
"
,
"
:%s 463 * :Your IP address is on an RBL. Connection denied.
\r\n
"
,
ServerName
ServerName
));
));
log
(
LOG_NOTICE
,
format
(
log
(
LOG_NOTICE
,
format
(
...
...
This diff is collapsed.
Click to expand it.
exec/load/ircd/server.js
+
12
−
1
View file @
277da6d7
...
@@ -1277,11 +1277,22 @@ function Reset_Autoconnect(cline, freq) {
...
@@ -1277,11 +1277,22 @@ function Reset_Autoconnect(cline, freq) {
if
(
typeof
cline
!==
'
object
'
)
if
(
typeof
cline
!==
'
object
'
)
throw
"
Reset_Autoconnect() called without cline object.
"
;
throw
"
Reset_Autoconnect() called without cline object.
"
;
log
(
LOG_DEBUG
,
format
(
"
Reset_Autoconnect() for %s on port %u.
"
,
cline
.
servername
,
cline
.
port
));
if
(
cline
.
next_connect
)
if
(
cline
.
next_connect
)
js
.
clearTimeout
(
cline
.
next_connect
);
js
.
clearTimeout
(
cline
.
next_connect
);
if
(
!
cline
.
port
||
Servers
[
cline
.
servername
.
toLowerCase
()])
if
(
!
cline
.
port
||
Servers
[
cline
.
servername
.
toLowerCase
()])
{
log
(
LOG_DEBUG
,
format
(
"
Reset_Autoconnect() cancelled for %s because no port or server exists.
"
,
cline
.
servername
));
return
false
;
return
false
;
}
cline
.
next_connect
=
js
.
setTimeout
(
cline
.
next_connect
=
js
.
setTimeout
(
Automatic_Server_Connect
,
Automatic_Server_Connect
,
...
...
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