diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 35ee617..4b4a75e 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -16,4 +16,4 @@ jobs: - uses: actions/checkout@v4 - name: Build the Docker image - run: docker build . --file Dockerfile/dockerfile.bbsd --tag lbbs-bbsd:$(date +%s) + run: docker compose build diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index c60779a..8a96be7 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -35,12 +35,6 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 - with: - images: leafok/lbbs - - name: Build and push Docker image id: push-bbsd uses: docker/build-push-action@v5 diff --git a/ChangeLog.md b/ChangeLog.md index 158bdbf..7e689a8 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,74 +1,67 @@ -# Changelog of LBBS - Classical terminal server of LeafOK BBS +# LBBS Changelog - Classic Terminal Server for LeafOK BBS -中文版本的ChangeLog.md位于[ChangeLog.zh_CN.md](ChangeLog.zh_CN.md) +The Chinese version of this changelog is available at [ChangeLog.zh_CN.md](ChangeLog.zh_CN.md). +## 2025-12-26 v1.7 -2025-12-26 v1.7 -================= -Add minor features +### Major Features Added -1. Enhance article management +1. Docker container deployment support +2. Enhanced article management capabilities +## 2025-11-21 v1.6 -2025-11-21 v1.6 -================= -Support running on MSYS2 / MinGW64 +Added support for running on MSYS2 / MinGW64 environments. +## 2025-11-07 v1.5 -2025-11-07 v1.5 -================= -Add major features +### Major Features Added -1. Display of all user list -2. Display of online user list -3. Display user information of selected item -4. Search user by username -5. Search article by username -6. Search article by title -7. Bad words filter -8. Selection of variant / fixed display width of wide-character +1. Complete user list display +2. Online user list display +3. Detailed user information display for selected items +4. User search by username +5. Article search by author username +6. Article search by title +7. Bad words filtering system +8. Variable/fixed width display selection for wide characters +## 2025-10-15 v1.4 -2025-10-15 v1.4 -================= -Add major features +### Major Features Added -1. Personal favorite topics -2. Menu of top 10 hot topics -3. Allow charset selection (UTF-8 or GBK) by user -4. Support full / partial line deletion in text editor +1. Personal favorite topics/bookmarks +2. "Top 10 Hot Topics" menu +3. User-selectable character encoding (UTF-8 or GBK) +4. Full/partial line deletion support in text editor +## 2025-07-01 v1.3 -2025-07-01 v1.3 -================= -1. Support UTF8 instead of GBK -2. Support charset conversion in BBSNET +1. UTF-8 encoding support (replacing GBK) +2. Character set conversion support in BBSNET +## 2025-06-28 v1.2 -2025-06-28 v1.2 -================= -Add major features +### Major Features Added -1. Display specific articles at the top (bottom) of the section -2. Excerptional directories and articles +1. Pinned article display at top/bottom of section lists +2. Excerpt/featured directories and articles display +## 2025-06-15 v1.1 -2025-06-15 v1.1 -================= -Major release with all fundamental features +Major release containing all fundamental features: -1. Post / modify / reply article with text editor -2. Delete article by user self or admin -3. New / viewed article status display -4. SSH2 secure connection +1. Post, modify, and reply to articles using text editor +2. Article deletion by users (self) or administrators +3. New/viewed article status indicators +4. SSH2 secure connection support +## 2025-05-31 v1.0 -2025-05-31 v1.0 -================= -Initial release with major features ready +Initial release with core features: -1. User login with accounts registered in Web -2. Board category / list with user favor setting -3. Article list per board with topic articles group selection -4. Article reader with quick article / topic selecting -5. Utilities, such as game, site shuttle, etc. +1. User login with web-registered accounts +2. Board categories and lists with user favorites +3. Article lists per board with topic grouping +4. Article reader with quick article/topic navigation +5. Utilities including games and site shuttle diff --git a/ChangeLog.zh_CN.md b/ChangeLog.zh_CN.md index 336e5b5..ceb086b 100644 --- a/ChangeLog.zh_CN.md +++ b/ChangeLog.zh_CN.md @@ -1,73 +1,67 @@ -# Changelog of LBBS - Classical terminal server of LeafOK BBS +# LBBS 更新日志 - LeafOK BBS 经典终端服务器 +英文版本的更新日志位于 [ChangeLog.md](ChangeLog.md)。 -2025-12-26 v1.7 -================= -新增功能 +## 2025-12-26 v1.7 -1. 完善文章管理 +### 新增主要功能 +1. 支持 Docker 容器化部署 +2. 完善文章管理功能 -2025-11-21 v1.6 -================= -支持运行在MSYS2 / MinGW64环境上 +## 2025-11-21 v1.6 +新增对 MSYS2 / MinGW64 环境的运行支持。 -2025-11-07 v1.5 -================= -新增功能 +## 2025-11-07 v1.5 -1. 全部用户列表显示 -2. 在线用户列表显示 -3. 显示选中项的用户信息 -4. 按用户名查找用户 -5. 按用户名查找文章 -6. 按标题查找文章 -7. 敏感词过滤 -8. 多字节字符的变宽/定宽处理 +### 新增主要功能 +1. 全部用户列表显示 +2. 在线用户列表显示 +3. 显示选中项的用户详细信息 +4. 按用户名查找用户 +5. 按作者用户名查找文章 +6. 按标题查找文章 +7. 敏感词过滤系统 +8. 多字节字符的变宽/定宽显示选择 -2025-10-15 v1.4 -================= -新增功能 +## 2025-10-15 v1.4 -1. 个人收藏主题文章 -2. “本站十大热点”菜单 -3. 允许用户选择UTF-8/GBK编码 -4. 文本编辑器中,支持整行/剩余行快速删除 +### 新增主要功能 +1. 个人收藏主题文章功能 +2. "本站十大热点"菜单 +3. 允许用户选择字符编码(UTF-8 或 GBK) +4. 文本编辑器中支持整行/剩余行快速删除 -2025-07-01 v1.3 -================= -1. 启用UTF-8编码 -2. 站点穿梭支持转码 +## 2025-07-01 v1.3 +1. 启用 UTF-8 编码(替代 GBK) +2. 站点穿梭支持字符集转换 -2025-06-28 v1.2 -================= -新增功能 +## 2025-06-28 v1.2 -1. 版块文章列表置顶文章显示 -2. 版块精华区目录和文章显示 +### 新增主要功能 +1. 版块文章列表置顶文章显示功能 +2. 版块精华区目录和文章显示 -2025-06-15 v1.1 -================= -完善基础功能 +## 2025-06-15 v1.1 -1. 文本编辑器,支持发表/修改/回复文章 -2. 自行删除和管理员删除文章 -3. 未读/已读文章状态显示 -4. SSH2安全连接 +包含所有基础功能的主要版本: +1. 文本编辑器支持发表、修改、回复文章 +2. 支持用户自行删除和管理员删除文章 +3. 未读/已读文章状态显示 +4. SSH2 安全连接支持 -2025-05-31 v1.0 -================= -包含部分基础功能的初始版本 +## 2025-05-31 v1.0 -1. 已注册用户账户登陆 -2. 版块栏目/列表,可显示用户收藏版块 -3. 版块文章列表,支持同主题文章高亮显示 -4. 文章阅读,支持同主题阅读模式 -5. 站点穿梭、小游戏等实用工具 +包含核心功能的初始版本: +1. 已注册用户账户登录 +2. 版块栏目/列表,支持显示用户收藏版块 +3. 版块文章列表,支持同主题文章分组显示 +4. 文章阅读器,支持快速文章/主题导航 +5. 实用工具,包括小游戏和站点穿梭 diff --git a/INSTALL.md b/INSTALL.md index dc0d44e..add9a19 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,86 +1,155 @@ -Installation -================== -To install LBBS on Linux (e.g. Debian 13, CentOS Stream 10), please perform the following steps: - -0) Prerequisite - Follow README.md under [leafok_bbs](https://github.com/leafok/leafok_bbs) to initialize the database structure shared by both web version and telnet version. - It is highly recommended to finish the configuration steps of web version first and make sure those features could work properly. - -1) Common requirements - gcc >= 13.3 - autoconf >= 2.68 - automake >= 1.16 - php >= 8.2 - mysql >= 8.4 - (For Debian / Ubuntu) - sudo apt-get install -y libssh-dev libsystemd-dev - (For CentOS / RHEL) - sudo dnf install -y libssh-devel systemd-devel - (For MSYS2 with MinGW-w64 toolchain) - pacman -S --needed msys2-runtime-devel libssh libssh-devel pcre2-devel mingw-w64-x86_64-libiconv mingw-w64-x86_64-libmariadbclient - -3) Extract the source files from a tarball or export from GitHub - Run the following command to set up the autoconf/automake environment, - autoreconf --install --force - -4) Compile source files - export LBBS_HOME_DIR=/usr/local/lbbs - (For Linux) - ./configure --prefix=$LBBS_HOME_DIR - (For MSYS2 with MinGW-w64 toolchain) - ./configure --prefix=$LBBS_HOME_DIR --disable-shared PKG_CONFIG_PATH=/mingw64/lib/pkgconfig/ - make - -5) Create user and group - sudo useradd bbs - -6) Install binary files and data files - sudo make install - chown -R bbs:bbs $LBBS_HOME_DIR - -7) Modify following configuration files - Default configuration files is saved as *.default, you should rename them first. - $LBBS_HOME_DIR/conf/bbsd.conf - $LBBS_HOME_DIR/conf/bbsnet.conf - $LBBS_HOME_DIR/conf/badwords.conf - $LBBS_HOME_DIR/utils/conf/db_conn.conf.php - -8) Copy CA cert file of MySQL server to $LBBS_HOME_DIR/conf/ca_cert.pem - -9) Generate menu configuration file with section data by running the script - sudo -u bbs php $LBBS_HOME_DIR/utils/bin/gen_section_menu.php - sudo -u bbs php $LBBS_HOME_DIR/utils/bin/gen_ex_list.php - sudo -u bbs php $LBBS_HOME_DIR/utils/bin/gen_top.php - -10) Create SSH2 RSA / ED25519 certificate - ssh-keygen -t rsa -C "Your Server Name" -N "" -f $LBBS_HOME_DIR/conf/ssh_host_rsa_key - ssh-keygen -t ed25519 -C "Your Server Name" -N "" -f $LBBS_HOME_DIR/conf/ssh_host_ed25519_key - ssh-keygen -t ecdsa -C "Your Server Name" -N "" -f $LBBS_HOME_DIR/conf/ssh_host_ecdsa_key - -11) Startup - sudo -u bbs $LBBS_HOME_DIR/bin/bbsd - -12) (Optional) Set up systemd - Create your own /usr/lib/systemd/system/lbbs.service from the sample at conf/lbbs.service, and make any change if necessary. - Reload daemon config and start the service. - -13) (Optional) Set up logrotate - Create your own /etc/logrotate.d/lbbs from the sample at conf/lbbs.logrotate, and make any change if necessary. - Restart logrotate service. - -14) Cleanup on abnormal service termination - In case of any unexpected failure or improper operation which results in abnormal termination of lbbs process, manual cleanup of shared memory / semaphore might be required before re-launch the process. Run the following command to check first: - sudo -u bbs ipcs - There should be no item owned by bbs. Otherwise, run the following command to cleanup: - sudo -u bbs ipcrm -a - - -For Docker user -================== -You may either build the docker image from source code by running: - docker compose up --build -d - -or pull the docker image per release from Docker Hub by running: - docker compose pull - -You should always create / update the configuration files for local configuration (e.g. database connection, network port) as described above. +# Installation + +The Chinese version of this changelog is available at [INSTALL.zh_CN.md](INSTALL.zh_CN.md). + +To install LBBS on Linux (e.g., Debian 13, CentOS Stream 10), please perform the following steps: + +## 0. Prerequisites + +Follow the instructions in [leafok_bbs](https://github.com/leafok/leafok_bbs) README.md to initialize the database structure shared by both the web and telnet versions. + +It is highly recommended to complete the web version configuration steps first and ensure those features work properly. + +## 1. Common Requirements + +- gcc >= 13.3 +- autoconf >= 2.68 +- automake >= 1.16 +- php >= 8.2 +- mysql >= 8.4 + +### Distribution-Specific Packages + +**Debian / Ubuntu:** +```bash +sudo apt-get install -y libssh-dev libsystemd-dev +``` + +**CentOS / RHEL:** +```bash +sudo dnf install -y libssh-devel systemd-devel +``` + +**MSYS2 with MinGW-w64 toolchain:** +```bash +pacman -S --needed msys2-runtime-devel libssh libssh-devel pcre2-devel mingw-w64-x86_64-libiconv mingw-w64-x86_64-libmariadbclient +``` + +## 2. Extract Source Files + +Extract the source files from a tarball or export from GitHub. + +Run the following command to set up the autoconf/automake environment: +```bash +autoreconf --install --force +``` + +## 3. Compile Source Files + +```bash +export LBBS_HOME_DIR=/usr/local/lbbs +``` + +**For Linux:** +```bash +./configure --prefix=$LBBS_HOME_DIR +``` + +**For MSYS2 with MinGW-w64 toolchain:** +```bash +./configure --prefix=$LBBS_HOME_DIR --disable-shared PKG_CONFIG_PATH=/mingw64/lib/pkgconfig/ +``` + +```bash +make +``` + +## 4. Create User and Group + +```bash +sudo useradd bbs +``` + +## 5. Install Binary and Data Files + +```bash +sudo make install +chown -R bbs:bbs $LBBS_HOME_DIR +``` + +## 6. Modify Configuration Files + +Default configuration files are saved as `*.default`. Rename them first: + +- `$LBBS_HOME_DIR/conf/bbsd.conf` +- `$LBBS_HOME_DIR/conf/bbsnet.conf` +- `$LBBS_HOME_DIR/conf/badwords.conf` +- `$LBBS_HOME_DIR/utils/conf/db_conn.conf.php` + +## 7. Copy MySQL CA Certificate + +Copy the MySQL server's CA certificate file to `$LBBS_HOME_DIR/conf/ca_cert.pem`. + +## 8. Generate Menu Configuration Files + +Run the following scripts to generate menu configuration files with section data: + +```bash +sudo -u bbs php $LBBS_HOME_DIR/utils/bin/gen_section_menu.php +sudo -u bbs php $LBBS_HOME_DIR/utils/bin/gen_ex_list.php +sudo -u bbs php $LBBS_HOME_DIR/utils/bin/gen_top.php +``` + +## 9. Create SSH2 Certificates + +```bash +ssh-keygen -t rsa -C "Your Server Name" -N "" -f $LBBS_HOME_DIR/conf/ssh_host_rsa_key +ssh-keygen -t ed25519 -C "Your Server Name" -N "" -f $LBBS_HOME_DIR/conf/ssh_host_ed25519_key +ssh-keygen -t ecdsa -C "Your Server Name" -N "" -f $LBBS_HOME_DIR/conf/ssh_host_ecdsa_key +``` + +## 10. Startup + +```bash +sudo -u bbs $LBBS_HOME_DIR/bin/bbsd +``` + +## 11. (Optional) Set Up systemd + +Create your own `/usr/lib/systemd/system/lbbs.service` from the sample at `conf/lbbs.service`, and make any necessary changes. + +Reload daemon configuration and start the service. + +## 12. (Optional) Set Up logrotate + +Create your own `/etc/logrotate.d/lbbs` from the sample at `conf/lbbs.logrotate`, and make any necessary changes. + +Restart the logrotate service. + +## 13. Cleanup on Abnormal Service Termination + +In case of unexpected failure or improper operation resulting in abnormal termination of the LBBS process, manual cleanup of shared memory/semaphore might be required before relaunching the process. + +First, check with: +```bash +sudo -u bbs ipcs +``` + +There should be no items owned by `bbs`. Otherwise, clean up with: +```bash +sudo -u bbs ipcrm -a +``` + +# For Docker Users + +You may either build the Docker image from source code by running: +```bash +docker compose up --build -d +``` + +or pull the Docker image per release from Docker Hub by running: +```bash +docker compose pull +``` + +You should always create/update the configuration files for local configuration (e.g., database connection, network port) as described above. \ No newline at end of file diff --git a/INSTALL.zh_CN.md b/INSTALL.zh_CN.md index d0ff5c2..0471d98 100644 --- a/INSTALL.zh_CN.md +++ b/INSTALL.zh_CN.md @@ -1,85 +1,155 @@ -安装说明 -================== -请按照以下步骤在Linux (例如: Debian 13, CentOS Stream 10) 上进行LBBS的编译和安装: - -0) 准备工作 - 按照[leafok_bbs](https://github.com/leafok/leafok_bbs)下README.md的说明,初始化Web/Telnet版本共享的数据库。 - 强烈建议先按照Web版本的说明完成基础功能的配置和验证,再开始Telnet版本的安装。 - -1) 通用工具/基础库依赖 - gcc >= 14.2 - autoconf >= 2.68 - automake >= 1.16 - php >= 8.2 - mysql >= 8.4 - (Debian / Ubuntu 用户) - sudo apt-get install -y libssh-dev libsystemd-dev - (For CentOS / RHEL 用户) - sudo dnf install -y libssh-devel systemd-devel - (MSYS2 with MinGW-w64 toolchain 用户) - pacman -S --needed msys2-runtime-devel libssh libssh-devel pcre2-devel mingw-w64-x86_64-libiconv mingw-w64-x86_64-libmariadbclient - -2) 从Github导出或下载源代码文件 - 运行以下命令来初始化autoconf/automake环境: - autoreconf --install --force - -3) 编译源代码 - export LBBS_HOME_DIR=/usr/local/lbbs - (Linux用户) - ./configure --prefix=$LBBS_HOME_DIR - (MSYS2用户: 需要MinGW-w64) - ./configure --prefix=$LBBS_HOME_DIR --disable-shared PKG_CONFIG_PATH=/mingw64/lib/pkgconfig/ - make - -4) 建立用户和组 - sudo useradd bbs - -5) 安装程序文件和数据文件 - sudo make install - chown -R bbs:bbs $LBBS_HOME_DIR - -6) 修改以下配置文件 - 默认配置文件被命名为*.default,请先将其改名。 - $LBBS_HOME_DIR/conf/bbsd.conf - $LBBS_HOME_DIR/conf/bbsnet.conf - $LBBS_HOME_DIR/conf/badwords.conf - $LBBS_HOME_DIR/utils/conf/db_conn.conf.php - -7) 运行以下脚本来生成菜单配置文件和版块精华区数据文件 - sudo -u bbs php $LBBS_HOME_DIR/utils/bin/gen_section_menu.php - sudo -u bbs php $LBBS_HOME_DIR/utils/bin/gen_ex_list.php - -8) 将MySQL服务器的CA证书文件,复制到$LBBS_HOME_DIR/conf/ca_cert.pem - -9) 创建SSH2 RSA / ED25519 证书 - ssh-keygen -t rsa -C "Your Server Name" -N "" -f $LBBS_HOME_DIR/conf/ssh_host_rsa_key - ssh-keygen -t ed25519 -C "Your Server Name" -N "" -f $LBBS_HOME_DIR/conf/ssh_host_ed25519_key - ssh-keygen -t ecdsa -C "Your Server Name" -N "" -f $LBBS_HOME_DIR/conf/ssh_host_ecdsa_key - -10) 启动服务程序 - sudo -u bbs $LBBS_HOME_DIR/bin/bbsd - -11) (可选) 配置systemd - 基于conf/lbbs.service创建/usr/lib/systemd/system/lbbs.service,并进行必要的修改。 - 刷新配置并启动服务。 - -12) (可选) 配置logrotate - 基于conf/lbbs.logrotate创建/etc/logrotate.d/bbsd,并进行必要的修改。 - 重启logrotate服务。 - -13) 服务异常终止时的清理 - 由于未预期的错误或者不当操作导致lbbs进程异常终止时,在重启服务之前可能需要进行共享内存/信号量的清理。先运行以下命令检测: - sudo -u bbs ipcs - 正常情况下不存在所有者是bbs的项。否则,请运行以下命令清理: - sudo -u bbs ipcrm -a - - -Docker用户 -================== -你可以从源代码位置生成容器镜像: - docker compose up --build -d - -也可以从Docker Hub下载镜像文件: - docker compose pull - -记得需要根据本地配置 (数据库连接、服务端口等) 修改配置文件,步骤见上节。 +# 安装说明 + +英文版本的更新日志位于 [INSTALL.md](INSTALL.md)。 + +要在 Linux(例如:Debian 13、CentOS Stream 10)上安装 LBBS,请按照以下步骤操作: + +## 0. 准备工作 + +按照 [leafok_bbs](https://github.com/leafok/leafok_bbs) 中的 README.md 说明,初始化 Web 和 Telnet 版本共享的数据库结构。 + +强烈建议先完成 Web 版本的配置步骤,并确保这些功能正常工作。 + +## 1. 通用要求 + +- gcc >= 13.3 +- autoconf >= 2.68 +- automake >= 1.16 +- php >= 8.2 +- mysql >= 8.4 + +### 发行版特定软件包 + +**Debian / Ubuntu:** +```bash +sudo apt-get install -y libssh-dev libsystemd-dev +``` + +**CentOS / RHEL:** +```bash +sudo dnf install -y libssh-devel systemd-devel +``` + +**MSYS2 with MinGW-w64 工具链:** +```bash +pacman -S --needed msys2-runtime-devel libssh libssh-devel pcre2-devel mingw-w64-x86_64-libiconv mingw-w64-x86_64-libmariadbclient +``` + +## 2. 提取源代码文件 + +从 tarball 或 GitHub 导出源代码文件。 + +运行以下命令来设置 autoconf/automake 环境: +```bash +autoreconf --install --force +``` + +## 3. 编译源代码 + +```bash +export LBBS_HOME_DIR=/usr/local/lbbs +``` + +**对于 Linux:** +```bash +./configure --prefix=$LBBS_HOME_DIR +``` + +**对于 MSYS2 with MinGW-w64 工具链:** +```bash +./configure --prefix=$LBBS_HOME_DIR --disable-shared PKG_CONFIG_PATH=/mingw64/lib/pkgconfig/ +``` + +```bash +make +``` + +## 4. 创建用户和组 + +```bash +sudo useradd bbs +``` + +## 5. 安装二进制和数据文件 + +```bash +sudo make install +chown -R bbs:bbs $LBBS_HOME_DIR +``` + +## 6. 修改配置文件 + +默认配置文件保存为 `*.default`。首先重命名它们: + +- `$LBBS_HOME_DIR/conf/bbsd.conf` +- `$LBBS_HOME_DIR/conf/bbsnet.conf` +- `$LBBS_HOME_DIR/conf/badwords.conf` +- `$LBBS_HOME_DIR/utils/conf/db_conn.conf.php` + +## 7. 复制 MySQL CA 证书 + +将 MySQL 服务器的 CA 证书文件复制到 `$LBBS_HOME_DIR/conf/ca_cert.pem`。 + +## 8. 生成菜单配置文件 + +运行以下脚本以生成包含版块数据的菜单配置文件: + +```bash +sudo -u bbs php $LBBS_HOME_DIR/utils/bin/gen_section_menu.php +sudo -u bbs php $LBBS_HOME_DIR/utils/bin/gen_ex_list.php +sudo -u bbs php $LBBS_HOME_DIR/utils/bin/gen_top.php +``` + +## 9. 创建 SSH2 证书 + +```bash +ssh-keygen -t rsa -C "您的服务器名称" -N "" -f $LBBS_HOME_DIR/conf/ssh_host_rsa_key +ssh-keygen -t ed25519 -C "您的服务器名称" -N "" -f $LBBS_HOME_DIR/conf/ssh_host_ed25519_key +ssh-keygen -t ecdsa -C "您的服务器名称" -N "" -f $LBBS_HOME_DIR/conf/ssh_host_ecdsa_key +``` + +## 10. 启动 + +```bash +sudo -u bbs $LBBS_HOME_DIR/bin/bbsd +``` + +## 11. (可选)设置 systemd + +从 `conf/lbbs.service` 中的示例创建您自己的 `/usr/lib/systemd/system/lbbs.service`,并进行任何必要的更改。 + +重新加载守护进程配置并启动服务。 + +## 12. (可选)设置 logrotate + +从 `conf/lbbs.logrotate` 中的示例创建您自己的 `/etc/logrotate.d/lbbs`,并进行任何必要的更改。 + +重新启动 logrotate 服务。 + +## 13. 服务异常终止时的清理 + +如果发生意外故障或操作不当导致 LBBS 进程异常终止,在重新启动进程之前可能需要手动清理共享内存/信号量。 + +首先,使用以下命令检查: +```bash +sudo -u bbs ipcs +``` + +不应存在属于 `bbs` 的项目。否则,使用以下命令清理: +```bash +sudo -u bbs ipcrm -a +``` + +# 对于 Docker 用户 + +您可以通过运行以下命令从源代码构建 Docker 镜像: +```bash +docker compose up --build -d +``` + +或者通过运行以下命令从 Docker Hub 拉取每个版本的 Docker 镜像: +```bash +docker compose pull +``` + +您应始终按照上述说明创建/更新本地配置(例如,数据库连接、网络端口)的配置文件。 \ No newline at end of file diff --git a/README.md b/README.md index 827fc40..0a638f6 100644 --- a/README.md +++ b/README.md @@ -1,43 +1,39 @@ # LBBS - Classical terminal server of LeafOK BBS -中文版本的README.md位于[README.zh_CN.md](README.zh_CN.md) +Chinese version of README.md is located at [README.zh_CN.md](README.zh_CN.md) +## Introduction -Introduction -================= -This software aims to providing a telnet-based interface for a pure web-based BBS [leafok_bbs](https://github.com/leafok/leafok_bbs). -Demo site : fenglin.info (Telnet 2323 / SSH2 2322) -![Welcome](misc/images/ssh_welcome.jpg "Welcome to LBBS") -![Menu](misc/images/telnet_menu.jpg "Main menu") -![Section](misc/images/telnet_section.jpg "List of articles") -![Reader](misc/images/telnet_article_reader.jpg "Article reader") +This software aims to provide a telnet-based interface for a pure web-based BBS [leafok_bbs](https://github.com/leafok/leafok_bbs). +Demo site: fenglin.info (Telnet 2323 / SSH2 2322) -System Requirement -================== -1) GNU C Compiler -2) PHP ( Version >= 8.2 ) -3) MySQL database ( Version >= 8.4 ) +![Welcome screen](misc/images/ssh_welcome.jpg "Welcome to LBBS") +![Main menu](misc/images/telnet_menu.jpg "Main menu") +![Section view](misc/images/telnet_section.jpg "List of articles") +![Article reader](misc/images/telnet_article_reader.jpg "Article reader") +## System Requirements -Installation -================== -See guide in [INSTALL.md](INSTALL.md) +1. GNU C Compiler +2. PHP (version 8.2 or higher) +3. MySQL database (version 8.4 or higher) +## Installation -Tutorial -================== -Watch demos and keynotes in [Tutorial.md](Tutorial.md) +See guide in [INSTALL.md](INSTALL.md) +## Tutorial -Copyright -================= -Copyright (C) 2004-2026 Leaflet +Watch demos and keynotes in [Tutorial.md](Tutorial.md) +## Copyright -License -================== -This program is free software; you can redistribute it and/or modify -it under the terms of the [GNU General Public License](LICENSE) as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. +Copyright (C) 2004-2026 Leaflet + +## License + +This program is free software; you can redistribute it and/or modify +it under the terms of the [GNU General Public License](LICENSE) as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. diff --git a/README.zh_CN.md b/README.zh_CN.md index 8bed38c..c8efaf5 100644 --- a/README.zh_CN.md +++ b/README.zh_CN.md @@ -1,39 +1,36 @@ -# LBBS - LeafOK BBS 的经典风格终端服务器 +# LBBS - LeafOK BBS 的经典终端服务器 -简介 -================= -本软件旨在为一个纯Web访问的BBS [leafok_bbs](https://github.com/leafok/leafok_bbs) 提供基于Telnet访问的界面。 -演示站点 : fenglin.info (Telnet 2323 / SSH2 2322) -![欢迎](misc/images/ssh_welcome.jpg "欢迎访问LBBS") -![菜单](misc/images/telnet_menu.jpg "主选单") -![版块](misc/images/telnet_section.jpg "文章列表") -![阅读](misc/images/telnet_article_reader.jpg "文章阅读") +英文版本的README.md位于[README.md](README.md) +## 简介 -系统需求 -================== -1) GCC编译器 -2) PHP ( 版本 >= 8.2 ) -3) MySQL数据库 ( 版本 >= 8.4 ) +本软件旨在为一个纯Web访问的BBS [leafok_bbs](https://github.com/leafok/leafok_bbs) 提供基于Telnet访问的界面。 +演示站点: fenglin.info (Telnet 2323 / SSH2 2322) -安装说明 -================== -中文安装说明位于[INSTALL.zh_CN.md](INSTALL.zh_CN.md) +![欢迎界面](misc/images/ssh_welcome.jpg "欢迎访问LBBS") +![主菜单](misc/images/telnet_menu.jpg "主选单") +![版块视图](misc/images/telnet_section.jpg "文章列表") +![文章阅读器](misc/images/telnet_article_reader.jpg "文章阅读") +## 系统需求 -教程 -================== -安装演示和技术架构介绍位于[Tutorial.zh_CN.md](Tutorial.zh_CN.md) +1. GNU C 编译器 +2. PHP (版本 8.2 或更高) +3. MySQL数据库 (版本 8.4 或更高) +## 安装说明 -版权信息 -================= -版权所有 (C) 2004-2026 Leaflet +中文安装指南位于[INSTALL.zh_CN.md](INSTALL.zh_CN.md) +## 教程 -授权许可 -================== -本程序是自由软件; -你可以按照自由软件基金会发布的[GNU通用发布许可](LICENSE) -的第三版或后续版本的条款,分发和/或修改本程序。 +中文演示和要点说明位于[Tutorial.zh_CN.md](Tutorial.zh_CN.md) + +## 版权信息 + +版权所有 (C) 2004-2026 Leaflet + +## 授权许可 + +本程序是自由软件; 你可以根据自由软件基金会发布的[GNU通用公共许可证](LICENSE)的条款重新发布和/或修改本程序,无论是许可证的第3版还是(根据你的选择)任何后续版本。 diff --git a/configure.ac b/configure.ac index 45da5d5..142d5e0 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) -AC_INIT([lbbs],[1.7.2]) +AC_INIT([lbbs],[1.7.3]) AC_CONFIG_SRCDIR([src/]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIRS([m4]) diff --git a/data/version.txt b/data/version.txt index 3c7698b..ceb086b 100644 --- a/data/version.txt +++ b/data/version.txt @@ -1,54 +1,67 @@ -LeafOK BBS(Telnet版本) -版本变更记录 - -1.7 -================= - 完善文章管理 - -1.6 -================= - 可以在MSYS2 / MinGW64环境上运行 - -1.5 -================= - 新增全部用户列表显示 - 新增在线用户列表显示 - 新增显示选中项的用户信息 - 新增按用户名查找用户 - 新增按用户名查找文章 - 新增按标题查找文章 - 新增敏感词过滤 - 多字节字符的变宽/定宽处理 - -1.4 -================= - 新增个人收藏主题文章 - 新增“本站十大热点”菜单 - 允许用户选择UTF-8/GBK编码 - 文本编辑器中,支持整行/剩余行快速删除 - -1.3 -================= - 启用UTF-8编码 - 站点穿梭支持转码 - -1.2 -================= - 新增版块文章列表置顶文章显示 - 新增版块精华区目录和文章显示 - -1.1 -================= - 新增文本编辑器,支持发表/修改/回复文章 - 新增自行删除和管理员删除文章 - 新增未读/已读文章状态显示 - 支持SSH2安全连接 - -1.0 -================= - 新增已注册用户账户登陆(需通过Web方式注册) - 新增版块栏目/列表,可显示用户收藏版块 - 新增版块文章列表,支持同主题文章高亮显示 - 新增文章阅读,支持同主题阅读模式 - 新增站点穿梭、小游戏等实用工具 +# LBBS 更新日志 - LeafOK BBS 经典终端服务器 +英文版本的更新日志位于 [ChangeLog.md](ChangeLog.md)。 + +## 2025-12-26 v1.7 + +### 新增主要功能 + +1. 支持 Docker 容器化部署 +2. 完善文章管理功能 + +## 2025-11-21 v1.6 + +新增对 MSYS2 / MinGW64 环境的运行支持。 + +## 2025-11-07 v1.5 + +### 新增主要功能 + +1. 全部用户列表显示 +2. 在线用户列表显示 +3. 显示选中项的用户详细信息 +4. 按用户名查找用户 +5. 按作者用户名查找文章 +6. 按标题查找文章 +7. 敏感词过滤系统 +8. 多字节字符的变宽/定宽显示选择 + +## 2025-10-15 v1.4 + +### 新增主要功能 + +1. 个人收藏主题文章功能 +2. "本站十大热点"菜单 +3. 允许用户选择字符编码(UTF-8 或 GBK) +4. 文本编辑器中支持整行/剩余行快速删除 + +## 2025-07-01 v1.3 + +1. 启用 UTF-8 编码(替代 GBK) +2. 站点穿梭支持字符集转换 + +## 2025-06-28 v1.2 + +### 新增主要功能 + +1. 版块文章列表置顶文章显示功能 +2. 版块精华区目录和文章显示 + +## 2025-06-15 v1.1 + +包含所有基础功能的主要版本: + +1. 文本编辑器支持发表、修改、回复文章 +2. 支持用户自行删除和管理员删除文章 +3. 未读/已读文章状态显示 +4. SSH2 安全连接支持 + +## 2025-05-31 v1.0 + +包含核心功能的初始版本: + +1. 已注册用户账户登录 +2. 版块栏目/列表,支持显示用户收藏版块 +3. 版块文章列表,支持同主题文章分组显示 +4. 文章阅读器,支持快速文章/主题导航 +5. 实用工具,包括小游戏和站点穿梭 diff --git a/src/net_server.c b/src/net_server.c index 8fb0531..3173fbe 100644 --- a/src/net_server.c +++ b/src/net_server.c @@ -56,6 +56,7 @@ enum _net_server_constant_t { + SOCKET_LISTEN_BACKLOG = 20, WAIT_CHILD_PROCESS_EXIT_TIMEOUT = 5, // second WAIT_CHILD_PROCESS_KILL_TIMEOUT = 1, // second @@ -636,7 +637,7 @@ int net_server(const char *hostaddr, in_port_t port[]) return -1; } - if (listen(socket_server[i], 10) < 0) + if (listen(socket_server[i], SOCKET_LISTEN_BACKLOG) < 0) { log_error("Telnet socket listen error (%d)", errno); return -1; diff --git a/src/section_list.c b/src/section_list.c index cf7f468..2c74754 100644 --- a/src/section_list.c +++ b/src/section_list.c @@ -281,12 +281,18 @@ int set_article_block_shm_readonly(void) int detach_article_block_shm(void) { + int shm_count; + size_t pool_shm_size; + if (p_article_block_pool == NULL) { return -1; } - for (int i = 0; i < p_article_block_pool->shm_count; i++) + shm_count = p_article_block_pool->shm_count; + pool_shm_size = p_article_block_pool->shm_size; + + for (int i = 0; i < shm_count; i++) { if ((p_article_block_pool->shm_pool + i)->p_shm != NULL && munmap((p_article_block_pool->shm_pool + i)->p_shm, (p_article_block_pool->shm_pool + i)->shm_size) < 0) @@ -296,7 +302,7 @@ int detach_article_block_shm(void) } } - if (p_article_block_pool != NULL && munmap(p_article_block_pool, p_article_block_pool->shm_size) < 0) + if (p_article_block_pool != NULL && munmap(p_article_block_pool, pool_shm_size) < 0) { log_error("munmap() error (%d)", errno); return -3; @@ -373,7 +379,7 @@ ARTICLE *article_block_find_by_aid(int32_t aid) while (left < right) { // get block offset no less than mid value of left and right block offsets - mid = (left + right) / 2 + (left + right) % 2; + mid = left + (right - left + 1) / 2; if (aid < p_article_block_pool->p_block[mid]->articles[0].aid) { @@ -393,7 +399,7 @@ ARTICLE *article_block_find_by_aid(int32_t aid) // aid in the range [ aid of articles[left], aid of articles[right] ] while (left < right) { - mid = (left + right) / 2; + mid = left + (right - left) / 2; if (aid <= p_block->articles[mid].aid) { @@ -1217,7 +1223,7 @@ ARTICLE *section_list_find_article_with_offset(SECTION_LIST *p_section, int32_t while (left < right) { // get page id no less than mid value of left page id and right page id - mid = (left + right) / 2 + (left + right) % 2; + mid = left + (right - left + 1) / 2; if (aid < p_section->p_page_first_article[mid]->aid) { @@ -1514,14 +1520,17 @@ int section_list_move_topic(SECTION_LIST *p_section_src, SECTION_LIST *p_section { p_section_src->p_article_tail = p_article->p_prior; } - if (p_section_src->p_article_head == p_article) // || p_section_src->p_article_tail == p_article + if (p_section_src->p_article_head == p_article) // Single element list { p_section_src->p_article_head = NULL; p_section_src->p_article_tail = NULL; } - - p_article->p_prior->p_next = p_article->p_next; - p_article->p_next->p_prior = p_article->p_prior; + else + { + // Only update neighbor pointers if list is not empty after removal + p_article->p_prior->p_next = p_article->p_next; + p_article->p_next->p_prior = p_article->p_prior; + } // Update sid of article p_article->sid = p_section_dest->sid;