-
Notifications
You must be signed in to change notification settings - Fork 49
/
install.sh
140 lines (101 loc) · 3.62 KB
/
install.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#!/bin/bash
cat << "EOF"
_ _ _ _ _ _ _ ___ _ _ _
_ | (_) |_ __(_)___ /_\ __| |_ __ (_)_ _ |_ _|_ _ __| |_ __ _| | |___ _ _
| || | | _(_-< |___/ _ \/ _` | ' \| | ' \ | || ' \(_-< _/ _` | | / -_) '_|
\__/|_|\__/__/_| /_/ \_\__,_|_|_|_|_|_||_| |___|_||_/__/\__\__,_|_|_\___|_|
EOF
BRANCH=${1:-master}
sudo mkdir -p /var/www
echo ""
echo ******INSTALLING DEPENDENCIES******
echo ""
sudo apt update
sudo service apache2 stop
sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common php php-*
sudo apt-get autoremove
sudo apt install -y lsb-release gnupg2 ca-certificates apt-transport-https software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt install -y \
git curl lsb-release ca-certificates apt-transport-https software-properties-common gnupg2 mysql-server \
nginx nginx-extras\
php8.2 php8.2-{bcmath,fpm,xml,mysql,zip,intl,ldap,gd,cli,bz2,curl,mbstring,opcache,soap,cgi,dom,simplexml}
curl -sL https://deb.nodesource.com/setup_18.x | sudo bash -
sudo apt -y install nodejs
clear
echo ""
echo ******INSTALLING JITSI-ADMIN*******
echo ""
pushd /var/www
[ ! -d "/var/www/jitsi-admin" ] && git clone https://github.com/H2-invent/jitsi-admin.git
popd
pushd /var/www/jitsi-admin
git -C /var/www/jitsi-admin checkout $BRANCH
git -C /var/www/jitsi-admin reset --hard
git -C /var/www/jitsi-admin pull
export COMPOSER_ALLOW_SUPERUSER=1
php composer.phar install --no-interaction
php composer.phar dump-autoload
cp -n .env.sample .env.local
sudo mysql -e "CREATE USER 'jitsiadmin'@'localhost' IDENTIFIED BY 'jitsiadmin';"
sudo mysql -e "GRANT ALL PRIVILEGES ON jitsi_admin.* TO 'jitsiadmin'@'localhost';"
sudo mysql -e "FLUSH PRIVILEGES;"
php bin/console app:install
php bin/console cache:clear
php bin/console doctrine:database:create --if-not-exists --no-interaction
php bin/console doctrine:migrations:migrate --no-interaction
php bin/console cache:clear
php bin/console cache:warmup
php bin/console app:system:repair
clear
echo ""
echo *******Build JS and CSS********
echo ""
npm install
npm run build
rm -rf node_modules/
clear
echo ""
echo *******Build Webesocket********
echo ""
popd
pushd /var/www/jitsi-admin/nodejs
npm install
popd
clear
pushd /var/www/jitsi-admin
echo ""
echo *******CONFIGURING SERVICES********
echo ""
crontab -l > cron_bkp
echo "* * * * * php /var/www/jitsi-admin/bin/console cron:run 1>> /dev/null 2>&1" > cron_bkp
crontab cron_bkp
rm cron_bkp
chown -R www-data:www-data var/
chown -R www-data:www-data public/
chown -R www-data:www-data theme/
cp installer/nginx.conf /etc/nginx/sites-enabled/jitsi-admin.conf
rm /etc/nginx/sites-enabled/default
cp installer/jitsi-admin_messenger.service /etc/systemd/system/jitsi-admin_messenger.service
cp installer/jitsi-admin.conf /etc/systemd/system/jitsi-admin.conf
cp -r nodejs /usr/local/bin/websocket
cp installer/jitsi-admin_websocket.service /etc/systemd/system/jitsi-admin_websocket.service
mkdir /var/log/websocket/
service php*-fpm restart
service nginx restart
systemctl daemon-reload
service jitsi-admin* stop
service jitsi-admin_messenger start
service jitsi-admin_messenger restart
systemctl enable jitsi-admin_messenger
systemctl daemon-reload
service jitsi-admin_websocket start
service jitsi-admin_websocket restart
systemctl enable jitsi-admin_websocket
popd
cat << "EOF"
___ _ _ _ _ __ _
|_ _|_ _ __| |_ __ _| | |___ __| | ____ _ __ __ ___ ______/ _|_ _| |
| || ' \(_-| _/ _` | | / -_/ _` | (_-| || / _/ _/ -_(_-(_-| _| || | |
|___|_||_/__/\__\__,_|_|_\___\__,_| /__/\_,_\__\__\___/__/__|_| \_,_|_|
EOF