Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/conf/bbsd.conf
/conf/bbsnet.conf
/conf/badwords.conf
/conf/ssh_host_rsa_key*
/conf/ssh_host_ed25519_key*
/conf/ssh_host_ecdsa_key*
/utils/conf/db_conn.conf.php
/aclocal.m4
/autom4te.cache
Expand Down
2 changes: 2 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ To install LBBS on Linux (e.g. Debian 13, CentOS Stream 10), please perform the
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

Expand All @@ -53,6 +54,7 @@ To install LBBS on Linux (e.g. Debian 13, CentOS Stream 10), please perform the
10) Create SSH2 RSA / ED25519 certificate
ssh-keygen -t rsa -C "Your Server Name" -f $LBBS_HOME_DIR/conf/ssh_host_rsa_key
ssh-keygen -t ed25519 -C "Your Server Name" -f $LBBS_HOME_DIR/conf/ssh_host_ed25519_key
ssh-keygen -t ecdsa -C "Your Server Name" -f $LBBS_HOME_DIR/conf/ssh_host_ecdsa_key

11) Startup
sudo -u bbs $LBBS_HOME_DIR/bin/bbsd
Expand Down
2 changes: 2 additions & 0 deletions INSTALL.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
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

Expand All @@ -53,6 +54,7 @@
9) 创建SSH2 RSA / ED25519 证书
ssh-keygen -t rsa -C "Your Server Name" -f $LBBS_HOME_DIR/conf/ssh_host_rsa_key
ssh-keygen -t ed25519 -C "Your Server Name" -f $LBBS_HOME_DIR/conf/ssh_host_ed25519_key
ssh-keygen -t ecdsa -C "Your Server Name" -f $LBBS_HOME_DIR/conf/ssh_host_ecdsa_key

10) 启动服务程序
sudo -u bbs $LBBS_HOME_DIR/bin/bbsd
Expand Down
4 changes: 2 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ SUBDIRS = utils src

install-data-local:
install -d $(prefix)/conf $(prefix)/data $(prefix)/log $(prefix)/var $(prefix)/var/articles $(prefix)/var/chicken $(prefix)/var/gen_ex
cd $(srcdir)/conf; find . -maxdepth 1 -type f -exec install -t $(prefix)/conf -m 644 {} \;
cd $(srcdir)/data; find . -maxdepth 1 -type f -exec install -t $(prefix)/data -m 644 {} \;
cd $(srcdir)/conf; find . -maxdepth 1 -type f -exec install -t $(prefix)/conf -m 644 -p {} \;
cd $(srcdir)/data; find . -maxdepth 1 -type f -exec install -t $(prefix)/data -m 644 -p {} \;
find $(prefix)/ -type d -exec chmod 750 {} \;

uninstall-local:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
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 : bbs.fenglin.info (Telnet 2323 / SSH2 2322)
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")
Expand Down
2 changes: 1 addition & 1 deletion README.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
简介
=================
本软件旨在为一个纯Web访问的BBS [leafok_bbs](https://github.com/leafok/leafok_bbs) 提供基于Telnet访问的界面。
演示站点 : bbs.fenglin.info (Telnet 2323 / SSH2 2322)
演示站点 : fenglin.info (Telnet 2323 / SSH2 2322)
![欢迎](misc/images/ssh_welcome.jpg "欢迎访问LBBS")
![菜单](misc/images/telnet_menu.jpg "主选单")
![版块](misc/images/telnet_section.jpg "文章列表")
Expand Down
6 changes: 0 additions & 6 deletions conf/bbsnet.conf

This file was deleted.

6 changes: 6 additions & 0 deletions conf/bbsnet.conf.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#单位 站名 位置 端口 SSH 编码

LBBS Testing localhost 2322 Y UTF-8
清华大学 水木社区 bbs.newsmth.net 22 Y GBK
复旦大学 日月光华 bbs.fudan.edu.cn 2323 N GBK
交通大学 饮水思源 bbs.sjtu.edu.cn 23 N GBK
3 changes: 2 additions & 1 deletion conf/menu.conf
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ screen 10, 0, S_UNUSEABLE
%menu M_SYSINFO
title 0, 0, "系统资讯区"
screen 10, 0, S_SYSINFO
@LICENSE 11, 5, 0, 0, "License", "(L) 【 使用执照 】"
@EULA 11, 5, 0, 0, "EULA", "(E) 【用户许可协议】"
@LICENSE 0, 0, 0, 0, "License", "(L) 【 使用执照 】"
@COPYRIGHT 0, 0, 0, 0, "Copyright", "(C) 【 版权信息 】"
@VERSION 0, 0, 0, 0, "Version", "(V) 【 版本记录 】"
!.. 0, 0, 0, 0, "Back", "(B) 【 返回上一级 】"
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.69])
AC_INIT([lbbs],[1.6.1])
AC_INIT([lbbs],[1.6.2])
AC_CONFIG_SRCDIR([src/])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIRS([m4])
Expand Down
32 changes: 32 additions & 0 deletions data/eula.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
枫林在线(FengLin.info)《用户许可协议》
(2025年12月2日 修订)

1. 服务条款的确认和接纳 枫林在线的所有权和运作权归FengLin.info所有。枫林在线所提供的服务将完全按照其发布的章程、服务条款和操作规则严格执行。用户完成注册程序,即表示用户与枫林在线达成协议并接受所有的服务条款。
2. 服务依赖的软硬件条件 枫林在线运用自己的软件系统通过互联网为用户提供网络服务,并承担服务条款和入网协议中对用户的责任和义务。用户必须:
1) 自行配备上网所需的设备,包括个人电脑,手机、网络接入设备及其他必备的设备装置。
2) 自行负担上网所需的相关必要费用,如:电话费用、网络费用等。
3. 用户必须提供详尽、真实和准确的个人资料,并对个人资料不断进行及时的更新。如果用户所提供的资料包含不正确的信息,枫林在线保留中止为该用户提供网络服务的权利。
4. 服务条款的修改 枫林在线在必要时将修改服务条款,届时将在用户界面提示修改内容,如果用户不同意所作的修改,可以主动停止获得相应服务。如果用户希望继续享有枫林在线提供的服务,则必须接受服务条款的变动。
5. 服务功能的变更 枫林在线保留随时修改服务,包括但不限于新增、移除、修改服务功能,临时中断服务,而不需事先通知用户的权利。
6. 用户隐私制度 尊重用户隐私是枫林在线的一项基本政策。枫林在线将对用户资料实行保密,承诺不会在未经用户授权时公开、编辑或透露其注册资料及保存在枫林在线中的非公开内容,除非有法律明确要求枫林在线提供相关信息的情况存在。
7. 用户帐号、密码和安全性 用户注册成为枫林在线的合法用户,须选定唯一的用户名,并自行设置密码。用户帐号仅限用户本人使用,不得将密码公开或提供给第三方。通过用户名和密码登陆后的一切操作,均视为用户本人的行为。用户须妥善保管密码,并定期修改。如发现可疑帐号活动,请立即通知枫林在线。
8. 免责声明 枫林在线对任何直接、间接、偶然、特殊及继起的损害不负责任,这些损害可能来自:不正当使用网络服务,在网上购买商品或进行同类型服务,在网上进行交易,非法使用网络服务或用户传送的信息有所变动。这些行为都有可能会导致枫林在线的形象受损,所以枫林在线事先提出这种损害的可能性。
9. 服务稳定性 鉴于枫林在线向用户提供的服务不收取任何费用,枫林在线不对服务稳定性作出任何承诺。枫林在线建议用户自行备份在本网站上存放的重要数据,包括但不限于发表的文章、发送的消息、上传的文件等。因发生如火灾、水灾、暴动、骚乱、战争、自然灾害等不可抗事故,枫林在线所不能控制的时间而影响枫林在线提供服务,造成服务中断、数据丢失等后果,枫林在线无须承担任何责任。
10. 版权保护 枫林在线用户的文章版权归原文作者和枫林在线共同所有,转贴的文章枫林在线不拥有版权。枫林在线有权在本网站范围内引用、发布、转载用户在枫林在线社区发布、转贴的内容。用户在枫林在线上发布信息,应当遵守相关法律法规,尊重他人的版权,并对由此所引发的版权异议、纠纷承担法律责任。任何用户需要转载枫林在线文章,必须征得原文作者或枫林在线同意或授权,并应注明作者名称和真实出处。
11. 用户管理 用户单独承担发布内容的责任。用户对服务的使用是根据所有适用于枫林在线的法律、法规和政府颁布的管理办法。 用户必须遵循:
1) 从中国境内向外传输重要数据(包括但不限于个人信息、技术性资料等)时,必须符合中国有关法律、法规和政府规章;
2) 不得使用网络服务以作非法用途;
3) 不得干扰、混乱、非法侵入网络服务及其计算机系统;
4) 遵守所有使用网络服务的网络协议、规定、程序和惯例;
5) 不能传输任何非法的、骚扰性的、中伤他人的、辱骂性的、恐吓性的、伤害性的、庸俗的、淫秽的等信息资料;
6) 不能传输任何教唆他人构成犯罪行为的资料;
7) 不能传输任何可能涉及或危害国家安全的资料。
若用户的行为不符合以上提到的服务条款,枫林在线将立即停止用户帐号的服务。枫林在线的系统记录有可能作为用户违反法律的证据。
12. 保障 用户同意保障和维护枫林在线全体成员的利益,负责支付由用户使用超出服务范围引起的律师费用,违反服务条款的损害补偿费用等。
13. 结束服务 用户或枫林在线可随时根据用户管理的规范(参见第11条)和实际情况中断一项或多项服务,枫林在线无须对个人或第三方负责。用户对后来的条款修改有异议,或对枫林在线的服务不满,可以行使如下权利:
1) 停止使用枫林在线的网络服务。
2) 通告枫林在线停止对该用户的服务。结束用户服务后,用户使用相应服务的权利立即中止。在法律规定的数据保存期限之后,枫林在线不对用户承担任何义务和责任。
14. 通告 所有发给用户的通告都可以通过重要页面的公告或电子邮件传送。
15. 广告策划 用户在他们发表的信息中加入宣传资料或广告策划,在枫林在线的免费服务上展示他们的产品,任何这类促销方法,包括运输货物、付款、服务、商业条件、担保及与广告有关的描述都只是在相应的用户和广告销售商之间发生。枫林在线不为此类行为提供任何担保,也不为其后果承担任何责任。
16. 网络服务的内容所有权 枫林在线定义的内容包括:文字、软件、声音、相片、录像、图表;广告中的全部内容;电子邮件中的全部内容;枫林在线为用户提供的其他信息。所有这些信息均受版权、商标、标签和其他财产所有权法律的保护。用户只能在枫林在线和广告商的授权下才能使用这些内容,不能擅自复制、再造或创造与这些内容有关的派生产品。枫林在线的所有内容版权归原文作者和枫林在线共同所有,任何人需要转载枫林在线的内容,必须获得原文作者或枫林在线的授权。
17. 法律 本服务条款要与中华人民共和国的法律解释相一致,用户和枫林在线一致同意服从高等法院的所有管辖。如果任何服务条款与法律相抵触,则这些条款将按法律规定重新解释,而其他条款依旧保持对枫林在线和用户产生法律效力和影响。
2 changes: 1 addition & 1 deletion data/register.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

该功能尚未完成,请使用WWW方式注册新帐号。
https://www.fenglin.info/bbs/user_reg.php
https://fenglin.info/bbs/user_reg.php

4 changes: 2 additions & 2 deletions data/welcome.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
▍ ▎ ▏ ▍ ▆  
▎ ▏ ▌  
▁▃▅ ▆▃▁ 
 ◥▃▇▅▅▇ Web https://www.fenglin.info
▁▂▄◤ ▆▄◣ SSH bbs.fenglin.info:2322
 ◥▃▇▅▅▇ Web https://fenglin.info
▁▂▄◤ ▆▄◣ SSH fenglin.info:2322
3 changes: 3 additions & 0 deletions include/bbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ extern char BBS_nickname[BBS_nickname_max_len + 1];
extern char BBS_user_tz[BBS_user_tz_max_len + 1];
extern int BBS_user_exp;

extern time_t BBS_eula_tm;
extern int BBS_update_eula;

extern time_t BBS_login_tm;
extern time_t BBS_last_access_tm;

Expand Down
3 changes: 3 additions & 0 deletions include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,16 @@ extern const char CONF_BWF[];
extern const char CONF_TOP10_MENU[];
extern const char SSH_HOST_RSA_KEY_FILE[];
extern const char SSH_HOST_ED25519_KEY_FILE[];
extern const char SSH_HOST_ECDSA_KEY_FILE[];
extern const char SSH_KNOWN_HOSTS_FILE[];

extern const char LOG_FILE_INFO[];
extern const char LOG_FILE_ERROR[];

extern const char DATA_WELCOME[];
extern const char DATA_REGISTER[];
extern const char DATA_GOODBYE[];
extern const char DATA_EULA[];
extern const char DATA_LICENSE[];
extern const char DATA_COPYRIGHT[];
extern const char DATA_VERSION[];
Expand Down
2 changes: 2 additions & 0 deletions include/login.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@ extern int user_online_exp(MYSQL *db);

extern int user_online_update(const char *action);

extern int user_update_agreement(void);

#endif //_LOGIN_H_
1 change: 1 addition & 0 deletions include/menu_proc.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
extern int list_section(void *param);
extern int exec_mbem(void *param);
extern int exit_bbs(void *param);
extern int eula(void *param);
extern int license(void *param);
extern int copyright(void *param);
extern int version(void *param);
Expand Down
6 changes: 6 additions & 0 deletions src/article_favor_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ static enum select_cmd_t article_favor_select(int total_page, int item_count, in
if (ch != KEY_NULL && ch != KEY_TIMEOUT)
{
BBS_last_access_tm = time(NULL);

// Refresh current action
if (user_online_update(NULL) < 0)
{
log_error("user_online_update(NULL) error\n");
}
}

switch (ch)
Expand Down
3 changes: 3 additions & 0 deletions src/bbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ char BBS_nickname[BBS_nickname_max_len + 1];
char BBS_user_tz[BBS_user_tz_max_len + 1];
int BBS_user_exp;

time_t BBS_eula_tm;
int BBS_update_eula = 0;

time_t BBS_login_tm;
time_t BBS_last_access_tm;

Expand Down
1 change: 1 addition & 0 deletions src/bbs_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ static const BBS_CMD bbs_cmd_list[] = {
{"LIST_SECTION", list_section},
{"RunMBEM", exec_mbem},
{"EXITBBS", exit_bbs},
{"EULA", eula},
{"LICENSE", license},
{"COPYRIGHT", copyright},
{"VERSION", version},
Expand Down
39 changes: 32 additions & 7 deletions src/bbs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,6 @@ int bbs_logout(void)
return -2;
}

if (user_online_del(db) < 0)
{
return -3;
}

mysql_close(db);

display_file(DATA_GOODBYE, 1);
Expand All @@ -133,6 +128,26 @@ int bbs_logout(void)
return 0;
}

int bbs_session_cleanup(void)
{
MYSQL *db;

db = db_open();
if (db == NULL)
{
return -1;
}

if (user_online_del(db) < 0)
{
return -2;
}

mysql_close(db);

return 0;
}

int bbs_center()
{
int ch;
Expand Down Expand Up @@ -370,6 +385,13 @@ int bbs_main()
log_common("User [%s] (uid=%d) login from %s:%d\n",
BBS_username, BBS_priv.uid, hostaddr_client, port_client);

// Check EULA update status
if (BBS_update_eula)
{
user_update_agreement();
goto cleanup;
}

// Load section aid locations
if (section_aid_locations_load(BBS_priv.uid) < 0)
{
Expand Down Expand Up @@ -406,6 +428,9 @@ int bbs_main()
// Main
bbs_center();

// Logout
bbs_logout();

// Save section aid locations
if (section_aid_locations_save(BBS_priv.uid) < 0)
{
Expand All @@ -425,8 +450,8 @@ int bbs_main()
}

cleanup:
// Logout
bbs_logout();
// Cleanup session
bbs_session_cleanup();

// Cleanup iconv
io_conv_cleanup();
Expand Down
Loading