@@ -1,4 +1,4 @@ | |||||
name: Build container image, publish as Github-package | |||||
name: Build container image, publish as GitHub-package | |||||
# This workflow uses actions that are not certified by GitHub. | # This workflow uses actions that are not certified by GitHub. | ||||
# They are provided by a third-party and are governed by | # They are provided by a third-party and are governed by | ||||
@@ -504,7 +504,7 @@ func login(app *App, w http.ResponseWriter, r *http.Request) error { | |||||
// User has no email set, so check if they haven't added a password, either, | // User has no email set, so check if they haven't added a password, either, | ||||
// so we can return a more helpful error message. | // so we can return a more helpful error message. | ||||
if hasPass, _ := app.db.IsUserPassSet(u.ID); !hasPass { | if hasPass, _ := app.db.IsUserPassSet(u.ID); !hasPass { | ||||
log.Info("Tried logging in to %s, but no password or email.", signin.Alias) | |||||
log.Info("Tried logging into %s, but no password or email.", signin.Alias) | |||||
return impart.HTTPError{http.StatusPreconditionFailed, "This user never added a password or email address. Please contact us for help."} | return impart.HTTPError{http.StatusPreconditionFailed, "This user never added a password or email address. Please contact us for help."} | ||||
} | } | ||||
} | } | ||||
@@ -577,7 +577,7 @@ func getVerboseAuthUser(app *App, token string, u *User, verbose bool) *AuthUser | |||||
} | } | ||||
passIsSet, err := app.db.IsUserPassSet(u.ID) | passIsSet, err := app.db.IsUserPassSet(u.ID) | ||||
if err != nil { | if err != nil { | ||||
// TODO: correct error meesage | |||||
// TODO: correct error message | |||||
log.Error("Login: Unable to get user collections: %v", err) | log.Error("Login: Unable to get user collections: %v", err) | ||||
} | } | ||||
@@ -262,7 +262,7 @@ func apiAuth(app *App, r *http.Request) (*User, error) { | |||||
return u, nil | return u, nil | ||||
} | } | ||||
// optionaAPIAuth is used for endpoints that accept authenticated requests via | |||||
// optionalAPIAuth is used for endpoints that accept authenticated requests via | |||||
// Authorization header or cookie, unlike apiAuth. It returns a different err | // Authorization header or cookie, unlike apiAuth. It returns a different err | ||||
// in the case where no Authorization header is present. | // in the case where no Authorization header is present. | ||||
func optionalAPIAuth(app *App, r *http.Request) (*User, error) { | func optionalAPIAuth(app *App, r *http.Request) (*User, error) { | ||||
@@ -51,7 +51,7 @@ func initKeyPaths(app *App) { | |||||
func generateKey(path string) error { | func generateKey(path string) error { | ||||
// Check if key file exists | // Check if key file exists | ||||
if _, err := os.Stat(path); err == nil { | if _, err := os.Stat(path); err == nil { | ||||
log.Info("%s already exists. rm the file if you understand the consquences.", path) | |||||
log.Info("%s already exists. rm the file if you understand the consequences.", path) | |||||
return nil | return nil | ||||
} else if !os.IsNotExist(err) { | } else if !os.IsNotExist(err) { | ||||
log.Error("%s", err) | log.Error("%s", err) | ||||
@@ -109,7 +109,7 @@ func defaultPrivacyPolicy(cfg *config.Config) string { | |||||
It retains as little data about you as possible, not even requiring an email address to sign up. However, if you _do_ give us your email address, it is stored encrypted in our database. We salt and hash your account's password. | It retains as little data about you as possible, not even requiring an email address to sign up. However, if you _do_ give us your email address, it is stored encrypted in our database. We salt and hash your account's password. | ||||
We store log files, or data about what happens on our servers. We also use cookies to keep you logged in to your account. | |||||
We store log files, or data about what happens on our servers. We also use cookies to keep you logged into your account. | |||||
Beyond this, it's important that you trust whoever runs **` + cfg.App.SiteName + `**. Software can only do so much to protect you -- your level of privacy protections will ultimately fall on the humans that run this particular service.` | Beyond this, it's important that you trust whoever runs **` + cfg.App.SiteName + `**. Software can only do so much to protect you -- your level of privacy protections will ultimately fall on the humans that run this particular service.` | ||||
} | } | ||||
@@ -1,13 +1,13 @@ | |||||
{{define "head"}}<title>Log in — {{.SiteName}}</title> | {{define "head"}}<title>Log in — {{.SiteName}}</title> | ||||
<meta name="description" content="Log in to {{.SiteName}}."> | |||||
<meta itemprop="description" content="Log in to {{.SiteName}}."> | |||||
<meta name="description" content="Log into {{.SiteName}}."> | |||||
<meta itemprop="description" content="Log into {{.SiteName}}."> | |||||
<style> | <style> | ||||
input{margin-bottom:0.5em;} | input{margin-bottom:0.5em;} | ||||
</style> | </style> | ||||
{{end}} | {{end}} | ||||
{{define "content"}} | {{define "content"}} | ||||
<div class="tight content-container"> | <div class="tight content-container"> | ||||
<h1>Log in to {{.SiteName}}</h1> | |||||
<h1>Log into {{.SiteName}}</h1> | |||||
{{if .Flashes}}<ul class="errors"> | {{if .Flashes}}<ul class="errors"> | ||||
{{range .Flashes}}<li class="urgent">{{.}}</li>{{end}} | {{range .Flashes}}<li class="urgent">{{.}}</li>{{end}} | ||||
@@ -1068,7 +1068,7 @@ func pinPost(app *App, w http.ResponseWriter, r *http.Request) error { | |||||
ppr := PinPostResult{ID: p.ID} | ppr := PinPostResult{ID: p.ID} | ||||
if err != nil { | if err != nil { | ||||
ppr.Code = http.StatusInternalServerError | ppr.Code = http.StatusInternalServerError | ||||
// TODO: set error messsage | |||||
// TODO: set error message | |||||
} else { | } else { | ||||
ppr.Code = http.StatusOK | ppr.Code = http.StatusOK | ||||
} | } | ||||
@@ -82,7 +82,7 @@ func InitRoutes(apper Apper, r *mux.Router) *mux.Router { | |||||
configureGenericOauth(handler, write, apper.App()) | configureGenericOauth(handler, write, apper.App()) | ||||
configureGiteaOauth(handler, write, apper.App()) | configureGiteaOauth(handler, write, apper.App()) | ||||
// Set up dyamic page handlers | |||||
// Set up dynamic page handlers | |||||
// Handle auth | // Handle auth | ||||
auth := write.PathPrefix("/api/auth/").Subrouter() | auth := write.PathPrefix("/api/auth/").Subrouter() | ||||
if apper.App().cfg.App.OpenRegistration { | if apper.App().cfg.App.OpenRegistration { | ||||
@@ -2,7 +2,7 @@ | |||||
############################################################################### | ############################################################################### | ||||
## writefreely update script ## | ## writefreely update script ## | ||||
## ## | ## ## | ||||
## WARNING: running this script will overwrite any modifed assets or ## | |||||
## WARNING: running this script will overwrite any modified assets or ## | |||||
## template files. If you have any custom changes to these files you ## | ## template files. If you have any custom changes to these files you ## | ||||
## should back them up FIRST. ## | ## should back them up FIRST. ## | ||||
## ## | ## ## | ||||
@@ -1,6 +1,6 @@ | |||||
# static/js | # static/js | ||||
This directory is for Javascript. | |||||
This directory is for JavaScript. | |||||
## Updating libraries | ## Updating libraries | ||||
@@ -28,7 +28,7 @@ | |||||
</ul></nav> | </ul></nav> | ||||
<span id="wc" class="hidden if-room room-4">0 words</span> | <span id="wc" class="hidden if-room room-4">0 words</span> | ||||
</div> | </div> | ||||
<noscript style="margin-left: 2em;"><strong>NOTE</strong>: for now, you'll need Javascript enabled to post.</noscript> | |||||
<noscript style="margin-left: 2em;"><strong>NOTE</strong>: for now, you'll need JavaScript enabled to post.</noscript> | |||||
<div id="belt"> | <div id="belt"> | ||||
{{if .Editing}}<div class="tool hidden if-room"><a href="{{if .EditCollection}}{{.EditCollection.CanonicalURL}}{{.Post.Slug}}/edit/meta{{else}}/{{if .SingleUser}}d/{{end}}{{.Post.Id}}/meta{{end}}" title="Edit post metadata" id="edit-meta"><img class="ic-24dp" src="/img/ic_info_dark@2x.png" /></a></div>{{end}} | {{if .Editing}}<div class="tool hidden if-room"><a href="{{if .EditCollection}}{{.EditCollection.CanonicalURL}}{{.Post.Slug}}/edit/meta{{else}}/{{if .SingleUser}}d/{{end}}{{.Post.Id}}/meta{{end}}" title="Edit post metadata" id="edit-meta"><img class="ic-24dp" src="/img/ic_info_dark@2x.png" /></a></div>{{end}} | ||||
<div class="tool"><button title="Publish your writing" id="publish" style="font-weight: bold">Post</button></div> | <div class="tool"><button title="Publish your writing" id="publish" style="font-weight: bold">Post</button></div> | ||||
@@ -62,7 +62,7 @@ | |||||
</ul></nav> | </ul></nav> | ||||
<span id="wc" class="hidden if-room room-4">0 words</span> | <span id="wc" class="hidden if-room room-4">0 words</span> | ||||
</div> | </div> | ||||
<noscript style="margin-left: 2em;"><strong>NOTE</strong>: for now, you'll need Javascript enabled to post.</noscript> | |||||
<noscript style="margin-left: 2em;"><strong>NOTE</strong>: for now, you'll need JavaScript enabled to post.</noscript> | |||||
<div id="belt"> | <div id="belt"> | ||||
{{if .Editing}}<div class="tool hidden if-room"><a href="{{if .EditCollection}}{{.EditCollection.CanonicalURL}}{{.Post.Slug}}/edit/meta{{else}}/{{if .SingleUser}}d/{{end}}{{.Post.Id}}/meta{{end}}" title="Edit post metadata" id="edit-meta"><img class="ic-24dp" src="/img/ic_info_dark@2x.png" /></a></div>{{end}} | {{if .Editing}}<div class="tool hidden if-room"><a href="{{if .EditCollection}}{{.EditCollection.CanonicalURL}}{{.Post.Slug}}/edit/meta{{else}}/{{if .SingleUser}}d/{{end}}{{.Post.Id}}/meta{{end}}" title="Edit post metadata" id="edit-meta"><img class="ic-24dp" src="/img/ic_info_dark@2x.png" /></a></div>{{end}} | ||||
<div class="tool hidden if-room room-2"><a href="#theme" title="Toggle theme" id="toggle-theme"><img class="ic-24dp" src="/img/ic_brightness_dark@2x.png" /></a></div> | <div class="tool hidden if-room room-2"><a href="#theme" title="Toggle theme" id="toggle-theme"><img class="ic-24dp" src="/img/ic_brightness_dark@2x.png" /></a></div> | ||||
@@ -1,4 +1,4 @@ | |||||
<!-- Miscelaneous render related template parts we use multiple times --> | |||||
<!-- Miscellaneous render related template parts we use multiple times --> | |||||
{{define "collection-meta"}} | {{define "collection-meta"}} | ||||
{{if .Monetization -}} | {{if .Monetization -}} | ||||
<meta name="monetization" content="{{.DisplayMonetization}}" /> | <meta name="monetization" content="{{.DisplayMonetization}}" /> | ||||
@@ -79,7 +79,7 @@ | |||||
jss.push(lurl); | jss.push(lurl); | ||||
} | } | ||||
} | } | ||||
// Load files in order, higlight on last load | |||||
// Load files in order, highlight on last load | |||||
loadLanguages(jss, () => {highlight(lb)}); | loadLanguages(jss, () => {highlight(lb)}); | ||||
} | } | ||||
}); | }); | ||||
@@ -57,7 +57,7 @@ | |||||
</ul></nav> | </ul></nav> | ||||
<span id="wc" class="hidden if-room room-4">0 words</span> | <span id="wc" class="hidden if-room room-4">0 words</span> | ||||
</div> | </div> | ||||
<noscript style="margin-left: 2em;"><strong>NOTE</strong>: for now, you'll need Javascript enabled to post.</noscript> | |||||
<noscript style="margin-left: 2em;"><strong>NOTE</strong>: for now, you'll need JavaScript enabled to post.</noscript> | |||||
<div id="belt"> | <div id="belt"> | ||||
{{if .Editing}}<div class="tool hidden if-room"><a href="{{if .EditCollection}}{{.EditCollection.CanonicalURL}}{{.Post.Slug}}/edit/meta{{else}}/{{if .SingleUser}}d/{{end}}{{.Post.Id}}/meta{{end}}" title="Edit post metadata" id="edit-meta"><img class="ic-24dp" src="/img/ic_info_dark@2x.png" /></a></div>{{end}} | {{if .Editing}}<div class="tool hidden if-room"><a href="{{if .EditCollection}}{{.EditCollection.CanonicalURL}}{{.Post.Slug}}/edit/meta{{else}}/{{if .SingleUser}}d/{{end}}{{.Post.Id}}/meta{{end}}" title="Edit post metadata" id="edit-meta"><img class="ic-24dp" src="/img/ic_info_dark@2x.png" /></a></div>{{end}} | ||||
<div class="tool hidden if-room room-2"><a href="#theme" title="Toggle theme" id="toggle-theme"><img class="ic-24dp" src="/img/ic_brightness_dark@2x.png" /></a></div> | <div class="tool hidden if-room room-2"><a href="#theme" title="Toggle theme" id="toggle-theme"><img class="ic-24dp" src="/img/ic_brightness_dark@2x.png" /></a></div> | ||||
@@ -4,7 +4,7 @@ | |||||
<div class="snug content-container"> | <div class="snug content-container"> | ||||
{{template "admin-header" .}} | {{template "admin-header" .}} | ||||
<!-- TODO: if other use for flashes use patern like account_import.go --> | |||||
<!-- TODO: if other use for flashes use pattern like account_import.go --> | |||||
{{if .Flashes}} | {{if .Flashes}} | ||||
<p class="alert success"> | <p class="alert success"> | ||||
{{range .Flashes}}{{.}}{{end}} | {{range .Flashes}}{{.}}{{end}} | ||||
@@ -45,7 +45,7 @@ input.copy-text { | |||||
{{if .NewPassword}}<div class="alert success"> | {{if .NewPassword}}<div class="alert success"> | ||||
<p>This user's password has been reset to:</p> | <p>This user's password has been reset to:</p> | ||||
<p><input type="text" class="copy-text" value="{{.NewPassword}}" onfocus="if (this.select) this.select(); else this.setSelectionRange(0, this.value.length);" readonly /></p> | <p><input type="text" class="copy-text" value="{{.NewPassword}}" onfocus="if (this.select) this.select(); else this.setSelectionRange(0, this.value.length);" readonly /></p> | ||||
<p>They can use this new password to log in to their account. <strong>This will only be shown once</strong>, so be sure to copy it and send it to them now.</p> | |||||
<p>They can use this new password to log into their account. <strong>This will only be shown once</strong>, so be sure to copy it and send it to them now.</p> | |||||
{{if .ClearEmail}}<p>Their email address is: <a href="mailto:{{.ClearEmail}}">{{.ClearEmail}}</a></p>{{end}} | {{if .ClearEmail}}<p>Their email address is: <a href="mailto:{{.ClearEmail}}">{{.ClearEmail}}</a></p>{{end}} | ||||
</div> | </div> | ||||
{{end}} | {{end}} | ||||
@@ -55,7 +55,7 @@ h3 { font-weight: normal; } | |||||
<div class="option"> | <div class="option"> | ||||
<h3>Passphrase</h3> | <h3>Passphrase</h3> | ||||
<div class="section"> | <div class="section"> | ||||
{{if and (not .HasPass) (not .IsLogOut)}}<div class="alert info"><p>Add a passphrase to easily log in to your account.</p></div>{{end}} | |||||
{{if and (not .HasPass) (not .IsLogOut)}}<div class="alert info"><p>Add a passphrase to easily log into your account.</p></div>{{end}} | |||||
{{if .HasPass}}<p>Current passphrase</p> | {{if .HasPass}}<p>Current passphrase</p> | ||||
<input type="password" name="current-pass" placeholder="Current passphrase" tabindex="1" /> <input class="show" type="checkbox" id="show-cur-pass" /><label for="show-cur-pass"> Show</label> | <input type="password" name="current-pass" placeholder="Current passphrase" tabindex="1" /> <input class="show" type="checkbox" id="show-cur-pass" /><label for="show-cur-pass"> Show</label> | ||||
<p>New passphrase</p> | <p>New passphrase</p> | ||||