-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
New release? #28
Comments
I will get this updated this week. Apologies -- life happened and got a bit busy with other things! |
No problem, I just created an addition PR. Would be great if this could be part of the new release, too. |
Thanks - taking a look at it today. |
@AlexanderS - quick question - Given that this is now using a configuration file to set the adapter for initramfs, I can't see a reason not to just ingest a wireguard config from
This reduces the complexity of the scripts, leaves the configuration to a single place (while separating initramfs specific configuration), which is testable by the user before running initramfs generation, and keeps this focused solely on generating good results for boot configs (e.g. setting date for pi's, MTU's, etc). I was consolidating all of the previous merges and testing functionality and it seems a large portion of it is now no longer needed with the addition of config file loading versus directly setting the interface in the early days. Thoughts? |
I personally would still prefer a separate config in My suggestion is to use:
We could theoretically also set This approach ensures all settings are defined once, minimizes user configuration effort, and allows the WireGuard tunnel configuration to be tested independently (e.g., via To integrate this cleanly, we could parse the WireGuard configuration during initramfs build-time and extend the shell config file with the required additional information (or generate a new one). This would simplify tunnel activation in the initramfs environment. I think we would need at least Any thoughts? I can prepare a pull request if you think that's a good approach. |
I basically went down this path yesterday, keeping the initramfs configuration to strictly needed options to stand-up the link, and leaving the rest of the configuration to the actual wireguard config. Effectively: initramfs settings:
Adapter settings that are copied from the config file:
everything else effectively gets removed because it is now configured by the user in the adapter config. IPV4 and IPV6 settings are kept separate to minimize regex parsing for IP identification and enabling dual-stack configurations.
I started playing with this last night too. There's a few issues:
The problem is that the wireguard adapter file is a form of The data from the configuration file itself would need to be pre-processed and stored in a file (which would not be the initramfs config, but a separate third file) that would be parsed during boot without support of more advanced tooling like sed and grep. So you're left in a bit of pickle where you need to generate a configuration file or statically set the bare minimum adapter configuration to stand-up the interface.
I'll push the branch I was working on yesterday evening and tag it in this thread. It's cleaned up a bunch of stuff but hasn't gotten to the parsing of the config file yet (plan was to get the idea working and move to parsing complex configurations; effectively getting the initramfs configuration down to as minimal as possible; and then updating the migration script accordingly from a 2023-10-21 format to a new minimal (and would likely be, permenant format). |
https://github.com/r-pufky/wireguard-initramfs/tree/migrate_config As a side note, I've gotten a proof of concept that uses the installed wg-quick script and calls parse_options() to parse the wireguard adapter config. |
@AlexanderS - heya, I just pushed the last change to the 'migrate_config' branch, which should:
Should effectively get the repo in a state where it is release ready, pending raspbeery pi testing (I don't have one). Branch is located here: https://github.com/r-pufky/wireguard-initramfs/tree/migrate_config I saw there were a few pull requests from you just now from a bit earlier today - would you like me to roll those into main before merging this branch, or re-apply after branch is merged? |
Migrate adapter configuration to default defined adapter for the new configuration format. Leaves filesystem in a state ready for standard install. Updates #28 to pre-release status, pending additional feedback. Added: * Test validating last release (2023-10-21) migrates correctly to current head. Changed: * migrate_project_structure.sh - updated to reflect current implementation for migration; with logging to inform end user of new configuration location. * README.md - updated migration instructions.
@AlexanderS - everything is merged, tested, and updated to main. Please take a look. I don't have an Raspberry Pi to do that verification, but all other tests now pass. Will push a new release if I don't here anything back by this weekend. |
Would it be possible to tag a release? The last tag is from long ago and does not contain the recent enhancements from last year. I would like to try to create a package for Debian and it would be nice to use a clean upstream version.
Thanks.
The text was updated successfully, but these errors were encountered: