-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from hseg/packaging-conveniences
Add systemd unit
- Loading branch information
Showing
4 changed files
with
54 additions
and
1 deletion.
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
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,11 @@ | ||
[Unit] | ||
Description=Pizauth OAuth2 token manager | ||
|
||
[Service] | ||
Type=simple | ||
ExecStart=/usr/bin/pizauth server -vvvv -d | ||
ExecReload=/usr/bin/pizauth reload | ||
ExecStop=/usr/bin/pizauth shutdown | ||
|
||
[Install] | ||
WantedBy=default.target |
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,6 @@ | ||
[Service] | ||
Environment="PIZAUTH_STATE_FILE=%S/%N.dump" | ||
ExecStartPost=-sh -c 'age --decrypt --identity AGE_PRIV_KEY -o - "$PIZAUTH_STATE_FILE" | pizauth restore' | ||
ExecStop= | ||
ExecStop=-sh -c 'pizauth dump | age --encrypt --recipient AGE_PUB_KEY -o "$PIZAUTH_STATE_FILE"' | ||
ExecStop=/usr/bin/pizauth shutdown |
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,11 @@ | ||
[Unit] | ||
Requires=gpg-agent.socket | ||
|
||
[Service] | ||
PassEnvironment=GNUPGHOME | ||
Environment="PIZAUTH_KEY_ID=" | ||
Environment="PIZAUTH_STATE_FILE=%S/%N.dump" | ||
ExecStartPost=-sh -c 'gpg --batch --decrypt "$PIZAUTH_STATE_FILE" | pizauth restore' | ||
ExecStop= | ||
ExecStop=-sh -c 'pizauth dump | gpg --batch --yes --encrypt --recipient $PIZAUTH_KEY_ID -o "$PIZAUTH_STATE_FILE"' | ||
ExecStop=/usr/bin/pizauth shutdown |