feature/ts - read-only support (#57)
* extend post info with ts and add info implemenation to engine * info controller * remove unused * docker froendly new test * tree find to include post info struct * remove leftovers from codeconv * test for empty tree request * add func name to error rest report * test with disabled proxy * add read only age and reject updates on old posts * lint: shaddow err * make info calls fast. needs migration! * fix backup restore script * increase limiter timeout * add local exporter * migrate list to new info * fix rest list tests * add manual backup script * default backup path * fix eait on sec change failing rss tests * add RO status bucket and rest * add admin RO controller test
This commit is contained in:
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
# this scrips makes a backup file to /srv/var/userbackup-<site>-<timestamp>.gz
|
||||
|
||||
BACKUP_PATH=${BACKUP_PATH:-./var}
|
||||
backup_file=${BACKUP_PATH}/userbackup-${1}-$(date +%s).gz
|
||||
echo "make backup file for site $1 to $backup_file"
|
||||
curl "http://127.0.0.1:8081/api/v1/admin/export?site=${1}&secret=${SECRET}" > ${backup_file}
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
# this scrips making a backup file to /tmp/export-remark.gz and loading it back
|
||||
# useful to migrate data schema in case if new version of data store incomaptible with the stored comments.
|
||||
|
||||
echo "make backup file for site $1"
|
||||
curl "http://127.0.0.1:8081/api/v1/admin/export?site=${1}&secret=${SECRET}" > /tmp/export-remark.gz
|
||||
|
||||
BOLTDB_PATH=${BOLTDB_PATH:-./var}
|
||||
BACKUP_PATH=${BACKUP_PATH:-./var}
|
||||
|
||||
cp ${BOLTDB_PATH}/${1}.db ${BACKUP_PATH}/${1}-$(date +%s).db
|
||||
|
||||
echo "import backup to site $1"
|
||||
echo "unpack /tmp/export-remark.gz"
|
||||
gunzip -c /tmp/export-remark.gz >/tmp/backup.remark
|
||||
ls -laH /tmp/backup.remark
|
||||
|
||||
echo "export to site $1"
|
||||
curl -X POST -H "Content-Type: application/json" --data-binary @/tmp/backup.remark "http://127.0.0.1:8081/api/v1/admin/import?site=${1}&provider=native&secret=${SECRET}"
|
||||
|
||||
rm -f /tmp/backup.remark
|
||||
rm -f /tmp/export-remark.gz
|
||||
@@ -7,5 +7,5 @@ gunzip -c /srv/var/backup/$1 >/tmp/backup.remark
|
||||
size=`stat -c "%s" /tmp/backup.remark`
|
||||
echo "source file size ${size}"
|
||||
|
||||
curl -X POST -H "Content-Type: application/json" -d @/tmp/backup.remark "http://127.0.0.1:8081/api/v1/admin/import?site=${2}&provider=native&secret=${SECRET}"
|
||||
curl -X POST -H "Content-Type: application/json" --data-binary @/tmp/backup.remark "http://127.0.0.1:8081/api/v1/admin/import?site=${2}&provider=native&secret=${SECRET}"
|
||||
rm -fq /tmp/backup.remark
|
||||
|
||||
Reference in New Issue
Block a user