Adjust I2P apprmarmor profiles for /viewlicense
I2P comes with its own apparmor profiles which is great, but they are not enabled by default (in complain mode) and user should enable/enforce them manually:
sudo apt install app-utils
this will give us aa-enforce option:
sudo aa-enforce /etc/apparmor.d/system_i2p
sudo aa-enforce /etc/apparmor.d/usr.bin.i2prouter
aa-status will show:
user@host:~# sudo aa-status
apparmor module is loaded.
/usr/bin/i2prouter
/usr/bin/i2prouter//sanitized_helper
system_i2p
system_i2p//sanitized_helper
3 processes have profiles defined.
3 processes are in enforce mode.
/usr/sbin/wrapper (1450) /usr/bin/i2prouter
/usr/lib/jvm/java-11-openjdk-amd64/bin/java (1452) /usr/bin/i2prouter
0 processes are in complain mode.
0 processes are unconfined but have a profile defined.
everything working great except when visiting:
http://127.0.0.1:7657/viewlicense
It will give:
HTTP ERROR 403 java.io.FileNotFoundException: /usr/share/doc/i2p-router/copyright (Permission denied)
URI: /viewlicense
STATUS: 403
MESSAGE: java.io.FileNotFoundException: /usr/share/doc/i2p-router/copyright (Permission denied)
SERVLET: net.i2p.router.web.jsp.viewlicense_jsp
Powered by Jetty:// 9.4.39.v20210325
I2P info:
I2P version: 0.9.50-0-1ubuntu1
API version: 0.9.50
Java version: Debian 11.0.12 (OpenJDK Runtime Environment 11.0.12+7-post-Debian-2)
Wrapper version: 3.5.30
Server version: 9.4.39.v20210325
Servlet version: Jasper JSP 2.3 Engine (3.1)
JSTL version: standard-taglib 1.2.5
Platform: Linux amd64 5.4.136-1.fc25.qubes.x86_64
Processor: Haswell Core i3/i5/i7 model 60 (coreihwl)
JBigI status: Locally optimized library libjbigi-linux-coreihwl_64.so loaded from file
GMP version: 6.2.1
JBigI version: 4
JCpuId version: 3
Encoding: UTF-8
Charset: UTF-8
Built By: Undefined