Commit Graph

142 Commits

Author SHA1 Message Date
Matt Baer 151ec71163 Land on login form for private instances 2020-03-02 16:32:04 -06:00
Matt Baer 8364dce398 Merge branch 'develop' into T572-check-updates 2020-02-14 14:27:22 -05:00
Matt Baer 9d360f0e41 Merge branch 'develop' into T319-delete-account 2020-02-08 13:42:46 -05:00
Nick Gerakines 7a0863f71b Added oauth handlers and tests with mocks. Part of T705. 2019-12-19 11:51:19 -05:00
Matt Baer 342c3cde89 Bump version to 0.11.2 2019-11-26 13:15:31 -05:00
Matt Baer 278e4f6242 Bump version to 0.11.1 2019-11-12 16:53:52 +09:00
Matt Baer 8f24da94a6 Bump version to 0.11.0 2019-11-12 00:47:49 +09:00
Matt Baer 38f3eec8e0 Merge branch 'develop' into T572-check-updates 2019-11-11 15:45:47 +09:00
Rob Loranger b83af955c3
remove wrapper over db.DeleteAccount 2019-11-05 12:20:07 -08:00
Rob Loranger 41166e5c35
CLI delete account by username and delete posts
this changed the CLI flag to use the username instead of the userID
leaving the underlying database function as is.

also now posts are all deleted with no option to skip as this is likely
never needed.
2019-11-05 09:14:20 -08:00
Rob Loranger c87ca11a52
add account deletion
CLI only but backend supports calls from app.db.DeleteAccount already

takes --delete-account user_id_number with optional --posts to also
delete posts. if --posts is omitted all user posts will be updated to
anonymous posts
2019-10-31 15:20:18 -07:00
Matt Baer ca388d6536 Merge branch 'develop' into chorus 2019-09-09 17:26:40 +02:00
Rob Loranger eae4097677
add update checks
includes cache of latest version and page to view if updates are
available with a link to the latest update's release notes and a link to
check for the latest update now, refreshing the cache manually.
2019-08-29 15:30:27 -07:00
Daniel Watkins 7a53af355e
Emit the server software and version to the log on startup 2019-08-11 09:53:33 -04:00
Matt Baer d8405680b4 Respect `private` setting with home page Reader
Ref T681
2019-08-09 14:57:09 -04:00
Matt Baer f821dbaac4 Support dedicated signup page in chorus mode
This adds a Sign Up link to site navigation and shows the
otherwise-landing page on /signup when in chorus mode.

Ref T681
2019-08-09 12:00:46 -04:00
Matt Baer 006b7a86ea Show Reader on home route in chorus mode
Ref T681
2019-08-09 11:32:53 -04:00
Matt Baer deec914ccb Merge branch 'develop' into chorus 2019-08-08 07:55:49 -04:00
Matt Baer adfcc82241
Merge pull request #148 from writeas/default-visibility
Support setting default blog visibility on instance

Resolves T675
2019-08-07 17:44:37 -04:00
Matt Baer df078c569d Accept config.Config in datastore.CreateUser()
instead of App

Ref T675
2019-08-07 16:19:35 -04:00
Matt Baer 3cc397ad76 Merge branch 'develop' into chorus 2019-08-07 10:58:34 -04:00
Matt Baer ff7828c558 Link hashtags to Reader when Chorus mode enabled
instead of linking to posts only on a user's blog.

Ref T681
2019-08-07 09:40:07 -04:00
Matt Baer 1a80cd3c02 Add site-wide navigation on colls when chorus = true
This adds a new config value: `chorus` that signifies an instance is
more about the Reader view than individual blogs / writers. When
enabled, user navigation will show on all pages, including About,
Reader, and Privacy (ref T680).

It also uses different collection templates that keep the instance-wide
navigation at the top of the page, instead of the author's name --
again, branded more for the collective than the individual.

Ref T681
2019-08-07 09:00:16 -04:00
Matt Baer d752d29b4b
Merge pull request #151 from writeas/custom-logging
Let Apper set request log format
2019-08-05 10:58:43 -04:00
Matt Baer 81847fbbcc Land on Blogs page when SimpleNav is enabled
This shows the Blogs page instead of the Editor to logged in users on
the `/` path when the new `simple_nav` config option is enabled.

Ref T680
2019-08-05 09:27:51 -04:00
Matt Baer 5953a50f4a Let Apper set request log format
This adds a new ReqLog() func to the Apper interface that'll return the
log message for incoming requests.

Ref T649
2019-08-01 16:12:22 -04:00
Matt Baer a75b45f060 Support configuring default collection visibility
This adds a new `default_visibility` config value that lets an instance
admin set the visibility of newly created collections.

Ref T675
2019-07-31 22:18:40 -04:00
Matt Baer 3346e735d3 Fix autocert insecure server redirect
This fixes certificate validation, while keeping HTTP -> HTTPS
redirection.

Ref T542
2019-07-20 21:38:02 -04:00
Matt Baer 42386beabc Fix autocert HostPolicy
Previously, this would pass in the instance's full (and invalid) URL.
Now it passes only the host name.

Ref T542
2019-07-20 21:37:27 -04:00
Matt Baer 36fb7ecb2b Support automatically generated certificates
This adds a new config option in the `[server]` section: `autocert`.
When true, WF will automatically generate certificates instead of using
ones from the provided cert path. However, all generated certificates
will be stored in the configured `tls_cert_path`.

Ref T542
2019-07-20 20:49:20 -04:00
Matt Baer 3b079810bb Accept Apper in writefreely.ResetPassword()
instead of *App
2019-07-03 14:39:43 -04:00
Matt Baer 79cf6ce0eb Accept Apper in writefreely.Migrate()
instead of *App
2019-07-03 14:39:05 -04:00
Matt Baer 7aaff778da
Merge pull request #123 from writeas/private-instance
Private instances

Resolves T576
2019-07-01 19:14:20 -04:00
Matt Baer 7240bf0cdc
Merge pull request #131 from writeas/customize-landing
Customize landing page

Resolves T565
2019-07-01 19:12:58 -04:00
Matt Baer 5757407994 Bump version to 0.10.0 2019-07-01 15:20:29 -04:00
Matt Baer 18bafadc43
Merge pull request #127 from writeas/shorter-config-process
Shorter config process
2019-07-01 14:15:41 -04:00
Matt Baer c3f3eb0a65 Rename getLandingPage -> getLandingBody
This makes the naming scheme more consistent with other funcs.

Ref T565
2019-06-27 22:22:21 -04:00
Matt Baer a72ce2ef29 Make landing page dynamic
This enables admins to customize their landing / home page via the Admin
dashboard -- including the text at the top of the page and the section
below it. It keeps the current default text, falling back to it if the
user hasn't overwritten it.

Ref T565
2019-06-27 17:06:37 -04:00
Matt Baer aedb05080c Support ?landing=1 to always show landing page
This supports admins previewing changes to the landing page.

Ref T565
2019-06-27 16:38:24 -04:00
Michael Demetriou 6506709fbc Merge branch 'develop' into shorter-config-process
Move flag parsing to main.go as per the issue description
2019-06-21 12:07:01 +03:00
Michael Demetriou efbef83362 make sure app exits after error in --sections argument 2019-06-21 10:40:40 +03:00
Michael Demetriou 07fe366c15 Fix T657: add --sections argument to allow partial configuration.
Use the split argument list (slice) just for validation purposes
as it's substantially easier to do `.contains` in a string instead
of a slice. As such, pass the `configSections` arguments to
`Configure()` and check the existence of each one before showing
the options to the user.

An empty argument list is replaced by "server db app" so everything
is there negating the need to check anything else in `Configure()`.
In the same vein the default is "server db app".

The parsing is done in `app.go` alongside the other flags instead
of `main.go` as described in T657.
2019-06-20 23:41:03 +03:00
Michael Demetriou 1d5c396327 Add --sections flag to app.go and pass it to setup.go
Add --sections flag to app.go according to T657, parse them
into a string array (check for invalid arguments and abort)
and pass them to Configure(). For now Configure() doesn't do
anything with them yet.
2019-06-20 23:14:36 +03:00
Matt Baer bbd775bcc6 Always initialize database after --config
Previously, this would only run when configuring an instance for
single-user usage. Now it'll also run when configuring for multi-user
usage.

It also adds a log when the database has already been initialized.
2019-06-20 09:04:52 -04:00
Matt Baer bf989eb696 Hide Reader link on private instance when unauth'd
Ref T576
2019-06-16 20:29:31 -04:00
Matt Baer 36b160b706 Add TODO for multierror 2019-06-14 19:12:14 -04:00
Matt Baer f38a135bfa Remove global hostName var
This moves `hostName` to the `Collection` struct, where it's needed. The
field is populated after successful `GetCollection...()` calls.

This isn't the cleanest way to do things, but it accomplishes the goal.
Eventually, we should accept the AppCfg to `GetCollection...()` calls,
or make them `App` methods, instead of `datastore` methods.

Ref T613
2019-06-14 18:54:04 -04:00
Matt Baer 034db22f8c Break functionality out of Serve() func
- Adds a new interface, Apper, that enables loading and persisting
  instance-level data in new ways
- Converts some initialization funcs to methods
- Exports funcs and methods needed for intialization
- In general, moves a ton of stuff around

Overall, this should maintain all existing functionality, but with the
ability to now better manage a WF instance.

Ref T613
2019-06-13 18:50:23 -04:00
Matt Baer ed4aacd1ac Move static file ServeMux to App struct 2019-06-13 18:45:03 -04:00
Matt Baer eb6349f93a Allow compiling without go-sql-driver/mysql pkg
This ensures the writefreely pkg can be used in other applications that
need to load mysql themselves -- this can be done by building with the
tag: wflib

Ref T613
2019-06-13 13:47:27 -04:00