Skip to content

Commit

Permalink
[#1831]Add Akvo RSR name to footer. Improve Readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
stellanl committed Nov 6, 2015
1 parent 095c92e commit 3b1da68
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3643,9 +3643,11 @@ select ? as number, 'D' as name
<column id="4"/>
<row id="5">
<cell id="6">
<text id="7">
<text name="footer" id="7">
<property name="marginTop">8pt</property>
<property name="marginLeft">8pt</property>
<property name="contentType">html</property>
<text-property name="content"><![CDATA[<value-of>new Date()</value-of>]]></text-property>
<text-property name="content"><![CDATA[Akvo RSR <value-of>new Date().toLocaleDateString()</value-of>]]></text-property>
</text>
</cell>
</row>
Expand Down
17 changes: 11 additions & 6 deletions akvo/templates/reportserver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,18 @@ The report has one parameter, TheProjectId, which is created on the RS as a Data

## Access by URL

https://reporting.test.akvo-ops.org/reportserver/reportserver/httpauthexport?key=restest2&user=user1&password=unicorns&format=pdf&download=false&p_TheProjectId=2081
https://reporting.test.akvo-ops.org/reportserver/reportserver/httpauthexport?key=project_results&user=user1&password=unicorns&format=pdf&download=false&p_TheProjectId=2081

Where format can be one of [WORD, PDF, HTML, PNG, EXCEL].
Since this exposes a password, even if just a dummy one, it should be hidden behind the rsr nginx proxy which can append the key/username/password query parameters. A proxy rule like this should do it, as the original query parameters will be copied over:

location /report/project {
proxy_pass https://reporting.test.akvo-ops.org;
rewrite ^(.*)$ /reportserver/reportserver/httpauthexport?key=project_results&username=user1&password=unicorns break;
}

The URL will then become something like
https://rsr.akvo.org/report/project/2849?format=pdf
where format can be one of [WORD, PDF, HTML, PNG, EXCEL].


During development I found it convenient to:
Expand All @@ -25,15 +34,11 @@ During development I found it convenient to:
```
sudo -u postgres psql
postgres=# create role rsr_readonly encrypted password '*************' login;
CREATE ROLE
postgres=# grant connect on database rsr to rsr_readonly;
GRANT
\c rsr
rsr=# grant usage on schema public to rsr_readonly;
GRANT
rsr=# grant select on all tables in schema public to rsr_readonly;
rsr=# grant select on all sequences in schema public to rsr_readonly;
GRANT
```


Expand Down

0 comments on commit 3b1da68

Please sign in to comment.