Browse Source

Blog installation

Bob Mottram 10 years ago
parent
commit
340ae2712e
1 changed files with 38 additions and 4 deletions
  1. 38
    4
      install-freedombone.sh

+ 38
- 4
install-freedombone.sh View File

64
 FREEDNS_SUBDOMAIN_CODE=$3
64
 FREEDNS_SUBDOMAIN_CODE=$3
65
 SYSTEM_TYPE=$4
65
 SYSTEM_TYPE=$4
66
 
66
 
67
+# Different system variants which may be specified within
68
+# the SYSTEM_TYPE option
67
 VARIANT_WRITER="writer"
69
 VARIANT_WRITER="writer"
68
 VARIANT_CLOUD="cloud"
70
 VARIANT_CLOUD="cloud"
69
 VARIANT_CHAT="chat"
71
 VARIANT_CHAT="chat"
93
 WIKI_ARCHIVE="dokuwiki-stable.tgz"
95
 WIKI_ARCHIVE="dokuwiki-stable.tgz"
94
 WIKI_DOWNLOAD="http://download.dokuwiki.org/src/dokuwiki/$WIKI_ARCHIVE"
96
 WIKI_DOWNLOAD="http://download.dokuwiki.org/src/dokuwiki/$WIKI_ARCHIVE"
95
 WIKI_HASH="a0e79986b87b2744421ce3c33b43a21f296deadd81b1789c25fa4bb095e8e470"
97
 WIKI_HASH="a0e79986b87b2744421ce3c33b43a21f296deadd81b1789c25fa4bb095e8e470"
98
+
96
 # see https://www.dokuwiki.org/template:mnml-blog
99
 # see https://www.dokuwiki.org/template:mnml-blog
97
 WIKI_MNML_BLOG_ADDON_ARCHIVE="mnml-blog.tar.gz"
100
 WIKI_MNML_BLOG_ADDON_ARCHIVE="mnml-blog.tar.gz"
98
 WIKI_MNML_BLOG_ADDON="https://andreashaerter.com/downloads/dokuwiki-template-mnml-blog/latest"
101
 WIKI_MNML_BLOG_ADDON="https://andreashaerter.com/downloads/dokuwiki-template-mnml-blog/latest"
99
 WIKI_MNML_BLOG_ADDON_HASH="428c280d09ee14326fef5cd6f6772ecfcd532f7b6779cd992ff79a97381cf39f"
102
 WIKI_MNML_BLOG_ADDON_HASH="428c280d09ee14326fef5cd6f6772ecfcd532f7b6779cd992ff79a97381cf39f"
100
 
103
 
104
+# see https://www.dokuwiki.org/plugin:blogtng
105
+WIKI_BLOGTNG_ADDON_NAME="dokufreaks-plugin-blogtng-93a3fec"
106
+WIKI_BLOGTNG_ADDON_ARCHIVE="$WIKI_BLOGTNG_ADDON_NAME.zip"
107
+WIKI_BLOGTNG_ADDON="https://github.com/dokufreaks/plugin-blogtng/zipball/master"
108
+WIKI_BLOGTNMG_ADDON_HASH="212b3ad918fdc92b2d49ef5d36bc9e086eab27532931ba6b87e05f35fd402a27"
109
+
101
 GPG_KEYSERVER="hkp://keys.gnupg.net"
110
 GPG_KEYSERVER="hkp://keys.gnupg.net"
102
 
111
 
103
 # optionally you can provide your exported GPG key pair here
112
 # optionally you can provide your exported GPG key pair here
2025
   if grep -Fxq "install_blog" $COMPLETION_FILE; then
2034
   if grep -Fxq "install_blog" $COMPLETION_FILE; then
2026
       return
2035
       return
2027
   fi
2036
   fi
2037
+  if [ ! -f $WIKI_DOMAIN_NAME ]; then
2038
+      return
2039
+  fi
2028
 
2040
 
2041
+  # download mnml-blog
2029
   cd $INSTALL_DIR
2042
   cd $INSTALL_DIR
2030
   rm -f latest
2043
   rm -f latest
2031
   wget $WIKI_MNML_BLOG_ADDON
2044
   wget $WIKI_MNML_BLOG_ADDON
2032
   if [ ! -f "$INSTALL_DIR/latest" ]; then
2045
   if [ ! -f "$INSTALL_DIR/latest" ]; then
2033
-	  echo 'Dokuwiki mnml-blog addon could not be downloaded. Check the Dokuwiki web site and alter WIKI_MNML_BLOG_ADDON at the top of this script as needed.'
2034
-	  exit 21
2046
+      echo 'Dokuwiki mnml-blog addon could not be downloaded. Check the Dokuwiki web site and alter WIKI_MNML_BLOG_ADDON at the top of this script as needed.'
2047
+      exit 21
2035
   fi
2048
   fi
2036
   mv latest $WIKI_MNML_BLOG_ADDON_ARCHIVE
2049
   mv latest $WIKI_MNML_BLOG_ADDON_ARCHIVE
2037
 
2050
 
2038
-  # Check that the hash is correct
2051
+  # Check that the mnml-blog download hash is correct
2039
   CHECKSUM=$(sha256sum $WIKI_MNML_BLOG_ADDON_ARCHIVE | awk -F ' ' '{print $1}')
2052
   CHECKSUM=$(sha256sum $WIKI_MNML_BLOG_ADDON_ARCHIVE | awk -F ' ' '{print $1}')
2040
   if [[ $CHECKSUM != $WIKI_MNML_BLOG_ADDON_HASH ]]; then
2053
   if [[ $CHECKSUM != $WIKI_MNML_BLOG_ADDON_HASH ]]; then
2041
       echo 'The sha256 hash of the mnml-blog download is incorrect. Possibly the file may have been tampered with. Check the hash on the Dokuwiki mnmlblog web site and alter WIKI_MNML_BLOG_ADDON_HASH if needed.'
2054
       echo 'The sha256 hash of the mnml-blog download is incorrect. Possibly the file may have been tampered with. Check the hash on the Dokuwiki mnmlblog web site and alter WIKI_MNML_BLOG_ADDON_HASH if needed.'
2042
       exit 22
2055
       exit 22
2043
   fi
2056
   fi
2044
 
2057
 
2058
+  # download blogTNG
2059
+  wget $WIKI_BLOGTNG_ADDON
2060
+  if [ ! -f "$INSTALL_DIR/master" ]; then
2061
+      echo 'Dokuwiki blogTNG addon could not be downloaded. Check the Dokuwiki web site and alter WIKI_BLOGTNG_ADDON at the top of this script as needed.'
2062
+      exit 23
2063
+  fi
2064
+  mv master $WIKI_BLOGTNG_ADDON_ARCHIVE
2065
+
2066
+  # Check that the blogTNG hash is correct
2067
+  CHECKSUM=$(sha256sum $WIKI_BLOGTNG_ADDON_ARCHIVE | awk -F ' ' '{print $1}')
2068
+  if [[ $CHECKSUM != $WIKI_BLOGTNG_ADDON_HASH ]]; then
2069
+      echo 'The sha256 hash of the blogTNG download is incorrect. Possibly the file may have been tampered with. Check the hash on the Dokuwiki blogTNG web site and alter WIKI_BLOGTNG_ADDON_HASH if needed.'
2070
+      exit 24
2071
+  fi
2072
+
2073
+  # install blogTNG
2074
+  unzip $WIKI_BLOGTNG_ADDON_ARCHIVE
2075
+  mv $WIKI_BLOGTNG_ADDON_NAME blogtng
2076
+  cp blogtng /var/www/$WIKI_DOMAIN_NAME/htdocs/lib/plugins/
2077
+
2078
+  # install mnml-blog
2045
   tar -xzvf $WIKI_MNML_BLOG_ADDON_ARCHIVE
2079
   tar -xzvf $WIKI_MNML_BLOG_ADDON_ARCHIVE
2046
   cp mnml-blog /var/www/$WIKI_DOMAIN_NAME/htdocs/lib/tpl/
2080
   cp mnml-blog /var/www/$WIKI_DOMAIN_NAME/htdocs/lib/tpl/
2047
   cp -r /var/www/$WIKI_DOMAIN_NAME/htdocs/lib/tpl/mnml-blog/blogtng-tpl/* /var/www/$WIKI_DOMAIN_NAME/htdocs/lib/plugins/blogtng/tpl/default/
2081
   cp -r /var/www/$WIKI_DOMAIN_NAME/htdocs/lib/tpl/mnml-blog/blogtng-tpl/* /var/www/$WIKI_DOMAIN_NAME/htdocs/lib/plugins/blogtng/tpl/default/
2108
 install_irc_server
2142
 install_irc_server
2109
 configure_firewall_for_irc
2143
 configure_firewall_for_irc
2110
 install_wiki
2144
 install_wiki
2111
-#install_blog
2145
+install_blog
2112
 install_final
2146
 install_final
2113
 echo 'Freedombone installation is complete'
2147
 echo 'Freedombone installation is complete'
2114
 exit 0
2148
 exit 0