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
10 changes: 4 additions & 6 deletions Dockerfile/dockerfile.bbsd
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Stage for Build
FROM debian:13-slim

ARG LBBS_HOME_DIR=/usr/local/lbbs
FROM debian:13-slim AS builder

RUN apt-get update && apt-get install -y \
gcc make gdb autoconf automake libtool pkg-config \
Expand All @@ -13,7 +11,7 @@ COPY ./ /home/lbbs_src
WORKDIR /home/lbbs_src

RUN autoreconf --install --force
RUN ./configure --prefix=${LBBS_HOME_DIR} \
RUN ./configure --prefix=/usr/local/lbbs \
&& make && make install

# Stage for Runtime
Expand All @@ -38,6 +36,6 @@ RUN apt-get update && apt-get install -y \
# Copy the custom configuration file
COPY ./Dockerfile/php.ini /usr/local/etc/php/php.ini

COPY --from=0 /usr/local/lbbs /usr/local/lbbs
COPY --from=builder /usr/local/lbbs /usr/local/lbbs

WORKDIR ${LBBS_HOME_DIR}
WORKDIR /usr/local/lbbs
6 changes: 3 additions & 3 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ To install LBBS on Linux (e.g. Debian 13, CentOS Stream 10), please perform the
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" -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
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
Expand Down
6 changes: 3 additions & 3 deletions INSTALL.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
8) 将MySQL服务器的CA证书文件,复制到$LBBS_HOME_DIR/conf/ca_cert.pem

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
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
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.7.1])
AC_INIT([lbbs],[1.7.2])
AC_CONFIG_SRCDIR([src/])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIRS([m4])
Expand Down
9 changes: 6 additions & 3 deletions src/memory_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,19 @@ inline static void *memory_pool_add_chunk(MEMORY_POOL *p_pool)
void *p_chunk;
void *p_node;
size_t i;
size_t chunk_size;

if (p_pool->chunk_count >= p_pool->chunk_count_limit)
{
log_error("Chunk count limit %d reached", p_pool->chunk_count);
return NULL;
}
p_chunk = malloc(p_pool->node_size * p_pool->node_count_per_chunk);

chunk_size = p_pool->node_size * p_pool->node_count_per_chunk;
p_chunk = malloc(chunk_size);
if (p_chunk == NULL)
{
log_error("malloc(%d * %d) error: OOM", p_pool->node_size, p_pool->node_count_per_chunk);
log_error("malloc(%zu) error: OOM", chunk_size);
return NULL;
}

Expand Down Expand Up @@ -180,7 +183,7 @@ int memory_pool_check_node(MEMORY_POOL *p_pool, void *p_node)
else
{
log_error("Address of node (%p) is not aligned with border of chunk %d [%p, %p)",
i, p_node >= p_pool->p_chunks[i], (char *)(p_pool->p_chunks[i]) + chunk_size);
p_node, i, p_pool->p_chunks[i], (char *)(p_pool->p_chunks[i]) + chunk_size);
return -3;
}
}
Expand Down
6 changes: 3 additions & 3 deletions utils/bin/gen_ex_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function gen_ex_dir(mysqli $db_conn, int $sid, int $fid = 0, string $dir = "", s
if (!isset($_SERVER["argc"]))
{
echo ("Invalid usage");
exit();
exit(-1);
}

chdir(dirname($_SERVER["argv"][0]));
Expand Down Expand Up @@ -138,7 +138,7 @@ function gen_ex_dir(mysqli $db_conn, int $sid, int $fid = 0, string $dir = "", s
if ($rs == false)
{
echo ("Query section error: " . mysqli_error($db_conn));
exit();
exit(-2);
}

while ($row = mysqli_fetch_array($rs))
Expand All @@ -155,7 +155,7 @@ function gen_ex_dir(mysqli $db_conn, int $sid, int $fid = 0, string $dir = "", s
if ($ret == false)
{
echo ("Update tm error: " . mysqli_error($db_conn));
exit();
exit(-3);
}
}
else
Expand Down
8 changes: 4 additions & 4 deletions utils/bin/gen_section_menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
if (!isset($_SERVER["argc"]))
{
echo ("Invalid usage");
exit();
exit(-1);
}

chdir(dirname($_SERVER["argv"][0]));
Expand All @@ -18,7 +18,7 @@
if ($buffer == false)
{
echo "Unable to load menu config file " . $menu_input_path . "\n";
exit();
exit(-2);
}

// Load section list
Expand Down Expand Up @@ -84,7 +84,7 @@ function (array $section, array $filter_param) : mixed
if ($ret == false)
{
echo "Query section list error: " . mysqli_error($db_conn);
exit();
exit(-3);
}

// Generate menu of section class
Expand Down Expand Up @@ -229,7 +229,7 @@ function (array $section, array $filter_param) : mixed
if ($ret == false)
{
echo "Query excerptional section list error: " . mysqli_error($db_conn);
exit();
exit(-3);
}

// Generate menu of excerptional section class
Expand Down
4 changes: 2 additions & 2 deletions utils/bin/gen_top.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
if (!isset($_SERVER["argc"]))
{
echo ("Invalid usage");
exit();
exit(-1);
}

chdir(dirname($_SERVER["argv"][0]));
Expand Down Expand Up @@ -43,7 +43,7 @@
if ($rs == false)
{
echo("Query data error: " . mysqli_error($db_conn));
exit();
exit(-2);
}

$i = 1;
Expand Down
2 changes: 1 addition & 1 deletion utils/lib/db_open.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ function db_open($sql_charset = "utf8")

if ($db_conn == NULL)
{
exit();
exit(-1);
}
}