Commit Graph

47 Commits

Author SHA1 Message Date
7547b6f766 Update syntax for relative imports 2019-01-26 16:19:26 +01:00
0883ac6423 Fix whitespace and indentation, per pep8 2019-01-17 20:47:43 +01:00
87237f6536 Tabs, meet your new overlords: spaces
In a quest to reach pep8, use spaces to indent rather than tabs.
2019-01-17 15:35:39 +01:00
9308f141fc Allow unsafe inline style on docs
Our new docs build seems to put this in there, and only older docs were
tested it seems.
2018-12-22 16:28:42 +01:00
d36ea4a985 Enable setting of security http headers
The following security policy headers are set:

X-XSS-Protection: 1; mode=block -- always set

X-Frame-Options: DENY is set for all pages except for the documentation
  pages, primarily because pgadmin4 loads them in an iframe which would
  break.

Content-Security-Policy: <x>-src
  Is set to allow the default of self only, then allowing scripts for
  google analytics and fonts for google fonts. Images are allowed from everywhere.
  frame-ancestors 'none' is set by the same rules as X-Frame-Options

This also adds a decorator for @script_sources to have a single view
allow extra sources, and this is used for recaptcha. A generic decorator
is also made for other types of exclusions, though we don't have any at
this point.

If the setting SECURITY_POLICY_REPORT_ONLY is set to True then the policy
will be report-only and not enforced (for testing), otherwise enforcing
mode is enabled.

The setting SECURITY_POLICY_REPORT_URI sets where to send security
policy reports, if any.
2018-12-21 21:46:28 +01:00
4bdb128d01 Use "old-style" string format on doc URL redirect.
This eliminates a unicode error.
2018-11-05 10:50:14 -05:00
17f9b7f070 Remove "/static/" from doc URLs.
This creates a permanent redirect for any doc URL that references the
"static" path (i.e. all doc URLs), which allows a format similar to:

/docs/current/index.html

This is in response to not having "interactive" as an available option,
which should lead to shorter, less confusing URLs.
2018-11-05 10:23:11 -05:00
6679835174 Apply modern pgweb styles to web-based documentation.
This patch brings the web-based documentation to match the current styles
on the main postgresql.org website. The CSS supports the generated markup
from the main PostgreSQL documentation and supports the new/old class
that are visible in the documentation (e.g. uppercase classes pre-v10).

Authors: Sarah Conway, Jonathan Katz
2018-10-16 09:40:52 -04:00
f686dac717 Remove leftover testing code 2018-06-29 13:40:04 +02:00
e8eb10d9a7 Don't allow docs comments on unsupported versions 2018-05-03 19:44:11 +02:00
68ee1d6f1d Update language on "Submit Documentation Comment" page.
The language is more thorough in describing how to use the form,
in an effort to help improve the overall quality of submissions to
pgsql-docs.
2018-04-15 13:16:05 -04:00
6bd992d786 Change field labels for docs comments form
Clearly indicate what's subject, what's body, and that it's sending an
email.
2018-04-05 19:42:23 +02:00
f5ed2399d4 Pdf wrapper should not inherit from django model
It was already storing the version as a field, the inheriting from the
actual model was never used. Remove it, since newer django tries to
access a table based on the class name..
2018-03-23 14:16:23 +01:00
fd37389a3b Replace NavContext and render_to_response with render_pgweb
render_to_response does not work on newer django, so it needs to be
replaced. And using a speicfic context actually overcomplicates things,
it's easier to just use a wrapper function. For those cases where we
don't need NavContext, just use render() (the new shortcut function from
django), which also removes the need to use RequestContext.
2018-03-10 10:38:11 -05:00
e1cda9861d Fix doc comments for devel version
Don't say version 0.0 in the emails that are sent out. That's what we
call it internally, but the URL should have /devel/ in it. Fix this both
in the template, and then if it comes through in the form again in case
the user picked up a link elsewhere that is incorrect.
2018-01-06 17:51:25 +01:00
18ffd5eb3f Fix reply-to address for docs comments emails 2017-12-18 16:24:23 +01:00
a01d8d6a4a Set sender name on bug report and docs comments email 2017-12-18 16:22:11 +01:00
dfd46afae4 Send -bugs and -docs emails from noreply address
Sending from the submitters address runs afoul to DMARC and other
restrictions. Instead, send the email from a defined noreply address.
Instead, add the original submitter to both the Cc and the Reply-To
header, to make sure they receive followups.

Patch by Stephen, minor changes by Magnus
2017-12-18 15:59:18 +01:00
496416ceda Invent the concept of a docs page alias
This allows us to say that "app-pgreceivexlog.html" is actually the same
as "app-pgreceivewal.html" on a different version.

Turns out the templates would already render this correctly if we could
just find the map, so it's a simple case of adding an additional join
(that the django orm can't figure out, but we can do it in manual sql).

Adds a non-django managed unique index to make sure that it's not
possible to add the same alias twice in different "directions".
Violating this will cause a django excpetion in the admin interface
since it doesn't know about it, but as this is a very uncommon operation
and admin only, we don't care about that.

Finally, we don't bother issuing varnish purges for changes here, the
admin is expected to handle those manually. These changes are supposed
to happen very seldom, and the contents are purged automatically when
the docs are loaded anyway.
2017-05-25 11:28:39 -04:00
1fbb78cbcc Redirect docs requests for 10.0 to 10
This will include future 11.0 -> 11 as well, etc, for good measure.
2017-05-19 13:43:50 +02:00
88d6fdc224 Invent the concept of a "numtree" for versions
This property returns a single digit numbers for versions 10 and up (10,
11 etc), and keeps the two digit number for earlier (9.0, 9.1 etc).
2017-05-19 13:42:58 +02:00
7fc34e9eaf Replace login_required decorator with a validating one
This one will validate that the url is under /accounts/, which is
the only part we are going to be excluding from caching once we
move the website to https-only.
2016-05-24 21:14:34 +02:00
3c089cd09a Remove SSL decorators and middleware
The site is now served regardless of SSL, and assumes that the webserver
or web cache ensures that things rae always SSL.
2016-05-24 21:13:00 +02:00
2952b39754 Replace interactive docs with docs bug reporting
Per discussion from a long time ago, interactive docs aren't really
working out. The majority of submissions are either support questions
(which then get rejected because they cannot be answered in this
context) or pointing out docs incorrectnesses (which should be submitted
as a docs bug instead, so they can actually be fixed in the main
documentation).

Old references to /interactive/ will get redirected to /static/
automatically, and we expect to keep doing that for a long time (since
there are many links to them around the net).
2016-05-19 10:42:44 -04:00
21f6071417 Include links to beta documentation under manuals 2014-07-24 11:46:00 +02:00
8c4898e988 Give a 404 error when trying to load docs version 0.0
Noted by Josh Kupershmidt
2014-05-28 19:52:03 +02:00
756aa6ffbe Clean up imports
Remove unused imports and some other completely unused code.
2014-01-01 15:42:30 +01:00
48410d04fa Enable cache-busting URLs for CSS and JS
This will allow us to increase the cache times in the browser for our
CSS, which almost never changes.

Enables a new value to be used in templates, {{gitrev}}, which can be
used to bust pretty much any URL. We could do this for all the images
in the templates as well, but since most of them almost never change,
we'll just enable it manually for each individual image as it becomes
necessray - or just use a ?1, ?2 etc for those.

Enabled by default for CSS and JavaScript links, since those are much
more likely to be changed without having the URL changed.

Cache times aren't increased yet - we'll do that later one we're sure
that all existing caches are expired first.
2014-01-01 15:24:51 +01:00
f31c58ddaa Fix beta versioning to be more generic test versioning
This allows us to specify both beta and rc versions.

Requires SQL:

ALTER TABLE core_version RENAME COLUMN beta TO testing;
ALTER TABLE core_version ALTER COLUMN testing TYPE integer USING CASE WHEN testing THEN 2 ELSE 0 END;
2013-08-22 14:45:33 +02:00
8c21b3bd34 Fix strange float casting problems in python 2013-08-17 17:48:28 +02:00
ce499f4f0a Fix links to frontpage of documentation for old versions
I forgot that old versions have strange names for their homepage, and
we only switched to index.html in 7.2.
2013-08-17 17:43:09 +02:00
bc020e460f Oops, we're not supposed to include supported versions in the archive 2013-08-17 17:38:27 +02:00
d2d110290a Move docs templates into the docs/ app, now that they are not plain pages 2013-08-17 17:32:36 +02:00
fdd1404f37 Get the list of documentation versions out of the database
Instead of having to update this list manually in multiple places when
releasing new versions, just take the information out of the database
where it has to be anyway.

Fixes #90
Closes #93

Also make the code automatically pick up wich PDF files exist in the
static checkout, and auto-detect their size, both A4 and US sizes. This
removes yet one more manual step, yay!

Fixes #163
2013-08-17 17:28:36 +02:00
845c133d0b Explicitly list beta and development versions in docs as "devel"
Previously we listed both those as unsupported, which confused some users
particularly with new beta releases. While they are technically not supported
yet, it gave off the image that specific features would not be in newer
versions anymore, since they got listed as unsupported.

In passing, fix the style of the links in case they only exist in old
versions, which would put an extra | character in the version list.
2013-08-17 15:55:30 +02:00
7979342924 Redirect interactive devel docs to static instead of giving error
Per suggestion from Josh Kupershmidt
2012-06-13 09:00:36 +02:00
9a37d893e8 Show links to other versions of docs
Main patch from Marti Raudsepp, but with some fairly extensive changes
2012-06-05 12:24:06 +02:00
1ea8ecd12a Include docs load timestamp in developer docs
This makes it possible to figure out when the docs were actually
loaded, since developer docs don't carry a version number. This is
actually going to be the docs *load* timestamp, and not build timestamp,
but they should be close enough together that it shouldn't matter.

Fixes #108
2011-12-04 15:14:54 +01:00
37d7c02ae3 Fix docs index filename for old versions
It hasn't always been called index.html, annoyingly enough...

Fixes #109
2011-12-04 14:23:45 +01:00
9424c84e15 Use Decimal(0) instead of Decimal(0.0) to support older version of Python 2011-11-22 21:33:04 +01:00
7e9742c678 Allow loading and serving of developer docs on the main website 2011-11-22 20:58:29 +01:00
9ffd26ca5d Correcly handle old versions of the docs, where the file extension is .htm 2011-07-12 14:16:46 +01:00
34023288b8 Add redirects as required to deal with legacy urls, for all the stuff
that was in .htaccess files on the old site.
2010-06-22 11:17:49 +02:00
e3d8eae0ce Add the concept of a "current version", and use this when determining
which version to map /current/ to in the docs section.
2010-02-26 13:14:03 +01:00
e82022eb1d Add support for docs comments 2010-01-16 20:02:07 +01:00
4e9c4ef7fc Properly render docs pages with missing index.html in the path. 2010-01-11 17:25:47 +01:00
90b758c247 A first very basic import.
Contains basic functionality, and an import of most of the static content
from the old site.

There is still plenty more to do...
2009-09-14 14:39:25 +02:00