-
Notifications
You must be signed in to change notification settings - Fork 26
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 #18 from SharzyL/master
v6-only systemd services, XDG_CONFIG_HOME support
- Loading branch information
Showing
6 changed files
with
77 additions
and
27 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 |
---|---|---|
|
@@ -27,7 +27,7 @@ USAGE: | |
auth-thu [options] online [online_options] | ||
VERSION: | ||
2.1 | ||
2.1.1 | ||
AUTHORS: | ||
Yuxiang Zhang <[email protected]> | ||
|
@@ -62,6 +62,7 @@ COMMANDS: | |
online Keep your computer online | ||
OPTIONS: | ||
--auth, -a keep the Auth online only | ||
--ipv6, -6 keep only ipv6 connection online | ||
GLOBAL OPTIONS: | ||
--username name, -u name your TUNET account name | ||
|
@@ -74,8 +75,8 @@ GLOBAL OPTIONS: | |
--version, -v print the version | ||
``` | ||
|
||
The program looks for a config file in `$XDG_CONFIG_HOME/auth-thu`, `~/.config/auth-thu`, `~/.auth-thu` in order. | ||
Write a config file to store your username & password or other options in the following format. | ||
The default location of config file is `~/.auth-thu`. | ||
|
||
``` | ||
{ | ||
|
@@ -103,9 +104,7 @@ Note that the program should have access to the configure file. For `goauthing.s | |
setfacl -m u:nobody:r /etc/goauthing.json | ||
``` | ||
|
||
Or, to be more secure, you can choose `[email protected]` and store the config in `~/.auth-thu`. | ||
|
||
For other authentication like IPv6, you can copy these service files and modify them correspondingly. | ||
Or, to be more secure, you can choose `[email protected]` and store the config in home directory. | ||
|
||
It is suggested that one configures and runs it manually first with `debug` flag turned on, which ensures the correctness of one's config, then start it as system service. For `daemonize` flag, it forces the program to only log errors, hence debugging should be done earlier and manually. `daemonize` is automatically turned on for system service (ref to associated systemd unit files). | ||
|
||
|
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
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,14 @@ | ||
[Unit] | ||
Description=Authenticating utility for auth.tsinghua.edu.cn | ||
StartLimitIntervalSec=0 | ||
|
||
[Service] | ||
ExecStartPre=-/usr/local/bin/auth-thu -c /etc/goauthing.json -D deauth -6 | ||
ExecStartPre=-/usr/local/bin/auth-thu -c /etc/goauthing.json -D auth -6 | ||
ExecStart=/usr/local/bin/auth-thu -c /etc/goauthing.json -D online -6 | ||
User=nobody | ||
Restart=always | ||
RestartSec=5 | ||
|
||
[Install] | ||
WantedBy = multi-user.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,15 @@ | ||
[Unit] | ||
Description=Authenticating utility for auth.tsinghua.edu.cn | ||
StartLimitIntervalSec=0 | ||
|
||
[Service] | ||
# default config is in ~/.auth-thu | ||
ExecStartPre=-/usr/local/bin/auth-thu -D deauth -6 | ||
ExecStartPre=-/usr/local/bin/auth-thu -D auth -6 | ||
ExecStart=/usr/local/bin/auth-thu -D online -6 | ||
User=%i | ||
Restart=always | ||
RestartSec=5 | ||
|
||
[Install] | ||
WantedBy = multi-user.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