def initialize(self): """initialize this module""" registrar.register_file(self.ifup_routes_filename, "restart-default-route", self) registrar.register_file(self.ifdown_routes_filename, "restart-default-route", self) registrar.register_file(self.rt_tables_filename, "restart-networking", self) registrar.register_file(self.wan_routing_filename, "restart-wan-routing", self) registrar.register_file(self.wan_policy_filename, "restart-wan-manager", self)
def initialize(self): registrar.register_file(self.hosts_filename, None, self) registrar.register_file(self.hostname_filename, "update-hostname", self) registrar.register_file(self.mailname_filename, None, self) registrar.register_file(self.resolv_filename, None, self) registrar.register_file(self.pre_network_hook_filename, "restart-networking", self)
def initialize(self): """initialize this module""" registrar.register_settings_file("settings", self) registrar.register_file(self.ifup_routes_filename, "restart-default-route", self) registrar.register_file(self.ifdown_routes_filename, "restart-default-route", self) registrar.register_file(self.rt_tables_filename, "restart-networking", self) registrar.register_file(self.wan_routing_filename, "restart-wan-routing", self) registrar.register_file(self.wan_manager_filename, "restart-wan-routing", self)
def initialize(self): """initialize this module""" registrar.register_file(self.timezone_setter_filename, "startup-scripts", self) registrar.register_file(self.watchdog_disabler_filename, "startup-scripts", self) registrar.register_file(self.rpfilter_disabler_filename, "startup-scripts", self) registrar.register_file(self.hostname_setter_filename, "startup-scripts", self) registrar.register_file(self.cron_filename, "restart-cron", self)
def initialize(self): registrar.register_file(self.pap_secrets_filename, "restart-networking", self) registrar.register_file(self.chap_secrets_filename, "restart-networking", self) # FIXME registrar.register_file(self.peers_directory + ".*", "restart-networking", self) registrar.register_file(self.pre_network_hook_filename, "restart-networking", self) registrar.register_file(self.ppp_ip_up_filename, "restart-networking", self)
def initialize(self): registrar.register_file(self.enter_hook_filename, "restart-networking", self) registrar.register_file(self.exit_hook_filename, "restart-networking", self) registrar.register_file(self.pre_network_hook_filename, "restart-networking", self) registrar.register_file(self.dhcp_conf_filename, "restart-networking", self) registrar.register_file(self.ddclient_hook_filename, "restart-networking", self)
def initialize(self): registrar.register_file(self.upnp_daemon_conf_filename, "restart-miniupnpd", self) registrar.register_file(self.restart_hook_filename, "restart-miniupnpd", self) registrar.register_file(self.iptables_filename, "restart-iptables", self) registrar.register_file(self.iptables_init_filename, "restart-miniupnpd", self) registrar.register_file(self.ip6tables_init_filename, "restart-miniupnpd", self)
def initialize(self): registrar.register_file(self.ifup_routes_filename, "restart-default-route", self) registrar.register_file(self.ifdown_routes_filename, "restart-default-route", self) registrar.register_file(self.ifup_wan_balancer_filename, "restart-wan-balancer", self) registrar.register_file(self.ifdown_wan_balancer_filename, "restart-wan-balancer", self) registrar.register_file(self.rt_tables_filename, "restart-networking", self)
def initialize(self): """initialize this module""" registrar.register_settings_file("settings", self) registrar.register_file(self.filename_prefix + ".*", "restart-nftables-rules", self) # Update WireGuard defaults self.wireguard_access_rule_template['description'] = re.search(r'^([^{]+)', self.wireguard_description_template).group(1) # Escape brackets for WireGuard description searches. self.wireguard_description_template_regex = self.wireguard_description_template.translate( str.maketrans({ '[': r'\[', ']': r'\]', }))
def initialize(self): try: self.file_uid = pwd.getpwnam("quagga").pw_uid self.file_gid = grp.getgrnam("quagga").gr_gid except Exception as exc: print("quagga user/group missing!") # traceback.print_exc() registrar.register_file(self.daemons_conf_filename, "restart-quagga", self) registrar.register_file(self.zebra_conf_filename, "restart-quagga", self) registrar.register_file(self.bgpd_conf_filename, "restart-quagga", self) registrar.register_file(self.ospfd_conf_filename, "restart-quagga", self) registrar.register_file(self.restart_hook_filename, "restart-quagga", self)
def initialize( self ): # dnsmasq settings, requires dnsmasq restart registrar.register_file( self.dnsmasq_hosts_filename, "restart-dnsmasq", self ) registrar.register_file( self.dnsmasq_conf_filename, "restart-dnsmasq", self ) registrar.register_file( self.dhcp_statics_filename, "restart-dnsmasq", self ) # Just a restart script, no need to restart if changed registrar.register_file( self.restart_hook_filename, None, self )
def validate_settings(self, settings_file): """validates settings""" accounts = settings_file.settings.get('accounts') if accounts is None: return creds = accounts.get('credentials') if creds is None: return for cred in creds: if cred.get("authorizedKeys") is None: continue if cred.get("username") != "admin": continue registrar.register_file("/root/.ssh/authorized_keys", None, self)
def initialize(self): try: file_uid = pwd.getpwnam("quagga").pw_uid file_gid = grp.getgrnam("quagga").gr_gid except Exception as exc: traceback.print_exc() registrar.register_file(self.daemons_conf_filename, "restart-quagga", self) registrar.register_file(self.zebra_conf_filename, "restart-quagga", self) registrar.register_file(self.bgpd_conf_filename, "restart-quagga", self) registrar.register_file(self.ospfd_conf_filename, "restart-quagga", self) registrar.register_file(self.restart_hook_filename, "restart-quagga", self)
def write_authorized_keys(self, dirname, contents, prefix): """Write the script to set the password in /tmp/shadow""" filename = prefix + dirname + "/authorized_keys" file_dir = os.path.dirname(filename) if not os.path.exists(file_dir): os.makedirs(file_dir) registrar.register_file(filename, None, self) file = open(filename, "w+") file.write(contents) file.flush() file.close() os.chmod(filename, stat.S_IWRITE | stat.S_IREAD) # chmod 600 # os.chown(filename, 0, 0) # chown root:root print("AccountsManager: Wrote %s" % filename) return
def initialize(self): registrar.register_settings_file("network", self) try: self.file_uid = pwd.getpwnam("quagga").pw_uid self.file_gid = grp.getgrnam("quagga").gr_gid except Exception as exc: print("quagga user/group missing!") # traceback.print_exc() registrar.register_file(self.daemons_conf_filename, "restart-quagga", self) registrar.register_file(self.zebra_conf_filename, "restart-quagga", self) registrar.register_file(self.bgpd_conf_filename, "restart-quagga", self) registrar.register_file(self.ospfd_conf_filename, "restart-quagga", self) registrar.register_file(self.restart_hook_filename, "restart-quagga", self)
def initialize(self): registrar.register_settings_file("network", self) registrar.register_file(self.config_filename, "restart-ddclient", self) registrar.register_file(self.default_filename, "restart-ddclient", self) registrar.register_file(self.restart_filename, "restart-networking", self)
def initialize(self): registrar.register_file(self.wpasupplicant_conf_filename + ".*", "restart-networking", self) registrar.register_file(self.hostapd_conf_filename + ".*", "restart-networking", self) registrar.register_file(self.crda_default_filename, "restart-networking", self)
def initialize(self): registrar.register_file(self.rt_table_filename, "restart-networking", self) registrar.register_file(self.routes_filename, "restart-networking", self) registrar.register_file(self.pre_routes_filename, "restart-networking", self)
def initialize(self): registrar.register_file(self.keepalived_conf_filename, "restart-keepalived", self) registrar.register_file(self.post_network_hook_filename, "restart-networking", self) registrar.register_file(self.iptables_hook_filename, "restart-iptables", self)
def initialize(self): registrar.register_file(self.interfaces_filename, "restart-networking", self) registrar.register_file(self.interfaces_marks_filename, "restart-iptables", self) registrar.register_file(self.pre_network_hook_filename, "restart-networking", self)
def initialize(self): """ Register settings of interest and our file """ registrar.register_settings_file("wireguard-vpn", self) registrar.register_file(self.wireguard_vpn_conf, "restart-wireguard", self) registrar.register_file(self.wireguard_iptables_script, "restart-iptables", self) ## !! need to remove all files. Maybe rsync instead of cp? registrar.register_file(self.wireguard_remote_conf_dir + "/*", "restart-wireguard", self)
def initialize(self): """initialize this module""" registrar.register_settings_file("settings", self) registrar.register_file(self.timezone_setter_filename, "startup-scripts", self) registrar.register_file(self.watchdog_disabler_filename, "startup-scripts", self) registrar.register_file(self.rpfilter_disabler_filename, "startup-scripts", self) registrar.register_file(self.hostname_setter_filename, "startup-scripts", self) registrar.register_file(self.wizard_status_filename, "restart-pyconnector", self) registrar.register_file(self.reload_system_filename, "startup-scripts", self) registrar.register_file(self.cron_filename, "restart-cron", self) registrar.register_file(self.nic_setter_filename, "restart-nic-setting", self)
def initialize(self): registrar.register_file(self.flush_filename, "restart-iptables", self) registrar.register_file(self.helpers_filename, "restart-iptables", self) registrar.register_file(self.post_network_filename, "restart-networking", self)
def initialize(self): registrar.register_file(self.filename, "restart-networking", self)
def initialize(self): """initialize this module""" registrar.register_settings_file("settings", self) registrar.register_file(self.wireless_filename, "restart-wireless", self)
def initialize(self): registrar.register_file(self.wireless_filename, "restart-wireless", self)
def initialize(self): registrar.register_file(self.ethernet_media_filename, "restart-networking", self)
def initialize(self): registrar.register_file(self.upnp_daemon_conf_filename, "restart-miniupnpd", self) registrar.register_file(self.restart_hook_filename, "restart-miniupnpd", self) registrar.register_file(self.iptables_filename, "restart-iptables", self) registrar.register_file(self.iptables_init_filename, "restart-miniupnpd", self) registrar.register_file(self.ip6tables_init_filename, "restart-miniupnpd", self)
def initialize(self): """initialize this module""" registrar.register_file(self.nat_rules_sys_filename, "restart-nftables-rules", self)
def initialize(self): registrar.register_file(self.kernel_hook_filename, "restart-networking", self)
def initialize(self): """initialize this module""" registrar.register_file(self.filename_prefix + ".*", "restart-nftables-rules", self)
def initialize(self): registrar.register_file(self.rt_table_filename, "restart-networking", self) registrar.register_file(self.routes_filename, "restart-networking", self) registrar.register_file(self.pre_routes_filename, "restart-networking", self)
def initialize(self): registrar.register_file(self.softflow_daemon_conf_filename, "restart-softflowd", self) registrar.register_file(self.restart_hook_filename, "restart-softflowd", self)
def initialize(self): registrar.register_file(self.enter_hook_filename, "restart-networking", self) registrar.register_file(self.exit_hook_filename, "restart-networking", self) registrar.register_file(self.pre_network_hook_filename, "restart-networking", self) registrar.register_file(self.dhcp_conf_filename, "restart-networking", self) registrar.register_file(self.ddclient_hook_filename, "restart-networking", self)
def initialize(self): registrar.register_file(self.flush_filename, "restart-iptables", self) registrar.register_file(self.helpers_filename, "restart-iptables", self) registrar.register_file(self.post_network_filename, "restart-networking", self)
def initialize(self): """initialize this module""" registrar.register_settings_file("settings", self) registrar.register_file(self.bctid_filename, "restart-bctid", self)
def initialize(self): """initialize this module""" registrar.register_file(self.timezone_setter_filename, "startup-scripts", self)
def initialize(self): registrar.register_file(self.qos_rules_sys_filename, "restart-qos", self) pass
def initialize(self): """initialize this module""" registrar.register_file(self.wireless_filename, "restart-wireless", self)
def initialize(self): """initialize this module""" registrar.register_file(self.qos_rules_sys_filename, "restart-nftables-rules", self) registrar.register_file(self.qos_file_path + "/*", "restart-qos", self)
def initialize(self): registrar.register_file(self.hosts_filename, None, self) registrar.register_file(self.hostname_filename, "update-hostname", self) registrar.register_file(self.mailname_filename, None, self) registrar.register_file(self.resolv_filename, None, self) registrar.register_file(self.pre_network_hook_filename, "restart-networking", self)
def initialize(self): registrar.register_file(self.config_filename, "restart-radvd", self) registrar.register_file(self.restart_hook_filename, "restart-networking", self)
def initialize(self): registrar.register_file(self.config_filename, "restart-radvd", self) registrar.register_file(self.restart_hook_filename, "restart-networking", self)
def initialize(self): registrar.register_file(self.iptables_filename, "restart-iptables", self) registrar.register_file(self.admin_filename, "restart-iptables", self)
def initialize(self): registrar.register_settings_file("network", self) registrar.register_file(self.ethernet_media_filename, "restart-networking", self)
def initialize(self): """initialize this module""" registrar.register_file(self.INTERFACE_MARKS_FILENAME, "restart-nftables-rules", self)
def initialize(self): registrar.register_file(self.bypass_rules_filename, "restart-iptables", self)
def initialize(self): """initialize this module""" registrar.register_file(self.filename_prefix + ".*", "restart-nftables-rules", self)
def initialize(self): registrar.register_file(self.pap_secrets_filename, "restart-networking", self) registrar.register_file(self.chap_secrets_filename, "restart-networking", self) # FIXME registrar.register_file(self.peers_directory+".*", "restart-networking", self) registrar.register_file(self.pre_network_hook_filename, "restart-networking", self) registrar.register_file(self.ppp_ip_up_filename, "restart-networking", self)
def initialize(self): registrar.register_file(self.iptables_filename, "restart-iptables", self) registrar.register_file(self.admin_filename, "restart-iptables", self)
def initialize(self): registrar.register_file(self.config_filename, "restart-ddclient", self) registrar.register_file(self.default_filename, "restart-ddclient", self) registrar.register_file(self.restart_filename, "restart-networking", self)