Sfoglia il codice sorgente

Fixing mediagoblin

Bob Mottram 8 anni fa
parent
commit
0d1b4eb2d5
1 ha cambiato i file con 16 aggiunte e 11 eliminazioni
  1. 16
    11
      src/freedombone-app-mediagoblin

+ 16
- 11
src/freedombone-app-mediagoblin Vedi File

@@ -39,7 +39,7 @@ MEDIAGOBLIN_CODE=
39 39
 MEDIAGOBLIN_ONION_PORT=8108
40 40
 MEDIAGOBLIN_REPO="http://git.savannah.gnu.org/r/mediagoblin.git"
41 41
 MEDIAGOBLIN_BASE_DIR=/var/www/mediagoblin.local/htdocs
42
-MEDIAGOBLIN_PORT=26543
42
+MEDIAGOBLIN_PORT=6543
43 43
 
44 44
 mediagoblin_variables=(ONION_ONLY
45 45
                        MY_USERNAME
@@ -75,16 +75,21 @@ function add_user_mediagoblin {
75 75
 function remove_user_mediagoblin {
76 76
     remove_username="$1"
77 77
     MEDIAGOBLIN_BASE_DIR=/var/www/$MEDIAGOBLIN_DOMAIN_NAME/htdocs
78
-    su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin/ && bin/gmg deluser --username $new_username" - mediagoblin
78
+    su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin/ && bin/gmg deleteuser --username $new_username" - mediagoblin
79 79
     echo "0"
80 80
 }
81 81
 
82 82
 function reconfigure_mediagoblin {
83
-    echo -n ''
83
+    MEDIAGOBLIN_BASE_DIR=/var/www/$MEDIAGOBLIN_DOMAIN_NAME/htdocs
84
+    rm -f /var/lib/mediagoblin/*.db
85
+    rm -rf $MEDIAGOBLIN_BASE_DIR/user_dev
86
+    su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin/ && ./bin/gmg dbupdate" - mediagoblin
84 87
 }
85 88
 
86 89
 function upgrade_mediagoblin {
87
-    echo -n ''
90
+    MEDIAGOBLIN_BASE_DIR=/var/www/$MEDIAGOBLIN_DOMAIN_NAME/htdocs
91
+    su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin/ && ./bin/python setup.py develop --upgrade && ./bin/gmg dbupdate" - mediagoblin
92
+    echo "0"
88 93
 }
89 94
 
90 95
 function backup_local_mediagoblin {
@@ -214,13 +219,13 @@ function install_mediagoblin {
214 219
     mkdir -p $MEDIAGOBLIN_BASE_DIR
215 220
     chown -hR mediagoblin:www-data $MEDIAGOBLIN_BASE_DIR
216 221
     su -c "cd $MEDIAGOBLIN_BASE_DIR && git clone $MEDIAGOBLIN_REPO $MEDIAGOBLIN_BASE_DIR/mediagoblin" - mediagoblin
217
-    su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin && mediagoblin git checkout stable" - mediagoblin
222
+    su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin && git checkout stable" - mediagoblin
218 223
     su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin && git submodule sync" - mediaGoblin
219 224
     su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin && git submodule update --force --init --recursive" - mediagoblin
220 225
     su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin && ./bootstrap.sh" -mediagoblin
221 226
     su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin && ./configure" - mediagoblin
222 227
     su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin && make" - mediagoblin
223
-    su -c "$MEDIAGOBLIN_BASE_DIR/mediagoblin && bin/easy_install flup==1.0.3.dev-20110405" - mediaGoblin
228
+    su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin && bin/easy_install flup==1.0.3.dev-20110405" - mediaGoblin
224 229
     su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin && ln -s /var/lib/mediagoblin user_dev" - mediagoblin
225 230
     su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin && bash -c 'cp -av mediagoblin.ini mediagoblin_local.ini && cp -av paste.ini paste_local.ini'" - mediagoblin
226 231
     su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin && perl -pi -e 's|.*sql_engine = .*|sql_engine = sqlite:////var/lib/mediagoblin/mediagoblin.db|' mediagoblin_local.ini" - mediagoblin
@@ -234,7 +239,7 @@ function install_mediagoblin {
234 239
             gstreamer1.0-libav \
235 240
             python-gst-1.0
236 241
     cd $MEDIAGOBLIN_BASE_DIR/mediagoblin
237
-    su -c "echo '[[mediagoblin.media_types.video]]' | tee -a mediagoblin_local.ini" - mediagoblin
242
+    su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin && echo '[[mediagoblin.media_types.video]]' | tee -a mediagoblin_local.ini" - mediagoblin
238 243
 
239 244
     # Audio plugin
240 245
     apt-get install -yq python-gst-1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-libav libsndfile1-dev libasound2-dev libgstreamer-plugins-base1.0-dev python-numpy python-scipy
@@ -372,14 +377,14 @@ function install_mediagoblin {
372 377
     echo 'WantedBy=multi-user.target' >> /etc/systemd/system/mediagoblin.service
373 378
     chmod +x /etc/systemd/system/mediagoblin.service
374 379
 
375
-    systemctl enable mediagoblin
376
-    systemctl daemon-reload
377
-    systemctl start mediagoblin
378
-
379 380
     su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin/ && bin/gmg dbupdate" - mediagoblin
380 381
     su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin/ && bin/gmg adduser --username $MY_USERNAME --password $MY_USERNAME $MEDIAGOBLIN_ADMIN_PASSWORD" - mediagoblin
381 382
     su -c "cd $MEDIAGOBLIN_BASE_DIR/mediagoblin/ && bin/gmg makeadmin $MY_USERNAME" - mediagoblin
382 383
 
384
+    systemctl enable mediagoblin
385
+    systemctl daemon-reload
386
+    systemctl start mediagoblin
387
+
383 388
     function_check create_site_certificate
384 389
     create_site_certificate $MEDIAGOBLIN_DOMAIN_NAME
385 390