Skip to content

Instantly share code, notes, and snippets.

@pastleo
Last active April 30, 2021 07:07
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pastleo/c34bcfa883d624772e3ebcf0080c2eaa to your computer and use it in GitHub Desktop.
Save pastleo/c34bcfa883d624772e3ebcf0080c2eaa to your computer and use it in GitHub Desktop.
綜合所得稅申報系統 Docker Image that ArchLinux can use

綜合所得稅申報系統 Docker Image that ArchLinux can use

在 2021/4/30 更新給 google 到這邊的朋友們:

這篇很可能已經不能用,原作者也有更新導致下方連結失效,原作者 repo: https://github.com/chihchun/personal-income-tax-docker/

同時在筆者稍微了解此這邊的技術架構後,偏好讓 docker 只執行最小需要虛擬的部份,也就是只有健保卡元件 mLNHIICC,因為政府網站只有提供給 Ubuntu, Fedora 用的 binary,其他部份可以用原本 host 的軟體就用原本 host 的軟體,改成筆者的版本,有興趣的朋友也歡迎參考:


based on https://github.com/chihchun/personal-income-tax-docker/tree/master/2018, but I use host pcscd

requirements

  • docker
  • Xorg
  • pcscd (smart card reader service)

follow this wiki to install pcscd: https://wiki.archlinux.org/index.php/Smartcards

pacman -Sy docker ccid opensc pcsc-tools

Test on host

sudo systemctl restart pcscd
pcsc_scan

then insert the card, there should be readings from pcsc_scan

run the container

bash <(curl -s https://gist.githubusercontent.com/pastleo/c34bcfa883d624772e3ebcf0080c2eaa/raw/affed8df71e8d0a7c296e0847329ed91507d5cef/run.sh)
#!/bin/sh
set -x
sudo systemctl restart pcscd.service
# Ensure user can connect to X server on localhost
xhost +localhost
read -r -d '' COMMAND_STR << COMMAND_STR_EOM
cd /usr/local/HiPKILocalSignServerApp && ./start.sh &
# Start plugin for health insurance card
sudo /usr/local/share/NHIICC/mLNHIICC
firefox \
https://github.com/chihchun/personal-income-tax-docker/blob/master/2019/README.md \
https://efile.tax.nat.gov.tw/irxw/index.jsp \
https://iccert.nhi.gov.tw:7777
COMMAND_STR_EOM
# Individual Income Tax
docker run -ti --rm \
-e XMODIFIERS=$XMODIFIERS \
-e LANGUAGE=$LANGUAGE \
-e LC_ALL=$LC_ALL \
-e LANG=$LANG \
-e LC_CTYPE=${LC_CTYPE} \
-e DISPLAY=$DISPLAY \
--privileged \
-v /run/pcscd:/run/pcscd \
-v $(xdg-user-dir DOWNLOAD):/home/firefox/Downloads \
-v /tmp/.X11-unix:/tmp/.X11-unix \
chihchun/personal-income-tax:2019 \
sh -c "$COMMAND_STR"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment