diff --git a/sysutils/api-backup/Makefile b/sysutils/api-backup/Makefile new file mode 100644 index 000000000..abef4dd09 --- /dev/null +++ b/sysutils/api-backup/Makefile @@ -0,0 +1,7 @@ +PLUGIN_NAME= api-backup +PLUGIN_VERSION= 0.0.1 +PLUGIN_COMMENT= Provide the functionality to download the config.xml +PLUGIN_MAINTAINER= franz.fabian.94@gmail.com +PLUGIN_DEVEL= YES + +.include "../../Mk/plugins.mk" diff --git a/sysutils/api-backup/pkg-descr b/sysutils/api-backup/pkg-descr new file mode 100644 index 000000000..578a3db51 --- /dev/null +++ b/sysutils/api-backup/pkg-descr @@ -0,0 +1 @@ +Provide the functionality to download the config.xml \ No newline at end of file diff --git a/sysutils/api-backup/src/opnsense/mvc/app/controllers/OPNsense/Backup/Api/BackupController.php b/sysutils/api-backup/src/opnsense/mvc/app/controllers/OPNsense/Backup/Api/BackupController.php new file mode 100644 index 000000000..cb5b14b79 --- /dev/null +++ b/sysutils/api-backup/src/opnsense/mvc/app/controllers/OPNsense/Backup/Api/BackupController.php @@ -0,0 +1,47 @@ +response->setStatusCode(200, "OK"); + $this->response->setContentType('application/xml', 'UTF-8'); + $this->response->setHeader("Content-Disposition", "attachment; filename=\"config.xml\""); + $data = file_get_contents(self::CONFIG_XML); + $this->response->setContent($data); + } + + public function afterExecuteRoute($dispatcher) + { + $this->response->send(); + } +} \ No newline at end of file diff --git a/sysutils/api-backup/src/opnsense/mvc/app/models/OPNsense/Backup/ACL/ACL.xml b/sysutils/api-backup/src/opnsense/mvc/app/models/OPNsense/Backup/ACL/ACL.xml new file mode 100644 index 000000000..2a1b83765 --- /dev/null +++ b/sysutils/api-backup/src/opnsense/mvc/app/models/OPNsense/Backup/ACL/ACL.xml @@ -0,0 +1,8 @@ + + + Backup API + + api/backup/* + + +