|
@@ -0,0 +1,407 @@
|
|
1
|
+#!/bin/bash
|
|
2
|
+#
|
|
3
|
+# .---. . .
|
|
4
|
+# | | |
|
|
5
|
+# |--- .--. .-. .-. .-.| .-. .--.--. |.-. .-. .--. .-.
|
|
6
|
+# | | (.-' (.-' ( | ( )| | | | )( )| | (.-'
|
|
7
|
+# ' ' --' --' -' - -' ' ' -' -' -' ' - --'
|
|
8
|
+#
|
|
9
|
+# Freedom in the Cloud
|
|
10
|
+#
|
|
11
|
+# Personal or small business accounts
|
|
12
|
+#
|
|
13
|
+# License
|
|
14
|
+# =======
|
|
15
|
+#
|
|
16
|
+# Copyright (C) 2017 Bob Mottram <bob@freedombone.net>
|
|
17
|
+#
|
|
18
|
+# This program is free software: you can redistribute it and/or modify
|
|
19
|
+# it under the terms of the GNU Affero General Public License as published by
|
|
20
|
+# the Free Software Foundation, either version 3 of the License, or
|
|
21
|
+# (at your option) any later version.
|
|
22
|
+#
|
|
23
|
+# This program is distributed in the hope that it will be useful,
|
|
24
|
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
25
|
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
26
|
+# GNU Affero General Public License for more details.
|
|
27
|
+#
|
|
28
|
+# You should have received a copy of the GNU Affero General Public License
|
|
29
|
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
30
|
+
|
|
31
|
+VARIANTS='full full-vim media'
|
|
32
|
+
|
|
33
|
+IN_DEFAULT_INSTALL=0
|
|
34
|
+SHOW_ON_ABOUT=1
|
|
35
|
+
|
|
36
|
+AKAUNTING_DOMAIN_NAME=
|
|
37
|
+AKAUNTING_CODE=
|
|
38
|
+AKAUNTING_ONION_PORT=8341
|
|
39
|
+AKAUNTING_REPO="https://github.com/akaunting/akaunting"
|
|
40
|
+AKAUNTING_COMMIT='b68c840cded60d92b86e98fcbc26ce338cf93fef'
|
|
41
|
+AKAUNTING_ADMIN_PASSWORD=
|
|
42
|
+
|
|
43
|
+AKAUNTING_BACKGROUND_IMAGE_URL=
|
|
44
|
+
|
|
45
|
+akaunting_variables=(ONION_ONLY
|
|
46
|
+ AKAUNTING_DOMAIN_NAME
|
|
47
|
+ AKAUNTING_CODE
|
|
48
|
+ AKAUNTING_WELCOME_MESSAGE
|
|
49
|
+ AKAUNTING_BACKGROUND_IMAGE_URL
|
|
50
|
+ DDNS_PROVIDER
|
|
51
|
+ MY_USERNAME)
|
|
52
|
+
|
|
53
|
+function logging_on_akaunting {
|
|
54
|
+ echo -n ''
|
|
55
|
+}
|
|
56
|
+
|
|
57
|
+function logging_off_akaunting {
|
|
58
|
+ echo -n ''
|
|
59
|
+}
|
|
60
|
+
|
|
61
|
+function remove_user_akaunting {
|
|
62
|
+ remove_username="$1"
|
|
63
|
+
|
|
64
|
+ ${PROJECT_NAME}-pass -u $remove_username --rmapp akaunting
|
|
65
|
+}
|
|
66
|
+
|
|
67
|
+function add_user_akaunting {
|
|
68
|
+ new_username="$1"
|
|
69
|
+ new_user_password="$2"
|
|
70
|
+
|
|
71
|
+ ${PROJECT_NAME}-pass -u $new_username -a akaunting -p "$new_user_password"
|
|
72
|
+
|
|
73
|
+ echo '0'
|
|
74
|
+}
|
|
75
|
+
|
|
76
|
+function install_interactive_akaunting {
|
|
77
|
+ if [ ! $ONION_ONLY ]; then
|
|
78
|
+ ONION_ONLY='no'
|
|
79
|
+ fi
|
|
80
|
+
|
|
81
|
+ if [[ $ONION_ONLY != "no" ]]; then
|
|
82
|
+ AKAUNTING_DOMAIN_NAME='akaunting.local'
|
|
83
|
+ else
|
|
84
|
+ AKAUNTING_DETAILS_COMPLETE=
|
|
85
|
+ while [ ! $AKAUNTING_DETAILS_COMPLETE ]
|
|
86
|
+ do
|
|
87
|
+ data=$(tempfile 2>/dev/null)
|
|
88
|
+ trap "rm -f $data" 0 1 2 5 15
|
|
89
|
+ if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
|
|
90
|
+ dialog --backtitle $"Freedombone Configuration" \
|
|
91
|
+ --title $"Akaunting Configuration" \
|
|
92
|
+ --form $"\nPlease enter your Akaunting details. The background image URL can be left blank.\n\nIMPORTANT: This should be a domain name which is supported by Let's Encrypt:" 14 65 2 \
|
|
93
|
+ $"Domain:" 1 1 "$(grep 'AKAUNTING_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 25 33 40 \
|
|
94
|
+ $"Code:" 2 1 "$(grep 'AKAUNTING_CODE' temp.cfg | awk -F '=' '{print $2}')" 2 25 33 255 \
|
|
95
|
+ 2> $data
|
|
96
|
+ else
|
|
97
|
+ dialog --backtitle $"Freedombone Configuration" \
|
|
98
|
+ --title $"Akaunting Configuration" \
|
|
99
|
+ --form $"\nPlease enter your Akaunting details. The background image URL can be left blank.\n\nIMPORTANT: This should be a domain name which is supported by Let's Encrypt:" 14 65 2 \
|
|
100
|
+ $"Domain:" 1 1 "$(grep 'AKAUNTING_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 1 25 33 40 \
|
|
101
|
+ 2> $data
|
|
102
|
+ fi
|
|
103
|
+ sel=$?
|
|
104
|
+ case $sel in
|
|
105
|
+ 1) exit 1;;
|
|
106
|
+ 255) exit 1;;
|
|
107
|
+ esac
|
|
108
|
+ AKAUNTING_DOMAIN_NAME=$(cat $data | sed -n 1p)
|
|
109
|
+ if [ $AKAUNTING_DOMAIN_NAME ]; then
|
|
110
|
+ if [[ $AKAUNTING_DOMAIN_NAME == "$HUBZILLA_DOMAIN_NAME" ]]; then
|
|
111
|
+ AKAUNTING_DOMAIN_NAME=""
|
|
112
|
+ fi
|
|
113
|
+ TEST_DOMAIN_NAME=$AKAUNTING_DOMAIN_NAME
|
|
114
|
+ validate_domain_name
|
|
115
|
+ if [[ $TEST_DOMAIN_NAME != $AKAUNTING_DOMAIN_NAME ]]; then
|
|
116
|
+ AKAUNTING_DOMAIN_NAME=
|
|
117
|
+ dialog --title $"Domain name validation" --msgbox "$TEST_DOMAIN_NAME" 15 50
|
|
118
|
+ else
|
|
119
|
+ if [[ $DDNS_PROVIDER == "default@freedns.afraid.org" ]]; then
|
|
120
|
+ AKAUNTING_CODE=$(cat $data | sed -n 2p)
|
|
121
|
+ validate_freedns_code "$AKAUNTING_CODE"
|
|
122
|
+ if [ ! $VALID_CODE ]; then
|
|
123
|
+ AKAUNTING_DOMAIN_NAME=
|
|
124
|
+ fi
|
|
125
|
+ fi
|
|
126
|
+ fi
|
|
127
|
+ fi
|
|
128
|
+ if [ $AKAUNTING_DOMAIN_NAME ]; then
|
|
129
|
+ AKAUNTING_DETAILS_COMPLETE="yes"
|
|
130
|
+ fi
|
|
131
|
+ done
|
|
132
|
+
|
|
133
|
+ write_config_param "AKAUNTING_CODE" "$AKAUNTING_CODE"
|
|
134
|
+ fi
|
|
135
|
+ write_config_param "AKAUNTING_DOMAIN_NAME" "$AKAUNTING_DOMAIN_NAME"
|
|
136
|
+ APP_INSTALLED=1
|
|
137
|
+}
|
|
138
|
+
|
|
139
|
+function change_password_akaunting {
|
|
140
|
+ curr_username="$1"
|
|
141
|
+ new_user_password="$2"
|
|
142
|
+
|
|
143
|
+ read_config_param 'AKAUNTING_DOMAIN_NAME'
|
|
144
|
+
|
|
145
|
+ ${PROJECT_NAME}-pass -u "$curr_username" -a akaunting -p "$new_user_password"
|
|
146
|
+}
|
|
147
|
+
|
|
148
|
+function akaunting_create_database {
|
|
149
|
+ if [ -f $IMAGE_PASSWORD_FILE ]; then
|
|
150
|
+ AKAUNTING_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
|
|
151
|
+ else
|
|
152
|
+ if [ ! $AKAUNTING_ADMIN_PASSWORD ]; then
|
|
153
|
+ AKAUNTING_ADMIN_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
|
|
154
|
+ fi
|
|
155
|
+ fi
|
|
156
|
+ if [ ! $AKAUNTING_ADMIN_PASSWORD ]; then
|
|
157
|
+ return
|
|
158
|
+ fi
|
|
159
|
+
|
|
160
|
+ function_check create_database
|
|
161
|
+ create_database akaunting "$AKAUNTING_ADMIN_PASSWORD" $MY_USERNAME
|
|
162
|
+}
|
|
163
|
+
|
|
164
|
+function reconfigure_akaunting {
|
|
165
|
+ echo -n ''
|
|
166
|
+}
|
|
167
|
+
|
|
168
|
+function upgrade_akaunting {
|
|
169
|
+ CURR_AKAUNTING_COMMIT=$(get_completion_param "akaunting commit")
|
|
170
|
+ if [[ "$CURR_AKAUNTING_COMMIT" == "$AKAUNTING_COMMIT" ]]; then
|
|
171
|
+ return
|
|
172
|
+ fi
|
|
173
|
+
|
|
174
|
+ if grep -q "akaunting domain" $COMPLETION_FILE; then
|
|
175
|
+ AKAUNTING_DOMAIN_NAME=$(get_completion_param "akaunting domain")
|
|
176
|
+ fi
|
|
177
|
+
|
|
178
|
+ # update to the next commit
|
|
179
|
+ function_check set_repo_commit
|
|
180
|
+ set_repo_commit /var/www/$AKAUNTING_DOMAIN_NAME/htdocs "akaunting commit" "$AKAUNTING_COMMIT" $AKAUNTING_REPO
|
|
181
|
+
|
|
182
|
+ chown -R www-data:www-data /var/www/${AKAUNTING_DOMAIN_NAME}/htdocs
|
|
183
|
+}
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+function backup_local_akaunting {
|
|
187
|
+ echo -n ''
|
|
188
|
+}
|
|
189
|
+
|
|
190
|
+function restore_local_akaunting {
|
|
191
|
+ echo -n ''
|
|
192
|
+}
|
|
193
|
+
|
|
194
|
+function backup_remote_akaunting {
|
|
195
|
+ echo -n ''
|
|
196
|
+}
|
|
197
|
+
|
|
198
|
+function restore_remote_akaunting {
|
|
199
|
+ echo -n ''
|
|
200
|
+}
|
|
201
|
+
|
|
202
|
+function remove_akaunting {
|
|
203
|
+ if [ ${#AKAUNTING_DOMAIN_NAME} -eq 0 ]; then
|
|
204
|
+ return
|
|
205
|
+ fi
|
|
206
|
+
|
|
207
|
+ read_config_param "AKAUNTING_DOMAIN_NAME"
|
|
208
|
+ read_config_param "MY_USERNAME"
|
|
209
|
+ echo "Removing $AKAUNTING_DOMAIN_NAME"
|
|
210
|
+ nginx_dissite $AKAUNTING_DOMAIN_NAME
|
|
211
|
+ remove_certs $AKAUNTING_DOMAIN_NAME
|
|
212
|
+
|
|
213
|
+ if [ -d /var/www/$AKAUNTING_DOMAIN_NAME ]; then
|
|
214
|
+ rm -rf /var/www/$AKAUNTING_DOMAIN_NAME
|
|
215
|
+ fi
|
|
216
|
+ if [ -f /etc/nginx/sites-available/$AKAUNTING_DOMAIN_NAME ]; then
|
|
217
|
+ rm /etc/nginx/sites-available/$AKAUNTING_DOMAIN_NAME
|
|
218
|
+ fi
|
|
219
|
+ function_check drop_database
|
|
220
|
+ drop_database akaunting
|
|
221
|
+ function_check remove_onion_service
|
|
222
|
+ remove_onion_service akaunting ${AKAUNTING_ONION_PORT}
|
|
223
|
+ if grep -q "akaunting" /etc/crontab; then
|
|
224
|
+ sed -i "/akaunting/d" /etc/crontab
|
|
225
|
+ fi
|
|
226
|
+ remove_app akaunting
|
|
227
|
+ remove_completion_param install_akaunting
|
|
228
|
+ sed -i '/akaunting/d' $COMPLETION_FILE
|
|
229
|
+
|
|
230
|
+ function_check remove_ddns_domain
|
|
231
|
+ remove_ddns_domain $AKAUNTING_DOMAIN_NAME
|
|
232
|
+}
|
|
233
|
+
|
|
234
|
+function install_akaunting {
|
|
235
|
+ if [ ! $ONION_ONLY ]; then
|
|
236
|
+ ONION_ONLY='no'
|
|
237
|
+ fi
|
|
238
|
+
|
|
239
|
+ if [ ! $AKAUNTING_DOMAIN_NAME ]; then
|
|
240
|
+ echo $'No domain name was given for akaunting'
|
|
241
|
+ exit 7359
|
|
242
|
+ fi
|
|
243
|
+
|
|
244
|
+ function_check install_mariadb
|
|
245
|
+ install_mariadb
|
|
246
|
+
|
|
247
|
+ function_check get_mariadb_password
|
|
248
|
+ get_mariadb_password
|
|
249
|
+
|
|
250
|
+ apt-get -yq install php-gettext php-curl php-gd php-mysql git curl
|
|
251
|
+ apt-get -yq install memcached php-memcached php-intl exiftool libfcgi0ldbl
|
|
252
|
+
|
|
253
|
+ if [ ! -d /var/www/$AKAUNTING_DOMAIN_NAME ]; then
|
|
254
|
+ mkdir /var/www/$AKAUNTING_DOMAIN_NAME
|
|
255
|
+ fi
|
|
256
|
+ if [ ! -d /var/www/$AKAUNTING_DOMAIN_NAME/htdocs ]; then
|
|
257
|
+ if [ -d /repos/akaunting ]; then
|
|
258
|
+ mkdir /var/www/$AKAUNTING_DOMAIN_NAME/htdocs
|
|
259
|
+ cp -r -p /repos/akaunting/. /var/www/$AKAUNTING_DOMAIN_NAME/htdocs
|
|
260
|
+ cd /var/www/$AKAUNTING_DOMAIN_NAME/htdocs
|
|
261
|
+ git pull
|
|
262
|
+ else
|
|
263
|
+ function_check git_clone
|
|
264
|
+ git_clone $AKAUNTING_REPO /var/www/$AKAUNTING_DOMAIN_NAME/htdocs
|
|
265
|
+ fi
|
|
266
|
+
|
|
267
|
+ if [ ! -d /var/www/$AKAUNTING_DOMAIN_NAME/htdocs ]; then
|
|
268
|
+ echo $'Unable to clone akaunting repo'
|
|
269
|
+ exit 87525
|
|
270
|
+ fi
|
|
271
|
+ fi
|
|
272
|
+
|
|
273
|
+ cd /var/www/$AKAUNTING_DOMAIN_NAME/htdocs
|
|
274
|
+ git checkout $AKAUNTING_COMMIT -b $AKAUNTING_COMMIT
|
|
275
|
+ set_completion_param "akaunting commit" "$AKAUNTING_COMMIT"
|
|
276
|
+
|
|
277
|
+ chmod g+w /var/www/$AKAUNTING_DOMAIN_NAME/htdocs
|
|
278
|
+ chown -R www-data:www-data /var/www/$AKAUNTING_DOMAIN_NAME/htdocs
|
|
279
|
+
|
|
280
|
+ function_check akaunting_create_database
|
|
281
|
+ akaunting_create_database
|
|
282
|
+
|
|
283
|
+ function_check add_ddns_domain
|
|
284
|
+ add_ddns_domain $AKAUNTING_DOMAIN_NAME
|
|
285
|
+
|
|
286
|
+ AKAUNTING_ONION_HOSTNAME=$(add_onion_service akaunting 80 ${AKAUNTING_ONION_PORT})
|
|
287
|
+
|
|
288
|
+ akaunting_nginx_site=/etc/nginx/sites-available/$AKAUNTING_DOMAIN_NAME
|
|
289
|
+ if [[ $ONION_ONLY == "no" ]]; then
|
|
290
|
+ function_check nginx_http_redirect
|
|
291
|
+ nginx_http_redirect $AKAUNTING_DOMAIN_NAME "index index.php"
|
|
292
|
+ echo 'server {' >> $akaunting_nginx_site
|
|
293
|
+ echo ' listen 443 ssl;' >> $akaunting_nginx_site
|
|
294
|
+ echo ' listen [::]:443 ssl;' >> $akaunting_nginx_site
|
|
295
|
+ echo " server_name $AKAUNTING_DOMAIN_NAME;" >> $akaunting_nginx_site
|
|
296
|
+ echo '' >> $akaunting_nginx_site
|
|
297
|
+ function_check nginx_compress
|
|
298
|
+ nginx_compress $AKAUNTING_DOMAIN_NAME
|
|
299
|
+ echo '' >> $akaunting_nginx_site
|
|
300
|
+ echo ' # Security' >> $akaunting_nginx_site
|
|
301
|
+ function_check nginx_ssl
|
|
302
|
+ nginx_ssl $AKAUNTING_DOMAIN_NAME
|
|
303
|
+
|
|
304
|
+ function_check nginx_disable_sniffing
|
|
305
|
+ nginx_disable_sniffing $AKAUNTING_DOMAIN_NAME
|
|
306
|
+
|
|
307
|
+ echo ' add_header Strict-Transport-Security max-age=15768000;' >> $akaunting_nginx_site
|
|
308
|
+ echo '' >> $akaunting_nginx_site
|
|
309
|
+ echo ' # Logs' >> $akaunting_nginx_site
|
|
310
|
+ echo ' access_log /dev/null;' >> $akaunting_nginx_site
|
|
311
|
+ echo ' error_log /dev/null;' >> $akaunting_nginx_site
|
|
312
|
+ echo '' >> $akaunting_nginx_site
|
|
313
|
+ echo ' # Root' >> $akaunting_nginx_site
|
|
314
|
+ echo " root /var/www/$AKAUNTING_DOMAIN_NAME/htdocs;" >> $akaunting_nginx_site
|
|
315
|
+ echo '' >> $akaunting_nginx_site
|
|
316
|
+ echo ' # Index' >> $akaunting_nginx_site
|
|
317
|
+ echo ' index index.php;' >> $akaunting_nginx_site
|
|
318
|
+ echo '' >> $akaunting_nginx_site
|
|
319
|
+ echo ' # PHP' >> $akaunting_nginx_site
|
|
320
|
+ echo ' location ~ \.php {' >> $akaunting_nginx_site
|
|
321
|
+ echo ' include snippets/fastcgi-php.conf;' >> $akaunting_nginx_site
|
|
322
|
+ echo ' fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;' >> $akaunting_nginx_site
|
|
323
|
+ echo ' fastcgi_read_timeout 30;' >> $akaunting_nginx_site
|
|
324
|
+ echo ' }' >> $akaunting_nginx_site
|
|
325
|
+ echo '' >> $akaunting_nginx_site
|
|
326
|
+ echo ' # Location' >> $akaunting_nginx_site
|
|
327
|
+ echo ' location / {' >> $akaunting_nginx_site
|
|
328
|
+ function_check nginx_limits
|
|
329
|
+ nginx_limits $AKAUNTING_DOMAIN_NAME '15m'
|
|
330
|
+ echo ' try_files $uri $uri/ @akaunting;' >> $akaunting_nginx_site
|
|
331
|
+ echo ' }' >> $akaunting_nginx_site
|
|
332
|
+ echo '' >> $akaunting_nginx_site
|
|
333
|
+ echo ' location @akaunting {' >> $akaunting_nginx_site
|
|
334
|
+ echo ' rewrite ^(.*)$ /index.php?p=$1 last;' >> $akaunting_nginx_site
|
|
335
|
+ echo ' }' >> $akaunting_nginx_site
|
|
336
|
+ echo '' >> $akaunting_nginx_site
|
|
337
|
+ echo ' location ~ /\.(ht|git) {' >> $akaunting_nginx_site
|
|
338
|
+ echo ' deny all;' >> $akaunting_nginx_site
|
|
339
|
+ echo ' }' >> $akaunting_nginx_site
|
|
340
|
+ echo '' >> $akaunting_nginx_site
|
|
341
|
+ echo '}' >> $akaunting_nginx_site
|
|
342
|
+ else
|
|
343
|
+ echo -n '' > $akaunting_nginx_site
|
|
344
|
+ fi
|
|
345
|
+ echo 'server {' >> $akaunting_nginx_site
|
|
346
|
+ echo " listen 127.0.0.1:$AKAUNTING_ONION_PORT default_server;" >> $akaunting_nginx_site
|
|
347
|
+ echo " server_name $AKAUNTING_ONION_HOSTNAME;" >> $akaunting_nginx_site
|
|
348
|
+ echo '' >> $akaunting_nginx_site
|
|
349
|
+ function_check nginx_compress
|
|
350
|
+ nginx_compress $AKAUNTING_DOMAIN_NAME
|
|
351
|
+ echo '' >> $akaunting_nginx_site
|
|
352
|
+ function_check nginx_disable_sniffing
|
|
353
|
+ nginx_disable_sniffing $AKAUNTING_DOMAIN_NAME
|
|
354
|
+ echo '' >> $akaunting_nginx_site
|
|
355
|
+ echo ' access_log /dev/null;' >> $akaunting_nginx_site
|
|
356
|
+ echo ' error_log /dev/null;' >> $akaunting_nginx_site
|
|
357
|
+ echo '' >> $akaunting_nginx_site
|
|
358
|
+ echo " root /var/www/$AKAUNTING_DOMAIN_NAME/htdocs;" >> $akaunting_nginx_site
|
|
359
|
+ echo '' >> $akaunting_nginx_site
|
|
360
|
+ echo ' # Index' >> $akaunting_nginx_site
|
|
361
|
+ echo ' index index.php;' >> $akaunting_nginx_site
|
|
362
|
+ echo '' >> $akaunting_nginx_site
|
|
363
|
+ echo ' # PHP' >> $akaunting_nginx_site
|
|
364
|
+ echo ' location ~ \.php {' >> $akaunting_nginx_site
|
|
365
|
+ echo ' include snippets/fastcgi-php.conf;' >> $akaunting_nginx_site
|
|
366
|
+ echo ' fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;' >> $akaunting_nginx_site
|
|
367
|
+ echo ' fastcgi_read_timeout 30;' >> $akaunting_nginx_site
|
|
368
|
+ echo ' }' >> $akaunting_nginx_site
|
|
369
|
+ echo '' >> $akaunting_nginx_site
|
|
370
|
+ echo ' # Location' >> $akaunting_nginx_site
|
|
371
|
+ echo ' location / {' >> $akaunting_nginx_site
|
|
372
|
+ function_check nginx_limits
|
|
373
|
+ nginx_limits $AKAUNTING_DOMAIN_NAME '15m'
|
|
374
|
+ echo ' try_files $uri $uri/ @akaunting;' >> $akaunting_nginx_site
|
|
375
|
+ echo ' }' >> $akaunting_nginx_site
|
|
376
|
+ echo '' >> $akaunting_nginx_site
|
|
377
|
+ echo ' location @akaunting {' >> $akaunting_nginx_site
|
|
378
|
+ echo ' rewrite ^(.*)$ /index.php?p=$1 last;' >> $akaunting_nginx_site
|
|
379
|
+ echo ' }' >> $akaunting_nginx_site
|
|
380
|
+ echo '' >> $akaunting_nginx_site
|
|
381
|
+ echo ' location ~ /\.(ht|git) {' >> $akaunting_nginx_site
|
|
382
|
+ echo ' deny all;' >> $akaunting_nginx_site
|
|
383
|
+ echo ' }' >> $akaunting_nginx_site
|
|
384
|
+ echo '' >> $akaunting_nginx_site
|
|
385
|
+ echo '}' >> $akaunting_nginx_site
|
|
386
|
+
|
|
387
|
+ function_check configure_php
|
|
388
|
+ configure_php
|
|
389
|
+
|
|
390
|
+ function_check create_site_certificate
|
|
391
|
+ create_site_certificate $AKAUNTING_DOMAIN_NAME 'yes'
|
|
392
|
+
|
|
393
|
+ function_check nginx_ensite
|
|
394
|
+ nginx_ensite $AKAUNTING_DOMAIN_NAME
|
|
395
|
+
|
|
396
|
+ systemctl restart mariadb
|
|
397
|
+ systemctl restart php7.0-fpm
|
|
398
|
+ systemctl restart nginx
|
|
399
|
+
|
|
400
|
+ ${PROJECT_NAME}-pass -u $MY_USERNAME -a akaunting -p "$AKAUNTING_ADMIN_PASSWORD"
|
|
401
|
+
|
|
402
|
+ set_completion_param "akaunting domain" "$AKAUNTING_DOMAIN_NAME"
|
|
403
|
+
|
|
404
|
+ APP_INSTALLED=1
|
|
405
|
+}
|
|
406
|
+
|
|
407
|
+# NOTE: deliberately there is no "exit 0"
|