Commit Graph

407 Commits

Author SHA1 Message Date
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 aeab30db8a Fix #96
This solves the error 500 on the /api/me endpoint.

Replace token search query `=` with `LIKE` to fix sqlite complaining about
no valid tokens. Also checked with MySQL and it still works after the change.
2019-06-21 10:48:40 +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 161f7a8de2 Support changing landing conf val from Admin UI
Closes T651
2019-06-16 17:38:34 -04:00
Matt Baer 2b8b52285d
Merge pull request #122 from writeas/update-script
Update script

Closes T555
2019-06-14 20:36:07 -04:00
Rob Loranger 075f25b829
fix: update script: non-standard version numbers
store version output in new variable
slice output indexed from beginning instead of end. allowing for custom
build version numbers.

also fix weird spacing from tabs being two spaces wide, sorry :)
2019-06-14 17:26:56 -07:00
Matt Baer 872ec4809b Tweak status wording
And fix a typo

Ref T555
2019-06-14 19:50:41 -04:00
Matt Baer ac7d727435
Merge pull request #102 from writeas/librarization
Decouple writefreely library from executable

Ref T613
2019-06-14 19:25:24 -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 4c34b34736 Exit when no writefreely executable found
(or `writefreely -v` otherwise doesn't output anything)

Ref T555
2019-06-14 16:43:18 -04:00
Rob Loranger f6ba1fc9c8
update script: error check restarting service
basic error check with descriptive output in update_server.sh
2019-06-14 10:05:08 -07:00
Rob Loranger 0c44fe1c2e
add update script
this bash script will download a new version, if any, and exrtact it to
a temporary location. Then copy the new files to the current directory
and restart the systemd service.
2019-06-14 09:55:31 -07:00
Matt Baer 26a0990014 Save config via Apper interface from Admin dash
Ref T613
2019-06-13 21:56:13 -04:00
Matt Baer d5c2fe47da
Merge branch 'develop' into librarization 2019-06-13 20:44:55 -04:00
Matt Baer 830b859421 Fix activitypub.go imports 2019-06-13 20:44:13 -04:00
Matt Baer a10a4e9a28 Merge branch 'develop' into librarization 2019-06-13 20:39:52 -04:00
Matt Baer be0547a62c Include schema.sql when built with wflib tag
This ensures outside application builds will succeed when including the
writefreely pkg.

Ref T613
2019-06-13 20:25:30 -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 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
Michael Demetriou 9570388d1d Fix #96
This solves the error 500 on the /api/me endpoint.

Replace token search query `=` with `LIKE` to fix sqlite complaining about
no valid tokens. Also checked with MySQL and it still works after the change.
2019-06-11 20:18:58 +03:00
Matt Baer b2a9429db0
Merge pull request #117 from writeas/T612
change delete post authentication logic
2019-06-05 16:18:08 -04:00
Rob Loranger d58c142467
change delete post authentication logic
this reorders the logic for checking authentication on post deletes to
first check for a provided edit token and after check for an access
token or auth'd user.
2019-06-05 09:39:22 -07:00
Matt Baer c87b7ab39e
Merge pull request #111 from writeas/gh100
support pubgate
2019-06-03 16:37:36 -04:00
Rob Loranger 08799b220b
revert accidental .vscode folder inclusion 2019-06-03 11:55:42 -07:00
Rob Loranger d8fa85432d
fix for Pubgate user not having SharedInbox 2019-06-03 11:53:17 -07:00
Rob Loranger 702db2bf75
Merge branch 'gh100' of github.com:writeas/writefreely into gh100 2019-06-03 11:52:44 -07:00
Matt Baer 73f627a6c2
Merge pull request #110 from writeas/fix-rtl
Enable un-setting RTL setting via web
2019-06-02 13:19:32 -04:00
Matt Baer f82e11b3b3
Merge pull request #115 from writeas/blog-index-titles
Make post body h2's smaller on index pages
2019-06-01 12:16:36 -04:00
Matt Baer 6bf4e1a52e Add spacing around time element on index pages
This adds a small margin around a time element, which makes things look
better when the body of a post starts with a header.
2019-06-01 09:26:58 -04:00
Matt Baer 4b1ca3e296 Make post body h2's smaller on index pages
Previously, <h2>s in a post were the exact same size as post titles on
index pages (blog index, tag listing). This fixes that by reducing the
font-size of body h2's. Closes #82.
2019-06-01 09:17:28 -04:00
Matt Baer 68bd5ef01a
Merge pull request #114 from writeas/export-title
Include post title in zip export txt files
2019-05-31 09:26:20 -04:00
Matt Baer cba7f1223e Include post title in zip export txt files 2019-05-30 10:38:55 -04:00
Matt Baer cf51fc4886
Merge pull request #113 from writeas/fix-json-export-2
Modify GetPost() to allow inclusion of pinned posts
2019-05-29 12:18:04 -04:00
Noëlle Anthony f271e53925 Update GetPosts() docstring 2019-05-29 12:03:01 -04:00
Noëlle Anthony 95e84a1d0e Change GetPosts() to have includePinned parameter, change all calls to match 2019-05-28 14:54:56 -04:00
Rob Loranger 95215aa39d
fixes issue #100 - can't follow from pubgate
this moves the unmarshaling of a remote actor out into a new helper which
accounts for the possibility of a context being a list or a single entity.
i.e. a string or an object.

basics tests are provided for both situations

also go fmt'd the file activitypub.go
2019-05-24 19:38:35 -07:00
Matt Baer cf1d2d30e9 Merge branch 'agd' into librarization 2019-05-23 08:26:52 -04:00
Rob Loranger ff2d3fc3d5
fixes issue #100 - can't follow from pubgate
this moves the unmarshaling of a remote actor out into a new helper which
accounts for the possibility of a context being a list or a single entity.
i.e. a string or an object.

basics tests are provided for both situations

also go fmt'd the file activitypub.go
2019-05-21 07:02:35 -07:00
Rob Loranger 3986c8eec1
add missing string variable in log statement in export.go + go fmt 2019-05-20 14:51:54 -07:00
Matt Baer b6da5d9711
Merge pull request #107 from writeas/go-bindata-as-dep
Add go-bindata as a module dependency
2019-05-20 14:18:36 -04:00
Matt Baer b9b41b1ef7 Enable un-setting RTL setting via web
Previously, once RTL was enabled on a post, you couldn't unset it via
the web application. This fixes that. (Fixes #103)
2019-05-18 23:16:42 -04:00
Rob Loranger 6ff136455c
Add go-bindata as a module dependency
This adds https://github.com/jteeuwen/go-bindata as a module dependency
as the make target 'build' will result in it's addition.
2019-05-17 16:22:44 -07:00