mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-13 10:30:16 +00:00
Add comment to mark end of Plinth Hidden Service configuration block.
This commit is contained in:
parent
4e493c1ac5
commit
500cfd11e3
@ -101,6 +101,7 @@ def subcommand_enable_hs(_):
|
|||||||
lines.append("HiddenServiceDir /var/lib/tor/hidden_service/\n")
|
lines.append("HiddenServiceDir /var/lib/tor/hidden_service/\n")
|
||||||
lines.append("HiddenServicePort 80 127.0.0.1:80\n")
|
lines.append("HiddenServicePort 80 127.0.0.1:80\n")
|
||||||
lines.append("HiddenServicePort 443 127.0.0.1:443\n")
|
lines.append("HiddenServicePort 443 127.0.0.1:443\n")
|
||||||
|
lines.append("# end of Plinth Hidden Service config\n")
|
||||||
|
|
||||||
with open(TOR_CONFIG, 'w') as conffile:
|
with open(TOR_CONFIG, 'w') as conffile:
|
||||||
conffile.writelines(lines)
|
conffile.writelines(lines)
|
||||||
@ -121,7 +122,11 @@ def subcommand_disable_hs(_):
|
|||||||
removing = False
|
removing = False
|
||||||
for line in lines:
|
for line in lines:
|
||||||
if removing:
|
if removing:
|
||||||
if not line.startswith("HiddenService"):
|
if line.startswith("# end of Plinth Hidden Service config"):
|
||||||
|
# last line of Plinth hidden service block
|
||||||
|
# stop removing after this line
|
||||||
|
removing = False
|
||||||
|
elif not line.startswith("HiddenService"):
|
||||||
# end of Plinth hidden service block
|
# end of Plinth hidden service block
|
||||||
# stop removing lines
|
# stop removing lines
|
||||||
removing = False
|
removing = False
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user