mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-08-28 04:46:41 -04:00
Compare commits
86
Commits
v0.2.2
...
v0.3.x-lts
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
353b6a67de | ||
|
|
bc35766de5 | ||
|
|
3cb0bdce59 | ||
|
|
bfb6372c29 | ||
|
|
32f9dd45fa | ||
|
|
25aaeb74a3 | ||
|
|
d8842138ea | ||
|
|
a7a92e78b5 | ||
|
|
49d23b365d | ||
|
|
2712fecf68 | ||
|
|
45c03f0fe4 | ||
|
|
97d49fdba1 | ||
|
|
52628dba0a | ||
|
|
d2b2dcf7cf | ||
|
|
0895dcba8a | ||
|
|
b942867692 | ||
|
|
bdaaf0906c | ||
|
|
9201e3857c | ||
|
|
511204d17a | ||
|
|
9ee2f7ae0f | ||
|
|
499c9cdd40 | ||
|
|
1488c7d536 | ||
|
|
05f95a4c0c | ||
|
|
59cb9ac0d1 | ||
|
|
eda08ad9b6 | ||
|
|
1370f5cd80 | ||
|
|
5af8caf680 | ||
|
|
2ab8eac7a4 | ||
|
|
9cd248eb8b | ||
|
|
cc3416a89c | ||
|
|
a0cde0aff0 | ||
|
|
b1853dd763 | ||
|
|
85584da807 | ||
|
|
72755e91b5 | ||
|
|
310c935d2d | ||
|
|
392af55b4c | ||
|
|
2f9d5df285 | ||
|
|
d15e71a88f | ||
|
|
5acb7e47bf | ||
|
|
2def48e58b | ||
|
|
7ed199cba1 | ||
|
|
1ed4b8d4dc | ||
|
|
74926a2577 | ||
|
|
54a7d51efa | ||
|
|
2f34fc2c0c | ||
|
|
752b9d616a | ||
|
|
6504bdc8a6 | ||
|
|
1180112967 | ||
|
|
a144b2769d | ||
|
|
b366d1e13e | ||
|
|
34136633d9 | ||
|
|
8166bfcfbe | ||
|
|
63c663ab36 | ||
|
|
fab4bd8d37 | ||
|
|
c6ea3b0136 | ||
|
|
a0d75aad20 | ||
|
|
0a622765cc | ||
|
|
e2d79d4ce3 | ||
|
|
d323f2f75a | ||
|
|
4556e38e32 | ||
|
|
edc2ef25de | ||
|
|
f21041a38d | ||
|
|
0c57bd5764 | ||
|
|
dd8464ecd9 | ||
|
|
38ddc32656 | ||
|
|
27e6972d82 | ||
|
|
118ffc2adb | ||
|
|
d1d88c2e69 | ||
|
|
cb1b010e0a | ||
|
|
6210c9cd31 | ||
|
|
6d557a77c2 | ||
|
|
4933da4c37 | ||
|
|
0e056822ef | ||
|
|
c323899bf8 | ||
|
|
cfb4a2ad51 | ||
|
|
dda33755b3 | ||
|
|
544261a461 | ||
|
|
77014cf5e3 | ||
|
|
750029a491 | ||
|
|
380c49bd00 | ||
|
|
33b8704f0c | ||
|
|
f96b60d3ef | ||
|
|
13422e12c4 | ||
|
|
880d633da0 | ||
|
|
cbf9035969 | ||
|
|
a5d93d4527 |
@@ -1,5 +1,7 @@
|
||||
/mutn
|
||||
/mutn.exe
|
||||
/MUTN
|
||||
/MUTN.exe
|
||||
/main
|
||||
/main.exe
|
||||
/version.go
|
||||
|
||||
@@ -1,21 +1,667 @@
|
||||
MIT License
|
||||
MUTN
|
||||
Copyright (c) 2024-2025 Randall Winkhart
|
||||
|
||||
Copyright (c) 2024 Randall Winkhart
|
||||
MUTN is licensed under the AGPL 3.0 due to its usage of
|
||||
a custom fork of https://github.com/jessp01/gohighlight.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
@@ -23,26 +23,21 @@ Additionally, MUTN is available as a source package ("[mutn](https://aur.archlin
|
||||
After installing, please review the [usage guide](https://github.com/rwinkhart/MUTN/blob/main/wiki/usage.md).
|
||||
|
||||
# Roadmap
|
||||
#### Release v0.3.0
|
||||
- [ ] Replace Glamour with a more minimal Markdown renderer (likely custom)
|
||||
#### Release v0.4.0
|
||||
- [ ] libmutton v0.3.0
|
||||
- [ ] Swap to native (cascade) encryption (custom)
|
||||
- [ ] Implement "netpin" (quick-unlock) with new encryption
|
||||
#### Release v0.5.0
|
||||
- [ ] libmutton v0.4.0
|
||||
- [ ] Password aging support
|
||||
#### Release v0.6.0
|
||||
### Release v0.4.0
|
||||
- [ ] Switch to fully compliant Markdown (do not preserve new lines)
|
||||
- [ ] Switch to alternative Markdown renderer (minimark or BEAN)
|
||||
### Release v0.5.0
|
||||
- [ ] libmutton v0.5.0
|
||||
- [ ] Add refresh/re-encrypt functionality
|
||||
- [ ] Re-implement init menu
|
||||
- [ ] Implement tweak menu
|
||||
#### Release v1.0.0
|
||||
- [ ] Implement "netpin" (quick-unlock)
|
||||
- [ ] Password aging support
|
||||
- [ ] Add yellow/red dot indicators to entry list readout for when passwords should be changed
|
||||
### Release v1.0.0 - Distribution packages
|
||||
- [ ] Create packaging scripts
|
||||
- [x] Stable source PKGBUILD
|
||||
- [ ] Stable source APKBUILD
|
||||
- [x] Stable source APKBUILD
|
||||
- [ ] Debian/Ubuntu
|
||||
- [ ] Fedora
|
||||
- [ ] FreeBSD
|
||||
- [ ] Windows installer
|
||||
- Hunt for polishing opportunities and bugs
|
||||
- [ ] Brew formula
|
||||
- Perform extensive testing
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
gofmt -l -w -s ./src/cli/*.go ./mutn.go
|
||||
git commit -am "$1"
|
||||
git push
|
||||
@@ -1,9 +1,58 @@
|
||||
$global:cliMUTN_entriesToSpaceIndicesMap = @{}
|
||||
|
||||
if (!$IsWindows) {
|
||||
# since the executable has the same name as the completion function (on non-Windows platforms), its path must be stored before the function is registered
|
||||
$MUTNExecutablePath = (Get-Command mutn).Path
|
||||
$spaceIndicesFilePath = '~/.config/libmutton/psCompletionsCache.json'
|
||||
} else {
|
||||
$spaceIndicesFilePath = '~\AppData\Local\libmutton\psCompletionsCache.json'
|
||||
}
|
||||
|
||||
function cliMUTNEntryCompleter {
|
||||
function cliMUTN-loadSpaceIndices {
|
||||
if (Test-Path $global:spaceIndicesFilePath) {
|
||||
$jsonContent = Get-Content -Path $global:spaceIndicesFilePath -Raw
|
||||
$global:cliMUTN_entriesToSpaceIndicesMap = ConvertFrom-Json -InputObject $jsonContent -AsHashtable
|
||||
}
|
||||
}
|
||||
|
||||
function cliMUTN-saveSpaceIndices {
|
||||
$jsonContent = $global:cliMUTN_entriesToSpaceIndicesMap | ConvertTo-Json -Compress
|
||||
$jsonContent | Set-Content -Path $global:spaceIndicesFilePath
|
||||
}
|
||||
|
||||
function cliMUTN-getSpaceIndices {
|
||||
param ([string]$inputString)
|
||||
$indices = @()
|
||||
|
||||
# loop through each character in the string
|
||||
for ($i = 0; $i -lt $inputString.Length; $i++) {
|
||||
if ($inputString[$i] -eq ' ') {
|
||||
# if the character is a space, add the index to the array
|
||||
$indices += $i
|
||||
}
|
||||
}
|
||||
|
||||
return $indices
|
||||
}
|
||||
|
||||
function cliMUTN-getEscapedEntryName {
|
||||
param ([int[]]$Indices, [string]$InputString)
|
||||
$charArray = $InputString.ToCharArray()
|
||||
|
||||
# loop through each index in the provided array,
|
||||
# replacing the character at that index with a space
|
||||
foreach ($index in $Indices) {
|
||||
$charArray[$index] = ' '
|
||||
}
|
||||
|
||||
# convert the character array back to a string
|
||||
$outputString = -join $charArray
|
||||
|
||||
# return the modified string with spaces escaped
|
||||
return $outputString -replace ' ', '` '
|
||||
}
|
||||
|
||||
function cliMUTN-entryCompleter {
|
||||
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
|
||||
if ($IsWindows) {
|
||||
$entryRoot = (Resolve-Path '~\AppData\Local\libmutton\entries').Path
|
||||
@@ -12,18 +61,27 @@ function cliMUTNEntryCompleter {
|
||||
}
|
||||
try {
|
||||
$trimmedPaths = If (Test-Path $entryRoot) {
|
||||
(Get-ChildItem -Path $entryRoot -Recurse -File).FullName.Substring($entryRoot.Length) -replace '\\', '/' -replace ' ', [char]0x259d
|
||||
(Get-ChildItem -Path $entryRoot -Recurse -File).FullName.Substring($entryRoot.Length) -replace '\\', '/'
|
||||
}
|
||||
} catch {
|
||||
$trimmedPaths = $null # if any errors occur (especially, "You cannot call a method on a null-valued expression", set $trimmedPaths to $null
|
||||
}
|
||||
if ($null -eq $trimmedPaths) { # if no entries are found, add 'help' to $trimmedPaths
|
||||
$trimmedPaths = 'help'
|
||||
} else {
|
||||
# replace spaces with underscores, tracking the indices of the spaces in a global variable for later restoration of spaces
|
||||
$trimmedPaths = $trimmedPaths | ForEach-Object {
|
||||
$spaceIndices = cliMUTN-getSpaceIndices -inputString $_
|
||||
$replacedEntry = $_ -replace ' ', '_'
|
||||
$replacedEntry
|
||||
$global:cliMUTN_entriesToSpaceIndicesMap[$replacedEntry] = $spaceIndices
|
||||
}
|
||||
cliMUTN-saveSpaceIndices
|
||||
}
|
||||
$trimmedPaths | Where-Object { $_ -like "$wordToComplete*" }
|
||||
}
|
||||
|
||||
function cliMUTNOptionCompleter {
|
||||
function cliMUTN-optionCompleter {
|
||||
param ($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters)
|
||||
|
||||
$possibleValues = @{
|
||||
@@ -46,7 +104,7 @@ function mutn {
|
||||
[CmdletBinding()]
|
||||
param (
|
||||
[Parameter(Position = 0)]
|
||||
[ArgumentCompleter({ cliMUTNEntryCompleter @args })]
|
||||
[ArgumentCompleter({ cliMUTN-entryCompleter @args })]
|
||||
[string]$entry,
|
||||
|
||||
[Parameter(Position = 1)]
|
||||
@@ -54,13 +112,18 @@ function mutn {
|
||||
[string]$argument,
|
||||
|
||||
[Parameter(Position = 2, ValueFromRemainingArguments=$true)]
|
||||
[ArgumentCompleter({ cliMUTNOptionCompleter @args })]
|
||||
[ArgumentCompleter({ cliMUTN-optionCompleter @args })]
|
||||
[string]$option
|
||||
)
|
||||
|
||||
# replace placeholder underscores with escaped spaces
|
||||
$escapedEntry = cliMUTN-getEscapedEntryName -Indices $global:cliMUTN_entriesToSpaceIndicesMap[$entry] -InputString $entry
|
||||
|
||||
if ($IsWindows) {
|
||||
Invoke-Expression -Command ('mutn.exe ' + ($entry -replace ' ', '` ' -replace [char]0x259d, '` '), $argument, $option).Trim()
|
||||
Invoke-Expression -Command ('mutn.exe ' + $escapedEntry, $argument, $option).Trim()
|
||||
} else {
|
||||
Invoke-Expression -Command ($MUTNExecutablePath + ' ' + ($entry -replace ' ', '` ' -replace [char]0x259d, '` '), $argument, $option).Trim()
|
||||
Invoke-Expression -Command ($global:MUTNExecutablePath + ' ' + $escapedEntry, $argument, $option).Trim()
|
||||
}
|
||||
}
|
||||
|
||||
cliMUTN-loadSpaceIndices
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.TH MUTN 1 "20 August 2024" "v0.2.2" "MUTN man page"
|
||||
.TH MUTN 1 "23 November 2025" "v0.3.1" "MUTN man page"
|
||||
|
||||
.SH NAME
|
||||
\fBmutn\fR - Simple, self-hosted, SSH-synchronized password and note management based on libmutton. It is the successor to sshyp.
|
||||
@@ -47,6 +47,7 @@ Manually synchronizing entries with the server:
|
||||
help Bring up the help menu
|
||||
version Display version and license information
|
||||
init Set up MUTN (generates libmutton.ini)
|
||||
tweak Make changes to the libmutton configuration
|
||||
copy Copy details of an entry to your clipboard
|
||||
edit Edit an existing entry
|
||||
gen Generate a new password
|
||||
@@ -151,23 +152,15 @@ Once this has been done, you may proceed with the client setup:
|
||||
|
||||
102: write error
|
||||
|
||||
103: sync process error
|
||||
103: target not found
|
||||
|
||||
104: server connection error
|
||||
104: sync process error
|
||||
|
||||
105: target not found
|
||||
105: decryption error
|
||||
|
||||
106: target already exists
|
||||
106: encryption error
|
||||
|
||||
107: target wrong type (file/directory)
|
||||
|
||||
108: decryption error
|
||||
|
||||
109: encryption error
|
||||
|
||||
110: clipboard error
|
||||
|
||||
111: other error
|
||||
107: clipboard error
|
||||
|
||||
.SH AUTHOR
|
||||
Randall Winkhart (https://github.com/rwinkhart)
|
||||
|
||||
@@ -1,4 +1,58 @@
|
||||
**WARNING: AS LIBMUTTON HAS NOT YET REACHED v1.0.0, [BREAKING CHANGES](https://github.com/rwinkhart/libmutton/blob/main/wiki/breaking.md) IN FUTURE UPDATES ARE PLANNED**
|
||||
**MUTN v0.2.4**
|
||||
Built with libmutton v0.2.4
|
||||
December 13, 2024
|
||||
|
||||
# The Tripe Transmission Update - Patch 4
|
||||
|
||||
This release updates libmutton to v0.2.4 and includes only a minor tweak and some dependency bumps.
|
||||
|
||||
## IMPORTANT
|
||||
- This release includes a dependency bump to address a high-severity CVE (CVE-2024-45337) - Please update as soon as possible!
|
||||
|
||||
## Changes
|
||||
- A build option/tag was added (`BEAN`) for building with experimental [BEAN](https://github.com/Trojan2021/BEAN) Markdown rendering support (instead of Glamour)
|
||||
- Note that the BEAN Markdown renderer is a new project and is **not** near complete
|
||||
- The pre-compiled binaries provided below do **not** make use of this new build tag (they are still Glamour-based)
|
||||
- From libmutton v0.2.4:
|
||||
- The MIME type of data copied to the clipboard on UNIX-like systems (X11 and Wayland) is now statically set to "text/plain" to avoid potential issues with type inference
|
||||
|
||||
## Dependencies
|
||||
- Bumps (direct and indirect)
|
||||
- Go: v1.23.2 => 1.23.4
|
||||
- github.com/rwinkhart/libmutton: v0.2.3 => v0.2.4
|
||||
- github.com/charmbracelet/x/ansi: v0.4.0 => v0.5.2
|
||||
- github.com/pkg/sftp: v1.13.6 => v1.13.7
|
||||
- golang.org/x/crypto: v0.28.0 => v0.31.0
|
||||
- golang.org/x/net: v0.30.0 => v0.32.0
|
||||
- golang.org/x/sys: v0.26.0 => v0.28.0
|
||||
- golang.org/x/term: v0.25.0 => v0.27.0
|
||||
|
||||
---
|
||||
|
||||
**MUTN v0.2.3**
|
||||
Built with libmutton v0.2.3
|
||||
October 19, 2024
|
||||
|
||||
# The Tripe Transmission Update - Patch 3
|
||||
|
||||
This release updates libmutton to v0.2.3 to fix a minor bug causing the client to make a request to the server under an inappropriate condition.
|
||||
|
||||
## Fixes
|
||||
- From libmutton v0.2.3:
|
||||
- Fixed renaming/moving an entry/folder to an invalid path still having clients request the operation on the server
|
||||
|
||||
## Dependencies
|
||||
- Bumps (direct and indirect)
|
||||
- Go: v1.22.6 => 1.23.2
|
||||
- github.com/rwinkhart/libmutton: v0.2.2 => v0.2.3
|
||||
- github.com/yuin/goldmark: v1.7.4 => v1.7.8
|
||||
- github.com/yuin/goldmark-emoji: v1.0.3 => v1.0.4
|
||||
- golang.org/x/crypto: v0.26.0 => v0.28.0
|
||||
- golang.org/x/net: v0.28.0 => v0.30.0
|
||||
- golang.org/x/sys: v0.24.0 => v0.26.0
|
||||
- golang.org/x/term: v0.23.0 => v0.25.0
|
||||
|
||||
---
|
||||
|
||||
**MUTN v0.2.2**
|
||||
Built with libmutton v0.2.2
|
||||
@@ -9,7 +63,7 @@ August 20, 2024
|
||||
This release updates libmutton to v0.2.2 to address a regression from v0.2.1. Additionally, a Windows-only entry adding bug has been fixed.
|
||||
|
||||
## Fixes
|
||||
- From libmutton v0.2.1:
|
||||
- From libmutton v0.2.2:
|
||||
- Edited entries are no longer improperly synced if their line count is reduced
|
||||
- (8c1b986e20bf8e02b4b27e18748f7677be2b2743) Adding new entries from Windows now works as intended
|
||||
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
**WARNING: AS LIBMUTTON HAS NOT YET REACHED v1.0.0, [BREAKING CHANGES](https://github.com/rwinkhart/libmutton/blob/main/wiki/breaking.md) IN FUTURE UPDATES ARE PLANNED**
|
||||
|
||||
**MUTN v0.3.1**
|
||||
Built with libmutton v0.4.4
|
||||
November 23, 2025
|
||||
|
||||
This is a simple dependency bump and bugfix release. Security issues are addressed. See the [libmutton v0.4.4 patchnotes](https://github.com/rwinkhart/libmutton/releases/tag/v0.4.4) for more information.
|
||||
|
||||
A new major version is well underway. This is likely the last release in the v0.3.x series before more breaking changes are made.
|
||||
|
||||
---
|
||||
|
||||
**MUTN v0.3.0**
|
||||
Built with libmutton v0.4.0
|
||||
August 17, 2025
|
||||
|
||||
# The Cryptic Cuts Update
|
||||
This is the largest update to MUTN yet, and as such, these patch notes are non-exhaustive.
|
||||
Many minor changes and fixes to features mentioned in these patch notes have been made.
|
||||
Please see the commit history for a more complete list of changes.
|
||||
|
||||
This is a major, breaking release that changes the encryption scheme used for entries.
|
||||
This version of MUTN requires `mutn init` to be run before use.
|
||||
Additionally, it requires previously created entries to be converted using the conversion program linked below.
|
||||
|
||||
## libmutton-derived Changes
|
||||
- **PLEASE** read [libmutton's release notes](https://github.com/rwinkhart/libmutton/releases/tag/v0.4.0), as they detail severe breaking changes
|
||||
- Highlight feature: GPG has been entirely replaced with [RCW](https://github.com/rwinkhart/rcw)
|
||||
- All entries created in previous versions _**MUST**_ be converted using [this conversion program](https://github.com/rwinkhart/sshyp-labs/releases/tag/v2.0.0)
|
||||
|
||||
## Features
|
||||
- (05f95a4c0c8a854828161c9d3f70e8cff6da0fc5) Implemented "mutn tweak" for performing various quick operations
|
||||
- These currently include:
|
||||
1. (1488c7d5360fc6f0ac7489e4925247732f687f1e) Changing the device ID
|
||||
2. (59cb9ac0d18defa201713f91f033702339ff45e6) Re-encrypting/optimizing entries (changing the passphrase)
|
||||
3. (45c03f0fe4435cb7e619c80b2a91157405d2a7c9) Setting/changing the editor used for notes
|
||||
|
||||
## Changes
|
||||
- (a7a92e78b565799a04e683d8eae28b6791720c08) Re-licensed under the AGPL 3.0
|
||||
- I would prefer a more permissive license, but this is a legal requirement due to MUTN's use of go-highlite, which is based on [an AGPL project](https://github.com/jessp01/gohighlight)
|
||||
- (0895dcba8ae3435b35e1821ece9a6a924fde5905) (52628dba0a3a959784a6706216615bb7babced09) A temporary fork of Glamour v0.7.0 is now used
|
||||
- This fixes the long-dreaded startup latency caused by Glamour's dependency on [Chroma](https://github.com/alecthomas/chroma)
|
||||
- Chroma has been replaced with [go-highlite](https://github.com/rwinkhart/go-highlite)
|
||||
- This also reduces the binary size by several megabytes
|
||||
- This solution is temporary: Two alternative markdown rendering solutions are in the works and one will be chosen to replace Glamour entirely
|
||||
- (72755e91b582dd2f6b93f0aa30992da4dc10750d) `edit` is now the default note editor on Windows
|
||||
- (cc3416a89c119076e3ce84252029e952288ecf35) Release binaries now target x86_64_v2 and arm64v8.7+crypto (v8.0 still offered on Linux)
|
||||
|
||||
## Fixes
|
||||
- (85584da807a5d973078d6357decdc7a1092582f3) The entry reader loop is now broken as intended once notes have been printed
|
||||
|
||||
## Dependencies
|
||||
- Dropped
|
||||
- Many dependencies were dropped due to the removal of experimental build options
|
||||
- github.com/alecthomas/chroma/v2 was dropped as part of the Glamour fork
|
||||
- github.com/fortis/go-steam-totp was dropped due to libmutton now using one package for all TOTP generation
|
||||
- Bumped (direct)
|
||||
- Go: v1.24.2 => 1.24.6
|
||||
- github.com/rwinkhart/libmutton: v0.3.1 => v0.4.0
|
||||
- golang.org/x/term: v0.31.0 => v0.34.0
|
||||
- Added (direct)
|
||||
- github.com/rwinkhart/go-boilerplate v0.1.0
|
||||
|
||||
---
|
||||
|
||||
**MUTN v0.2.6**
|
||||
Built with libmutton v0.3.1
|
||||
April 21, 2025
|
||||
|
||||
# The Tripe Transmission Update - Patch 6
|
||||
|
||||
This release updates libmutton to v0.3.1 and brings in some minor bug fixes.
|
||||
|
||||
## libmutton-derived Changes
|
||||
- See [libmutton's release notes](https://github.com/rwinkhart/libmutton/releases/tag/v0.3.1)
|
||||
- Highlight feature: (34136633d93749bb75d680537ee2191a49d9d276) Added a new password generation option for moderately complex strings (better compatibility with many services than the previous complex passwords)
|
||||
- The previous generator is still accessible as the "ultra complex" option
|
||||
|
||||
## Fixes
|
||||
- (8166bfcfbe960d77b33e42de35fd0b31c9751039) Notes can once again be removed from entries
|
||||
|
||||
## Dependencies
|
||||
- Bumps (direct and indirect)
|
||||
- Go: v1.24.0 => 1.24.2
|
||||
- github.com/rwinkhart/libmutton: v0.3.0 => v0.3.1
|
||||
- golang.org/x/term: v0.29.0 => v0.31.0
|
||||
- golang.org/x/crypto: v0.34.0 => v0.37.0
|
||||
- golang.org/x/net: v0.35.0 => v0.39.0
|
||||
- golang.org/x/sys: v0.30.0 => v0.32.0
|
||||
- github.com/pkg/sftp: v1.13.7 => v1.13.9
|
||||
- github.com/alecthomas/chroma/v2: v2.15.0 => v2.16.0
|
||||
- github.com/yuin/goldmark: v1.7.8 => v1.7.10
|
||||
- github.com/yuin/goldmark-emoji: v1.0.4 => v1.0.6
|
||||
|
||||
---
|
||||
|
||||
**MUTN v0.2.5**
|
||||
Built with libmutton v0.3.0
|
||||
February 22, 2025
|
||||
|
||||
# The Tripe Transmission Update - Patch 5
|
||||
|
||||
This release updates libmutton to v0.3.0 and brings in some minor bug fixes.
|
||||
|
||||
## libmutton-derived Changes
|
||||
- See [libmutton's release notes](https://github.com/rwinkhart/libmutton/releases/tag/v0.3.0)
|
||||
|
||||
## Changes
|
||||
- (38ddc3265634275d999781dbc0ce827392ed77e0) Some ANSI-colored text is now more visible in light terminal themes
|
||||
- (0c57bd576447c4b61f67c22f81db7543ba30ff3f) Trailing double spaces are now preserved in notes for Markdown manual line breaks
|
||||
- Currently only supported in [BEAN](https://github.com/Trojan2021/BEAN)
|
||||
|
||||
## Fixes
|
||||
- (edc2ef25dea9d702bf8a096fd23795957ae721f1) (4556e38e32c52862ecf3d88e7b8faeae231b44a2) PowerShell completions no longer become unusable when multiple entries with similar names (containing spaces) exist in the same directory
|
||||
- (d323f2f75a219163f3b6b3fbb2b7c1b21930fd0b) Entries are no longer re-uploaded when the user adds a blank note
|
||||
|
||||
## Dependencies
|
||||
- Bumps (direct and indirect)
|
||||
- Go: v1.23.4 => 1.24.0
|
||||
- github.com/rwinkhart/libmutton: v0.2.4 => v0.3.0
|
||||
- github.com/alecthomas/chroma/v2: v2.14.0 => v2.15.0
|
||||
- github.com/dlclark/regexp2: v1.11.4 => v1.11.5
|
||||
- github.com/muesli/termenv: v0.15.2 => v0.16.0
|
||||
- golang.org/x/term: v0.27.0 => v0.29.0
|
||||
- golang.org/x/crypto: v0.31.0 => v0.34.0
|
||||
- golang.org/x/net: v0.32.0 => v0.35.0
|
||||
- golang.org/x/sys: v0.28.0 => v0.30.0
|
||||
@@ -1,20 +1,19 @@
|
||||
module github.com/rwinkhart/MUTN
|
||||
|
||||
go 1.22.6
|
||||
go 1.25.4
|
||||
|
||||
require (
|
||||
github.com/charmbracelet/glamour v0.7.0
|
||||
github.com/rwinkhart/libmutton v0.2.2
|
||||
golang.org/x/term v0.23.0
|
||||
github.com/rwinkhart/go-boilerplate v0.1.1-0.20251110055016-10ee4f91fcb6
|
||||
github.com/rwinkhart/libmutton v0.4.4
|
||||
golang.org/x/term v0.37.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/alecthomas/chroma/v2 v2.14.0 // indirect
|
||||
github.com/Microsoft/go-winio v0.6.2 // indirect
|
||||
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
|
||||
github.com/aymerick/douceur v0.2.0 // indirect
|
||||
github.com/boombuler/barcode v1.0.2 // indirect
|
||||
github.com/dlclark/regexp2 v1.11.4 // indirect
|
||||
github.com/fortis/go-steam-totp v0.0.0-20171114202746-18e928674727 // indirect
|
||||
github.com/boombuler/barcode v1.1.0 // indirect
|
||||
github.com/gorilla/css v1.0.1 // indirect
|
||||
github.com/kr/fs v0.1.0 // indirect
|
||||
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
|
||||
@@ -22,16 +21,29 @@ require (
|
||||
github.com/mattn/go-runewidth v0.0.16 // indirect
|
||||
github.com/microcosm-cc/bluemonday v1.0.27 // indirect
|
||||
github.com/muesli/reflow v0.3.0 // indirect
|
||||
github.com/muesli/termenv v0.15.2 // indirect
|
||||
github.com/muesli/termenv v0.16.0 // indirect
|
||||
github.com/olekukonko/tablewriter v0.0.5 // indirect
|
||||
github.com/pkg/sftp v1.13.6 // indirect
|
||||
github.com/pquerna/otp v1.4.1-0.20231130234153-3357de7c0481 // indirect
|
||||
github.com/pkg/sftp v1.13.10 // indirect
|
||||
github.com/pquerna/otp v1.5.0 // indirect
|
||||
github.com/rivo/uniseg v0.4.7 // indirect
|
||||
github.com/stretchr/testify v1.8.4 // indirect
|
||||
github.com/yuin/goldmark v1.7.4 // indirect
|
||||
github.com/yuin/goldmark-emoji v1.0.3 // indirect
|
||||
golang.org/x/crypto v0.26.0 // indirect
|
||||
golang.org/x/net v0.28.0 // indirect
|
||||
golang.org/x/sys v0.24.0 // indirect
|
||||
github.com/rwinkhart/go-highlite v0.1.1 // indirect
|
||||
github.com/rwinkhart/peercred-mini v0.1.2 // indirect
|
||||
github.com/rwinkhart/rcw v0.2.4 // indirect
|
||||
github.com/yuin/goldmark v1.7.13 // indirect
|
||||
github.com/yuin/goldmark-emoji v1.0.6 // indirect
|
||||
golang.design/x/clipboard v0.7.1 // indirect
|
||||
golang.org/x/crypto v0.45.0 // indirect
|
||||
golang.org/x/exp/shiny v0.0.0-20251017212417-90e834f514db // indirect
|
||||
golang.org/x/image v0.32.0 // indirect
|
||||
golang.org/x/mobile v0.0.0-20251021151156-188f512ec823 // indirect
|
||||
golang.org/x/net v0.47.0 // indirect
|
||||
golang.org/x/sys v0.38.0 // indirect
|
||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
)
|
||||
|
||||
replace golang.org/x/sys => github.com/rwinkhart/sys v0.38.0
|
||||
|
||||
replace github.com/Microsoft/go-winio => github.com/rwinkhart/go-winio v0.1.0
|
||||
|
||||
replace github.com/charmbracelet/glamour => github.com/rwinkhart/glamour-temp-MUTN v0.7.2
|
||||
|
||||
@@ -1,29 +1,15 @@
|
||||
github.com/alecthomas/assert/v2 v2.7.0 h1:QtqSACNS3tF7oasA8CU6A6sXZSBDqnm7RfpLl9bZqbE=
|
||||
github.com/alecthomas/assert/v2 v2.7.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k=
|
||||
github.com/alecthomas/chroma/v2 v2.14.0 h1:R3+wzpnUArGcQz7fCETQBzO5n9IMNi13iIs46aU4V9E=
|
||||
github.com/alecthomas/chroma/v2 v2.14.0/go.mod h1:QolEbTfmUHIMVpBqxeDnNBj2uoeI4EbYP4i6n68SG4I=
|
||||
github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc=
|
||||
github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
|
||||
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
|
||||
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
|
||||
github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=
|
||||
github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4=
|
||||
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
|
||||
github.com/boombuler/barcode v1.0.2 h1:79yrbttoZrLGkL/oOI8hBrUKucwOL0oOjUgEguGMcJ4=
|
||||
github.com/boombuler/barcode v1.0.2/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
|
||||
github.com/charmbracelet/glamour v0.7.0 h1:2BtKGZ4iVJCDfMF229EzbeR1QRKLWztO9dMtjmqZSng=
|
||||
github.com/charmbracelet/glamour v0.7.0/go.mod h1:jUMh5MeihljJPQbJ/wf4ldw2+yBP59+ctV36jASy7ps=
|
||||
github.com/boombuler/barcode v1.1.0 h1:ChaYjBR63fr4LFyGn8E8nt7dBSt3MiU3zMOZqFvVkHo=
|
||||
github.com/boombuler/barcode v1.1.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/dlclark/regexp2 v1.11.4 h1:rPYF9/LECdNymJufQKmri9gV604RvvABwgOA8un7yAo=
|
||||
github.com/dlclark/regexp2 v1.11.4/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
|
||||
github.com/fortis/go-steam-totp v0.0.0-20171114202746-18e928674727 h1:1RkPJqfzrncAuh9xgoslr9OplZskm+VRA9lkucHPQZ4=
|
||||
github.com/fortis/go-steam-totp v0.0.0-20171114202746-18e928674727/go.mod h1:wRAWHbTlpt0C4kwnKoa42L2Phrv6uIq+c50P2uKpb7I=
|
||||
github.com/gorilla/css v1.0.1 h1:ntNaBIghp6JmvWnxbZKANoLyuXTPZ4cAMlo6RyhlbO8=
|
||||
github.com/gorilla/css v1.0.1/go.mod h1:BvnYkspnSzMmwRK+b8/xgNPLiIuNZr6vbZBTPQ2A3b0=
|
||||
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
|
||||
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
|
||||
github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8=
|
||||
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
|
||||
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
|
||||
@@ -38,74 +24,63 @@ github.com/microcosm-cc/bluemonday v1.0.27 h1:MpEUotklkwCSLeH+Qdx1VJgNqLlpY2KXwX
|
||||
github.com/microcosm-cc/bluemonday v1.0.27/go.mod h1:jFi9vgW+H7c3V0lb6nR74Ib/DIB5OBs92Dimizgw2cA=
|
||||
github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s=
|
||||
github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8=
|
||||
github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo=
|
||||
github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8=
|
||||
github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc=
|
||||
github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk=
|
||||
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
|
||||
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
|
||||
github.com/pkg/sftp v1.13.6 h1:JFZT4XbOU7l77xGSpOdW+pwIMqP044IyjXX6FGyEKFo=
|
||||
github.com/pkg/sftp v1.13.6/go.mod h1:tz1ryNURKu77RL+GuCzmoJYxQczL3wLNNpPWagdg4Qk=
|
||||
github.com/pkg/sftp v1.13.10 h1:+5FbKNTe5Z9aspU88DPIKJ9z2KZoaGCu6Sr6kKR/5mU=
|
||||
github.com/pkg/sftp v1.13.10/go.mod h1:bJ1a7uDhrX/4OII+agvy28lzRvQrmIQuaHrcI1HbeGA=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/pquerna/otp v1.4.1-0.20231130234153-3357de7c0481 h1:FkxbO331O7mS5EJkP+MCi0o2gswh/Aezs+//NmefrR8=
|
||||
github.com/pquerna/otp v1.4.1-0.20231130234153-3357de7c0481/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg=
|
||||
github.com/pquerna/otp v1.5.0 h1:NMMR+WrmaqXU4EzdGJEE1aUUI0AMRzsp96fFFWNPwxs=
|
||||
github.com/pquerna/otp v1.5.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg=
|
||||
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
|
||||
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
|
||||
github.com/rwinkhart/libmutton v0.2.2 h1:PN3VaM8IiKy6Ea2dfyTQxwyNeIu00CZ2vsgVZESrcvU=
|
||||
github.com/rwinkhart/libmutton v0.2.2/go.mod h1:W4xYquN2Hz5rNyaaIUZCMTLvTNcAx804f1Y4vaUBmiw=
|
||||
github.com/rwinkhart/glamour-temp-MUTN v0.7.2 h1:/CBexwkGdL8HuZjO7M0zzjGHaHCr9/r4XTOtUJa+pPE=
|
||||
github.com/rwinkhart/glamour-temp-MUTN v0.7.2/go.mod h1:DN/eJaNQ5h7dgxzfmWFo7By+b82CKEUdNaY6z4R4v3c=
|
||||
github.com/rwinkhart/go-boilerplate v0.1.1-0.20251110055016-10ee4f91fcb6 h1:tGGtw5Wr4laDrU7Ooe95g4E+O6c+oY18atamcMPaMY8=
|
||||
github.com/rwinkhart/go-boilerplate v0.1.1-0.20251110055016-10ee4f91fcb6/go.mod h1:cnzIF45I0FCOvE4YIB+26pLCUx2kWyY2llKYZruNaRY=
|
||||
github.com/rwinkhart/go-highlite v0.1.1 h1:9TxbRhYVfD/3YaEgNk1BtEiZ0t8/5mxDUZqNMXHodT0=
|
||||
github.com/rwinkhart/go-highlite v0.1.1/go.mod h1:mWLMtCWcyV0BG4NeyPyAUGMjPvI0ds6vXmUq89QwBFA=
|
||||
github.com/rwinkhart/go-winio v0.1.0 h1:b72agLW+dETGmhR3VbcbwnStfgKfc5AfgJOXBJDkaHg=
|
||||
github.com/rwinkhart/go-winio v0.1.0/go.mod h1:ZWa7ssZJT30CCDGJ7fk/2SBTq9BIQrrVjrcss0UW2s0=
|
||||
github.com/rwinkhart/libmutton v0.4.4 h1:tUGU0JLf0aQ0YQy+1RSzOy5yujfpJ4b3iXuxAhUjhzE=
|
||||
github.com/rwinkhart/libmutton v0.4.4/go.mod h1:2GV6ILW7dawIGvBoOcV0K3Uw7llc0ZWFRYcV+kM9K8g=
|
||||
github.com/rwinkhart/peercred-mini v0.1.2 h1:4cGWDbv0whvLeVvbUdx84V/9p+2fS+DEXgrA1KxlRFo=
|
||||
github.com/rwinkhart/peercred-mini v0.1.2/go.mod h1:LLHG7YshHEpbpJJP+Il9nx2dnGj5O3VGE32rWmflj0c=
|
||||
github.com/rwinkhart/rcw v0.2.4 h1:FrRSsl+ui1WLmDwqjLSROtFPKqSeGLEfF2SPENt4qP0=
|
||||
github.com/rwinkhart/rcw v0.2.4/go.mod h1:nhW4RAHvEjW2QcOlqEdWqRQOFJLjoOGSPkSRZlMjU3s=
|
||||
github.com/rwinkhart/sys v0.38.0 h1:V1PGKcUutWtD3+VdHvyvfGtPy7PDXzKHNM1IzVq1ysY=
|
||||
github.com/rwinkhart/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/yuin/goldmark v1.7.1/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E=
|
||||
github.com/yuin/goldmark v1.7.4 h1:BDXOHExt+A7gwPCJgPIIq7ENvceR7we7rOS9TNoLZeg=
|
||||
github.com/yuin/goldmark v1.7.4/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E=
|
||||
github.com/yuin/goldmark-emoji v1.0.3 h1:aLRkLHOuBR2czCY4R8olwMjID+tENfhyFDMCRhbIQY4=
|
||||
github.com/yuin/goldmark-emoji v1.0.3/go.mod h1:tTkZEbwu5wkPmgTcitqddVxY9osFZiavD+r4AzQrh1U=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
|
||||
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
|
||||
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
|
||||
golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
|
||||
golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
|
||||
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU=
|
||||
golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/yuin/goldmark v1.7.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA=
|
||||
github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg=
|
||||
github.com/yuin/goldmark-emoji v1.0.6 h1:QWfF2FYaXwL74tfGOW5izeiZepUDroDJfWubQI9HTHs=
|
||||
github.com/yuin/goldmark-emoji v1.0.6/go.mod h1:ukxJDKFpdFb5x0a5HqbdlcKtebh086iJpI31LTKmWuA=
|
||||
golang.design/x/clipboard v0.7.1 h1:OEG3CmcYRBNnRwpDp7+uWLiZi3hrMRJpE9JkkkYtz2c=
|
||||
golang.design/x/clipboard v0.7.1/go.mod h1:i5SiIqj0wLFw9P/1D7vfILFK0KHMk7ydE72HRrUIgkg=
|
||||
golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q=
|
||||
golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4=
|
||||
golang.org/x/exp/shiny v0.0.0-20251017212417-90e834f514db h1:NmsmaSkEAq6A8r0Q78WxD0IygJNCs6J3uYDgNuPkXYM=
|
||||
golang.org/x/exp/shiny v0.0.0-20251017212417-90e834f514db/go.mod h1:QMAAUorQ8fzCK0C6mr4X4XV9BEp7Al6+jlejJvfYKw4=
|
||||
golang.org/x/image v0.32.0 h1:6lZQWq75h7L5IWNk0r+SCpUJ6tUVd3v4ZHnbRKLkUDQ=
|
||||
golang.org/x/image v0.32.0/go.mod h1:/R37rrQmKXtO6tYXAjtDLwQgFLHmhW+V6ayXlxzP2Pc=
|
||||
golang.org/x/mobile v0.0.0-20251021151156-188f512ec823 h1:M0DtBf/UvJoTH+tk6tgHT2NVxNEJCYhVu1g/xeD+GEk=
|
||||
golang.org/x/mobile v0.0.0-20251021151156-188f512ec823/go.mod h1:3QSlP0AtP6HPTLbsxfgfefGN76jpIB9yBsMqB8UY37I=
|
||||
golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY=
|
||||
golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU=
|
||||
golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU=
|
||||
golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
|
||||
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
|
||||
@@ -1,13 +1,22 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"cmp"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/rwinkhart/MUTN/src/cli"
|
||||
"github.com/rwinkhart/go-boilerplate/back"
|
||||
"github.com/rwinkhart/go-boilerplate/front"
|
||||
"github.com/rwinkhart/go-boilerplate/other"
|
||||
"github.com/rwinkhart/libmutton/cfg"
|
||||
"github.com/rwinkhart/libmutton/core"
|
||||
"github.com/rwinkhart/libmutton/sync"
|
||||
"github.com/rwinkhart/libmutton/crypt"
|
||||
"github.com/rwinkhart/libmutton/global"
|
||||
"github.com/rwinkhart/libmutton/syncclient"
|
||||
"github.com/rwinkhart/libmutton/synccycles"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -25,7 +34,7 @@ func main() {
|
||||
if strings.HasPrefix(args[1], "/") {
|
||||
|
||||
// store location of target entry
|
||||
targetLocation := core.TargetLocationFormat(args[1])
|
||||
targetLocation := global.TargetLocationFormat(args[1])
|
||||
|
||||
// entry reader shortcut (if no other arguments are supplied)
|
||||
if argsCount == 2 {
|
||||
@@ -38,7 +47,10 @@ func main() {
|
||||
case "show", "-s":
|
||||
cli.EntryReaderDecrypt(targetLocation, false)
|
||||
case "copy":
|
||||
core.CopyArgument(args[0], targetLocation, 0)
|
||||
err := core.CopyArgument(targetLocation, 0)
|
||||
if err != nil {
|
||||
other.PrintError("Failed to copy password to clipboard: "+err.Error(), global.ErrorClipboard)
|
||||
}
|
||||
case "edit":
|
||||
cli.EditEntryField(targetLocation, true, 0)
|
||||
case "gen":
|
||||
@@ -46,7 +58,10 @@ func main() {
|
||||
case "add":
|
||||
cli.AddEntry(targetLocation, true, 0)
|
||||
case "shear":
|
||||
sync.ShearRemoteFromClient(args[1]) // pass the incomplete path as the server and all clients (reading from the deletions directory) will have a different home directory
|
||||
err := syncclient.ShearRemoteFromClient(args[1]) // pass the incomplete path as the server and all clients (reading from the deletions directory) will have a different home directory
|
||||
if err != nil {
|
||||
other.PrintError("Failed to shear target: "+err.Error(), back.ErrorWrite)
|
||||
}
|
||||
default:
|
||||
cli.HelpMain()
|
||||
}
|
||||
@@ -82,7 +97,10 @@ func main() {
|
||||
default:
|
||||
cli.HelpCopy()
|
||||
}
|
||||
core.CopyArgument(args[0], targetLocation, field)
|
||||
err := core.CopyArgument(targetLocation, field)
|
||||
if err != nil {
|
||||
other.PrintError("Failed to copy field to clipboard: "+err.Error(), global.ErrorClipboard)
|
||||
}
|
||||
case "edit":
|
||||
var field int // indicates which (numbered) field to edit
|
||||
switch args[3] {
|
||||
@@ -97,8 +115,11 @@ func main() {
|
||||
case "note", "-n":
|
||||
field = 4
|
||||
case "rename", "-r":
|
||||
core.TargetIsFile(targetLocation, true, 0) // ensure location exists before prompting for new location
|
||||
cli.RenameCli(args[1]) // pass the incomplete path as the server and all clients (reading from the deletions directory) will have a different home directory
|
||||
isAccessible, _ := back.TargetIsFile(targetLocation, true) // error is ignored because dir/file status is irrelevant
|
||||
if !isAccessible {
|
||||
other.PrintError("Failed to access location ("+targetLocation+")", back.ErrorTargetNotFound)
|
||||
}
|
||||
cli.RenameCli(args[1]) // pass the incomplete path as the server and all clients (reading from the deletions directory) will have a different home directory
|
||||
default:
|
||||
cli.HelpEdit()
|
||||
}
|
||||
@@ -145,7 +166,10 @@ func main() {
|
||||
case "note", "-n":
|
||||
cli.AddEntry(targetLocation, true, 2)
|
||||
case "folder", "-f":
|
||||
sync.AddFolderRemoteFromClient(args[1]) // pass the incomplete path as the server will have a different home directory
|
||||
err := syncclient.AddFolderRemoteFromClient(args[1]) // pass the incomplete path as the server will have a different home directory
|
||||
if err != nil {
|
||||
other.PrintError("Failed to add folder: "+err.Error(), back.ErrorWrite)
|
||||
}
|
||||
default:
|
||||
cli.HelpAdd()
|
||||
}
|
||||
@@ -158,14 +182,52 @@ func main() {
|
||||
} else {
|
||||
switch args[1] {
|
||||
case "clipclear":
|
||||
core.ClipClearArgument()
|
||||
err := core.ClipClearArgument()
|
||||
if err != nil {
|
||||
other.PrintError("Failure occurred in clipboard clearing process: "+err.Error(), global.ErrorClipboard)
|
||||
}
|
||||
case "startrcwd":
|
||||
crypt.RCWDArgument()
|
||||
case "sync":
|
||||
sync.RunJob(true)
|
||||
_, err := syncclient.RunJob(true)
|
||||
if err != nil {
|
||||
other.PrintError("Failed to sync entries: "+err.Error(), global.ErrorSyncProcess)
|
||||
}
|
||||
case "init":
|
||||
cli.TempInitCli()
|
||||
err := core.LibmuttonInit(front.Input,
|
||||
[][3]string{{"MUTN", "textEditor", getTextEditorInput()}},
|
||||
confirmRCWPassword("new"), false, false)
|
||||
if err != nil {
|
||||
other.PrintError("Initialization failed: "+err.Error(), 0)
|
||||
}
|
||||
case "tweak":
|
||||
fmt.Println(core.AnsiError + "\"tweak\" is not yet implemented" + core.AnsiReset)
|
||||
os.Exit(0)
|
||||
choice := front.InputMenuGen("Action:", []string{"Change device ID", "Change master password/Optimize entries", "Set text editor"})
|
||||
switch choice {
|
||||
case 1:
|
||||
oldDeviceID, err := global.GetCurrentDeviceID()
|
||||
if err != nil {
|
||||
other.PrintError("Failed to get current device ID: "+err.Error(), back.ErrorRead)
|
||||
}
|
||||
_, _, err = synccycles.DeviceIDGen(oldDeviceID, "")
|
||||
if err != nil {
|
||||
other.PrintError("Failed to change device ID: "+err.Error(), global.ErrorSyncProcess)
|
||||
}
|
||||
fmt.Println("\nDevice ID changed successfully.")
|
||||
case 2:
|
||||
oldPassword := confirmRCWPassword("old")
|
||||
newPassword := confirmRCWPassword("new")
|
||||
fmt.Print("\nRe-encrypting entries. Please wait; do not force close this process.\n")
|
||||
err := core.EntryRefresh(oldPassword, newPassword, false)
|
||||
if err != nil {
|
||||
other.PrintError("Re-encryption failed: "+err.Error(), global.ErrorEncryption)
|
||||
}
|
||||
fmt.Println("\nRe-encryption complete.")
|
||||
case 3:
|
||||
err := cfg.WriteConfig([][3]string{{"MUTN", "textEditor", getTextEditorInput()}}, nil, true)
|
||||
if err != nil {
|
||||
other.PrintError("Failed to set text editor: "+err.Error(), back.ErrorWrite)
|
||||
}
|
||||
}
|
||||
case "copy":
|
||||
cli.HelpCopy()
|
||||
case "edit":
|
||||
@@ -182,3 +244,22 @@ func main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// confirmRCWPassword prompts the user for a master password and confirms it
|
||||
// is typed correctly. Returns the password as a byte slice.
|
||||
func confirmRCWPassword(lowercasePrefix string) []byte {
|
||||
for {
|
||||
// get master password
|
||||
rcwPass := front.InputHidden(strings.ToUpper(string(lowercasePrefix[0])) + lowercasePrefix[1:] + " master password:")
|
||||
if !bytes.Equal(rcwPass, front.InputHidden("Confirm "+lowercasePrefix+" master password:")) || len(rcwPass) == 0 {
|
||||
fmt.Println(back.AnsiError + "Passwords do not match or password is invalid" + back.AnsiReset)
|
||||
continue
|
||||
}
|
||||
return rcwPass
|
||||
}
|
||||
}
|
||||
|
||||
// getTextEditorInput prompts the user for a text editor input, first falling back to "$EDITOR", then to a default value
|
||||
func getTextEditorInput() string {
|
||||
return cmp.Or(front.Input("Text editor (leave blank for $EDITOR, falls back to \""+cli.FallbackEditor+"\"):"), os.Getenv("EDITOR"), cli.FallbackEditor)
|
||||
}
|
||||
|
||||
+8
-4
@@ -22,11 +22,15 @@ case "$1" in
|
||||
. ./resources/release-binaries.sh
|
||||
create_release_binaries
|
||||
;;
|
||||
pkgbuild-git-stable)
|
||||
. ./resources/pkgbuild-git-stable.sh
|
||||
create_pkgbuild_git_stable
|
||||
pkgbuild-git-stable-optimized)
|
||||
. ./resources/pkgbuild-git-stable-optimized.sh
|
||||
create_pkgbuild_git_stable_optimized
|
||||
;;
|
||||
apkbuild-source-stable-optimized)
|
||||
. ./resources/apkbuild-source-stable-optimized.sh
|
||||
create_apkbuild_source_stable_optimized
|
||||
;;
|
||||
*)
|
||||
printf '\nusage: package.sh [target] <revision>\n\ntargets: release-binaries pkgbuild-git-stable\n\n'
|
||||
printf '\nusage: package.sh [target] <revision>\n\ntargets: release-binaries pkgbuild-git-stable-optimized apkbuild-source-stable-optimized\n\n'
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
#!/bin/sh
|
||||
|
||||
create_apkbuild_source_stable_optimized() {
|
||||
printf '\nGenerating APKBUILD...\n'
|
||||
local source="https://github.com/rwinkhart/MUTN/archive/refs/tags/v"$version".tar.gz"
|
||||
local checksum=$(curl -sL "$source" | sha512sum | cut -d ' ' -f1)
|
||||
printf "# Maintainer: Randall Winkhart <idgr@tutanota.com>
|
||||
pkgname=mutn
|
||||
pkgver="$version"
|
||||
pkgrel="$((revision-1))"
|
||||
pkgdesc='A simple, self-hosted, SSH-synchronized password/note manager for the CLI (based on libmutton)'
|
||||
arch='all'
|
||||
url='https://github.com/rwinkhart/MUTN'
|
||||
license='MIT'
|
||||
depends=''
|
||||
makedepends='busybox go'
|
||||
options='!check net'
|
||||
source=\"\$pkgname-\$pkgver.tar.gz::"$source"\"
|
||||
|
||||
build() {
|
||||
cd \${srcdir}/MUTN-\$pkgver
|
||||
|
||||
# compress man page
|
||||
gzip -kf ./docs/man
|
||||
|
||||
# determine microarchitecture feature level
|
||||
case \$CARCH in
|
||||
'x86_64')
|
||||
cpuFlags=\$(grep -E 'flags\s+:\s' /proc/cpuinfo)
|
||||
if [ ! -z \"\$(echo \"\$cpuFlags\" | grep 'avx512f')\" ]; then
|
||||
export GOAMD64=v4
|
||||
elif [ ! -z \"\$(echo \"\$cpuFlags\" | grep 'avx2')\" ]; then
|
||||
export GOAMD64=v3
|
||||
elif [ ! -z \"\$(echo \"\$cpuFlags\" | grep 'sse4_2')\" ]; then
|
||||
export GOAMD64=v2
|
||||
else
|
||||
export GOAMD64=v1
|
||||
fi
|
||||
;;
|
||||
# TODO check aarch64 feature level
|
||||
esac
|
||||
|
||||
# compile binary
|
||||
CGO_ENABLED=1 go build -ldflags=\"-s -w\" -trimpath -tags=stxAll ./mutn.go
|
||||
}
|
||||
|
||||
package() {
|
||||
cd \${srcdir}/MUTN-\$pkgver
|
||||
install -Dm755 ./mutn \${pkgdir}/usr/bin/mutn
|
||||
install -Dm644 ./LICENSE \${pkgdir}/usr/share/licenses/mutn/LICENSE
|
||||
install -Dm644 ./completions/zsh/_mutn \${pkgdir}/usr/share/zsh/site-functions/_mutn
|
||||
install -Dm644 ./completions/bash/mutn \${pkgdir}/usr/share/bash-completion/completions/mutn
|
||||
install -Dm644 ./docs/man.gz \${pkgdir}/usr/share/man/man1/mutn.1.gz
|
||||
}
|
||||
|
||||
sha512sums=\"
|
||||
$checksum \$pkgname-\$pkgver.tar.gz
|
||||
\"
|
||||
" > 1output/APKBUILD
|
||||
printf '\nAPKBUILD generated\n\n'
|
||||
}
|
||||
+8
-7
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
create_pkgbuild_git_stable() {
|
||||
create_pkgbuild_git_stable_optimized() {
|
||||
printf '\nGenerating PKGBUILD...\n'
|
||||
local source="git+https://github.com/rwinkhart/MUTN.git#tag=v\${pkgver}"
|
||||
printf "# Maintainer: Randall Winkhart <idgr at tutanota dot com>
|
||||
@@ -11,7 +11,8 @@ pkgdesc='A simple, self-hosted, SSH-synchronized password/note manager for the C
|
||||
arch=('x86_64' 'i686' 'i486' 'pentium4' 'aarch64' 'armv7h' 'riscv64')
|
||||
url='https://github.com/rwinkhart/MUTN'
|
||||
license=('MIT')
|
||||
makedepends=(go util-linux gzip)
|
||||
depends=()
|
||||
makedepends=(go grep gzip)
|
||||
optdepends=(
|
||||
'wl-clipboard: Wayland clipboard support'
|
||||
'xclip: X11 clipboard support'
|
||||
@@ -29,12 +30,12 @@ build() {
|
||||
# determine microarchitecture feature level
|
||||
case \$CARCH in
|
||||
'x86_64')
|
||||
lscpuOutput=\$(lscpu | grep Flags)
|
||||
if [ ! -z \"\$(echo \$lscpuOutput | grep avx512f)\" ]; then
|
||||
cpuFlags=\$(grep -E 'flags\s+:\s' /proc/cpuinfo)
|
||||
if [ ! -z \"\$(grep 'avx512f' <<< \"\$cpuFlags\")\" ]; then
|
||||
export GOAMD64=v4
|
||||
elif [ ! -z \"\$(echo \$lscpuOutput | grep avx2)\" ]; then
|
||||
elif [ ! -z \"\$(grep 'avx2' <<< \"\$cpuFlags\")\" ]; then
|
||||
export GOAMD64=v3
|
||||
elif [ ! -z \"\$(echo \$lscpuOutput | grep sse4_2)\" ]; then
|
||||
elif [ ! -z \"\$(grep 'sse4_2' <<< \"\$cpuFlags\")\" ]; then
|
||||
export GOAMD64=v2
|
||||
else
|
||||
export GOAMD64=v1
|
||||
@@ -44,7 +45,7 @@ build() {
|
||||
esac
|
||||
|
||||
# compile binary
|
||||
CGO_ENABLED=1 go build -ldflags=\"-s -w\" -trimpath ./mutn.go
|
||||
CGO_ENABLED=1 go build -ldflags=\"-s -w\" -trimpath -tags=stxAll ./mutn.go
|
||||
}
|
||||
|
||||
package() {
|
||||
@@ -1,11 +1,18 @@
|
||||
#!/bin/sh
|
||||
# This script generates portable MUTN release binaries for the following platforms:
|
||||
# - Linux (x86_64_v2)
|
||||
# - Linux (arm64v8.0)
|
||||
# - Linux (arm64v8.7+crypto)
|
||||
# - Windows (x86_64_v2)
|
||||
# - Windows (arm64v8.7+crypto)
|
||||
|
||||
create_release_binaries() {
|
||||
printf '\nGenerating release binaries...\n'
|
||||
cd ..
|
||||
GOOS=linux CGO_ENABLED=0 GOAMD64=v1 go build -o ./packaging/1output/mutn-linux-x86_64_v1 -ldflags="-s -w" -trimpath ./mutn.go
|
||||
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -o ./packaging/1output/mutn-linux-aarch64 -ldflags="-s -w" -trimpath ./mutn.go
|
||||
GOOS=windows CGO_ENABLED=0 GOAMD64=v1 go build -o ./packaging/1output/mutn-windows-x86_64_v1.exe -ldflags="-s -w" -trimpath ./mutn.go
|
||||
GOOS=windows GOARCH=arm64 CGO_ENABLED=0 go build -o ./packaging/1output/mutn-windows-aarch64.exe -ldflags="-s -w" -trimpath ./mutn.go
|
||||
GOOS=linux CGO_ENABLED=0 GOAMD64=v2 go build -o ./packaging/1output/mutn-linux-x86_64_v2 -ldflags="-s -w" -trimpath -tags=stxAll ./mutn.go
|
||||
GOOS=linux GOARCH=arm64 GOARM64=v8.0 CGO_ENABLED=0 go build -o ./packaging/1output/mutn-linux-arm64v8.0 -ldflags="-s -w" -trimpath -tags=stxAll ./mutn.go
|
||||
GOOS=linux GOARCH=arm64 GOARM64=v8.7,crypto CGO_ENABLED=0 go build -o ./packaging/1output/mutn-linux-arm64v8.7+crypto -ldflags="-s -w" -trimpath -tags=stxAll ./mutn.go
|
||||
GOOS=windows CGO_ENABLED=0 GOAMD64=v2 go build -o ./packaging/1output/mutn-windows-x86_64_v2.exe -ldflags="-s -w" -trimpath -tags=stxAll ./mutn.go
|
||||
GOOS=windows GOARCH=arm64 GOARM64=v8.7,crypto CGO_ENABLED=0 go build -o ./packaging/1output/mutn-windows-arm64v8.7+crypto.exe -ldflags="-s -w" -trimpath -tags=stxAll ./mutn.go
|
||||
cd ./packaging
|
||||
}
|
||||
|
||||
+7
-2
@@ -3,6 +3,8 @@ package cli
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/rwinkhart/go-boilerplate/front"
|
||||
"github.com/rwinkhart/libmutton/global"
|
||||
"golang.org/x/term"
|
||||
)
|
||||
|
||||
@@ -11,8 +13,11 @@ var (
|
||||
)
|
||||
|
||||
const (
|
||||
MUTNVersion = "0.2.2" // untagged releases feature a letter suffix corresponding to the eventual release version, e.g "0.2.A" -> "0.2.0", "0.2.B" -> "0.2.1"
|
||||
MUTNVersion = "0.3.1" // untagged releases feature a letter suffix corresponding to the eventual release version, e.g "0.2.A" -> "0.2.0", "0.2.B" -> "0.2.1"
|
||||
|
||||
AnsiBold = "\033[1m"
|
||||
ansiBlackOnWhite = "\033[38;5;0;48;5;15m"
|
||||
)
|
||||
|
||||
func init() {
|
||||
global.GetPassword = front.InputHidden
|
||||
}
|
||||
|
||||
+18
-23
@@ -1,52 +1,47 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/rwinkhart/go-boilerplate/back"
|
||||
"github.com/rwinkhart/go-boilerplate/front"
|
||||
"github.com/rwinkhart/go-boilerplate/other"
|
||||
"github.com/rwinkhart/libmutton/core"
|
||||
)
|
||||
|
||||
// AddEntry creates a new entry at targetLocation by taking user input via CLI prompts.
|
||||
// Requires: entryType (0 = standard password entry, 1 = auto-generated password entry, 2 = note-only entry).
|
||||
func AddEntry(targetLocation string, hideSecrets bool, entryType uint8) {
|
||||
// ensure target location does not already exist
|
||||
_, isAccessible := core.TargetIsFile(targetLocation, false, 0)
|
||||
if isAccessible {
|
||||
fmt.Println(core.AnsiError + "Target location already exists" + core.AnsiReset)
|
||||
os.Exit(core.ErrorTargetExists)
|
||||
// ensure targetLocation is valid
|
||||
_, err := core.EntryAddPrecheck(targetLocation)
|
||||
if err != nil {
|
||||
other.PrintError("Failed to add entry: "+err.Error(), back.ErrorWrite)
|
||||
}
|
||||
|
||||
// ensure target containing directory exists and is a directory (not a file)
|
||||
core.TargetIsFile(targetLocation[:strings.LastIndex(targetLocation, core.PathSeparator)], true, 1)
|
||||
|
||||
var unencryptedEntry []string
|
||||
var decryptedEntry []string
|
||||
|
||||
if entryType < 2 {
|
||||
username := input("Username:")
|
||||
username := front.Input("Username:")
|
||||
|
||||
// determine whether to generate the password
|
||||
var password string
|
||||
if entryType == 0 {
|
||||
password = inputHidden("Password:")
|
||||
password = string(front.InputHidden("Password:"))
|
||||
} else {
|
||||
password = core.StringGen(inputInt("Password length:", -1), inputBinary("Generate a complex (special characters) password?"), 0.2, false)
|
||||
password = inputPasswordGen()
|
||||
}
|
||||
|
||||
totp := inputHidden("TOTP secret:")
|
||||
url := input("URL:")
|
||||
if inputBinary("Add a note to this entry?") {
|
||||
totp := string(front.InputHidden("TOTP secret:"))
|
||||
url := front.Input("URL:")
|
||||
if front.InputBinary("Add a note to this entry?") {
|
||||
note, _ := editNote([]string{})
|
||||
unencryptedEntry = append([]string{password, username, totp, url}, note...)
|
||||
decryptedEntry = append([]string{password, username, totp, url}, note...)
|
||||
} else {
|
||||
unencryptedEntry = []string{password, username, totp, url}
|
||||
decryptedEntry = []string{password, username, totp, url}
|
||||
}
|
||||
} else {
|
||||
note, _ := editNote([]string{})
|
||||
unencryptedEntry = append([]string{"", "", "", ""}, note...)
|
||||
decryptedEntry = append([]string{"", "", "", ""}, note...)
|
||||
}
|
||||
|
||||
// write and preview the new entry
|
||||
writeEntryCLI(targetLocation, unencryptedEntry, hideSecrets, false)
|
||||
writeEntryCLI(targetLocation, decryptedEntry, hideSecrets)
|
||||
}
|
||||
|
||||
+63
-34
@@ -2,21 +2,26 @@ package cli
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/rwinkhart/go-boilerplate/back"
|
||||
"github.com/rwinkhart/go-boilerplate/front"
|
||||
"github.com/rwinkhart/go-boilerplate/other"
|
||||
"github.com/rwinkhart/libmutton/cfg"
|
||||
"github.com/rwinkhart/libmutton/core"
|
||||
"github.com/rwinkhart/libmutton/sync"
|
||||
"github.com/rwinkhart/libmutton/syncclient"
|
||||
)
|
||||
|
||||
// RenameCli renames an entry at oldLocationIncomplete to a new location (user input) on both the client and the server.
|
||||
func RenameCli(oldLocationIncomplete string) {
|
||||
// prompt user for new location and rename
|
||||
newLocationIncomplete := input("New location:")
|
||||
sync.RenameRemoteFromClient(oldLocationIncomplete, newLocationIncomplete)
|
||||
newLocationIncomplete := front.Input("New location:")
|
||||
err := syncclient.RenameRemoteFromClient(oldLocationIncomplete, newLocationIncomplete)
|
||||
if err != nil {
|
||||
other.PrintError("Failed to rename entry: "+err.Error(), back.ErrorWrite)
|
||||
}
|
||||
|
||||
// exit is done from sync.RenameRemoteFromClient
|
||||
}
|
||||
@@ -24,61 +29,83 @@ func RenameCli(oldLocationIncomplete string) {
|
||||
// EditEntryField edits a field of an entry at targetLocation (user input).
|
||||
func EditEntryField(targetLocation string, hideSecrets bool, field int) {
|
||||
// fetch old entry data (with all required lines present)
|
||||
unencryptedEntry := core.GetOldEntryData(targetLocation, field)
|
||||
decryptedEntry, err := core.GetOldEntryData(targetLocation, field)
|
||||
if err != nil {
|
||||
other.PrintError("Failed to fetch entry data: "+err.Error(), back.ErrorRead)
|
||||
}
|
||||
|
||||
// edit the field
|
||||
switch field {
|
||||
case 0:
|
||||
unencryptedEntry[field] = inputHidden("Password:")
|
||||
decryptedEntry[field] = string(front.InputHidden("Password:"))
|
||||
case 1:
|
||||
unencryptedEntry[field] = input("Username:")
|
||||
decryptedEntry[field] = front.Input("Username:")
|
||||
case 2:
|
||||
unencryptedEntry[field] = inputHidden("TOTP secret:")
|
||||
decryptedEntry[field] = string(front.InputHidden("TOTP secret:"))
|
||||
case 3:
|
||||
unencryptedEntry[field] = input("URL:")
|
||||
decryptedEntry[field] = front.Input("URL:")
|
||||
case 4: // edit notes fields
|
||||
// store note and non-note data separately
|
||||
nonNoteData := unencryptedEntry[:4]
|
||||
noteData := unencryptedEntry[4:]
|
||||
fieldsMain := decryptedEntry[:4]
|
||||
fieldsNote := decryptedEntry[4:]
|
||||
|
||||
// edit the note
|
||||
editedNote, noteEdited := editNote(noteData)
|
||||
editedNote, noteEdited := editNote(fieldsNote)
|
||||
if !noteEdited { // exit early if the note was not edited
|
||||
fmt.Println(core.AnsiError + "Entry is unchanged" + core.AnsiReset)
|
||||
os.Exit(0)
|
||||
other.PrintError("Entry is unchanged", 0)
|
||||
}
|
||||
unencryptedEntry = append(nonNoteData, editedNote...)
|
||||
decryptedEntry = append(fieldsMain, editedNote...)
|
||||
}
|
||||
|
||||
// write and preview the modified entry
|
||||
writeEntryCLI(targetLocation, unencryptedEntry, hideSecrets, false)
|
||||
writeEntryCLI(targetLocation, decryptedEntry, hideSecrets)
|
||||
}
|
||||
|
||||
// GenUpdate generates a new password for an entry at targetLocation (user input).
|
||||
func GenUpdate(targetLocation string, hideSecrets bool) {
|
||||
// fetch old entry data
|
||||
unencryptedEntry := core.GetOldEntryData(targetLocation, 0)
|
||||
decryptedEntry, err := core.GetOldEntryData(targetLocation, 0)
|
||||
if err != nil {
|
||||
other.PrintError("Failed to fetch entry data: "+err.Error(), back.ErrorRead)
|
||||
}
|
||||
|
||||
// generate a new password
|
||||
unencryptedEntry[0] = core.StringGen(inputInt("Password length:", -1), inputBinary("Generate a complex (special characters) password?"), 0.2, false)
|
||||
decryptedEntry[0] = inputPasswordGen()
|
||||
|
||||
// write and preview the modified entry
|
||||
writeEntryCLI(targetLocation, unencryptedEntry, hideSecrets, false)
|
||||
writeEntryCLI(targetLocation, decryptedEntry, hideSecrets)
|
||||
}
|
||||
|
||||
// editNote uses the user-specified text editor to edit an existing note (or create a new one if baseNote is empty).
|
||||
// Returns the edited note and a boolean indicating whether the note was edited.
|
||||
func editNote(baseNote []string) ([]string, bool) {
|
||||
tempFile := core.CreateTempFile()
|
||||
tempFile, err := back.CreateTempFile()
|
||||
if err != nil {
|
||||
other.PrintError("Failed to create temporary note file: "+err.Error(), back.ErrorWrite)
|
||||
}
|
||||
defer func(name string) {
|
||||
_ = os.Remove(name) // error ignored; if the file could be created, it can probably be removed
|
||||
}(tempFile.Name())
|
||||
|
||||
// fetch the user's text editor
|
||||
editor := core.ParseConfig([][2]string{{"MUTN", "textEditor"}}, "")[0]
|
||||
editorCfg, err := cfg.ParseConfig([][2]string{{"MUTN", "textEditor"}})
|
||||
if err != nil {
|
||||
other.PrintError("Failed to retrieve text editor from libmutton.ini\n\nPlease specify one with \"mutn tweak\"", back.ErrorRead)
|
||||
}
|
||||
editor := editorCfg[0]
|
||||
|
||||
// write baseNote to tempFile (if it is not empty)
|
||||
if len(baseNote) > 0 {
|
||||
baseNoteLen := len(baseNote)
|
||||
switch baseNoteLen {
|
||||
case 0: // do not write empty baseNote to file
|
||||
case 1: // truncate baseNote if its only length is an empty string (do not write to file)
|
||||
if baseNote[0] == "" {
|
||||
baseNote = []string{}
|
||||
baseNoteLen = 0
|
||||
break
|
||||
}
|
||||
fallthrough // if baseNote contained real data, write it to tempFile
|
||||
default: // write baseNote to tempFile for external editing
|
||||
for _, line := range baseNote {
|
||||
_, _ = tempFile.WriteString(line + "\n")
|
||||
}
|
||||
@@ -92,15 +119,15 @@ func editNote(baseNote []string) ([]string, bool) {
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stdin = os.Stdin
|
||||
cmd.Stderr = os.Stderr
|
||||
err := cmd.Run()
|
||||
err = cmd.Run()
|
||||
if err != nil {
|
||||
panic(core.AnsiError + "Failed to write note with " + editor + core.AnsiReset) // panic is used to ensure the tempFile is removed, as per the defer statement
|
||||
panic(back.AnsiError + "Failed to write note with " + editor + back.AnsiReset) // panic is used to ensure the tempFile is removed, as per the defer statement
|
||||
}
|
||||
|
||||
// open the tempFile for reading
|
||||
tempFile, err = os.Open(tempFile.Name())
|
||||
if err != nil {
|
||||
panic(core.AnsiError + "Failed to read note written with " + editor + core.AnsiReset) // panic is used to ensure the tempFile is removed, as per the defer statement
|
||||
panic(back.AnsiError + "Failed to read note written with " + editor + back.AnsiReset) // panic is used to ensure the tempFile is removed, as per the defer statement
|
||||
}
|
||||
|
||||
// read the edited note from the tempFile
|
||||
@@ -114,17 +141,19 @@ func editNote(baseNote []string) ([]string, bool) {
|
||||
_ = tempFile.Close() // error ignored; if the file could be opened, it can probably be closed
|
||||
|
||||
// remove trailing empty strings from the edited note
|
||||
note = core.RemoveTrailingEmptyStrings(note)
|
||||
note = back.RemoveTrailingEmptyStrings(note)
|
||||
|
||||
// trim trailing whitespace from each note line
|
||||
for i, line := range note {
|
||||
note[i] = strings.TrimRight(line, " \t\r\n")
|
||||
}
|
||||
// clamp trailing whitespace in each note line
|
||||
core.ClampTrailingWhitespace(note)
|
||||
|
||||
// return the edited note if it is different from baseNote
|
||||
if !reflect.DeepEqual(note, baseNote) {
|
||||
// return the edited note if:
|
||||
// it is different from baseNote AND
|
||||
// [it is not empty (prevent needless writes when adding blank notes) OR
|
||||
// it has a different length from baseNote (allow removing notes from entries)]
|
||||
noteLen := len(note)
|
||||
if !reflect.DeepEqual(note, baseNote) && (noteLen > 0 || baseNoteLen != noteLen) {
|
||||
return note, true
|
||||
} else {
|
||||
return []string{}, false
|
||||
return nil, false
|
||||
}
|
||||
}
|
||||
|
||||
+13
-9
@@ -5,15 +5,16 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/rwinkhart/libmutton/core"
|
||||
"github.com/rwinkhart/libmutton/sync"
|
||||
"github.com/rwinkhart/go-boilerplate/back"
|
||||
"github.com/rwinkhart/go-boilerplate/other"
|
||||
"github.com/rwinkhart/libmutton/synccommon"
|
||||
)
|
||||
|
||||
// ANSI color constants used only in this file
|
||||
const (
|
||||
ansiAlternateEntryColor = "\033[38;5;8m"
|
||||
ansiDirectoryHeader = "\033[38;5;7;48;5;8m"
|
||||
ansiEmptyDirectoryWarning = "\033[38;5;11m"
|
||||
ansiEmptyDirectoryWarning = "\033[38;5;3m"
|
||||
)
|
||||
|
||||
// determineIndentation calculates and returns the final visual indentation multiplier (needed to adjust indentation for skipped parent directories); also subtracts "old" text from directory header.
|
||||
@@ -72,17 +73,20 @@ func printFileEntry(entry string, lastSlash, charCounter, indent int, colorAlter
|
||||
}
|
||||
|
||||
// print fileEntryName to screen
|
||||
fmt.Printf("%s%s%s ", colorCode, fileEntryName, core.AnsiReset)
|
||||
fmt.Printf("%s%s%s ", colorCode, fileEntryName, back.AnsiReset)
|
||||
|
||||
return charCounter, colorAlternator
|
||||
}
|
||||
|
||||
// EntryListGen generates and displays the full libmutton entry list.
|
||||
func EntryListGen() {
|
||||
fileList, dirList := sync.WalkEntryDir()
|
||||
fileList, dirList, err := synccommon.WalkEntryDir()
|
||||
if err != nil {
|
||||
other.PrintError("Failed to generate entry list: "+err.Error(), back.ErrorRead)
|
||||
}
|
||||
|
||||
// print header bar w/total entry count
|
||||
fmt.Print("\n"+ansiBlackOnWhite, len(fileList), " libmutton entries:"+core.AnsiReset)
|
||||
fmt.Print("\n"+ansiBlackOnWhite, len(fileList), " libmutton entries:"+back.AnsiReset)
|
||||
|
||||
// dirList iteration
|
||||
dirListLength := len(dirList) // save length for multiple references below
|
||||
@@ -128,7 +132,7 @@ func EntryListGen() {
|
||||
containsFiles = true
|
||||
skippedDirList[i] = false // the directory header is being printed, indicate that it is not being skipped
|
||||
indent, vanityDirectory = determineIndentation(skippedDirList, dirList, i) // calculate the final indentation multiplier
|
||||
fmt.Printf("\n\n"+strings.Repeat(" ", indent*2)+ansiDirectoryHeader+"%s/"+core.AnsiReset+"\n", vanityDirectory)
|
||||
fmt.Printf("\n\n"+strings.Repeat(" ", indent*2)+ansiDirectoryHeader+"%s/"+back.AnsiReset+"\n", vanityDirectory)
|
||||
}
|
||||
|
||||
charCounter, colorAlternator = printFileEntry(file, lastSlash, charCounter, indent, colorAlternator)
|
||||
@@ -140,8 +144,8 @@ func EntryListGen() {
|
||||
if dirListLength > 1 { // and directories besides the root-level exist... display directory header and empty directory warning
|
||||
skippedDirList[i] = false // the directory header is being printed, indicate that it is not being skipped
|
||||
indent, vanityDirectory = determineIndentation(skippedDirList, dirList, i) // calculate the final indentation multiplier
|
||||
fmt.Printf("\n\n"+strings.Repeat(" ", indent*2)+ansiDirectoryHeader+"%s/"+core.AnsiReset+"\n", vanityDirectory)
|
||||
fmt.Print(strings.Repeat(" ", indent*2) + ansiEmptyDirectoryWarning + "-empty directory-" + core.AnsiReset)
|
||||
fmt.Printf("\n\n"+strings.Repeat(" ", indent*2)+ansiDirectoryHeader+"%s/"+back.AnsiReset+"\n", vanityDirectory)
|
||||
fmt.Print(strings.Repeat(" ", indent*2) + ansiEmptyDirectoryWarning + "-empty directory-" + back.AnsiReset)
|
||||
} else { // warn if the only thing that exists is the root-level directory
|
||||
fmt.Print("\n\nNothing's here! For help creating your first entry, run \"mutn help\".")
|
||||
}
|
||||
|
||||
+36
-19
@@ -5,8 +5,12 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/rwinkhart/libmutton/core"
|
||||
"github.com/rwinkhart/libmutton/sync"
|
||||
"github.com/charmbracelet/glamour"
|
||||
"github.com/rwinkhart/go-boilerplate/back"
|
||||
"github.com/rwinkhart/go-boilerplate/other"
|
||||
"github.com/rwinkhart/libmutton/crypt"
|
||||
"github.com/rwinkhart/libmutton/global"
|
||||
"github.com/rwinkhart/libmutton/syncclient"
|
||||
)
|
||||
|
||||
const ansiShownPassword = "\033[38;5;10m"
|
||||
@@ -15,66 +19,79 @@ const ansiShownPassword = "\033[38;5;10m"
|
||||
func EntryReader(decryptedEntry []string, hideSecrets, syncEnabled bool) {
|
||||
fmt.Println()
|
||||
|
||||
fieldLoop:
|
||||
for field := range decryptedEntry {
|
||||
switch field {
|
||||
case 0:
|
||||
// if the first field (password) is not empty, print it
|
||||
if decryptedEntry[0] != "" {
|
||||
if !hideSecrets {
|
||||
fmt.Print(ansiDirectoryHeader + "Password:" + core.AnsiReset + "\n" + ansiShownPassword + decryptedEntry[0] + core.AnsiReset + "\n\n")
|
||||
fmt.Print(ansiDirectoryHeader + "Password:" + back.AnsiReset + "\n" + ansiShownPassword + decryptedEntry[0] + back.AnsiReset + "\n\n")
|
||||
} else {
|
||||
fmt.Print(ansiDirectoryHeader + "Password:" + core.AnsiReset + "\n" + ansiEmptyDirectoryWarning + "End command in \"show\" or \"-s\" to view" + core.AnsiReset + "\n\n")
|
||||
fmt.Print(ansiDirectoryHeader + "Password:" + back.AnsiReset + "\n" + ansiEmptyDirectoryWarning + "End command in \"show\" or \"-s\" to view" + back.AnsiReset + "\n\n")
|
||||
}
|
||||
}
|
||||
case 1:
|
||||
// if the second field (username) is not empty, print it
|
||||
if decryptedEntry[1] != "" {
|
||||
fmt.Print(ansiDirectoryHeader + "Username:" + core.AnsiReset + "\n" + decryptedEntry[1] + "\n\n")
|
||||
fmt.Print(ansiDirectoryHeader + "Username:" + back.AnsiReset + "\n" + decryptedEntry[1] + "\n\n")
|
||||
}
|
||||
case 2:
|
||||
// if the third field (TOTP secret) is not empty, print it
|
||||
if decryptedEntry[2] != "" {
|
||||
if !hideSecrets {
|
||||
fmt.Print(ansiDirectoryHeader + "TOTP Secret:" + core.AnsiReset + "\n" + ansiShownPassword + decryptedEntry[2] + core.AnsiReset + "\n\n")
|
||||
fmt.Print(ansiDirectoryHeader + "TOTP Secret:" + back.AnsiReset + "\n" + ansiShownPassword + decryptedEntry[2] + back.AnsiReset + "\n\n")
|
||||
} else {
|
||||
fmt.Print(ansiDirectoryHeader + "TOTP Secret:" + core.AnsiReset + "\n" + ansiEmptyDirectoryWarning + "End command in \"show\" or \"-s\" to view" + core.AnsiReset + "\n\n")
|
||||
fmt.Print(ansiDirectoryHeader + "TOTP Secret:" + back.AnsiReset + "\n" + ansiEmptyDirectoryWarning + "End command in \"show\" or \"-s\" to view" + back.AnsiReset + "\n\n")
|
||||
}
|
||||
}
|
||||
case 3:
|
||||
// if the fourth field (url) is not empty, print it
|
||||
if decryptedEntry[3] != "" {
|
||||
fmt.Print(ansiDirectoryHeader + "URL:" + core.AnsiReset + "\n" + decryptedEntry[3] + "\n\n")
|
||||
fmt.Print(ansiDirectoryHeader + "URL:" + back.AnsiReset + "\n" + decryptedEntry[3] + "\n\n")
|
||||
}
|
||||
case 4:
|
||||
// print the notes header
|
||||
fmt.Println(ansiDirectoryHeader + "Notes:" + core.AnsiReset)
|
||||
fmt.Println(ansiDirectoryHeader + "Notes:" + back.AnsiReset)
|
||||
|
||||
// combine remaining fields into a single string (to support Markdown rendering)
|
||||
var notesSlice []string
|
||||
var noteLines []string
|
||||
for ; field < len(decryptedEntry); field++ {
|
||||
notesSlice = append(notesSlice, decryptedEntry[field])
|
||||
noteLines = append(noteLines, decryptedEntry[field])
|
||||
}
|
||||
joinedString := strings.Join(notesSlice, "\n")
|
||||
|
||||
// print notes to stdout
|
||||
renderNote(&joinedString)
|
||||
// render notes as Markdown
|
||||
r, _ := glamour.NewTermRenderer(glamour.WithStylesFromJSONBytes(glamourStyle()), glamour.WithPreservedNewLines(), glamour.WithWordWrap(width))
|
||||
markdownNotesString, _ := r.Render(strings.Join(noteLines, "\n"))
|
||||
|
||||
// print the rendered Markdown notes
|
||||
fmt.Print(markdownNotesString)
|
||||
|
||||
// break after notes have been printed
|
||||
break
|
||||
break fieldLoop
|
||||
}
|
||||
}
|
||||
|
||||
if syncEnabled {
|
||||
sync.RunJob(false)
|
||||
_, err := syncclient.RunJob(false)
|
||||
if err != nil {
|
||||
other.PrintError("Failed to sync entries: "+err.Error(), global.ErrorSyncProcess)
|
||||
}
|
||||
}
|
||||
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
// EntryReaderDecrypt is a wrapper for EntryReader that first decrypts a GPG-encrypted file before sending it to EntryReader.
|
||||
// EntryReaderDecrypt is a wrapper for EntryReader that first decrypts an RCW-wrapped file before sending it to EntryReader.
|
||||
func EntryReaderDecrypt(targetLocation string, hideSecrets bool) {
|
||||
if isFile, _ := core.TargetIsFile(targetLocation, true, 2); isFile {
|
||||
EntryReader(core.DecryptGPG(targetLocation), hideSecrets, false) // never sync if decrypting straight to EntryReader, as this means the entry could not have been modified
|
||||
_, err := back.TargetIsFile(targetLocation, true)
|
||||
if err != nil { // if the location does not exist or is a directory...
|
||||
other.PrintError("Failed to verify target location: "+err.Error(), back.ErrorTargetNotFound)
|
||||
}
|
||||
decSlice, err := crypt.DecryptFileToSlice(targetLocation)
|
||||
if err != nil {
|
||||
other.PrintError("Failed to decrypt entry: "+err.Error(), global.ErrorDecryption)
|
||||
}
|
||||
EntryReader(decSlice, hideSecrets, false) // never sync if decrypting straight to EntryReader, as this means the entry could not have been modified
|
||||
// do not exit, as this is the job of EntryReader
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
//go:build !noMarkdown
|
||||
|
||||
package cli
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/charmbracelet/glamour"
|
||||
)
|
||||
|
||||
// renderNote renders the notes section of an entry (in Markdown) to stdout.
|
||||
func renderNote(note *string) {
|
||||
r, _ := glamour.NewTermRenderer(glamour.WithStylesFromJSONBytes(glamourStyle()), glamour.WithPreservedNewLines(), glamour.WithWordWrap(width))
|
||||
markdownNotesString, _ := r.Render(*note)
|
||||
|
||||
// print markdown-rendered notes
|
||||
fmt.Print(markdownNotesString)
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
//go:build noMarkdown
|
||||
|
||||
package cli
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// renderNote prints the notes section of an entry to stdout (when Markdown rendering is disabled).
|
||||
func renderNote(note *string) {
|
||||
fmt.Print("\n" + *note + "\n\n")
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"cmp"
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
"github.com/rwinkhart/libmutton/core"
|
||||
"github.com/rwinkhart/libmutton/sync"
|
||||
)
|
||||
|
||||
// TempInitCli initializes the MUTN environment based on user input.
|
||||
func TempInitCli() {
|
||||
// gpgID
|
||||
var gpgID string
|
||||
if inputBinary("Auto-generate GPG key?") {
|
||||
gpgID = core.GpgKeyGen()
|
||||
} else {
|
||||
// select GPG key from menu
|
||||
uidSlice := core.GpgUIDListGen()
|
||||
gpgIDInt := inputMenuGen("Select GPG key:", uidSlice)
|
||||
if gpgIDInt == 0 {
|
||||
fmt.Println(core.AnsiError + "No GPG keys found - please generate one" + core.AnsiReset)
|
||||
os.Exit(core.ErrorTargetNotFound)
|
||||
}
|
||||
gpgID = uidSlice[gpgIDInt-1]
|
||||
}
|
||||
|
||||
// textEditor
|
||||
textEditor := cmp.Or(input("Text editor (leave blank for $EDITOR, falls back to \""+fallbackEditor+"\"):"), os.Getenv("EDITOR"), fallbackEditor)
|
||||
|
||||
// SSH info
|
||||
configSSH := inputBinary("Configure SSH settings (for synchronization)?")
|
||||
if configSSH {
|
||||
// necessary SSH info
|
||||
fmt.Println(AnsiBold + "\nNote:" + core.AnsiReset + " Only key-based authentication is supported (keys may optionally be passphrase-protected).\nThe remote server must already be in your ~" + core.PathSeparator + ".ssh" + core.PathSeparator + "known_hosts file.")
|
||||
sshUser := input("Remote SSH username:")
|
||||
sshPort := input("Remote SSH port:")
|
||||
sshIP := input("Remote SSH IP/domain:")
|
||||
|
||||
// prompt for and ensure existence of SSH identity file
|
||||
var sshKey string
|
||||
var sshKeyIsFile bool
|
||||
for !sshKeyIsFile {
|
||||
fallbackSSHKey := core.Home + core.PathSeparator + ".ssh" + core.PathSeparator + "id_ed25519"
|
||||
sshKey = cmp.Or(expandPathWithHome(input("SSH private identity file path (falls back to \""+fallbackSSHKey+"\"):")), fallbackSSHKey)
|
||||
sshKeyIsFile, _ = core.TargetIsFile(sshKey, false, 0)
|
||||
if !sshKeyIsFile {
|
||||
fmt.Println(core.AnsiError+"SSH identity file not found:", sshKey+core.AnsiReset)
|
||||
}
|
||||
}
|
||||
|
||||
sshKeyProtected := inputBinary("Is the identity file password-protected?")
|
||||
|
||||
// initialize libmutton directories
|
||||
oldDeviceID := core.DirInit(false)
|
||||
|
||||
// write config file (temporarily assigns sshEntryRoot and sshIsWindows to null to pass initial device ID registration)
|
||||
core.WriteConfig([][3]string{{"MUTN", "textEditor", textEditor}, {"LIBMUTTON", "gpgID", gpgID}, {"LIBMUTTON", "sshUser", sshUser}, {"LIBMUTTON", "sshIP", sshIP}, {"LIBMUTTON", "sshPort", sshPort}, {"LIBMUTTON", "sshKey", sshKey}, {"LIBMUTTON", "sshKeyProtected", strconv.FormatBool(sshKeyProtected)}, {"LIBMUTTON", "sshEntryRoot", "null"}, {"LIBMUTTON", "sshIsWindows", "false"}}, false)
|
||||
|
||||
// generate and register device ID
|
||||
sshEntryRoot, sshIsWindows := sync.DeviceIDGen(oldDeviceID)
|
||||
|
||||
// update config file with sshEntryRoot and sshIsWindows
|
||||
core.WriteConfig([][3]string{{"LIBMUTTON", "sshEntryRoot", sshEntryRoot}, {"LIBMUTTON", "sshIsWindows", sshIsWindows}}, true)
|
||||
} else {
|
||||
// initialize libmutton directories
|
||||
core.DirInit(false)
|
||||
|
||||
// write config file
|
||||
core.WriteConfig([][3]string{{"MUTN", "textEditor", textEditor}, {"LIBMUTTON", "gpgID", gpgID}}, false)
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -2,4 +2,4 @@
|
||||
|
||||
package cli
|
||||
|
||||
const fallbackEditor = "vi" // vi is pre-installed on most UNIX-like systems
|
||||
const FallbackEditor = "vi" // vi is pre-installed on most UNIX-like systems
|
||||
|
||||
+1
-1
@@ -2,4 +2,4 @@
|
||||
|
||||
package cli
|
||||
|
||||
const fallbackEditor = "nvim" // since there is no pre-installed CLI editor on Windows, default to the most popular one
|
||||
const FallbackEditor = "edit" // "edit" is the Microsoft-developed CLI text editor
|
||||
|
||||
+34
-32
@@ -4,7 +4,8 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/rwinkhart/libmutton/core"
|
||||
"github.com/rwinkhart/go-boilerplate/back"
|
||||
"github.com/rwinkhart/libmutton/global"
|
||||
)
|
||||
|
||||
// ANSI color constants used only in this file
|
||||
@@ -14,16 +15,17 @@ const (
|
||||
)
|
||||
|
||||
func HelpMain() {
|
||||
fmt.Print(AnsiBold + "\nMUTN | Copyright (c) 2024 Randall Winkhart\n" + core.AnsiReset + `
|
||||
fmt.Print(back.AnsiBold + "\nMUTN | Copyright (c) 2024-2025 Randall Winkhart\n" + back.AnsiReset + `
|
||||
This software exists under the MIT license; you may redistribute it under certain conditions.
|
||||
This program comes with absolutely no warranty; type "mutn version" for details.
|
||||
|
||||
` + AnsiBold + "Usage:" + core.AnsiReset + ` mutn [/<entry name> [argument] [option]] | [argument]
|
||||
` + back.AnsiBold + "Usage:" + back.AnsiReset + ` mutn [/<entry name> [argument] [option]] | [argument]
|
||||
|
||||
` + AnsiBold + "Arguments:" + core.AnsiReset + `
|
||||
` + back.AnsiBold + "Arguments:" + back.AnsiReset + `
|
||||
help Bring up this menu
|
||||
version Display version and license information
|
||||
init Set up MUTN (generates libmutton.ini)
|
||||
tweak Make changes to the libmutton configuration
|
||||
copy Copy details of an entry to your clipboard
|
||||
edit Edit an existing entry
|
||||
gen Generate a new password
|
||||
@@ -31,7 +33,7 @@ This program comes with absolutely no warranty; type "mutn version" for details.
|
||||
shear Delete an existing entry
|
||||
sync Manually sync the entry directory
|
||||
|
||||
` + AnsiBold + "Options:" + core.AnsiReset + `
|
||||
` + back.AnsiBold + "Options:" + back.AnsiReset + `
|
||||
copy:
|
||||
password|-pw|<blank> Copy the password in an entry to your clipboard
|
||||
username|-u Copy the username in an entry to your clipboard
|
||||
@@ -52,17 +54,17 @@ This program comes with absolutely no warranty; type "mutn version" for details.
|
||||
note|-n Add a note entry
|
||||
folder|-f Add a new folder for entries
|
||||
|
||||
` + AnsiBold + "Tip 1:" + core.AnsiReset + ` You can quickly read an entry with "mutn /<entry name>"
|
||||
` + AnsiBold + "Tip 2:" + core.AnsiReset + ` Type "mutn" (no arguments/options) to view a list of saved entries
|
||||
` + AnsiBold + "Tip 3:" + core.AnsiReset + ` Provide "add", "edit", "copy", or "gen" as the only argument to receive more specific help
|
||||
` + AnsiBold + "Tip 4:" + core.AnsiReset + " Using \"add\", \"edit\", or \"copy\" without specifying an option (field) will default to \"password\"\n\n")
|
||||
` + back.AnsiBold + "Tip 1:" + back.AnsiReset + ` You can quickly read an entry with "mutn /<entry name>"
|
||||
` + back.AnsiBold + "Tip 2:" + back.AnsiReset + ` Type "mutn" (no arguments/options) to view a list of saved entries
|
||||
` + back.AnsiBold + "Tip 3:" + back.AnsiReset + ` Provide "add", "edit", "copy", or "gen" as the only argument to receive more specific help
|
||||
` + back.AnsiBold + "Tip 4:" + back.AnsiReset + " Using \"add\", \"edit\", or \"copy\" without specifying an option (field) will default to \"password\"\n\n")
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
func HelpAdd() {
|
||||
fmt.Print(AnsiBold + "\nUsage:" + core.AnsiReset + ` mutn /<entry name> add <option>
|
||||
fmt.Print(back.AnsiBold + "\nUsage:" + back.AnsiReset + ` mutn /<entry name> add <option>
|
||||
|
||||
` + AnsiBold + "Options:" + core.AnsiReset + `
|
||||
` + back.AnsiBold + "Options:" + back.AnsiReset + `
|
||||
add:
|
||||
password|-pw|<blank> Add a password entry
|
||||
note|-n Add a note entry
|
||||
@@ -71,9 +73,9 @@ func HelpAdd() {
|
||||
}
|
||||
|
||||
func HelpEdit() {
|
||||
fmt.Print(AnsiBold + "\nUsage:" + core.AnsiReset + ` mutn /<entry name> edit <option>
|
||||
fmt.Print(back.AnsiBold + "\nUsage:" + back.AnsiReset + ` mutn /<entry name> edit <option>
|
||||
|
||||
` + AnsiBold + "Options:" + core.AnsiReset + `
|
||||
` + back.AnsiBold + "Options:" + back.AnsiReset + `
|
||||
edit:
|
||||
password|-pw|<blank> Change the password in an entry
|
||||
username|-u Change the username in an entry
|
||||
@@ -85,9 +87,9 @@ func HelpEdit() {
|
||||
}
|
||||
|
||||
func HelpCopy() {
|
||||
fmt.Print(AnsiBold + "\nUsage:" + core.AnsiReset + ` mutn /<entry name> copy <option>
|
||||
fmt.Print(back.AnsiBold + "\nUsage:" + back.AnsiReset + ` mutn /<entry name> copy <option>
|
||||
|
||||
` + AnsiBold + "Options:" + core.AnsiReset + `
|
||||
` + back.AnsiBold + "Options:" + back.AnsiReset + `
|
||||
copy:
|
||||
password|-pw|<blank> Copy the password in an entry to your clipboard
|
||||
username|-u Copy the username in an entry to your clipboard
|
||||
@@ -98,18 +100,18 @@ func HelpCopy() {
|
||||
}
|
||||
|
||||
func HelpGen() {
|
||||
fmt.Print(AnsiBold + "\nUsage:" + core.AnsiReset + ` mutn /<entry name> gen [option]
|
||||
fmt.Print(back.AnsiBold + "\nUsage:" + back.AnsiReset + ` mutn /<entry name> gen [option]
|
||||
|
||||
` + AnsiBold + "Options:" + core.AnsiReset + `
|
||||
` + back.AnsiBold + "Options:" + back.AnsiReset + `
|
||||
gen:
|
||||
update|-u Generate a password for an existing entry
|
||||
|
||||
` + AnsiBold + "Tip:" + core.AnsiReset + " If no options are provided, a new password entry is generated\n\n")
|
||||
` + back.AnsiBold + "Tip:" + back.AnsiReset + " If no options are provided, a new password entry is generated\n\n")
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
func MITLicense() {
|
||||
fmt.Print(AnsiBold + "\n MIT License" + core.AnsiReset + `
|
||||
fmt.Print(back.AnsiBold + "\n MIT License" + back.AnsiReset + `
|
||||
|
||||
Permission is hereby granted, free of charge, to any
|
||||
person obtaining a copy of this software and associated
|
||||
@@ -141,20 +143,20 @@ func Version() {
|
||||
MITLicense()
|
||||
fmt.Print("\n\n MUTN is a simple, self-hosted,\n SSH-synchronized password manager based on libmutton\n\n" +
|
||||
" .. ..\n" +
|
||||
" /()\\''.''. " + ansiVersionMeat + "♥♥♥♥" + core.AnsiReset + " .''.''/()\\ _)\n" +
|
||||
" _. : * " + ansiVersionMeat + "♥♥♥♥♥♥ ♥♥♥♥♥♥♥♥" + core.AnsiReset + " * : <[◎]|_|=\n" +
|
||||
" }-}-*] `..'..' " + ansiVersionMeat + "♥♥♥♥♥♥♥♥♥♥♥♥♥" + core.AnsiReset + " `..'..' |\n" +
|
||||
" ◎-◎ // \\\\ " + ansiVersionMeat + "♥♥♥♥♥♥♥♥♥" + core.AnsiReset + " // \\\\ /|\\\n" +
|
||||
" /()\\''.''. " + ansiVersionMeat + "♥♥♥♥" + back.AnsiReset + " .''.''/()\\ _)\n" +
|
||||
" _. : * " + ansiVersionMeat + "♥♥♥♥♥♥ ♥♥♥♥♥♥♥♥" + back.AnsiReset + " * : <[◎]|_|=\n" +
|
||||
" }-}-*] `..'..' " + ansiVersionMeat + "♥♥♥♥♥♥♥♥♥♥♥♥♥" + back.AnsiReset + " `..'..' |\n" +
|
||||
" ◎-◎ // \\\\ " + ansiVersionMeat + "♥♥♥♥♥♥♥♥♥" + back.AnsiReset + " // \\\\ /|\\\n" +
|
||||
ansiVersionOutline + "<><><><><><><><><><><><><><>-<><><><><><><><><><><><><><>\n" +
|
||||
"\\" + ansiBlackOnWhite + " " + core.AnsiReset + ansiVersionOutline + "/\n" +
|
||||
"\\" + ansiBlackOnWhite + " MUTN v" + MUTNVersion + " " + core.AnsiReset + ansiVersionOutline + "/\n" +
|
||||
"\\" + ansiBlackOnWhite + " The Tripe Transmission Update " + core.AnsiReset + ansiVersionOutline + "/\n" +
|
||||
"\\" + ansiBlackOnWhite + " " + core.AnsiReset + ansiVersionOutline + "/\n" +
|
||||
"\\" + ansiBlackOnWhite + " Built with libmutton v" + core.LibmuttonVersion + " " + core.AnsiReset + ansiVersionOutline + "/\n" +
|
||||
"\\" + ansiBlackOnWhite + " " + core.AnsiReset + ansiVersionOutline + "/\n" +
|
||||
"\\" + ansiBlackOnWhite + " Copyright (c) 2024 Randall Winkhart " + core.AnsiReset + ansiVersionOutline + "/\n" +
|
||||
"\\" + ansiBlackOnWhite + " " + core.AnsiReset + ansiVersionOutline + "/\n" +
|
||||
"<><><><><><><><><><><><><><>-<><><><><><><><><><><><><><>\n" + core.AnsiReset +
|
||||
"\\" + ansiBlackOnWhite + " " + back.AnsiReset + ansiVersionOutline + "/\n" +
|
||||
"\\" + ansiBlackOnWhite + " MUTN v" + MUTNVersion + " " + back.AnsiReset + ansiVersionOutline + "/\n" +
|
||||
"\\" + ansiBlackOnWhite + " The Cryptic Cuts Update " + back.AnsiReset + ansiVersionOutline + "/\n" +
|
||||
"\\" + ansiBlackOnWhite + " " + back.AnsiReset + ansiVersionOutline + "/\n" +
|
||||
"\\" + ansiBlackOnWhite + " Built with libmutton v" + global.LibmuttonVersion + " " + back.AnsiReset + ansiVersionOutline + "/\n" +
|
||||
"\\" + ansiBlackOnWhite + " " + back.AnsiReset + ansiVersionOutline + "/\n" +
|
||||
"\\" + ansiBlackOnWhite + " Copyright (c) 2024-2025: Randall Winkhart " + back.AnsiReset + ansiVersionOutline + "/\n" +
|
||||
"\\" + ansiBlackOnWhite + " " + back.AnsiReset + ansiVersionOutline + "/\n" +
|
||||
"<><><><><><><><><><><><><><>-<><><><><><><><><><><><><><>\n" + back.AnsiReset +
|
||||
"\n For more information, see:\n\n" +
|
||||
" https://github.com/rwinkhart/MUTN\n" +
|
||||
" https://github.com/rwinkhart/libmutton\n\n")
|
||||
|
||||
+26
-65
@@ -1,84 +1,45 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/rwinkhart/go-boilerplate/back"
|
||||
"github.com/rwinkhart/go-boilerplate/front"
|
||||
"github.com/rwinkhart/go-boilerplate/other"
|
||||
"github.com/rwinkhart/libmutton/core"
|
||||
"golang.org/x/term"
|
||||
"github.com/rwinkhart/libmutton/synccycles"
|
||||
)
|
||||
|
||||
// input prompts the user for input and returns the input as a string.
|
||||
func input(prompt string) string {
|
||||
fmt.Print("\n" + prompt + " ")
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
userInput, _ := reader.ReadString('\n')
|
||||
return strings.TrimRight(userInput, "\n\r ") // remove trailing newlines, carriage returns, and spaces
|
||||
}
|
||||
|
||||
// inputHidden prompts the user for input and returns the input as a string, hiding the input from the terminal.
|
||||
func inputHidden(prompt string) string {
|
||||
fmt.Print("\n" + prompt + " ")
|
||||
byteInput, _ := term.ReadPassword(int(os.Stdin.Fd()))
|
||||
password := string(byteInput)
|
||||
// inputPasswordGen prompts the user for password generation parameters and returns a generated password as a string.
|
||||
func inputPasswordGen() string {
|
||||
passLength := front.InputInt("Password length:", 1, -1)
|
||||
fmt.Println()
|
||||
return password
|
||||
}
|
||||
|
||||
// inputInt prompts the user for input and returns the input as an integer.
|
||||
// A maxValue of 0 will cause the function to return 0, an error - a negative maxValue will disable the maxValue check.
|
||||
func inputInt(prompt string, maxValue int) int {
|
||||
if maxValue == 0 {
|
||||
return 0
|
||||
passCharset := uint8(front.InputMenuGen("Password complexity:", []string{"Simple", "Complex", "Ultra Complex (not compatible with many services)"}))
|
||||
var complexity float64
|
||||
switch passCharset {
|
||||
case 1:
|
||||
complexity = 0 // simple
|
||||
// 1 indicates string gen for filenames, but since complexity is 0, only the base charset is used
|
||||
default:
|
||||
complexity = 0.2 // (ultra) complex
|
||||
// 2 and 3 indicate complex and ultra complex charsets, respectively
|
||||
}
|
||||
|
||||
// loop until a valid integer is entered
|
||||
for {
|
||||
fmt.Print("\n" + prompt + " ")
|
||||
var userInput int
|
||||
_, err := fmt.Scanln(&userInput)
|
||||
if err == nil && userInput > 0 && (userInput <= maxValue || maxValue < 0) {
|
||||
return userInput
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// inputBinary prompts the user with a yes/no question and returns the response as a boolean.
|
||||
func inputBinary(prompt string) bool {
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
fmt.Print("\n" + prompt + " (y/N) ")
|
||||
char, _, _ := reader.ReadRune()
|
||||
if char == 'y' || char == 'Y' {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// inputMenuGen prompts the user with a menu and returns the user's choice as an integer.
|
||||
func inputMenuGen(prompt string, options []string) int {
|
||||
for i, option := range options {
|
||||
fmt.Printf("%d. %s\n", i+1, option)
|
||||
}
|
||||
return inputInt(prompt, len(options))
|
||||
return synccycles.StringGen(passLength, complexity, passCharset)
|
||||
}
|
||||
|
||||
// writeEntryCLI writes an entry to targetLocation and previews it (errors if no data is supplied).
|
||||
func writeEntryCLI(targetLocation string, unencryptedEntry []string, hideSecrets, verifyEntryDoesNotExist bool) {
|
||||
if core.EntryIsNotEmpty(unencryptedEntry) {
|
||||
func writeEntryCLI(targetLocation string, decryptedEntry []string, hideSecrets bool) {
|
||||
if core.EntryIsNotEmpty(decryptedEntry) {
|
||||
// write the entry to the target location
|
||||
core.WriteEntry(targetLocation, unencryptedEntry, verifyEntryDoesNotExist)
|
||||
err := core.WriteEntry(targetLocation, []byte(strings.Join(decryptedEntry, "\n")))
|
||||
if err != nil {
|
||||
other.PrintError("Failed to write entry: "+err.Error(), back.ErrorWrite)
|
||||
}
|
||||
// preview the entry
|
||||
fmt.Println(AnsiBold + "\nEntry Preview:" + core.AnsiReset)
|
||||
EntryReader(unencryptedEntry, hideSecrets, true)
|
||||
fmt.Println(back.AnsiBold + "\nEntry Preview:" + back.AnsiReset)
|
||||
EntryReader(decryptedEntry, hideSecrets, true)
|
||||
} else {
|
||||
fmt.Println(core.AnsiError + "No data supplied for entry" + core.AnsiReset)
|
||||
os.Exit(core.ErrorTargetNotFound)
|
||||
other.PrintError("No data supplied for entry", back.ErrorTargetNotFound)
|
||||
}
|
||||
}
|
||||
|
||||
// expandPathWithHome, given a path (as a string) containing "~", returns the path with "~" expanded to the user's home directory.
|
||||
func expandPathWithHome(path string) string {
|
||||
return strings.Replace(path, "~", core.Home, 1)
|
||||
}
|
||||
|
||||
+1
-3
@@ -1,9 +1,7 @@
|
||||
## Known Bugs - MUTN CLI
|
||||
- Various Markdown issues resulting from the use of [Glamour](https://github.com/charmbracelet/glamour)
|
||||
- Note that MUTN is currently using the older Glamour v0.7.0, as v0.8.0 introduced a [line-wrapping regression](https://github.com/charmbracelet/glamour/issues/331)
|
||||
- Note that MUTN is currently using the older Glamour v0.7.0 (or rather, a custom fork of it), as v0.8.0 introduced a [line-wrapping regression](https://github.com/charmbracelet/glamour/issues/331)
|
||||
- [Odd handling of line breaks](https://github.com/charmbracelet/glamour/issues/84)
|
||||
- [Broken quotes](https://github.com/charmbracelet/glamour/issues/172) (seems related to line break issue)
|
||||
- [Extra blank lines after nested list items](https://github.com/charmbracelet/glamour/issues/102)
|
||||
- [Incorrect wrapping of text in lists](https://github.com/charmbracelet/glamour/issues/56)
|
||||
- [Excessive binary size and increased program startup time](https://github.com/charmbracelet/glamour/issues/288)
|
||||
- Relevant [libmutton bugs](https://github.com/rwinkhart/libmutton/blob/main/wiki/bugs.md)
|
||||
|
||||
+1
-2
@@ -1,10 +1,9 @@
|
||||
## Building
|
||||
Official binaries are stripped of debug info for size and built without CGO (except for distribution packages) for portability, as follows:
|
||||
```
|
||||
CGO_ENABLED=0 go build -ldflags="-s -w" -trimpath ./mutn.go
|
||||
CGO_ENABLED=0 go build -ldflags="-s -w" -trimpath -tags=stxAll ./mutn.go
|
||||
```
|
||||
|
||||
Additionally, some custom build tags can be used to create different binaries. The following tags are not used in official builds:
|
||||
- `noMarkdown`: Creates a binary without Markdown support (much smaller binary size and faster launch time)
|
||||
- `wsl`: Allows creating a Linux binary that can interact with the Windows clipboard (for WSL)
|
||||
- `termux`: Allows creating a Linux binary that can interact with the Termux clipboard (for Android)
|
||||
|
||||
+1
-1
@@ -12,6 +12,6 @@ After placing the binaries in your $PATH, it is highly recommended to also downl
|
||||
Please see the [usage guide](https://github.com/rwinkhart/MUTN/blob/main/wiki/usage.md) for help getting started.
|
||||
|
||||
### Dependencies (required for all installations)
|
||||
- GnuPG command-line utility (`gpg` command; will not be required in the future) for encryption/decryption
|
||||
- A text editor (preferably CLI-based) for writing entry notes
|
||||
- A private key for SSH key-based authentication is required to use MUTN/libmutton in online/synced mode
|
||||
- Linux: xclip (X11) or wl-clipboard (Wayland) for clipboard support
|
||||
|
||||
@@ -20,5 +20,8 @@ Once this has been done, you may proceed with the client setup:
|
||||
#### Operating on Passwords
|
||||
Any action that operates on the password attached to an entry (copying, editing, adding a new password-focused entry) does not require the user to specify the `password` or `-pw` options. In all cases, `password` is the assumed target when no other option is specified.
|
||||
|
||||
#### TOTP Support
|
||||
See [here](https://github.com/rwinkhart/libmutton/blob/main/wiki/tips.md#totp-support).
|
||||
|
||||
#### Granular Help
|
||||
Argument-specific help can be obtained by running `mutn <argument>` without an entry name or any options. For example, `mutn edit` will display help for the `edit` argument.
|
||||
|
||||
Reference in New Issue
Block a user