Commit 977ab65 1 parent 81c30e0 commit 977ab65 Copy full SHA for 977ab65
File tree 3 files changed +8
-2
lines changed
3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,6 @@ func (m *Migrator) exportCtrl(w http.ResponseWriter, r *http.Request) {
136
136
exportFile := fmt .Sprintf ("%s-%s.json.gz" , siteID , time .Now ().Format ("20060102" ))
137
137
w .Header ().Set ("Content-Type" , "application/gzip" )
138
138
w .Header ().Set ("Content-Disposition" , "attachment;filename=" + exportFile )
139
- w .WriteHeader (http .StatusOK )
140
139
gzWriter := gzip .NewWriter (w )
141
140
defer func () {
142
141
if e := gzWriter .Close (); e != nil {
Original file line number Diff line number Diff line change @@ -56,7 +56,6 @@ func (s *rss) postCommentsCtrl(w http.ResponseWriter, r *http.Request) {
56
56
57
57
w .Header ().Set ("Content-Type" , "application/xml; charset=utf-8" )
58
58
w .WriteHeader (http .StatusOK )
59
-
60
59
if _ , err = w .Write (data ); err != nil {
61
60
log .Printf ("[WARN] failed to send response to %s, %s" , r .RemoteAddr , err )
62
61
}
Original file line number Diff line number Diff line change @@ -103,6 +103,14 @@ GET {{host}}/api/v1/admin/blocked?site={{site}}
103
103
### delete comment by id
104
104
DELETE {{host}}/api/v1/admin/comment/3665976683?site={{site}}&url={{url}}
105
105
106
+ ### export site (for backup)
107
+ GET {{host}}/api/v1/admin/export?site={{site}}&mode=stream
108
+ X-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJyZW1hcmsiLCJleHAiOjE5NzYwNTY3NTYsImp0aSI6IjJlOGJmMTE5OTI0MjQxMDRjYjFhZGRlODllMWYwNGFiMTg4YWZjMzQiLCJpYXQiOjE1NzYwNTY0NTYsImlzcyI6InJlbWFyazQyIiwidXNlciI6eyJuYW1lIjoiZGV2X3VzZXIiLCJpZCI6ImRldl91c2VyIiwicGljdHVyZSI6Imh0dHA6Ly8xMjcuMC4wLjE6ODA4MC9hcGkvdjEvYXZhdGFyL2NjZmEyYWJkMDE2Njc2MDViNGUxZmM0ZmNiOTFiMWUxYWYzMjMyNDAuaW1hZ2UiLCJhdHRycyI6eyJhZG1pbiI6dHJ1ZSwiYmxvY2tlZCI6ZmFsc2V9fX0.6Qt5s2enBMRC-Jmsua01yViVYI95Dx6BPBMaNjj36d4
109
+
110
+ ### export site (for backup) to .gz file
111
+ GET {{host}}/api/v1/admin/export?site={{site}}&mode=file
112
+ X-JWT: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJyZW1hcmsiLCJleHAiOjE5NzYwNTY3NTYsImp0aSI6IjJlOGJmMTE5OTI0MjQxMDRjYjFhZGRlODllMWYwNGFiMTg4YWZjMzQiLCJpYXQiOjE1NzYwNTY0NTYsImlzcyI6InJlbWFyazQyIiwidXNlciI6eyJuYW1lIjoiZGV2X3VzZXIiLCJpZCI6ImRldl91c2VyIiwicGljdHVyZSI6Imh0dHA6Ly8xMjcuMC4wLjE6ODA4MC9hcGkvdjEvYXZhdGFyL2NjZmEyYWJkMDE2Njc2MDViNGUxZmM0ZmNiOTFiMWUxYWYzMjMyNDAuaW1hZ2UiLCJhdHRycyI6eyJhZG1pbiI6dHJ1ZSwiYmxvY2tlZCI6ZmFsc2V9fX0.6Qt5s2enBMRC-Jmsua01yViVYI95Dx6BPBMaNjj36d4
113
+
106
114
### get post info
107
115
GET {{host}}/api/v1/info?site={{site}}&url={{url}}
108
116
You can’t perform that action at this time.
0 commit comments