summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGDR! <gdr@gdr.name>2017-01-31 20:33:10 +0100
committerGDR! <gdr@gdr.name>2017-01-31 20:33:10 +0100
commit7e2e36c9ada68c9cdd7613c2ec35450bc108ff38 (patch)
tree087e6aab4dcd1e97402c98a6e1fdde890ee54008
parent820360140e012ae26c5d048cca2775a96f52812b (diff)
parentcac8edd1c0e025813fd4f65645bf9650ebaf4764 (diff)
Merge branch 'master' of github.com:gjedeer/tuntox
-rw-r--r--main.c46
-rw-r--r--scripts/tuntox.service10
2 files changed, 40 insertions, 16 deletions
diff --git a/main.c b/main.c
index bbbebe5..a13fc46 100644
--- a/main.c
+++ b/main.c
@@ -1156,22 +1156,36 @@ void do_daemonize()
1156 1156
1157void help() 1157void help()
1158{ 1158{
1159 fprintf(stderr, "tuntox - Forward ports over the Tox protocol\n"); 1159 fprintf(stderr, "tuntox - Forward ports over the Tox protocol\n\n");
1160 fprintf(stderr, "USAGE:\n\n"); 1160 fprintf(stderr, "Usage:\n");
1161 fprintf(stderr, "-i <toxid> - remote point Tox ID\n"); 1161 fprintf(stderr, " tuntox ... # starts the server\n");
1162 fprintf(stderr, "-L <localport>:<remotehostname>:<remoteport> - forward <remotehostname>:<remoteport> to 127.0.0.1:<localport>\n"); 1162 fprintf(stderr, " tuntox -i <servertoxid> -L <localport>:<remoteaddress>:<remoteport> ... # starts the client\n\n");
1163 fprintf(stderr, "-P <remotehostname>:<remoteport> - forward <remotehostname>:<remoteport> to stdin/stdout (SSH ProxyCommand mode)\n"); 1163 fprintf(stderr, "Options:\n");
1164 fprintf(stderr, "-p - ping the server from -i and exit\n"); 1164 fprintf(stderr, " Server:\n");
1165 fprintf(stderr, "-C <dir> - save private key in <dir> instead of /etc/tuntox in server mode\n"); 1165 fprintf(stderr, " -i <toxid> - whitelisted Tox ID (can be used multiple times)\n");
1166 fprintf(stderr, "-s <secret> - shared secret used for connection authentication (max %u characters)\n", TOX_MAX_FRIEND_REQUEST_LENGTH-1); 1166 fprintf(stderr, " -f <file> - only allow connections to hostname/port combinations contained\n");
1167 fprintf(stderr, "-f <file> - only allow connections to hostname/port combinations contained in <file>. Rules must be entered one per line with the <hostname>:<port> format\n"); 1167 fprintf(stderr, " in <file>. Rules must be entered one per line with the\n");
1168 fprintf(stderr, "-d - debug mode\n"); 1168 fprintf(stderr, " <hostname>:<port> format\n");
1169 fprintf(stderr, "-q - quiet mode\n"); 1169 fprintf(stderr, " Client:\n");
1170 fprintf(stderr, "-S - send output to syslog instead of stderr\n"); 1170 fprintf(stderr, " -i <toxid> - remote point Tox ID\n");
1171 fprintf(stderr, "-D - daemonize (fork) and exit (implies -S)\n"); 1171 fprintf(stderr, " -L <localport>:<remotehostname>:<remoteport>\n");
1172 fprintf(stderr, "-F <path> - create a PID file named <path>\n"); 1172 fprintf(stderr, " - forward <remotehostname>:<remoteport> to 127.0.0.1:<localport>\n");
1173 fprintf(stderr, "-U <username|userid> - drop privileges to <username> before forking. Use numeric <userid> in static builds.\n"); 1173 fprintf(stderr, " -P <remotehostname>:<remoteport> - forward <remotehostname>:<remoteport> to\n");
1174 fprintf(stderr, "-h - this help message\n"); 1174 fprintf(stderr, " stdin/stdout (SSH ProxyCommand mode)\n");
1175 fprintf(stderr, " -p - ping the server from -i and exit\n");
1176 fprintf(stderr, " Common:\n");
1177 fprintf(stderr, " -C <dir> - save private key in <dir> instead of /etc/tuntox in server\n");
1178 fprintf(stderr, " mode\n");
1179 fprintf(stderr, " -s <secret> - shared secret used for connection authentication (max\n");
1180 fprintf(stderr, " %u characters)\n", TOX_MAX_FRIEND_REQUEST_LENGTH-1);
1181 fprintf(stderr, " -d - debug mode\n");
1182 fprintf(stderr, " -q - quiet mode\n");
1183 fprintf(stderr, " -S - send output to syslog instead of stderr\n");
1184 fprintf(stderr, " -D - daemonize (fork) and exit (implies -S)\n");
1185 fprintf(stderr, " -F <path> - create a PID file named <path>\n");
1186 fprintf(stderr, " -U <username|userid> - drop privileges to <username> before forking. Use\n");
1187 fprintf(stderr, " numeric <userid> in static builds.\n");
1188 fprintf(stderr, " -h - this help message\n");
1175} 1189}
1176 1190
1177int main(int argc, char *argv[]) 1191int main(int argc, char *argv[])
diff --git a/scripts/tuntox.service b/scripts/tuntox.service
index 862a539..6027fa9 100644
--- a/scripts/tuntox.service
+++ b/scripts/tuntox.service
@@ -17,6 +17,16 @@ Restart=on-failure
17#User=proxy 17#User=proxy
18#Group=proxy 18#Group=proxy
19 19
20# Uncomment this and add a password to enable authentication
21#Environment=TUNTOX_SHARED_SECRET=yourpassword
22
23# Makes / read-only
24ProtectSystem=strict
25# … except for /etc/tuntox. Modify this if you change the default directory,
26# comment it out if you want to generate a new id on each start.
27# Remember that /etc/tuntox still needs to be writable by User!
28ReadWriteDirectories=/etc/tuntox
29
20[Install] 30[Install]
21WantedBy=multi-user.target 31WantedBy=multi-user.target
22Alias=tuntox.service 32Alias=tuntox.service