glamp*)
echo "FAIBASE MYSQLD PHP5 SYSADMIN WWW"
;;
+ gmg*libreplanet.org)
+ echo "FAIBASE VM PSQL GMG SYSADMIN LIBREPLANET"
+ ;;
gmg*)
echo "FAIBASE VM PSQL GMG SYSADMIN"
;;
GMG_PATH=/srv/gmg
+GMG_SENDER=noreply@libreplanet.org
+GMG_LOGPATH=/var/log/mediagoblin
--- /dev/null
+DOMAIN=libreplanet.org
#/bin/bash
-
+echo Installing GMG into GMG_PATH_TOKEN...
+(
cd GMG_PATH_TOKEN
if [ ! -d mediagoblin ]; then
# Crea te GMG database
sudo -u postgres createdb -E UNICODE -O mediagoblin mediagoblin
- git clone git://git.savannah.gnu.org/mediagoblin.git -b stable
+ sudo -u mediagoblin git clone git://git.savannah.gnu.org/mediagoblin.git -b stable
cd mediagoblin
- git submodule init && git submodule update
+ sudo -u mediagoblin git submodule init && git submodule update
+
+ sudo -u mediagoblin ./bootstrap.sh && sudo -u mediagoblin ./configure && sudo -u mediagoblin make
+ sudo -u mediagoblin mkdir user_dev && sudo -u mediagoblin chmod 750 user_dev
+ sudo -u mediagoblin ./bin/easy_install flup
+
+ sudo -u mediagoblin cp /etc/mediagoblin-templates/mediagoblin.ini mediagoblin_local.ini
- ./bootstrap.sh && ./configure && make
- mkdir user_dev && chmod 750 user_dev
- ./bin/easy_install flup
+ sudo -u mediagoblin ./bin/gmg dbupdate
- update-rc.d mediagoblin defaults
+ update-rc.d mediagoblin-paster defaults
+ update-rc.d mediagoblin-celery-worker defaults
+ /etc/init.d/mediagoblin-paster start
+ /etc/init.d/mediagoblin-celery-worker start
fi
+) >> /var/log/fai/install-mediagoblin.log
+echo Install Completed, started mediagoblin-paster and mediagoblin-celery-worker
\ No newline at end of file
--- /dev/null
+# If you want to make changes to this file, first copy it to
+# mediagoblin_local.ini, then make the changes there.
+#
+# If you don't see what you need here, have a look at mediagoblin/config_spec.ini
+# It defines types and defaults so it's a good place to look for documentation
+# or to find hidden options that we didn't tell you about. :)
+
+# To change the directory you should make sure you change the
+# directory in paste.ini and/or your webserver configuration.
+#
+# [DEFAULT]
+data_basedir = "GMG_PATH_TOKEN"
+
+[mediagoblin]
+direct_remote_path = /mgoblin_static/
+email_sender_address = "GMG_SENDER_TOKEN"
+
+## Uncomment and change to your DB's appropiate setting.
+## Default is a local sqlite db "mediagoblin.db".
+## Don't forget to run `./bin/gmg dbupdate` after having changed it.
+sql_engine = postgresql:///mediagoblin
+
+# Set to false to enable sending notices
+email_debug_mode = false
+
+# Set to false to disable registrations
+allow_registration = false
+
+# Set to false to disable the ability for users to report offensive content
+allow_reporting = false
+
+## Uncomment this to put some user-overriding templates here
+local_templates = %(data_basedir)s/templates/
+
+## You can set your theme by specifying this (not specifying it will
+## use the default theme). Run `gmg assetlink` to apply the change.
+## The airy and sandyseventiesspeedboat theme comes with GMG; please
+## see the theming docs on how to install other themes.
+# theme = airy
+
+## If you want the terms of service displayed, you can uncomment this
+# show_tos = true
+
+user_privilege_scheme = "uploader,commenter,reporter"
+[storage:queuestore]
+base_dir = %(data_basedir)s/media/queue
+
+[storage:publicstore]
+base_dir = %(data_basedir)s/media/public
+base_url = /mgoblin_media/
+
+[celery]
+# Put celery stuff here
+
+# Place plugins here, each in their own subsection of [plugins].
+# See http://docs.mediagoblin.org/siteadmin/plugins.html for details.
+[plugins]
+[[mediagoblin.plugins.geolocation]]
+[[mediagoblin.plugins.basic_auth]]
+[[mediagoblin.media_types.image]]
+[[mediagoblin.media_types.video]]
+auto_play = False
+[[[skip_transcode]]]
+audio_codecs = Vorbis,
+container_formats = Matroska, Ogg
+mime_types = video/webm, application/ogg
+dimensions_match = False
+video_codecs = VP8 video, Theora
+[[mediagoblin.media_types.pdf]]
+[[mediagoblin_libreplanet]]
+[[mediagoblin_piwik]]
+PIWIK_DOMAIN = '*.media.libreplanet.org'
+PIWIK_LOCATION = 'piwik.fsf.org'
+PIWIK_SITEID = 11
--- /dev/null
+server {
+ #################################################
+ # Stock useful config options, but ignore them :)
+ #################################################
+ include /etc/nginx/mime.types;
+
+ autoindex off;
+ default_type application/octet-stream;
+ sendfile on;
+
+ # Gzip
+ gzip on;
+ gzip_min_length 1024;
+ gzip_buffers 4 32k;
+ gzip_types text/plain application/x-javascript text/javascript text/xml text/css;
+
+ #####################################
+ # Mounting MediaGoblin stuff
+ # This is the section you should read
+ #####################################
+
+ # Change this to update the upload size limit for your users
+ client_max_body_size 4g;
+
+ # prevent attacks (someone uploading a .txt file that the browser
+ # interprets as an HTML file, etc.)
+ add_header X-Content-Type-Options nosniff;
+
+ # MediaGoblin's stock static files: CSS, JS, etc.
+ location /mgoblin_static/ {
+ alias /srv/mediagoblin.example.org/mediagoblin/mediagoblin/static/;
+ }
+
+ # Instance specific media:
+ location /mgoblin_media/ {
+ alias /srv/mediagoblin.example.org/mediagoblin/user_dev/media/public/;
+ }
+
+ # Theme static files (usually symlinked in)
+ location /theme_static/ {
+ alias /srv/mediagoblin.example.org/mediagoblin/user_dev/theme_static/;
+ }
+
+ # Plugin static files (usually symlinked in)
+ location /plugin_static/ {
+ alias /srv/mediagoblin.example.org/mediagoblin/user_dev/plugin_static/;
+ }
+
+ # Mounting MediaGoblin itself via FastCGI.
+ location / {
+ fastcgi_pass 127.0.0.1:26543;
+ include /etc/nginx/fastcgi_params;
+
+ # our understanding vs nginx's handling of script_name vs
+ # path_info don't match :)
+ fastcgi_param PATH_INFO $fastcgi_script_name;
+ fastcgi_param SCRIPT_NAME "";
+ }
+}
\ No newline at end of file
--- /dev/null
+server {
+ listen 80;
+ server_name media.libreplanet.org;
+
+ include /etc/nginx/mediagoblin-common.conf;
+
+ ## redirect http to https ##
+ rewrite ^ https://$server_name$request_uri? permanent;
+
+ access_log /var/log/nginx/media.libreplanet.org-access.log;
+ error_log /var/log/nginx/media.libreplanet.org-error.log;
+}
+
+server {
+ listen 443;
+
+ include /etc/nginx/mediagoblin-common.conf;
+
+ access_log /var/log/nginx/media.libreplanet.org-ssl.access.log;
+ error_log /var/log/nginx/media.libreplanet.org-ssl.error.log;
+
+ ssl on;
+
+ ## Use a SSL/TLS cache for SSL session resume.
+ ssl_session_cache shared:SSL:10m;
+ ssl_session_timeout 10m;
+
+ ssl_certificate /etc/ssl/certs/wildcard.libreplanet.org-full-chain.crt;
+ ssl_certificate_key /etc/ssl/private/wildcard.libreplanet.org.key;
+
+ ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
+ ssl_prefer_server_ciphers on;
+ ssl_ciphers "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
+
+}
\ No newline at end of file
if [ ! -d $GMG_PATH ]; then
$ROOTCMD mkdir -p $GMG_PATH && $ROOTCMD chown -hR mediagoblin:www-data $GMG_PATH
fi
+if [ ! -d $GMG_LOGPATH ]; then
+ $ROOTCMD mkdir -p $GMG_LOGPATH && $ROOTCMD chown -hR mediagoblin:mediagoblin $GMG_LOGPATH
+fi
#!/bin/bash
+# Copy configs
fcopy -Bv /etc/init.d/install-mediagoblin
fcopy -Bv /etc/init.d/mediagoblin-paster
fcopy -Bv /etc/init.d/mediagoblin-celery-worker
+fcopy -Bv /etc/mediagoblin-templates/mediagolbin.ini
+fcopy -Bv /etc/nginx/sites-available/mediagoblin
+fcopy -Bv /etc/nginx/mediagoblin-common.conf
+# Add installer to boot
$ROOTCMD update-rc.d install-mediagoblin defaults
+fqdn=$HOSTNAME.$DOMAIN
+
+# Replace Tokens
sed 's^GMG_PATH_TOKEN^'$GMG_PATH'^g' -i $target/etc/init.d/install-mediagoblin
sed 's^GMG_PATH_TOKEN^'$GMG_PATH'^g' -i $target/etc/init.d/mediagoblin-celery-worker
sed 's^GMG_PATH_TOKEN^'$GMG_PATH'^g' -i $target/etc/init.d/mediagoblin-paster
+
+sed 's^GMG_PATH_TOKEN^'$GMG_PATH'^g' -i $target/etc/mediagoblin-templates/mediagolbin.ini
+sed 's^GMG_PATH_TOKEN^'$GMG_PATH'^g' -i $target/etc/ngnix/mediagoblin-common.conf
+sed 's^GMG_SENDER_TOKEN^'$GMG_SENDER'^g' -i $target/etc/mediagoblin-templates/mediagolbin.ini