Commit Graph

4815 Commits

Author SHA1 Message Date
Rebecca Law
08e5f68461 A little refactoring 2018-01-12 12:06:07 +00:00
Rebecca Law
6070e2e197 Merge branch 'master' into download_link-activity-page 2018-01-10 16:06:40 +00:00
Chris Waszczuk
c3fe2bb906 Merge pull request #1755 from gov-cjwaszczuk/master
Allow letter templates to select the a default template sender from service senders
2018-01-10 14:56:44 +00:00
chrisw
7271d4fbde Allow letter templates to select the default contact block from the list 2018-01-10 11:20:40 +00:00
Leo Hemsted
db2fad1a75 Merge pull request #1763 from alphagov/leohemsted-patch-1
derry strabane council email whitelist
2018-01-10 11:06:37 +00:00
Leo Hemsted
b27eacb03b oops 2018-01-10 10:56:21 +00:00
Leo Hemsted
224b9e5098 Update test_validators.py 2018-01-10 10:48:58 +00:00
Leo Hemsted
c780c94fb6 derry strabane council email whitelist 2018-01-10 10:47:40 +00:00
Leo Hemsted
665c569db2 Merge pull request #1753 from alphagov/session-cookie
Replace cookie implementation with flask builtin secure cookie.
2018-01-09 17:18:43 +00:00
Leo Hemsted
b9f7fa1f6f Replace cookie implementation with flask builtin secure cookie.
However, by default, session cookies don't expire (only cleared out by
the end user's browser).

This is dumb. You'd think, given that there's
`config['PERMANENT_SESSION_LIFETIME']`, that you'd enable permanent
sessions in the config too - but no, you have to declare it for each
request. session.permanent is also, helpfully, a way of saying that the
session isn't permanent - in that, it will expire on its own, as
opposed to being controlled by the browser's session. Because session
is a proxy, it's only accessible from within a request context, so we
need to set this before every request 🙄

http://flask.pocoo.org/docs/0.12/api/#flask.session
https://stackoverflow.com/questions/34118093/flask-permanent-session-where-to-define-them
2018-01-09 16:45:48 +00:00
Alexey Bezhan
08dca5b879 Merge pull request #1758 from alphagov/generate-manifest-env
Add generate_manifest.py script and update deployment tasks
2018-01-09 16:41:25 +00:00
Alexey Bezhan
0088d588e1 Use VCAP_APPLICATION to detect CloudFoundry environment
VCAP_SERVICES is not set on PaaS if no services are bound to the
application, so we need to check for VCAP_APPLICATION to parse the
application name and environment.
2018-01-09 14:50:41 +00:00
Alexey Bezhan
945c967250 Don't parse AWS credentials from VCAP_SERVICES in run_app_paas
AWS credentials are provided in the environment variables directly,
so we don't need to parse them from VCAP_SERVICES
2018-01-09 14:20:18 +00:00
Alexey Bezhan
8346e1b8be Remove VCAP_SERVICES parsing code
We're no longer using user-provided services for application secrets
so we can remove the cloudfoundry_config code responsible for parsing
VCAP_SERVICES.
2018-01-09 14:18:32 +00:00
Alexey Bezhan
c550c686d1 Replace manifest user-provided services with environment variables
Variable values are populated from the credentials by the `generate-manifest`
make target.
2018-01-09 14:17:03 +00:00
Alexey Bezhan
ab55bf49b2 Add generate_manifest.py script and update deployment tasks
Brings in the new environment variables deployment process introduced
in alphagov/notifications-api#1543.

The script is a copy of the API one and make steps are modified to
fit with the existing admin deployment targets.
2018-01-09 14:14:47 +00:00
Chris Hill-Scott
8c55dba2a7 Merge pull request #1754 from alphagov/pre-next-update
Update previous/next navigation to match GOV.UK
2018-01-09 10:23:50 +00:00
Chris Hill-Scott
17ea920be4 Update previous/next navigation to match GOV.UK
The pagination pattern on GOV.UK changed in:
https://github.com/alphagov/static/pull/1051

We should update ours to match because:
- consistency
- the new icons looks better
2018-01-08 15:59:55 +00:00
Chris Waszczuk
24d73a2471 Merge pull request #1750 from alphagov/make-content-links-in-notify-consistent
Make content links in notify consistent
2018-01-08 11:43:55 +00:00
chrisw
79355d42fb Merge branch 'master' of https://github.com/alphagov/notifications-admin into make-content-links-in-notify-consistent 2018-01-08 11:23:38 +00:00
chrisw
0a7fe52e83 make content links in Notify consistent 2018-01-05 14:45:19 +00:00
Chris Hill-Scott
9265101b11 Merge pull request #1749 from alphagov/pyup-update-pytest-3.3.1-to-3.3.2
Update pytest to 3.3.2
2018-01-05 12:59:42 +00:00
pyup-bot
3e9e45ee29 Update pytest from 3.3.1 to 3.3.2 2018-01-05 12:46:24 +00:00
Chris Hill-Scott
291e55efa6 Merge pull request #1747 from alphagov/128-131
128-131 and 53 to 55
2018-01-05 12:46:05 +00:00
Pete Herlihy
9e70924042 128-131 and 53 to 55
* ABCi - Aneurin Bevan UHB – Aneurin Bevan University Health Board
* Research – Driver & Vehicle Standards Agency
* Tunbridge Wells Borough Council	 – Tunbridge Wells Borough Council
2018-01-05 12:32:34 +00:00
Chris Hill-Scott
8daeb4bcc4 Merge pull request #1743 from alphagov/all-pages-letter
Show all pages of a sent letter
2018-01-05 12:32:19 +00:00
Chris Hill-Scott
22de67fa19 Show all pages of a sent letter
Because we weren’t specifying how many pages the letter has, it was
defaulting to only showing the first page. This looked broken.
2018-01-05 12:19:55 +00:00
Chris Hill-Scott
ec265dd2b4 Merge pull request #1745 from alphagov/🖨
Lint for print statements
2018-01-05 12:19:22 +00:00
Chris Hill-Scott
b24c23fe3b Lint for print statements
flake8-print is a flake8 plugin that checks for `print()` statements in
Python files.

This should save us having to manually spot these when reviewing pull
requests.

The `--enable=T` flag needs to be set until this bug is fixed:
https://github.com/JBKahn/flake8-print/issues/27
2018-01-05 12:14:28 +00:00
chrisw
efe90f6830 Updated service manual link on using-notify page 2018-01-05 11:52:28 +00:00
Chris Hill-Scott
2ec71ace5c Merge pull request #1746 from alphagov/british-museum
Add British Museum to whitelist
2018-01-04 17:14:20 +00:00
Chris Hill-Scott
1e7b330bd9 Add British Museum to whitelist
> BM is an executive non-departmental public body, sponsored by the
> Department for Digital, Culture, Media & Sport.
>
> British Museum has a separate website (http://www.britishmuseum.org)

– https://www.gov.uk/government/organisations/british-museum
2018-01-04 15:36:22 +00:00
Sakis
86cda8aaac Merge pull request #1744 from alphagov/make-failwhale
Add make targets to enable and disable failwhale
2018-01-04 11:39:44 +00:00
Sakis
ee64d9bfee Use backticks around <environment> to make it render 2018-01-04 11:02:51 +00:00
Athanasios Voutsadakis
85c7ecfe64 Update docs about how to enable and disable failwhale 2018-01-04 11:02:18 +00:00
Athanasios Voutsadakis
d9f6554956 Add make targets to enable and disable failwhale
Also add a couple of convenience targets and bring back the DNS_NAME
variable.
2018-01-03 17:17:26 +00:00
Sakis
bb493bfddd Merge pull request #1739 from alphagov/clean-makefile
Remove unused targets and variables from Makefile
2018-01-03 15:10:24 +00:00
Athanasios Voutsadakis
e9d706dde6 Merge branch 'master' into clean-makefile 2018-01-03 13:49:52 +00:00
Rebecca Law
e71bbc1bb5 [WIp] 2018-01-03 13:21:00 +00:00
Rebecca Law
1fccb3da5e Merge branch 'master' into download_link-activity-page 2018-01-03 12:48:02 +00:00
Chris Hill-Scott
9586632fec Merge pull request #1723 from alphagov/admin-invite-url
Specify domain to use for invite links
2018-01-03 11:47:15 +00:00
Chris Hill-Scott
86d76baa0d Have admin specify host to use for invite links
When we’re doing user research we often:
- start the task by inviting the participant to a service on Notify
- have them use a prototype version of the admin app, hosted on a
  different domain

Currently we can’t do both of these things together, because the invite
emails always send people to notifications.service.gov.uk (because it’s
the API that sends the emails, and the prototype admin app points at the
production API).

This commit changes the admin app to tell the API which host to use when
creating the invite links.

Depends on:
- [ ] https://github.com/alphagov/notifications-api/pull/1515
2018-01-03 10:37:29 +00:00
Chris Hill-Scott
087c0cbc8c Merge pull request #1740 from alphagov/quis-patch-1
Force example CSV to download, not open in browser
2018-01-02 17:08:15 +00:00
Chris Hill-Scott
a604ed60b6 Remove value of download attribute on links
We should standardise on <a download> rather than
<a download="download"> everywhere. The value of the download attribute
tells the browser what filename to use, but is overridden by the
Content-Disposition HTTP header. Since it’s not being used, we should
remove it for the sake of disambiguation.
2018-01-02 16:52:17 +00:00
Athanasios Voutsadakis
d8dabcfbbf Remove appspec and related files
These have not been used since the migration to paas, so they can be
removed.
2018-01-02 14:24:26 +00:00
Chris Hill-Scott
85b3978061 Force example CSV to download, not open in browser
We wouldn’t wan’t anyone just seeing the raw CSV data in their browser – it isn’t clear what a user would do with it at that point. And we wouldn’t want it navigating them away from the send page, because this might cause them to lose their place.

This commit forces the file to download using the HTML5 `download` attribute:

> This attribute instructs browsers to download a URL instead of navigating to it, so the user will be prompted to save it as a local file. 

– https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download
2018-01-02 14:06:39 +00:00
Athanasios Voutsadakis
5a9d5cd065 Remove unused targets and variables from Makefile
Remove `cf-build` and `cf-build-with-docker` as they are not being used
Remove `build-codedeploy-artifact` in favor of `build-paas-artifact`
Remove `upload-codedeploy-artifact` in favor of `upload-paas-artifact`
Remove `deploy`, `check-aws-vars`,
`deploy-suspend-autoscaling-processes`,
`deploy-resume-autoscaling-processes`,
`deploy-check-autoscaling-processes` as they are remains of the pre-paas
era.

Consequently some variables became obsolete, namely: `CODEDEPLOY_PREFIX`
`CODEDEPLOY_APP_NAME`, `DNS_NAME`, `AWS_ACCESS_KEY_ID` and
`AWS_SECRET_ACCESS_KEY` and they are removed.
2018-01-02 12:29:50 +00:00
Chris Hill-Scott
538e3f8097 Merge pull request #1738 from alphagov/markdown-links-emails
Enable Markdown links in emails
2018-01-02 12:22:35 +00:00
Chris Hill-Scott
bb460bd300 Enable Markdown links in emails
Depends on:
- [ ] https://github.com/alphagov/notifications-utils/pull/293
- [ ] https://github.com/alphagov/notifications-api/pull/1535
2018-01-02 11:23:32 +00:00
Katie Smith
e3cf2bd455 Merge pull request #1726 from alphagov/ignore-case-of-invited-user-email-addresses
Make email addresses case insensitive when inviting users to services
2018-01-02 09:43:33 +00:00