i have installed searxng in a jail but havent got it working yet
which maybe a pf firewall issue
The jail already has Firefox installed
so i thought it would make sense to install searxng in the same jail
searxng is set to listen on the jails ip address 10.10.0.5 and port 8888
and since Firefox is running in the same jail i thought the set up would be simple
searxng is running but i cant access it using Firefox running in the Jail
or using Firefox from outside the jail
so im guessing its a pf firewall issue
if anyone has any bright ideas and could give a shove in the right direction that would be great
this is the only pf rule i have for the jail
Firefox cant access searxng running in the same Jail with this address
its almost like the pf rule is forcing the traffic out the external interface
and its not able to connect to the service running in the jail
just another thought
do i need enable pf in the jail and open port 8888
the issue is how can you access a service running in a jail
using a browser running in the same jail
this is the jails config
github.com
root config files
github.com
pf.conf
github.com
classic jail config
github.com
searxng jail notes
github.com
searxng install
searxng config
we need to change a couple of setting before starting searxng
bind_address
by default the searxng bing_address is set to 127.0.0.1
which doesnt exist in the jail, so we use the jails ip address instead
we also need to set the secret key
we can install apg to generate a random password
generate a 64 character password
set the secret key
enable the searxng service in /etc/rc.conf
we can then start searxng
check if searxng is running on port 8888
jail set up
pf config
which maybe a pf firewall issue
The jail already has Firefox installed
so i thought it would make sense to install searxng in the same jail
searxng is set to listen on the jails ip address 10.10.0.5 and port 8888
and since Firefox is running in the same jail i thought the set up would be simple
searxng is running but i cant access it using Firefox running in the Jail
or using Firefox from outside the jail
so im guessing its a pf firewall issue
if anyone has any bright ideas and could give a shove in the right direction that would be great
this is the only pf rule i have for the jail
Code:
nat on $int_if from {lo1:network} to any -> ($int_if)
Firefox cant access searxng running in the same Jail with this address
Code:
10.10.0.5:8888
its almost like the pf rule is forcing the traffic out the external interface
and its not able to connect to the service running in the jail
just another thought
do i need enable pf in the jail and open port 8888
the issue is how can you access a service running in a jail
using a browser running in the same jail
this is the jails config
GitHub - NapoleonWils0n/jailfox: firefox in a freebsd jail
firefox in a freebsd jail. Contribute to NapoleonWils0n/jailfox development by creating an account on GitHub.
root config files
GitHub - NapoleonWils0n/freebsd-root-xps: freebsd root dotfiles for dell xps 15 2019
freebsd root dotfiles for dell xps 15 2019. Contribute to NapoleonWils0n/freebsd-root-xps development by creating an account on GitHub.
pf.conf
freebsd-root-xps/etc/pf.conf at master · NapoleonWils0n/freebsd-root-xps
freebsd root dotfiles for dell xps 15 2019. Contribute to NapoleonWils0n/freebsd-root-xps development by creating an account on GitHub.
classic jail config
freebsd-root-xps/etc/jail.conf.d/classic.conf at master · NapoleonWils0n/freebsd-root-xps
freebsd root dotfiles for dell xps 15 2019. Contribute to NapoleonWils0n/freebsd-root-xps development by creating an account on GitHub.
searxng jail notes
cerberus/freebsd/searxng-jail.org at master · NapoleonWils0n/cerberus
cerberus code library. Contribute to NapoleonWils0n/cerberus development by creating an account on GitHub.
searxng install
Code:
doas pkg install py311-searxng-devel
searxng config
we need to change a couple of setting before starting searxng
Code:
doas vi /usr/local/etc/searxng.yml
bind_address
by default the searxng bing_address is set to 127.0.0.1
which doesnt exist in the jail, so we use the jails ip address instead
Code:
#bind_address: "127.0.0.1"
bind_address: "10.10.0.5"
we also need to set the secret key
we can install apg to generate a random password
Code:
doas pkg install apg
generate a 64 character password
Code:
apg -n 1 -m 64
Code:
1kpadEERISSrIMj0Sat6WeUWS0WGyGYXhELOmUtkx05fAu5kHWen9HpFgfxEOJZA
set the secret key
Code:
#secret_key: "ultrasecretkey" # Is overwritten by ${SEARXNG_SECRET}
secret_key: "1kpadEERISSrIMj0Sat6WeUWS0WGyGYXhELOmUtkx05fAu5kHWen9HpFgfxEOJZA"
enable the searxng service in /etc/rc.conf
Code:
doas sysrc searxng_enable="YES"
we can then start searxng
Code:
doas service searxng start
check if searxng is running on port 8888
Code:
sockstat -l4
jail set up
Code:
doas vi /etc/rc.conf
Code:
jail_enable="YES"
ifconfig_lo1_aliases="inet 10.10.0.1-12/24"
Code:
/etc/jail.conf.d/classic.conf
Code:
classic {
# hostname/path
host.hostname = "${name}";
path = "/usr/local/jails/containers/${name}";
# permissions
allow.raw_sockets;
exec.clean;
persist;
sysvmsg=inherit;
sysvsem=inherit;
sysvshm=inherit;
enforce_statfs=1;
# permissions
devfs_ruleset=7;
# network
ip4.addr="lo1|10.10.0.5/24";
# mount
#mount.fstab="/usr/local/jails/containers/classic/etc/fstab";
mount += "devfs $path/dev devfs rw 0 0";
mount += "tmpfs $path/dev/shm tmpfs rw,size=1g,mode=1777 0 0";
mount += "/tmp $path/tmp nullfs rw 0 0";
mount += "/home $path/home nullfs rw 0 0";
# mount the download directory from the host to the jail after creating it
mount += "/home/djwilcox/downloads $path/home/djwilcox/downloads nullfs rw 0 0";
# uncomment the line below for the xdg runtime directory for wayland after creating it
mount += "/var/run/xdg/djwilcox $path/var/run/xdg/djwilcox nullfs rw 0 0";
}
pf config
Code:
/etc/pf.conf
Code:
#=========================================================================#
# variables, macro and tables #
#=========================================================================#
int_if="lagg0" # lagg0 failover
vpn_if="tun0" # vpn interface
all_networks="0.0.0.0/0"
vpn_network="$vpn_if:network"
# 6881, 6882 = transmission. , 22000, 21025 = syncthing
tcp_services = "{ ntp, 6881, 22000 }" # tcp services - torrent
udp_services = "{ ntp, 6882, 21025 }" # udp services - torrent
icmp_types = "{ echoreq, unreach }"
tcp_state="flags S/SA keep state"
udp_state="keep state"
table <lan> { $int_if:network, !self } # lan network
table <myself> { self } # self
table <martians> { 0.0.0.0/8 10.0.0.0/8 127.0.0.0/8 169.254.0.0/16 \
172.16.0.0/12 192.0.0.0/24 192.0.2.0/24 224.0.0.0/3 \
192.168.0.0/16 198.18.0.0/15 198.51.100.0/24 \
203.0.113.0/24 } # broken networks
#=========================================================================#
# global policy #
#=========================================================================#
set block-policy drop
set loginterface $int_if
set fingerprints "/etc/pf.os"
set skip on lo0
scrub in all fragment reassemble no-df max-mss 1440
# nat jail
nat on $int_if from {lo1:network} to any -> ($int_if)
antispoof log quick for { lo $int_if } label "block_spoofing"
#=========================================================================#
# block #
#=========================================================================#
block log all # block log all
block return out quick inet6 all tag IPV6 # block ipv6
block in quick inet6 all tag IPV6 # block ipv6
#=========================================================================#
# anchors #
#=========================================================================#
# openvpn - anchor
anchor "openvpn"
#=========================================================================#
# traffic tag #
#=========================================================================#
# icmp
pass inet proto icmp all icmp-type $icmp_types keep state tag ICMP
# Allow the tcp and udp services defined in the macros at the top of the file
pass in on $int_if inet proto tcp from any to ($int_if) port $tcp_services $tcp_state tag TCP_IN
pass in on $int_if inet proto udp from any to ($int_if) port $udp_services $udp_state tag UDP_IN
# nfs
#pass in on $int_if inet proto tcp from <lan> to any port $nfs_services keep state
# outbound traffic
block out on $int_if all
pass out quick on $int_if all modulate state