Skip to content

Commit

Permalink
Privacy: Specify that a cookie is used to indicate if the user has cl…
Browse files Browse the repository at this point in the history
…icked through the warning page.
  • Loading branch information
espebra committed Dec 14, 2024
1 parent 8d9a85f commit dde1276
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions http_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,17 @@ func (h *HTTP) privacy(w http.ResponseWriter, r *http.Request) {

type Data struct {
ds.Common
CookiesInUse bool
Bin ds.Bin `json:"bin"`
}

var data Data
data.Page = "privacy"

if h.config.RequireCookie == true {
data.CookiesInUse = true
}

if err := h.templates.ExecuteTemplate(w, "privacy", data); err != nil {
fmt.Printf("Failed to execute template: %s\n", err.Error())
http.Error(w, "Errno 302", http.StatusInternalServerError)
Expand Down
4 changes: 4 additions & 0 deletions templates/privacy.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ <h1>Privacy</h1>
<p>Meta data about transactions, including the IP address of clients uploading and downloading files, is logged for abuse handling purposes and may be shared with third parties in this context.</p>

<p>This service is using <a href="https://en.wikipedia.org/wiki/HTTPS">HTTPS</a> to secure <a href="https://en.wikipedia.org/wiki/Data_in_transit">data in transit</a>. This mechanism provide data protection from a limited set of scenarios such as man-in-the-middle attacks. The content is, however, not encrypted on the server side. It is recommended that the client encrypts the content prior to uploading it.</p>

{{ if .CookiesInUse }}
<p>A cookie named <code>verified</code> is stored in the client's browser to signal to Filebin if the user has acknowledged the risk involved in downloading files from this service.</p>
{{ end }}
</div>
</div>

Expand Down

0 comments on commit dde1276

Please sign in to comment.