You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.MD
+19-5Lines changed: 19 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -8,14 +8,14 @@ It originates from [pull request #845](takezoe/gitbucket#845) and can be used to
8
8
9
9
### H2 Backup
10
10
11
-
This plugin allows to backup the underlying H2 database used by default by GitBucket.
11
+
This plugin allows you to backup the underlying H2 database used by default by GitBucket.
12
12
13
13
## Usage
14
14
15
-
The plugin provides 2 ways to backup the H2 database:
15
+
The plugin provides two ways to backup the H2 database:
16
16
17
17
- via an administration page and a backup button
18
-
- via an HTTP call to http://YOUR_GITBUCKET/database/backup
18
+
- via an HTTP call to `http://YOUR_GITBUCKET/api/v3/plugins/database/backup
19
19
20
20
The default backup file points to `GITBUCKET_DATA/backup/gitbucket-db-YYYY-MM-DD-hhmm.zip` where:
21
21
@@ -34,13 +34,27 @@ The default backup file points to `GITBUCKET_DATA/backup/gitbucket-db-YYYY-MM-DD
34
34
35
35
Using your preferred tool (curl, wget, ...) it is possible start a backup of the H2 database.
36
36
37
-
The URL to call looks like `http://YOUR_GITBUCKET/database/backup`.
37
+
The URL to call looks like `http://YOUR_GITBUCKET/api/v3/plugins/database/backup`
38
38
39
-
You can pass an optional argument `dest` that references the destination file path where the backup will be done on the server. For example calling `http://YOUR_GITBUCKET/database/backup?dest=/var/backups/gitbucket.zip` will do an H2 backup of the gitbucket database into the file `/var/backups/gitbucket.zip`.
39
+
You can pass an optional argument `dest` that references the destination file path where the backup will be done on the server.
40
+
For example calling `http://YOUR_GITBUCKET/api/v3/plugins/database/backup?dest=/var/backups/gitbucket.zip` will do an H2 backup of the gitbucket database into the file `/var/backups/gitbucket.zip`.
40
41
Since `1.3.0`, the _dest_ parameter can denote a relative file path, in this case the file will be created relatively to `GITBUCKET_DATA`.
41
42
42
43
On success, you will receive a `HTTP 200` answer with a body containing `done: FULL_PATH_OF_BACKUP_FILE`.
43
44
45
+
### HTTP API Authorization
46
+
47
+
The api uses token authentication. To generate a token:
48
+
49
+
1. Login to Gitbucket with an administrative account
50
+
2. In the top-right corner, click the user menu
51
+
3. Click `Account Settings`
52
+
4. On the left, click `Applications`
53
+
5. In `Generate new token` enter a description and click `Generate token`
54
+
6. Add the token to your http call, such as with `curl`:
0 commit comments