Skip to content
pols.so docs
Esc
↑↓navigate↵open⌘Jpreview
On this page

Who can open a site

Make a published site private to your org, open to anyone with its share link, or public, and replace a share link that got out.

Each site has one of three access modes, which you can switch at any time:

Access Who can open the site
private (the default) your org’s active users, logged in at my.pols.so
link anyone with the site’s share link, and your org’s users
public anyone who knows the URL
pols publish web app/dist --site demo --access link   # choose the access of a new site
pols sites set demo --access public                   # switch an existing site
pols sites link demo                                  # print the share link of a link site
pols sites link demo --rotate                         # replace it; the old one stops working

--access on pols publish applies only to a site the publish makes; an existing site keeps its access, and the CLI refuses a --access that differs from it. Change an existing site’s access with pols sites set (PATCH /v1/sites/{site}). A change applies within seconds: visitors who opened the site under a mode that no longer lets them in lose access.

Private sites

A visitor without access who opens a private site is sent to my.pols.so. A user of the site’s org logs in there if needed and is sent back to the site, now logged in. Everyone else sees the same “There is nothing at” page as for an address no site has, so a private site does not show that it exists.

The site’s own session cookie lasts 12 hours. It stops working within seconds when its user leaves the org or is deactivated, or when the site’s access changes so that it no longer lets them in.

A link site has a share link: its URL with a token. Whoever has the link can open the site without a pols account, so hand it only to the people who should see the site, as you would a password. pols sites link prints it, and share_url holds it in the API.

pols sites link SITE --rotate (POST /v1/sites/{site}/link) replaces the share link. The old link, and every visit opened with it, stops working within seconds. Switching a site from link to another mode replaces the link too, so after switching back to link, hand out the new one.

Public sites

A public site is open to anyone with its URL, with no login and no link. Use it for something you would put on the open web anyway.

Headers that depend on access

Every site sends X-Content-Type-Options: nosniff and Cross-Origin-Opener-Policy: same-origin. Private and link sites also tell browsers and search engines to keep them to themselves: they are marked Cache-Control: private and X-Robots-Tag: noindex, nofollow, send no referrer to the pages they link to, and can be framed only by their own pages. Public sites send Referrer-Policy: strict-origin-when-cross-origin.

All sites live under on.pols.so, apart from pols.so, my.pols.so and api.pols.so, so a site’s pages cannot read the cookies of the website, the dashboard or the API. The session cookies are Secure, HttpOnly and bound to the site’s own host name.

A site of a disabled org is not served.