1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-22 13:12:41 +00:00

Fill out most of the manual page

Removed most of the online help as a consequence since maintaining
both is frought
This commit is contained in:
J. King 2021-05-29 21:48:02 -04:00
parent 88487d27a2
commit 62d49e0d3c
2 changed files with 158 additions and 218 deletions

View file

@ -13,223 +13,34 @@ use JKingWeb\Arsse\REST\Miniflux\Token as Miniflux;
class CLI { class CLI {
public const USAGE = <<<USAGE_TEXT public const USAGE = <<<USAGE_TEXT
Usage: Usage:
arsse.php daemon
arsse.php feed refresh-all
arsse.php feed refresh <n>
arsse.php conf save-defaults [<file>]
arsse.php user [list] arsse.php user [list]
arsse.php user add <username> [<password>] [--admin] arsse.php user add <username> [<password>] [--admin]
arsse.php user remove <username> arsse.php user remove <username>
arsse.php user show <username> arsse.php user show <username>
arsse.php user set <username> <property> <value> arsse.php user set <username> <property> <value>
arsse.php user unset <username> <property> arsse.php user unset <username> <property>
arsse.php user set-pass <username> [<password>] arsse.php user set-pass <username> [<password>] [--fever]
[--oldpass=<pass>] [--fever] arsse.php user unset-pass <username> [--fever]
arsse.php user unset-pass <username>
[--oldpass=<pass>] [--fever]
arsse.php user auth <username> <password> [--fever] arsse.php user auth <username> <password> [--fever]
arsse.php token list <username> arsse.php token list <username>
arsse.php token create <username> [<label>] arsse.php token create <username> [<label>]
arsse.php token revoke <username> [<token>] arsse.php token revoke <username> [<token>]
arsse.php import <username> [<file>] arsse.php import <username> [<file>] [-f|--flat] [-r|--replace]
[-f | --flat] [-r | --replace] arsse.php export <username> [<file>] [-f|--flat]
arsse.php export <username> [<file>] arsse.php daemon
[-f | --flat] arsse.php feed refresh-all
arsse.php feed refresh <n>
arsse.php conf save-defaults [<file>]
arsse.php --version arsse.php --version
arsse.php -h | --help arsse.php -h|--help
The Arsse command-line interface can be used to perform various administrative The Arsse command-line interface can be used to perform various administrative
tasks such as starting the newsfeed refresh service, managing users, and tasks such as starting the newsfeed refresh service, managing users, and
importing or exporting data. importing or exporting data.
Commands: See the manual page for more details:
daemon man 1 arsse
Starts the newsfeed refreshing service, which will refresh stale feeds at
the configured interval automatically.
feed refresh-all
Refreshes any stale feeds once, then exits. This performs the same
function as the daemon command without looping; this is useful if use of
a scheduler such a cron is preferred over a persitent service.
feed refresh <n>
Refreshes a single feed by numeric ID. This is principally for internal
use as the feed ID numbers are not usually exposed to the user.
conf save-defaults [<file>]
Prints default configuration parameters to standard output, or to <file>
if specified. Each parameter is annotated with a short description of its
purpose and usage.
user [list]
Prints a list of all existing users, one per line.
user add <username> [<password>] [--admin]
Adds the user specified by <username>, with the provided password
<password>. If no password is specified, a random password will be
generated and printed to standard output. The --admin option will make
the user an administrator, which allows them to manage users via the
Miniflux protocol, among other things.
user remove <username>
Removes the user specified by <username>. Data related to the user,
including folders and subscriptions, are immediately deleted. Feeds to
which the user was subscribed will be retained and refreshed until the
configured retention time elapses.
user show <username>
Displays the metadata of a user in a basic tabular format. See below for
details on the various properties displayed.
user set <username> <property> <value>
Sets a user's metadata property to the supplied value. See below for
details on the various properties available.
user unset <username> <property>
Sets a user's metadata property to its default value. See below for
details on the various properties available. What the default value
for a property evaluates to depends on which protocol is used.
user set-pass <username> [<password>]
Changes <username>'s password to <password>. If no password is specified,
a random password will be generated and printed to standard output.
The --oldpass=<pass> option can be used to supply a user's exiting
password if this is required by the authentication driver to change a
password. Currently this is not used by any existing driver.
The --fever option sets a user's Fever protocol password instead of their
general password. As Fever requires that passwords be stored insecurely,
users do not have Fever passwords by default, and logging in to the Fever
protocol is disabled until a password is set. It is highly recommended
that a user's Fever password be different from their general password.
user unset-pass <username>
Unsets a user's password, effectively disabling their account. As with
password setting, the --oldpass and --fever options may be used.
user auth <username> <password>
Tests logging in as <username> with password <password>. This only checks
that the user's password is correctly recognized; it has no side effects.
The --fever option may be used to test the user's Fever protocol password,
if any.
token list <username>
Lists available tokens for <username> in a simple tabular format. These
tokens act as an alternative means of authentication for the Miniflux
protocol and may be required by some clients. They do not expire.
token create <username> [<label>]
Creates a new login token for <username> and prints it. These tokens act
as an alternative means of authentication for the Miniflux protocol and
may be required by some clients. An optional label may be specified to
give the token a meaningful name.
token revoke <username> [<token>]
Deletes the specified token from the database. The token itself must be
supplied, not its label. If it is omitted all tokens are revoked.
import <username> [<file>]
Imports the feeds, folders, and tags found in the OPML formatted <file>
into the account of <username>. If no file is specified, data is instead
read from standard input.
The --replace option interprets the OPML file as the list of all desired
feeds, folders and tags, performing any deletion or moving of existing
entries which do not appear in the flle. If this option is not specified,
the file is assumed to list desired additions only.
The --flat option can be used to ignore any folder structures in the file,
importing any feeds only into the root folder.
export <username> [<file>]
Exports <username>'s feeds, folders, and tags to the OPML file specified
by <file>, or standard output if none is provided. Note that due to a
limitation of the OPML format, any commas present in tag names will not be
retained in the export.
The --flat option can be used to omit folders from the export. Some OPML
implementations may not support folders, or arbitrary nesting; this option
may be used when planning to import into such software.
User metadata:
User metadata are primarily used by the Miniflux protocol, and most
properties have identical or similar names to those used by Miniflux.
Properties may also affect other protocols, or conversely may have no
effect even when using the Miniflux protocol; this is noted below when
appropriate.
Booleans accept any of the values true/false, 1/0, yes/no, on/off.
The following metadata properties exist for each user:
num
Integer. The numeric identifier of the user. This is assigned at user
creation and is read-only.
admin
Boolean. Whether the user is an administrator. Administrators may
manage other users via the Miniflux protocol, and also may trigger
feed updates manually via the Nextcloud News protocol.
lang
String. The preferred language of the user, as a BCP 47 language tag
e.g. "en-ca". Note that since The Arsse currently only includes
English text it is not used by The Arsse itself, but clients may
use this metadatum in protocols which expose it.
tz
String. The time zone of the user, as a tzdata identifier e.g.
"America/Los_Angeles".
root_folder_name
String. The name of the root folder, in protocols which allow it to
be renamed.
sort_asc
Boolean. Whether the user prefers ascending sort order for articles.
Descending order is usually the default, but explicitly setting this
property false will also make a preference for descending order
explicit.
theme
String. The user's preferred theme. This is not used by The Arsse
itself, but clients may use this metadatum in protocols which expose
it.
page_size
Integer. The user's preferred page size when listing articles. This is
not used by The Arsse itself, but clients may use this metadatum in
protocols which expose it.
shortcuts
Boolean. Whether to enable keyboard shortcuts. This is not used by
The Arsse itself, but clients may use this metadatum in protocols which
expose it.
gestures
Boolean. Whether to enable touch gestures. This is not used by
The Arsse itself, but clients may use this metadatum in protocols which
expose it.
reading_time
Boolean. Whether to calculate and display the estimated reading time
for articles. Currently The Arsse does not calculate reading time, so
changing this will likely have no effect.
stylesheet
String. A user CSS stylesheet. This is not used by The Arsse itself,
but clients may use this metadatum in protocols which expose it.
USAGE_TEXT; USAGE_TEXT;
protected function usage($prog): string { protected function usage($prog): string {

View file

@ -1,5 +1,5 @@
% ARSSE(1) arsse 0.9.2 % ARSSE(1) arsse 0.9.2
% J. King %
% 2021-05-28 % 2021-05-28
# NAME # NAME
@ -8,7 +8,24 @@ arsse - manage an instance of The Advanced RSS Environment (The Arsse)
# SYNOPSIS # SYNOPSIS
**arsse** <*command*> [<*args*>]\ **arsse** user [list]\
**arsse** user add <_username_> [<_password_>] [--admin]\
**arsse** user remove <_username_>\
**arsse** user show <_username_>\
**arsse** user set <_username_> <_property_> <_value_>\
**arsse** user unset <_username_> <_property_>\
**arsse** user set-pass <_username_> [<_password_>] [--fever]\
**arsse** user unset-pass <_username_> [--fever]\
**arsse** user auth <_username_> <_password_> [--fever]\
**arsse** token list <_username_>\
**arsse** token create <_username_> [<_label_>]\
**arsse** token revoke <_username_> [<_token_>]\
**arsse** import <_username_> [<_file_>] [-f|--flat] [-r|--replace]\
**arsse** export <_username_> [<_file_>] [-f|--flat]\
**arsse** daemon\
**arsse** feed refresh-all\
**arsse** feed refresh <_n_>\
**arsse** conf save-defaults [<_file_>]\
**arsse** --version\ **arsse** --version\
**arsse** -h|--help **arsse** -h|--help
@ -28,34 +45,146 @@ These are documented in the next section **PRIMARY COMMANDS**. Further, seldom-u
**arsse user [list]** **arsse user [list]**
: Displays a simple list of user names with one entry per line : Displays a simple list of user names with one entry per line
**arsse user add** <*username*> [<*password*>] [--admin] **arsse user add** <_username_> [<_password_>] [--admin]
: Adds a new user to the database with the specified username and password. If <*password*> is omitted a random password will be generated and printed. : Adds a new user to the database with the specified username and password. If <_password_> is omitted a random password will be generated and printed.
: The **--admin** flag may be used to mark the user as an administrator. This has no meaning within the context of The Arsse as a whole, but it is used control access to certain features in the Miniflux and Nextcloud News protocols. The **--admin** flag may be used to mark the user as an administrator. This has no meaning within the context of The Arsse as a whole, but it is used control access to certain features in the Miniflux and Nextcloud News protocols.
**arsse user remove** <*username*> **arsse user remove** <_username_>
: Immediately removes a user from the database. All associated data (folders, subscriptions, etc.) are also removed. : Immediately removes a user from the database. All associated data (folders, subscriptions, etc.) are also removed.
**arsse user show** <*username*> **arsse user show** <_username_>
: Displays a table of metadata properties and their assigned values for <*username*>. These properties are primarily used by the Miniflux protocol. Consult the section **USER METADATA** for details. : Displays a table of metadata properties and their assigned values for <_username_>. These properties are primarily used by the Miniflux protocol. Consult the section **USER METADATA** for details.
**arsse user set** <*username*> <*property*> <*value*> **arsse user set** <_username_> <_property_> <_value_>
: Sets a metadata property for a user. These properties are primarily used by the Miniflux protocol. Consult the section **USER METADATA** for details. : Sets a metadata property for a user. These properties are primarily used by the Miniflux protocol. Consult the section **USER METADATA** for details.
**arsse user unset** <*username*> <*property*> **arsse user unset** <_username_> <_property_>
: Clears a metadata property for a user. The property is thereafter set to its default value, which is protocol-dependent. : Clears a metadata property for a user. The property is thereafter set to its default value, which is protocol-dependent.
## Managing passwords and authentication tokens ## Managing passwords and authentication tokens
**arsse user set-pass** <*username*> [<*password*>] [--fever] **arsse user set-pass** <_username_> [<_password_>] [--fever]
: Changes a user's password to the specified value. If no password is specified, a random password will be generated and printed. : Changes a user's password to the specified value. If no password is specified, a random password will be generated and printed.
\
: The **--fever** option sets a user's Fever protocol password instead of their general password. As Fever requires that passwords be stored insecurely, users do not have Fever passwords by default, and logging in to the Fever protocol is disabled until a password is set. It is highly recommended that a user's Fever password be different from their general password. The **--fever** option sets a user's Fever protocol password instead of their general password. As the Fever protocol requires that passwords be stored insecurely, users do not have Fever passwords by default, and logging in to the Fever protocol is disabled until a suitable password is set. It is highly recommended that a user's Fever password be different from their general password.
**arsse user unset-pass** <_username_> [--fever]
: Unsets a user's password, effectively disabling their account. As with password setting, the **--fever** option may be used to operate on a user's Fever password instead of their general password.
**arsse user auth** <_username_> <_password_> [--fever]
: Tests logging a user in. This only checks that the user's password is correctly recognized; it has no side effects.
The **--fever** option may be used to test the user's Fever protocol password, if any.
**arsse token list** <_username_>
: Displays a user's authentication tokens in a simple tabular format. These tokens act as an alternative means of authentication for the Miniflux protocol and may be required by some clients. They do not expire.
**arsse token create** <_username_> [<_label_>]
: Creates a new random login token and prints it. These tokens act as an alternative means of authentication for the Miniflux protocol and may be required by some clients. An optional <_label_> may be specified to give the token a meaningful name.
**arsse token revoke** <_username_> [<_token_>]
: Deletes the specified token from the database. The token itself must be supplied, not its label. If it is omitted all tokens are revoked.
## Importing and exporting data
**arsse import** <_username_> [<_file_>] [-r|--replace] [-f|--flat]
: Imports the newsfeeds, folders, and tags found in the OPML formatted <_file_> into the account of the specified user. If no file is specified, data is instead read from standard input. Import operations are atomic: if any of the newsfeeds listed in the input cannot be retrieved, the entire import operation will fail.
The **--replace** (or **-r**) option interprets the OPML file as the list of **all** desired newsfeeds, folders and tags, performing any deletion or moving of existing entries which do not appear in the flle. If this option is not specified, the file is assumed to list desired **additions** only.
The **--flat** (or **-f**) option can be used to ignore any folder structures in the file, importing any newsfeeds directly into the root folder. Combining this with the **--replace** option is possible.
**arsse export** <_username_> [<_file_>] [-f|--flat]
: Exports a user's newsfeeds, folders, and tags to the OPML file specified by <_file_>, or standard output if no file is specified. Note that due to a limitation of the OPML format, any commas present in tag names will not be retained in the export.
The **--flat** (or **-f**) option can be used to omit folders from the export. Some OPML implementations may not support folders, or arbitrary nesting; this option may be used when planning to import into such software.
# ADDITIONAL COMMANDS
**arsse daemon**
: Starts the newsfeed fetching service. Normally this command is only invoked by systemd.
**arsse feed refresh-all**
: Performs a one-time fetch of all stale feeds. This command can be used as the basis of a **cron** job to keep newsfeeds up-to-date.
**arsse feed refresh** <_n_>
: Performs a one-time fetch of the feed (not subscription) identified by integer <_n_>. This is used internally by the fetching service and should not normally be needed.
# USER METADATA
User metadata are primarily used by the Miniflux protocol, and most properties have identical or similar names to those used by Miniflux. Properties may also affect other protocols, or conversely may have no effect even when using the Miniflux protocol; this is noted below when appropriate.
Booleans accept any of the values **true**/**false**, **1**/**0**, **yes**/**no**, or **on**/**off**.
The following metadata properties exist for each user:
**num**
: Integer. The numeric identifier of the user. This is assigned at user creation and is read-only.
**admin**
: Boolean. Whether the user is an administrator. Administrators may manage other users via the Miniflux protocol, and also may trigger feed updates manually via the Nextcloud News protocol.
**lang**
: String. The preferred language of the user, as a BCP 47 language tag e.g. "en-ca". Note that since The Arsse currently only includes English text it is not used by The Arsse itself, but clients may use this metadatum in protocols which expose it.
**tz**
: String. The time zone of the user, as a tzdata identifier e.g. "America/Los_Angeles".
**root_folder_name**
: String. The name of the root folder, in protocols which allow it to be renamed.
**sort_asc**
: Boolean. Whether the user prefers ascending sort order for articles. Descending order is usually the default, but explicitly setting this property false will also make a preference for descending order explicit.
**theme**
: String. The user's preferred theme. This is not used by The Arsse itself, but clients may use this metadatum in protocols which expose it.
**page_size**
: Integer. The user's preferred page size when listing articles. This is not used by The Arsse itself, but clients may use this metadatum in protocols which expose it.
**shortcuts**
: Boolean. Whether to enable keyboard shortcuts. This is not used by The Arsse itself, but clients may use this metadatum in protocols which expose it.
**gestures**
: Boolean. Whether to enable touch gestures. This is not used by The Arsse itself, but clients may use this metadatum in protocols which expose it.
**reading_time**
: Boolean. Whether to calculate and display the estimated reading time for articles. Currently The Arsse does not calculate reading time, so changing this will likely have no effect.
**stylesheet**
: String. A user CSS stylesheet. This is not used by The Arsse itself, but clients may use this metadatum in protocols which expose it.
# EXAMPLES
TODO
# REPORTING BUGS
Any bugs found in The Arsse may be reported on the Web at [https://code.mensbeam.com/MensBeam/arsse](). Reports may also be directed to the authors (below) by e-mail.
# AUTHORS
J. King\
[https://jkingweb.ca/]()
Dustin Wilson\
[https://dustinwilson.com/]()