summarylogtreecommitdiffstats
path: root/install
blob: b545b659d30644ae6e739a6662485b26b20fd9a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
post_install() {
  if [[ ! -f /etc/telegramircd/key.pem ]]; then
    mkdir -p /etc/telegramircd
    openssl req -x509 -newkey rsa:2048 -nodes -keyout /etc/telegramircd/key.pem -out /etc/telegramircd/cert.pem -subj '/CN=127.0.0.1' -days 9999
    cat <<NOTE
NOTE:
1. Redirect https://web.telegram.org/js/app.js to https://127.0.0.1:9003/app.js
2. Import /etc/telegramircd/cert.pem to your browser. Instructions for Chrome/Chromium are listed below:
  a. Visit chrome://settings/certificates
  b. Import /etc/telegramircd/cert.pem
  c. 'Authorities' tab page -> 'Untrusted 127.0.0.1' -> 'Edit...' -> 'Trust this certificate for identifying websites.'

Refer to https://github.com/MaskRay/telegramircd for details.
NOTE
  fi
}

post_upgrade() {
  post_install
}

post_remove() {
  echo Removing /etc/telegramircd/
  rm /etc/telegramircd/{cert,key}.pem
  rmdir /etc/telegramircd
}