-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
111 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
WireGuard for SMF | ||
================= | ||
|
||
The example `wg-quick.xml` file may be used for running wg-quick(8) | ||
using SMF. | ||
|
||
Usage | ||
----- | ||
|
||
Choose a name for your wg-quick config. It can be pretty much any simple string. | ||
It will be used for naming your config file and your SMF service instance name. | ||
The underlying tun device will be allocated dynamically. | ||
|
||
Create `/etc/wireguard/<something>.conf` | ||
|
||
``` | ||
# svccfg import wg-quick.xml | ||
# svccfg -s svc:/vpn/wg-quick add something | ||
# svcadm enable wg-quick:something | ||
``` | ||
|
||
Helpful references | ||
------------------ | ||
|
||
- https://blogs.warwick.ac.uk/chrismay/entry/solaris_smf_manifest/ | ||
- (archive) https://web.archive.org/web/20210613085120/https://blogs.warwick.ac.uk/chrismay/entry/solaris_smf_manifest/ | ||
- https://github.com/omniosorg/omnios-extra/blob/800489a/build/wireguard-tools/files/wg-quick.xml | ||
- https://github.com/TritonDataCenter/pkgsrc-extra/blob/4423c14/wireguard-tools/files/smf/manifest.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0"?> | ||
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> | ||
<service_bundle type="manifest" name="export"> | ||
<service name="vpn/wg-quick" type="service" version="0"> | ||
<!--instance name="default" enabled="false" --> | ||
<dependency name="network" grouping="require_all" restart_on="error" type="service"> | ||
<service_fmri value="svc:/milestone/network:default"/> | ||
</dependency> | ||
<dependency name="filesystem" grouping="require_all" restart_on="error" type="service"> | ||
<service_fmri value="svc:/system/filesystem/local"/> | ||
</dependency> | ||
<exec_method name="start" type="method" exec="/usr/local/bin/wg-quick up %i" timeout_seconds="180"> | ||
<method_context> | ||
<method_credential group="root" user="root"/> | ||
<method_environment> | ||
<envvar name="WG_QUICK_USERSPACE_IMPLEMENTATION" value="/usr/local/sbin/wireguard"/> | ||
</method_environment> | ||
</method_context> | ||
</exec_method> | ||
<exec_method name="stop" type="method" exec="/usr/local/bin/wg-quick down %i" timeout_seconds="180"> | ||
<method_context> | ||
<method_credential group="root" user="root"/> | ||
<method_environment> | ||
<envvar name="WG_QUICK_USERSPACE_IMPLEMENTATION" value="/usr/local/sbin/wireguard"/> | ||
</method_environment> | ||
</method_context> | ||
</exec_method> | ||
<property_group name="application" type="application"/> | ||
<property_group name="startd" type="framework"> | ||
<propval name="duration" type="astring" value="contract"/> | ||
<propval name="ignore_error" type="astring" value="core,signal"/> | ||
</property_group> | ||
<!-- /instance --> | ||
<stability value="Evolving"/> | ||
<template> | ||
<common_name> | ||
<loctext xml:lang="C">WireGuard via wg-quick(8)</loctext> | ||
</common_name> | ||
</template> | ||
</service> | ||
</service_bundle> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters