Merge pull request #347 from hamid-gh98/main

[Feature] import/export database in the panel
This commit is contained in:
Ho3ein authored and GitHub committed 2023-05-06 12:53:41 +03:30 Unverified
commit ac31d6d9fb
15 files changed
+281 -26

No files matched your search

+1
View File
@@ -1,4 +1,5 @@
.idea
.vscode
tmp
backup/
bin/
+2 -2
View File
@@ -33,8 +33,8 @@ apt-get install certbot -y
certbot certonly --standalone --agree-tos --register-unsafely-without-email -d yourdomain.com
certbot renew --dry-run
```
or you can use x-ui menu then number '16' (Apply for an SSL Certificate)
or you can use x-ui menu then number '16' (Apply for an SSL Certificate)
# Default settings
@@ -116,6 +116,7 @@ If you want to use routing to WARP follow steps as below:
- For more advanced configuration items, please refer to the panel
- Fix api routes (user setting will create with api)
- Support to change configs by different items provided in panel
- Support export/import database from panel
# Tg robot use
@@ -194,7 +195,6 @@ Reference syntax:
- Tron USDT (TRC20): `TXncxkvhkDWGts487Pjqq1qT9JmwRUz8CC`
# Pictures
![1](./media/1.png)
+12
View File
@@ -1,6 +1,8 @@
package database
import (
"bytes"
"io"
"io/fs"
"os"
"path"
@@ -104,3 +106,13 @@ func GetDB() *gorm.DB {
func IsNotFound(err error) bool {
return err == gorm.ErrRecordNotFound
}
func IsSQLiteDB(file io.Reader) (bool, error) {
signature := []byte("SQLite format 3\x00")
buf := make([]byte, len(signature))
_, err := file.Read(buf)
if err != nil {
return false, err
}
return bytes.Equal(buf, signature), nil
}
Loaded 3 of 15 files, more files were not shown because too many files have changed in this diff. Show more