From 2244b5f1a600c17c5130d6da66ad04e9e42a69de Mon Sep 17 00:00:00 2001 From: Chuan-Heng Hsiao Date: Mon, 17 Jul 2023 06:25:14 -0400 Subject: [PATCH] remove unnecessary config.go 1. remove unnecessary config.go 2. update docker_update_bin --- .gitignore | 2 ++ ptttype/00-config-production.go | 47 --------------------------------- ptttype/02-config-run.go | 47 --------------------------------- scripts/docker_update_bin.sh | 8 +++--- 4 files changed, 6 insertions(+), 98 deletions(-) delete mode 100644 ptttype/00-config-production.go delete mode 100644 ptttype/02-config-run.go diff --git a/.gitignore b/.gitignore index d3ef8c1f..5928840b 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,8 @@ /swagger /02-config.run.ini /03-config.run-in-docker.ini +/ptttype/00-config-production.go +/ptttype/02-config-run.go **/cover.out /docker_compose.env diff --git a/ptttype/00-config-production.go b/ptttype/00-config-production.go deleted file mode 100644 index 3d4b2ecf..00000000 --- a/ptttype/00-config-production.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build production - -package ptttype - -const ( - // These are special config variables requiring to be const. - // copy to ptttype/00-config-production.go to setup production config. - // - // type struct requires const. - MAX_USERS = 2000000 /* 最高註冊人數 */ - - MAX_ACTIVE = 512 /* 最多同時上站人數 */ - - MAX_BOARD = 20000 /* 最大開板個數 */ - - ////////// - //config.h - ////////// - HASH_BITS = 16 /* userid->uid hashing bits */ - - MAX_FRIEND = 256 /* 載入 cache 之最多朋友數目 */ - - MAX_REJECT = 32 /* 載入 cache 之最多壞人數目 */ - - MAX_MSGS = 10 /* 水球(熱訊)忍耐上限 */ - - MAX_ADBANNER = 500 /* 最多動態看板數 */ - - HOTBOARDCACHE = 128 /* 熱門看板快取 */ - - MAX_FROM = 300 /* 最多故鄉數 */ - - MAX_REVIEW = 7 /* 最多水球回顧 */ - - NUMVIEWFILE = 14 /* 進站畫面最多數 */ - - MAX_ADBANNER_SECTION = 10 /* 最多動態看板類別 */ - - MAX_ADBANNER_HEIGHT = 11 /* 最大動態看板內容高度 */ - - ///////////////////////////////////////////////////////////////////////////// - // OS Settings 作業系統相關設定 - - MAXPATHLEN = 256 - - PATHLEN = 256 -) diff --git a/ptttype/02-config-run.go b/ptttype/02-config-run.go deleted file mode 100644 index c8a1e58c..00000000 --- a/ptttype/02-config-run.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build dev - -package ptttype - -const ( - // These are special config variables requiring to be const. - // copy to ptttype/00-config-production.go to setup production config. - // - // type struct requires const. - MAX_USERS = 100 /* 最高註冊人數 */ - - MAX_ACTIVE = 31 /* 最多同時上站人數 */ - - MAX_BOARD = 1024 /* 最大開板個數 */ - - ////////// - //config.h - ////////// - HASH_BITS = 16 /* userid->uid hashing bits */ - - MAX_FRIEND = 256 /* 載入 cache 之最多朋友數目 */ - - MAX_REJECT = 32 /* 載入 cache 之最多壞人數目 */ - - MAX_MSGS = 10 /* 水球(熱訊)忍耐上限 */ - - MAX_ADBANNER = 500 /* 最多動態看板數 */ - - HOTBOARDCACHE = 10 /* 熱門看板快取 */ - - MAX_FROM = 300 /* 最多故鄉數 */ - - MAX_REVIEW = 7 /* 最多水球回顧 */ - - NUMVIEWFILE = 14 /* 進站畫面最多數 */ - - MAX_ADBANNER_SECTION = 10 /* 最多動態看板類別 */ - - MAX_ADBANNER_HEIGHT = 11 /* 最大動態看板內容高度 */ - - ///////////////////////////////////////////////////////////////////////////// - // OS Settings 作業系統相關設定 - - MAXPATHLEN = 256 - - PATHLEN = 256 -) diff --git a/scripts/docker_update_bin.sh b/scripts/docker_update_bin.sh index cc3499e1..d7c84c4b 100755 --- a/scripts/docker_update_bin.sh +++ b/scripts/docker_update_bin.sh @@ -1,16 +1,16 @@ #!/bin/bash if [ "$#" != "2" ]; then - echo "usage: docker_initbbs.sh [BBSHOME] [GOBBS_IMAGE]" + echo "usage: docker_initbbs.sh [BBSHOME] [GOPTTBBS_IMAGE]" exit 255 fi BBSHOME=$1 -GOBBS_IMAGE=$2 -echo "BBSHOME: ${BBSHOME} GOBBS_IMAGE: ${GOBBS_IMAGE}" +GOPTTBBS_IMAGE=$2 +echo "BBSHOME: ${BBSHOME} GOPTTBBS_IMAGE: ${GOPTTBBS_IMAGE}" project=go-pttbbs docker container stop ${project} docker container rm ${project} -docker run --name ${project} -v ${BBSHOME}:/home/bbs ${GOBBS_IMAGE} sh -c 'mkdir -p /home/bbs/bin && cp /opt/bbs/bin/* /home/bbs/bin' +docker run --name ${project} -v ${BBSHOME}:/home/bbs ${GOPTTBBS_IMAGE} sh -c 'mkdir -p /home/bbs/bin && cp /opt/bbs/bin/* /home/bbs/bin'