-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0f19f46
commit f36ca30
Showing
8 changed files
with
226 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
article: false | ||
title: DeepLX - 免费翻译接口 | ||
order: 13 | ||
--- | ||
|
||
[DeepLX](https://github.com/OwO-Network/DeepLX/) 是基于 DeepL 的免费翻译服务,可以将 DeepL Free API 转换为本地 API,以供第三方程序使用。 | ||
|
||
```yml | ||
version: '3' | ||
|
||
services: | ||
deeplx: | ||
image: ghcr.io/owo-network/deeplx:latest | ||
container_name: deeplx | ||
restart: always | ||
ports: | ||
- "32770:1188" | ||
# environment: | ||
# 如果设置了 TOKEN,则每个请求都需要包含 Authorization 标头。 | ||
# - TOKEN=helloworld | ||
# 如果设置了 AUTHKEY,在 429 响应(请求过多/过快)后,会使用官方的 AuthKey 进行请求。如果同时使用多个 authKey,需要用逗号分隔。 | ||
# - AUTHKEY=xxxxxxx:fx | ||
``` | ||
|
||
如果你注册了 DeepL 的免费接口,建议设置 AUTHKEY 以加快翻译速度。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
article: false | ||
title: Gramps.js - 在线家谱 | ||
order: 14 | ||
--- | ||
|
||
[Gramps.js](https://github.com/gramps-project/Gramps.js) 是一款用于协作族谱编辑与展示的 Web 开源应用。它基于领开源家谱桌面应用程序 Gramps,并可与 Gramps 交互操作。不过,Gramps.js 的输入过程相对复杂,需要分别添加成员、家庭、事件、地点等元素,然后将它们组合在一起。第一次配置可能会花费一些时间,使用教程参考 [Gramps Web User guide](https://www.grampsweb.org/user-guide/)。 | ||
|
||
我打算将家里的族谱电子化,并迁移到 Gramps 上。 | ||
|
||
```yml | ||
# https://www.grampsweb.org/Deployment/ | ||
# https://github.com/gramps-project/web/blob/main/examples/docker-compose-base/docker-compose.yml | ||
|
||
version: "3.7" | ||
|
||
services: | ||
grampsweb: &grampsweb | ||
image: ghcr.io/gramps-project/grampsweb:latest | ||
container_name: grampsweb | ||
restart: always | ||
ports: | ||
- "23300:5000" # host:docker | ||
environment: | ||
GRAMPSWEB_TREE: "Gramps Web" # will create a new tree if not exists | ||
GRAMPSWEB_CELERY_CONFIG__broker_url: "redis://grampsweb_redis:6379/0" | ||
GRAMPSWEB_CELERY_CONFIG__result_backend: "redis://grampsweb_redis:6379/0" | ||
GRAMPSWEB_RATELIMIT_STORAGE_URI: redis://grampsweb_redis:6379/1 | ||
depends_on: | ||
- grampsweb_redis | ||
volumes: | ||
- /volume1/docker/grampsjs/users:/app/users # persist user database | ||
- /volume1/docker/grampsjs/index:/app/indexdir # persist search index | ||
- /volume1/docker/grampsjs/thumb_cache:/app/thumbnail_cache # persist thumbnails | ||
- /volume1/docker/grampsjs/cache:/app/cache # persist export and report caches | ||
- /volume1/docker/grampsjs/secret:/app/secret # persist flask secret | ||
- /volume1/docker/grampsjs/db:/root/.gramps/grampsdb # persist Gramps database | ||
- /volume1/docker/grampsjs/media:/app/media # persist media files | ||
- /volume1/docker/grampsjs/tmp:/tmp | ||
|
||
grampsweb_celery: | ||
<<: *grampsweb # YAML merge key copying the entire grampsweb service config | ||
ports: [] | ||
container_name: grampsweb_celery | ||
depends_on: | ||
- grampsweb_redis | ||
command: celery -A gramps_webapi.celery worker --loglevel=INFO | ||
|
||
grampsweb_redis: | ||
image: redis:alpine | ||
container_name: grampsweb_redis | ||
restart: always | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
--- | ||
article: false | ||
title: Nextcloud - 私有云盘 | ||
order: 11 | ||
--- | ||
|
||
[Nextcloud](https://github.com/nextcloud/docker) 是一款开源的云存储和协作平台。Nextcloud 不仅可以让你创建文件共享、在线编辑和备份等功能,还支持多用户协作、通讯录、日历等功能,可以完全替代你的 Google Drive 或 Dropbox 等云存储服务。 | ||
|
||
虽然 Nextcloud 内置了 Office 功能,但对中文支持有限,建议使用 Onlyoffice。Onlyoffice 是一个基于 Web 的办公套件,可以帮助你创建和编辑文字、电子表格和幻灯片等文档,实现文档的在线协作、版本控制和在线编辑等功能。这种集成方式将大大提高你的工作效率和协作能力。 | ||
|
||
## 公网访问 Nextcloud | ||
|
||
若在公网中使用 Nextcloud,需在 `docker/nextcloud/data/config/config.php` 文件中的 `trusted_domains` 部分添加你的公网域名,例如 `1 => 'xxx.newzone.top'`。 | ||
|
||
即使你的反向代理域名带有端口,也请勿在 `trusted_domains` 中包含端口信息,否则可能会出现「通过不被信任的域名访问」的提示。在使用带有端口的公网域名时,站点在未登录和成功登录时可能会在跳转时省略端口信息。这时,手动添加端口信息即可正常使用。 | ||
|
||
## ONLYOFFICE | ||
|
||
[ONLYOFFICE](https://helpcenter.onlyoffice.com/installation/docs-community-install-docker.aspx) Document Server 是一套提供在线编辑 Office 文档服务的套件。通过使用该套件及相应的 Nextcloud 插件,你可以在 Nextcloud 上进行在线编辑 Office 文档的操作,并正确识别中文内容。 | ||
|
||
完成部署后,ONLYOFFICE 会生成一段代码,将其输入到服务器即可获取秘钥。将秘钥填写到「管理设置」>「ONLYOFFICE」中。请注意,重新启动 NAS 和 Docker 容器可能会导致秘钥更换。 | ||
|
||
![](https://img.newzone.top/2023-11-11-13-51-31.png?imageMogr2/format/webp) | ||
|
||
## Nextcloud Office 中文乱码 | ||
|
||
Nextcloud Office 无法正常显示文档中的中文,而只显示方格子。关于此问题的解决方案可在[这篇教程](https://blog.csdn.net/skydust1979/article/details/106280811)中找到。教程建议修改 `/volume1/docker/nextcloud/data/lib/public/AppFramework/Http/FileDisplayResponse.php` 文件,注释掉第 67 行,并添加以下内容。然而,我测试后发现此方法并不起作用。 | ||
|
||
```php | ||
//$output->setOutput($this->file->getContent()); | ||
$fileContents=$this->file->getContent(); | ||
$encoding = mb_detect_encoding($fileContents . "a", "UTF-8,GB2312, GBK, WINDOWS-1252, ISO-8859-15, ISO-8859-1, ASCII", true); | ||
if ($encoding === "") { | ||
$encoding = "ISO-8859-15"; | ||
} | ||
$fileContents = iconv($encoding, "UTF-8", $fileContents); | ||
$output->setOutput($fileContents); | ||
``` | ||
|
||
## 部署命令 | ||
|
||
以下是集成了 ONLYOFFICE 的 Nextcloud 部署命令: | ||
|
||
```yml | ||
version: '2' | ||
|
||
services: | ||
nextcloud_db: | ||
image: mariadb:10.6 | ||
container_name: nextcloud_db | ||
restart: always | ||
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW | ||
volumes: | ||
- /volume1/docker/nextcloud/mysql:/var/lib/mysql | ||
environment: | ||
- MYSQL_ROOT_PASSWORD=nextcloud | ||
- MYSQL_PASSWORD=nextcloud | ||
- MYSQL_DATABASE=nextcloud | ||
- MYSQL_USER=nextcloud | ||
|
||
nextcloud_app: | ||
image: nextcloud | ||
container_name: nextcloud | ||
restart: always | ||
ports: | ||
- 9030:80 | ||
links: | ||
- nextcloud_db | ||
volumes: | ||
- /volume1/docker/nextcloud/data:/var/www/html | ||
- /volume1/sync:/sync #外部存储目录 | ||
environment: | ||
- MYSQL_PASSWORD=nextcloud | ||
- MYSQL_DATABASE=nextcloud | ||
- MYSQL_USER=nextcloud | ||
- MYSQL_HOST=nextcloud_db | ||
|
||
onlyoffice: | ||
image: onlyoffice/documentserver | ||
container_name: onlyoffice | ||
restart: always | ||
ports: | ||
- 9031:80 | ||
volumes: | ||
- /volume1/docker/nextcloud/onlyoffice/data:/var/www/onlyoffice/Data | ||
- /volume1/docker/nextcloud/onlyoffice/logs:/var/log/onlyoffice | ||
``` | ||
## 外部存储 | ||
有时你的文档在其他位置,可以在应用中添加插件 External storage support,这样可以直接编辑 FTP、WebDAV、Nextcloud、SFTP、Amazone S3 或其他对象存储等外部文件。 | ||
安装插件后,进入「管理」>「外部存储」设置目录。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
article: false | ||
title: SRS Stack - 直播推流 | ||
order: 16 | ||
--- | ||
|
||
SRS 是一个免费开源的实时视频服务器应用,通过 [SRS Stack](https://github.com/ossrs/srs-stack) 能够轻松在多平台上进行简单高效的直播同步推流部署。 | ||
|
||
在我的日常工作和学习中,我通常会开启直播,但如果推送多路流,会对上传带宽造成较大压力。通过使用 SRS Stack,这个问题得到了解决。 | ||
|
||
目前,我将电脑上的 OBS 推流到 NAS 上的 SRS Stack,然后在 NAS 上进行多平台统一转播。这样一来,我能够节省上行带宽,同时避免客户端推送多路流。然而,需要注意的是,SRS Stack 目前仅支持最多同时进行三个平台的转播。如果你需要更多平台,可以运行多个实例。 | ||
|
||
```yml | ||
version: '3' | ||
services: | ||
srs-stack: | ||
image: registry.cn-hangzhou.aliyuncs.com/ossrs/srs-stack:5 | ||
container_name: srs-stack | ||
volumes: | ||
- /volume1/docker/srs-stack/data:/data | ||
ports: | ||
- 23322:2022 | ||
- 23323:2443 | ||
- 1935:1935 | ||
- 8000:8000/udp | ||
- 10080:10080/udp | ||
restart: always | ||
``` | ||