mirror of
https://github.com/QYG2297248353/appstore-1panel.git
synced 2024-11-25 15:58:48 +08:00
feat: add discourse (#1847)
This commit is contained in:
parent
6fade6ab9b
commit
fac02ac341
58
apps/discourse/README.md
Normal file
58
apps/discourse/README.md
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
# 注意事项
|
||||||
|
- 同一个存储卷,只会在首次初始化管理员账号
|
||||||
|
- 使用端口访问的话,不会显示图标,修改为域名即可
|
||||||
|
|
||||||
|
# 配置
|
||||||
|
## 设置语言
|
||||||
|
/admin/site_settings/category/required
|
||||||
|
|
||||||
|
default locale 设置为 简体中文
|
||||||
|
|
||||||
|
## 设置SMTP
|
||||||
|
手动编辑 docker-compose,修改 smtp相关配置
|
||||||
|
|
||||||
|
|
||||||
|
## 插件安装
|
||||||
|
```shell
|
||||||
|
cd /opt/bitnami/discourse
|
||||||
|
# 安装插件 PLUGIN_REPO_URL 替换为插件地址
|
||||||
|
sudo RAILS_ENV=production bundle exec rake plugin:install repo=PLUGIN_REPO_URL
|
||||||
|
# 最后,预编译新资源以供插件使用:
|
||||||
|
sudo RAILS_ENV=production bundle exec rake assets:precompile
|
||||||
|
```
|
||||||
|
|
||||||
|
## 插件卸载
|
||||||
|
```shell
|
||||||
|
cd /opt/bitnami/discourse/plugins
|
||||||
|
# 删除插件目录 PLUGIN-DIR 替换为插件目录
|
||||||
|
rm -rf PLUGIN-DIR
|
||||||
|
# 最后,预编译新资源
|
||||||
|
sudo RAILS_ENV=production bundle exec rake assets:precompile
|
||||||
|
```
|
||||||
|
|
||||||
|
# Discourse
|
||||||
|
|
||||||
|
Discourse是一个现代化的讨论平台,提供了以下令人印象深刻的功能:
|
||||||
|
|
||||||
|
## 主要功能:
|
||||||
|
|
||||||
|
- **无缝滚动对话**:摒弃传统的分页,实现即时加载,用户可以无限滚动阅读更多内容。
|
||||||
|
- **实时聊天**:创建社区成员之间的非正式聊天渠道,建立关系,并将聊天信息引用到主题中以持续讨论。
|
||||||
|
- **个性化体验**:自定义侧边栏和用户偏好设置,允许社区成员根据个人需求调整体验。
|
||||||
|
- **简洁且有上下文**:Discourse是一个简单的平面论坛,回复按页面顺序排列,通过展开帖子上下文和引用来展示完整对话。
|
||||||
|
- **移动优先设计**:为高分辨率触摸设备设计,内置移动布局,支持iOS和Android应用。
|
||||||
|
- **自动扩展链接**:粘贴链接即可自动扩展,提供来自Wikipedia、YouTube等数百个流行网站的额外上下文和信息。
|
||||||
|
- **单点登录**:与现有网站的登录系统集成,实现简单、强大的单点登录。
|
||||||
|
- **信任系统**:随着成员逐渐成为受信任的常客,他们将获得帮助维护社区的能力。
|
||||||
|
- **社区管理**:让社区自行抑制垃圾邮件和危险内容,友好解决争议。
|
||||||
|
- **垃圾邮件屏蔽**:内置Akismet垃圾邮件保护和启发式规则,包括新用户沙盒、用户标志阻止和标准nofollow。
|
||||||
|
- **社交登录**:轻松添加Google、Facebook、Twitter、Discord和GitHub等常见社交登录。
|
||||||
|
- **主题摘要**:使用摘要按钮将长主题压缩为最有趣和最受欢迎的帖子。
|
||||||
|
- **徽章系统**:通过包含的徽章集鼓励积极的社区行为,或添加自定义徽章。
|
||||||
|
- **表情符号**:提供可搜索的标准表情符号列表,可选择四种不同的表情符号集或定义自定义表情符号。
|
||||||
|
- **通过电子邮件回复**:当用户不活跃在网站上时,通知将自动通过电子邮件发送,并可从任何地方、任何设备通过电子邮件回复。
|
||||||
|
- **双因素认证**:使用免费的Android或iOS认证应用程序增强账户安全性。
|
||||||
|
- **管理仪表板**:社区健康指标最相关和基本的指标只需点击即可访问。
|
||||||
|
- **全面API**:屏幕上看到的任何内容,也可以通过API调用完成。
|
||||||
|
- **100%开源**:完全开放的代码,可以完全信任地将Discourse集成到你的站点中。
|
||||||
|
- **一键更新**:通过一键式网络更新流程,在仪表板上自动通知新版本。
|
19
apps/discourse/data.yml
Normal file
19
apps/discourse/data.yml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
name: Discourse
|
||||||
|
tags:
|
||||||
|
- 社区
|
||||||
|
title: 开源社区系统
|
||||||
|
description: 社区讨论的平台。免费、开放、简单。
|
||||||
|
additionalProperties:
|
||||||
|
key: discourse
|
||||||
|
name: Discourse
|
||||||
|
tags:
|
||||||
|
- WebSite
|
||||||
|
shortDescZh: 社区讨论的平台。免费、开放、简单。
|
||||||
|
shortDescEn: A platform for community discussion. Free, open, simple.
|
||||||
|
type: website
|
||||||
|
crossVersionUpdate: false
|
||||||
|
limit: 0
|
||||||
|
recommend: 0
|
||||||
|
website: https://www.discourse.org
|
||||||
|
github: https://github.com/discourse/discourse
|
||||||
|
document: https://hub.docker.com/r/bitnami/discourse
|
111
apps/discourse/latest/data.yml
Normal file
111
apps/discourse/latest/data.yml
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
additionalProperties:
|
||||||
|
formFields:
|
||||||
|
- default: ""
|
||||||
|
envKey: DISCOURSE_HOST
|
||||||
|
labelEn: HOST
|
||||||
|
labelZh: 访问域名
|
||||||
|
required: true
|
||||||
|
type: text
|
||||||
|
- default: 40030
|
||||||
|
envKey: PANEL_APP_PORT_HTTP
|
||||||
|
labelEn: Port
|
||||||
|
labelZh: HTTP 端口
|
||||||
|
required: true
|
||||||
|
rule: paramPort
|
||||||
|
type: number
|
||||||
|
- default: ""
|
||||||
|
envKey: DISCOURSE_EMAIL
|
||||||
|
labelEn: email
|
||||||
|
labelZh: 管理员邮箱
|
||||||
|
required: true
|
||||||
|
type: text
|
||||||
|
- default: ""
|
||||||
|
envKey: DISCOURSE_PASSWORD
|
||||||
|
labelEn: password(must length > 10)
|
||||||
|
labelZh: 管理员密码(长度必须>10)
|
||||||
|
required: true
|
||||||
|
type: password
|
||||||
|
rule: paramCommon
|
||||||
|
# - default: ""
|
||||||
|
# envKey: DISCOURSE_SMTP_HOST
|
||||||
|
# labelEn: SMTP HOST
|
||||||
|
# labelZh: SMTP服务器地址
|
||||||
|
# required: true
|
||||||
|
# type: text
|
||||||
|
# - default: 0
|
||||||
|
# envKey: DISCOURSE_SMTP_PORT_NUMBER
|
||||||
|
# labelEn: SMTP PORT
|
||||||
|
# labelZh: SMTP服务器端口
|
||||||
|
# required: true
|
||||||
|
# type: number
|
||||||
|
# - default: ""
|
||||||
|
# envKey: DISCOURSE_SMTP_USER
|
||||||
|
# labelEn: SMTP USER
|
||||||
|
# labelZh: SMTP服务器账号
|
||||||
|
# required: true
|
||||||
|
# type: text
|
||||||
|
# - default: ""
|
||||||
|
# envKey: DISCOURSE_SMTP_PASSWORD
|
||||||
|
# labelEn: SMTP PASSWORD
|
||||||
|
# labelZh: SMTP服务器密码
|
||||||
|
# required: true
|
||||||
|
# type: password
|
||||||
|
# - default: ""
|
||||||
|
# envKey: DISCOURSE_SMTP_PROTOCOL
|
||||||
|
# labelEn: SMTP PROTOCOL
|
||||||
|
# labelZh: SMTP服务器加密协议
|
||||||
|
# type: select
|
||||||
|
# values:
|
||||||
|
# - label: 无
|
||||||
|
# value: ""
|
||||||
|
# - label: TLS
|
||||||
|
# value: "tls"
|
||||||
|
# - label: SSL
|
||||||
|
# value: "ssl"
|
||||||
|
- default: ""
|
||||||
|
envKey: PANEL_DB_HOST
|
||||||
|
key: postgresql
|
||||||
|
labelEn: postgresql Database Service
|
||||||
|
labelZh: postgresql数据库服务
|
||||||
|
required: true
|
||||||
|
type: service
|
||||||
|
- default: de
|
||||||
|
envKey: PANEL_DB_NAME
|
||||||
|
labelEn: Database
|
||||||
|
labelZh: 数据库名
|
||||||
|
random: true
|
||||||
|
required: true
|
||||||
|
rule: paramCommon
|
||||||
|
type: text
|
||||||
|
- default: de
|
||||||
|
envKey: PANEL_DB_USER
|
||||||
|
labelEn: User
|
||||||
|
labelZh: 数据库用户
|
||||||
|
random: true
|
||||||
|
required: true
|
||||||
|
rule: paramCommon
|
||||||
|
type: text
|
||||||
|
- default: de
|
||||||
|
envKey: PANEL_DB_USER_PASSWORD
|
||||||
|
labelEn: Password
|
||||||
|
labelZh: 数据库用户密码
|
||||||
|
random: true
|
||||||
|
required: true
|
||||||
|
rule: paramComplexity
|
||||||
|
type: password
|
||||||
|
- default: ""
|
||||||
|
envKey: PANEL_REDIS_HOST #docker-compose 文件中的参数
|
||||||
|
key: redis #依赖应用的 key , 例如 mysql
|
||||||
|
labelEn: Redis Service #英文的label
|
||||||
|
labelZh: redis 服务 #中文的label
|
||||||
|
required: true #是否必填
|
||||||
|
type: service #如果需要依赖其他应用,例如数据库,使用此 type
|
||||||
|
- default: de
|
||||||
|
envKey: PANEL_REDIS_ROOT_PASSWORD
|
||||||
|
labelEn: Password
|
||||||
|
labelZh: redis 密码
|
||||||
|
random: true
|
||||||
|
required: true
|
||||||
|
rule: paramComplexity
|
||||||
|
type: password
|
||||||
|
|
68
apps/discourse/latest/docker-compose.yml
Normal file
68
apps/discourse/latest/docker-compose.yml
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
services:
|
||||||
|
discourse:
|
||||||
|
container_name: ${CONTAINER_NAME}
|
||||||
|
image: bitnami/discourse
|
||||||
|
restart: always
|
||||||
|
networks:
|
||||||
|
- 1panel-network
|
||||||
|
ports:
|
||||||
|
- "${PANEL_APP_PORT_HTTP}:3000"
|
||||||
|
volumes:
|
||||||
|
- discourse_data:/bitnami/discourse
|
||||||
|
environment:
|
||||||
|
#ALLOW_EMPTY_PASSWORD: true
|
||||||
|
DISCOURSE_HOST: ${DISCOURSE_HOST}
|
||||||
|
DISCOURSE_USERNAME: admin
|
||||||
|
DISCOURSE_PASSWORD: ${DISCOURSE_PASSWORD}
|
||||||
|
DISCOURSE_EMAIL: ${DISCOURSE_EMAIL}
|
||||||
|
DISCOURSE_DATABASE_HOST: ${PANEL_DB_HOST}
|
||||||
|
DISCOURSE_DATABASE_PORT_NUMBER: ${PANEL_DB_PORT}
|
||||||
|
DISCOURSE_DATABASE_USER: ${PANEL_DB_USER}
|
||||||
|
DISCOURSE_DATABASE_PASSWORD: ${PANEL_DB_USER_PASSWORD}
|
||||||
|
DISCOURSE_DATABASE_NAME: ${PANEL_DB_NAME}
|
||||||
|
POSTGRESQL_CLIENT_POSTGRES_USER: ${PANEL_DB_USER}
|
||||||
|
POSTGRESQL_CLIENT_POSTGRES_PASSWORD: ${PANEL_DB_USER_PASSWORD}
|
||||||
|
POSTGRESQL_CLIENT_CREATE_DATABASE_NAME: ${PANEL_DB_NAME}
|
||||||
|
POSTGRESQL_CLIENT_CREATE_DATABASE_EXTENSIONS: hstore,pg_trgm
|
||||||
|
DISCOURSE_REDIS_HOST: ${PANEL_REDIS_HOST}
|
||||||
|
DISCOURSE_REDIS_PASSWORD: ${PANEL_REDIS_ROOT_PASSWORD}
|
||||||
|
DISCOURSE_SMTP_HOST: test
|
||||||
|
DISCOURSE_SMTP_PORT_NUMBER: 0
|
||||||
|
DISCOURSE_SMTP_USER: test
|
||||||
|
DISCOURSE_SMTP_PASSWORD: test
|
||||||
|
DISCOURSE_SMTP_PROTOCOL:
|
||||||
|
labels:
|
||||||
|
createdBy: "Apps"
|
||||||
|
sidekiq:
|
||||||
|
container_name: ${CONTAINER_NAME}-sidekiq
|
||||||
|
image: bitnami/discourse
|
||||||
|
restart: always
|
||||||
|
networks:
|
||||||
|
- 1panel-network
|
||||||
|
depends_on:
|
||||||
|
- discourse
|
||||||
|
volumes:
|
||||||
|
- discourse_data:/bitnami/discourse
|
||||||
|
command: /opt/bitnami/scripts/discourse-sidekiq/run.sh
|
||||||
|
environment:
|
||||||
|
DISCOURSE_HOST: ${DISCOURSE_HOST}
|
||||||
|
DISCOURSE_DATABASE_HOST: ${PANEL_DB_HOST}
|
||||||
|
DISCOURSE_DATABASE_PORT_NUMBER: ${PANEL_DB_PORT}
|
||||||
|
DISCOURSE_DATABASE_USER: ${PANEL_DB_USER}
|
||||||
|
DISCOURSE_DATABASE_PASSWORD: ${PANEL_DB_USER_PASSWORD}
|
||||||
|
DISCOURSE_DATABASE_NAME: ${PANEL_DB_NAME}
|
||||||
|
DISCOURSE_REDIS_HOST: ${PANEL_REDIS_HOST}
|
||||||
|
DISCOURSE_REDIS_PASSWORD: ${PANEL_REDIS_ROOT_PASSWORD}
|
||||||
|
# DISCOURSE_SMTP_HOST: test
|
||||||
|
# DISCOURSE_SMTP_PORT_NUMBER: 0
|
||||||
|
# DISCOURSE_SMTP_USER: test
|
||||||
|
# DISCOURSE_SMTP_PASSWORD: test
|
||||||
|
# DISCOURSE_SMTP_PROTOCOL:
|
||||||
|
labels:
|
||||||
|
createdBy: "Apps"
|
||||||
|
volumes:
|
||||||
|
discourse_data:
|
||||||
|
|
||||||
|
networks:
|
||||||
|
1panel-network:
|
||||||
|
external: true
|
11
apps/discourse/latest/scripts/upgrade.sh
Normal file
11
apps/discourse/latest/scripts/upgrade.sh
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [[ -f ./.env ]]; then
|
||||||
|
if grep -q "DISCOURSE_SKIP_BOOTSTRAP" ./.env; then
|
||||||
|
echo "DISCOURSE_SKIP_BOOTSTRAP 已存在"
|
||||||
|
else
|
||||||
|
echo 'DISCOURSE_SKIP_BOOTSTRAP="yes"' >> ./.env
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo ".env 文件不存在"
|
||||||
|
fi
|
BIN
apps/discourse/logo.png
Normal file
BIN
apps/discourse/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
Loading…
Reference in New Issue
Block a user