diff --git a/services/install-mediawiki.sh b/services/install-mediawiki.sh new file mode 100644 index 0000000000..e82bffda44 --- /dev/null +++ b/services/install-mediawiki.sh @@ -0,0 +1,137 @@ +#!/bin/bash + +function install { + # create service directory + mkdir -p /srv/mediawiki + + # create yml(s) + { + echo "version: '3'" + echo "services:" + echo " mediawiki:" + echo " image: mediawiki" + echo " restart: always" + echo " ports:" + echo " - '8080:80'" + echo " links:" + echo " - database" + echo " volumes:" + echo " - /var/www/html/images" + # After initial setup, download LocalSettings.php to the same directory as + # this yaml and uncomment the following line and use compose to restart + # the mediawiki service + #echo " - ./LocalSettings.php:/var/www/html/LocalSettings.php" + echo " database:" + echo " image: mariadb" + echo " restart: always" + echo " environment:" + # @see https://phabricator.wikimedia.org/source/mediawiki/browse/master/includes/DefaultSettings.php" + echo " MYSQL_DATABASE: my_wiki" + echo " MYSQL_USER: wikiuser" + echo " MYSQL_PASSWORD: example" + echo " MYSQL_RANDOM_ROOT_PASSWORD: 'yes'" +} > /srv/mediawiki/mediawiki.yml + + # create .env with default values + + # add autorun + cat << EOF > /srv/mediawiki/autorun +mediawiki_autorun=true + +if [ "$mediawiki_autorun" = true ]; then + treehouses services mediawiki up +fi + + +EOF +} + +# environment var + # NEEDS REVIEW FOR ACCURACY +function uses_env { + echo true +} + +# add supported arch(es) + # NEEDS TO BE CHANGED TO GITLAB +function supported_arches { + echo "armv7l" +} + +# add port(s) + # NEEDS REVIEW FOR ACCURACY +function get_ports { + echo "80" +} + +# add size (in MB) + # NEEDS REVIEW FOR ACCURACY +function get_size { + echo "1982" +} + +# add description +function get_description { + echo "MediaWiki is a free server-based software, licensed under the GNU General Public License (GPL). It's designed to run on a large server farm for a website that gets millions of hits per day." +} + +# add info + # NEEDS REVIEW FOR FORMATTING +function get_info { + echo "https://github.com/treehouses/mediawiki" + echo + echo "\"MediaWiki is a free server-based software," + echo "licensed under the GNU General Public License (GPL)." + echo "It's designed to run on a large server farm" + echo "for a website that gets millions of hits per day.\"" +} + +# add svg icon +function get_icon { + cat < + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +EOF +}