<Directory %DOCUMENTROOT>
Options +FollowSymLinks
RewriteEngine On
+
+ RewriteCond %{REQUEST_URI} ^/index\.php$ [OR]
+ RewriteCond %{REQUEST_URI} ^/$
+ RewriteRule ^(.+)$ /panel? [L]
+
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php/$1 [L]
- RedirectMatch ^/$ /api/?api
+
# Apache 2.2
<IfModule !mod_authz_core.c>
Order Allow,Deny
# From: <Directory %DOCUMENTROOT>
# ...section body...
# </Directory>
- # To: <Location /api/page>
+ # To: <Location /panel>
# ...section body...
# </Location>
#
<Directory %DOCUMENTROOT>
- #<Location /api/page>
+ #<Location /panel>
AuthType Basic
AuthName "Baculum Auth"
AuthUserFile %DOCUMENTROOT/protected/API/Config/baculum.users
#
# Uncomment this line and closing braces below when you use OAuth2
#
-# $HTTP["url"] =~ "^/web/page/.*$" {
+#$HTTP["url"] =~ "^/panel.*$" {
auth.backend = "htpasswd"
auth.backend.htpasswd.userfile = "%DOCUMENTROOT/protected/API/Config/baculum.users"
auth.require = ( "/" => (
"require" => "valid-user"
)
)
-# }
+#}
index-file.names = ( "index.php" )
url.rewrite-once = (
"^/themes/(.+)$" => "/themes/$1",
"^/assets/(.+)$" => "/assets/$1",
- "^/$" => "/index.php/api/page/home/",
+ "^/((index\.php)?\?.+)?$" => "/index.php/panel/",
"^/(.+)$" => "/index.php/$1"
)
<Directory /usr/share/baculum/htdocs>
Options +FollowSymLinks
RewriteEngine On
+
+ RewriteCond %{REQUEST_URI} ^/index\.php$ [OR]
+ RewriteCond %{REQUEST_URI} ^/$
+ RewriteRule ^(.+)$ /panel? [L]
+
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php/$1 [L]
- RedirectMatch ^/$ /api/?api
+
# Apache 2.2
<IfModule !mod_authz_core.c>
Order Allow,Deny
# From: <Directory /usr/share/baculum/htdocs>
# ...section body...
# </Directory>
- # To: <Location /api/page>
+ # To: <Location /panel>
# ...section body...
# </Location>
#
<Directory /usr/share/baculum/htdocs>
- #<Location /api/page>
+ #<Location /panel>
AuthType Basic
AuthName "Baculum Auth"
AuthUserFile /usr/share/baculum/htdocs/protected/API/Config/baculum.users
#
# Uncomment this line and closing braces below when you use OAuth2
#
-# $HTTP["url"] =~ "^/web/page/.*$" {
+#$HTTP["url"] =~ "^/panel.*$" {
auth.backend = "htpasswd"
auth.backend.htpasswd.userfile = "/usr/share/baculum/htdocs/protected/API/Config/baculum.users"
auth.require = ( "/" => (
"require" => "valid-user"
)
)
-# }
+#}
index-file.names = ( "index.php" )
url.rewrite-once = (
"^/themes/(.+)$" => "/themes/$1",
"^/assets/(.+)$" => "/assets/$1",
- "^/$" => "/index.php/api/page/home/",
+ "^/((index\.php)?\?.+)?$" => "/index.php/panel/",
"^/(.+)$" => "/index.php/$1"
)
<Directory %DOCUMENTROOT>
Options +FollowSymLinks
RewriteEngine On
+
+ RewriteCond %{REQUEST_URI} ^/index\.php$ [OR]
+ RewriteCond %{REQUEST_URI} ^/$
+ RewriteRule ^(.+)$ /panel? [L]
+
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php/$1 [L]
- RedirectMatch ^/$ /api/?api
+
# Apache 2.2
<IfModule !mod_authz_core.c>
Order Allow,Deny
# From: <Directory %DOCUMENTROOT>
# ...section body...
# </Directory>
- # To: <Location /api/page>
+ # To: <Location /panel>
# ...section body...
# </Location>
#
<Directory %DOCUMENTROOT>
- #<Location /api/page>
+ #<Location /panel>
AuthType Basic
AuthName "Baculum Auth"
AuthUserFile %DOCUMENTROOT/protected/API/Config/baculum.users
#
# Uncomment this line and closing braces below when you use OAuth2
#
-# $HTTP["url"] =~ "^/web/page/.*$" {
+#$HTTP["url"] =~ "^/panel.*$" {
auth.backend = "htpasswd"
auth.backend.htpasswd.userfile = "%DOCUMENTROOT/protected/API/Config/baculum.users"
auth.require = ( "/" => (
"require" => "valid-user"
)
)
-# }
+#}
index-file.names = ( "index.php" )
url.rewrite-once = (
"^/themes/(.+)$" => "/themes/$1",
"^/assets/(.+)$" => "/assets/$1",
- "^/$" => "/index.php/api/page/home/",
+ "^/((index\.php)?\?.+)?$" => "/index.php/panel/",
"^/(.+)$" => "/index.php/$1"
)
<Directory /usr/share/baculum/htdocs>
Options +FollowSymLinks
RewriteEngine On
+
+ RewriteCond %{REQUEST_URI} ^/index\.php$ [OR]
+ RewriteCond %{REQUEST_URI} ^/$
+ RewriteRule ^(.+)$ /panel? [L]
+
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php/$1 [L]
- RedirectMatch ^/$ /api/?api
+
# Apache 2.2
<IfModule !mod_authz_core.c>
Order Allow,Deny
# From: <Directory /usr/share/baculum/htdocs>
# ...section body...
# </Directory>
- # To: <Location /api/page>
+ # To: <Location /panel>
# ...section body...
# </Location>
#
<Directory /usr/share/baculum/htdocs>
- #<Location /api/page>
+ #<Location /panel>
AuthType Basic
AuthName "Baculum Auth"
AuthUserFile /usr/share/baculum/htdocs/protected/API/Config/baculum.users
#
# Uncomment this line and closing braces below when you use OAuth2
#
-# $HTTP["url"] =~ "^/web/page/.*$" {
+#$HTTP["url"] =~ "^/panel.*$" {
auth.backend = "htpasswd"
auth.backend.htpasswd.userfile = "/usr/share/baculum/htdocs/protected/API/Config/baculum.users"
auth.require = ( "/" => (
"require" => "valid-user"
)
)
-# }
+#}
index-file.names = ( "index.php" )
url.rewrite-once = (
"^/themes/(.+)$" => "/themes/$1",
"^/assets/(.+)$" => "/assets/$1",
- "^/$" => "/index.php/api/page/home/",
+ "^/((index\.php)?\?.+)?$" => "/index.php/panel/",
"^/(.+)$" => "/index.php/$1"
)
* Bacula(R) - The Network Backup Solution
* Baculum - Bacula web interface
*
- * Copyright (C) 2013-2017 Kern Sibbald
+ * Copyright (C) 2013-2019 Kern Sibbald
*
* The main author of Baculum is Marcin Haba.
* The original author of Bacula is Kern Sibbald, with contributions
$error['state'] = $state;
}
+ header('Content-Type: application/json');
header($header);
echo json_encode($error);
exit();
* Bacula(R) - The Network Backup Solution
* Baculum - Bacula web interface
*
- * Copyright (C) 2013-2017 Kern Sibbald
+ * Copyright (C) 2013-2019 Kern Sibbald
*
* The main author of Baculum is Marcin Haba.
* The original author of Bacula is Kern Sibbald, with contributions
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.BaculumAPIPage');
+Prado::using('System.Web.TUrlMapping');
-class MainPage extends BaculumAPIPage {
+class OAuthUrlMapping extends TUrlMappingPattern {
- public $auth_params;
+ const SERVICE_ID = 'oauth';
- public function onInit($param) {
- parent::onInit($param);
- $url = $this->getRequest()->getUrl()->getPath();
- $params = explode('/', $url);
- if ($url === '/' || (count($params) === 3 && $params[1] === 'api') || (count($params) >= 3 && $params[2] === 'page')) {
- $this->goToPage('Panel.APIHome');
- } else {
- $this->goToPage('API.Welcome');
- }
+ public function __construct(BaculumUrlMapping $manager) {
+ parent::__construct($manager);
+ $this->setServiceID(self::SERVICE_ID);
}
}
?>
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2019 Kern Sibbald
+ *
+ * The main author of Baculum is Marcin Haba.
+ * The original author of Bacula is Kern Sibbald, with contributions
+ * from many others, a complete list can be found in the file AUTHORS.
+ *
+ * You may use this file and others of this release according to the
+ * license defined in the LICENSE file, which includes the Affero General
+ * Public License, v3.0 ("AGPLv3") and some additional permissions and
+ * terms pursuant to its AGPLv3 Section 7.
+ *
+ * This notice must be preserved when any source code is
+ * conveyed and/or propagated.
+ *
+ * Bacula(R) is a registered trademark of Kern Sibbald.
+ */
+
+Prado::using('System.Web.TUrlMapping');
+
+class PanelUrlMapping extends TUrlMappingPattern {
+
+ const SERVICE_ID = 'panel';
+
+ public function __construct(BaculumUrlMapping $manager) {
+ parent::__construct($manager);
+ $this->setServiceID(self::SERVICE_ID);
+ }
+}
+?>
<configuration>
<paths>
- <using namespace="System.I18N.*" />
<using namespace="Application.API.Class.BaculumAPIServer" />
</paths>
<modules>
+ <!-- auth modules -->
+ <module id="oauth2_token" class="Application.API.Class.OAuth2.TokenManager" />
<!-- database modules -->
<module id="db" class="Application.API.Class.Database" />
<module id="client" class="Application.API.Class.ClientManager" />
<module id="api_config" class="Application.API.Class.APIConfig" />
<module id="bacula_config" class="Application.API.Class.BaculaConfig" />
<module id="bacula_setting" class="Application.API.Class.BaculaSetting" />
- <!-- internalization modules -->
- <module id="globalization" class="TGlobalization">
- <translation type="gettext" source="Application.API.Lang" marker="@@" autosave="false" cache="false" DefaultCulture="en" />
- </module>
<!-- logging modules -->
<module id="log" class="System.Util.TLogRouter">
<route class="TFileLogRoute" Categories="Execute, External, Application, General, Security" LogPath="Application.API.Logs" LogFile="baculum-api.log" MaxFileSize="1000" MaxLogFiles="5" />
</module>
- <!-- auth modules -->
- <module id="basic_apiuser" class="Application.API.Class.BasicAPIUserConfig" />
- <module id="oauth2" class="Application.API.Class.OAuth2.BaculumOAuth2" />
- <module id="oauth2_config" class="Application.API.Class.OAuth2.OAuth2Config" />
- <module id="oauth2_authid" class="Application.API.Class.OAuth2.AuthIdManager" />
- <module id="oauth2_token" class="Application.API.Class.OAuth2.TokenManager" />
<!-- component status modules -->
<module id="status_dir" class="Application.API.Class.StatusDirector" />
<module id="status_sd" class="Application.API.Class.StatusStorage" />
--- /dev/null
+<urls>
+ <!-- #### NEW API version 1 #### -->
+ <!-- general endpoint -->
+ <url ServiceParameter="Welcome" pattern="api/v1/welcome/" />
+ <!-- bconsole endpoints -->
+ <url ServiceParameter="ConsoleCommand" pattern="api/v1/console/" />
+ <!-- database endpoints -->
+ <url ServiceParameter="Catalog" pattern="api/v1/catalog/" />
+ <url ServiceParameter="DbSize" pattern="api/v1/dbsize/" />
+ <!-- director endpoints -->
+ <url ServiceParameter="Directors" pattern="api/v1/directors/" />
+ <!-- clients (file daemons) endpoints -->
+ <url ServiceParameter="Clients" pattern="api/v1/clients/" />
+ <url ServiceParameter="Client" pattern="api/v1/clients/{id}/" parameters.id="\d+" />
+ <url ServiceParameter="ClientsShow" pattern="api/v1/clients/show/" />
+ <url ServiceParameter="ClientShow" pattern="api/v1/clients/{id}/show/" parameters.id="\d+" />
+ <url ServiceParameter="ClientStatus" pattern="api/v1/clients/{id}/status/" parameters.id="\d+" />
+ <url ServiceParameter="JobsForClient" pattern="api/v1/clients/{id}/jobs/" parameters.id="\d+" />
+ <url ServiceParameter="ClientLs" pattern="api/v1/clients/{id}/ls/" parameters.id="\d+" />
+ <!-- storages (storage daemons) endpoints -->
+ <url ServiceParameter="Storages" pattern="api/v1/storages/" />
+ <url ServiceParameter="Storage" pattern="api/v1/storages/{id}/" parameters.id="\d+" />
+ <url ServiceParameter="StoragesShow" pattern="api/v1/storages/show/" />
+ <url ServiceParameter="StorageShow" pattern="api/v1/storages/{id}/show/" parameters.id="\d+" />
+ <url ServiceParameter="StorageStatus" pattern="api/v1/storages/{id}/status/" parameters.id="\d+" />
+ <url ServiceParameter="StorageMount" pattern="api/v1/storages/{id}/mount/" parameters.id="\d+" />
+ <url ServiceParameter="StorageUmount" pattern="api/v1/storages/{id}/umount/" parameters.id="\d+" />
+ <url ServiceParameter="StorageRelease" pattern="api/v1/storages/{id}/release/" parameters.id="\d+" />
+ <!-- volumes (media) endpoints-->
+ <url ServiceParameter="Volumes" pattern="api/v1/volumes/" />
+ <url ServiceParameter="Volume" pattern="api/v1/volumes/{id}/" parameters.id="\d+" />
+ <url ServiceParameter="VolumePrune" pattern="api/v1/volumes/{id}/prune/" parameters.id="\d+" />
+ <url ServiceParameter="VolumePurge" pattern="api/v1/volumes/{id}/purge/" parameters.id="\d+" />
+ <url ServiceParameter="VolumesRequired" pattern="api/v1/volumes/required/{jobid}/{fileid}/" parameters.jobid="\d+" parameters.fileid="\d+" />
+ <url ServiceParameter="JobsOnVolume" pattern="api/v1/volumes/{id}/jobs/" parameters.id="\d+" />
+ <url ServiceParameter="VolumeLabel" pattern="api/v1/volumes/label/" />
+ <url ServiceParameter="VolumeLabelBarcodes" pattern="api/v1/volumes/label/barcodes/" />
+ <url ServiceParameter="SlotsUpdate" pattern="api/v1/volumes/update/" />
+ <url ServiceParameter="SlotsUpdate" pattern="api/v1/volumes/update/{barcodes}/" parameters.barcodes="barcodes" />
+ <!-- pools endpoints -->
+ <url ServiceParameter="Pools" pattern="api/v1/pools/" />
+ <url ServiceParameter="Pool" pattern="api/v1/pools/{id}/" parameters.id="\d+" />
+ <url ServiceParameter="VolumesInPool" pattern="api/v1/pools/{id}/volumes/" parameters.id="\d+" />
+ <url ServiceParameter="PoolUpdate" pattern="api/v1/pools/{id}/update/" parameters.id="\d+" />
+ <url ServiceParameter="PoolUpdateVolumes" pattern="api/v1/pools/{id}/update/volumes/" parameters.id="\d+" />
+ <url ServiceParameter="PoolsShow" pattern="api/v1/pools/show/" />
+ <url ServiceParameter="PoolShow" pattern="api/v1/pools/{id}/show/" parameters.id="\d+" />
+ <!-- jobs endpoints-->
+ <url ServiceParameter="Jobs" pattern="api/v1/jobs/" />
+ <url ServiceParameter="Job" pattern="api/v1/jobs/{id}/" parameters.id="\d+" />
+ <url ServiceParameter="JobResNames" pattern="api/v1/jobs/resnames/" />
+ <url ServiceParameter="JobsShow" pattern="api/v1/jobs/show/" />
+ <url ServiceParameter="JobShow" pattern="api/v1/jobs/{id}/show/" parameters.id="\d+" />
+ <url ServiceParameter="JobsRecent" pattern="api/v1/jobs/recent/{name}/" parameters.name="[a-zA-Z0-9:.\-_ ]+" />
+ <url ServiceParameter="JobEstimate" pattern="api/v1/jobs/estimate/" />
+ <url ServiceParameter="JobRun" pattern="api/v1/jobs/run/" />
+ <url ServiceParameter="JobCancel" pattern="api/v1/jobs/{id}/cancel/" parameters.id="\d+"/>
+ <url ServiceParameter="JobTotals" pattern="api/v1/jobs/totals/" />
+ <url ServiceParameter="RestoreRun" pattern="api/v1/jobs/restore/" />
+ <!-- bvfs endpoints-->
+ <url ServiceParameter="BVFSUpdate" pattern="api/v1/bvfs/update/" />
+ <url ServiceParameter="BVFSLsDirs" pattern="api/v1/bvfs/lsdirs/" />
+ <url ServiceParameter="BVFSLsFiles" pattern="api/v1/bvfs/lsfiles/" />
+ <url ServiceParameter="BVFSVersions" pattern="api/v1/bvfs/versions/" />
+ <url ServiceParameter="BVFSGetJobids" pattern="api/v1/bvfs/getjobids/" />
+ <url ServiceParameter="BVFSRestore" pattern="api/v1/bvfs/restore/" />
+ <url ServiceParameter="BVFSClearCache" pattern="api/v1/bvfs/clear/" />
+ <url ServiceParameter="BVFSCleanUp" pattern="api/v1/bvfs/cleanup/" />
+ <!-- joblog endpoints -->
+ <url ServiceParameter="JobLog" pattern="api/v1/joblog/{id}/" parameters.id="\d+" />
+ <!-- fileset endpoints -->
+ <url ServiceParameter="FileSets" pattern="api/v1/filesets/" />
+ <url ServiceParameter="FileSet" pattern="api/v1/filesets/{id}/" parameters.id="\d+" />
+ <url ServiceParameter="FileSetResNames" pattern="api/v1/filesets/resnames/" />
+ <!-- schedule endpoints -->
+ <url ServiceParameter="Schedules" pattern="api/v1/schedules/resnames/" />
+ <url ServiceParameter="ScheduleStatus" pattern="api/v1/schedules/status/" />
+ <!-- Bacula config module endpoints -->
+ <url ServiceParameter="Config" pattern="api/v1/config/" />
+ <url ServiceParameter="Config" pattern="api/v1/config/{component_type}/" parameters.component_type="[a-z]+" />
+ <url ServiceParameter="Config" pattern="api/v1/config/{component_type}/{resource_type}/" parameters.component_type="[a-z]+" parameters.resource_type="[a-zA-Z]+" />
+ <url ServiceParameter="Config" pattern="api/v1/config/{component_type}/{resource_type}/{resource_name}/" parameters.component_type="[a-z]+" parameters.resource_type="[a-zA-Z]+" parameters.resource_name="[a-zA-Z0-9:.\-_ ]+" />
+ <!-- component status endpoints -->
+ <url ServiceParameter="ComponentStatus" pattern="api/v1/status/{component}/" parameters.component="(director|storage|client)" />
+ <!-- actions endpoints -->
+ <url ServiceParameter="Actions" pattern="api/v1/actions/{component}/{action}/" parameters.component="(director|storage|client)" parameters.action="(start|stop|restart)" />
+</urls>
--- /dev/null
+<configuration>
+ <paths>
+ <using namespace="Application.API.Class.BaculumAPIServer" />
+ </paths>
+ <modules>
+ <!-- auth modules -->
+ <module id="oauth2" class="Application.API.Class.OAuth2.BaculumOAuth2" />
+ <module id="oauth2_config" class="Application.API.Class.OAuth2.OAuth2Config" />
+ <module id="oauth2_authid" class="Application.API.Class.OAuth2.AuthIdManager" />
+ <module id="oauth2_token" class="Application.API.Class.OAuth2.TokenManager" />
+ <!-- config modules -->
+ <module id="api_config" class="Application.API.Class.APIConfig" />
+ </modules>
+</configuration>
--- /dev/null
+<urls>
+ <!-- OAuth2 -->
+ <url ServiceParameter="Authorize" pattern="oauth/authorize/" />
+ <url ServiceParameter="RequestToken" pattern="oauth/token/" />
+</urls>
<%@ MasterClass="Application.API.Layouts.Main" Theme="Baculum-v1"%>
<com:TContent ID="Main">
<com:BClientScript ScriptUrl=<%~ ../../JavaScript/misc.js %> />
- <h3 style="clear: left"><%[ Welcome on the Baculum API default page ]%> <input type="button" class="bbutton" onclick="window.location.href='<%=$this->getService()->constructUrl('Panel.APIInstallWizard')%>'" value="<%[ Go to configuration wizard ]%>" style="float: right" /></h3>
+ <h3 style="clear: left"><%[ Welcome on the Baculum API default page ]%> <input type="button" class="bbutton" onclick="window.location.href='<%=$this->getService()->constructUrl('APIInstallWizard')%>'" value="<%[ Go to configuration wizard ]%>" style="float: right" /></h3>
<div id="tabs">
<ul>
<li><a href="#tab1"><%[ Baculum API Client ]%></a></li>
return;
}
this.set_progress(1, 'Sending auth code request...');
- var authorization_uri = document.location.origin + '/api/auth';
+ var authorization_uri = document.location.origin + '/oauth/authorize';
var auth_params = {
response_type: 'code',
client_id: this.baculum_auth.client_id,
},
send_token_request: function(code) {
this.set_progress(2, 'Sending token request...');
- var uri = document.location.origin + '/api/token';
+ var uri = document.location.origin + '/oauth/token';
var auth_params = {
grant_type: 'authorization_code',
code: code,
--- /dev/null
+<configuration>
+ <paths>
+ <using namespace="System.I18N.*" />
+ </paths>
+ <modules>
+ <!-- database modules -->
+ <module id="db" class="Application.API.Class.Database" />
+ <!-- tools modules -->
+ <module id="bconsole" class="Application.API.Class.Bconsole" />
+ <module id="json_tools" class="Application.API.Class.JSONTools" />
+ <!-- config modules -->
+ <module id="api_config" class="Application.API.Class.APIConfig" />
+ <!-- internalization modules -->
+ <module id="globalization" class="TGlobalization">
+ <translation type="gettext" source="Application.API.Lang" marker="@@" autosave="false" cache="false" DefaultCulture="en" />
+ </module>
+ <!-- logging modules -->
+ <module id="log" class="System.Util.TLogRouter">
+ <route class="TFileLogRoute" Categories="Execute, External, Application, General, Security" LogPath="Application.API.Logs" LogFile="baculum-api.log" MaxFileSize="1000" MaxLogFiles="5" />
+ </module>
+ <!-- auth modules -->
+ <module id="basic_apiuser" class="Application.API.Class.BasicAPIUserConfig" />
+ <module id="oauth2_config" class="Application.API.Class.OAuth2.OAuth2Config" />
+ <!-- component actions modules -->
+ <module id="comp_actions" class="Application.API.Class.ComponentActions" />
+ </modules>
+</configuration>
--- /dev/null
+<urls>
+ <!-- Pages -->
+ <url ServiceParameter="APIInstallWizard" pattern="panel/config/" />
+ <url ServiceParameter="APIHome" pattern="panel/" />
+</urls>
+++ /dev/null
-<urls>
- <!-- Pages -->
- <url ServiceParameter="Panel.APIInstallWizard" pattern="api/page/config/" />
- <url ServiceParameter="Panel.APIHome" pattern="api/page/home/" />
- <url ServiceParameter="Panel.MainPage" pattern="api/page/" />
- <!-- OAuth2 -->
- <url ServiceParameter="OAuth2.Authorize" pattern="api/auth/" />
- <url ServiceParameter="OAuth2.RequestToken" pattern="api/token/" />
-
-
- <!-- #### NEW API version 1 #### -->
- <!-- general endpoint -->
- <url ServiceParameter="API.Welcome" pattern="api/v1/welcome/" />
- <!-- bconsole endpoints -->
- <url ServiceParameter="API.ConsoleCommand" pattern="api/v1/console/" />
- <!-- database endpoints -->
- <url ServiceParameter="API.Catalog" pattern="api/v1/catalog/" />
- <url ServiceParameter="API.DbSize" pattern="api/v1/dbsize/" />
- <!-- director endpoints -->
- <url ServiceParameter="API.Directors" pattern="api/v1/directors/" />
- <!-- clients (file daemons) endpoints -->
- <url ServiceParameter="API.Clients" pattern="api/v1/clients/" />
- <url ServiceParameter="API.Client" pattern="api/v1/clients/{id}/" parameters.id="\d+" />
- <url ServiceParameter="API.ClientsShow" pattern="api/v1/clients/show/" />
- <url ServiceParameter="API.ClientShow" pattern="api/v1/clients/{id}/show/" parameters.id="\d+" />
- <url ServiceParameter="API.ClientStatus" pattern="api/v1/clients/{id}/status/" parameters.id="\d+" />
- <url ServiceParameter="API.JobsForClient" pattern="api/v1/clients/{id}/jobs/" parameters.id="\d+" />
- <url ServiceParameter="API.ClientLs" pattern="api/v1/clients/{id}/ls/" parameters.id="\d+" />
- <!-- storages (storage daemons) endpoints -->
- <url ServiceParameter="API.Storages" pattern="api/v1/storages/" />
- <url ServiceParameter="API.Storage" pattern="api/v1/storages/{id}/" parameters.id="\d+" />
- <url ServiceParameter="API.StoragesShow" pattern="api/v1/storages/show/" />
- <url ServiceParameter="API.StorageShow" pattern="api/v1/storages/{id}/show/" parameters.id="\d+" />
- <url ServiceParameter="API.StorageStatus" pattern="api/v1/storages/{id}/status/" parameters.id="\d+" />
- <url ServiceParameter="API.StorageMount" pattern="api/v1/storages/{id}/mount/" parameters.id="\d+" />
- <url ServiceParameter="API.StorageUmount" pattern="api/v1/storages/{id}/umount/" parameters.id="\d+" />
- <url ServiceParameter="API.StorageRelease" pattern="api/v1/storages/{id}/release/" parameters.id="\d+" />
- <!-- volumes (media) endpoints-->
- <url ServiceParameter="API.Volumes" pattern="api/v1/volumes/" />
- <url ServiceParameter="API.Volume" pattern="api/v1/volumes/{id}/" parameters.id="\d+" />
- <url ServiceParameter="API.VolumePrune" pattern="api/v1/volumes/{id}/prune/" parameters.id="\d+" />
- <url ServiceParameter="API.VolumePurge" pattern="api/v1/volumes/{id}/purge/" parameters.id="\d+" />
- <url ServiceParameter="API.VolumesRequired" pattern="api/v1/volumes/required/{jobid}/{fileid}/" parameters.jobid="\d+" parameters.fileid="\d+" />
- <url ServiceParameter="API.JobsOnVolume" pattern="api/v1/volumes/{id}/jobs/" parameters.id="\d+" />
- <url ServiceParameter="API.VolumeLabel" pattern="api/v1/volumes/label/" />
- <url ServiceParameter="API.VolumeLabelBarcodes" pattern="api/v1/volumes/label/barcodes/" />
- <url ServiceParameter="API.SlotsUpdate" pattern="api/v1/volumes/update/" />
- <url ServiceParameter="API.SlotsUpdate" pattern="api/v1/volumes/update/{barcodes}/" parameters.barcodes="barcodes" />
- <!-- pools endpoints -->
- <url ServiceParameter="API.Pools" pattern="api/v1/pools/" />
- <url ServiceParameter="API.Pool" pattern="api/v1/pools/{id}/" parameters.id="\d+" />
- <url ServiceParameter="API.VolumesInPool" pattern="api/v1/pools/{id}/volumes/" parameters.id="\d+" />
- <url ServiceParameter="API.PoolUpdate" pattern="api/v1/pools/{id}/update/" parameters.id="\d+" />
- <url ServiceParameter="API.PoolUpdateVolumes" pattern="api/v1/pools/{id}/update/volumes/" parameters.id="\d+" />
- <url ServiceParameter="API.PoolsShow" pattern="api/v1/pools/show/" />
- <url ServiceParameter="API.PoolShow" pattern="api/v1/pools/{id}/show/" parameters.id="\d+" />
- <!-- jobs endpoints-->
- <url ServiceParameter="API.Jobs" pattern="api/v1/jobs/" />
- <url ServiceParameter="API.Job" pattern="api/v1/jobs/{id}/" parameters.id="\d+" />
- <url ServiceParameter="API.JobResNames" pattern="api/v1/jobs/resnames/" />
- <url ServiceParameter="API.JobsShow" pattern="api/v1/jobs/show/" />
- <url ServiceParameter="API.JobShow" pattern="api/v1/jobs/{id}/show/" parameters.id="\d+" />
- <url ServiceParameter="API.JobsRecent" pattern="api/v1/jobs/recent/{name}/" parameters.name="[a-zA-Z0-9:.\-_ ]+" />
- <url ServiceParameter="API.JobEstimate" pattern="api/v1/jobs/estimate/" />
- <url ServiceParameter="API.JobRun" pattern="api/v1/jobs/run/" />
- <url ServiceParameter="API.JobCancel" pattern="api/v1/jobs/{id}/cancel/" parameters.id="\d+"/>
- <url ServiceParameter="API.JobTotals" pattern="api/v1/jobs/totals/" />
- <url ServiceParameter="API.RestoreRun" pattern="api/v1/jobs/restore/" />
- <!-- bvfs endpoints-->
- <url ServiceParameter="API.BVFSUpdate" pattern="api/v1/bvfs/update/" />
- <url ServiceParameter="API.BVFSLsDirs" pattern="api/v1/bvfs/lsdirs/" />
- <url ServiceParameter="API.BVFSLsFiles" pattern="api/v1/bvfs/lsfiles/" />
- <url ServiceParameter="API.BVFSVersions" pattern="api/v1/bvfs/versions/" />
- <url ServiceParameter="API.BVFSGetJobids" pattern="api/v1/bvfs/getjobids/" />
- <url ServiceParameter="API.BVFSRestore" pattern="api/v1/bvfs/restore/" />
- <url ServiceParameter="API.BVFSClearCache" pattern="api/v1/bvfs/clear/" />
- <url ServiceParameter="API.BVFSCleanUp" pattern="api/v1/bvfs/cleanup/" />
- <!-- joblog endpoints -->
- <url ServiceParameter="API.JobLog" pattern="api/v1/joblog/{id}/" parameters.id="\d+" />
- <!-- fileset endpoints -->
- <url ServiceParameter="API.FileSets" pattern="api/v1/filesets/" />
- <url ServiceParameter="API.FileSet" pattern="api/v1/filesets/{id}/" parameters.id="\d+" />
- <url ServiceParameter="API.FileSetResNames" pattern="api/v1/filesets/resnames/" />
- <!-- schedule endpoints -->
- <url ServiceParameter="API.Schedules" pattern="api/v1/schedules/resnames/" />
- <url ServiceParameter="API.ScheduleStatus" pattern="api/v1/schedules/status/" />
- <!-- Bacula config module endpoints -->
- <url ServiceParameter="API.Config" pattern="api/v1/config/" />
- <url ServiceParameter="API.Config" pattern="api/v1/config/{component_type}/" parameters.component_type="[a-z]+" />
- <url ServiceParameter="API.Config" pattern="api/v1/config/{component_type}/{resource_type}/" parameters.component_type="[a-z]+" parameters.resource_type="[a-zA-Z]+" />
- <url ServiceParameter="API.Config" pattern="api/v1/config/{component_type}/{resource_type}/{resource_name}/" parameters.component_type="[a-z]+" parameters.resource_type="[a-zA-Z]+" parameters.resource_name="[a-zA-Z0-9:.\-_ ]+" />
- <!-- component status endpoints -->
- <url ServiceParameter="API.ComponentStatus" pattern="api/v1/status/{component}/" parameters.component="(director|storage|client)" />
- <!-- actions endpoints -->
- <url ServiceParameter="API.Actions" pattern="api/v1/actions/{component}/{action}/" parameters.component="(director|storage|client)" parameters.action="(start|stop|restart)" />
-
-
-
- <!-- #### OLD API (deprecated) #### -->
- <!-- general endpoint -->
- <url ServiceParameter="API.Welcome" pattern="api/welcome/" />
- <!-- bconsole endpoints -->
- <url ServiceParameter="API.ConsoleCommand" pattern="api/console/" />
- <!-- database endpoints -->
- <url ServiceParameter="API.Catalog" pattern="api/catalog/" />
- <url ServiceParameter="API.DbSize" pattern="api/dbsize/" />
- <!-- director endpoints -->
- <url ServiceParameter="API.Directors" pattern="api/directors/" />
- <!-- clients (file daemons) endpoints -->
- <url ServiceParameter="API.Clients" pattern="api/clients/" />
- <url ServiceParameter="API.Client" pattern="api/clients/{id}/" parameters.id="\d+" />
- <url ServiceParameter="API.Clients" pattern="api/clients/limit/{limit}/" parameters.limit="\d+" />
- <url ServiceParameter="API.ClientsShow" pattern="api/clients/show/" />
- <url ServiceParameter="API.ClientShow" pattern="api/clients/show/{id}/" parameters.id="\d+" />
- <url ServiceParameter="API.ClientStatus" pattern="api/clients/status/{id}/" parameters.id="\d+" />
- <url ServiceParameter="API.JobsForClient" pattern="api/clients/jobs/{id}/" parameters.id="\d+" />
- <!-- storages (storage daemons) endpoints -->
- <url ServiceParameter="API.Storages" pattern="api/storages/" />
- <url ServiceParameter="API.Storage" pattern="api/storages/{id}/" parameters.id="\d+" />
- <url ServiceParameter="API.Storage" pattern="api/storages/{name}/" parameters.name="[a-zA-Z0-9:.\-_ ]+" />
- <url ServiceParameter="API.Storages" pattern="api/storages/limit/{limit}/" parameters.limit="\d+" />
- <url ServiceParameter="API.StoragesShow" pattern="api/storages/show/" />
- <url ServiceParameter="API.StorageShow" pattern="api/storages/show/{id}/" parameters.id="\d+" />
- <url ServiceParameter="API.StorageStatus" pattern="api/storages/status/{id}/" parameters.id="\d+" />
- <url ServiceParameter="API.StorageMount" pattern="api/storages/mount/{id}/{drive}/{slot}/" parameters.id="\d+" parameters.drive="\d+" parameters.slot="\d+" />
- <url ServiceParameter="API.StorageMount" pattern="api/storages/mount/{id}/{device}/{slot}/" parameters.id="\d+" parameters.device="[a-zA-Z0-9:.\-_ ]+" parameters.slot="\d+" />
- <url ServiceParameter="API.StorageUmount" pattern="api/storages/umount/{id}/{drive}/" parameters.id="\d+" parameters.drive="\d+" />
- <url ServiceParameter="API.StorageUmount" pattern="api/storages/umount/{id}/{device}/" parameters.id="\d+" parameters.device="[a-zA-Z0-9:.\-_ ]+" />
- <url ServiceParameter="API.StorageRelease" pattern="api/storages/release/{id}/{drive}/" parameters.id="\d+" parameters.drive="\d+" />
- <url ServiceParameter="API.StorageRelease" pattern="api/storages/release/{id}/{device}/" parameters.id="\d+" parameters.device="[a-zA-Z0-9:.\-_ ]+" />
- <!-- volumes (media) endpoints-->
- <url ServiceParameter="API.Volumes" pattern="api/volumes/" />
- <url ServiceParameter="API.Volumes" pattern="api/volumes/limit/{limit}/" parameters.limit="\d+" />
- <url ServiceParameter="API.Volume" pattern="api/volumes/{id}/" parameters.id="\d+" />
- <url ServiceParameter="API.VolumePrune" pattern="api/volumes/prune/{id}/" parameters.id="\d+" />
- <url ServiceParameter="API.VolumePurge" pattern="api/volumes/purge/{id}/" parameters.id="\d+" />
- <url ServiceParameter="API.VolumesRequired" pattern="api/volumes/required/{jobid}/{fileid}/" parameters.jobid="\d+" parameters.fileid="\d+" />
- <url ServiceParameter="API.JobsOnVolume" pattern="api/volumes/jobs/{id}/" parameters.id="\d+" />
- <!-- pools endpoints -->
- <url ServiceParameter="API.Pools" pattern="api/pools/" />
- <url ServiceParameter="API.Pool" pattern="api/pools/{id}/" parameters.id="\d+" />
- <url ServiceParameter="API.Pool" pattern="api/pools/{name}/" parameters.name="[a-zA-Z0-9:.\-_ ]+" />
- <url ServiceParameter="API.VolumesInPool" pattern="api/pools/{poolid}/volumes/" parameters.poolid="\d+" />
- <url ServiceParameter="API.Pools" pattern="api/pools/limit/{limit}/" parameters.limit="\d+" />
- <url ServiceParameter="API.PoolUpdate" pattern="api/pools/update/{id}/" parameters.id="\d+" />
- <url ServiceParameter="API.PoolUpdateVolumes" pattern="api/pools/update/volumes/{id}/" parameters.id="\d+" />
- <url ServiceParameter="API.PoolsShow" pattern="api/pools/show/" />
- <url ServiceParameter="API.PoolShow" pattern="api/pools/show/{id}/" parameters.id="\d+" />
- <!-- jobs endpoints-->
- <url ServiceParameter="API.Jobs" pattern="api/jobs/" />
- <url ServiceParameter="API.Jobs" pattern="api/jobs/jobstatus/{jobstatus}/" parameters.jobstatus="[a-zA-Z]+" />
- <url ServiceParameter="API.JobResNames" pattern="api/jobs/tasks/" />
- <url ServiceParameter="API.JobResNames" pattern="api/jobs/tasks/type/{type}" parameters.type="[a-zA-Z]" />
- <url ServiceParameter="API.JobResNames" pattern="api/jobs/tasks/type/{type}/limit/{limit}/" parameters.type="[a-zA-Z]" parameters.limit="\d+" />
- <url ServiceParameter="API.JobResNames" pattern="api/jobs/tasks/limit/{limit}/" parameters.limit="\d+" />
- <url ServiceParameter="API.Job" pattern="api/jobs/{id}/" parameters.id="\d+" />
- <url ServiceParameter="API.Jobs" pattern="api/jobs/limit/{limit}/" parameters.limit="\d+" />
- <url ServiceParameter="API.JobsRecent" pattern="api/jobs/recent/{name}/client/{client}/filesetid/{filesetid}/" parameters.name="[a-zA-Z0-9:.\-_ ]+" parameters.client="[a-zA-Z0-9:.\-_ ]+" parameters.filesetid="\d+" />
- <url ServiceParameter="API.JobsRecent" pattern="api/jobs/recent/{name}/clientid/{clientid}/filesetid/{filesetid}/" parameters.name="[a-zA-Z0-9:.\-_ ]+" parameters.clientid="\d+" parameters.filesetid="\d+" />
- <url ServiceParameter="API.JobEstimate" pattern="api/jobs/estimate/" />
- <url ServiceParameter="API.JobRun" pattern="api/jobs/run/" />
- <url ServiceParameter="API.JobCancel" pattern="api/jobs/cancel/{id}/" parameters.id="\d+"/>
- <url ServiceParameter="API.JobsShow" pattern="api/jobs/show/" />
- <url ServiceParameter="API.JobShow" pattern="api/jobs/show/{id}/" parameters.id="\d+" />
- <url ServiceParameter="API.JobShow" pattern="api/jobs/show/name/{name}/" parameters.name="[a-zA-Z0-9:.\-_ ]+" />
- <url ServiceParameter="API.JobTotals" pattern="api/jobs/totals/" />
- <url ServiceParameter="API.RestoreRun" pattern="api/jobs/restore/" />
- <!-- bvfs endpoints-->
- <url ServiceParameter="API.BVFSUpdate" pattern="api/bvfs/update/" />
- <url ServiceParameter="API.BVFSLsDirs" pattern="api/bvfs/lsdirs/" />
- <url ServiceParameter="API.BVFSLsDirs" pattern="api/bvfs/lsdirs/limit/{limit}/" parameters.limit="\d+" />
- <url ServiceParameter="API.BVFSLsDirs" pattern="api/bvfs/lsdirs/limit/{limit}/{offset}/" parameters.limit="\d+" parameters.offset="\d+" />
- <url ServiceParameter="API.BVFSLsFiles" pattern="api/bvfs/lsfiles/" />
- <url ServiceParameter="API.BVFSLsFiles" pattern="api/bvfs/lsfiles/limit/{limit}/" parameters.limit="\d+" />
- <url ServiceParameter="API.BVFSLsFiles" pattern="api/bvfs/lsfiles/limit/{limit}/{offset}/" parameters.limit="\d+" parameters.offset="\d+" />
- <url ServiceParameter="API.BVFSVersions" pattern="api/bvfs/versions/{client}/{jobid}/{pathid}/{filenameid}/" parameters.client="[a-zA-Z0-9:.\-_ ]+" parameters.jobid="\d+" parameters.pathid="\d+" parameters.filenameid="\d+" />
- <url ServiceParameter="API.BVFSGetJobids" pattern="api/bvfs/getjobids/{jobid}/" parameters.jobid="[\d\,]+" />
- <url ServiceParameter="API.BVFSRestore" pattern="api/bvfs/restore/" />
- <url ServiceParameter="API.BVFSClearCache" pattern="api/bvfs/clear/" />
- <!-- joblog endpoints -->
- <url ServiceParameter="API.JobLog" pattern="api/joblog/{id}/" parameters.id="\d+" />
- <!-- fileset endpoints -->
- <url ServiceParameter="API.FileSetResNames" pattern="api/filesets/" />
- <url ServiceParameter="API.FileSet" pattern="api/filesets/{id}/" parameters.id="\d+" />
- <url ServiceParameter="API.FileSets" pattern="api/filesets/info/" />
- <url ServiceParameter="API.FileSet" pattern="api/filesets/{name}/" parameters.name="[a-zA-Z0-9:.\-_ ]+" />
- <!-- schedule endpoints -->
- <url ServiceParameter="API.Schedules" pattern="api/schedules/" />
- <!-- Bacula config module endpoints -->
- <url ServiceParameter="API.Config" pattern="api/config/" />
- <url ServiceParameter="API.Config" pattern="api/config/{component_type}/" parameters.component_type="[a-z]+" />
- <url ServiceParameter="API.Config" pattern="api/config/{component_type}/{resource_type}/" parameters.component_type="[a-z]+" parameters.resource_type="[a-zA-Z]+" />
- <url ServiceParameter="API.Config" pattern="api/config/{component_type}/{resource_type}/{resource_name}/" parameters.component_type="[a-z]+" parameters.resource_type="[a-zA-Z]+" parameters.resource_name="[a-zA-Z0-9:.\-_ ]+" />
-</urls>
* Bacula(R) - The Network Backup Solution
* Baculum - Bacula web interface
*
- * Copyright (C) 2013-2016 Kern Sibbald
+ * Copyright (C) 2013-2019 Kern Sibbald
*
* The main author of Baculum is Marcin Haba.
* The original author of Bacula is Kern Sibbald, with contributions
'api' => array(
'url_manager' => 'Application.API.Class.APIUrlMapping',
'url_pattern' => '!^(/index\.php)?/api([/,].*)?$!',
- 'endpoints' => 'Application.API.endpoints'
+ 'endpoints' => 'Application.API.Pages.API.endpoints'
+ ),
+ 'oauth' => array(
+ 'url_manager' => 'Application.API.Class.OAuthUrlMapping',
+ 'url_pattern' => '!^(/index\.php)?/oauth([/,].*)?$!',
+ 'endpoints' => 'Application.API.Pages.OAuth2.endpoints'
+ ),
+ 'panel' => array(
+ 'url_manager' => 'Application.API.Class.PanelUrlMapping',
+ 'url_pattern' => '!^(/index\.php)?/panel([/,].*)?$!',
+ 'endpoints' => 'Application.API.Pages.Panel.endpoints'
)
);
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2019 Kern Sibbald
+ *
+ * The main author of Baculum is Marcin Haba.
+ * The original author of Bacula is Kern Sibbald, with contributions
+ * from many others, a complete list can be found in the file AUTHORS.
+ *
+ * You may use this file and others of this release according to the
+ * license defined in the LICENSE file, which includes the Affero General
+ * Public License, v3.0 ("AGPLv3") and some additional permissions and
+ * terms pursuant to its AGPLv3 Section 7.
+ *
+ * This notice must be preserved when any source code is
+ * conveyed and/or propagated.
+ *
+ * Bacula(R) is a registered trademark of Kern Sibbald.
+ */
+
+Prado::using('Application.Common.Class.BaculumPage');
+
+class CommonPage extends BaculumPage {
+}
+?>
* Bacula(R) - The Network Backup Solution
* Baculum - Bacula web interface
*
- * Copyright (C) 2013-2018 Kern Sibbald
+ * Copyright (C) 2013-2019 Kern Sibbald
*
* The main author of Baculum is Marcin Haba.
* The original author of Bacula is Kern Sibbald, with contributions
/**
* OAuth2 authorization endpoints
*/
- const OAUTH2_AUTH_URL = 'api/auth/';
- const OAUTH2_TOKEN_URL = 'api/token/';
+ const OAUTH2_AUTH_URL = 'oauth/authorize/';
+ const OAUTH2_TOKEN_URL = 'oauth/token/';
/**
* API server version for current request.
<module id="url_manager" class="Application.Common.Class.BaculumUrlMapping" EnableCustomUrl="true" />
</modules>
<services>
- <service id="api" class="TPageService" BasePath="Application.API.Pages" DefaultPage="Panel.MainPage" />
+ <service id="page" class="TPageService" BasePath="Application.Common.Pages" DefaultPage="CommonPage" />
+ <service id="oauth" class="TPageService" BasePath="Application.API.Pages.OAuth2" DefaultPage="Authorize" />
+ <service id="api" class="TPageService" BasePath="Application.API.Pages.API" DefaultPage="Welcome" />
+ <service id="panel" class="TPageService" BasePath="Application.API.Pages.Panel" DefaultPage="APIHome" />
<service id="web" class="TPageService" BasePath="Application.Web.Pages" DefaultPage="Dashboard" />
</services>
</application>