Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

include bitly.json

Mike McGann55c35db5870c
diff --git a/rpm/bitly.json b/rpm/bitly.json
new file mode 100644
index 000000000..3eba706db
--- /dev/null
+++ b/rpm/bitly.json
@@ -0,0 +1,4 @@
+{
+ "login": "",
+ "key": ""
+}
\ No newline at end of file
diff --git a/rpm/buildRPM.js b/rpm/buildRPM.js
index 1c42b37e9..8102bc300 100755
--- a/rpm/buildRPM.js
+++ b/rpm/buildRPM.js
@@ -14,6 +14,7 @@ shell.rm('-rf', `${homedir}/rpmbuild`);
shell.mkdir('-p', `${homedir}/rpmbuild/SOURCES`);
shell.cp('dist/worldview.tar.gz', `${homedir}/rpmbuild/SOURCES`);
shell.cp('rpm/httpd.conf', `${homedir}/rpmbuild/SOURCES`);
+shell.cp('rpm/bitly.json', `${homedir}/rpmbuild/SOURCES`);
shell.mkdir('-p', `${homedir}/rpmbuild/SPECS`);
shell.cp('rpm/worldview.spec', `${homedir}/rpmbuild/SPECS`);
diff --git a/rpm/httpd.conf b/rpm/httpd.conf
index 2c2b45aa0..fedf9ee31 100644
--- a/rpm/httpd.conf
+++ b/rpm/httpd.conf
@@ -1,8 +1,8 @@
-Alias /labs/worldview /usr/share/worldview
+Alias /labs/worldview /usr/share/worldview/web
AddHandler cgi-script .cgi
-<Directory /usr/share/worldview>
+<Directory /usr/share/worldview/web>
AllowOverride All
Order allow,deny
Allow from all
@@ -10,6 +10,6 @@ AddHandler cgi-script .cgi
AddHandler cgi-script .cgi
-<Directory /usr/share/worldview/service>
+<Directory /usr/share/worldview/web/service>
Options ExecCGI
</Directory>
diff --git a/rpm/worldview.spec b/rpm/worldview.spec
index f1e48afd4..39f3d9244 100644
--- a/rpm/worldview.spec
+++ b/rpm/worldview.spec
@@ -6,6 +6,7 @@ License: NASA-1.3
URL: http://earthdata.nasa.gov
Source1: httpd.conf
+Source2: bitly.json
BuildArch: noarch
Requires: httpd
@@ -28,6 +29,7 @@ Summary: Non-minified version of Worldview for debugging
%setup -c -T
tar xf %{SOURCE0} --touch
cp %{SOURCE1} .
+cp %{SOURCE2} .
%install
rm -rf %{buildroot}
@@ -38,8 +40,11 @@ install -m 644 httpd.conf %{buildroot}/%{httpdconfdir}/@[email protected]
rm httpd.conf
# Install release application
-install -m 755 -d %{buildroot}/%{_datadir}/@WORLDVIEW@
-cp -r @WORLDVIEW@/* %{buildroot}/%{_datadir}/@WORLDVIEW@
+install -m 755 -d %{buildroot}/%{_datadir}/@WORLDVIEW@/web
+cp -r @WORLDVIEW@/* %{buildroot}/%{_datadir}/@WORLDVIEW@/web
+
+# Keep the bitly API key outside the web root
+cp bitly.json %{buildroot}/%{_datadir}/@WORLDVIEW@
%clean
rm -rf %{buildroot}
diff --git a/tasks/buildAll.sh b/tasks/buildAll.sh
index 31161d4c9..6f5daafd0 100755
--- a/tasks/buildAll.sh
+++ b/tasks/buildAll.sh
@@ -1,9 +1,6 @@
#!/bin/bash
# Bash commands to run in Bamboo to prepare an rpm for deployment
-
-find .
-
npm install --production=false # Install dependencies, set production false so devDependencies are installed even though NODE_ENV is set to production
npm run dist
node rpm/buildRPM.js
diff --git a/web/service/link/shorten.cgi b/web/service/link/shorten.cgi
index 9d471be8a..a9feebed7 100755
--- a/web/service/link/shorten.cgi
+++ b/web/service/link/shorten.cgi
@@ -149,7 +149,7 @@ if __name__ == '__main__':
"""
options = parse_options()
try:
- key_path = os.path.join("..", "..", "etc", "bitly.json")
+ key_path = os.path.join("..", "..", "..", "bitly.json")
with open(key_path) as fp:
config = json.load(fp)
login = config["login"]