Commit 0c2b24e6 authored by Steve Johnson's avatar Steve Johnson

initial commit

parents
package com.cablelabs.android.dial;
public class MSEConfig {
public static final String MSE_REMOTE_URL = "https://yourdomain.com/xxxx/mse/html/remote/remote.html";
public static final String MSE_CHROMECAST_APPID = "YOUR_CHROMECAST_APP_ID"; // (Register your app at cast.google.com)
};
#My Stuff Everywhere™ - mse-site repository
Contains templates for specific configuration files for applications that are referenced by but not included by the other repositories. These files contain application id/secret information and server urls.
Developers should create a private repository for these files after they have been modified with their site information.
The private repository should then be references by mse/tools/upload_all and mse/tools/install_site.
## Template Files
- application/*.json - application configuration files. (App Key/Secret)
- config.json - site configuration file (websocket bridge uris and optional backend uris (see js/url.js))
- mseConfig.h - site urls/misc for iOS/OS X client applications
- MSEConfig.java - site urls/misc for Android/Java client applications
- qrcConfig.h - site urls/misc for iOS QRCode Reader client application (qrc demo)
- upload - bash script for distributing the files contained in this repository
- upload_config - bash script sourced by other repository upload scripts containing the remote server configuration
- users.json - flat file containing MSE user information
- ws2bridge*.config - WebSockets bridge configuration files
{
"friendlyName" : "My DropBox",
"uuid" : "eeeeeeee-cccc-bbbb-ffff-aaaaaaaaaaaa",
"type" : "mse",
"clientId" : "your_dropbox_app_key",
"clientSecret" : "your_dropbox_app_secret",
"shared" : {
"url" : "mse/demo/dbxmedia/dbxms.html"
},
"remote" : {
"url" : "mse/demo/dbxmedia/dbxmr.html"
},
"authType" : "oauth",
"serviceProvider" : "dropbox",
"description" : "",
"enableInst" : "To enable access to your DropBox Account, click the button below. You will be asked to sign in to Dropbox account to allow this application to display your photos on the second screen.",
"disableInst" : "To disable access to your DropBox Account, click the button below"
}
\ No newline at end of file
{
"friendlyName" : "My Trusty Bank",
"uuid" : "eeeeeeee-cccc-bbbb-ffff-aaaaaaaaaaaa",
"type" : "login",
"clientId" : "trusty_id0123456789",
"clientSecret" : "trusty_secret0123456789",
"type" : "login",
"remoteLoginUrl" : "mse/qrc/php/remote_authenticate",
"authorizeUrl" : "mse/qrc/php/oauth2/authorize",
"tokenUrl" : "mse/qrc/php/oauth2/token",
"authType" : "oauth",
"serviceProvider" : "generic",
"description" : "",
"enableInst" : "To enable logins to your Trusty Bank Account by scanning a QR Code with your mobile device, click the button below. You will be asked to sign in to your Trusty Bank account to enable this feature."
}
\ No newline at end of file
{
"wsBridgeURL" : "wss://yourdomain.com:1339",
"wssBridgeURL" : "wss://yourdomain.com:1339"
}
// Baked in url to landing page for iOS/OS X applications
// Used by OS X and iOS mseclient applications
#define MSE_REMOTE_URL "https://yourdomain.com/xxxx/mse/remote/remote.html"
// Used by OS X mseproxy application
#define MSE_PROXY_URL "https://yourdomain.com/xxxx/mse/php/dial/discovery.php"
// Used by the iOS mseclient application (Register your app at cast.google.com)
#define MSE_CHROMECAST_APPID "YOUR_CHROMECAST_APP_ID"
\ No newline at end of file
// Baked in redirect url to landing page for iOS/OS X applications
// Used by OS X and iOS mseclient applications
#define QRC_LOGIN_URL "https://yourdomain.com/xxxx/mse/qrc/remote/login.html"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>MSE Remote Redirect</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="cache-control" content="no-cache">
<script>
/*
This page is the old landing page for MSE, and is baked into the mobile applications. We need to
redirect to the new page, but now we have an opportunity to have alternate redirect locations.
This is useful for separating development/production sites. The redirect cookie is set by clicking
the "i" button in the header on the login page.
*/
// Helper function for reading named cookies.
(function(){
var cookies;
function readCookie(name,c,C,i){
if(cookies){ return cookies[name]; }
c = document.cookie.split('; ');
cookies = {};
for(i=c.length-1; i>=0; i--){
C = c[i].split('=');
cookies[C[0]] = C[1];
}
return cookies[name];
}
window.readCookie = readCookie;
})();
var relativeUri = "mse/remote/remote.html";
var defaultBase = "/prod/";
var newBase = readCookie("MSE_BaseRedirect");
var uri = (newBase ? newBase : defaultBase) + relativeUri;
location.replace(uri+window.location.search);
</script>
</head>
<body></body>
</html>
#! /bin/sh
# Note: This upload is different than the other repos as we need to piece meal copy
# site specific files into their correct location on the server and/or into sibling repositories
# Some will go into dev/prod, but others (redirect files, etc) will need to go to.
# You should upload the mse-php, mse-usps, and sdom-html repos initially before running this script.
# Copy upload configuration file - used for all repositories including this one.
cp -f upload_config ../mse/tools
# Set default base for most things except redirects
. ../mse/tools/upload_config $1 mse
# Above repo would challenge if prod, else we have bailed.
export CONFIRMED="Y"
# These are all of the redirects to the new default location (docroot/atg/mse*)
rsync --recursive mse_redirects/* $REPO_USERHOST$REPO_SEP$REPO_BASE/mse
dest=$REPO_USERHOST$REPO_SEP$REPO_DEST
echo " "
echo " * Uploading site specific files to: $REPO_HOST"
echo " "
rsync --recursive applications $dest/php/auth
check_rcode $?
rsync users.json $dest/php/auth
check_rcode $?
rsync config.json $dest/php/auth
check_rcode $?
# Copy source files to sibling repos.
cp -f mseConfig.h ../mse-ios
cp -f MSEConfig.java ../mse-android/app/src/main/java/com/cablelabs/android/dial
cp -f qrcConfig.h ../mse-qrc/QRCodeReader/QRCodeReader
# SDOM standalone applications
. ../mse/tools/upload_config $1 sdom
dest=$REPO_USERHOST$REPO_SEP$REPO_DEST
rsync config.json $dest
check_rcode $?
unset $CONFIRMED
\ No newline at end of file
#! /bin/bash
# This file is sourced from the upload scripts in the repos that need to be located relative to each other.
# (and underneath the folder containing this file)
# Examples of these include sdom-html, mse-html, mse-php
# For this to work properly, each of the participating repos need to be cloned as siblings (under a common folder)
# Edit this file to work with your server configuration. You may have to install ssl certs for rsync to work.
# Ensure we don't get leftovers if we fail.
unset REPO_HOST
unset REPO_USERHOST
unset REPO_DEST
unset REPO_USER
unset REPO_BASE
# -- Configure these variables for your server
REPO_HOST="yourdomain.com"
REPO_USER="sddev"
REPO_BASE="/var/www/"
# This is for Macs, adjust as required for other platforms
LOCAL_BASE="/Library/WebServer/Documents/"
# -- Default separator for remote hosts
export REPO_SEP=":"
# You can define as many sibling upload destinations as you like.
REPO_PROD="atg"
REPO_DEV="atgdev"
# -- End configure
if [ "$1" = "prod" ]; then
if [ -z $CONFIRMED ]; then
read -p " - Are you sure you want to upload to the production site ($REPO_PROD)? " -n 1 -r
else
REPLY="Y"
fi
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]; then
REPO=$REPO_PROD
else
echo " - Upload canceled"
exit 1
fi
elif [ "$1" = "dev" ]; then
REPO=$REPO_DEV
elif [ "$1" = "local" ]; then
REPO_HOST="localhost"
REPO_BASE=$LOCAL_BASE
REPO=$REPO_PROD
elif [ "$1" = "localdev" ]; then
REPO_HOST="localhost"
REPO_BASE=$LOCAL_BASE
REPO=$REPO_DEV
else
echo " - Upload destination invalid or not specified (use prod or dev - or modify upload_config script)"
exit 1
fi
if [ -z $2 ]; then
echo "Subdirectory not specified."
exit 2
fi
if [[ "$1" == *local* ]]; then
# special case. Use the production folder name under your localhost base directory
REPO_SEP=""
REPO_USERHOST=""
else
# normal case (remote server)
REPO_USERHOST="$REPO_USER@$REPO_HOST"
fi
export REPO_DEST="$REPO_BASE$REPO/$2"
export REPO_HOST
export REPO_USER
export REPO_BASE
export REPO_USERHOST
export REPO_SEP
check_rcode() {
if [ $1 == 12 ]; then
echo " "
echo " *"
echo " * Upload Failed. This probably because of a missing destination subdirectory."
echo " * Now attempting to create the remote subdirectory: $REPO_DEST"
echo " *"
if [ "$REPO_USERHOST" != "" ]; then
echo "ssh $REPO_USERHOST mkdir -p $REPO_DEST"
ssh $REPO_USERHOST mkdir -p $REPO_DEST
else
echo " mkdir -p $REPO_DEST"
mkdir -p $REPO_DEST
fi
if [ $? == 0 ]; then
echo " *"
echo " * Successfully created the destination subdirectory at $REPO_USERHOST$REPO_SEP$REPO_DEST."
echo " * Please try your upload again."
echo " *"
echo " "
else
echo " *"
echo " * Failed to create the destination subdirectory at $REPO_USERHOST$REPO_SEP$REPO_DEST."
echo " * Good Luck."
echo " *"
echo " "
fi
fi
}
export -f check_rcode
{
"demo": {
"password":"demo",
"duration":63072000,
"uid":"demo",
"name" : "MSE Demo",
"email":"demo@yourdomain.com",
"type":"user"
},
"dev": {
"password":"dev",
"duration":63072000,
"uid":"dev",
"name" : "MSE Developer",
"email":"dev@yourdomain.com",
"type":"user"
}
}
\ No newline at end of file
{
"httpPort" : 1339,
"filterByAddress" : false,
"enableKeepalive" : true,
"enableSSDP" : true,
"sshKey" : "path_to_your_ssl_servers_rsa.key",
"sshCrt" : "path_to_your_ssl_servers_rsa.crt",
"sshCA" : "path_to_your_ssl_servers_chain-optional.crt"
}
{
"httpPort" : 1338,
"filterByAddress" : false,
"enableKeepalive" : true,
"enableSSDP" : true
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment