[quote=“troubadour, post:19, topic:533”]- create a configuration file.
- create a hash file (sha1) of the configuration file (installed along the configuration file).
- when CPFP is started, it runs the hash function of the configuration file and compares it to the hash file content.[/quote]
Why do you need a hash of the config anyway? I don’t know the rationale behind that yet. Why not just parse it every time cpfpy starts?
I overlooked that (a daemon should not have root privileges).Probably easiest to run the daemon as the same user as Tor, as user debian-tor. Because that user has access to Tor's files (control cookie) because it's member of the debian-tor group. (But that user does not have a /home folder by default.)
I do agree on the usability of the .d folders. Yes, the problem is parsing.Please find out. Never figured that out myself. Otherwise maybe I would have written more scripts in python.
What you are doing in bash is very neat (although I do not fully understand the magic).[code] [...] ## Check if folder /etc/controlportfilt.d exists. if [ -d /etc/controlportfilt.d ]; then ## Use bash (or also sh's? nevermind) globbing feature. It matches all files in that folder. (Except for i in /etc/controlportfilt.d/*; do if [ -f "$i" ]; then ## [...] ## Check for syntax errors. (Would exit 0 if no syntax errors, otherwise 1.) ## (And non-zero exit codes would be caught by the error handler and the whole script would exit.) bash -n "$i" ## "source" (same as ".") the folder. Imagine you'd take the content of the whole file "$i" and include it at this point in the script. source "$i" fi [...] [/code]
It would be a whole different game to parse the controlportfilt.d directory in Python and make out what the real configuration is.Looks like there is no python library for doing this?
The configuration file I am working with: [code] [CONFIGURATION] CONTROL_PORT_FILTER_LIMIT_GETINFO_NET_LISTENERS_SOCKS = True CONTROL_PORT_FILTER_LIMIT_STRING_LENGTH = True CONTROL_PORT_FILTER_EXCESSIVE_STRING_LENGTH = 128[WHITE_LIST]
1 = GETINFO net/listeners/socks
2 = SIGNAL NEWNYM
3 = GETINFO status/bootstrap-phase
4 = GETINFO status/circuit-established
[/code]
Looks like a long way to go to make it overrulable?