README.rst 907 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. nfoservers-panel
  2. ================
  3. Python frontend for NFOServers control panel
  4. Usage
  5. -----
  6. .. code-block::
  7. from nfoservers_panel import server, firewall
  8. s = server.NFOServer('email@example.com', '********', 'server_name', 'virtual')
  9. f = firewall.Firewall(s)
  10. rules = f.fetch_rules()
  11. i = rules.get_idx_by_description('whitelist')
  12. old_ips = [l for l in rules.rules[i]['f_ipfrom_ipset'].split('\n') if l]
  13. ips = '\n'.join(old_ips + ['8.8.8.8'])
  14. rules.rules[i]['f_ipfrom_ipset'] = ips
  15. f.rules.prepare_new_rule_idx(9) # insert new rule with #9
  16. f.update_rules(rules, idxs_updated=[i])
  17. Installation
  18. ------------
  19. Requirements
  20. ^^^^^^^^^^^^
  21. apt install libgnutls28-dev python3-dev
  22. Compatibility
  23. -------------
  24. Licence
  25. -------
  26. Authors
  27. -------
  28. `nfoservers-panel` was written by `Boris Bobrov <breton@cynicmansion.ru>`_.