Skip to content

Commit

Permalink
add firewalld config file
Browse files Browse the repository at this point in the history
  • Loading branch information
feschber committed Jan 28, 2024
1 parent 5cc8cda commit c9deb6e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ gtk-update-icon-cache /usr/local/share/icons/hicolor/
# install desktop entry
sudo mkdir -p /usr/local/share/applications
sudo cp de.feschber.LanMouse.dekstop /usr/local/share/applications

# when using firewalld: install firewall rule
sudo cp firewall/lan-mouse.xml /etc/firewalld/services
# -> enable the service in firewalld settings
```

### Conditional Compilation
Expand Down
8 changes: 8 additions & 0 deletions firewall/lan-mouse.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- for packaging: /usr/lib/firewalld/services/lan-mouse.xml -->
<!-- configure manually: /etc/firewalld/services/lan-mouse.xml -->
<service>
<short>LAN Mouse</short>
<description>mouse and keyboard sharing via LAN</description>
<port port="4242" protocol="udp"/>
</service>

5 comments on commit c9deb6e

@feschber
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CupricReki

see https://firewalld.org/documentation/howto/add-a-service.html

Would be nice to distribute that with the AUR package

@CupricReki
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this only be added if /etc/firewalld exists do you think?

@feschber
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this only be added if /etc/firewalld exists do you think?

For packaging it should be under /usr/lib/firewalld/services (I think?), and I feel like it should also create that directory if its not there. Otherwise installing firewalld would not install that file.
I havent tested if this causes problems with installing firewalld, so that should probably be tested.

@CupricReki
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the firewalld documentation:

A package that places a service in the /usr/lib/firewalld/services directory should require the firewalld package or sub package that is providing the path. In an RPM based distribution that is using or that bases on the firewalld provided spec file this package is firewalld-filesystem.

If files are put into the /usr/lib/firewalld/services directory, you should make firewalld a dependency of the package. So I don't think we can pre-populate the config file. I'm reading up on optional dependencies in AUR though. Makes sense to move the config if firewalld is already installed.

@feschber
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Would be fine by me if we put it under /etc/firewalld then.

Please sign in to comment.