-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Use override.conf files for systemd unit config
- Loading branch information
Showing
7 changed files
with
176 additions
and
143 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
169 changes: 91 additions & 78 deletions
169
packages/dart/sshnoports/bundles/shell/systemd/README.md
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 |
---|---|---|
@@ -1,78 +1,91 @@ | ||
# Systemd Units | ||
|
||
This directory contains systemd unit definitions for running various components | ||
of the SSH No Ports suite. | ||
|
||
## sshnpd | ||
|
||
### Installation | ||
|
||
The `sshnpd.service` file should be placed in `/etc/systemd/system` (as root). | ||
|
||
Modify the `sshnpd.service` unit to use the appropriate host and client atSigns, | ||
(The boilerplate uses @device_atsign @manager_atsign) as well as the devicename. | ||
Also change the username and make sure that username running sshnpd has the | ||
.atkeys file in place at '~/.atsign/keys'. | ||
|
||
Run the following command to view full usage information of the sshnpd binary: | ||
```sh | ||
/usr/local/bin/sshnpd | ||
``` | ||
|
||
### Usage | ||
|
||
To enable the service: | ||
|
||
```sh | ||
sudo systemctl enable sshnpd.service | ||
``` | ||
|
||
The services will then start at the next reboot, or can be started immediately | ||
with: | ||
|
||
```sh | ||
sudo systemctl start sshnpd.service | ||
``` | ||
|
||
To view the realtime logs, use journalctl: | ||
|
||
```sh | ||
sudo journalctl -u sshnpd.service | ||
``` | ||
|
||
## srvd | ||
|
||
### Installation | ||
|
||
The `srvd.service` file should be placed in `/etc/systemd/system` (as root). | ||
|
||
Modify the `srvd.service` unit to use the appropriate atSign, | ||
(The boilerplate uses @atsign) as well as the internet address. | ||
Also change the username and make sure that username running srvd has the | ||
.atkeys file in place at '~/.atsign/keys'. | ||
|
||
Run the following command to view full usage information of the srvd binary: | ||
```sh | ||
/usr/local/bin/srvd | ||
``` | ||
|
||
### Usage | ||
|
||
To enable the service use: | ||
|
||
```sh | ||
sudo systemctl enable srvd.service | ||
``` | ||
|
||
The services will then start at the next reboot, or can be started immediately | ||
with: | ||
|
||
```sh | ||
sudo systemctl start srvd.service | ||
``` | ||
|
||
To view the realtime logs, use journalctl: | ||
|
||
```sh | ||
sudo journalctl -u srvd.service | ||
``` | ||
# Systemd Units | ||
|
||
This directory contains systemd unit definitions for running various | ||
components of the NoPorts suite. | ||
|
||
## sshnpd | ||
|
||
### Installation | ||
|
||
The `sshnpd.service` file should be placed in `/etc/systemd/system` (as root). | ||
|
||
The `sshnpd.service` unit `override.conf` can be modified by running: | ||
|
||
```sh | ||
sudo systemctl edit sshnpd | ||
``` | ||
|
||
It should be edited to use the appropriate host and client atSigns, (The | ||
boilerplate uses @device_atsign @manager_atsign) as well as the devicename. | ||
Also change the username and make sure that username running sshnpd has the | ||
.atkeys file in place at '~/.atsign/keys'. | ||
|
||
Run the following command to view full usage information of the sshnpd binary: | ||
```sh | ||
/usr/local/bin/sshnpd | ||
``` | ||
|
||
### Usage | ||
|
||
To enable the service: | ||
|
||
```sh | ||
sudo systemctl enable sshnpd | ||
``` | ||
|
||
The services will then start at the next reboot, or can be started immediately | ||
with: | ||
|
||
```sh | ||
sudo systemctl start sshnpd | ||
``` | ||
|
||
To view the realtime logs, use journalctl: | ||
|
||
```sh | ||
journalctl -u sshnpd -f | ||
``` | ||
|
||
## srvd | ||
|
||
### Installation | ||
|
||
The `srvd.service` file should be placed in `/etc/systemd/system` (as root). | ||
|
||
The `srvd.service` unit `override.conf` can be modified by running: | ||
|
||
```sh | ||
sudo systemctl edit ssrvd | ||
``` | ||
|
||
It should be edited to use the appropriate atSign, | ||
(The boilerplate uses @atsign) as well as the internet address. | ||
Also change the username and make sure that username running srvd has the | ||
.atkeys file in place at '~/.atsign/keys'. | ||
|
||
Run the following command to view full usage information of the srvd binary: | ||
|
||
```sh | ||
/usr/local/bin/srvd | ||
``` | ||
|
||
### Usage | ||
|
||
To enable the service use: | ||
|
||
```sh | ||
sudo systemctl enable srvd | ||
``` | ||
|
||
The services will then start at the next reboot, or can be started immediately | ||
with: | ||
|
||
```sh | ||
sudo systemctl start srvd | ||
``` | ||
|
||
To view the realtime logs, use journalctl: | ||
|
||
```sh | ||
journalctl -u srvd -f | ||
``` |
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
19 changes: 19 additions & 0 deletions
19
packages/dart/sshnoports/bundles/shell/systemd/srvd.service.d/override.conf
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,19 @@ | ||
# Configuration of srvd service | ||
# This override configuration is a template for the srvd service. | ||
# You can configure the service by editing the variables below. | ||
# This ovverride config covers the common configuration options for srvd. | ||
# To see all available options, run `srvd` with no arguments. | ||
|
||
[Service] | ||
|
||
# MANDATORY: User to run the daemon as | ||
User=<username> | ||
|
||
# MANDATORY: Srvd atSign | ||
Environment=atsign="@my_rvd" | ||
|
||
# MANDATORY: Public FQDN or IP address of the machine running the srvd | ||
Environment=internet_address="" | ||
|
||
# Any additional command line arguments for srvd | ||
Environment=additional_args="" |
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
39 changes: 39 additions & 0 deletions
39
packages/dart/sshnoports/bundles/shell/systemd/sshnpd.service.d/override.conf
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,39 @@ | ||
# Configuration of sshnpd service | ||
# This override configuration is a template for the sshnpd service. | ||
# You can configure the service by editing the variables below. | ||
# This service file covers the common configuration options for sshnpd. | ||
# To see all available options, run `sshnpd` with no arguments. | ||
|
||
[Unit] | ||
|
||
# Uncomment the following line to make this unit fail if sshd isn't started first | ||
; Requisite=sshd.service | ||
|
||
# Uncomment the following line to make this unit auto-start sshd if it isn't started | ||
; Requires=sshd.service | ||
|
||
[Service] | ||
|
||
# MANDATORY: User to run the daemon as | ||
User=<username> | ||
|
||
# MANDATORY: Manager (client) or policy manager address (atSign) | ||
Environment=manager_atsign="@example_client" | ||
|
||
# MANDATORY: Device address (atSign) | ||
Environment=device_atsign="@example_device" | ||
|
||
# OPTIONAL: Delegated access policy management | ||
Environment=delegate_policy="" | ||
|
||
# Device name | ||
Environment=device_name="default" | ||
|
||
# Comment if you don't want the daemon to update authorized_keys to include public keys sent by authorized manager atSigns | ||
Environment=s="-s" | ||
|
||
# Comment to disable verbose logging | ||
Environment=v="-v" | ||
|
||
# Any additional command line arguments for sshnpd | ||
Environment=additional_args="" |
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