mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-06-10 11:00:22 +00:00
i2p: Add HTTP(S) and IRC ports to firewall
Enable or disable the ports with the firewalld. Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
5c26c28f96
commit
f40ecaa155
@ -64,11 +64,15 @@ additional_favorites = [
|
||||
('YaCy Seeker', 'http://seeker.i2p'),
|
||||
]
|
||||
|
||||
tunnels_to_manage = [
|
||||
'I2P HTTP Proxy',
|
||||
'I2P HTTPS Proxy',
|
||||
'Irc2P'
|
||||
]
|
||||
tunnels_to_manage = {
|
||||
'I2P HTTP Proxy': 'i2p_socks_http-freedombox',
|
||||
'I2P HTTPS Proxy': 'i2p_socks_https-freedombox',
|
||||
'Irc2P': 'i2p_irc-freedombox'
|
||||
}
|
||||
|
||||
service_ports = [
|
||||
'http', 'https'
|
||||
] + list(tunnels_to_manage.values())
|
||||
|
||||
|
||||
def init():
|
||||
@ -80,9 +84,8 @@ def init():
|
||||
global service
|
||||
setup_helper = globals()['setup_helper']
|
||||
if setup_helper.get_state() != 'needs-setup':
|
||||
service = service_module.Service(managed_services[0], name, ports=[
|
||||
'http', 'https'
|
||||
], is_external=True, is_enabled=is_enabled, enable=enable,
|
||||
service = service_module.Service(managed_services[0], name, ports=service_ports,
|
||||
is_external=True, is_enabled=is_enabled, enable=enable,
|
||||
disable=disable,
|
||||
is_running=is_running)
|
||||
|
||||
@ -105,19 +108,19 @@ def setup(helper, old_version=None):
|
||||
])
|
||||
|
||||
# Tunnels to all interfaces
|
||||
for tunnel in tunnels_to_manage:
|
||||
for tunnel in tunnels_to_manage.keys():
|
||||
helper.call('post', actions.superuser_run, 'i2p', [
|
||||
'set-tunnel-property',
|
||||
'--name', tunnel,
|
||||
'--property', 'interface',
|
||||
'--value', '0.0.0.0'
|
||||
])
|
||||
helper.call('post', disable)
|
||||
helper.call('post', enable)
|
||||
global service
|
||||
if service is None:
|
||||
service = service_module.Service(managed_services[0], name, ports=[
|
||||
'http', 'https'
|
||||
], is_external=True, is_enabled=is_enabled, enable=enable,
|
||||
service = service_module.Service(managed_services[0], name, ports=service_ports,
|
||||
is_external=True, is_enabled=is_enabled, enable=enable,
|
||||
disable=disable,
|
||||
is_running=is_running)
|
||||
|
||||
|
||||
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<service>
|
||||
<short>I2P IRC</short>
|
||||
<description>An entry into an IRC proxy server on I2P</description>
|
||||
<port protocol="tcp" port="6668"/>
|
||||
<port protocol="udp" port="6668"/>
|
||||
</service>
|
||||
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<service>
|
||||
<short>I2P SOCKS5 HTTP Proxy</short>
|
||||
<description>A SOCKS5 HTTP proxy into the I2P network to browse eepsites.</description>
|
||||
<port protocol="tcp" port="4444"/>
|
||||
<port protocol="udp" port="4444"/>
|
||||
</service>
|
||||
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<service>
|
||||
<short>I2P SOCKS5 HTTPS Proxy</short>
|
||||
<description>A SOCKS5 HTTPS proxy into the I2P network to browse eepsites.</description>
|
||||
<port protocol="tcp" port="4445"/>
|
||||
<port protocol="udp" port="4445"/>
|
||||
</service>
|
||||
Loading…
x
Reference in New Issue
Block a user