Skip to content

Commit

Permalink
Merge branch 'release/1.9.11'
Browse files Browse the repository at this point in the history
  • Loading branch information
muloem committed Nov 8, 2016
2 parents 0e502f2 + 90ef02b commit 9055d1a
Show file tree
Hide file tree
Showing 105 changed files with 5,034 additions and 618 deletions.
11 changes: 6 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ gwt-unitcache
GAE/env

# Dashboard paths
Dashboard/.bundle
Dashboard/app/cljs/out/
Dashboard/app/cljs/target
Dashboard/app/cljs/users.js
Dashboard/app/test.html
Dashboard/assets
Dashboard/bin
Dashboard/node_modules
Dashboard/test_assets
Dashboard/tmp
Expand Down Expand Up @@ -62,6 +67,7 @@ GAE/war/WEB-INF/lib/datanucleus*.jar
GAE/war/WEB-INF/lib/geronimo*.jar
GAE/war/WEB-INF/lib/jdo2-api*.jar
GAE/war/WEB-INF/lib/jsr107*.jar
GAE/war/WEB-INF/lib/libservice.jar

# APK paths
WFPMapping/device/debugcert
Expand All @@ -84,8 +90,3 @@ tests/clojure/akvo-tests/target
*.codekit
*.scssc
dwsync.xml

Dashboard/app/cljs/out/
Dashboard/app/cljs/users.js

GAE/war/WEB-INF/lib/libservice.jar
295 changes: 295 additions & 0 deletions Config/ide/eclipse/eclipse-preferences.xml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions Config/instanceConfigurator/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/bin
/dist
.DS_Store
.classpath
.idea
.project
.settings
Binary file not shown.
Binary file not shown.
Binary file removed Config/instanceConfigurator/lib/commons-cli-1.2.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed Config/instanceConfigurator/lib/httpcore-4.2.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed Config/instanceConfigurator/lib/joda-time-2.2.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
import java.util.Map;
import java.util.UUID;

import org.apache.commons.cli.BasicParser;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.DefaultParser;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
Expand Down Expand Up @@ -58,7 +58,7 @@ public class InstanceConfigurator {
public static void main(String[] args) throws Exception {

Options opts = getOptions();
CommandLineParser parser = new BasicParser();
CommandLineParser parser = new DefaultParser();
CommandLine cli = null;

try {
Expand Down Expand Up @@ -91,18 +91,15 @@ public static void main(String[] args) throws Exception {
String orgName = cli.getOptionValue("on");
String signingKey = cli.getOptionValue("sk");

File out = new File(outFolder);
File configFileHome = new File(outFolder);

if (!out.exists()) {
out.mkdirs();
}
if (! configFileHome.exists()) { configFileHome.mkdirs(); }

Map<String, AccessKey> accessKeys = new HashMap<String, AccessKey>();
String apiKey = UUID.randomUUID().toString().replaceAll("-", "");

AWSCredentials creds = new BasicAWSCredentials(awsAccessKey, awsSecret);
AmazonIdentityManagementClient iamClient = new AmazonIdentityManagementClient(
creds);
AmazonIdentityManagementClient iamClient = new AmazonIdentityManagementClient(creds);
AmazonS3Client s3Client = new AmazonS3Client(creds);

// Creating bucket
Expand Down Expand Up @@ -146,8 +143,7 @@ public static void main(String[] args) throws Exception {
CreateAccessKeyRequest gaeAccessRequest = new CreateAccessKeyRequest();
gaeAccessRequest.setUserName(gaeUser);

CreateAccessKeyResult gaeAccessResult = iamClient
.createAccessKey(gaeAccessRequest);
CreateAccessKeyResult gaeAccessResult = iamClient.createAccessKey(gaeAccessRequest);
accessKeys.put(gaeUser, gaeAccessResult.getAccessKey());

// APK
Expand Down Expand Up @@ -176,15 +172,13 @@ public static void main(String[] args) throws Exception {
System.out.println("Configuring security policies...");

Configuration cfg = new Configuration();
cfg.setClassForTemplateLoading(InstanceConfigurator.class,
"/org/akvo/flow/templates");
cfg.setClassForTemplateLoading(InstanceConfigurator.class, "/org/akvo/flow/templates");
cfg.setObjectWrapper(new DefaultObjectWrapper());
cfg.setDefaultEncoding("UTF-8");

Map<String, Object> data = new HashMap<String, Object>();
data.put("bucketName", bucketName);
data.put("version",
new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
data.put("version", new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
data.put("accessKey", accessKeys);

Template t0 = cfg.getTemplate("bucket-policy.ftl");
Expand All @@ -199,7 +193,7 @@ public static void main(String[] args) throws Exception {
StringWriter gaePolicy = new StringWriter();
t2.process(data, gaePolicy);

s3Client.setBucketPolicy(bucketName, t0.toString());
s3Client.setBucketPolicy(bucketName, bucketPolicy.toString());

iamClient.putUserPolicy(new PutUserPolicyRequest(apkUser, apkUser,
Policy.fromJson(apkPolicy.toString()).toJson()));
Expand All @@ -213,21 +207,18 @@ public static void main(String[] args) throws Exception {
Map<String, Object> apkData = new HashMap<String, Object>();
apkData.put("awsBucket", bucketName);
apkData.put("awsAccessKeyId", accessKeys.get(apkUser).getAccessKeyId());
apkData.put("awsSecretKey", accessKeys.get(apkUser)
.getSecretAccessKey());
apkData.put("awsSecretKey", accessKeys.get(apkUser).getSecretAccessKey());
apkData.put("serverBase", "https://" + gaeId + ".appspot.com");
apkData.put("restApiKey", apiKey);

Template t3 = cfg.getTemplate("survey.properties.ftl");
FileWriter fw = new FileWriter(new File(out, "/survey.properties"));
t3.process(apkData, fw);
t3.process(apkData, new FileWriter(new File(configFileHome, "/survey.properties")));

// appengine-web.xml
Map<String, Object> webData = new HashMap<String, Object>();
webData.put("awsBucket", bucketName);
webData.put("awsAccessKeyId", accessKeys.get(gaeUser).getAccessKeyId());
webData.put("awsSecretAccessKey", accessKeys.get(gaeUser)
.getSecretAccessKey());
webData.put("awsSecretAccessKey", accessKeys.get(gaeUser).getSecretAccessKey());
webData.put("s3url", "https://" + bucketName + ".s3.amazonaws.com");
webData.put("instanceId", gaeId);
webData.put("alias", alias);
Expand All @@ -248,8 +239,7 @@ public static void main(String[] args) throws Exception {
webData.put("signingKey", signingKey);

Template t5 = cfg.getTemplate("appengine-web.xml.ftl");
FileWriter fw3 = new FileWriter(new File(out, "/appengine-web.xml"));
t5.process(webData, fw3);
t5.process(webData, new FileWriter(new File(configFileHome, "/appengine-web.xml")));

System.out.println("Done");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
</static-files>
<!-- Configure java.util.logging -->
<system-properties>
<property name="enableChangeEvents" value="$enableChangeEvents" />
<property name="eventNotification" value="$eventNotification" />
<property name="apkS3Path" value="https://akvoflow.s3.amazonaws.com/apk/" />
<property name="autoUpdateApk" value="true" />
<property name="java.util.logging.config.file" value="WEB-INF/logging.properties" />
<property name="aws_secret_key" value="${awsSecretAccessKey}" />
<property name="aws_identifier" value="${awsAccessKeyId}" />
<property name="serviceAccountId" value="sa-${instanceId}@${instanceId}.iam.gserviceaccount.com" />
<property name="photo_url_root" value="${s3url}/images/" />
<property name="alias" value="${alias}" />
<property name="flowServices" value="${flowServices}" />
Expand All @@ -29,30 +28,34 @@
<property name="recipientListString" value="${emailTo};FLOW Errors recipient" />
<property name="defaultPhotoCaption" value="${organization}" />
<property name="attachreport" value="true" />
<property name="bootstrapdir" value="bootstrap"/>
<property name="imageroot" value="https://${instanceId}.appspot.com"/>
<property name="mapiconimageroot" value="${s3url}/images/mapicons"/>
<property name="scoreAPFlag" value="true"/>
<property name="organization" value="${organization}"/>
<property name="bootstrapdir" value="bootstrap" />
<property name="imageroot" value="https://${instanceId}.appspot.com" />
<property name="mapiconimageroot" value="${s3url}/images/mapicons" />
<property name="scoreAPFlag" value="true" />
<property name="organization" value="${organization}" />
<property name="signingKey" value="${signingKey}" />
<property name="allowUnsignedData" value="true" />
<property name="defaultOrg" value="${organization}" />
<property name="domainType" value="locale" />
<property name="exportedProperties" value="defaultOrg,domainType,pointTypes" />
<property name="pointTypes" value="WaterPoint,SanitationPoint,PublicInstitution"/>
<property name="optionRenderMode" value="radio"/>
<property name="backendpublish" value="false"/>
<property name="cacheExpirySeconds" value="3600"/>
<property name="useLongDates" value="true"/>
<property name="statusQuestionText" value="water available on the day;Yes=FUNCTIONING_HIGH;No=BROKEN_DOWN;DEFAULT=BROKEN_DOWN"/>
<property name="mergeNearbyLocales" value="false"/>
<property name="scoreAPDynamicFlag" value="false"/>
<property name="asyncTaskTimeout" value="16384"/>
<property name="enableRestSecurity" value="true"/>
<property name="restPrivateKey" value="${apiKey}"/>
<property name="useTabRDRFlag" value="false"/>
<property name="showStatisticsFeature" value="false"/>
<property name="showMonitoringFeature" value="false"/>
<property name="mandatoryQuestionID" value="false"/>
<property name="pointTypes" value="WaterPoint,SanitationPoint,PublicInstitution" />
<property name="optionRenderMode" value="radio" />
<property name="backendpublish" value="false" />
<property name="cacheExpirySeconds" value="3600" />
<property name="useLongDates" value="true" />
<property name="statusQuestionText" value="water available on the day;Yes=FUNCTIONING_HIGH;No=BROKEN_DOWN;DEFAULT=BROKEN_DOWN" />
<property name="mergeNearbyLocales" value="false" />
<property name="scoreAPDynamicFlag" value="false" />
<property name="asyncTaskTimeout" value="16384" />
<property name="enableRestSecurity" value="true" />
<property name="restPrivateKey" value="${apiKey}" />
<property name="useTabRDRFlag" value="false" />
<property name="showStatisticsFeature" value="false" />
<property name="showMonitoringFeature" value="true" />
<property name="mandatoryQuestionID" value="false" />
<property name="enableChangeEvents" value="${enableChangeEvents}" />
<property name="eventNotification" value="${eventNotification}" />
<property name="hereMapsAppId" value="${hereMapsAppId}" />
<property name="hereMapsAppCode" value="${hereMapsAppCode}" />
</system-properties>
</appengine-web-app>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Version": "2012-10-17",
"Statement": {
"Statement": [{
"Sid": "Stmt1",
"Effect": "Allow",
"Principal": {
Expand All @@ -9,7 +9,7 @@
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::${bucketName}",
"arn:aws:s3:::${bucketName}/*",
"arn:aws:s3:::${bucketName}/*"
]
}
}]
}
5 changes: 1 addition & 4 deletions Dashboard/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ GEM
rake
i18n-docs (0.0.7)
rake
json (1.8.1)
json (1.8.3)
listen (2.7.9)
celluloid (>= 0.15.2)
rb-fsevent (>= 0.9.3)
Expand Down Expand Up @@ -84,6 +84,3 @@ DEPENDENCIES
sass
uglifier
yui-compressor

BUNDLED WITH
1.10.3
Loading

0 comments on commit 9055d1a

Please sign in to comment.