forked from hyphanet/pyFreenet
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Review.txt
136 lines (94 loc) · 3.67 KB
/
Review.txt
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
Code review for pyFreenet
=========================
bab, starting at 56fb60ee5b1d820a14f717639b66422e2fac9578
---------------------------------------------------------
### State
- All files in fcp/ are reviewed, I’m pretty sure that they are not evil. I did not check for all kinds of code errors, though, only for potentially malicious code.
- Scripts I checked in toplevel: fcpgenkey, fcpget, fcpinvertkey, fcpnames, fcpput, fcpredirect, fcp_to_mrtg_bridge.py, fcp_to_rrdtool_bridge.py, fcpxmlrpc.cgi, fproxyproxy, freesitemgr, pyNodeConfig, freedisk
### fcp/node.py
General note: Really nicely commented code.
#### 2013-02-07 00:42:22
Read the code completely. Disabled an unsafe exec.
#### 2013-02-07 01:11:11
Reviewed everything in fcp/ except for sitemgr.py, xmlobject.py and xmlrpc.py
#### 2013-02-13 23:48:24
- xmlobject.py looks good.
- xmlrpc.py looks good - and actually provides an XML-RPC interface to freenet!
#### 2013-02-15 00:34:28
- fixed sitemgr.py and reactivated namesite after creating a pseudopythonparser which can read the pythonesque config files without using exec.
- Scripts I checked in toplevel: fcpgenkey, fcpget, fcpinvertkey, fcpnames, fcpput, fcpredirect, fcp_to_mrtg_bridge.py, fcp_to_rrdtool_bridge.py, fcpxmlrpc.cgi, fproxyproxy, freesitemgr, pyNodeConfig
#### Notes
- quite a few global objects, but that’s ok
- the methods mostly use **kw, but the help text gives an overview of the useful keywords.
- seems to attempt compatibility to before python 2.3 (=ancient). See line 281.
- it might be useful to have a property for the ID which just spawns new ids
- FCPNode.shutdown() is misleading: it closes the connection but does not shutdown the node.
- epydoc documentation generation works
- [sha](http://docs.python.org/2/library/sha.html) has been deprecated in favor of [hashlib](http://docs.python.org/2/library/hashlib.html) since Python 2.5.
Do the tutorial:
- creating the fcp.node.FCPNode() works
- node.put(key, file=path) works
TODO:
- doctests functions:
* readdir √
* hashfile √
* sha265dda √
* uriIsPrivate √
* parseTime √
* base64encode - can’t really test this right now.
* base64decode - can’t really test this right now.
- doctests node:
* getSocketTimeout(self): √
* setSocketTimeout(self, socketTimeout): √
* getVerbosity(self): √
* setVerbosity(self, verbosity): √
- namesite: I don’t know what these should do, so I can’t test them
reliably. Could be a simple decentral DNS system. The code looks as
if it should work, though.
* namesiteInit(self, path):
* namesiteLoad(self):
* namesiteSave(self):
* namesiteDelLocal(self, name):
* namesiteDelRecord(self, localname, domain):
* namesiteAddPeer(self, name, uri):
* namesiteHasPeer(self, name):
* namesiteGetPeer(self, name):
* namesiteRemovePeer(self, name):
* namesiteProcessUri(self, uri):
#### Check requests we can send to the node
(according to https://wiki.freenetproject.org/FCPv2 )
TODO: Check which are supported.
- ClientHello
- ListPeer (since 1045)
- ListPeers
- ListPeerNotes
- AddPeer
- ModifyPeer
- ModifyPeerNote
- RemovePeer
- GetNode
- GetConfig (since 1027)
- ModifyConfig (since 1027)
- TestDDARequest (since 1027)
- TestDDAResponse (since 1027)
- GenerateSSK
- ClientPut
- ClientPutDiskDir
- ClientPutComplexDir
- ClientGet
- LoadPlugin (since 1227)
- ReloadPlugin (since 1227)
- RemovePlugin (since 1227)
- GetPluginInfo (since 1075)
- FCPPluginMessage (since 1075)
- SubscribeUSK
- UnsubscribeUSK (since 1209)
- WatchGlobal
- GetRequestStatus
- ListPersistentRequests
- RemoveRequest
- ModifyPersistentRequest
- Disconnect
- Shutdown
- Void
- ProbeRequest