/
doc.go
149 lines (136 loc) · 4.91 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
// Copyright 2014-2015 Apptimist, Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// NOTE Usage... is the output of `./asn -h`
/*
Package "asn" implements the Apptimist Social Networks a server and
adminsttration client for the protocol described in:
https://github.com/apptimistco/rfc/blob/master/asn.md
Usage: asn [FLAGS] [COMMAND [ARGS...]]
Flags:
-admin=false: Run COMMAND or CLI in admin mode.
This is the default action if the configuration doesn't have
any listerners.
-config="asn.yaml": Set configuration filename.
Without this flag asn searches './' and '/etc' for 'asn.yaml'.
-diag="": If built with the 'diag' tag, this redirects output
to the named file instead of syslog.
-log="": If built *without* the 'nolog' tag, this redirects
output to the named file instead of syslog.
-new-keys=false: Print new keys and exit.
-nologin=false: run COMMAND w/o login
-server="0": Connect to the configured server with the matching name,
URL or at the given index.
-show-config=false: Print configuration with redacted keys and exit.
-show-errors=false: Print ASN protocol error codes and exit.
-show-help=false: Print this and exit.
-show-ids=false: Print ASN protocol identifiers and exit.
-show-sums=false: Print sums of *.go files and exit.
Examples:
$ asn -config example-sf.yaml &
$ asn -config example-adm.yaml echo hello world
$ asn -config example-adm.yaml -server 1 echo hello world
$ asn -config example-adm.yaml -server sf echo hello world
$ asn -config example-adm.yaml -server sf # CLI
$ asn -config example-adm.yaml -server sf - <<-EOF
echo hello world
EOF
Commands:
approve BLOB...
Before acknowledgment, the server forwards the matching blobs
to its owner or subscriber.
auth [-u USER] AUTH
Record user's ED255519 authentication key.
blob <USER|[USER/]NAME> - CONTENT
Creates named blob.
cat BLOB...
Returns the contents of the named blob.
clone [NAME][@TIME]
Replicate or update an object repository.
echo [STRING]...
Returns space separated ARGS in the Ack data.
filter FILTER [ARGS... --] [BLOB...]
Returns STDOUT of FILTER program run with list of blobs as STDIN.
fetch BLOB...
Before acknowledgement the server sends all matching blobs.
gc [-v|--verbose] [-n|--dry-run] [@TIME]
Before acknowledgement the server purges older or all blobs
flagged for deletion.
iam NAME
Show NAME instead of LOGIN key in list of Who.
Used by servers in indirect clone request.
ls [BLOB...]
Returns list of matching blobs.
mark [-u USER] [LATITUDE LONGITUDE | 7?PLACE]
Record user's location.
newuser <"actual"|"bridge"|"forum"|"place">
Creates a new user and return keys in acknowledgment.
objdump BLOB...
Returns the decoded header of the named blob
rm BLOB...
Flag blobs for removal by garbage collector.
trace [COMMAND [ARG]]
Return and flush the PDU trace or manipulate its filter.
users
List all users.
vouch USER SIG
Vouch for or deny USER's identity.
who
List logged in user names, if set, or login key.
Where BLOB may be any of the following:
-
'$'<'*' | SUM>[@TIME]
['~'['*' | '.' | USER]][GLOB][@TIME]
Server CONFIG Format:
name: STRING
dir: PATH
lat: FLOAT
lon: FLOAT
listen:
- unix:///PATH.sock
- tcp://:PORT
- ws://[HOST][:PORT]/PATH.ws
keys:
admin:
pub:
encr: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
auth: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
server:
pub:
encr: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
auth: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sec:
encr: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
auth: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
nonce: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Admin CONFIG Format:
name: STRING
dir: PATH
lat: FLOAT
lon: FLOAT
keys:
admin:
pub:
encr: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
auth: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
sec:
encr: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
auth: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
server:
pub:
encr: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
auth: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
nonce: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
server:
- name: local
url: unix:///PATH.sock
- name: sf
url: ws://HOST[:PORT]/PATH.ws
lat: 37.774929
lon: -122.419415
- name: la
url: ws://HOST[:PORT]/PATH.ws
lat: 34.052234
lon: -118.243684
*/
package main