@@ -25,27 +25,29 @@ var spaceMatcher = regexp.MustCompile(`[\s]+`)
25
25
func (l * link ) ValidArgs () map [string ]string {
26
26
27
27
r := map [string ]string {
28
- "s" : "Set homeserver address, defaults to server --external_address if set, or server listen address if not" ,
29
- "l" : "List currently active download links" ,
30
- "r" : "Remove download link" ,
31
- "C" : "Comment to add as the public key (acts as the name)" ,
32
- "goos" : "Set the target build operating system (default runtime GOOS)" ,
33
- "goarch" : "Set the target build architecture (default runtime GOARCH)" ,
34
- "goarm" : "Set the go arm variable (not set by default)" ,
35
- "name" : "Set the link download url/filename (default random characters)" ,
36
- "proxy" : "Set connect proxy address to bake it" ,
37
- "tls" : "Use TLS as the underlying transport" ,
38
- "ws" : "Use plain http websockets as the underlying transport" ,
39
- "wss" : "Use TLS websockets as the underlying transport" ,
40
- "stdio" : "Use stdin and stdout as transport, will disable logging, destination after stdio:// is ignored" ,
41
- "http" : "Use http polling as the underlying transport" ,
42
- "https" : "Use https polling as the underlying transport" ,
43
- "shared-object" : "Generate shared object file" ,
44
- "fingerprint" : "Set RSSH server fingerprint will default to server public key" ,
45
- "garble" : "Use garble to obfuscate the binary (requires garble to be installed)" ,
46
- "upx" : "Use upx to compress the final binary (requires upx to be installed)" ,
47
- "no-lib-c" : "Compile client without glibc" ,
48
- "sni" : "When TLS is in use, set a custom SNI for the client to connect with" ,
28
+ "s" : "Set homeserver address, defaults to server --external_address if set, or server listen address if not" ,
29
+ "l" : "List currently active download links" ,
30
+ "r" : "Remove download link" ,
31
+ "C" : "Comment to add as the public key (acts as the name)" ,
32
+ "goos" : "Set the target build operating system (default runtime GOOS)" ,
33
+ "goarch" : "Set the target build architecture (default runtime GOARCH)" ,
34
+ "goarm" : "Set the go arm variable (not set by default)" ,
35
+ "name" : "Set the link download url/filename (default random characters)" ,
36
+ "proxy" : "Set connect proxy address to bake it" ,
37
+ "tls" : "Use TLS as the underlying transport" ,
38
+ "ws" : "Use plain http websockets as the underlying transport" ,
39
+ "wss" : "Use TLS websockets as the underlying transport" ,
40
+ "stdio" : "Use stdin and stdout as transport, will disable logging, destination after stdio:// is ignored" ,
41
+ "http" : "Use http polling as the underlying transport" ,
42
+ "https" : "Use https polling as the underlying transport" ,
43
+ "shared-object" : "Generate shared object file" ,
44
+ "fingerprint" : "Set RSSH server fingerprint will default to server public key" ,
45
+ "garble" : "Use garble to obfuscate the binary (requires garble to be installed)" ,
46
+ "upx" : "Use upx to compress the final binary (requires upx to be installed)" ,
47
+ "no-lib-c" : "Compile client without glibc" ,
48
+ "sni" : "When TLS is in use, set a custom SNI for the client to connect with" ,
49
+ "working-directory" : "Set download/working directory for automatic script (i.e doing curl https://<url>.sh)" ,
50
+ "raw-download" : "Download over raw TCP, outputs bash downloader rather than http" ,
49
51
}
50
52
51
53
// Add duplicate flags for owners
@@ -117,6 +119,8 @@ func (l *link) Run(user *users.User, tty io.ReadWriter, line terminal.ParsedLine
117
119
UPX : line .IsSet ("upx" ),
118
120
Garble : line .IsSet ("garble" ),
119
121
DisableLibC : line .IsSet ("no-lib-c" ),
122
+
123
+ RawDownload : line .IsSet ("raw-download" ),
120
124
}
121
125
122
126
var err error
@@ -206,6 +210,11 @@ func (l *link) Run(user *users.User, tty io.ReadWriter, line terminal.ParsedLine
206
210
}
207
211
}
208
212
213
+ buildConfig .WorkingDirectory , err = line .GetArgString ("working-directory" )
214
+ if err != nil && err != terminal .ErrFlagNotSet {
215
+ return err
216
+ }
217
+
209
218
if spaceMatcher .MatchString (buildConfig .Owners ) {
210
219
return errors .New ("owners flag cannot contain any whitespace" )
211
220
}
0 commit comments