Browse Source

Remove googleapi links from akaunting

Bob Mottram 7 years ago
parent
commit
c6bf24f406
1 changed files with 32 additions and 0 deletions
  1. 32
    0
      src/freedombone-app-akaunting

+ 32
- 0
src/freedombone-app-akaunting View File

@@ -48,6 +48,35 @@ akaunting_variables=(ONION_ONLY
48 48
                      DDNS_PROVIDER
49 49
                      MY_USERNAME)
50 50
 
51
+function akaunting_remove_bad_links {
52
+    cd /var/www/$AKAUNTING_DOMAIN_NAME/htdocs
53
+
54
+    # copy jquery locally
55
+    jquery_version='1.12.4'
56
+    if [ ! -f jquery-${jquery_version}.js ]; then
57
+        cd /var/www/$GHOST_DOMAIN_NAME/htdocs
58
+        wget https://code.jquery.com/jquery-${jquery_version}.js
59
+        jquery_hash=$(sha256sum jquery-${jquery_version}.js | awk -F ' ' '{print $1}')
60
+        if [[ "$jquery_hash" != '430f36f9b5f21aae8cc9dca6a81c4d3d84da5175eaedcf2fdc2c226302cb3575' ]]; then
61
+            echo $'Unexpected jquery hash value'
62
+            exit 78363527
63
+        fi
64
+    fi
65
+
66
+    sed -i '/googleapi/d' resources/assets/sass/app.scss
67
+    sed -i "s|ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js|$AKAUNTING_DOMAIN_NAME/jquery-${jquery_version}.js|g" vendor/league/flysystem/docs/_layouts/default.html
68
+    sed -i '/googleapi/d' vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/503.blade.php
69
+    sed -i '/googleapi/d' vendor/almasaeed2010/adminlte/build/less/AdminLTE-without-plugins.less
70
+    sed -i '/googleapi/d' vendor/almasaeed2010/adminlte/build/less/AdminLTE.less
71
+    sed -i '/googleapi/d' vendor/almasaeed2010/adminlte/dist/css/AdminLTE.css
72
+    sed -i '/googleapi/d' vendor/almasaeed2010/adminlte/dist/css/AdminLTE.min.css
73
+    sed -i '/googleapi/d' vendor/almasaeed2010/adminlte/dist/css/alt/AdminLTE-without-plugins.css
74
+    sed -i '/googleapi/d' vendor/almasaeed2010/adminlte/dist/css/alt/AdminLTE-without-plugins.min.css
75
+    sed -i "s|ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js|$AKAUNTING_DOMAIN_NAME/jquery-${jquery_version}.js|g" vendor/almasaeed2010/adminlte/plugins/ckeditor/samples/old/jquery.html
76
+
77
+    chown -R www-data:www-data /var/www/$AKAUNTING_DOMAIN_NAME/htdocs
78
+}
79
+
51 80
 function logging_on_akaunting {
52 81
     echo -n ''
53 82
 }
@@ -179,6 +208,7 @@ function upgrade_akaunting {
179 208
 
180 209
     cd /var/www/$AKAUNTING_DOMAIN_NAME/htdocs
181 210
     install_composer
211
+    akaunting_remove_bad_links
182 212
 
183 213
     chown -R www-data:www-data /var/www/${AKAUNTING_DOMAIN_NAME}/htdocs
184 214
 }
@@ -424,6 +454,8 @@ function install_akaunting {
424 454
     function_check nginx_ensite
425 455
     nginx_ensite $AKAUNTING_DOMAIN_NAME
426 456
 
457
+    akaunting_remove_bad_links
458
+
427 459
     systemctl restart mariadb
428 460
     systemctl restart php7.0-fpm
429 461
     systemctl restart nginx