Commit Graph

361 Commits

Author SHA1 Message Date
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 f8de8f7f21 Merge branch 'librarization' of github.com:writeas/writefreely into librarization 2019-06-13 13:48:05 -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
Matt Baer 23acabaeb3 Use db.isDuplicateKeyErr() in activitypub.go
(instead of writing out the logic of that helper function)

Ref T613
2019-06-13 13:47:37 -04:00
Matt Baer 758269e3d8 Move key generation and Keychain to key pkg
Ref T613
2019-06-13 13:47:28 -04:00
Matt Baer 584fe4fb93 Support changing default landing path
This adds a new `landing` value in the [app] section of config.ini.
If non-empty, unauthenticated users on multi-user instances will be
redirected to the path given there.

This closes T574
2019-06-13 13:47:27 -04:00
Matt Baer cf1d2d30e9 Merge branch 'agd' into librarization 2019-05-23 08:26:52 -04:00
Matt Baer c95ee0abe1 Support changing default landing path
This adds a new `landing` value in the [app] section of config.ini.
If non-empty, unauthenticated users on multi-user instances will be
redirected to the path given there.

This closes T574
2019-05-12 20:11:53 -04:00
Matt Baer 77c8152786 Break up CreateUser credentials into two args
Now the func takes a username and password instead of a single string.
2019-05-12 18:42:57 -04:00
Matt Baer 9e43b04f04 Make Keychain struct public 2019-05-12 17:20:24 -04:00
Matt Baer d8937e89a8 Make App struct public 2019-05-12 17:19:38 -04:00
Matt Baer 9023d4eb3f Move flag parsing to main package
This exposes setup and admin functions in the writefreely package, and
uses them in the main application, initialized by the flag parsing that
now happens there.

This is the first step towards making `writefreely` usable as a
standalone package.
2019-05-10 11:40:35 -04:00
Matt Baer 788713116f
Merge pull request #99 from gytisrepecka/master
Added /bin/lessc path to be compatible with CentOS 7
2019-05-02 10:01:28 -04:00
Gytis Repečka 6da10f28ac
Modified less/Makefile: added /bin/lessc path which is returned by which lessc in CentOS 7 when lessc is installed via npm. 2019-05-02 12:07:01 +03:00
Matt Baer 601fc5d93e
Merge pull request #97 from dariusk/master
Tweak Makefile for MacOS
2019-04-30 15:33:57 -04:00
Darius Kazemi 91a181f628 Adding another possible path for lessc to Makefile 2019-04-30 10:40:00 -07:00
Matt Baer fdbefa806f
Merge pull request #95 from TeDomum/master
Fix the build in Docker after enabling go modules
2019-04-19 09:01:44 -04:00
kaiyou 70f754e8af Install the writefreely cmd properly 2019-04-19 13:05:01 +02:00
kaiyou 402e9e822c Fix the build in Docker after enabling go modules
Enabling go modules requires that GO111MODULE is set, so
we set it as an environment variable in the Dockerfile.

Also, go-bindata is meant to be installed globally, so we
force the install before enabling Go modules. Also, we update
Go to 1.12 to fix a couple module builds.
2019-04-19 12:55:54 +02:00
Matt Baer 7a07e1009b Include -config and -init-db steps in make install
This also moves development instructions to documentation repo.
2019-04-16 11:27:27 -04:00
Matt Baer 771c7acf5f Run migrations on db initialization
This makes it so we can keep all schema changes in the `migrations`
module, instead of adding them there *and* in the schema files. It
fixes #92 and should prevent these kinds of issues in the future.
2019-04-15 13:48:19 -04:00
Matt Baer c08484aa9c Fix excessive p spacing in blockquotes 2019-04-13 12:04:17 -04:00
Matt Baer e80f99a72e Fix draft post metadata
Previously it referenced an image on write.as and had the incorrect
og:url property. This also fixes the canonical URL on single-user
instances. Closes #91
2019-04-12 14:56:46 -04:00
Matt Baer 1dc93c076d Revert "Support new commentsEnabled property"
This reverts commit 5e7da6678d.

There are better standards in progress like a `capabilities` object:
https://litepub.social/litepub/lice.html
2019-04-11 22:04:51 -04:00
Matt Baer 831209f4b6 Merge branch 'develop' 2019-04-11 22:03:16 -04:00
Matt Baer 1f973464bc Merge branch 'master' of github.com:writeas/writefreely 2019-04-11 22:03:03 -04:00
Matt Baer 238a913ce3 Make WriteFreely spacing consistent 2019-04-11 21:33:33 -04:00
Matt Baer 63a2225b7f Add admin dashboard link to dropdown navs 2019-04-11 21:11:30 -04:00
Matt Baer af0f6302a2 Replace --reset-pass instructions with admin guide link 2019-04-11 21:10:45 -04:00
Matt Baer 7ab5350a94 Bump version to 0.9.0 2019-04-11 21:04:48 -04:00
Matt Baer 51ac06a51b Move Docker instructions to writefreely/documentation 2019-04-11 20:44:44 -04:00
Matt Baer 07ab0cdb9c Add `invites` flag in NodeInfo
This indicates whether or not invites are enabled on this instance. It
requires an upgrade to writefreely/go-nodeinfo v1.2.0
2019-04-11 20:37:01 -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 4cad074b44 Link to version-specific writer's guide 2019-04-11 13:52:10 -04:00
Matt Baer 24c56af6ee
Merge pull request #89 from writeas/comments-enabled
Support new commentsEnabled property
2019-04-07 12:34:14 -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 00ed2990eb Do Travis builds without sqlite
Using xgo comes with its own gomod-related issues. So let's see if this
fixes the build issue mentioned in the previous commit.
2019-04-06 11:46:27 -04:00
Matt Baer c7a4955840 Do CI compile with xgo
This will hopefully fix Travis errors:

/home/travis/.gimme/versions/go1.11.7.linux.amd64/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: /tmp/go-link-810454258/000020.o: unrecognized relocation (0x2a) in section `.text'
/usr/bin/ld: final link failed: Bad value
2019-04-06 11:28:43 -04:00
Matt Baer 09fb73bdd5 Standardize admin navigation 2019-04-06 11:15:14 -04:00
Matt Baer 45b01c041b Don't install packages in make deps
This fixes an error: undefined: Asset
2019-04-06 10:50:22 -04:00
Matt Baer 8a9ef513fa Fix go-bindata error in Travis build
Based on @sheenobu's work on #58
2019-04-06 10:45:19 -04:00
Matt Baer 24b193df96 Bump Travis Go version to 1.11 2019-04-06 10:22:42 -04:00
Matt Baer 4af9fa66aa Don't federate scheduled posts upon claiming
Previously, moving an anonymous post to a blog would instantly federate
the post, regardless of its `created` date. This now respects that value
and doesn't federate the post if its `created` date is in the future.

This is the first part of supporting scheduled, federated posts (ref T567)
but technically fixes #76.
2019-04-05 18:50:18 -04:00
Matt Baer 5e7da6678d Support new commentsEnabled property
This is a field previously supported by PeerTube, and just recently
added on PixelFed, that should inform other ActivityPub services whether
or not comments are enabled on any given post. WriteFreely doesn't
support comments today, so this will always be false.
2019-04-04 17:03:54 -04:00
Matt Baer 5a0a3ce451
Merge pull request #78 from mrvdb/apple-icons
Add touch icons
2019-03-24 17:42:56 -05:00
Matt Baer be0df11653 Use WF "w" for touch icons
(instead of the Write.as "w")
2019-03-24 17:38:46 -05:00
Matt Baer b7d07e2037 Automatically assign "bug?" label to bug reports 2019-03-14 09:43:48 -04:00
Matt Baer 54edb2562d Strip HTML from post summary
This removes HTML, in addition to the Markdown stripping that was
already happening.

This fixes #83
2019-03-14 08:59:59 -04:00
Matt Baer 2f683e783e
Merge pull request #81 from mrvdb/codehighlight
Resolve an edge case where last language has error
2019-03-06 14:22:53 -05:00