-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_discourse.sh
84 lines (68 loc) · 2.62 KB
/
install_discourse.sh
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md
# https://app.mailjet.com/account/setup
# https://meta.discourse.org/t/replace-rubygems-org-with-taobao-mirror-to-resolve-network-error-in-china/21988
# (optional) edit templates/web.china.template.yml - https://mirrors.tuna.tsinghua.edu.cn/help/rubygems/
- gem sources --add https://mirrors.tuna.tsinghua.edu.cn/rubygems/ --remove https://rubygems.org/
# in app.yml
templates:
- "templates/web.china.yml"
## Github time out -> /etc/hosts
# https://www.ipaddress.com/ip-lookup
# github.com
# assets-cdn.github.com
# change install location: modify `volumes`
# https://meta.discourse.org/t/change-discourse-install-storage-location/88256
# Domain name or `/etc/hosts`
# namecheap: education.github.com/pack
# Change timezone to UTC
sudo timedatectl set-timezone UTC
sudo service cron restart
# Git - /etc/ssh/ssh_config
GSSAPIAuthentication no
# Docker
# Best in aliyun: https://cr.console.aliyun.com/cn-beijing/instances/mirrors
# http://mirrors.ustc.edu.cn/help/docker-ce.html
# download.docker.com -> mirrors.ustc.edu.cn/docker-ce
# mirror: http://mirrors.ustc.edu.cn/help/dockerhub.html#id3
# Email Server
# Mailjet: https://www.mailjet.com/
# My account -> Senders & Domains (do 3 part one by one)
# !Important: If you own `example.com`, please
# (Maybe 网易企业邮箱: http://ym.163.com)
# Install plugin
# https://meta.discourse.org/t/install-plugins-in-discourse/19157
# - git clone https://github.com/discourse/discourse-math.git
# - git clone https://github.com/discourse/discourse-solved.git
# - git clone https://github.com/discourse/discourse-checklist.git
# Install
./launcher rebuild app
./launcher rebuild app -e HTTP_PROXY="<proxy>" -e HTTPS_PROXY="<proxy>"
# Create admin
./launcher enter app
rake admin:create
crontab -e
0 0,12 * * * /var/discourse/shared/standalone/scripts/update_score.py
## disable read-only mode
./launcher enter app
rails c
Discourse.disable_readonly_mode(Discourse::USER_READONLY_MODE_KEY)
## change domain name
# 1. edit containers/app.yml
./launcher rebuild app
./launcher enter app
discourse remap <old domain> <new domain>
rake posts:rebake
## Restore backup
# https://meta.discourse.org/t/restore-a-backup-from-command-line/108034
mkdir -p shared/standalone/backups/default
# put <name>.tar.gz under the created folder
./launcher enter app
discourse enable_restore
discourse restore <name>.tar.gz
## Enable hostname in local network
# https://www.anastis.gr/setting-hostname-avahi-mdns/
#hostnamectl set-hostname <new name>
#yum install -y avahi
# apt-get install avahi-daemon
#systemctl enable avahi
#systemctl start avahi