Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
feat: 增加wget等依赖包;升级备份方法
Browse files Browse the repository at this point in the history
  • Loading branch information
sixmillions committed Apr 23, 2023
1 parent 6975e17 commit 8580ffc
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 9 deletions.
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@

![success](./img/run-success.png)

**注意:**
- 检查 `.replit` 文件(点击`Files` 最右边三个点,选择 `Show hidden files`, 就能看到该文件)
- 这种方式导入,有时候replit会覆盖这个文件
- 如果发现和本项目不一样,重新copy一份进去,然后刷新页面重新进一下这个项目

## 方式3

1. 参考下面的[构建方式](#构建方式)构建出memos
Expand Down Expand Up @@ -87,7 +92,7 @@ rm -rf ./server/dist && cp -r web/dist ./server/
go build -o memos ./main.go
```

这样就构建出来 `memos`
这样就构建出来 `memos` 这个可执行文件了,在项目根路径

# 防止replit休眠

Expand Down Expand Up @@ -127,6 +132,30 @@ go build -o memos ./main.go

![cloudflare-config-2](./img/cloudflare-config-2.png)

# 版本升级

目前还不是自动构建,有新版memos可以email我一下,我快速构建一下

**升级一时爽,数据火葬场!!!!注意备份数据**

```bash
# 先备份数据
zip memeos-db.zip -qr db/*
# 然后下载该数据,这个就是你的数据库

# 备份旧的memos
mv memos memos.bk

# 安装最新版(本项目构建的最新版)
bash main.sh

# 或者指定版本(本项目构建的某个版本)
bash main.sh v0.12.2
```

- v0.11.2
- v0.12.2 最新

# 最后

感谢Memos开源社区的各位大佬
Expand Down
17 changes: 9 additions & 8 deletions main.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/bin/bash

if [ $# -eq 1 ]; then
version=$1
else
version="$(curl -fsSLI -o /dev/null -w "%{url_effective}" https://github.com/sixmillions/memos-replit/releases/latest)"
version="${version#https://github.com/sixmillions/memos-replit/releases/tag/}"
fi

echo "down load memos ${version} >>> $(date '+%Y-%m-%d %H:%M:%S')"

rm -rf memos && wget https://github.com/sixmillions/memos-replit/releases/download/${version}/memos
if [ ! -e memos ];then
if [ $# -eq 1 ]; then
version=$1
else
version="$(curl -fsSLI -o /dev/null -w "%{url_effective}" https://github.com/sixmillions/memos-replit/releases/latest)"
version="${version#https://github.com/sixmillions/memos-replit/releases/tag/}"
fi
wget https://github.com/sixmillions/memos-replit/releases/download/${version}/memos
fi

echo "run memos >>> $(date '+%Y-%m-%d %H:%M:%S')"

Expand Down
Binary file added memos
Binary file not shown.
3 changes: 3 additions & 0 deletions replit.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{ pkgs }: {
deps = [
pkgs.wget
pkgs.unzip
pkgs.zip
pkgs.go
pkgs.gopls
];
Expand Down

0 comments on commit 8580ffc

Please sign in to comment.