Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

確認如何可以在 local 的實體機跑起來~ #300

Open
chhsiao1981 opened this issue Aug 15, 2021 · 7 comments
Open

確認如何可以在 local 的實體機跑起來~ #300

chhsiao1981 opened this issue Aug 15, 2021 · 7 comments
Labels
doc 文件 Improvements or additions to documentation good first issue Good for newcomers help wanted Extra attention is needed question 問題 Further information is requested

Comments

@chhsiao1981
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

目前雖然有寫一個大致的 steps 嘗試讓大家可以在 local 的實體機跑起來~
但是似乎不是很明確~

希望可以透過這個 issue 的討論幫助大家可以在 local 的實體機跑起來~

Describe the solution you'd like

Describe alternatives you've considered

Additional context

@chhsiao1981 chhsiao1981 added doc 文件 Improvements or additions to documentation good first issue Good for newcomers help wanted Extra attention is needed question 問題 Further information is requested labels Aug 15, 2021
@chhsiao1981
Copy link
Collaborator Author

https://github.com/Ptt-official-app/go-openbbsmiddleware/blob/main/docker/docker-compose.yaml

總共有 5 個 processes.
包含著 mongo / redis / postfix / go-pttbbs / go-openbbsmiddleware.

對於只希望把 go-openbbsmiddleware 跑在實體機的 developers~
需要有一個 docker-compose.yaml 是只有 mongo / redis / postfix / go-pttbbs.
並且 ports 可以讓實體機正常 access. (postfix 需要注意 mynetwork 是要包到 docker 的 network)

@tingyuchang
Copy link
Collaborator

您好,我照著 README 裡面的步驟做

  • copy docker/docker_compose.env.template to docker/docker_compose.env and modify the settings.
  • ./scripts/docker_initbbs.sh [BBSHOME] pttofficialapps/go-pttbbs:latest
  • docker-compose --env-file docker/docker_compose.env -f docker/docker-compose.yaml up -d
  1. 有修改 BBSHOME=/Users/matt/bbs,其他 Volume 的路徑也有修改成自己的路徑
  2. run ./scripts/docker_initbbs.sh /Users/matt/bbs pttofficialapps/go-pttbbs:latest
  3. execute docker-compose

看起來 postfix / go-pttbbs / go-openbbsmiddleware 這三個都跑不起來,只有 mongo/ redis 成功
請問是有哪些地方遺漏了嗎?

@chhsiao1981
Copy link
Collaborator Author

關於 go-openbbsmiddleware:

需要在 etc 裡包含:

  1. attemptregister.template (可在 docs/etc 裡找到)
  2. emailtoken.template (可在 docs/etc 裡找到)
  3. idemailtoken.template (可在 docs/etc 裡找到)
  4. production.ini (可在 docs/config/03-config.local-docker.ini 找到)

關於 postfix:

  1. 將 docs/postfix 裡的 main.cf.template 和 master.cf.template
    放到你想要放進的 etc/postfix dir 裡.
  2. main.cf 需要根據你的 docker-network 修改 mynetworks.
    (應該會是 docker network inspect docker_default 可以找出相對應的 subnet,
    我的範例: mynetworks = 172.22.0.0/16, 127.0.0.1/8)
    myhostname = temp
    mydomain = temp
  3. docker_compose.env 修改相對應的 POSTFIX_MAIN_CF 和 POSTFIX_MASTER_CF

@chhsiao1981
Copy link
Collaborator Author

關於 go-pttbbs:

發現需要在 BBSHOME 裡加上 types/uao250-b2u.big5.txt 和 types/uao250-u2b.big5.txt
(從 https://github.com/Ptt-official-app/go-pttbbs/tree/main/types copy 過去~)
下一版的 scripts/docker_initbbs.sh 會修正這個問題~

@tingyuchang
Copy link
Collaborator

三個 containers 都正常運作了,謝謝
另外關於只希望跑 mongo / redis / postfix / go-pttbbs 的開發者來說,我的做法是

  1. docker-compose.yaml -> expose redis, mongo port , 把 openbbs-middleware 取消
  2. docs/config/02-config.run.ini (我不太確定開發的時候是不是跑這個 ini) 要把對 BACKEND_PREFIX 改成 http://localhost:3458/v1
  3. types/00-config.go -> 修改 EMAILTOKEN_TEMPLATE, IDEMAILTOKEN_TEMPLATE, ATTEMPT_REGISTER_USER_TEMPLATE 的路徑,指向存在的 template

@chhsiao1981
Copy link
Collaborator Author

  1. 剛剛 update README.md
    發現忘記補上 postfix 的部分~
    下次 release 時補上 postfix.

  2. types/00-config.go 相關的 variables 可以在 02-config.run.ini 裡參考 00-config.template.ini 在 [go-openbbsmiddleware:types] 加上相對應的 config.

@chhsiao1981
Copy link
Collaborator Author

這個 issue 將會在以下完成時結束:

  1. README.md 加上"一個 script 建立 default environment"的方式. 1 個 script 就可以完成 default install 的 script. #315
  2. README.md 加上 swagger-ui + python 的方式. README 加上 swagger python 和 pttbbs/Docker (SYSOP/guest) #314

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc 文件 Improvements or additions to documentation good first issue Good for newcomers help wanted Extra attention is needed question 問題 Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants