From 74c2ec7221056c8c4c6bb80c8805e5e1008bcc47 Mon Sep 17 00:00:00 2001 From: JLKwong Date: Fri, 30 Apr 2021 10:11:59 -0700 Subject: [PATCH 1/2] add mediawiki server --- services/install-mediawiki.sh | 137 ++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 services/install-mediawiki.sh diff --git a/services/install-mediawiki.sh b/services/install-mediawiki.sh new file mode 100644 index 0000000000..98b69dfe12 --- /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 +} From 47556d3f17056d7a6465f8e13fbb62b546226018 Mon Sep 17 00:00:00 2001 From: JLKwong Date: Fri, 30 Apr 2021 10:42:09 -0700 Subject: [PATCH 2/2] crop svg --- services/install-mediawiki.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/install-mediawiki.sh b/services/install-mediawiki.sh index 98b69dfe12..e82bffda44 100644 --- a/services/install-mediawiki.sh +++ b/services/install-mediawiki.sh @@ -90,7 +90,7 @@ function get_info { function get_icon { cat < - +