Commit Graph

55 Commits

Author SHA1 Message Date
Matt Baer 2768ea9414 Make Monetization optional
Some WriteFreely instances are completely private, and thus have no need for public-
oriented features like Web Monetization. Like federation, this gives admins control
over whether or not the feature is enabled for users.

Ref T773
2020-09-30 15:18:21 -04:00
Matt Baer f903388a28 Fix admin nav rendering on user viewing 2020-02-25 15:03:29 -05:00
Matt Baer 9fe528bf47 Fix admin nav rendering on page editing 2020-02-25 15:01:24 -05:00
Matt Baer 303144fd24 Fix 500 when update checks disabled
Ref T572
2020-02-25 15:00:58 -05:00
Matt Baer 37b7755c08 Tell admin that automated check failed when necessary
This keeps track when automated update check fails, and displays a
relevant message to the admin on /admin/updates

Ref T572
2020-02-15 12:56:33 -05:00
Matt Baer c2ece926e0 Show update notification in admin nav bar
When a WriteFreely update is available, indicate this on the "Updates"
navigation item

Ref T572
2020-02-15 12:53:47 -05:00
Matt Baer 389dc8b9db Show functional Updates page when checks are disabled
Ref T572
2020-02-15 12:19:06 -05:00
Matt Baer a06bb457de Change copy and design on WF Updates page
- Tweak the copy
- Include link to download latest release
- Change the version status design a bit
- Restyle some text
2020-02-15 11:59:47 -05:00
Matt Baer 48ca695c46 Show last update check time in local timezone 2020-02-15 11:57:55 -05:00
Matt Baer 0d79057bae Rename ReleaseURL() to ReleaseNotesURL() 2020-02-14 16:13:54 -05:00
Matt Baer 84ab41697b Merge branch 'develop' into admin-dashboard-redesign 2020-02-14 14:50:23 -05:00
Matt Baer 8364dce398 Merge branch 'develop' into T572-check-updates 2020-02-14 14:27:22 -05:00
Matt Baer 92da069ce4 Move admin dashboard sections into subpages
This moves app config to a "Settings" page and the application monitor
to a "Monitor" page. It also reworks the admin navigation bar a bit and
adds some instance stats on the dashboard.

Ref T694
2020-02-14 13:55:24 -05:00
Matt Baer 468bbf2187 Merge branch 'develop' into rename-account-suspend 2020-02-09 11:14:14 -05:00
Matt Baer 666bd1b9d1 Show correct error when user not found in admin panel
Previously, it would show a 500. This also logs the real reason if it's
not a "not found" error
2020-02-08 14:46:05 -05:00
Nick Gerakines 7a0863f71b Added oauth handlers and tests with mocks. Part of T705. 2019-12-19 11:51:19 -05:00
Rob Loranger 7e014ca659
Rename Suspend status to Silence
This changes all variables and functions from using Suspend{ed} to using
Silence{d} as well as documentation, errors and logging.
2019-11-11 15:25:19 -08:00
Matt Baer 53586d9cb8 Merge branch 'develop' into T661-disable-accounts 2019-11-12 01:46:37 +09:00
Matt Baer 7f96e8c384 Rename UserSuspended to UserSilenced
Some of the work needed to have the backend match user-facing wording.

Ref T661
2019-11-12 00:41:25 +09:00
Matt Baer f7550a0da8 Change more suspension check logic
From u.Status == UserSuspended to u.IsSuspended()

Ref T661
2019-11-12 00:04:36 +09:00
Matt Baer a9b5bb2f6b Fix reset user's email address display
Previously, this had bad template logic and showed the wrong email address.

Ref T695
2019-11-11 21:40:49 +09:00
Matt Baer 422c16f39a Tweak admin user pass reset success copy
This also adjusts the style and includes the user's password, so the
admin can easily notify them.

Ref T695
2019-11-11 18:03:19 +09:00
Matt Baer f673f9b562 Reset password to sorta-sensical string
This resets user password to something random that also reminds the user
they should change it immediately after logging in, instead of a
completely random jumble of characters.

Ref T695
2019-11-11 18:01:08 +09:00
Matt Baer 6d4ec0b17d Remove extra OwnUserPage field
Move logic into template, rather than add another field to the page.

Ref T695
2019-11-11 16:06:03 +09:00
Matt Baer 38f3eec8e0 Merge branch 'develop' into T572-check-updates 2019-11-11 15:45:47 +09:00
Rob Loranger f85f0751a3
address PR comments
- update error messages to be correct
- move suspended message into template and include for other pages
- check suspended status on all relevant pages and show message if
logged in user is suspended.
- fix possible nil pointer error
- remove changes to db schema files
- add version comment to migration
- add UserStatus type with UserActive and UserSuspended
- change database table to use status column instead of suspended
- update toggle suspended handler to be toggle status in prep for
possible future inclusion of further user statuses
2019-10-25 12:04:24 -07:00
Matt Baer 9873fc443f Merge branch 'develop' into T661-disable-accounts 2019-10-24 13:22:26 -04:00
Rob Loranger aa9efc7b37
allow admin to reset user passwords
this adds a new button when viewing a user as an admin, that will
generate and store a new password for the user
2019-10-03 13:53:04 -07:00
Rob Loranger 0286dcf214
move tool from gogs into appstats pkg 2019-09-13 08:22:38 -07:00
Rob Loranger feba200916
remove gogs/gogs/pkg/tool dependency
this borrows some code from github.com/gogs/gogs/pkg/tool to avoid
pulling it in as a dependency, along with many other indirect deps.
2019-09-11 12:50:04 -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
Rob Loranger 77f7b4a522
Add account suspension features
This renders all requests for that user's posts, collections and related
ActivityPub endpoints with 404 responses.

While suspended, users may not create or edit posts or collections.

User status is listed in the admin user page

Admin view of user details shows status and now has a button to activate
or suspend a user.
2019-08-29 09:09:11 -07:00
Rob Loranger ca957c4b6d
fix missing collection hostname
GetCollections and GetPublishableCollections now take a hostname
parameter to allow setting the collecion hostname.

All collections used in memory now have their hostname set.
2019-08-12 12:35:17 -07:00
Matt Baer 7b42efb9d9 Enable customizing Reader page
This makes it possible to edit the title and introductory text at the
top of the Reader view.

Ref T684
2019-08-09 11:16:38 -04:00
Matt Baer 569bc792d0 Enable changing default_visibility from Admin dash
Ref T675
2019-07-31 22:20:00 -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 161f7a8de2 Support changing landing conf val from Admin UI
Closes T651
2019-06-16 17:38:34 -04:00
Matt Baer 26a0990014 Save config via Apper interface from Admin dash
Ref T613
2019-06-13 21:56:13 -04:00
Matt Baer d8937e89a8 Make App struct public 2019-05-12 17:19:38 -04:00
Matt Baer 9cb0f80921 Support changing instance page titles
Now admins can choose a title for their About and Privacy pages; now
editable through the instance page editor.

This adds `title` and `content_type` fields to the `appcontent` table,
requiring a migration by running `writefreely --migrate`

The content_type field specifies that items we're currently storing in
this table are all "page"s; queries for fetching these have been updated
to filter for this type. In the future, this field will be used to
indicate when an item is a stylesheet (ref T563) or other supported
type.

Ref T566
2019-04-11 13:56:07 -04:00
Matt Baer a850fa14cd Move instance page editing to dedicated section
This adds a "Pages" section to the admin part of the site, and enables
admins to edit the pre-defined About and Privacy pages there, instead of
on the dashboard itself.

It also restructures how these pages get sent around in the backend and
lays the groundwork for dynamically adding static pages. The backend
changes were made with more customization in mind, such as an
instance-wide custom stylesheet (T563).

Ref T566
2019-04-06 13:23:22 -04:00
Matt Baer 70e823d6ab Support user invites
This includes:

- A new `user_invites` config value that determines who can generate
  invite links
- A new page for generating invite links, with new user navigation link
- A new /invite/ path that allows anyone to sign up via unique invite
  link, even if registrations are closed
- Tracking who (of registered users) has been invited by whom

It requires an updated database with `writefreely --migrate` in order to
work.

This closes T556
2019-01-18 00:05:50 -05:00
Matt Baer bf7d422039 Add pager to admin user list
This enables paging through the entire list of users.

Ref T553
2019-01-05 09:37:53 -05:00
Matt Baer 0e722de82c Add admin user list
This enables admins on multi-user instances to see all users registered,
and view the details of each, including:

- Username
- Join date
- Total posts
- Last post date
- All blogs
  - Public info
  - Views
  - Total posts
  - Last post date
  - Fediverse followers count

This is the foundation for future user moderation features.

Ref T553
2019-01-04 22:28:29 -05:00
Matt Baer 3ae45bc156 Fix spacing around copyright notices 2018-12-31 01:05:26 -05:00
Matt Baer 1274914207 Add copyright / license notices to .go files 2018-12-24 12:45:15 -05:00
Matt Baer 25a68d0c0e Add Reader section
This adds a "Reader" section of the site for admins who want to enable
it for their instance. That means visitors can go to /read and see who
has publicly shared their writing. They can also follow all public posts
via RSS by going to /read/feed/. Writers on an instance with this
`local_timeline` setting enabled can publish to the timeline by going
into their blog settings and choosing the "Public" visibility setting.

The `local_timeline` feature is disabled by default, as is the Public
setting on writer blogs. Enabling it adds a "Reader" navigation item and
enables the reader endpoints. This feature will also consume more
memory, as public posts are cached in memory for 10 minutes.

These changes include code ported over from Read.Write.as, and thus
include some experimental features like filtering public posts by tags
and authors. These features aren't well-tested or complete.

Closes T554
2018-12-10 16:08:07 -05:00
Matt Baer 111945bc5d Add new -c [filename] option for supplying config file
This allows users to load a different configuration file instead of the
default config.ini. It works in combination with other configuration
actions, like --config and --create-config.
2018-12-08 17:49:19 -05:00