#ptt
2020-12-02
yoche2000
15:48:09
@yoche2000 has joined the channel
2020-12-08
QMO Lee
22:31:47
@yudgrayman has joined the channel
2020-12-09
John Yeh
16:38:30
@tsoen.526018 has joined the channel
John Yeh
16:41:39
hi, teemo, 對於 ptt 專案的架構有點興趣 想知道下目前情況,或是也許我能夠幫忙些什麼事情
2020-12-10
Yun Liaw
09:05:23
@frouscy has joined the channel
mlwmlw
10:08:42
@mlwmlw has joined the channel
WS
10:18:33
@twkoci has joined the channel
Can
10:32:32
@can has joined the channel
chaoh
10:34:01
@chaoh has joined the channel
gaga5lala
10:47:45
@gaga5lala has joined the channel
osimpleo
11:06:44
@osimpleo has joined the channel
kkpan11
11:20:25
@kkpan11 has joined the channel
oyster
13:54:11
@jenhausu has joined the channel
KCg0v_Lan
22:41:26
@r35085866 has joined the channel
2020-12-19
ifanchu675
13:45:40
@ifanchu675 has joined the channel
ifanchu675
14:19:36
hello 大家好,請問這個project還有缺人幫忙的嗎?
2020-12-20
pichuchen
00:38:29
有有有有有
ifanchu675
06:17:18
請問目前需要哪方面的幫助以及要如何參與呢?我主要專長是Software Engineering, 我可以幫忙iOS Development, backend server development. 我有數個iOS app的經驗,目前全職工作主要用的是golang, docker, kubernetes, python, bash. iOS的部份Swift, Flutter。看有沒有我可以幫忙的地方,最近年底剛好公司放長假比較有點時間。
- 👍1
pichuchen
12:12:18
目前Golang 後端的部分缺人把 ptt 的記錄檔讀取出來/寫入進去
https://github.com/PichuChen/go-bbs/issues/16
https://github.com/PichuChen/go-bbs/issues/16
這個 ISSUE 紀錄需要被解析的檔案以及解析的進度 ☐ 使用者記錄檔 (PASSWDS) • 進行中 <https://github.com/PichuChen/go-bbs/issues/1|#1> ☑︎ 看板列表 (.BRD) ☑︎ 看板內文章列表 (.DIR) ☑︎ 最近登入紀錄 (logins_recent) ☐ .polling ☐ .post ☐ 登入失敗紀錄 (logins.bad) ☐ reg.wait ☐ register.log ☐ usies ☐ 我的最愛列表 (.fav) ☐ 聊天室紀錄檔 ☐ 使用者名片檔 ☐ 使用者簽名檔
pichuchen
12:12:39
iOS 的部分據說在等中台和後台進度中
2020-12-26
chewei 哲瑋
22:30:57
@chewei has joined the channel
chewei 哲瑋
22:32:24
hi 想請 PTT 專案的朋友補充專案的相關資訊,例如 github, channel, 簡介文字等~
https://docs.google.com/spreadsheets/d/1C9-g1pvkfqBJbfkjPB0gvfBbBxVlWYJj6tTVwaI5_x8/edit#gid=0
https://docs.google.com/spreadsheets/d/1C9-g1pvkfqBJbfkjPB0gvfBbBxVlWYJj6tTVwaI5_x8/edit#gid=0
- 👀1
pichuchen
2020-12-27 02:07:11
@teemocogs
okcool
2020-12-29 21:44:56
已經更新囉!
chewei 哲瑋
2020-12-29 22:03:51
嗯嗯 ! 感謝 !
2020-12-27
pichuchen
02:07:11
@teemocogs
2020-12-28
chhsiao1981
09:51:04
- 😮1
chewei 哲瑋
2020-12-28 11:28:51
哇 再請試試看
GitHub 網址我有先加上去了
https://docs.google.com/spreadsheets/d/1C9-g1pvkfqBJbfkjPB0gvfBbBxVlWYJj6tTVwaI5_x8/edit
GitHub 網址我有先加上去了
https://docs.google.com/spreadsheets/d/1C9-g1pvkfqBJbfkjPB0gvfBbBxVlWYJj6tTVwaI5_x8/edit
chewei 哲瑋
11:28:51
哇 再請試試看
GitHub 網址我有先加上去了
https://docs.google.com/spreadsheets/d/1C9-g1pvkfqBJbfkjPB0gvfBbBxVlWYJj6tTVwaI5_x8/edit
GitHub 網址我有先加上去了
https://docs.google.com/spreadsheets/d/1C9-g1pvkfqBJbfkjPB0gvfBbBxVlWYJj6tTVwaI5_x8/edit
2020-12-29
ifanchu675
15:38:13
請問一下 https://github.com/Ptt-official-app/go-pttbbs `Docker-Compose` 這部份現在是working的嗎?我試著在我的Mac上面跑,container可以跑但是http://localhost:3456/register 顯示404 page not found.
This intends to be the go-implementation of pttbbs, with the needs transitioning to web-based-bbs.
okcool
21:44:56
已經更新囉!
chewei 哲瑋
22:03:51
嗯嗯 ! 感謝 !
2020-12-31
chhsiao1981
01:08:30
@ifanchu675~
docker-compose 的部分我確認一下~
docker-compose 的部分我確認一下~
chhsiao1981
01:09:19
另外有 https://api.devptt.site:8080 可以測試~
chhsiao1981
01:10:08
(https://api.devptt.site:8080 是用 docker-compose 跑的~)
chhsiao1981
01:13:15
@ifanchu675~
現在改成了 http://localhost:3456/v1/register
go-pttbbs 相關的 api 可以參考 https://api.devptt.site:8080
現在改成了 http://localhost:3456/v1/register
go-pttbbs 相關的 api 可以參考 https://api.devptt.site:8080
chhsiao1981
01:15:33
這是個 swagger-ui 的網站. 測試站是在 https://api.devptt.site:3456. 可以 telnet api.devptt.site 8888 看 api 測試結果~
ifanchu675
04:32:18
got it, I think that `docker-compose` is working, I can telnet to `localhost`. Thanks.
- 👍1
ifanchu675
04:50:01
有另一個問題,這個 `scripts/swagger.sh`, 是可以用來standup swagger-ui的嗎?裡面有用到 `pyyaml` and `flaskswagger`, 我用python 3.8 setup virtualenv 後試了一下, `flaskswagger` failed
```usage: flaskswagger [-h] [--template TEMPLATE] [--out-dir OUT_DIR] [--definitions DEFINITIONS] [--host HOST] [--base-path BASE_PATH] [--version VERSION] app
flaskswagger: error: unrecognized arguments: --from-file-keyword=swagger_from_file```
是不是我python version用錯了?我找了一下好像也沒看到用來setup python venv用的 `requirements.txt`
```usage: flaskswagger [-h] [--template TEMPLATE] [--out-dir OUT_DIR] [--definitions DEFINITIONS] [--host HOST] [--base-path BASE_PATH] [--version VERSION] app
flaskswagger: error: unrecognized arguments: --from-file-keyword=swagger_from_file```
是不是我python version用錯了?我找了一下好像也沒看到用來setup python venv用的 `requirements.txt`
ifanchu675
04:50:05
還有 `calling yaml.load() without Loader=... is deprecated`
ifanchu675
05:01:10
請問一下那個swagger-ui,我若要在localhost setup, 要怎麼弄呢? 我試了 `scripts/swagger.sh` not working. 顯示的是petstore
```╰─➤ ./scripts/swagger.sh localhost
apidoc/yamltojson.py:40: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
the_struct = yaml.load(f)
WARNING:root:include: self: apidoc/template.yaml filename_list: ['apidoc/defs/board_summary.yaml', 'apidoc/defs/host.yaml', 'apidoc/defs/x_forwarded_for.yaml', 'apidoc/defs/authorization.yaml', 'apidoc/defs/article_summary.yaml', 'apidoc/defs/params_max.yaml', 'apidoc/defs/params_start_idx.yaml', 'apidoc/defs/params_keyword.yaml']
apidoc/yamltojson.py:26: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
each_struct = yaml.load(f)
Traceback (most recent call last):
File "/Users/ifanchu/code/venv/python3/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2455, in resolve
return functools.reduce(getattr, self.attrs, module)
AttributeError: module 'apidoc' has no attribute 'app'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/ifanchu/code/venv/python3/bin/flaskswagger", line 8, in <module>
sys.exit(run())
File "/Users/ifanchu/code/venv/python3/lib/python3.8/site-packages/build_swagger_spec.py", line 24, in run
app = pkg_resources.EntryPoint.parse("x=%s" % args.app).resolve()
File "/Users/ifanchu/code/venv/python3/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2457, in resolve
raise ImportError(str(exc)) from exc
ImportError: module 'apidoc' has no attribute 'app'```
```╰─➤ ./scripts/swagger.sh localhost
apidoc/yamltojson.py:40: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
the_struct = yaml.load(f)
WARNING:root:include: self: apidoc/template.yaml filename_list: ['apidoc/defs/board_summary.yaml', 'apidoc/defs/host.yaml', 'apidoc/defs/x_forwarded_for.yaml', 'apidoc/defs/authorization.yaml', 'apidoc/defs/article_summary.yaml', 'apidoc/defs/params_max.yaml', 'apidoc/defs/params_start_idx.yaml', 'apidoc/defs/params_keyword.yaml']
apidoc/yamltojson.py:26: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
each_struct = yaml.load(f)
Traceback (most recent call last):
File "/Users/ifanchu/code/venv/python3/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2455, in resolve
return functools.reduce(getattr, self.attrs, module)
AttributeError: module 'apidoc' has no attribute 'app'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/ifanchu/code/venv/python3/bin/flaskswagger", line 8, in <module>
sys.exit(run())
File "/Users/ifanchu/code/venv/python3/lib/python3.8/site-packages/build_swagger_spec.py", line 24, in run
app = pkg_resources.EntryPoint.parse("x=%s" % args.app).resolve()
File "/Users/ifanchu/code/venv/python3/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2457, in resolve
raise ImportError(str(exc)) from exc
ImportError: module 'apidoc' has no attribute 'app'```
chhsiao1981
07:16:37
hmm~
原來還有這部分~
基本上 swagger-ui 我是先用 python 的環境偷吃步~
所以需要:
1. 產生一個 virtualenv 的環境.
2. 在 apidoc 裡 pip install .; pip uninstall apidoc; python setup develop (這個步驟有可以改進的空間~ 不過就先如此了~)
3. 回到原本的目錄. 做 scripts/swagger.sh
這樣子可能可以 work~
原來還有這部分~
基本上 swagger-ui 我是先用 python 的環境偷吃步~
所以需要:
1. 產生一個 virtualenv 的環境.
2. 在 apidoc 裡 pip install .; pip uninstall apidoc; python setup develop (這個步驟有可以改進的空間~ 不過就先如此了~)
3. 回到原本的目錄. 做 scripts/swagger.sh
這樣子可能可以 work~
ifanchu675
2020-12-31 11:34:00
Let me try
ifanchu675
2020-12-31 13:55:37
yes it works, thanks
chhsiao1981
07:16:45
@ifanchu675
ifanchu675
11:34:00
Let me try
ifanchu675
13:55:37
yes it works, thanks
ifanchu675
14:05:25
不好意思再請問一下我要如何register SYSOP? swagger裡面要求 `Host` , I put `localhost` ; `X-Forwarded-For`, I put `127.0.0.1`, 然後param
```{
"username": "SYSOP",
"password": "password",
"email": "sysop@ptt.com",
"nickname": "SYSOP",
"realname": "SYSOP",
"career": "NA",
"address": "NA",
"over18": true
}```
送出後 response code 200, 但response body
```{
"access_token": "string",
"token_type": "string"
}```
看起來是沒有註冊成功。
```{
"username": "SYSOP",
"password": "password",
"email": "sysop@ptt.com",
"nickname": "SYSOP",
"realname": "SYSOP",
"career": "NA",
"address": "NA",
"over18": true
}```
送出後 response code 200, 但response body
```{
"access_token": "string",
"token_type": "string"
}```
看起來是沒有註冊成功。
chhsiao1981
18:58:15
@ifanchu675
這個看起來是 swagger 的結果?~
直接用 swagger 目前會遇到 CORS 的問題~
swagger 上有 curl 指令. 並且有 copy 的 button~
你可以用 copy button 使用 curl 指令~
這個看起來是 swagger 的結果?~
直接用 swagger 目前會遇到 CORS 的問題~
swagger 上有 curl 指令. 並且有 copy 的 button~
你可以用 copy button 使用 curl 指令~
chhsiao1981
19:01:05
基本上 mobile-app / server-side 互傳是沒有 CORS 的問題~
只有 browser 上才會有 CORS 的問題~
某種程度上這其實是符合預期的~ 因為目前並不希望其他網站讓使用者直接在 browser 上偷打 api~
只有 browser 上才會有 CORS 的問題~
某種程度上這其實是符合預期的~ 因為目前並不希望其他網站讓使用者直接在 browser 上偷打 api~