diff --git a/.github/README.md b/.github/README.md index e3d2fd7d..b48682e4 100644 --- a/.github/README.md +++ b/.github/README.md @@ -101,6 +101,7 @@ | 🟢 | | 苹果CMS V10 | https://www.maccms.la/ | 基于ThinkPHP和Layui的多功能开源免费内容管理系统 | | | 🟢 | | Docker Mailserver | https://docker-mailserver.github.io/docker-mailserver/latest/ | 可用于生产的全栈但简单的邮件服务器 | | | 🟢 | | MDC-NG | https://github.com/mdc-ng/mdc-ng/ | 成人电影数据采集工具 | | +| 🟢 | | Mastodon (长毛象) | https://joinmastodon.org/ | 自由开源的去中心化的分布式微博客社交网络 | | | 🟢 | | MaxKB | https://maxkb.cn/ | 基于 LLM 大语言模型的知识库问答系统 | | | 🟢 | | Media CMS | https://mediacms.io/ | 现代、功能齐全的开源视频和媒体内容管理系统 | | | 🟢 | | MetaTube | https://github.com/metatube-community/ | 为 Jellyfin/Emby/Plex 开发的超级好用的成人元数据刮削插件 | | @@ -184,7 +185,6 @@ > > 维护状态:🟢 维护中 🔴 未维护 🟡 表示不定期维护 - --- ## 1Pane 导入应用商店 diff --git a/README.md b/README.md index d1e18bb9..9442df3b 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,7 @@ | 🟢 | | 苹果CMS V10 | https://www.maccms.la/ | 基于ThinkPHP和Layui的多功能开源免费内容管理系统 | | | 🟢 | | Docker Mailserver | https://docker-mailserver.github.io/docker-mailserver/latest/ | 可用于生产的全栈但简单的邮件服务器 | | | 🟢 | | MDC-NG | https://github.com/mdc-ng/mdc-ng/ | 成人电影数据采集工具 | | +| 🟢 | | Mastodon (长毛象) | https://joinmastodon.org/ | 自由开源的去中心化的分布式微博客社交网络 | | | 🟢 | | MaxKB | https://maxkb.cn/ | 基于 LLM 大语言模型的知识库问答系统 | | | 🟢 | | Media CMS | https://mediacms.io/ | 现代、功能齐全的开源视频和媒体内容管理系统 | | | 🟢 | | MetaTube | https://github.com/metatube-community/ | 为 Jellyfin/Emby/Plex 开发的超级好用的成人元数据刮削插件 | | diff --git a/apps/mastodon/4.3.6/data.yml b/apps/mastodon/4.3.6/data.yml new file mode 100644 index 00000000..2b490eee --- /dev/null +++ b/apps/mastodon/4.3.6/data.yml @@ -0,0 +1,159 @@ +additionalProperties: + formFields: + - child: + default: "" + envKey: PANEL_POSTGRES_SERVICE + required: true + type: service + default: postgresql + envKey: PANEL_POSTGRES_TYPE + labelZh: Postgres 服务 (前置检查) + labelEn: Postgres Service (Pre-check) + required: true + type: apps + values: + - label: PostgreSQL + value: postgresql + - child: + default: "" + envKey: PANEL_REDIS_SERVICE + required: true + type: service + default: redis + envKey: PANEL_REDIS_TYPE + labelZh: Redis 服务 (前置检查) + labelEn: Redis Service (Pre-check) + required: true + type: apps + values: + - label: Redis + value: redis + - default: "/home/mastodon" + edit: true + envKey: MASTODON_ROOT_PATH + labelZh: 数据持久化路径 + labelEn: Data persistence path + required: true + type: text + - default: 3000 + edit: true + envKey: PANEL_APP_PORT_HTTP + labelZh: WebUI 端口 + labelEn: WebUI port + required: true + rule: paramPort + type: number + - default: 4000 + edit: true + envKey: PANEL_APP_PORT_STREAM + labelZh: Stream 端口 + labelEn: Stream port + required: true + rule: paramPort + type: number + - default: "127.0.0.1" + edit: true + envKey: DB_HOST + labelZh: 数据库 主机地址 + labelEn: Database Host + required: true + type: text + - default: 5432 + edit: true + envKey: DB_PORT + labelZh: 数据库 端口 + labelEn: Database Port + required: true + rule: paramPort + type: number + - default: "mastodon" + edit: true + envKey: DB_NAME + labelZh: 数据库 名称 + labelEn: Database Name + required: true + rule: paramCommon + type: text + - default: "mastodon" + edit: true + envKey: DB_USER + labelZh: 数据库 用户名 + labelEn: Database Username + required: true + type: text + - default: "" + edit: true + envKey: DB_PASS + labelZh: 数据库 密码 + labelEn: Database Password + random: true + required: true + rule: paramComplexity + type: password + - default: "127.0.0.1" + edit: true + envKey: REDIS_HOST + labelZh: Redis 主机 + labelEn: Redis Host + required: true + type: text + - default: 6379 + edit: true + envKey: REDIS_PORT + labelZh: Redis 端口 + labelEn: Redis Port + required: true + rule: paramPort + type: number + - default: 0 + edit: true + envKey: REDIS_DB + labelZh: Redis 索引 (0-20) + labelEn: Redis Index (0-20) + required: true + type: number + - default: "" + edit: true + envKey: REDIS_USERNAME + labelZh: Redis 用户名 + labelEn: Redis UserName + required: false + type: text + - default: "" + edit: true + envKey: REDIS_PASSWORD + labelZh: Redis 密码 + labelEn: Redis Password + required: false + type: password + - default: "127.0.0.1" + edit: true + envKey: ES_HOST + labelZh: ES数据库 主机地址 + labelEn: Database Host + required: false + type: text + - default: 9200 + edit: true + envKey: ES_PORT + labelZh: ES数据库 端口 + labelEn: Database Port + required: false + rule: paramPort + type: number + - default: "elastic" + edit: true + envKey: ES_USER + labelZh: ES数据库 用户名 + labelEn: Database Username + required: false + type: text + - default: "" + edit: true + envKey: ES_PASS + labelZh: ES数据库 密码 + labelEn: Database Password + random: true + required: false + rule: paramComplexity + type: password diff --git a/apps/mastodon/4.3.6/docker-compose.yml b/apps/mastodon/4.3.6/docker-compose.yml new file mode 100644 index 00000000..7c637eb1 --- /dev/null +++ b/apps/mastodon/4.3.6/docker-compose.yml @@ -0,0 +1,62 @@ +networks: + 1panel-network: + external: true + +services: + mastodon: + image: ghcr.io/mastodon/mastodon:v4.3.6 + container_name: ${CONTAINER_NAME} + labels: + createdBy: "Apps" + restart: always + command: bundle exec puma -C config/puma.rb + networks: + - 1panel-network + ports: + - ${PANEL_APP_PORT_HTTP}:3000 + env_file: + - ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env} + - ${APP_ENV_FILE:-/etc/1panel/envs/mastodon/mastodon.env} + - ${ENV_FILE:-/etc/1panel/envs/default.env} + volumes: + - ${MASTODON_ROOT_PATH}/system:/mastodon/public/system + environment: + - TZ=Asia/Shanghai + healthcheck: + test: [ 'CMD-SHELL',"curl -s --noproxy localhost localhost:3000/health | grep -q 'OK' || exit 1" ] + + streaming-mastodon: + image: ghcr.io/mastodon/mastodon-streaming:v4.3.6 + container_name: streaming-${CONTAINER_NAME} + restart: always + command: node ./streaming/index.js + networks: + - 1panel-network + ports: + - ${PANEL_APP_PORT_STREAM}:4000 + env_file: + - ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env} + - ${APP_ENV_FILE:-/etc/1panel/envs/mastodon/mastodon.env} + - ${ENV_FILE:-/etc/1panel/envs/default.env} + environment: + - TZ=Asia/Shanghai + healthcheck: + test: [ 'CMD-SHELL', "curl -s --noproxy localhost localhost:4000/api/v1/streaming/health | grep -q 'OK' || exit 1" ] + + sidekiq-mastodon: + image: ghcr.io/mastodon/mastodon:v4.3.6 + container_name: sidekiq-${CONTAINER_NAME} + restart: always + command: bundle exec sidekiq + networks: + - 1panel-network + env_file: + - ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env} + - ${APP_ENV_FILE:-/etc/1panel/envs/mastodon/mastodon.env} + - ${ENV_FILE:-/etc/1panel/envs/default.env} + volumes: + - ${MASTODON_ROOT_PATH}/system:/mastodon/public/system + environment: + - TZ=Asia/Shanghai + healthcheck: + test: [ 'CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false" ] diff --git a/apps/mastodon/4.3.6/envs/default.env b/apps/mastodon/4.3.6/envs/default.env new file mode 100644 index 00000000..cd05f46e --- /dev/null +++ b/apps/mastodon/4.3.6/envs/default.env @@ -0,0 +1,2 @@ +# copyright© 2024 XinJiang Ms Studio +ENV_FILE=.env diff --git a/apps/mastodon/4.3.6/envs/global.env b/apps/mastodon/4.3.6/envs/global.env new file mode 100644 index 00000000..e10989fe --- /dev/null +++ b/apps/mastodon/4.3.6/envs/global.env @@ -0,0 +1,2 @@ +# copyright© 2024 XinJiang Ms Studio +TZ=Asia/Shanghai diff --git a/apps/mastodon/4.3.6/envs/mastodon.env b/apps/mastodon/4.3.6/envs/mastodon.env new file mode 100644 index 00000000..12ab2b6d --- /dev/null +++ b/apps/mastodon/4.3.6/envs/mastodon.env @@ -0,0 +1,109 @@ +# This is a sample configuration file. You can generate your configuration +# with the `bundle exec rails mastodon:setup` interactive setup wizard, but to customize +# your setup even further, you'll need to edit it manually. This sample does +# not demonstrate all available configuration options. Please look at +# https://docs.joinmastodon.org/admin/config/ for the full documentation. + +# Note that this file accepts slightly different syntax depending on whether +# you are using `docker-compose` or not. In particular, if you use +# `docker-compose`, the value of each declared variable will be taken verbatim, +# including surrounding quotes. +# See: https://github.com/mastodon/mastodon/issues/16895 + +# Federation +# ---------- +# This identifies your server and cannot be changed safely later +# ---------- +LOCAL_DOMAIN=example.com + +# Redis +# ----- +REDIS_HOST=localhost +REDIS_PORT=6379 + +# PostgreSQL +# ---------- +DB_HOST=/var/run/postgresql +DB_USER=mastodon +DB_NAME=mastodon_production +DB_PASS= +DB_PORT=5432 + +# Elasticsearch (optional) +# ------------------------ +ES_ENABLED=true +ES_HOST=localhost +ES_PORT=9200 +# Authentication for ES (optional) +ES_USER=elastic +ES_PASS=password + +# Secrets +# ------- +# Make sure to use `bundle exec rails secret` to generate secrets +# ------- +SECRET_KEY_BASE= +OTP_SECRET= + +# Encryption secrets +# ------------------ +# Must be available (and set to same values) for all server processes +# These are private/secret values, do not share outside hosting environment +# Use `bin/rails db:encryption:init` to generate fresh secrets +# Do NOT change these secrets once in use, as this would cause data loss and other issues +# ------------------ +# ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY= +# ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT= +# ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY= + +# Web Push +# -------- +# Generate with `bundle exec rails mastodon:webpush:generate_vapid_key` +# -------- +VAPID_PRIVATE_KEY= +VAPID_PUBLIC_KEY= + +# Sending mail +# ------------ +SMTP_SERVER= +SMTP_PORT=587 +SMTP_LOGIN= +SMTP_PASSWORD= +SMTP_FROM_ADDRESS=notifications@example.com + +# File storage (optional) +# ----------------------- +S3_ENABLED=true +S3_BUCKET=files.example.com +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +S3_ALIAS_HOST=files.example.com + +# IP and session retention +# ----------------------- +# Make sure to modify the scheduling of ip_cleanup_scheduler in config/sidekiq.yml +# to be less than daily if you lower IP_RETENTION_PERIOD below two days (172800). +# ----------------------- +IP_RETENTION_PERIOD=31556952 +SESSION_RETENTION_PERIOD=31556952 + +# Fetch All Replies Behavior +# -------------------------- +# When a user expands a post (DetailedStatus view), fetch all of its replies +# (default: false) +FETCH_REPLIES_ENABLED=false + +# Period to wait between fetching replies (in minutes) +FETCH_REPLIES_COOLDOWN_MINUTES=15 + +# Period to wait after a post is first created before fetching its replies (in minutes) +FETCH_REPLIES_INITIAL_WAIT_MINUTES=5 + +# Max number of replies to fetch - total, recursively through a whole reply tree +FETCH_REPLIES_MAX_GLOBAL=1000 + +# Max number of replies to fetch - for a single post +FETCH_REPLIES_MAX_SINGLE=500 + +# Max number of replies Collection pages to fetch - total +FETCH_REPLIES_MAX_PAGES=500 diff --git a/apps/mastodon/4.3.6/scripts/init.sh b/apps/mastodon/4.3.6/scripts/init.sh new file mode 100644 index 00000000..07fb8c3f --- /dev/null +++ b/apps/mastodon/4.3.6/scripts/init.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +if [ -f .env ]; then + source .env + + # setup-1 add default values + CURRENT_DIR=$(pwd) + sed -i '/^ENV_FILE=/d' .env + sed -i '/^GLOBAL_ENV_FILE=/d' .env + echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env + echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi diff --git a/apps/mastodon/4.3.6/scripts/uninstall.sh b/apps/mastodon/4.3.6/scripts/uninstall.sh new file mode 100644 index 00000000..c86c4fbc --- /dev/null +++ b/apps/mastodon/4.3.6/scripts/uninstall.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +if [ -f .env ]; then + source .env + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi diff --git a/apps/mastodon/4.3.6/scripts/upgrade.sh b/apps/mastodon/4.3.6/scripts/upgrade.sh new file mode 100644 index 00000000..07fb8c3f --- /dev/null +++ b/apps/mastodon/4.3.6/scripts/upgrade.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +if [ -f .env ]; then + source .env + + # setup-1 add default values + CURRENT_DIR=$(pwd) + sed -i '/^ENV_FILE=/d' .env + sed -i '/^GLOBAL_ENV_FILE=/d' .env + echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env + echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi diff --git a/apps/mastodon/README.md b/apps/mastodon/README.md new file mode 100644 index 00000000..6e854692 --- /dev/null +++ b/apps/mastodon/README.md @@ -0,0 +1,48 @@ +# Mastodon (长毛象) + +自由开源的去中心化的分布式微博客社交网络 + +![Mastodon](https://file.lifebus.top/imgs/mastodon_cover.png) + +![](https://img.shields.io/badge/%E6%96%B0%E7%96%86%E8%90%8C%E6%A3%AE%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91%E5%B7%A5%E4%BD%9C%E5%AE%A4-%E6%8F%90%E4%BE%9B%E6%8A%80%E6%9C%AF%E6%94%AF%E6%8C%81-blue) + +## 简介 + +Mastodon 是一款基于 ActivityPub 的免费开源社交网络服务器,用户可以关注好友并发现新朋友。在 Mastodon +上,用户可以发布任何他们想要的内容:链接、图片、文本和视频。所有 Mastodon 服务器都可以作为联合网络互操作(一台服务器上的用户可以与另一台服务器上的用户无缝通信,包括实现 +ActivityPub 的非 Mastodon 软件!) + +## 特征 + +### 不受供应商限制 + +可与任何符合要求的平台完全互操作- 不一定是 Mastodon;无论实现 ActivityPub 的是什么,都是社交网络的一部分!了解更多 + +### 实时、按时间顺序排列的时间线更新 + +您关注的人的更新会通过 WebSockets 实时显示在 UI 中。还有流水线视图! + +### 媒体附件,如图片和短视频 + +上传和查看更新中附加的图片和 WebM/MP4 视频。没有音轨的视频将被视为 GIF;普通视频将连续循环播放! + +### 安全和审核工具 + +Mastodon 包括私人帖子、锁定帐户、短语过滤、静音、屏蔽和各种其他功能,以及报告和审核系统。了解更多 + +### OAuth2 和简单的 REST API + +Mastodon 充当 OAuth2 提供商,因此第三方应用可以使用 REST 和 Streaming +API。这带来了一个拥有众多选择的丰富应用生态系统! + +## 安装说明 + +> 项目使用 软件版本 +> +> Redis 4+ +> +> PostgreSQL 12+ + +--- + +![Ms Studio](https://file.lifebus.top/imgs/ms_blank_001.png) diff --git a/apps/mastodon/data.yml b/apps/mastodon/data.yml new file mode 100644 index 00000000..2900e80b --- /dev/null +++ b/apps/mastodon/data.yml @@ -0,0 +1,14 @@ +additionalProperties: + key: mastodon + name: Mastodon (长毛象) + tags: + - WebSite + - Local + shortDescZh: 自由开源的去中心化的分布式微博客社交网络 + shortDescEn: Your self-hosted, globally interconnected microblogging community + type: website + crossVersionUpdate: true + limit: 0 + website: https://joinmastodon.org/ + github: https://github.com/mastodon/mastodon/ + document: https://docs.joinmastodon.org/ diff --git a/apps/mastodon/logo.png b/apps/mastodon/logo.png new file mode 100644 index 00000000..e80d6c71 Binary files /dev/null and b/apps/mastodon/logo.png differ diff --git a/envs/mastodon/mastodon.env b/envs/mastodon/mastodon.env new file mode 100644 index 00000000..12ab2b6d --- /dev/null +++ b/envs/mastodon/mastodon.env @@ -0,0 +1,109 @@ +# This is a sample configuration file. You can generate your configuration +# with the `bundle exec rails mastodon:setup` interactive setup wizard, but to customize +# your setup even further, you'll need to edit it manually. This sample does +# not demonstrate all available configuration options. Please look at +# https://docs.joinmastodon.org/admin/config/ for the full documentation. + +# Note that this file accepts slightly different syntax depending on whether +# you are using `docker-compose` or not. In particular, if you use +# `docker-compose`, the value of each declared variable will be taken verbatim, +# including surrounding quotes. +# See: https://github.com/mastodon/mastodon/issues/16895 + +# Federation +# ---------- +# This identifies your server and cannot be changed safely later +# ---------- +LOCAL_DOMAIN=example.com + +# Redis +# ----- +REDIS_HOST=localhost +REDIS_PORT=6379 + +# PostgreSQL +# ---------- +DB_HOST=/var/run/postgresql +DB_USER=mastodon +DB_NAME=mastodon_production +DB_PASS= +DB_PORT=5432 + +# Elasticsearch (optional) +# ------------------------ +ES_ENABLED=true +ES_HOST=localhost +ES_PORT=9200 +# Authentication for ES (optional) +ES_USER=elastic +ES_PASS=password + +# Secrets +# ------- +# Make sure to use `bundle exec rails secret` to generate secrets +# ------- +SECRET_KEY_BASE= +OTP_SECRET= + +# Encryption secrets +# ------------------ +# Must be available (and set to same values) for all server processes +# These are private/secret values, do not share outside hosting environment +# Use `bin/rails db:encryption:init` to generate fresh secrets +# Do NOT change these secrets once in use, as this would cause data loss and other issues +# ------------------ +# ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY= +# ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT= +# ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY= + +# Web Push +# -------- +# Generate with `bundle exec rails mastodon:webpush:generate_vapid_key` +# -------- +VAPID_PRIVATE_KEY= +VAPID_PUBLIC_KEY= + +# Sending mail +# ------------ +SMTP_SERVER= +SMTP_PORT=587 +SMTP_LOGIN= +SMTP_PASSWORD= +SMTP_FROM_ADDRESS=notifications@example.com + +# File storage (optional) +# ----------------------- +S3_ENABLED=true +S3_BUCKET=files.example.com +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +S3_ALIAS_HOST=files.example.com + +# IP and session retention +# ----------------------- +# Make sure to modify the scheduling of ip_cleanup_scheduler in config/sidekiq.yml +# to be less than daily if you lower IP_RETENTION_PERIOD below two days (172800). +# ----------------------- +IP_RETENTION_PERIOD=31556952 +SESSION_RETENTION_PERIOD=31556952 + +# Fetch All Replies Behavior +# -------------------------- +# When a user expands a post (DetailedStatus view), fetch all of its replies +# (default: false) +FETCH_REPLIES_ENABLED=false + +# Period to wait between fetching replies (in minutes) +FETCH_REPLIES_COOLDOWN_MINUTES=15 + +# Period to wait after a post is first created before fetching its replies (in minutes) +FETCH_REPLIES_INITIAL_WAIT_MINUTES=5 + +# Max number of replies to fetch - total, recursively through a whole reply tree +FETCH_REPLIES_MAX_GLOBAL=1000 + +# Max number of replies to fetch - for a single post +FETCH_REPLIES_MAX_SINGLE=500 + +# Max number of replies Collection pages to fetch - total +FETCH_REPLIES_MAX_PAGES=500