[Scummvm-git-logs] scummvm-web master -> 5124840f01179618a856514f0f9cb54699344ef5
Mataniko
mataniko at gmail.com
Tue Nov 27 17:54:00 CET 2018
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm-web' repo located at https://github.com/scummvm/scummvm-web .
Summary:
5124840f01 BUILD: Remove site-update and .htaccess files
Commit: 5124840f01179618a856514f0f9cb54699344ef5
https://github.com/scummvm/scummvm-web/commit/5124840f01179618a856514f0f9cb54699344ef5
Author: Matan Bareket (mataniko at gmail.com)
Date: 2018-11-27T11:53:43-05:00
Commit Message:
BUILD: Remove site-update and .htaccess files
Changed paths:
R .htaccess
R site-update/.htaccess
R site-update/index.php
R site-update/install.sh
R site-update/webhook.php
diff --git a/.htaccess b/.htaccess
deleted file mode 100644
index 4def23b..0000000
--- a/.htaccess
+++ /dev/null
@@ -1,153 +0,0 @@
-# Enable mod_rewrite
-RewriteEngine On
-
-# Always redirect to HTTPS except when browsing in localhost
-RewriteCond %{HTTPS} off
-RewriteCond %{HTTP_HOST} !=localhost
-RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
-
-# Set the base for the rewritten URLs
-# NOTE: When debugging locally, set this to the directory the site is in
-RewriteBase /
-
-# Fetch language and put it into Cookie
-RewriteCond %{QUERY_STRING} lang=(.*)?
-RewriteRule .* - [CO=lang:%1:.scummvm.org:86400]
-
-RewriteRule ^old/.* - [L]
-
-# Cloud service provider redirects
-# Dropbox
-RewriteRule ^c/db$ https://www.dropbox.com/1/oauth2/authorize?response_type=code&redirect_uri=https://www.scummvm.org/c/code&client_id=dlm3nadaa4t3nsk [NE]
-RewriteRule ^c/dbs$ https://www.dropbox.com/1/oauth2/authorize?response_type=code&redirect_uri=http://localhost:12345/&client_id=dlm3nadaa4t3nsk [NE]
-
-# OneDrive
-RewriteRule ^c/od$ https://login.live.com/oauth20_authorize.srf?response_type=code&redirect_uri=https://www.scummvm.org/c/code&client_id=c9582384-aa02-4054-bc40-56692270cb02&scope=onedrive.appfolder+offline_access
-RewriteRule ^c/ods$ https://login.live.com/oauth20_authorize.srf?response_type=code&redirect_uri=http://localhost:12345/&client_id=c9582384-aa02-4054-bc40-56692270cb02&scope=onedrive.appfolder+offline_access
-
-# Google Drive
-RewriteRule ^c/gd$ https://accounts.google.com/o/oauth2/auth?response_type=code&redirect_uri=https://www.scummvm.org/c/code&client_id=372269489234-cc487pr03275ua50b6sr7tulq3d6dfbi.apps.googleusercontent.com&scope=https://www.googleapis.com/auth/drive
-RewriteRule ^c/gds$ https://accounts.google.com/o/oauth2/auth?response_type=code&redirect_uri=http://localhost:12345&client_id=372269489234-cc487pr03275ua50b6sr7tulq3d6dfbi.apps.googleusercontent.com&scope=https://www.googleapis.com/auth/drive
-
-# Box
-RewriteRule ^c/bx$ https://account.box.com/api/oauth2/authorize?response_type=code&client_id=93trp4qdtmrbb5mccdofdnplhizcv2mi&redirect_uri=https://www.scummvm.org/c/code
-RewriteRule ^c/bxs$ https://account.box.com/api/oauth2/authorize?response_type=code&client_id=93trp4qdtmrbb5mccdofdnplhizcv2mi&redirect_uri=http://localhost:12345
-
-RewriteRule ^c/.* c/index.php [L]
-
-##
-# We moved screenshots, fixing the links
-##
-RewriteRule ^screenshots/(scummvm_[0-9]+.png)$ data/screenshots/old/$1 [L]
-RewriteRule ^screenshots/(big_scummvm_[0-9]+.png)$ data/screenshots/old/$1 [L]
-RewriteRule ^screenshots/(scummvm_[0-9]+.jpg)$ data/screenshots/old/$1 [L]
-RewriteRule ^(?:data/)?screenshots/other/(sword/.*)$ data/screenshots/revolution/$1 [L]
-RewriteRule ^(?:data/)?screenshots/other/(sky/.*)$ data/screenshots/revolution/$1 [L]
-RewriteRule ^(?:data/)?screenshots/other/(lure/.*)$ data/screenshots/revolution/$1 [L]
-RewriteRule ^(?:data/)?screenshots/other/(simon/.*)$ data/screenshots/agos/$1 [L]
-RewriteRule ^(?:data/)?screenshots/other/(feeble/.*)$ data/screenshots/agos/$1 [L]
-RewriteRule ^(?:data/)?screenshots/other/(kyra/.*)$ data/screenshots/westwood/$1 [L]
-RewriteRule ^(?:data/)?screenshots/other/(gob/.*)$ data/screenshots/gob/$1 [L]
-RewriteRule ^(?:data/)?screenshots/other/(bargon/.*)$ data/screenshots/gob/$1 [L]
-RewriteRule ^screenshots/(scummvm_0_0_5.jpg)$ data/screenshots/lec/maniac/$1 [L]
-RewriteRule ^screenshots/big(scummvm_0_0_0).png$ data/screenshots/lec/maniac/$1-full.png [L]
-RewriteRule ^screenshots/(scummvm_0_2_2.jpg)$ data/screenshots/lec/indy3/$1 [L]
-RewriteRule ^screenshots/(scummvm_0_3_[01].jpg)$ data/screenshots/lec/atlantis/$1 [L]
-RewriteRule ^screenshots/big(scummvm_0_3_[01]).png$ data/screenshots/lec/atlantis/$1-full.png [L]
-RewriteRule ^screenshots/(scummvm_0_4_[7-9].jpg)$ data/screenshots/lec/monkey/$1 [L]
-RewriteRule ^screenshots/big(scummvm_0_4_[56]).png$ data/screenshots/lec/monkey/$1-full.png [L]
-RewriteRule ^screenshots/(scummvm_0_5_[0-2].jpg)$ data/screenshots/lec/monkey2/$1 [L]
-RewriteRule ^screenshots/(scummvm_0_6_[0-4].jpg)$ data/screenshots/lec/loom/$1 [L]
-RewriteRule ^screenshots/big(scummvm_0_6_[0-4]).png$ data/screenshots/lec/loom/$1-full.png [L]
-RewriteRule ^screenshots/(scummvm_0_7_[01].jpg)$ data/screenshots/lec/samnmax/$1 [L]
-RewriteRule ^screenshots/big(scummvm_0_7_0).png$ data/screenshots/lec/samnmax/$1-full.png [L]
-RewriteRule ^screenshots/(scummvm_0_8_[01].jpg)$ data/screenshots/lec/tentacle/$1 [L]
-RewriteRule ^screenshots/big(scummvm_0_8_[01]).png$ data/screenshots/lec/tentacle/$1-full.png [L]
-RewriteRule ^screenshots/(scummvm_0_9_[0-2].jpg)$ data/screenshots/lec/ft/$1 [L]
-RewriteRule ^screenshots/big(scummvm_0_9_[0-2]).png$ data/screenshots/lec/ft/$1-full.png [L]
-RewriteRule ^screenshots/(scummvm_0_10_0.jpg)$ data/screenshots/lec/dig/$1 [L]
-RewriteRule ^screenshots/(scummvm_0_11_[0-2].jpg)$ data/screenshots/lec/comi/$1 [L]
-RewriteRule ^screenshots/big(scummvm_0_11_[0-2]).png$ data/screenshots/lec/comi/$1-full.png [L]
-RewriteRule ^screenshots/(scummvm_2_0_[03].jpg)$ data/screenshots/revolution/sword/$1 [L]
-RewriteRule ^screenshots/(scummvm_2_3_[01].jpg)$ data/screenshots/other/queen/$1 [L]
-RewriteRule ^screenshots/(scummvm_2_5_[01].jpg)$ data/screenshots/revolution/sky/$1 [L]
-RewriteRule ^screenshots/(scummvm_2_6_1.jpg)$ data/screenshots/westwood/kyra/kyra1-2.jpg [L]
-
-##
-# Images linked directly from the wiki need to work
-##
-RewriteRule ^screenshots/(.+)\.(jpg|png)$ data/screenshots/$1.$2 [NS,L]
-
-##
-# Standard location for appcast
-##
-RewriteRule ^scummvm_appcast.xml appcasts/macosx/release.xml [L]
-
-##
-# Catch script kiddies
-##
-RewriteRule wp-(admin|login) / [R=301]
-
-##
-# Forward old page requests to the new fancy URLs
-##
-# Compatibility page, with args
-RewriteCond %{QUERY_STRING} version=(DEV|[0-9\.rc]+)(&details=(.+))?
-RewriteRule ^compatibility\.php$ compatibility/%1/%3/? [NS,R=301]
-# Documentation page, with args
-RewriteCond %{QUERY_STRING} view=md5
-RewriteRule ^documentation\.php$ documentation/md5sums/? [NS,R=301]
-# News page, with args
-RewriteCond %{QUERY_STRING} shownews=([0-9]{8}).xml [OR]
-RewriteCond %{QUERY_STRING} shownews=(archive)
-RewriteRule ^(index\.php)?$ news/%1/? [NS,R=301]
-# Feeds (not pretty)
-RewriteRule ^feed-(atom|rss)(20)?.php$ feeds/$1/? [NS,R=301]
-# Other pages, without args
-RewriteRule ^(.+)\.php$ $1/? [NS,R=301]
-
-
-##
-# Basic rewrite
-##
-RewriteRule ^([a-z]+)/?$ ?p=$1 [QSA]
-
-##
-# Compatibility
-##
-RewriteRule ^(compatibility)(/(DEV|[0-9\.rc]+)(/([^/]+))?)?/?$ ?p=$1&v=$3&t=$5 [L,QSA]
-
-##
-# Documentation
-##
-RewriteRule ^(documentation)(/([^/]+))?/? ?p=$1&d=$3 [L,QSA]
-
-##
-# Feeds
-##
-RewriteRule ^(feeds)/(atom|rss)/? ?p=$1&f=$2 [L,QSA]
-
-##
-# News
-##
-RewriteRule ^(news)(/([0-9]{8,12}[a-z]?|archive))?/?$ ?p=$1&d=$3 [L,QSA]
-
-##
-# Screenshots
-##
-RewriteRule ^(screenshots)(/([a-z]+)(/([-_a-z0-9]+)(/([0-9]+))?)?)?/? ?p=$1&cat=$3&game=$5&num=$7 [L,QSA]
-
-##
-# Composer
-##
-RewriteRule ^(vendor/|composer\.json|composer\.lock) - [F,L,NC]
-
-##
-# node
-##
-RewriteRule ^(node_modules/|package\.json|package-lock\.json) - [F,L,NC]
-
-##
-# dev files
-##
-RewriteRule ^(dev-router\.php|dev-os\.php) - [F,L,NC]
diff --git a/site-update/.htaccess b/site-update/.htaccess
deleted file mode 100644
index fa8965a..0000000
--- a/site-update/.htaccess
+++ /dev/null
@@ -1,8 +0,0 @@
-RewriteEngine On
-RewriteRule ^([^/.]+)/?$ $1.php [L]
-
-AuthType basic
-AuthName "cgi-bin restricted"
-AuthUserFile /etc/awstats/awstats.htpasswd
-Require expr %{REQUEST_URI} =~ m#^/site-update/webhook/?#
-Require valid-user
diff --git a/site-update/index.php b/site-update/index.php
deleted file mode 100644
index 7abe8f5..0000000
--- a/site-update/index.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<html>
- <head>
- <style>
- body {
- background: black;
- }
- pre {
- font-family: monospace, monospace;
- font-size: 1em;
- color: #00FF33;
- }
- </style>
- </head>
- <body>
- <pre>
- <?php
- while (@ ob_end_flush()); // end all output buffers if any
-
- $proc = popen('sh install.sh', 'r');
-
- while (!feof($proc))
- {
- echo fread($proc, 4096);
- @ flush();
- }
- ?>
- </pre>
- </body>
-</html>
diff --git a/site-update/install.sh b/site-update/install.sh
deleted file mode 100755
index f3d9a05..0000000
--- a/site-update/install.sh
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/bin/bash
-export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
-
-eval $(ssh-agent -s)
-ssh-add ~/.ssh/id_rsa_website_deploy
-
-# echo empty line because the buffer starts with a tab for some reason
-echo ''
-echo "Current time: $(date)"
-echo 'Updating website - please wait until the page finishes loading'
-
-# Go to the root folder
-cd ..
-
-# Pull the updated website from github
-echo '$ git pull --rebase'
-git pull --rebase
-echo '$ git status'
-git status
-
-# Generate image sprite
-echo 'Checking for glue'
-if ! [ -x "$(command -v glue)" ]; then
- echo 'Installing glue'
- pip install glue
-fi
-echo 'Glue found. Generating games and platforms sprites'
-glue images/icons/games/ --img=images/ --scss=scss/sprites/ --retina
-glue images/icons/platforms/ --img=images/ --scss=scss/sprites/ --retina
-mv scss/sprites/games.scss scss/sprites/_games.scss
-mv scss/sprites/platforms.scss scss/sprites/_platforms.scss
-
-# Create a css folder if it doesn't exist
-echo "Checking CSS folder"
-if [ ! -d "css" ]; then
- echo "$ mkdir css"
- mkdir css
-fi
-
-# Run composer install
-export COMPOSER_HOME=/var/www/composer
-echo "Composer home:" $COMPOSER_HOME
-echo '$ composer install'
-composer install 2>&1
-
-# Update i18n
-echo 'Update base news translation file'
-git add data/news/i18n/news.en.json
-git commit -m "I18N: Update base news translation file"
-git push
-
-# Run npm install
-echo "$ npm install"
-npm install 2>&1
-
-# Set up smarty 3
-echo "Checking smarty template folder"
-if [ -d "vendor/smarty/smarty/libs" ] && [ ! -d "vendor/smarty/smarty/libs/template_c" ]; then
- echo "$ mkdir vendor/smarty/smarty/libs/template_c"
- mkdir vendor/smarty/smarty/libs/template_c
- echo "$ chmod +w vendor/smarty/smarty/libs/template_c"
- chmod +w vendor/smarty/smarty/libs/template_c
-fi
diff --git a/site-update/webhook.php b/site-update/webhook.php
deleted file mode 100644
index b713aef..0000000
--- a/site-update/webhook.php
+++ /dev/null
@@ -1,69 +0,0 @@
-
-<?php
-/**
- * GitHub webhook handler template.
- *
- * @see https://developer.github.com/webhooks/
- * @author Miloslav Hůla (https://github.com/milo)
- */
-$hookSecret = getenv('webhook_secret'); # set NULL to disable check
-set_error_handler(function ($severity, $message, $file, $line) {
- throw new \ErrorException($message, 0, $severity, $file, $line);
-});
-set_exception_handler(function ($e) {
- header('HTTP/1.1 500 Internal Server Error');
- echo "Error on line {$e->getLine()}: " . htmlSpecialChars($e->getMessage());
- die();
-});
-$rawPost = null;
-if ($hookSecret !== null) {
- if (!isset($_SERVER['HTTP_X_HUB_SIGNATURE'])) {
- throw new \Exception("HTTP header 'X-Hub-Signature' is missing.");
- } elseif (!extension_loaded('hash')) {
- throw new \Exception("Missing 'hash' extension to check the secret code validity.");
- }
- list($algo, $hash) = explode('=', $_SERVER['HTTP_X_HUB_SIGNATURE'], 2) + array('', '');
- if (!in_array($algo, hash_algos(), true)) {
- throw new \Exception("Hash algorithm '$algo' is not supported.");
- }
- $rawPost = file_get_contents('php://input');
- if (!hash_equals($hash, hash_hmac($algo, $rawPost, $hookSecret))) {
- throw new \Exception('Hook secret does not match.');
- }
-
-}
-;
-if (!isset($_SERVER['CONTENT_TYPE'])) {
- throw new \Exception("Missing HTTP 'Content-Type' header.");
-} elseif (!isset($_SERVER['HTTP_X_GITHUB_EVENT'])) {
- throw new \Exception("Missing HTTP 'X-Github-Event' header.");
-}
-switch ($_SERVER['CONTENT_TYPE']) {
- case 'application/json':
- $json = $rawPost ?: file_get_contents('php://input');
- break;
- case 'application/x-www-form-urlencoded':
- $json = $_POST['payload'];
- break;
- default:
- throw new \Exception("Unsupported content type: $_SERVER[CONTENT_TYPE]");
-}
-# Payload structure depends on triggered event
-# https://developer.github.com/v3/activity/events/types/
-$payload = json_decode($json);
-switch (strtolower($_SERVER['HTTP_X_GITHUB_EVENT'])) {
- case 'ping':
- echo 'pong';
- break;
- case 'push':
- echo 'Site update is running, details area available in webhook.log';
- sleep(2);
- exec('sh install.sh > webhook.log &');
- break;
- default:
- header('HTTP/1.0 404 Not Found');
- echo "Event:$_SERVER[HTTP_X_GITHUB_EVENT] Payload:\n";
- print_r($payload); # For debug only. Can be found in GitHub hook log.
- die();
-}
-?>
More information about the Scummvm-git-logs
mailing list