- Move the build and application information to the internal info
package.
- Move the user agent and redirect URI string to the internal client
package.
Summary:
If the user hasn't supplied the path to a configuration directory and
Enbas fails to find the user's default home configuration directory,
Enbas will now return an error message back to the user. Previously
Enbas would try to, instead, calculate the configuration directory
using the user's current directory.
Changes:
- Return an error if the user's home configuration directory cannot
be found.
- Add tests to the internal.config package.
- Update the tests in internal.utilities package.
PR: #54
Changes:
- Fixed the issue where the instance's FQDN was not included in the
cache directories' path when the user sets a custom path to the root
cache directory.
- Added unit tests for the cache directory calculations.
- Updated REUSE.toml to fix compliance failures.
- Added small changes/fixes based on feedback from golangci-lint.
PR: #53
Resolves: #51
- Created generic Error types to remove the need to import the errors
package.
- Used the generic Error types in place of the single use custom Error
types that have no fields.
- Created new Error types where necessary.
PR: #50
This commit adds support for deleting statuses.
Before sending the delete request to the instance, Enbas will first
verify that the status that the user wants to delete actually belongs to
them.
The user has the option to save the text of the deleted status. This
will be written to a text file within the cache directory.
PR: #48
Resolves: #44
This commit adds more support for interacting with media attachments.
Now users can:
- Upload media to their instances and create media attachments.
- Edit existing media attachments.
- Attach one or more existing media to a new status.
- Upload and attach one or more media files to a new status.
PR: apollo/enbas#42Resolves: apollo/enbas#29
Updated the ReadFile function in 'utilities' by using the Scanner from
the bufio package to read lines from a text file. The trailing empty
line is stripped after scanning and before returning back to the caller.
Improve how ordered and unordered lists are displayed within the
contents of a status by adding indentation when a list item is wrapped.
Changes:
- fix: improve how ordered and unordered lists are displayed in status
and status list views.
- fix: improve how media attachments are displayed in status list views.
- refactor: move the line wrapping and HTML converting functions from
utilities to the internal printer package.
- refactor: the convertHTMLToText now (optionally) applies line
wrapping after conversion.
When creating the configuration file during the initialisation process
calculate the absolute path to the credentials file instead of the
relative path.
Use the browser specified in the configuration file to open URLs. If the
browser is not specified the link will not be opened and an error is
returned to the user in most cases. This replaces the use of the BROWSER
environment variable and the xdg-open command (on linux).
SUMMARY
This commit adds configuration support to enbas. The configuration is
stored as a JSON file in the user specified configuration directory.
When using enbas for the first time, the user will first need to
execute the new init command in order to generate the configuration.
Once this has been generated the user can edit the settings to
personalise their experience, login to their account and use enbas as
normal.
For now the configurable settings included in the configuration
are as follows:
- The path to the credentials file (by default this is set to a file in
the same directory as the configuration file).
- The path to the cache directory.
- The character limit used for line wrapping.
- The programs used for integrations such as paging, media viewing,
opening URLs, etc.
CHANGES
- added the new config type.
- added the new init executor for generating a new configuration file.
- removed the following top level flags in favour of the new
configration support.
- cache-dir
- pager
- image-viewer
- video-player
- max-terminal-width
- added a new error type for use when an unknown media attachment ID
is specified.
- updated the usage function for the executors to support a case
where a flagsets has no flags.
- update .golangci.yaml to disable some linters
This commit adds integration to external image viewers and video players
to allow users to view image and video attachments.
Enbas creates a cache directory where the media is downloaded to before
opening the external program for viewing.
Users can view one or more media attachments from a single status.
Add a new internal printer package for printing resources to the screen
or pager.
With the new printer in place, most of the settings such as the pager
command, colour theme, whether or not colour output is disabled, etc
are defined in one place which saves us the trouble of passing an
increasing number of parameters to an increasing number of Display
methods throughout the code base.
The old Displayer interface and associated Display methods in the
model package are removed as this is now handled by the printer.
The format functions in the utilities package has essentially been
rewritten as methods to the Printer type.
Additional changes:
- All indentation when displaying information about resources (e.g.
statuses, instance, accounts) are removed.
- The application's build information now has colour output.
Add the FullDisplayNameFormat as a replacement for DisplayNameFormat for
displaying the full display name. It uses the builder from the strings
package to reduce the use of fmt.Sprintf.
Changes:
- Move InvalidListRepliesPolicyError, InvalidTimelineCategory,
InvalidStatusVisibility and InvalidStatusContentTypeError type to the
model package.
- Clean up some code in regards to the parsing of the Enum types.
- Clean up the error messages sent back to the user.
- Use colons instead of semicolons when unwrapping error messages.
- Print errors to Standard Error (os.Stderr)
Add support for disabling ANSI colour output via the --no-color flag
or the NO_COLOR environment variable. The suggested implementation was
inspired by the standards defined at no-color.org
Allow users to post a status from a file using the --from-file flag.
If both --content and --from-file flags are used then the --content
flag takes precedence.
Add support for opening links for accounts and statuses in a user's
favourite web browser.
Changes:
- Add browser support if the BROWSER environment variable is set.
- Add support for viewing accounts in the browser.
- Add support for viewing statuses in the browser (if they are publicly
viewable)
The wrap line function breaks a line at the position of the last
white space before reaching the line limit, however sometimes a single
word (e.g. a very long url) exceeds the character limit itself which
threw the function into an infinite loop. This commit fixes that by
breaking said word at the last letter before the character limit is
reached.
This commit fixes the issue where the contents of a status is not shown
when displayed on screen. For statuses made in GTS the Text field is
populated with the plain text version of the content however this is
unfortunately not the case for Mastodon statuses, therefore the Content
field is used instead and the contents is processed with StripHTMLTags
function to remove the HTML tags before printing.
This commit refactors the login flow to a GTS server thanks to an update
in the official GTS documentation.
golang.org/x/oauth2 is no longer needed.
Documentation reference:
- https://docs.gotosocial.org/en/latest/api/authentication/