EnglishEspañolPortuguêsالعربيةעבריתفارسیTürkçe
Nostr npubs archive Nostr relays archive
EnglishEspañolPortuguêsالعربيةעבריתفارسیTürkçe
lnbits.bitcago.com/nostrclient/api/v1/relay
lnbits.bitcago.com/nostrclient/api/v1/relay

lnbits.bitcago.com/nostrclient/api/v1/relay

wss://lnbits.bitcago.com/nostrclient/api/v1/relay

Last Notes

2026-04-05 04:30:03 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
# Contributing to `n34`
For basic information about the `n34` project, please read the
[README.md](README.md). The project is licensed under **GPL-3.0**, and by
contributing, your work will also be licensed under the same terms.
Before submitting changes, please read the [Developer Certificate of Origin](DCO).
All patches must include a `Signed-off-by: NAME <EMAIL>` line to acknowledge
your agreement with the DCO.
Ensure your Git name and email are correctly configured. While you don’t need to
use your real details, avoid leaving them as the default values. To verify your
current settings, run:
```bash
git config user.name
git config user.email
```
If they’re incorrect or unset, update them using:
```bash
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
```
We welcome all contributions, whether it be bug reports, fixes, feature
submissions, feature requests, or improving documentation or testing. Enjoy
collaborating!
## Git Repository
The repository is hosted at <https://git.4rs.nl/awiteb/n34.git>, with `master`
as the active development branch.
## Nostr Repository Address
You can submit issues and patches via any
Nostr-compatible client using the address:
`naddr1qqpkuve5qgsqqqqqq9g9uljgjfcyd6dm4fegk8em2yfz0c3qp3tc6mntkrrhawgrqsqqqaueq
yf8wumn8ghj7mn0wd68yt35wfejumnvqyxhwumn8ghj7mn0wvhxcmmvqy28wumn8ghj7mn0wd68ytn00
p68ytnyv4mqwuj6xc`
When using `n34`, there's no need to specify the address, it will automatically
check the `nostr-address` file. Simply submit your issues and patches without
worrying about this detail.
## Contribution Workflow
Before submitting changes, open an issue to discuss your proposed contribution.
Clearly indicate that you intend to work on it and wait for a maintainer's
response. If the issue remains open, you may proceed with submitting your patch.
### Reporting Issues
When opening an issue, include:
- Detailed steps to reproduce the problem
- Relevant error messages or logs (use the `-vvvv` flag for verbose output)
- Expected vs. actual behavior
Please label your issue appropriately (e.g., `bug`, `feature`, `question`) to
help categorize it.
### Your Patch
Ensure your patch submission tool notifies the maintainers and sends the patch
to their read relays, most tools handle this automatically.
#### Patch Guidelines
- Keep patches small: Focused changes are easier to review and merge.
- Run `just ci` before submitting your patch.
- Update the change log with your patch. Run `just changelog` or `git-cliff > CHANGELOG.md`
- Add your name to the [AUTHORS](AUTHORS) file if this is your first contribution. (alphabetical order)
- Use [Conventional Commits]: Start the patch subject with one of these types:
- `feat`: New feature
- `fix`: Bug fix
- `docs`: Documentation updates
- `refactor`: Code restructuring without behavioral changes
- `deprecate`: Marking code as deprecated
- `remove`: Removing deprecated code
- `security`: Security-related changes
- `perf`: Performance improvements
- `test`: Test additions or corrections
- For all other changes, use `chore`.
- Add `!` to the subject if your patch contains a breacking change, e.g.
`remove!: text` and `fix(reply)!: text`
- Use the `--cover-letter` flag to include a cover letter with your patch. Describe the issue you’re addressing, whether it’s a one-line bug fix or a 5000-line new feature.
- Specify the base commit for your patch using the `--base` flag.
- First-time contributors: Review the [Submitting Patches guide](https://www.kernel.org/doc/html/latest/process/submitting-patches.html) before sending your patch.
- If you revise your patch, you should reference all previous revisions (or the
root patch if this is the first revision) and explain the changes made (i.e.,
the differences between this patch and the prior one).
#### Code Style
When writing code, make sure to folow this:
- Using Rust's official formatting tool, `rustfmt`, to format your code.
- Writing clear and concise code with meaningful variable and function names.
- Adding comments to explain complex logic or algorithms.
#### Cover Letter Description
Your patch description should provide a clear and concise summary of the changes you
have made. It should also include any relevant context or background information
that will help the project maintainers understand the purpose of the changes.
Make sure to reference the issue[^1] that your patch is addressing, and note any breaking
changes that your patch introduces.
[^1]: When referencing, avoid URLs or `nevent` formats with relays. Instead, use only the note ID in `note1` bech32 format.
[Conventional Commits]: https://www.conventionalcommits.org/en/v1.0.0/
2026-04-05 04:30:00 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
plan-dist-manifest.json
2026-04-05 04:29:58 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
<?xml version='1.0' encoding='windows-1252'?>
<!--
Copyright (C) 2017 Christopher R. Field.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
The "cargo wix" subcommand provides a variety of predefined variables available
for customization of this template. The values for each variable are set at
installer creation time. The following variables are available:
TargetTriple = The rustc target triple name.
TargetEnv = The rustc target environment. This is typically either
"msvc" or "gnu" depending on the toolchain downloaded and
installed.
TargetVendor = The rustc target vendor. This is typically "pc", but Rust
does support other vendors, like "uwp".
CargoTargetBinDir = The complete path to the directory containing the
binaries (exes) to include. The default would be
"target\release\". If an explicit rustc target triple is
used, i.e. cross-compiling, then the default path would
be "target\<CARGO_TARGET>\<CARGO_PROFILE>",
where "<CARGO_TARGET>" is replaced with the "CargoTarget"
variable value and "<CARGO_PROFILE>" is replaced with the
value from the "CargoProfile" variable. This can also
be overridden manually with the "target-bin-dir" flag.
CargoTargetDir = The path to the directory for the build artifacts, i.e.
"target".
CargoProfile = The cargo profile used to build the binaries
(usually "debug" or "release").
Version = The version for the installer. The default is the
"Major.Minor.Fix" semantic versioning number of the Rust
package.
-->
<!--
Please do not remove these pre-processor If-Else blocks. These are used with
the `cargo wix` subcommand to automatically determine the installation
destination for 32-bit versus 64-bit installers. Removal of these lines will
cause installation errors.
-->
<?if $(sys.BUILDARCH) = x64 or $(sys.BUILDARCH) = arm64 ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?else ?>
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
<?endif ?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<Product
Id='*'
Name='n34-relay'
UpgradeCode='036A2A4F-DA54-4FE2-B2D8-8C58D5814874'
Manufacturer='Awiteb'
Language='1033'
Codepage='1252'
Version='$(var.Version)'>
<Package Id='*'
Keywords='Installer'
Description='A nostr GRASP relay implementation'
Manufacturer='Awiteb'
InstallerVersion='450'
Languages='1033'
Compressed='yes'
InstallScope='perMachine'
SummaryCodepage='1252'
/>
<MajorUpgrade
Schedule='afterInstallInitialize'
DowngradeErrorMessage='A newer version of [ProductName] is already installed. Setup will now exit.'/>
<Media Id='1' Cabinet='media1.cab' EmbedCab='yes' DiskPrompt='CD-ROM #1'/>
<Property Id='DiskPrompt' Value='n34-relay Installation'/>
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='$(var.PlatformProgramFilesFolder)' Name='PFiles'>
<Directory Id='APPLICATIONFOLDER' Name='n34-relay'>
<!--
Enabling the license sidecar file in the installer is a four step process:
1. Uncomment the `Component` tag and its contents.
2. Change the value for the `Source` attribute in the `File` tag to a path
to the file that should be included as the license sidecar file. The path
can, and probably should be, relative to this file.
3. Change the value for the `Name` attribute in the `File` tag to the
desired name for the file when it is installed alongside the `bin` folder
in the installation directory. This can be omitted if the desired name is
the same as the file name.
4. Uncomment the `ComponentRef` tag with the Id attribute value of "License"
further down in this file.
-->
<!--
<Component Id='License' Guid='*'>
<File Id='LicenseFile' Name='ChangeMe' DiskId='1' Source='C:\Path\To\File' KeyPath='yes'/>
</Component>
-->
<Directory Id='Bin' Name='bin'>
<Component Id='Path' Guid='97D3207D-71DB-4DD0-B548-E43E8C664B7D' KeyPath='yes'>
<Environment
Id='PATH'
Name='PATH'
Value='[Bin]'
Permanent='no'
Part='last'
Action='set'
System='yes'/>
</Component>
<Component Id='binary0' Guid='*'>
<File
Id='exe0'
Name='n34_relay.exe'
DiskId='1'
Source='$(var.CargoTargetBinDir)\n34_relay.exe'
KeyPath='yes'/>
</Component>
</Directory>
</Directory>
</Directory>
</Directory>
<Feature
Id='Binaries'
Title='Application'
Description='Installs all binaries and the license.'
Level='1'
ConfigurableDirectory='APPLICATIONFOLDER'
AllowAdvertise='no'
Display='expand'
Absent='disallow'>
<!--
Uncomment the following `ComponentRef` tag to add the license
sidecar file to the installer.
-->
<!--<ComponentRef Id='License'/>-->
<ComponentRef Id='binary0'/>
<Feature
Id='Environment'
Title='PATH Environment Variable'
Description='Add the install location of the [ProductName] executable to the PATH system environment variable. This allows the [ProductName] executable to be called from any location.'
Level='1'
Absent='allow'>
<ComponentRef Id='Path'/>
</Feature>
</Feature>
<SetProperty Id='ARPINSTALLLOCATION' Value='[APPLICATIONFOLDER]' After='CostFinalize'/>
<!--
Uncomment the following `Icon` and `Property` tags to change the product icon.
The product icon is the graphic that appears in the Add/Remove
Programs control panel for the application.
-->
<!--<Icon Id='ProductICO' SourceFile='wix\Product.ico'/>-->
<!--<Property Id='ARPPRODUCTICON' Value='ProductICO' />-->
<Property Id='ARPHELPLINK' Value='https://relay.n34.dev/docs.html'/>
<UI>
<UIRef Id='WixUI_FeatureTree'/>
<!--
Enabling the EULA dialog in the installer is a three step process:
1. Comment out or remove the two `Publish` tags that follow the
`WixVariable` tag.
2. Uncomment the `<WixVariable Id='WixUILicenseRtf' Value='Path\to\Eula.rft'>` tag further down
3. Replace the `Value` attribute of the `WixVariable` tag with
the path to a RTF file that will be used as the EULA and
displayed in the license agreement dialog.
-->
<Publish Dialog='WelcomeDlg' Control='Next' Event='NewDialog' Value='CustomizeDlg' Order='99'>1</Publish>
<Publish Dialog='CustomizeDlg' Control='Back' Event='NewDialog' Value='WelcomeDlg' Order='99'>1</Publish>
</UI>
<!--
Enabling the EULA dialog in the installer requires uncommenting
the following `WixUILicenseRTF` tag and changing the `Value`
attribute.
-->
<!-- <WixVariable Id='WixUILicenseRtf' Value='Relative\Path\to\Eula.rtf'/> -->
<!--
Uncomment the next `WixVariable` tag to customize the installer's
Graphical User Interface (GUI) and add a custom banner image across
the top of each screen. See the WiX Toolset documentation for details
about customization.
The banner BMP dimensions are 493 x 58 pixels.
-->
<!--<WixVariable Id='WixUIBannerBmp' Value='wix\Banner.bmp'/>-->
<!--
Uncomment the next `WixVariable` tag to customize the installer's
Graphical User Interface (GUI) and add a custom image to the first
dialog, or screen. See the WiX Toolset documentation for details about
customization.
The dialog BMP dimensions are 493 x 312 pixels.
-->
<!--<WixVariable Id='WixUIDialogBmp' Value='wix\Dialog.bmp'/>-->
</Product>
</Wix>
2026-04-05 04:29:58 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
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.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is 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. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
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.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
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 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. Use with the GNU Affero General Public License.
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 Affero 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 special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU 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 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 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 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 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/gpl-3.0.html>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
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 GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
2026-04-05 04:29:58 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
# Fetch a Patch By ID
> `n34 patch fetch` command
**Usage:**
```
Fetches a patch by its id
Usage: n34 patch fetch [OPTIONS] <PATCH_ID>
Arguments:
<PATCH_ID> The patch id to fetch it
Options:
--repo <NADDR-NIP05-OR-SET> Repository address in `naddr` format (`naddr1...`), NIP-05 format (`4rs.nl/n34` or `[email protected]/n34`), or a set name like `kernel`
-o, --output <PATH> Output directory for the patches. Default to the current directory
```
Fetches patches using their original patch ID. All fetched patches will be saved
to the specified output directory (current directory by default). You can then
apply or merge these patches into your branch as needed.
2026-04-05 04:29:58 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
# Command-Line Usage
## Options
The `n34` command-line tool accepts the following options:
- `-s`, `--secret-key`: Your Nostr secret key (in `nsec` format), used for
signing events.
- `-b`, `--bunker-url`: The URL of a NIP-46 bunker service used for remote
signing of events.
- `-7`, `--nip07`: Enables signing events using the browser's NIP-07
extension. Listens on `127.0.0.1:51034`. You can configure the address with `n34
config nip07`
- `-r`, `--relays`: A relay to read from and write to. This option can be
specified multiple times to connect to several relays.
- `--pow`: Sets the Proof of Work difficulty required when creating events.
- `--config`: Specifies a custom path to the configuration file (Default:
`$HOME/.config/n34/config.toml`).
- `-v`, `--verbose...`: Increases the logging verbosity. Can be used multiple
times for more detail (e.g., `-v`, `-vv`).
**Note:** The `--secret-key` and `--bunker-url` options are mutually exclusive.
You must provide exactly one signing method.
## Multiple Repositories
Commands that interact with a repository, such as submitting an issue or a
patch, can accept multiple repository addresses (`naddr`). This feature is
useful for projects with multiple maintainers who each have their own repository
fork.
> **Important:** When you provide multiple repositories, `n34` does not
create a separate issue or patch for each one. Instead, it creates a single
event that references all of the specified repositories.
## The `nostr-address` File
The `nostr-address` file is a plain text file that stores a list of project
repository addresses. This allows the `n34` to find and use them
without requiring you to enter the addresses manually.
### Format
- Each line must contain a single addressable event coordinate `naddr` which is
the repository address.
- Lines beginning with a `#` are treated as comments and are ignored.
- Empty lines are also ignored.
## Passing repositories
By default, `n34` will look for a `nostr-address` file to extract repositories
from it. This is why repositories are not required for commands like `patch
send` and `issue new`. You can also pass repositories using the `--repo`
option or the `<NADDR-NIP05-OR-SET>` argument for commands that accept them. The
supported formats for manual input are:
- A [NIP-19] addressable event coordinate `naddr`.
- A [NIP-05] identifier and repository name, in the format
`<nip05>/<repo-name>`.
- A set name that contains repository addresses.
You do not need to specify relays for these commands if your `naddr` or `NIP-05`
identifier already includes relays; `n34` will automatically extract them.
[NIP-19]: https://github.com/nostr-protocol/nips/blob/master/19.md
[NIP-05]: https://github.com/nostr-protocol/nips/blob/master/05.md
2026-04-05 04:29:45 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
name: Rust
on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]
env:
CARGO_TERM_COLOR: always
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
RUST_LOG: info
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-15-intel, macos-latest, windows-latest]
features_args: ["", "--no-default-features", "--features nostr"]
steps:
- uses: actions/checkout@v4
- name: Install system deps (dbus)
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libdbus-1-dev
- name: Install protobuf (protoc)
shell: bash
run: |
set -euxo pipefail
if [[ "${{ runner.os }}" == "macOS" ]]; then
brew update
brew install protobuf
elif [[ "${{ runner.os }}" == "Linux" ]]; then
sudo apt-get update
sudo apt-get install -y protobuf-compiler
elif [[ "${{ runner.os }}" == "Windows" ]]; then
choco install -y protoc
fi
- name: Build ${{ matrix.features_args }}
run: cargo build --workspace --verbose ${{ matrix.features_args }}
- name: Run workspace tests ${{ matrix.features_args }}
run: |
cargo test --workspace ${{ matrix.features_args }} -- --test-threads 1
- name: Run get_file_hash_core tests ${{ matrix.features_args }}
shell: bash
run: |
if [[ "${{ matrix.features_args }}" == "--features nostr" ]]; then
cargo test -p get_file_hash_core ${{ matrix.features_args }} -- --test-threads 1 --nocapture
else
cargo test -p get_file_hash_core ${{ matrix.features_args }} -- --test-threads 1
fi
- name: Run get_file_hash tests ${{ matrix.features_args }}
shell: bash
run: |
if [[ "${{ matrix.features_args }}" == "--features nostr" ]]; then
cargo test -p get_file_hash ${{ matrix.features_args }} -- --test-threads 1 --nocapture
else
cargo test -p get_file_hash ${{ matrix.features_args }} -- --test-threads 1
fi
- name: Build Release ${{ matrix.features_args }}
run: cargo build --workspace --release ${{ matrix.features_args }}
2026-04-05 04:29:43 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
// n34-relay - A nostr GRASP relay implementation
// Copyright (C) 2025 Awiteb <[email protected]>
//
// 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://gnu.org/licenses/agpl-3.0>.
use std::fs;
use nostr::{
event::{Event, TagKind, TagStandard},
key::PublicKey,
};
use crate::{
errors::{RelayError, RelayResult},
pathes,
};
/// Opens the logs file for writing. If the file size exceeds 5MB, it is opened
/// in write mode, otherwise in append mode.
pub fn logs_file() -> RelayResult<fs::File> {
const FIVE_MB: u64 = 1024 * 1024 * 5;
let logs_path = pathes::logs_file_path();
if let Some(parent) = logs_path.parent()
&& !parent.exists()
{
fs::create_dir_all(parent)
.map_err(|err| RelayError::Fs(parent.to_path_buf(), err.to_string()))?;
}
_ = fs::File::create_new(&logs_path);
let is_large = if let Ok(file) = fs::File::open(&logs_path)
&& let Ok(metadata) = file.metadata()
{
metadata.len() >= FIVE_MB
} else {
false
};
fs::OpenOptions::new()
.write(true)
.append(!is_large)
.truncate(is_large)
.open(&logs_path)
.map_err(|err| RelayError::Fs(logs_path, err.to_string()))
}
/// Replaces template variables in content with their value.
fn homepage_variables(content: &str) -> String {
content.replace("{{VERSION}}", env!("CARGO_PKG_VERSION"))
}
/// Returns the content of the homepage if the file exists, otherwise the
/// default homepage
pub fn homepage_content() -> String {
let default_page = include_str!("default-homepage.html");
let homepage_path = pathes::homepage_file_path();
if !homepage_path.exists() {
tracing::debug!(
"No custom home page in `{}`, using the default one",
homepage_path.display()
);
return homepage_variables(default_page);
}
match fs::read_to_string(&homepage_path) {
Ok(content) => {
tracing::info!("Using the custom home page: `{}`", homepage_path.display());
homepage_variables(&content)
}
Err(err) => {
tracing::error!(
"Failed to get the custom home page content from `{}`: {err}",
homepage_path.display()
);
homepage_variables(default_page)
}
}
}
/// Removes the protocol part (e.g. `http://`, `https://`) from a URL string.
///
/// If no protocol is found, returns the original string unchanged.
pub fn remove_proto(str_url: &str) -> &str {
const SEPARATOR: &str = "://";
if let Some(index) = str_url.find(SEPARATOR) {
&str_url[index + SEPARATOR.len()..]
} else {
str_url
}
}
/// Fetches the maintainers associated with the event. Returns an empty iterator
/// if no maintainers are found.
#[inline]
pub fn get_maintainers(event: &Event) -> impl Iterator<Item = &PublicKey> {
event
.tags
.find_standardized(TagKind::Maintainers)
.map(|tag| {
if let TagStandard::GitMaintainers(pubkeys) = tag {
return pubkeys.as_slice();
}
unreachable!("TagKind::Maintainers")
})
.unwrap_or(&[])
.iter()
}
/// Validates that a string is a valid 40-character hex SHA-1 OID.
#[inline]
pub fn is_valid_sha1(s: &str) -> bool {
s.len() == 40 && s.chars().all(|c| c.is_ascii_hexdigit())
}
2026-04-05 04:29:43 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.4.0] - 2025-08-08
### Added
- Support signing using NIP-46 bunker - by Awiteb
- Keyring the secret key `n34 config keyring --enable` - by Awiteb
- New flag to `patch apply and merge` to mention patches - by Awiteb
- Sign using NIP-07 - by Awiteb
### Dependencies
- Add `keyring`, `nostr-connect`, `nostr-keyring` and `url` to the dependencies - by Awiteb
- Remove `url` from `n34` dependencies - by Awiteb
- Upgrade to `[email protected]` - by Awiteb
### Documentation
- N34 book - by Awiteb
- Fix status command docs - by Awiteb
### Refactor
- Move the trait extensions to `traits.rs` - by Awiteb
- Move `root` and `root-revision` to constants - by Awiteb
## [0.3.0] - 2025-07-05
### Added
- New `patch send` command to send patches - by Awiteb
- Add `alt` tag to the git issue - by Awiteb
- Add `description` tag to the patch - by Awiteb
- New `config pow` command to set the default PoW difficulty - by Awiteb
- New `config relays` command to set the default fallbacks relays - by Awiteb
- New `issue view` command to view an issue - by Awiteb
- New `patch fetch` command to fetch patches - by Awiteb
- New `issue {reopen,close,resolve}` commands to manage issue status - by Awiteb
- New `patch` subcommands apply,close,draft,merge and reopen to manage the patch status - by Awiteb
- View the repo maintainers as `npub` - by Awiteb
- New `patch list` commands to list the repo patches - by Awiteb
- New `issue list` commands to list the repo issues - by Awiteb
- Improve exit codes and make them more specific - by Awiteb
### Dependencies
- Add `[email protected]` to the dependencies - by Awiteb
- Update `nostr` to `0.42.2` - by Awiteb
- Remove `bitcoin_hashes` and use `nostr::hashes` re-export - by Awiteb
### Fixed
- Not to return an error if `nostr-address` file does not exist - by Awiteb
- Spelling in help content - by DanConwayDev
- Fix a typo in `EmptySetRelays` error message - by Awiteb
- Require a repo in `repo view` command - by Awiteb
### Refactor
- Store the config in `CliOptions` instead of its path - by Awiteb
- Improve commands running and make the signer optional for some commands - by Awiteb
### Removed
- Remove the `--repo` option and make the repo an argument - by Awiteb
- Remove the `--to` flag from `reply` command and make it an argument - by Awiteb
- Remove `--euc` flag from `patch send` command and use the repo euc - by Awiteb
## [0.2.0] - 2025-06-01
### Added
- Add `--force-id` flag to bypass case validation in `repo announce` - by Awiteb
- Add `--address-file` flag to `repo announce` command - by Awiteb
- Read the `nostr-address` file in `repo view` command - by Awiteb
- Read the `nostr-address` file in `issue new` command - by Awiteb
- Read the `nostr-address` file in `reply` command - by Awiteb
- A `--quote-to` flag to quote the replied to content in the editor - by Awiteb
- Enter repository as nip5 - by Awiteb
- Make the relays list optional - by Awiteb
- Events and naddrs can starts with `nostr:` - by Awiteb
- Support relays and naddrs sets - by Awiteb
### Dependencies
- Add `[email protected]` to the dependencies - by Awiteb
- Enable `nip05` feature of `nostr` crate - by Awiteb
- Add `[email protected]`, `[email protected]` and `[email protected]` - by Awiteb
### Fixed
- Create a valid naddr string - by Awiteb
### Refactor
- Support more than one naddr instead of one - by Awiteb
## [0.1.0] - 2025-05-21
### Added
- Setup the CLI and create `repo view` command - by Awiteb
- Add `repo announce` command - by Awiteb
- Support PoW - by Awiteb
- Add `issue new` command - by Awiteb
- New `reply` command - by Awiteb
### Dependencies
- Add nedded dependencies - by Awiteb
- Add `[email protected]` to the dependencies - by Awiteb
- Add `[email protected]` to the dependencies - by Awiteb
- Add `[email protected]` to the dependencies - by Awiteb
- Add `[email protected]` to the dependencies - by Awiteb
- Bump `nostr` and `nostr_sdk` to `0.42.0` - by Awiteb
## [0.0.0] - 2025-05-01
### Added
- Initialize the project - by Awiteb
[0.4.0]: https://git.4rs.nl/awiteb/n34.git/tag/?h=v0.4.0
[0.3.0]: https://git.4rs.nl/awiteb/n34.git/tag/?h=v0.3.0
[0.2.0]: https://git.4rs.nl/awiteb/n34.git/tag/?h=v0.2.0
[0.1.0]: https://git.4rs.nl/awiteb/n34.git/tag/?h=v0.1.0
[0.0.0]: https://git.4rs.nl/awiteb/n34.git/tag/?h=v0.0.0
<!-- generated by git-cliff -->
2026-04-05 04:29:43 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
2026-04-05 04:29:43 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
# n34 documentation
- [Command Line Usage](commands.md)
- [Managing Repository and Relay Sets](sets/README.md)
- [Create a Set](sets/new.md)
- [Modify a Set](sets/update.md)
- [Show Sets](sets/show.md)
- [Remove a Set](sets/remove.md)
- [Manage Configuration](config/README.md)
- [Default PoW Difficulty](config/pow.md)
- [Fallback Relays](config/relays.md)
- [NIP-07 Browser Signer Proxy](config/nip07.md)
- [NIP-46 Bunker](config/bunker.md)
- [Secret Key Keyring](config/keyring.md)
- [Manage Repositories](repo/README.md)
- [Broadcast and Update a Git Repository](repo/announce.md)
- [View Git Repository Details](repo/view.md)
- [Issue Management](issue/README.md)
- [Create an Issue](issue/new.md)
- [View an Issue By ID](issue/view.md)
- [Reopen a Closed Issue](issue/reopen.md)
- [Closes an Open Issue](issue/close.md)
- [Resolves an Issue](issue/resolve.md)
- [List Repositories Issues](issue/list.md)
- [Patch Management](patch/README.md)
- [Send Patches to a Repository](patch/send.md)
- [Fetch a Patch By ID](patch/fetch.md)
- [Reopens a Closed or Drafted Patch](patch/reopen.md)
- [Closes an Open or Drafted Patch](patch/close.md)
- [Draft an Open Patch](patch/draft.md)
- [Apply an Open Patch](patch/apply.md)
- [Merge an Open Patch](patch/merge.md)
- [List Repositories Patches](patch/list.md)
- [Reply to Issues and Patches](reply.md)
2026-04-05 04:29:42 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
# Draft an Open Patch
> `n34 patch draft` command
**Usage:**
```
Converts an open patch to draft state
Usage: n34 patch draft [OPTIONS] <PATCH_ID>
Arguments:
<PATCH_ID> The open patch id to draft it. Must be orignal root patch
Options:
--repo <NADDR-NIP05-OR-SET> Repository address in `naddr` format (`naddr1...`), NIP-05 format (`4rs.nl/n34` or `[email protected]/n34`), or a set name like `kernel`
```
Issue a kind `1633` (Draft status) for the specified patch. The patch have to
be open.
2026-04-05 04:29:31 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
# git-cliff ~ configuration file
# https://git-cliff.org/docs/configuration
[changelog]
# A Tera template to be rendered as the changelog's header.
# See https://keats.github.io/tera/docs/#introduction
header = """
# Changelog\n
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n
"""
# A Tera template to be rendered for each release in the changelog.
# See https://keats.github.io/tera/docs/#introduction
body = """
{% if version -%}
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else -%}
## Unreleased
{% endif -%}
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
{% for commit in commits %}
- {{ commit.message | split(pat="\n") | first | split(pat=":") | slice(start=1) | join(sep=":") | trim | upper_first }} - \
by {{ commit.author.name}}\
{% endfor %}
{% endfor %}\n
"""
# A Tera template to be rendered as the changelog's footer.
# See https://keats.github.io/tera/docs/#introduction
footer = """
{% for release in releases -%}
{% if release.version -%}
[{{ release.version | trim_start_matches(pat="v") }}]: https://git.4rs.nl/awiteb/n34.git/tag/?h={{ release.version }}
{% endif -%}
{% endfor %}
<!-- generated by git-cliff -->
"""
# Remove leading and trailing whitespaces from the changelog's body.
trim = true
postprocessors = [
# Replace the placeholder `<REPO>` with a URL.
{ pattern = '\$REPO', replace = "https://git.4rs.nl/awiteb/n34.git" },
]
[git]
# Parse commits according to the conventional commits specification.
# See https://www.conventionalcommits.org
conventional_commits = false
# Exclude commits that do not match the conventional commits specification.
filter_unconventional = false
# An array of regex based parsers for extracting data from the commit message.
# Assigns commits to groups.
# Optionally sets the commit's scope and can decide to exclude commits from further processing.
commit_parsers = [
{ message = '^.*!:.*$', group = "Breaking Change" },
{ message = '^feat', group = "Added" },
{ message = '^deprecate', group = "Deprecated" },
{ message = '^remove', group = "Removed" },
{ message = '^deps', group = "Dependencies" },
{ message = '^refactor', group = "Refactor" },
{ message = '^fix', group = "Fixed" },
{ message = '^docs', group = "Documentation" },
]
# Prevent commits that are breaking from being excluded by commit parsers.
filter_commits = false
# Order releases topologically instead of chronologically.
topo_order = false
# Order of commits in each group/release within the changelog.
# Allowed values: newest, oldest
sort_commits = "oldest"
2026-04-05 04:29:31 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
[package]
name = "n34"
description = "A CLI to interact with NIP-34 and other stuff related to code in Nostr"
version = "0.4.1"
edition = "2024"
license = "GPL-3.0-or-later"
authors = ["Awiteb <[email protected]>"]
readme = "README.md"
documentation = "https://n34.dev/commands.html"
homepage = "https://n34.dev"
repository = "https://github.com/gnostr-org/get_file_hash.git"
keywords = ["nostr", "NIP-34", "CLI"]
categories = ["command-line-utilities"]
rust-version = "1.88.0"
[package.metadata.wix]
upgrade-guid = "5E8926D0-4A18-48E9-A070-AFB0F698F04C"
path-guid = "7A2E5F6A-FC23-498B-AEC1-5FA63678FBFD"
license = false
eula = false
[[bin]]
name = "n34-cli"
path = "src/main.rs"
[dependencies]
chrono = "0.4.41"
convert_case = "0.8.0"
dirs = "6.0.0"
easy-ext = "1.0.2"
either = "1.15.0"
futures = "0.3.31"
nostr-browser-signer-proxy = "0.43.0"
regex = "1.11.1"
tempfile = "3.20.0"
thiserror = "2.0.12"
toml = "0.9.4"
tracing = "0.1.41"
tracing-subscriber = "0.3.19"
[dependencies.clap]
features = ["derive"]
version = "4.5.42"
[dependencies.clap-verbosity-flag]
default-features = false
features = ["tracing"]
version = "3.0.3"
[dependencies.nostr]
default-features = false
features = ["std"]
version = "0.43.0"
[dependencies.nostr-connect]
default-features = false
version = "0.43.0"
[dependencies.nostr-keyring]
default-features = false
version = "0.43.0"
[dependencies.nostr-sdk]
default-features = false
version = "0.43.0"
[dependencies.reqwest]
default-features = false
features = ["http2", "json", "rustls-tls"]
version = "0.12.22"
[dependencies.serde]
features = ["derive"]
version = "1.0.219"
[dependencies.tokio]
features = ["macros", "rt-multi-thread"]
version = "1.47.1"
# [profile.release]
# lto = "fat"
# opt-level = 3
2026-04-05 04:29:28 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
// n34-relay - A nostr GRASP relay implementation
// Copyright (C) 2025 Awiteb <[email protected]>
//
// 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://gnu.org/licenses/agpl-3.0>.
use std::{path::PathBuf, sync::Arc};
use nostr::{key::PublicKey, nips::nip19::ToBech32};
use nostr_database::NostrDatabase;
use nostr_relay_builder::LocalRelay;
use crate::relay_config::RelayConfig;
/// Router state.
pub struct RouterState {
/// Configuration settings for the relay.
pub config: Arc<RelayConfig>,
/// The local relay instance being managed.
pub relay: Arc<LocalRelay>,
/// The relay database
pub database: Arc<dyn NostrDatabase>,
}
impl RouterState {
/// Creates a new router state.
pub fn new(
config: Arc<RelayConfig>,
relay: Arc<LocalRelay>,
database: Arc<dyn NostrDatabase>,
) -> Self {
Self {
config,
relay,
database,
}
}
/// Returns the repo path if it's exists
pub fn repo_path(&self, npub: &PublicKey, repo_name: &str) -> Option<PathBuf> {
let path = self
.config
.grasp
.repos_path
.join(npub.to_bech32().expect("Infallible"))
.join(repo_name)
.with_extension("git");
path.exists().then_some(path)
}
}
2026-04-05 04:29:26 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
Awiteb <[email protected]> (nprofile1qqsqqqqqq9g9uljgjfcyd6dm4fegk8em2yfz0c3qp3tc6mntkrrhawgpzfmhxue69uhkummnw3ezudrjwvhxumq3dg0ly)
2026-04-05 04:29:25 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
# Closes an Open or Drafted Patch
> `n34 patch close` command
**Usage:**
```
Closes an open or drafted patch
Usage: n34 patch close [OPTIONS] <PATCH_ID>
Arguments:
<PATCH_ID> The open/drafted patch id to close it. Must be orignal root patch
Options:
--repo <NADDR-NIP05-OR-SET> Repository address in `naddr` format (`naddr1...`), NIP-05 format (`4rs.nl/n34` or `[email protected]/n34`), or a set name like `kernel`
```
Issue a kind `1632` (Close status) for the specified patch. The patch have to
be open or drafted.
2026-04-05 04:29:24 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
# This file was autogenerated by dist: https://axodotdev.github.io/cargo-dist
#
# Copyright 2022-2024, axodotdev
# SPDX-License-Identifier: MIT or Apache-2.0
#
# CI that:
#
# * checks for a Git Tag that looks like a release
# * builds artifacts with dist (archives, installers, hashes)
# * uploads those artifacts to temporary workflow zip
# * on success, uploads the artifacts to a GitHub Release
#
# Note that the GitHub Release will be created with a generated
# title/body based on your changelogs.
name: Release
permissions:
"contents": "write"
# This task will run whenever you push a git tag that looks like a version
# like "1.0.0", "v0.1.0-prerelease.1", "my-app/0.1.0", "releases/v1.0.0", etc.
# Various formats will be parsed into a VERSION and an optional PACKAGE_NAME, where
# PACKAGE_NAME must be the name of a Cargo package in your workspace, and VERSION
# must be a Cargo-style SemVer Version (must have at least major.minor.patch).
#
# If PACKAGE_NAME is specified, then the announcement will be for that
# package (erroring out if it doesn't have the given version or isn't dist-able).
#
# If PACKAGE_NAME isn't specified, then the announcement will be for all
# (dist-able) packages in the workspace with that version (this mode is
# intended for workspaces with only one dist-able package, or with all dist-able
# packages versioned/released in lockstep).
#
# If you push multiple tags at once, separate instances of this workflow will
# spin up, creating an independent announcement for each one. However, GitHub
# will hard limit this to 3 tags per commit, as it will assume more tags is a
# mistake.
#
# If there's a prerelease-style suffix to the version, then the release(s)
# will be marked as a prerelease.
on:
pull_request:
push:
tags:
- '**[0-9]+.[0-9]+.[0-9]+*'
jobs:
# Run 'dist plan' (or host) to determine what tasks we need to do
install-deps:
runs-on: "ubuntu-latest"
outputs:
val: ${{ steps.plan.outputs.manifest }}
tag: ${{ !github.event.pull_request && github.ref_name || '' }}
tag-flag: ${{ !github.event.pull_request && format('--tag={0}', github.ref_name) || '' }}
publishing: ${{ !github.event.pull_request }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
submodules: recursive
- name: Install-deps
shell: bash
run: |
if [[ "${{ runner.os }}" == "Linux" ]]; then
sudo apt-get update
sudo apt-get install -y pkg-config libdbus-1-dev curl unzip
# Install a pinned modern protoc
PROTOC_ZIP=protoc-25.3-linux-x86_64.zip
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v25.3/$PROTOC_ZIP
sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
sudo unzip -o $PROTOC_ZIP -d /usr/local 'include/*'
rm -f $PROTOC_ZIP
elif [[ "${{ runner.os }}" == "macOS" ]]; then
brew install protobuf
elif [[ "${{ runner.os }}" == "Windows" ]]; then
choco install protoc --no-progress
echo "C:\ProgramData\chocolatey\bin" >> $GITHUB_PATH
fi
protoc --version
plan:
needs:
- install-deps
runs-on: "ubuntu-latest"
outputs:
val: ${{ steps.plan.outputs.manifest }}
tag: ${{ !github.event.pull_request && github.ref_name || '' }}
tag-flag: ${{ !github.event.pull_request && format('--tag={0}', github.ref_name) || '' }}
publishing: ${{ !github.event.pull_request }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
submodules: recursive
- name: Install dist
# we specify bash to get pipefail; it guards against the `curl` command
# failing. otherwise `sh` won't catch that `curl` returned non-0
shell: bash
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.30.3/cargo-dist-installer.sh | sh"
- name: Cache dist
uses: actions/upload-artifact@v4
with:
name: cargo-dist-cache
path: ~/.cargo/bin/dist
# sure would be cool if github gave us proper conditionals...
# so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
# functionality based on whether this is a pull_request, and whether it's from a fork.
# (PRs run on the *source* but secrets are usually on the *target* -- that's *good*
# but also really annoying to build CI around when it needs secrets to work right.)
- id: plan
run: |
dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json
echo "dist ran successfully"
cat plan-dist-manifest.json
echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"
- name: "Upload dist-manifest.json"
uses: actions/upload-artifact@v4
with:
name: artifacts-plan-dist-manifest
path: plan-dist-manifest.json
# Build and packages all the platform-specific things
build-local-artifacts:
name: build-local-artifacts (${{ join(matrix.targets, ', ') }})
# Let the initial task tell us to not run (currently very blunt)
needs:
- plan
- install-deps
if: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix.include != null && (needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload') }}
strategy:
fail-fast: false
# Target platforms/runners are computed by dist in create-release.
# Each member of the matrix has the following arguments:
#
# - runner: the github runner
# - dist-args: cli flags to pass to dist
# - install-dist: expression to run to install dist on the runner
#
# Typically there will be:
# - 1 "global" task that builds universal installers
# - N "local" tasks that build each platform's binaries and platform-specific installers
matrix: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix }}
runs-on: ${{ matrix.runner }}
container: ${{ matrix.container && matrix.container.image || null }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILD_MANIFEST_NAME: target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json
steps:
- name: enable windows longpaths
run: |
git config --global core.longpaths true
- uses: actions/checkout@v4
with:
persist-credentials: false
submodules: recursive
- name: Install Rust non-interactively if not already installed
if: ${{ matrix.container }}
run: |
if ! command -v cargo > /dev/null 2>&1; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
fi
- name: Install dist
run: ${{ matrix.install_dist.run }}
# Get the dist-manifest
- name: Fetch local artifacts
uses: actions/download-artifact@v4
with:
pattern: artifacts-*
path: target/distrib/
merge-multiple: true
- name: Install dependencies
run: |
${{ matrix.packages_install }}
- name: Install-deps
shell: bash
run: |
if [[ "${{ runner.os }}" == "Linux" ]]; then
sudo apt-get update
sudo apt-get install -y pkg-config libdbus-1-dev curl unzip
# Install a pinned modern protoc
PROTOC_ZIP=protoc-25.3-linux-x86_64.zip
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v25.3/$PROTOC_ZIP
sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
sudo unzip -o $PROTOC_ZIP -d /usr/local 'include/*'
rm -f $PROTOC_ZIP
elif [[ "${{ runner.os }}" == "macOS" ]]; then
brew install protobuf
elif [[ "${{ runner.os }}" == "Windows" ]]; then
choco install protoc --no-progress
echo "C:\ProgramData\chocolatey\bin" >> $GITHUB_PATH
fi
protoc --version
- name: Configure Cargo for Windows builds
if: runner.os == 'Windows'
shell: bash
run: |
# Put target dir somewhere short and less likely to be locked
echo "CARGO_TARGET_DIR=D:/cargo-target" >> $GITHUB_ENV
# Reduce file-handle pressure / parallel writes
echo "CARGO_BUILD_JOBS=2" >> $GITHUB_ENV
# Avoid incremental artifacts (less churn, fewer locks)
echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV
- name: Build artifacts
run: |
# Actually do builds and make zips and whatnot
dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
echo "dist ran successfully"
- id: cargo-dist
name: Post-build
# We force bash here just because github makes it really hard to get values up
# to "real" actions without writing to env-vars, and writing to env-vars has
# inconsistent syntax between shell and powershell.
shell: bash
run: |
# Parse out what we just built and upload it to scratch storage
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
dist print-upload-files-from-manifest --manifest dist-manifest.json >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
- name: "Upload artifacts"
uses: actions/upload-artifact@v4
with:
name: artifacts-build-local-${{ join(matrix.targets, '_') }}
path: |
${{ steps.cargo-dist.outputs.paths }}
${{ env.BUILD_MANIFEST_NAME }}
# Build and package all the platform-agnostic(ish) things
build-global-artifacts:
needs:
- plan
- install-deps
- build-local-artifacts
runs-on: "ubuntu-latest"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILD_MANIFEST_NAME: target/distrib/global-dist-manifest.json
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
submodules: recursive
- name: Install cached dist
uses: actions/download-artifact@v4
with:
name: cargo-dist-cache
path: ~/.cargo/bin/
- run: chmod +x ~/.cargo/bin/dist
- name: Install-deps
shell: bash
run: |
if [[ "${{ runner.os }}" == "Linux" ]]; then
sudo apt-get update
sudo apt-get install -y pkg-config libdbus-1-dev curl unzip
# Install a pinned modern protoc
PROTOC_ZIP=protoc-25.3-linux-x86_64.zip
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v25.3/$PROTOC_ZIP
sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
sudo unzip -o $PROTOC_ZIP -d /usr/local 'include/*'
rm -f $PROTOC_ZIP
elif [[ "${{ runner.os }}" == "macOS" ]]; then
brew install protobuf
elif [[ "${{ runner.os }}" == "Windows" ]]; then
choco install protoc --no-progress
echo "C:\ProgramData\chocolatey\bin" >> $GITHUB_PATH
fi
protoc --version
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
- name: Fetch local artifacts
uses: actions/download-artifact@v4
with:
pattern: artifacts-*
path: target/distrib/
merge-multiple: true
- id: cargo-dist
shell: bash
run: |
dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json
echo "dist ran successfully"
# Parse out what we just built and upload it to scratch storage
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
- name: "Upload artifacts"
uses: actions/upload-artifact@v4
with:
name: artifacts-build-global
path: |
${{ steps.cargo-dist.outputs.paths }}
${{ env.BUILD_MANIFEST_NAME }}
# Determines if we should publish/announce
host:
needs:
- plan
- install-deps
- build-local-artifacts
- build-global-artifacts
# Only run if we're "publishing", and only if plan, local and global didn't fail (skipped is fine)
if: ${{ always() && needs.plan.result == 'success' && needs.plan.outputs.publishing == 'true' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') && (needs.build-local-artifacts.result == 'skipped' || needs.build-local-artifacts.result == 'success') }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
runs-on: "ubuntu-latest"
outputs:
val: ${{ steps.host.outputs.manifest }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
submodules: recursive
- name: Install cached dist
uses: actions/download-artifact@v4
with:
name: cargo-dist-cache
path: ~/.cargo/bin/
- run: chmod +x ~/.cargo/bin/dist
# Fetch artifacts from scratch-storage
- name: Fetch artifacts
uses: actions/download-artifact@v4
with:
pattern: artifacts-*
path: target/distrib/
merge-multiple: true
- id: host
shell: bash
run: |
dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
echo "artifacts uploaded and released successfully"
cat dist-manifest.json
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
- name: "Upload dist-manifest.json"
uses: actions/upload-artifact@v4
with:
# Overwrite the previous copy
name: artifacts-dist-manifest
path: dist-manifest.json
# Create a GitHub Release while uploading all files to it
- name: "Download GitHub Artifacts"
uses: actions/download-artifact@v4
with:
pattern: artifacts-*
path: artifacts
merge-multiple: true
- name: Cleanup
run: |
# Remove the granular manifests
rm -f artifacts/*-dist-manifest.json
- name: Create GitHub Release
env:
PRERELEASE_FLAG: "${{ fromJson(steps.host.outputs.manifest).announcement_is_prerelease && '--prerelease' || '' }}"
ANNOUNCEMENT_TITLE: "${{ fromJson(steps.host.outputs.manifest).announcement_title }}"
ANNOUNCEMENT_BODY: "${{ fromJson(steps.host.outputs.manifest).announcement_github_body }}"
RELEASE_COMMIT: "${{ github.sha }}"
run: |
# Write and read notes from a file to avoid quoting breaking things
echo "$ANNOUNCEMENT_BODY" > $RUNNER_TEMP/notes.txt
gh release create "${{ needs.plan.outputs.tag }}" --target "$RELEASE_COMMIT" $PRERELEASE_FLAG --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" artifacts/*
publish-homebrew-formula:
needs:
- plan
- host
- install-deps
- build-local-artifacts
- build-global-artifacts
runs-on: "ubuntu-latest"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PLAN: ${{ needs.plan.outputs.val }}
GITHUB_USER: "axo bot"
GITHUB_EMAIL: "[email protected]"
if: ${{ !fromJson(needs.plan.outputs.val).announcement_is_prerelease || fromJson(needs.plan.outputs.val).publish_prereleases }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: true
repository: "gnostr-org/homebrew-gnostr"
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
# So we have access to the formula
- name: Fetch homebrew formulae
uses: actions/download-artifact@v4
with:
pattern: artifacts-*
path: Formula/
merge-multiple: true
# This is extra complex because you can make your Formula name not match your app name
# so we need to find releases with a *.rb file, and publish with that filename.
- name: Commit formula files
run: |
git config --global user.name "${GITHUB_USER}"
git config --global user.email "${GITHUB_EMAIL}"
for release in $(echo "$PLAN" | jq --compact-output '.releases[] | select([.artifacts[] | endswith(".rb")] | any)'); do
filename=$(echo "$release" | jq '.artifacts[] | select(endswith(".rb"))' --raw-output)
name=$(echo "$filename" | sed "s/\.rb$//")
version=$(echo "$release" | jq .app_version --raw-output)
export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"
brew update
# We avoid reformatting user-provided data such as the app description and homepage.
brew style --except-cops FormulaAudit/Homepage,FormulaAudit/Desc,FormulaAuditStrict --fix "Formula/${filename}" || true
git add "Formula/${filename}"
git commit -m "${name} ${version}"
done
git push
announce:
needs:
- plan
- install-deps
- build-local-artifacts
- build-global-artifacts
- host
- publish-homebrew-formula
# use "always() && ..." to allow us to wait for all publish jobs while
# still allowing individual publish jobs to skip themselves (for prereleases).
# "host" however must run to completion, no skipping allowed!
if: ${{ always() && needs.host.result == 'success' && (needs.publish-homebrew-formula.result == 'skipped' || needs.publish-homebrew-formula.result == 'success') }}
runs-on: "ubuntu-latest"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
submodules: recursive
2026-04-05 04:29:20 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
[book]
authors = ["Awiteb"]
language = "en"
multilingual = false
src = "docs"
title = "n34 documentation"
[output.html]
git-repository-icon = "fa-git"
git-repository-url = "https://git.4rs.nl/awiteb/n34.git"
2026-04-05 04:29:19 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
# Contributing to `n34`
For basic information about the `n34` project, please read the
[README.md](README.md). The project is licensed under **GPL-3.0**, and by
contributing, your work will also be licensed under the same terms.
Before submitting changes, please read the [Developer Certificate of Origin](DCO).
All patches must include a `Signed-off-by: NAME <EMAIL>` line to acknowledge
your agreement with the DCO.
Ensure your Git name and email are correctly configured. While you don’t need to
use your real details, avoid leaving them as the default values. To verify your
current settings, run:
```bash
git config user.name
git config user.email
```
If they’re incorrect or unset, update them using:
```bash
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
```
We welcome all contributions, whether it be bug reports, fixes, feature
submissions, feature requests, or improving documentation or testing. Enjoy
collaborating!
## Git Repository
The repository is hosted at <https://git.4rs.nl/awiteb/n34.git>, with `master`
as the active development branch.
## Nostr Repository Address
You can submit issues and patches via any
Nostr-compatible client using the address:
`naddr1qqpkuve5qgsqqqqqq9g9uljgjfcyd6dm4fegk8em2yfz0c3qp3tc6mntkrrhawgrqsqqqaueq
yf8wumn8ghj7mn0wd68yt35wfejumnvqyxhwumn8ghj7mn0wvhxcmmvqy28wumn8ghj7mn0wd68ytn00
p68ytnyv4mqwuj6xc`
When using `n34`, there's no need to specify the address, it will automatically
check the `nostr-address` file. Simply submit your issues and patches without
worrying about this detail.
## Contribution Workflow
Before submitting changes, open an issue to discuss your proposed contribution.
Clearly indicate that you intend to work on it and wait for a maintainer's
response. If the issue remains open, you may proceed with submitting your patch.
### Reporting Issues
When opening an issue, include:
- Detailed steps to reproduce the problem
- Relevant error messages or logs (use the `-vvvv` flag for verbose output)
- Expected vs. actual behavior
Please label your issue appropriately (e.g., `bug`, `feature`, `question`) to
help categorize it.
### Your Patch
Ensure your patch submission tool notifies the maintainers and sends the patch
to their read relays, most tools handle this automatically.
#### Patch Guidelines
- Keep patches small: Focused changes are easier to review and merge.
- Run `just ci` before submitting your patch.
- Update the change log with your patch. Run `just changelog` or `git-cliff > CHANGELOG.md`
- Add your name to the [AUTHORS](AUTHORS) file if this is your first contribution. (alphabetical order)
- Use [Conventional Commits]: Start the patch subject with one of these types:
- `feat`: New feature
- `fix`: Bug fix
- `docs`: Documentation updates
- `refactor`: Code restructuring without behavioral changes
- `deprecate`: Marking code as deprecated
- `remove`: Removing deprecated code
- `security`: Security-related changes
- `perf`: Performance improvements
- `test`: Test additions or corrections
- For all other changes, use `chore`.
- Add `!` to the subject if your patch contains a breacking change, e.g.
`remove!: text` and `fix(reply)!: text`
- Use the `--cover-letter` flag to include a cover letter with your patch. Describe the issue you’re addressing, whether it’s a one-line bug fix or a 5000-line new feature.
- Specify the base commit for your patch using the `--base` flag.
- First-time contributors: Review the [Submitting Patches guide](https://www.kernel.org/doc/html/latest/process/submitting-patches.html) before sending your patch.
- If you revise your patch, you should reference all previous revisions (or the
root patch if this is the first revision) and explain the changes made (i.e.,
the differences between this patch and the prior one).
#### Code Style
When writing code, make sure to folow this:
- Using Rust's official formatting tool, `rustfmt`, to format your code.
- Writing clear and concise code with meaningful variable and function names.
- Adding comments to explain complex logic or algorithms.
#### Cover Letter Description
Your patch description should provide a clear and concise summary of the changes you
have made. It should also include any relevant context or background information
that will help the project maintainers understand the purpose of the changes.
Make sure to reference the issue[^1] that your patch is addressing, and note any breaking
changes that your patch introduces.
[^1]: When referencing, avoid URLs or `nevent` formats with relays. Instead, use only the note ID in `note1` bech32 format.
[Conventional Commits]: https://www.conventionalcommits.org/en/v1.0.0/
2026-04-05 04:29:17 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
// n34-relay - A nostr GRASP relay implementation
// Copyright (C) 2025 Awiteb <[email protected]>
//
// 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://gnu.org/licenses/agpl-3.0>.
use std::{str::FromStr, sync::Arc};
use hyper::Uri;
use nostr::{event::Kind, key::PublicKey, nips::nip19::ToBech32};
use parking_lot::RwLock;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
/// Serializes a vector of public keys into a list of bech32-encoded `npub`
/// strings.
pub fn pubkeys_ser<S: Serializer>(
pubkeys: &Arc<RwLock<Vec<PublicKey>>>,
serializer: S,
) -> Result<S::Ok, S::Error> {
pubkeys
.read()
.iter()
.map(|pkey| pkey.to_bech32().expect("Infallible"))
.collect::<Vec<_>>()
.serialize(serializer)
}
/// Deserialize the kind from a number
pub fn kind_de<'de, D: Deserializer<'de>>(
deserializer: D,
) -> Result<Arc<RwLock<Vec<Kind>>>, D::Error> {
Ok(Arc::new(RwLock::new(
Vec::<u16>::deserialize(deserializer)?
.into_iter()
.map(Kind::from)
.collect(),
)))
}
/// Serializes a vector of URIs into a list of strings.
pub fn uris_ser<S: Serializer>(uris: &[Uri], serializer: S) -> Result<S::Ok, S::Error> {
uris.iter()
.map(|uri| uri.to_string())
.collect::<Vec<_>>()
.serialize(serializer)
}
/// Deserialize a list of string into URIs
pub fn uris_de<'de, D: Deserializer<'de>>(deserializer: D) -> Result<Vec<Uri>, D::Error> {
Vec::<String>::deserialize(deserializer)?
.into_iter()
.map(|str_uri| Uri::from_str(&str_uri))
.collect::<Result<Vec<Uri>, _>>()
.map_err(|err| serde::de::Error::custom(err.to_string()))
}
2026-04-05 04:29:15 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
exclude = ["target/**/*.toml", "Cargo.lock"]
[formatting]
align_entries = true
indent_tables = true
reorder_keys = false
[[rule]]
include = ["**/Cargo.toml"]
keys = ["dependencies"]
formatting.reorder_keys = true
2026-04-05 04:29:14 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
# Apply an Open Patch
> `n34 patch apply` command
**Usage:**
```
Set an open patch status to applied
Usage: n34 patch apply [OPTIONS] <PATCH_ID> [APPLIED_COMMITS]...
Arguments:
<PATCH_ID> The open patch id to apply it. Must be orignal root patch or revision root
[APPLIED_COMMITS]... The applied commits
Options:
--repo <NADDR-NIP05-OR-SET> Repository address in `naddr` format (`naddr1...`), NIP-05 format (`4rs.nl/n34` or `[email protected]/n34`), or a set name like `kernel`
--patches <PATCH-EVENT-ID> Patches that have been applied. Use this when only some patches have been applied, not all
```
Creates a kind `1631` event (Applied/Merged status) for the specified patch. The
patch must be in open status.
You can specify either an original patch or revision patch ID, but the status
event will only reference the original patch. Revision patches will be mentioned
in the event.
The `APPLIED_COMMITS` field serves to inform clients about the status of
specific commits, whether they have been applied or not. If you need to retrieve
the list of commits from a specific point (such as the tip of the master branch)
up to the `HEAD`, you can use the following Git command: `git log --pretty=%H
'origin/master..HEAD'`.
2026-04-05 04:29:08 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
# n34
A CLI to interact with NIP-34 and other stuff related to code in Nostr
## About
`n34` is a command-line interface (CLI) tool for sending and receiving Git
issues, patches, and comments over the Nostr protocol. It supports creating,
replying to, and managing issues and patches, making Git collaboration
decentralized and censorship-resistant.
The primary goal of `n34` is to implement [NIP-34] (`git` stuff), but its
flexible design allows for additional use cases beyond Git workflows. For more
details, see the following section.
## Documentation
Check the documentation at [n34.dev]
## Features
- [X] Repository announcements
- [ ] Repository state announcements
- [X] Patches (Send, fetch and list)
- [X] Issues (Send, view and list)
- [X] Replies
- [X] Issues and patches status
- [ ] Pull requests ([nostr-protocol/nips#1966])
- [X] Gossip Model ([NIP-65])
- [X] Proof of Work ([NIP-13])
- [X] `nostr:` URI scheme, in the issue/reply content ([NIP-21])
- [X] Signing using bunker ([NIP-46])
- [X] Signing using [NIP-07] proxy ([nostr-browser-signer-proxy])
- [ ] Code Snippets ([NIP-C0])
- [X] In device relays and repos bookmark (`sets` command)
## Why Nostr?
Nostr is fundamentally different from traditional platforms because it’s not
an application or service, it’s a decentralized protocol. This means any tool or
app can integrate with it, enabling open, permissionless collaboration without
relying on centralized gatekeepers. Unlike proprietary systems, Nostr doesn’t
require emails, passwords, or accounts. You interact directly through relays,
whether you self-host your own or use public ones, ensuring no single point of
failure or control.
What makes Nostr uniquely resilient is its design, the protocol itself is just
a set of rules, not a company or product that can disappear. Your Git issues,
patches, and comments persist as long as relays choose to store them, immune to
the whims of corporate shutdowns or policy changes. Nostr is infrastructure in
its purest form, an idea that outlives any temporary implementation. `n34` taps
into a future-proof foundation for decentralized collaboration.
### More about Nostr
- <https://nostr.com>
- <https://nostr.org>
- <https://nostr.how/en/what-is-nostr>
## Installation
You can install n34 either by cloning the repository and building it with Cargo,
or by using `cargo install` or Nix.
### Building from source
- Clone the repository:
```sh
git clone git://git.4rs.nl/awiteb/n34.git
cd n34
```
- Build the release version:
```sh
cargo build --release
```
The binary will be available at `target/release/n34`.
### Using cargo install
```sh
cargo install n34
```
The binary will be installed to your Cargo binary directory (typically `~/.cargo/bin/n34`).
Make sure `~/.cargo/bin` is in your `PATH` environment variable to run the binary from anywhere.
### Using `nix build` (+v0.4)
- Clone the repository.
- Run the `nix build` command.
The binary will be available at `result/bin/n34`.
### Adding it to your [home-manager] (+v0.4)
- Add it as an input to your `flake.nix`:
```nix
inputs = {
# Specify the version you want to install, or remove `?ref` for the unreleased
# version. You can also use any mirror; it doesn't have to be `git.4rs.nl`.
n34.url = "git+https://git.4rs.nl/awiteb/n34.git?ref=refs/tags/vx.y.x";
};
```
- Add it to your packages (ensure your home-manager `extraSpecialArgs` includes the `inputs`):
```nix
packages = [ inputs.n34.packages."${pkgs.system}".default ];
```
## Contributing
Contributions to `n34` are welcome! You can help by opening issues (such as bug
reports or feature requests) or submitting patches. **All contributions must be
submitted through Nostr**. For more details on the process, please refer to the
[CONTRIBUTING.md](CONTRIBUTING.md) file. Your support is greatly appreciated!
## Contributions & Changes
You can find the changelog at [CHANGELOG.md](CHANGELOG.md) and the list of
contributors at [AUTHORS](AUTHORS) file.
## License
n34 is licensed under the GPL-3.0 License. This means that you are free to use,
modify, and distribute the software under the terms of this license. Please
refer to the [LICENSE](LICENSE) file for more details.
[NIP-34]: https://github.com/nostr-protocol/nips/blob/master/34.md
[NIP-65]: https://github.com/nostr-protocol/nips/blob/master/65.md
[NIP-13]: https://github.com/nostr-protocol/nips/blob/master/13.md
[NIP-21]: https://github.com/nostr-protocol/nips/blob/master/21.md
[NIP-C0]: https://github.com/nostr-protocol/nips/blob/master/C0.md
[NIP-46]: https://github.com/nostr-protocol/nips/blob/master/46.md
[NIP-07]: https://github.com/nostr-protocol/nips/blob/master/07.md
[nostr-protocol/nips#1966]: https://github.com/nostr-protocol/nips/pull/1966
[nostr-browser-signer-proxy]: https://crates.io/crates/nostr-browser-signer-proxy
[home-manager]: https://github.com/nix-community/home-manager
[n34.dev]: https://n34.dev
2026-04-05 04:29:08 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.4.0] - 2025-08-08
### Added
- Support signing using NIP-46 bunker - by Awiteb
- Keyring the secret key `n34 config keyring --enable` - by Awiteb
- New flag to `patch apply and merge` to mention patches - by Awiteb
- Sign using NIP-07 - by Awiteb
### Dependencies
- Add `keyring`, `nostr-connect`, `nostr-keyring` and `url` to the dependencies - by Awiteb
- Remove `url` from `n34` dependencies - by Awiteb
- Upgrade to `[email protected]` - by Awiteb
### Documentation
- N34 book - by Awiteb
- Fix status command docs - by Awiteb
### Refactor
- Move the trait extensions to `traits.rs` - by Awiteb
- Move `root` and `root-revision` to constants - by Awiteb
## [0.3.0] - 2025-07-05
### Added
- New `patch send` command to send patches - by Awiteb
- Add `alt` tag to the git issue - by Awiteb
- Add `description` tag to the patch - by Awiteb
- New `config pow` command to set the default PoW difficulty - by Awiteb
- New `config relays` command to set the default fallbacks relays - by Awiteb
- New `issue view` command to view an issue - by Awiteb
- New `patch fetch` command to fetch patches - by Awiteb
- New `issue {reopen,close,resolve}` commands to manage issue status - by Awiteb
- New `patch` subcommands apply,close,draft,merge and reopen to manage the patch status - by Awiteb
- View the repo maintainers as `npub` - by Awiteb
- New `patch list` commands to list the repo patches - by Awiteb
- New `issue list` commands to list the repo issues - by Awiteb
- Improve exit codes and make them more specific - by Awiteb
### Dependencies
- Add `[email protected]` to the dependencies - by Awiteb
- Update `nostr` to `0.42.2` - by Awiteb
- Remove `bitcoin_hashes` and use `nostr::hashes` re-export - by Awiteb
### Fixed
- Not to return an error if `nostr-address` file does not exist - by Awiteb
- Spelling in help content - by DanConwayDev
- Fix a typo in `EmptySetRelays` error message - by Awiteb
- Require a repo in `repo view` command - by Awiteb
### Refactor
- Store the config in `CliOptions` instead of its path - by Awiteb
- Improve commands running and make the signer optional for some commands - by Awiteb
### Removed
- Remove the `--repo` option and make the repo an argument - by Awiteb
- Remove the `--to` flag from `reply` command and make it an argument - by Awiteb
- Remove `--euc` flag from `patch send` command and use the repo euc - by Awiteb
## [0.2.0] - 2025-06-01
### Added
- Add `--force-id` flag to bypass case validation in `repo announce` - by Awiteb
- Add `--address-file` flag to `repo announce` command - by Awiteb
- Read the `nostr-address` file in `repo view` command - by Awiteb
- Read the `nostr-address` file in `issue new` command - by Awiteb
- Read the `nostr-address` file in `reply` command - by Awiteb
- A `--quote-to` flag to quote the replied to content in the editor - by Awiteb
- Enter repository as nip5 - by Awiteb
- Make the relays list optional - by Awiteb
- Events and naddrs can starts with `nostr:` - by Awiteb
- Support relays and naddrs sets - by Awiteb
### Dependencies
- Add `[email protected]` to the dependencies - by Awiteb
- Enable `nip05` feature of `nostr` crate - by Awiteb
- Add `[email protected]`, `[email protected]` and `[email protected]` - by Awiteb
### Fixed
- Create a valid naddr string - by Awiteb
### Refactor
- Support more than one naddr instead of one - by Awiteb
## [0.1.0] - 2025-05-21
### Added
- Setup the CLI and create `repo view` command - by Awiteb
- Add `repo announce` command - by Awiteb
- Support PoW - by Awiteb
- Add `issue new` command - by Awiteb
- New `reply` command - by Awiteb
### Dependencies
- Add nedded dependencies - by Awiteb
- Add `[email protected]` to the dependencies - by Awiteb
- Add `[email protected]` to the dependencies - by Awiteb
- Add `[email protected]` to the dependencies - by Awiteb
- Add `[email protected]` to the dependencies - by Awiteb
- Bump `nostr` and `nostr_sdk` to `0.42.0` - by Awiteb
## [0.0.0] - 2025-05-01
### Added
- Initialize the project - by Awiteb
[0.4.0]: https://git.4rs.nl/awiteb/n34.git/tag/?h=v0.4.0
[0.3.0]: https://git.4rs.nl/awiteb/n34.git/tag/?h=v0.3.0
[0.2.0]: https://git.4rs.nl/awiteb/n34.git/tag/?h=v0.2.0
[0.1.0]: https://git.4rs.nl/awiteb/n34.git/tag/?h=v0.1.0
[0.0.0]: https://git.4rs.nl/awiteb/n34.git/tag/?h=v0.0.0
<!-- generated by git-cliff -->
2026-04-05 04:29:06 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
// n34-relay - A nostr GRASP relay implementation
// Copyright (C) 2025 Awiteb <[email protected]>
//
// 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://gnu.org/licenses/agpl-3.0>.
use std::{
borrow::Cow,
fs,
net::IpAddr,
num::{NonZeroU8, NonZeroU64, NonZeroUsize},
path::PathBuf,
sync::{
Arc,
atomic::{AtomicBool, Ordering},
},
};
use config::{Config, File as FileSource, FileFormat};
use nostr::{event::Kind, key::PublicKey, types::Url};
use parking_lot::RwLock;
use serde::{Deserialize, Serialize};
use crate::{
errors::{RelayError, RelayResult},
ext_traits::{RwlockOption, RwlockVecExt},
pathes,
relay_config::env::ConfigFromEnv,
};
/// Config defaults
pub mod defaults;
/// Struct the config from environment variables
pub mod env;
/// Config parsers
mod parsers;
/// A type for public keys list
type ArcRwVec<T> = Arc<RwLock<Vec<T>>>;
/// Indicates whether serialization is for TOML format.
///
/// Some fields are skipped during deserialization from config file,
/// but should be included when serializing to JSON.
pub static SERIALIZE_TO_TOML: AtomicBool = AtomicBool::new(false);
pub fn load_config() {
let config_path = pathes::get_default_config_path();
println!("Loading config from: {:?}", config_path);
if !config_path.exists() {
// Implementation for creating default config...
}
}
/// Configuration for the relay network.
#[derive(Debug, Deserialize, Serialize)]
pub struct NetworkConfig {
/// The IP address the relay will bind to.
#[serde(default = "defaults::net::ip_addr")]
pub ip: IpAddr,
/// The port the relay will listen on.
#[serde(default = "defaults::net::port")]
pub port: u16,
}
/// Configuration for an LMDB database instance.
#[derive(Debug, Deserialize, Serialize)]
pub struct LmdbConfig {
/// Path to the directory where the database files are stored. Defaults
/// `/etc/n34-relay/config.toml`
#[serde(default = "defaults::lmdb::dir")]
pub dir: PathBuf,
/// Maximum size of the memory map (in bytes). Defaults to `32GB` on 64-bit
/// and `4GB` on 32-bit systems.
#[serde(default = "defaults::lmdb::map_size")]
pub map_size: usize,
/// Maximum number of concurrent reader slots. Defaults to `126`.
#[serde(default = "defaults::lmdb::max_readers")]
pub max_readers: u32,
/// Number of extra databases to allocate in addition to the 9 internal
/// ones. Defaults `0`
#[serde(default = "defaults::lmdb::additional_dbs")]
pub additional_dbs: u32,
}
/// Ratelimit config
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct RatelimitConfig {
/// Maximum number of active queries allowed. Defaults 500
#[serde(default = "defaults::ratelimit::max_queries")]
pub max_queries: usize,
/// Number of events allowed per minute. Defaults 120
#[serde(default = "defaults::ratelimit::events_per_minute")]
pub events_per_minute: u32,
}
/// Relay metadata for NIP-11.
#[serde_with::skip_serializing_none]
#[derive(Debug, Deserialize, Serialize)]
pub struct Nip11Config {
/// Name of the relay.
#[serde(default, skip_serializing_if = "RwlockOption::is_none")]
pub name: RwLock<Option<String>>,
/// Description of the relay.
#[serde(default, skip_serializing_if = "RwlockOption::is_none")]
pub description: RwLock<Option<String>>,
/// URL of the relay's banner image.
#[serde(default, skip_serializing_if = "RwlockOption::is_none")]
pub banner: RwLock<Option<Url>>,
/// URL of the relay's icon image.
#[serde(default, skip_serializing_if = "RwlockOption::is_none")]
pub icon: RwLock<Option<Url>>,
/// Public key of the relay's administrator.
pub admin: Option<PublicKey>,
/// Alternate contact information for the relay administrator.
pub contact: Option<String>,
/// URL to the relay's privacy policy document.
pub privacy_policy: Option<Url>,
/// URL to the relay's terms of service document.
pub terms_of_service: Option<Url>,
/// Relay limitation
#[serde(default)]
pub limitation: Nip11Limitation,
// The following values are defined by the relay and not customizable by the user.
/// List of NIPs supported by the relay.
#[serde(
skip_deserializing,
skip_serializing_if = "ser_for_toml",
default = "defaults::nip11::supported_nips"
)]
pub supported_nips: &'static [u16],
/// List of supported GRASPs
#[serde(
skip_deserializing,
skip_serializing_if = "ser_for_toml",
default = "defaults::nip11::supported_grasps"
)]
pub supported_grasps: &'static [&'static str],
/// Name of the relay's software.
#[serde(
skip_deserializing,
skip_serializing_if = "ser_for_toml",
default = "defaults::nip11::software"
)]
pub software: &'static str,
/// Version of the relay's software.
#[serde(
skip_deserializing,
skip_serializing_if = "ser_for_toml",
default = "defaults::nip11::version"
)]
pub version: &'static str,
}
// TODO: Add `max_event_tags` and `max_content_length`
/// Represents limitations and requirements for a relay as specified in NIP-11.
#[derive(Default, Debug, Deserialize, Serialize)]
pub struct Nip11Limitation {
/// Indicates if payment is required to use the relay.
#[serde(default)]
pub payment_required: bool,
/// URL where payments can be made.
#[serde(skip_serializing_if = "Option::is_none")]
pub payments_url: Option<Url>,
// The following values are defined by the relay and not customizable by the user.
/// Maximum allowed size in bytes for incoming JSON messages.
#[serde(skip_deserializing, skip_serializing_if = "ser_for_toml", default)]
pub max_message_length: usize,
/// Maximum number of active subscriptions allowed per websocket connection.
#[serde(skip_deserializing, skip_serializing_if = "ser_for_toml", default)]
pub max_subscriptions: usize,
/// Minimum Proof of Work difficulty required for new events.
#[serde(skip_deserializing, skip_serializing_if = "ser_for_toml", default)]
pub min_pow_difficulty: u8,
/// Indicates if NIP-42 authentication is required before performing any
/// action.
#[serde(skip_deserializing, skip_serializing_if = "ser_for_toml", default)]
pub auth_required: bool,
/// Indicates if the relay enforces conditions to accept events.
#[serde(skip_deserializing, skip_serializing_if = "ser_for_toml", default)]
pub restricted_writes: bool,
/// Limits the maximum number of events a client can fetch from a single
/// subscription filter.
#[serde(skip_deserializing, skip_serializing_if = "ser_for_toml", default)]
pub max_limit: usize,
/// Sets the default number of events returned when no limit is specified in
/// a filter.
#[serde(skip_deserializing, skip_serializing_if = "ser_for_toml", default)]
pub default_limit: usize,
/// The maximum allowed length for a subscription ID as a string.
#[serde(skip_deserializing, skip_serializing_if = "ser_for_toml", default)]
pub max_subid_length: usize,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct RhaiPluginsConfig {
/// Rhai engine workers. Defaults 3
#[serde(default = "defaults::rhai::workers")]
pub workers: NonZeroU8,
/// Rhai plugins
#[serde(default)]
pub plugins: Vec<String>,
}
#[derive(Default, Debug, Deserialize, Serialize)]
pub struct PluginsConfig {
/// gRPC plugins services
#[serde(
serialize_with = "parsers::uris_ser",
deserialize_with = "parsers::uris_de",
skip_serializing_if = "Vec::is_empty",
default
)]
pub grpc: Vec<hyper::Uri>,
/// Rhai plugins
pub rhai: RhaiPluginsConfig,
}
/// Configuration settings for GRASP, including Git-related options.
#[derive(Debug, Deserialize, Serialize)]
pub struct GraspConfig {
/// Determines if GRASP is enabled or disabled.
#[serde(default = "defaults::grasp::enable")]
pub enable: bool,
/// Specifies the path to the Git executable. Defaults to 'git'.
#[serde(default = "defaults::grasp::git_path")]
pub git_path: Cow<'static, str>,
/// The maximum number of requests a Git server can handle simultaneously.
/// Default, no limit.
#[serde(default)]
pub max_reqs: Option<NonZeroUsize>,
/// A timeout for git Git server requests in seconds. If the request
/// exceeded the timeout it will aborted.
#[serde(default)]
pub req_timeout: Option<NonZeroU64>,
/// Repositories path
#[serde(skip, default = "pathes::grasp_repos")]
pub repos_path: PathBuf,
}
/// Core relay-specific configs.
#[derive(Debug, Deserialize, Serialize)]
pub struct CoreConfig {
/// The domain of the relay, excluding the protocol. Example: 'example.com'
/// or 'relay.example.net'.
#[serde(default)]
pub domain: String, // TODO: Check that it's without a protocol
/// Whether NIP42 authentication is required. Default is `false`.
#[serde(default = "defaults::relay::nip42")]
pub nip42: bool,
/// Maximum number of connections allowed. Defaults to no limit.
#[serde(default)]
pub max_connections: Option<usize>,
/// Minimum Proof of Work difficulty. Defaults to `0`.
#[serde(default = "defaults::relay::min_pow")]
pub min_pow: u8,
/// Maximum size of an event in bytes. Default is 150KB.
#[serde(default = "defaults::relay::max_event_size")]
pub max_event_size: NonZeroUsize,
/// Limits the maximum number of events a client can fetch from a single
/// subscription filter. Defaults `5000`.
#[serde(default = "defaults::relay::max_limit")]
pub max_limit: NonZeroUsize,
/// Sets the default number of events returned when no limit is specified in
/// a filter. Defaults `500`.
#[serde(default = "defaults::relay::default_limit")]
pub default_limit: NonZeroUsize,
/// The maximum allowed length for a subscription ID as a string. Defaults
/// `150`.
#[serde(default = "defaults::relay::max_subid_length")]
pub max_subid_length: NonZeroUsize,
/// List of allowed public keys in hex or `npub` format. Default is empty.
#[serde(default, serialize_with = "parsers::pubkeys_ser")]
pub whitelist: ArcRwVec<PublicKey>,
/// List of denied public keys in hex or `npub` format. Default is empty.
#[serde(default, serialize_with = "parsers::pubkeys_ser")]
pub blacklist: ArcRwVec<PublicKey>,
/// A list of administrators allowed to use the Relay Management API.
#[serde(default, serialize_with = "parsers::pubkeys_ser")]
pub admins: ArcRwVec<PublicKey>,
/// List of event kinds that are permitted
#[serde(default, deserialize_with = "parsers::kind_de")]
pub allowed_kinds: ArcRwVec<Kind>,
/// List of event kinds that are rejected
#[serde(default, deserialize_with = "parsers::kind_de")]
pub disallowed_kinds: ArcRwVec<Kind>,
}
/// Configuration for relay components.
#[derive(Debug, Deserialize, Serialize)]
pub struct RelayConfig {
/// Network-related configs for the relay.
#[serde(default)]
pub net: NetworkConfig,
/// LMDB database configs for the relay.
#[serde(default)]
pub lmdb: LmdbConfig,
/// RateLimit configuration.
#[serde(default)]
pub ratelimit: RatelimitConfig,
/// Relay's NIP-11 metadata
#[serde(default)]
pub nip11: Nip11Config,
/// Relay's plugins
#[serde(default)]
pub plugins: PluginsConfig,
#[serde(default)]
pub grasp: GraspConfig,
/// Core relay-specific configs.
#[serde(default, flatten)]
pub relay: CoreConfig,
}
impl RelayConfig {
/// Reload the config from the env and config file
pub fn reload() -> RelayResult<Self> {
let config: RelayConfig = Config::builder()
.add_source(
FileSource::from(pathes::config_file_path())
.format(FileFormat::Toml)
.required(false),
)
.add_source(RelayConfig::from_env()?)
.build()
.unwrap()
.try_deserialize()
.map_err(|err| RelayError::Config(err.to_string()))?;
Ok(config.post())
}
/// Post the config
fn post(mut self) -> Self {
self.nip11.limitation.max_message_length = self.relay.max_event_size.into();
self.nip11.limitation.max_limit = self.relay.max_limit.into();
self.nip11.limitation.default_limit = self.relay.default_limit.into();
self.nip11.limitation.max_subid_length = self.relay.max_subid_length.into();
self.nip11.limitation.max_subscriptions = self.relay.max_connections.unwrap_or(usize::MAX);
self.nip11.limitation.min_pow_difficulty = self.relay.min_pow;
self.nip11.limitation.auth_required = self.relay.nip42;
self.nip11.limitation.restricted_writes = self.relay.min_pow > 0
|| self.relay.nip42
|| self.nip11.limitation.payment_required
|| !self.relay.whitelist.is_empty()
|| !self.relay.allowed_kinds.is_empty();
self
}
/// Retrieves the database instance based on the configuration.
pub async fn get_relay_db(&self) -> RelayResult<Arc<dyn nostr_database::NostrDatabase>> {
// TODO: Support sqlite
Ok(Arc::new(
nostr_lmdb::NostrLmdbBuilder::new(&self.lmdb.dir)
.map_size(self.lmdb.map_size)
.max_readers(self.lmdb.max_readers)
.additional_dbs(self.lmdb.additional_dbs)
.build()
.await?,
))
}
}
impl Drop for RelayConfig {
fn drop(&mut self) {
fn inner(value: &RelayConfig) -> Result<(), Box<dyn std::error::Error>> {
fs::write(pathes::config_file_path(), toml::to_string_pretty(value)?)?;
Ok(())
}
tracing::info!("Writing the configuration to the file");
SERIALIZE_TO_TOML.store(true, Ordering::Relaxed);
if let Err(err) = inner(self) {
tracing::error!("Failed to write configuration to file: {err}");
}
SERIALIZE_TO_TOML.store(false, Ordering::Relaxed);
}
}
impl From<RatelimitConfig> for nostr_relay_builder::builder::RateLimit {
fn from(value: RatelimitConfig) -> Self {
Self {
max_reqs: value.max_queries,
notes_per_minute: value.events_per_minute,
}
}
}
/// Returns whether serialization to TOML is enabled.
fn ser_for_toml<T>(_: T) -> bool {
SERIALIZE_TO_TOML.load(Ordering::Relaxed)
}
2026-04-05 04:29:04 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
/target
/book
2026-04-05 04:29:03 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
# Patch Management
In `n34`, patch management is designed to give you complete control. You can
manually generate patch files using `git-format-patch` and then broadcast them
to Nostr relays. This ensures that you have full authority over the content
and structure of your patches, allowing for precise customization as per your
requirements.
Similarly, when fetching patches, `n34` provides them to you without
automatically applying, merging, or checking them. This empowers you to review
the patches at your own pace and decide whether to merge or apply them as
needed. You retain full control over the entire process, ensuring a tailored
approach to patch management.
## Patch Status Management
You can assign a status to original patches, but revision patches do not have
a specific status assigned to them. Instead, they inherit the status of the
original patch. However, if the original patch is marked as `Applied/Merged`,
the revision patch must be explicitly tagged to claim the same status. If not
tagged, the revision patch status will be `Closed`.
2026-04-05 04:28:55 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
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.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is 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. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
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.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
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 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. Use with the GNU Affero General Public License.
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 Affero 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 special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU 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 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 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 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 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/gpl-3.0.html>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
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 GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
2026-04-05 04:28:55 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
Awiteb <[email protected]> (nprofile1qqsqqqqqq9g9uljgjfcyd6dm4fegk8em2yfz0c3qp3tc6mntkrrhawgpzfmhxue69uhkummnw3ezudrjwvhxumq3dg0ly)
2026-04-05 04:28:54 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
// n34-relay - A nostr GRASP relay implementation
// Copyright (C) 2025 Awiteb <[email protected]>
//
// 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://gnu.org/licenses/agpl-3.0>.
use std::{borrow::Cow, collections::HashMap, convert::Infallible};
use config::Config;
use const_format::concatcp;
use convert_case::{Case, Casing};
use serde::{Deserialize, Serialize};
use super::{
CoreConfig,
LmdbConfig,
NetworkConfig,
Nip11Config,
Nip11Limitation,
RatelimitConfig,
RelayConfig,
};
use crate::{
errors::RelayError,
relay_config::{GraspConfig, PluginsConfig, RhaiPluginsConfig},
};
/// Prefix used for all environment variables.
pub const ENV_PREFIX: &str = "N34_RELAY";
#[derive(Debug, Serialize, Deserialize)]
#[serde(untagged)]
enum ValueKind {
String(String),
Bool(bool),
Array(Vec<ValueKind>),
U64(u64),
}
/// Parse a string value into a [`ValueKind`]
fn parse_value(value: Cow<'_, str>, is_array: bool) -> ValueKind {
if is_array {
return ValueKind::Array(
value
.split(',')
.map(|v| parse_value(Cow::Borrowed(v), false))
.collect(),
);
}
if let Ok(parsed) = value.parse::<u64>() {
ValueKind::U64(parsed)
} else if ["yes", "true"].contains(&value.trim()) {
ValueKind::Bool(true)
} else if ["no", "false"].contains(&value.trim()) {
ValueKind::Bool(false)
} else {
ValueKind::String(value.into_owned())
}
}
/// Builds a configuration for a type using environment variables.
pub trait ConfigFromEnv<const N: usize> {
/// The environment variables prefix
const ENV_PREFIX: &str;
/// The key of the type in snake case. If not empty, it must end with a dot.
const KEY: &str;
/// Contains a list of type keys in snake case, where the boolean indicates
/// whether the value should be parsed as an array.
const KEYS: [(&'static str, bool); N];
/// Error type that can be returned by the `from_env` function.
type Err;
fn from_env() -> Result<Config, Self::Err> {
let mut map: HashMap<String, ValueKind> = HashMap::new();
for (key, is_array) in Self::KEYS {
if let Ok(value) = std::env::var(format!(
"{}_{}",
Self::ENV_PREFIX,
key.from_case(Case::Snake).to_case(Case::Constant)
)) {
map.insert(
format!("{}{key}", Self::KEY),
parse_value(Cow::Owned(value), is_array),
);
}
}
Ok(Config::try_from(&map).expect("Can't fail"))
}
}
impl ConfigFromEnv<2> for NetworkConfig {
type Err = Infallible;
const ENV_PREFIX: &str = concatcp!(ENV_PREFIX, "_NET");
const KEY: &str = "net.";
const KEYS: [(&'static str, bool); 2] = [("ip", false), ("port", false)];
}
impl ConfigFromEnv<4> for LmdbConfig {
type Err = Infallible;
const ENV_PREFIX: &str = concatcp!(ENV_PREFIX, "_LMDB");
const KEY: &str = "lmdb.";
const KEYS: [(&'static str, bool); 4] = [
("dir", false),
("map_size", false),
("max_readers", false),
("additional_dbs", false),
];
}
impl ConfigFromEnv<2> for RatelimitConfig {
type Err = Infallible;
const ENV_PREFIX: &str = concatcp!(ENV_PREFIX, "_RATELIMIT");
const KEY: &str = "ratelimit.";
const KEYS: [(&'static str, bool); 2] = [("max_queries", false), ("events_per_minute", false)];
}
impl ConfigFromEnv<8> for Nip11Config {
type Err = Infallible;
const ENV_PREFIX: &str = concatcp!(ENV_PREFIX, "_NIP11");
const KEY: &str = "nip11.";
const KEYS: [(&'static str, bool); 8] = [
("name", false),
("description", false),
("banner", false),
("icon", false),
("admin", false),
("contact", false),
("privacy_policy", false),
("terms_of_service", false),
];
}
impl ConfigFromEnv<2> for Nip11Limitation {
type Err = Infallible;
const ENV_PREFIX: &str = concatcp!(Nip11Config::ENV_PREFIX, "_LIMITATION");
const KEY: &str = "nip11.limitation.";
const KEYS: [(&'static str, bool); 2] = [("payment_required", false), ("payments_url", false)];
}
impl ConfigFromEnv<2> for RhaiPluginsConfig {
type Err = Infallible;
const ENV_PREFIX: &str = concatcp!(ENV_PREFIX, "_RHAI");
const KEY: &str = "plugins.rhai.";
const KEYS: [(&'static str, bool); 2] = [("workers", false), ("plugins", true)];
}
impl ConfigFromEnv<1> for PluginsConfig {
type Err = Infallible;
const ENV_PREFIX: &str = concatcp!(ENV_PREFIX, "_PLUGINS");
const KEY: &str = "plugins.";
const KEYS: [(&'static str, bool); 1] = [("grpc", true)];
}
impl ConfigFromEnv<4> for GraspConfig {
type Err = Infallible;
const ENV_PREFIX: &str = concatcp!(ENV_PREFIX, "_GRASP");
const KEY: &str = "grasp.";
const KEYS: [(&'static str, bool); 4] = [
("enable", false),
("git_path", false),
("max_reqs", false),
("req_timeout", false),
];
}
impl ConfigFromEnv<13> for CoreConfig {
type Err = Infallible;
const ENV_PREFIX: &str = ENV_PREFIX;
const KEY: &str = "";
const KEYS: [(&'static str, bool); 13] = [
("domain", false),
("nip42", false),
("max_connections", false),
("min_pow", false),
("max_event_size", false),
("max_limit", false),
("default_limit", false),
("max_subid_length", false),
("whitelist", true),
("blacklist", true),
("admins", true),
("allowed_kinds", true),
("disallowed_kinds", true),
];
}
impl ConfigFromEnv<0> for RelayConfig {
type Err = RelayError;
// Constants defined with empty values as the `from_env` function is not
// implemented by the trait.
const ENV_PREFIX: &str = "";
const KEY: &str = "";
const KEYS: [(&'static str, bool); 0] = [];
fn from_env() -> Result<Config, Self::Err> {
Config::builder()
.add_source(NetworkConfig::from_env().expect("Infallible"))
.add_source(LmdbConfig::from_env().expect("Infallible"))
.add_source(RatelimitConfig::from_env().expect("Infallible"))
.add_source(Nip11Config::from_env().expect("Infallible"))
.add_source(Nip11Limitation::from_env().expect("Infallible"))
.add_source(RhaiPluginsConfig::from_env().expect("Infallible"))
.add_source(PluginsConfig::from_env().expect("Infallible"))
.add_source(GraspConfig::from_env().expect("Infallible"))
.add_source(CoreConfig::from_env().expect("Infallible"))
.build()
.map_err(|err| RelayError::Config(err.to_string()))
}
}
#[cfg(test)]
mod test {
use std::env::{self, temp_dir};
use nostr::key::PublicKey;
use super::*;
use crate::ext_traits::RwlockVecExt;
fn set_base_dir() {
unsafe {
env::set_var("N34_RELAY_BASE_DIR", temp_dir().join("n34-test"));
}
}
#[test]
fn core() {
set_base_dir();
unsafe {
env::set_var("N34_RELAY_NIP42", "yes");
env::set_var("N34_RELAY_MAX_CONNECTIONS", "123");
env::set_var("N34_RELAY_MIN_POW", "10");
env::set_var("N34_RELAY_MAX_EVENT_SIZE", "150000");
}
let config: RelayConfig = RelayConfig::from_env().unwrap().try_deserialize().unwrap();
assert!(config.relay.nip42);
assert_eq!(config.relay.max_connections, Some(123));
assert_eq!(config.relay.min_pow, 10);
assert_eq!(usize::from(config.relay.max_event_size), 150_000);
}
#[test]
fn array() {
set_base_dir();
let npub1 =
PublicKey::parse("npub1rzr6599lsp5fpy4qzytq6nccmpc09d8ekcc9vpemvereyuwp94qs0krtmz")
.unwrap();
let npub2 =
PublicKey::parse("npub1m2a0ht539xwr6evljppgdk6hn73e4p3dn2a23hx0ddt20rs9xsnsfx06cn")
.unwrap();
let npub3 =
PublicKey::parse("npub1wc0d0uuu02ua59h73khxu7trhsafvcvtp4xzqjkwjzvs8pyz0myq2vjxn6")
.unwrap();
unsafe {
env::set_var("N34_RELAY_WHITELIST", format!("{npub1},{npub2},{npub3}"));
env::set_var("N34_RELAY_BLACKLIST", format!("{npub1},{npub2},{npub3}"));
}
let config: RelayConfig = RelayConfig::from_env().unwrap().try_deserialize().unwrap();
assert!(config.relay.whitelist.contains(&npub1));
assert!(config.relay.whitelist.contains(&npub2));
assert!(config.relay.whitelist.contains(&npub3));
assert!(config.relay.blacklist.contains(&npub1));
assert!(config.relay.blacklist.contains(&npub2));
assert!(config.relay.blacklist.contains(&npub3));
}
#[test]
fn nested() {
set_base_dir();
unsafe {
env::set_var("N34_RELAY_NET_IP", "0.0.0.0");
env::set_var("N34_RELAY_NET_PORT", "8888");
env::set_var("N34_RELAY_LMDB_MAP_SIZE", "9999");
env::set_var("N34_RELAY_LMDB_DIR", "/app/lmdb");
}
let config: RelayConfig = RelayConfig::from_env().unwrap().try_deserialize().unwrap();
assert_eq!(config.net.ip.to_string(), "0.0.0.0");
assert_eq!(config.net.port, 8888);
assert_eq!(config.lmdb.map_size, 9999);
assert_eq!(config.lmdb.dir.to_string_lossy(), "/app/lmdb");
}
}
2026-04-05 04:28:51 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
#!/usr/bin/env sh
cargo run --bin n34 -- repo view naddr1qqpkuve5qgsqqqqqq9g9uljgjfcyd6dm4fegk8em2yfz0c3qp3tc6mntkrrhawgrqsqqqaueqyf8wumn8ghj7mn0wd68yt35wfejumnvqyt8wumn8ghj7un9d3shjtnswf5k6ctv9ehx2aqpp4mhxue69uhkummn9ekx7mqppamhxue69uhkummnw3ezumt0d5q3gamnwvaz7tmjv4kxz7fwv3sk6atn9e5k7qg5waehxw309ahx7um5wghx77r5wghxgetkxpx8xj
2026-04-05 04:28:44 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
2026-04-05 04:28:50 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
# View an Issue By ID
> `n34 issue view` command
**Usage:**
```
View an issue by its ID
Usage: n34 issue view [OPTIONS] <ISSUE_ID>
Arguments:
<ISSUE_ID> The issue id to view it
Options:
--repo <NADDR-NIP05-OR-SET> Repository address in `naddr` format (`naddr1...`), NIP-05 format (`4rs.nl/n34` or `[email protected]/n34`), or a set name like `kernel`
```
Simply provide the issue ID in `note` or `nevent` format to retrieve and display
the issue details.
2026-04-05 04:28:44 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
exclude = ["target/**/*.toml", "Cargo.lock"]
[formatting]
align_entries = true
indent_tables = true
reorder_keys = false
[[rule]]
include = ["**/Cargo.toml"]
keys = ["dependencies"]
formatting.reorder_keys = true
2026-04-05 04:28:43 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
// n34-relay - A nostr GRASP relay implementation
// Copyright (C) 2025 Awiteb <[email protected]>
//
// 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://gnu.org/licenses/agpl-3.0>.
use std::net::{IpAddr, Ipv4Addr};
use std::path::PathBuf;
use parking_lot::RwLock;
use crate::ext_traits::RwlockVecExt;
use crate::pathes;
/// `NetworkConfig` defaults
pub mod net {
use super::*;
#[inline]
pub const fn ip_addr() -> IpAddr {
IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1))
}
#[inline]
pub const fn port() -> u16 {
3598
}
}
/// `LmdbConfig` defaults
pub mod lmdb {
use super::*;
#[inline]
pub fn dir() -> PathBuf {
pathes::lmdb_dir_path()
}
#[inline]
pub const fn map_size() -> usize {
if cfg!(target_pointer_width = "32") {
1024 * 1024 * 1024 * 4
} else {
1024 * 1024 * 1024 * 32
}
}
#[inline]
pub const fn max_readers() -> u32 {
126
}
#[inline]
pub const fn additional_dbs() -> u32 {
0
}
}
/// `RatelimitConfig` defaults
pub mod ratelimit {
#[inline]
pub const fn max_queries() -> usize {
500
}
#[inline]
pub const fn events_per_minute() -> u32 {
120
}
}
/// `RhaiPluginsConfig`
pub mod rhai {
use std::num::NonZeroU8;
pub const fn workers() -> NonZeroU8 {
unsafe { NonZeroU8::new_unchecked(3) }
}
}
pub mod grasp {
use std::borrow::Cow;
pub const fn enable() -> bool {
true
}
pub const fn git_path() -> Cow<'static, str> {
Cow::Borrowed("git")
}
}
/// `Nip11Config` defaults
pub mod nip11 {
#[inline]
pub const fn supported_nips() -> &'static [u16] {
&[1, 9, 13, 17, 40, 42, 50, 59, 62, 70, 77]
}
#[inline]
pub const fn supported_grasps() -> &'static [&'static str] {
&["GRASP-01"]
}
#[inline]
pub const fn software() -> &'static str {
"https://relay.n34.dev"
}
#[inline]
pub const fn version() -> &'static str {
// e.g. `0.1.0`
env!("CARGO_PKG_VERSION")
}
}
/// `RelayConfig` defaults
pub mod relay {
use std::num::NonZeroUsize;
#[inline]
pub const fn nip42() -> bool {
false
}
#[inline]
pub const fn min_pow() -> u8 {
0
}
#[inline]
pub const fn max_event_size() -> NonZeroUsize {
unsafe { NonZeroUsize::new_unchecked(1024 * 150) }
}
#[inline]
pub const fn max_limit() -> NonZeroUsize {
unsafe { NonZeroUsize::new_unchecked(5000) }
}
#[inline]
pub const fn default_limit() -> NonZeroUsize {
unsafe { NonZeroUsize::new_unchecked(500) }
}
#[inline]
pub const fn max_subid_length() -> NonZeroUsize {
unsafe { NonZeroUsize::new_unchecked(150) }
}
}
impl Default for super::NetworkConfig {
fn default() -> Self {
use self::net::*;
Self {
ip: ip_addr(),
port: port(),
}
}
}
impl Default for super::LmdbConfig {
fn default() -> Self {
use self::lmdb::*;
Self {
dir: dir(),
map_size: map_size(),
max_readers: max_readers(),
additional_dbs: additional_dbs(),
}
}
}
impl Default for super::RatelimitConfig {
fn default() -> Self {
use self::ratelimit::*;
Self {
max_queries: max_queries(),
events_per_minute: events_per_minute(),
}
}
}
impl Default for super::RhaiPluginsConfig {
fn default() -> Self {
use self::rhai::*;
Self {
workers: workers(),
plugins: Vec::new(),
}
}
}
impl Default for super::GraspConfig {
fn default() -> Self {
use self::grasp::*;
Self {
enable: true,
git_path: git_path(),
max_reqs: None,
req_timeout: None,
repos_path: pathes::grasp_repos(),
}
}
}
impl Default for super::Nip11Config {
fn default() -> Self {
use self::nip11::*;
Self {
name: RwLock::new(None),
description: RwLock::new(None),
banner: RwLock::new(None),
icon: RwLock::new(None),
admin: Option::None,
contact: Option::None,
privacy_policy: Option::None,
terms_of_service: Option::None,
limitation: super::Nip11Limitation::default(),
supported_nips: supported_nips(),
supported_grasps: supported_grasps(),
software: software(),
version: version(),
}
}
}
impl Default for super::CoreConfig {
fn default() -> Self {
use relay::*;
Self {
domain: String::new(),
nip42: nip42(),
max_connections: None,
min_pow: min_pow(),
max_event_size: max_event_size(),
max_limit: max_limit(),
default_limit: default_limit(),
max_subid_length: max_subid_length(),
whitelist: RwlockVecExt::new_empty(),
blacklist: RwlockVecExt::new_empty(),
admins: RwlockVecExt::new_empty(),
allowed_kinds: RwlockVecExt::new_empty(),
disallowed_kinds: RwlockVecExt::new_empty(),
}
}
}
2026-04-05 04:28:32 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
// n34-relay - A nostr GRASP relay implementation
// Copyright (C) 2025 Awiteb <[email protected]>
//
// 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://gnu.org/licenses/agpl-3.0>.
use std::sync::Arc;
use nostr::{
event::{Event, Kind, TagStandard, Tags},
key::PublicKey,
util::BoxedFuture,
};
use nostr_relay_builder::builder::WritePolicyResult;
use parking_lot::RwLock;
use crate::{
ext_traits::{RwlockVecExt, WritePolicyResultExt},
relay::plugins_manager::RelayPlugin,
};
type ArcRwVec<T> = Arc<RwLock<Vec<T>>>;
/// A blacklist of public keys. Events are accepted only if their public key is
/// not in this list.
pub struct PubKeyBlacklist(
/// The set of blacklisted public keys.
pub ArcRwVec<PublicKey>,
);
/// A whitelist of public keys. Events are accepted only if the whitelist is
/// empty or their public key is in it.
pub struct PubKeyWhiteList(
/// The set of whitelisted public keys.
pub ArcRwVec<PublicKey>,
);
/// Verifies if the event tags contain any of the whitelisted public keys.
/// Events with such mentions are accepted.
pub struct MentionedPubKey(
/// The collection of public keys to search for in the event tags.
pub ArcRwVec<PublicKey>,
);
/// Accepts events if their kind is in the whitelist or if the whitelist is
/// empty.
pub struct KindWhitelist(
/// The list of allowed event kinds.
pub ArcRwVec<Kind>,
);
/// Accepts events if their kind is not in the blacklist.
pub struct KindBlacklist(
/// The list of disallowed event kinds.
pub ArcRwVec<Kind>,
);
impl RelayPlugin for PubKeyBlacklist {
fn check_event<'a>(&'a self, event: &'a Event) -> BoxedFuture<'a, Option<WritePolicyResult>> {
Box::pin(async {
if self.0.contains(&event.pubkey) {
return Some(WritePolicyResult::blocked_reject(
"this public key is blacklisted",
));
}
Some(WritePolicyResult::Accept)
})
}
}
impl RelayPlugin for PubKeyWhiteList {
fn check_event<'a>(&'a self, event: &'a Event) -> BoxedFuture<'a, Option<WritePolicyResult>> {
Box::pin(async {
if self.0.is_empty() || self.0.contains(&event.pubkey) {
return Some(WritePolicyResult::Accept);
}
Some(WritePolicyResult::blocked_reject(
"this public key is not whitelisted",
))
})
}
}
impl RelayPlugin for MentionedPubKey {
fn check_event<'a>(&'a self, event: &'a Event) -> BoxedFuture<'a, Option<WritePolicyResult>> {
Box::pin(async {
let whitelist_lock = self.0.read();
if whitelist_lock.is_empty()
|| public_keys(&event.tags).any(|p| whitelist_lock.contains(p))
{
return Some(WritePolicyResult::Accept);
}
Some(WritePolicyResult::blocked_reject(
"this public key is not whitelisted",
))
})
}
}
impl RelayPlugin for KindWhitelist {
fn check_event<'a>(&'a self, event: &'a Event) -> BoxedFuture<'a, Option<WritePolicyResult>> {
Box::pin(async {
if self.0.is_empty() || self.0.contains(&event.kind) {
return Some(WritePolicyResult::Accept);
}
Some(WritePolicyResult::blocked_reject("not allowed event kind"))
})
}
}
impl RelayPlugin for KindBlacklist {
fn check_event<'a>(&'a self, event: &'a Event) -> BoxedFuture<'a, Option<WritePolicyResult>> {
Box::pin(async {
if !self.0.contains(&event.kind) {
return Some(WritePolicyResult::Accept);
}
Some(WritePolicyResult::blocked_reject("event kind is blocked"))
})
}
}
/// Returns all the public keys in the tags
#[inline]
fn public_keys(tags: &Tags) -> impl Iterator<Item = &PublicKey> {
tags.iter().filter_map(|tag| {
match tag.as_standardized()? {
TagStandard::PublicKey { public_key, .. } => Some(public_key),
TagStandard::PublicKeyReport(pkey, ..) => Some(pkey),
TagStandard::Coordinate { coordinate, .. } => Some(&coordinate.public_key),
_ => None,
}
})
}
2026-04-05 04:28:40 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
<?xml version='1.0' encoding='windows-1252'?>
<!--
Copyright (C) 2017 Christopher R. Field.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
The "cargo wix" subcommand provides a variety of predefined variables available
for customization of this template. The values for each variable are set at
installer creation time. The following variables are available:
TargetTriple = The rustc target triple name.
TargetEnv = The rustc target environment. This is typically either
"msvc" or "gnu" depending on the toolchain downloaded and
installed.
TargetVendor = The rustc target vendor. This is typically "pc", but Rust
does support other vendors, like "uwp".
CargoTargetBinDir = The complete path to the directory containing the
binaries (exes) to include. The default would be
"target\release\". If an explicit rustc target triple is
used, i.e. cross-compiling, then the default path would
be "target\<CARGO_TARGET>\<CARGO_PROFILE>",
where "<CARGO_TARGET>" is replaced with the "CargoTarget"
variable value and "<CARGO_PROFILE>" is replaced with the
value from the "CargoProfile" variable. This can also
be overridden manually with the "target-bin-dir" flag.
CargoTargetDir = The path to the directory for the build artifacts, i.e.
"target".
CargoProfile = The cargo profile used to build the binaries
(usually "debug" or "release").
Version = The version for the installer. The default is the
"Major.Minor.Fix" semantic versioning number of the Rust
package.
-->
<!--
Please do not remove these pre-processor If-Else blocks. These are used with
the `cargo wix` subcommand to automatically determine the installation
destination for 32-bit versus 64-bit installers. Removal of these lines will
cause installation errors.
-->
<?if $(sys.BUILDARCH) = x64 or $(sys.BUILDARCH) = arm64 ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?else ?>
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
<?endif ?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<Product
Id='*'
Name='n34-relay'
UpgradeCode='036A2A4F-DA54-4FE2-B2D8-8C58D5814874'
Manufacturer='Awiteb'
Language='1033'
Codepage='1252'
Version='$(var.Version)'>
<Package Id='*'
Keywords='Installer'
Description='A nostr GRASP relay implementation'
Manufacturer='Awiteb'
InstallerVersion='450'
Languages='1033'
Compressed='yes'
InstallScope='perMachine'
SummaryCodepage='1252'
/>
<MajorUpgrade
Schedule='afterInstallInitialize'
DowngradeErrorMessage='A newer version of [ProductName] is already installed. Setup will now exit.'/>
<Media Id='1' Cabinet='media1.cab' EmbedCab='yes' DiskPrompt='CD-ROM #1'/>
<Property Id='DiskPrompt' Value='n34-relay Installation'/>
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='$(var.PlatformProgramFilesFolder)' Name='PFiles'>
<Directory Id='APPLICATIONFOLDER' Name='n34-relay'>
<!--
Enabling the license sidecar file in the installer is a four step process:
1. Uncomment the `Component` tag and its contents.
2. Change the value for the `Source` attribute in the `File` tag to a path
to the file that should be included as the license sidecar file. The path
can, and probably should be, relative to this file.
3. Change the value for the `Name` attribute in the `File` tag to the
desired name for the file when it is installed alongside the `bin` folder
in the installation directory. This can be omitted if the desired name is
the same as the file name.
4. Uncomment the `ComponentRef` tag with the Id attribute value of "License"
further down in this file.
-->
<!--
<Component Id='License' Guid='*'>
<File Id='LicenseFile' Name='ChangeMe' DiskId='1' Source='C:\Path\To\File' KeyPath='yes'/>
</Component>
-->
<Directory Id='Bin' Name='bin'>
<Component Id='Path' Guid='97D3207D-71DB-4DD0-B548-E43E8C664B7D' KeyPath='yes'>
<Environment
Id='PATH'
Name='PATH'
Value='[Bin]'
Permanent='no'
Part='last'
Action='set'
System='yes'/>
</Component>
<Component Id='binary0' Guid='*'>
<File
Id='exe0'
Name='n34_relay.exe'
DiskId='1'
Source='$(var.CargoTargetBinDir)\n34_relay.exe'
KeyPath='yes'/>
</Component>
</Directory>
</Directory>
</Directory>
</Directory>
<Feature
Id='Binaries'
Title='Application'
Description='Installs all binaries and the license.'
Level='1'
ConfigurableDirectory='APPLICATIONFOLDER'
AllowAdvertise='no'
Display='expand'
Absent='disallow'>
<!--
Uncomment the following `ComponentRef` tag to add the license
sidecar file to the installer.
-->
<!--<ComponentRef Id='License'/>-->
<ComponentRef Id='binary0'/>
<Feature
Id='Environment'
Title='PATH Environment Variable'
Description='Add the install location of the [ProductName] executable to the PATH system environment variable. This allows the [ProductName] executable to be called from any location.'
Level='1'
Absent='allow'>
<ComponentRef Id='Path'/>
</Feature>
</Feature>
<SetProperty Id='ARPINSTALLLOCATION' Value='[APPLICATIONFOLDER]' After='CostFinalize'/>
<!--
Uncomment the following `Icon` and `Property` tags to change the product icon.
The product icon is the graphic that appears in the Add/Remove
Programs control panel for the application.
-->
<!--<Icon Id='ProductICO' SourceFile='wix\Product.ico'/>-->
<!--<Property Id='ARPPRODUCTICON' Value='ProductICO' />-->
<Property Id='ARPHELPLINK' Value='https://relay.n34.dev/docs.html'/>
<UI>
<UIRef Id='WixUI_FeatureTree'/>
<!--
Enabling the EULA dialog in the installer is a three step process:
1. Comment out or remove the two `Publish` tags that follow the
`WixVariable` tag.
2. Uncomment the `<WixVariable Id='WixUILicenseRtf' Value='Path\to\Eula.rft'>` tag further down
3. Replace the `Value` attribute of the `WixVariable` tag with
the path to a RTF file that will be used as the EULA and
displayed in the license agreement dialog.
-->
<Publish Dialog='WelcomeDlg' Control='Next' Event='NewDialog' Value='CustomizeDlg' Order='99'>1</Publish>
<Publish Dialog='CustomizeDlg' Control='Back' Event='NewDialog' Value='WelcomeDlg' Order='99'>1</Publish>
</UI>
<!--
Enabling the EULA dialog in the installer requires uncommenting
the following `WixUILicenseRTF` tag and changing the `Value`
attribute.
-->
<!-- <WixVariable Id='WixUILicenseRtf' Value='Relative\Path\to\Eula.rtf'/> -->
<!--
Uncomment the next `WixVariable` tag to customize the installer's
Graphical User Interface (GUI) and add a custom banner image across
the top of each screen. See the WiX Toolset documentation for details
about customization.
The banner BMP dimensions are 493 x 58 pixels.
-->
<!--<WixVariable Id='WixUIBannerBmp' Value='wix\Banner.bmp'/>-->
<!--
Uncomment the next `WixVariable` tag to customize the installer's
Graphical User Interface (GUI) and add a custom image to the first
dialog, or screen. See the WiX Toolset documentation for details about
customization.
The dialog BMP dimensions are 493 x 312 pixels.
-->
<!--<WixVariable Id='WixUIDialogBmp' Value='wix\Dialog.bmp'/>-->
</Product>
</Wix>
2026-04-05 04:28:39 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
# Resolves an Issue
> `n34 issue resolve` command
**Usage:**
```
Resolves an issue
Usage: n34 issue resolve [OPTIONS] <ISSUE_ID>
Arguments:
<ISSUE_ID> The issue id to resolve it
Options:
--repo <NADDR-NIP05-OR-SET> Repository address in `naddr` format (`naddr1...`), NIP-05 format (`4rs.nl/n34` or `[email protected]/n34`), or a set name like `kernel`
```
Issue a kind `1631` (Resolved status) event for the specified issue.
2026-04-05 04:28:33 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
[package]
name = "n34"
description = "A CLI to interact with NIP-34 and other stuff related to code in Nostr"
version = "0.4.1"
edition = "2024"
license = "GPL-3.0-or-later"
authors = ["Awiteb <[email protected]>"]
readme = "README.md"
documentation = "https://n34.dev/commands.html"
homepage = "https://n34.dev"
repository = "https://github.com/gnostr-org/get_file_hash.git"
keywords = ["nostr", "NIP-34", "CLI"]
categories = ["command-line-utilities"]
rust-version = "1.88.0"
[package.metadata.wix]
upgrade-guid = "5E8926D0-4A18-48E9-A070-AFB0F698F04C"
path-guid = "7A2E5F6A-FC23-498B-AEC1-5FA63678FBFD"
license = false
eula = false
[[bin]]
name = "n34-cli"
path = "src/main.rs"
[dependencies]
chrono = "0.4.41"
convert_case = "0.8.0"
dirs = "6.0.0"
easy-ext = "1.0.2"
either = "1.15.0"
futures = "0.3.31"
nostr-browser-signer-proxy = "0.43.0"
regex = "1.11.1"
tempfile = "3.20.0"
thiserror = "2.0.12"
toml = "0.9.4"
tracing = "0.1.41"
tracing-subscriber = "0.3.19"
[dependencies.clap]
features = ["derive"]
version = "4.5.42"
[dependencies.clap-verbosity-flag]
default-features = false
features = ["tracing"]
version = "3.0.3"
[dependencies.nostr]
default-features = false
features = ["std"]
version = "0.43.0"
[dependencies.nostr-connect]
default-features = false
version = "0.43.0"
[dependencies.nostr-keyring]
default-features = false
version = "0.43.0"
[dependencies.nostr-sdk]
default-features = false
version = "0.43.0"
[dependencies.reqwest]
default-features = false
features = ["http2", "json", "rustls-tls"]
version = "0.12.22"
[dependencies.serde]
features = ["derive"]
version = "1.0.219"
[dependencies.tokio]
features = ["macros", "rt-multi-thread"]
version = "1.47.1"
# [profile.release]
# lto = "fat"
# opt-level = 3
2026-04-05 04:28:32 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
/target
/book
2026-04-05 04:28:28 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
# Reopen a Closed Issue
> `n34 issue reopen` command
**Usage:**
```
Reopens a closed issue
Usage: n34 issue reopen [OPTIONS] <ISSUE_ID>
Arguments:
<ISSUE_ID> The ID of the closed issue to reopen
Options:
--repo <NADDR-NIP05-OR-SET> Repository address in `naddr` format (`naddr1...`), NIP-05 format (`4rs.nl/n34` or `[email protected]/n34`), or a set name like `kernel`
```
Issue a kind `1630` (Open status) for the specified issue. The issue have to
be closed.
2026-04-05 04:28:29 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
// n34-relay - A nostr GRASP relay implementation
// Copyright (C) 2025 Awiteb <[email protected]>
//
// 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://gnu.org/licenses/agpl-3.0>.
use std::fs;
use nostr::{
event::{Event, TagKind, TagStandard},
key::PublicKey,
};
use crate::{
errors::{RelayError, RelayResult},
pathes,
};
/// Opens the logs file for writing. If the file size exceeds 5MB, it is opened
/// in write mode, otherwise in append mode.
pub fn logs_file() -> RelayResult<fs::File> {
const FIVE_MB: u64 = 1024 * 1024 * 5;
let logs_path = pathes::logs_file_path();
if let Some(parent) = logs_path.parent()
&& !parent.exists()
{
fs::create_dir_all(parent)
.map_err(|err| RelayError::Fs(parent.to_path_buf(), err.to_string()))?;
}
_ = fs::File::create_new(&logs_path);
let is_large = if let Ok(file) = fs::File::open(&logs_path)
&& let Ok(metadata) = file.metadata()
{
metadata.len() >= FIVE_MB
} else {
false
};
fs::OpenOptions::new()
.write(true)
.append(!is_large)
.truncate(is_large)
.open(&logs_path)
.map_err(|err| RelayError::Fs(logs_path, err.to_string()))
}
/// Replaces template variables in content with their value.
fn homepage_variables(content: &str) -> String {
content.replace("{{VERSION}}", env!("CARGO_PKG_VERSION"))
}
/// Returns the content of the homepage if the file exists, otherwise the
/// default homepage
pub fn homepage_content() -> String {
let default_page = include_str!("default-homepage.html");
let homepage_path = pathes::homepage_file_path();
if !homepage_path.exists() {
tracing::debug!(
"No custom home page in `{}`, using the default one",
homepage_path.display()
);
return homepage_variables(default_page);
}
match fs::read_to_string(&homepage_path) {
Ok(content) => {
tracing::info!("Using the custom home page: `{}`", homepage_path.display());
homepage_variables(&content)
}
Err(err) => {
tracing::error!(
"Failed to get the custom home page content from `{}`: {err}",
homepage_path.display()
);
homepage_variables(default_page)
}
}
}
/// Removes the protocol part (e.g. `http://`, `https://`) from a URL string.
///
/// If no protocol is found, returns the original string unchanged.
pub fn remove_proto(str_url: &str) -> &str {
const SEPARATOR: &str = "://";
if let Some(index) = str_url.find(SEPARATOR) {
&str_url[index + SEPARATOR.len()..]
} else {
str_url
}
}
/// Fetches the maintainers associated with the event. Returns an empty iterator
/// if no maintainers are found.
#[inline]
pub fn get_maintainers(event: &Event) -> impl Iterator<Item = &PublicKey> {
event
.tags
.find_standardized(TagKind::Maintainers)
.map(|tag| {
if let TagStandard::GitMaintainers(pubkeys) = tag {
return pubkeys.as_slice();
}
unreachable!("TagKind::Maintainers")
})
.unwrap_or(&[])
.iter()
}
/// Validates that a string is a valid 40-character hex SHA-1 OID.
#[inline]
pub fn is_valid_sha1(s: &str) -> bool {
s.len() == 40 && s.chars().all(|c| c.is_ascii_hexdigit())
}
2026-04-05 04:28:22 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
// n34-relay - A nostr GRASP relay implementation
// Copyright (C) 2025 Awiteb <[email protected]>
//
// 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://gnu.org/licenses/agpl-3.0>.
use std::sync::Arc;
use either::Either;
use nostr::{event::Event, filter::Filter};
use super::{rhai_caller::WorkerRx, rhai_runner::RhaiPluginsRunner};
/// Worker that receives and executes Rhai script calls.
pub struct RhaiWorker;
impl RhaiWorker {
/// Spawns a new worker that processes incoming events and queries.
///
/// The worker continuously receives messages through `rx` and processes
/// them using the provided `runner`. Events and queries are handled as
/// they arrive.
///
/// # Safety
/// The dereference is safe because the caller waits for the response and
/// won't drop the reference while it's being used.
pub fn create(rx: WorkerRx, runner: Arc<RhaiPluginsRunner>) {
tokio::spawn(async move {
while let Ok((event_or_filter, response_tx)) = rx.recv_async().await {
let res = match event_or_filter {
Either::Left(event_addr) => {
runner.admit_event(unsafe { &*(event_addr as *const Event) })
}
Either::Right(filter_addr) => {
runner.admit_query(unsafe { &*(filter_addr as *const Filter) })
}
};
_ = response_tx.send(res);
}
});
}
}
2026-04-05 04:28:21 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
# Contributing to `n34`
For basic information about the `n34` project, please read the
[README.md](README.md). The project is licensed under **GPL-3.0**, and by
contributing, your work will also be licensed under the same terms.
Before submitting changes, please read the [Developer Certificate of Origin](DCO).
All patches must include a `Signed-off-by: NAME <EMAIL>` line to acknowledge
your agreement with the DCO.
Ensure your Git name and email are correctly configured. While you don’t need to
use your real details, avoid leaving them as the default values. To verify your
current settings, run:
```bash
git config user.name
git config user.email
```
If they’re incorrect or unset, update them using:
```bash
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
```
We welcome all contributions, whether it be bug reports, fixes, feature
submissions, feature requests, or improving documentation or testing. Enjoy
collaborating!
## Git Repository
The repository is hosted at <https://git.4rs.nl/awiteb/n34.git>, with `master`
as the active development branch.
## Nostr Repository Address
You can submit issues and patches via any
Nostr-compatible client using the address:
`naddr1qqpkuve5qgsqqqqqq9g9uljgjfcyd6dm4fegk8em2yfz0c3qp3tc6mntkrrhawgrqsqqqaueq
yf8wumn8ghj7mn0wd68yt35wfejumnvqyxhwumn8ghj7mn0wvhxcmmvqy28wumn8ghj7mn0wd68ytn00
p68ytnyv4mqwuj6xc`
When using `n34`, there's no need to specify the address, it will automatically
check the `nostr-address` file. Simply submit your issues and patches without
worrying about this detail.
## Contribution Workflow
Before submitting changes, open an issue to discuss your proposed contribution.
Clearly indicate that you intend to work on it and wait for a maintainer's
response. If the issue remains open, you may proceed with submitting your patch.
### Reporting Issues
When opening an issue, include:
- Detailed steps to reproduce the problem
- Relevant error messages or logs (use the `-vvvv` flag for verbose output)
- Expected vs. actual behavior
Please label your issue appropriately (e.g., `bug`, `feature`, `question`) to
help categorize it.
### Your Patch
Ensure your patch submission tool notifies the maintainers and sends the patch
to their read relays, most tools handle this automatically.
#### Patch Guidelines
- Keep patches small: Focused changes are easier to review and merge.
- Run `just ci` before submitting your patch.
- Update the change log with your patch. Run `just changelog` or `git-cliff > CHANGELOG.md`
- Add your name to the [AUTHORS](AUTHORS) file if this is your first contribution. (alphabetical order)
- Use [Conventional Commits]: Start the patch subject with one of these types:
- `feat`: New feature
- `fix`: Bug fix
- `docs`: Documentation updates
- `refactor`: Code restructuring without behavioral changes
- `deprecate`: Marking code as deprecated
- `remove`: Removing deprecated code
- `security`: Security-related changes
- `perf`: Performance improvements
- `test`: Test additions or corrections
- For all other changes, use `chore`.
- Add `!` to the subject if your patch contains a breacking change, e.g.
`remove!: text` and `fix(reply)!: text`
- Use the `--cover-letter` flag to include a cover letter with your patch. Describe the issue you’re addressing, whether it’s a one-line bug fix or a 5000-line new feature.
- Specify the base commit for your patch using the `--base` flag.
- First-time contributors: Review the [Submitting Patches guide](https://www.kernel.org/doc/html/latest/process/submitting-patches.html) before sending your patch.
- If you revise your patch, you should reference all previous revisions (or the
root patch if this is the first revision) and explain the changes made (i.e.,
the differences between this patch and the prior one).
#### Code Style
When writing code, make sure to folow this:
- Using Rust's official formatting tool, `rustfmt`, to format your code.
- Writing clear and concise code with meaningful variable and function names.
- Adding comments to explain complex logic or algorithms.
#### Cover Letter Description
Your patch description should provide a clear and concise summary of the changes you
have made. It should also include any relevant context or background information
that will help the project maintainers understand the purpose of the changes.
Make sure to reference the issue[^1] that your patch is addressing, and note any breaking
changes that your patch introduces.
[^1]: When referencing, avoid URLs or `nevent` formats with relays. Instead, use only the note ID in `note1` bech32 format.
[Conventional Commits]: https://www.conventionalcommits.org/en/v1.0.0/
2026-04-05 04:28:21 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
#!/usr/bin/env sh
cargo run --bin n34 -- repo view naddr1qqpkuve5qgsqqqqqq9g9uljgjfcyd6dm4fegk8em2yfz0c3qp3tc6mntkrrhawgrqsqqqaueqyf8wumn8ghj7mn0wd68yt35wfejumnvqyt8wumn8ghj7un9d3shjtnswf5k6ctv9ehx2aqpp4mhxue69uhkummn9ekx7mqppamhxue69uhkummnw3ezumt0d5q3gamnwvaz7tmjv4kxz7fwv3sk6atn9e5k7qg5waehxw309ahx7um5wghx77r5wghxgetkxpx8xj
2026-04-05 04:28:17 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
// n34-relay - A nostr GRASP relay implementation
// Copyright (C) 2025 Awiteb <[email protected]>
//
// 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://gnu.org/licenses/agpl-3.0>.
use std::{path::PathBuf, sync::Arc};
use nostr::{key::PublicKey, nips::nip19::ToBech32};
use nostr_database::NostrDatabase;
use nostr_relay_builder::LocalRelay;
use crate::relay_config::RelayConfig;
/// Router state.
pub struct RouterState {
/// Configuration settings for the relay.
pub config: Arc<RelayConfig>,
/// The local relay instance being managed.
pub relay: Arc<LocalRelay>,
/// The relay database
pub database: Arc<dyn NostrDatabase>,
}
impl RouterState {
/// Creates a new router state.
pub fn new(
config: Arc<RelayConfig>,
relay: Arc<LocalRelay>,
database: Arc<dyn NostrDatabase>,
) -> Self {
Self {
config,
relay,
database,
}
}
/// Returns the repo path if it's exists
pub fn repo_path(&self, npub: &PublicKey, repo_name: &str) -> Option<PathBuf> {
let path = self
.config
.grasp
.repos_path
.join(npub.to_bech32().expect("Infallible"))
.join(repo_name)
.with_extension("git");
path.exists().then_some(path)
}
}
2026-04-05 04:28:11 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.4.0] - 2025-08-08
### Added
- Support signing using NIP-46 bunker - by Awiteb
- Keyring the secret key `n34 config keyring --enable` - by Awiteb
- New flag to `patch apply and merge` to mention patches - by Awiteb
- Sign using NIP-07 - by Awiteb
### Dependencies
- Add `keyring`, `nostr-connect`, `nostr-keyring` and `url` to the dependencies - by Awiteb
- Remove `url` from `n34` dependencies - by Awiteb
- Upgrade to `[email protected]` - by Awiteb
### Documentation
- N34 book - by Awiteb
- Fix status command docs - by Awiteb
### Refactor
- Move the trait extensions to `traits.rs` - by Awiteb
- Move `root` and `root-revision` to constants - by Awiteb
## [0.3.0] - 2025-07-05
### Added
- New `patch send` command to send patches - by Awiteb
- Add `alt` tag to the git issue - by Awiteb
- Add `description` tag to the patch - by Awiteb
- New `config pow` command to set the default PoW difficulty - by Awiteb
- New `config relays` command to set the default fallbacks relays - by Awiteb
- New `issue view` command to view an issue - by Awiteb
- New `patch fetch` command to fetch patches - by Awiteb
- New `issue {reopen,close,resolve}` commands to manage issue status - by Awiteb
- New `patch` subcommands apply,close,draft,merge and reopen to manage the patch status - by Awiteb
- View the repo maintainers as `npub` - by Awiteb
- New `patch list` commands to list the repo patches - by Awiteb
- New `issue list` commands to list the repo issues - by Awiteb
- Improve exit codes and make them more specific - by Awiteb
### Dependencies
- Add `[email protected]` to the dependencies - by Awiteb
- Update `nostr` to `0.42.2` - by Awiteb
- Remove `bitcoin_hashes` and use `nostr::hashes` re-export - by Awiteb
### Fixed
- Not to return an error if `nostr-address` file does not exist - by Awiteb
- Spelling in help content - by DanConwayDev
- Fix a typo in `EmptySetRelays` error message - by Awiteb
- Require a repo in `repo view` command - by Awiteb
### Refactor
- Store the config in `CliOptions` instead of its path - by Awiteb
- Improve commands running and make the signer optional for some commands - by Awiteb
### Removed
- Remove the `--repo` option and make the repo an argument - by Awiteb
- Remove the `--to` flag from `reply` command and make it an argument - by Awiteb
- Remove `--euc` flag from `patch send` command and use the repo euc - by Awiteb
## [0.2.0] - 2025-06-01
### Added
- Add `--force-id` flag to bypass case validation in `repo announce` - by Awiteb
- Add `--address-file` flag to `repo announce` command - by Awiteb
- Read the `nostr-address` file in `repo view` command - by Awiteb
- Read the `nostr-address` file in `issue new` command - by Awiteb
- Read the `nostr-address` file in `reply` command - by Awiteb
- A `--quote-to` flag to quote the replied to content in the editor - by Awiteb
- Enter repository as nip5 - by Awiteb
- Make the relays list optional - by Awiteb
- Events and naddrs can starts with `nostr:` - by Awiteb
- Support relays and naddrs sets - by Awiteb
### Dependencies
- Add `[email protected]` to the dependencies - by Awiteb
- Enable `nip05` feature of `nostr` crate - by Awiteb
- Add `[email protected]`, `[email protected]` and `[email protected]` - by Awiteb
### Fixed
- Create a valid naddr string - by Awiteb
### Refactor
- Support more than one naddr instead of one - by Awiteb
## [0.1.0] - 2025-05-21
### Added
- Setup the CLI and create `repo view` command - by Awiteb
- Add `repo announce` command - by Awiteb
- Support PoW - by Awiteb
- Add `issue new` command - by Awiteb
- New `reply` command - by Awiteb
### Dependencies
- Add nedded dependencies - by Awiteb
- Add `[email protected]` to the dependencies - by Awiteb
- Add `[email protected]` to the dependencies - by Awiteb
- Add `[email protected]` to the dependencies - by Awiteb
- Add `[email protected]` to the dependencies - by Awiteb
- Bump `nostr` and `nostr_sdk` to `0.42.0` - by Awiteb
## [0.0.0] - 2025-05-01
### Added
- Initialize the project - by Awiteb
[0.4.0]: https://git.4rs.nl/awiteb/n34.git/tag/?h=v0.4.0
[0.3.0]: https://git.4rs.nl/awiteb/n34.git/tag/?h=v0.3.0
[0.2.0]: https://git.4rs.nl/awiteb/n34.git/tag/?h=v0.2.0
[0.1.0]: https://git.4rs.nl/awiteb/n34.git/tag/?h=v0.1.0
[0.0.0]: https://git.4rs.nl/awiteb/n34.git/tag/?h=v0.0.0
<!-- generated by git-cliff -->
2026-04-05 04:28:15 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
# Create an Issue
> `n34 issue new` Command
**Usage:**
```
Create a new repository issue
Usage: n34 issue new [OPTIONS] <--content <CONTENT>|--editor>
Options:
--repo <NADDR-NIP05-OR-SET> Repository address in `naddr` format (`naddr1...`), NIP-05 format (`4rs.nl/n34` or `[email protected]/n34`), or a set name like `kernel`
-c, --content <CONTENT> Markdown content for the issue. Cannot be used together with the `--editor` flag
-e, --editor Opens the user's default editor to write issue content. The first line will be used as the issue subject
--subject <SUBJECT> The issue subject. Cannot be used together with the `--editor` flag
-l, --label <LABEL> Labels for the issue. Can be specified as arguments (-l bug) or hashtags in content (#bug)
```
Use the `n34 issue new` command to create a new issue in a repository. This
command supports the [NIP-21] (`nostr:` URI scheme) and hashtags within the
issue content. When you mention public keys in the content, they will be
included in the event tags. Additionally, using hashtags like `#bug` in the
issue body will automatically apply them as labels.
You must choose between the `--content` and `--editor` options. With
`--content`, you provide the issue content directly in the command. With
`--editor`, your default `$EDITOR` will open, allowing you to write the issue
content. The first line of the editor's output will be used as the issue
subject.
2026-04-05 04:28:10 UTC npub127u525u3l674p6l40c72u4ptxvumhfa0hu4pyjztnrw7vpppmvrqun5r64 by npub127u…5r64
<?xml version='1.0' encoding='windows-1252'?>
<!--
Copyright (C) 2017 Christopher R. Field.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
The "cargo wix" subcommand provides a variety of predefined variables available
for customization of this template. The values for each variable are set at
installer creation time. The following variables are available:
TargetTriple = The rustc target triple name.
TargetEnv = The rustc target environment. This is typically either
"msvc" or "gnu" depending on the toolchain downloaded and
installed.
TargetVendor = The rustc target vendor. This is typically "pc", but Rust
does support other vendors, like "uwp".
CargoTargetBinDir = The complete path to the directory containing the
binaries (exes) to include. The default would be
"target\release\". If an explicit rustc target triple is
used, i.e. cross-compiling, then the default path would
be "target\<CARGO_TARGET>\<CARGO_PROFILE>",
where "<CARGO_TARGET>" is replaced with the "CargoTarget"
variable value and "<CARGO_PROFILE>" is replaced with the
value from the "CargoProfile" variable. This can also
be overridden manually with the "target-bin-dir" flag.
CargoTargetDir = The path to the directory for the build artifacts, i.e.
"target".
CargoProfile = The cargo profile used to build the binaries
(usually "debug" or "release").
Version = The version for the installer. The default is the
"Major.Minor.Fix" semantic versioning number of the Rust
package.
-->
<!--
Please do not remove these pre-processor If-Else blocks. These are used with
the `cargo wix` subcommand to automatically determine the installation
destination for 32-bit versus 64-bit installers. Removal of these lines will
cause installation errors.
-->
<?if $(sys.BUILDARCH) = x64 or $(sys.BUILDARCH) = arm64 ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?else ?>
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
<?endif ?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<Product
Id='*'
Name='n34-relay'
UpgradeCode='036A2A4F-DA54-4FE2-B2D8-8C58D5814874'
Manufacturer='Awiteb'
Language='1033'
Codepage='1252'
Version='$(var.Version)'>
<Package Id='*'
Keywords='Installer'
Description='A nostr GRASP relay implementation'
Manufacturer='Awiteb'
InstallerVersion='450'
Languages='1033'
Compressed='yes'
InstallScope='perMachine'
SummaryCodepage='1252'
/>
<MajorUpgrade
Schedule='afterInstallInitialize'
DowngradeErrorMessage='A newer version of [ProductName] is already installed. Setup will now exit.'/>
<Media Id='1' Cabinet='media1.cab' EmbedCab='yes' DiskPrompt='CD-ROM #1'/>
<Property Id='DiskPrompt' Value='n34-relay Installation'/>
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='$(var.PlatformProgramFilesFolder)' Name='PFiles'>
<Directory Id='APPLICATIONFOLDER' Name='n34-relay'>
<!--
Enabling the license sidecar file in the installer is a four step process:
1. Uncomment the `Component` tag and its contents.
2. Change the value for the `Source` attribute in the `File` tag to a path
to the file that should be included as the license sidecar file. The path
can, and probably should be, relative to this file.
3. Change the value for the `Name` attribute in the `File` tag to the
desired name for the file when it is installed alongside the `bin` folder
in the installation directory. This can be omitted if the desired name is
the same as the file name.
4. Uncomment the `ComponentRef` tag with the Id attribute value of "License"
further down in this file.
-->
<!--
<Component Id='License' Guid='*'>
<File Id='LicenseFile' Name='ChangeMe' DiskId='1' Source='C:\Path\To\File' KeyPath='yes'/>
</Component>
-->
<Directory Id='Bin' Name='bin'>
<Component Id='Path' Guid='97D3207D-71DB-4DD0-B548-E43E8C664B7D' KeyPath='yes'>
<Environment
Id='PATH'
Name='PATH'
Value='[Bin]'
Permanent='no'
Part='last'
Action='set'
System='yes'/>
</Component>
<Component Id='binary0' Guid='*'>
<File
Id='exe0'
Name='n34_relay.exe'
DiskId='1'
Source='$(var.CargoTargetBinDir)\n34_relay.exe'
KeyPath='yes'/>
</Component>
</Directory>
</Directory>
</Directory>
</Directory>
<Feature
Id='Binaries'
Title='Application'
Description='Installs all binaries and the license.'
Level='1'
ConfigurableDirectory='APPLICATIONFOLDER'
AllowAdvertise='no'
Display='expand'
Absent='disallow'>
<!--
Uncomment the following `ComponentRef` tag to add the license
sidecar file to the installer.
-->
<!--<ComponentRef Id='License'/>-->
<ComponentRef Id='binary0'/>
<Feature
Id='Environment'
Title='PATH Environment Variable'
Description='Add the install location of the [ProductName] executable to the PATH system environment variable. This allows the [ProductName] executable to be called from any location.'
Level='1'
Absent='allow'>
<ComponentRef Id='Path'/>
</Feature>
</Feature>
<SetProperty Id='ARPINSTALLLOCATION' Value='[APPLICATIONFOLDER]' After='CostFinalize'/>
<!--
Uncomment the following `Icon` and `Property` tags to change the product icon.
The product icon is the graphic that appears in the Add/Remove
Programs control panel for the application.
-->
<!--<Icon Id='ProductICO' SourceFile='wix\Product.ico'/>-->
<!--<Property Id='ARPPRODUCTICON' Value='ProductICO' />-->
<Property Id='ARPHELPLINK' Value='https://relay.n34.dev/docs.html'/>
<UI>
<UIRef Id='WixUI_FeatureTree'/>
<!--
Enabling the EULA dialog in the installer is a three step process:
1. Comment out or remove the two `Publish` tags that follow the
`WixVariable` tag.
2. Uncomment the `<WixVariable Id='WixUILicenseRtf' Value='Path\to\Eula.rft'>` tag further down
3. Replace the `Value` attribute of the `WixVariable` tag with
the path to a RTF file that will be used as the EULA and
displayed in the license agreement dialog.
-->
<Publish Dialog='WelcomeDlg' Control='Next' Event='NewDialog' Value='CustomizeDlg' Order='99'>1</Publish>
<Publish Dialog='CustomizeDlg' Control='Back' Event='NewDialog' Value='WelcomeDlg' Order='99'>1</Publish>
</UI>
<!--
Enabling the EULA dialog in the installer requires uncommenting
the following `WixUILicenseRTF` tag and changing the `Value`
attribute.
-->
<!-- <WixVariable Id='WixUILicenseRtf' Value='Relative\Path\to\Eula.rtf'/> -->
<!--
Uncomment the next `WixVariable` tag to customize the installer's
Graphical User Interface (GUI) and add a custom banner image across
the top of each screen. See the WiX Toolset documentation for details
about customization.
The banner BMP dimensions are 493 x 58 pixels.
-->
<!--<WixVariable Id='WixUIBannerBmp' Value='wix\Banner.bmp'/>-->
<!--
Uncomment the next `WixVariable` tag to customize the installer's
Graphical User Interface (GUI) and add a custom image to the first
dialog, or screen. See the WiX Toolset documentation for details about
customization.
The dialog BMP dimensions are 493 x 312 pixels.
-->
<!--<WixVariable Id='WixUIDialogBmp' Value='wix\Dialog.bmp'/>-->
</Product>
</Wix>
2026-04-05 04:30:05 UTC npub1u2ut50n00436k3z4nuj6dp3arkd6rgkdw5ferf57ycddqf6qpkqswav5zl by npub1u2u…v5zl
📊 **Bitcoin-Update**
- 💰 Price: $67099
- 📦 Blockheight: 943721
- ⌛ Mempool: 524715 TXs
- 💸 Fees: 1 sats/vByte
2026-04-05 04:30:05 UTC
- reply
npub1m64hnkh6rs47fd9x6wk2zdtmdj4qkazt734d22d94ery9zzhne5qw9uaks by npub1m64…uaks
https://nostr.download/a70de8005df61849051405a4783b5ddac62cc96150eafc9e00d6ef061382156a.jpg
2026-04-05 04:30:03 UTC npub1fccn7ql8fdrp04nu9s4d50ag9qa8wj2ge6t03pedjk57jzgctc2sn5qrc6 by npub1fcc…qrc6
54c99c66cb4238ee02d9042fed4937ef35d7a84515fa3340bdee48cb6a06aa83
Previous Hashes:
6b8584504c9893f192252bf0286d683609ae9415c542ad9c02aa47986aa9806b (block 59984)
387b0b2847d0646586d268baf2f15f49671a2e95e8f1688a175f4f1580ae6f0b (block 59983)
d2d2a806fe6ab074343b0db1dbdcebd842473e73f40922744d1505e3b9779e56 (block 59979)
4da30d2fe6c6e2cf8fa71135770d65da243396836212582c36a6500153677891 (block 59973)
https://image.nostr.build/9abb3f2c729a66ed28f8e1b1947578f29d5cf9b3f2b161b1de9e1a3dd6134abb.png
2026-04-05 04:30:01 UTC npub1wfdmjz8m8t77v3y8xvzeedamu4f0uk3jtfwjnjskmftprx4uwepq5x6e3d by npub1wfd…6e3d
🧾 Estimated fee for 140 vB tx: 140.00 sats (0.09 USD)
📦 Fee rate from node: 0.00001000 BTC/kvB
📏 Converted: 1.00 sats/vB
🧭 Fee classification: Low
💰 BTC price (CoinGecko): 67,146.00 USD
2026-04-05 04:30:00 UTC npub1unu6h9j5p5j22fdpf9pja7u5423wxpeu6frv6ap3dw0wh9gjvuaq4n2xrm by npub1unu…2xrm
✄------------ 13:30 ------------✄
2026-04-05 04:29:59 UTC npub1q6ps7m94jfdastx2tx76sj8sq4nxdhlsgmzns2tr4xt6ydx6grzspm0kxr by npub1q6p…0kxr
Let me follow plebs for sats and repost their notes for breakfast monies now as I uninstall Damus Android and switch to Wisp . Bye fellas #notedeck all the best with the bugs
2026-04-05 04:29:55 UTC
- reply
npub1vlprg9j8u5l92az0zd6yd8ks7tl560v8ssepdkn07nwekdl9rs4saccfwp by npub1vlp…cfwp
for real
2026-04-05 04:29:52 UTC npub1jxjhacd9sh03mjefas8ms4a4jelquh2lfk9hz5sa2jy26gfvgt0s29tgs8 by npub1jxj…tgs8
bDLo5EG034cg/UyDY6OomySAaPhUs2aSVm7U7R0Zj9h6T1poro3xz4Zi2uqPhTmuwBo1ofg10TBVNqqJHjblLK2dlxGjdKZ1W1Kkjsg2VGdTQjABAfSFS7aMxc72L4CCkNie+Tg68Bybe2KTqFUTRwIPhcj+OfIWXqB9rHXz6Q==
2026-04-05 04:29:51 UTC npub17erh82nscmznjmdxzyhh5hm4vx8yg8w8tfjk6q6qdk4yuhgfmk0q4azgxw by npub17er…zgxw
GPT8Hh3ZUJCr9UyDY6Orvu6er7pqPEZO7Q6wj4d0jzAxD+pfDt/HdtlEcgKwOVmX8JazhpSEDwo8Pa653gRujxfetomv7aQNNU23a1i/Du98qrvOFnwdMY09/2q1L3Jl7qFvDeV3zqW84j+3wYmfk1Wz7n0IMfemeGYzwXU=
2026-04-05 04:29:49 UTC
- reply
npub1v7urry828l9wgy8ersruacr89g63wc5lzgc6xxgcwhralts2r4eqmz37jj by npub1v7u…37jj
Advantage gained
2026-04-05 04:29:44 UTC npub1kun5628raxpm7usdkj62z2337hr77f3ryrg9cf0vjpyf4jvk9r9smv3lhe by npub1kun…3lhe
I just eradicated 42 Nostr zombies using #PlebsVsZombies! ⚔️🧟‍♂️🧟‍♂️
My Zombie Score™ was 15%! What's yours?
🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟩🟩🟩
Follow @npub1pvz…sd4h and join the hunt at: 🏹
https://plebsvszombies.cc
2026-04-05 04:29:36 UTC
- reply
npub1kyeml3tma4su8yw5aru48wgxclchp8zr3kguwhakmtmegjw40zws82sfjk by npub1kye…sfjk
Well yeah lol, I plan on getting chickens… don’t really know the differences between breeds… I’m noob to raising chickens… will be trying to build my own coop from whatever I can salvage…
2026-04-05 04:29:34 UTC
- reply
npub1t3gxvxcf9nrcdd2ukhtfzjd39x7uers96u3ce3jnm605vhkkn7gsfp9elk by npub1t3g…9elk
GM🙏
2026-04-05 04:29:33 UTC npub16a0manf68g2f5duykju3gdgfuk4a6hg6p9uptmmgeld8uns6xtcqvu2075 by npub16a0…2075
Been watching this closely.
Inflation 2026: The Oil War Tax Nobody Can Escape
Gas up $1 per gallon in 30 days. Diesel at $5.25. Consumer sentiment at pandemic lows. The oil war inflation tax hits every American — and grocery prices h
Full analysis:
https://theboard.world/articles/inflation-2026-oil-war-tax
https://theboard.world/static/og/inflation-2026-oil-war-tax.png
#TheBoard #oil #energy #markets #finance #war
2026-04-05 04:29:30 UTC npub1e0uqy4ync4jggh7vk8xwn7y7g5n9twng7v0su32dne0jf77pngwqejryee by npub1e0u…ryee
#ライジングゼファーフクオカ
2Qスタート
7 #西川貴之
20 #中谷麻登
30 #テレンスウッドベリー
32 #狩野祐介
34 #パブロアギラール
2026-04-05 04:29:05 UTC npub1r7nqxauum30lka6n3wldcu6vaaekvhhtrnc8xweu096jv354pn0serd3fs by npub1r7n…d3fs
"She's So Mean" is a song by American rock band Matchbox Twenty. It was released on June 12, 2012, as the first single from their fourth studio album North (2012). The song received generally favorable reviews from music critics, who complimented its fun content and catchiness. The song performed moderately well on the charts, peaking inside the top 20 in Austria and New Zealand and the top 40 in Australia, Canada, and the United States. A music video was released for the song on July 30, 2012.
#MatchboxTwenty #ShesSoMean #Music #Songstr #Niche
https://blossom.primal.net/b305d0a89667dc1c301aaa8b790209ebf447afefddc74a15d155cc9b3f784146.jpg
2026-04-05 04:29:00 UTC npub174fp53yayj83rhvu2dw4qkufrf4zdk47tvzgzqywffz3tsuth4uqhxr3h8 by npub174f…r3h8
Hunting for our next meal
https://blossom.primal.net/a6cad907d4011ea4a8412b117cbe40dc01d4ebc0411400eafe921036dfb741fc.mov
2026-04-05 04:28:53 UTC npub138npwm6gqleqezkdhc46pj34eu5a6mr423w4ya8xrujcnept3ppqsvp5vp by npub138n…p5vp
Bookmark this. You will want to come back to it.
Will AI Replace Software Engineers by 2030? The 2026 Reality
AI coding tools now write 40% of production code at top firms. Which engineering roles survive, which don't, and what the job market data actually shows for
https://theboard.world/articles/will-ai-replace-software-engineers-2026-reality-check
https://theboard.world/static/og/will-ai-replace-software-engineers-2026-reality-check.png
#TheBoard #AI #tech #markets #finance
2026-04-05 04:28:53 UTC npub1ypstyyyt970aqkk8lkfqtpjy74xu7ekfxfr728kgkmer4tqnxj0suyzj0p by npub1yps…zj0p
gnostr-org 1881/943722 #992939040
2026-04-05 04:28:48 UTC
- reply
npub15nn0xkmww974ehr6wrhg723hypu0znqd2nyj3g5h5zugpulag9uqy7e0xy by npub15nn…e0xy
Virou um produto para as grandes corporações
2026-04-05 04:28:33 UTC
- reply
npub1x5tpj06sw9d57ykhh0cr699d63vc805pjvcvrcged7530a3l492sdy55am by npub1x5t…55am
hey -- we want to send you a test zap, but couldn’t find a NIP-05 or ⚡ lightning address on your profile. u can set one up for free on rizful https://rizful.com ... then pls reply here and we will do a test zap.
2026-04-05 04:28:32 UTC npub1ypstyyyt970aqkk8lkfqtpjy74xu7ekfxfr728kgkmer4tqnxj0suyzj0p by npub1yps…zj0p
gnostr-org 1881/943722 #992939040
2026-04-05 04:28:31 UTC npub1guld5x700sea80gqrt5f8gqnec0clae752f5h4lejg3uqzc28hpsv3zfrk by npub1gul…zfrk
Default
2026-04-05 04:28:31 UTC
- reply
npub1v7urry828l9wgy8ersruacr89g63wc5lzgc6xxgcwhralts2r4eqmz37jj by npub1v7u…37jj
Slow and steady wins the race
2026-04-05 04:28:27 UTC npub1ypstyyyt970aqkk8lkfqtpjy74xu7ekfxfr728kgkmer4tqnxj0suyzj0p by npub1yps…zj0p
gnostr-org 1881/943722 #992939040
2026-04-05 04:28:21 UTC
- reply
npub174hgatcj0ls9vd7a0r56443tlg0gc99qmjx49l06d8nmn8hhycksmhv4a6 by npub174h…v4a6
"Wow, Iran finally found its spine—maybe they’ll think twice before backing terror now that Trump’s calling their bluff."
"Anti-war crowd crying again? Funny how they never protested when terrorists were killing Americans."
2026-04-05 04:28:06 UTC npub1jjeq6xpne952w5y526w8mrrm8zlufmk8uea6qdlfveha3e6t9wgq53rnr4 by npub1jje…rnr4
This deserves more attention.
The Neurological War: How Precision Strikes Rewrote the...
Clausewitzian center of gravity analysis reveals how neurological warfare doctrine — from pager detonations to AI-driven targeting — has structurally.
https://theboard.world/articles/the-neurological-war-how-precision-strikes-rewrote-the-rules-against-iran
https://theboard.world/static/og/the-neurological-war-how-precision-strikes-rewrote-the-rules-against-iran.png
#TheBoard #AI #tech #war
2026-04-05 04:28:00 UTC
- reply
npub1g7ec7nfhyyus6kmtaaud4clnuwygandlrpz0hvem3pep6dndtjyqumtp42 by npub1g7e…tp42
https://www.youtube.com/watch?v=g42EG7LD1UY
2026-04-05 04:27:51 UTC npub1cgd35mxmy37vhkfcmjckk9dylguz6q8l67cj6h9m45tj5rx569cql9kfex by npub1cgd…kfex
Happy easter revolutionaries!
2026-04-05 04:27:44 UTC npub1q6ps7m94jfdastx2tx76sj8sq4nxdhlsgmzns2tr4xt6ydx6grzspm0kxr by npub1q6p…0kxr
My confidence is not a performance , it's the objective proof of my dedication to my craft and connection to the source .
2026-04-05 04:27:39 UTC npub1e0uqy4ync4jggh7vk8xwn7y7g5n9twng7v0su32dne0jf77pngwqejryee by npub1e0u…ryee
りそなグループ B.LEAGU 2025-26 SEASON
第29節 GAME2
第1Q終了
鹿児島 16 - 17 #ライジングゼファーフクオカ
西原商会アリーナ
#RsunZ
#BeRiZer #福岡一丸
#福岡
2026-04-05 04:27:19 UTC npub1kc6crlknw8nkcrnhe222s694duv3cwcxysxqypdlr6gf35kve3ysnf0vwv by npub1kc6…0vwv
‍Bitcoin Sentiment Hits 5-Week Low Amid Regulatory Uncertainty
Blockchain analytics platform Santiment reports that Bitcoin's bearish sentiment is at its highest since late February. The ratio of bullish to bearish mentions dropped to 0.81 on April 4, 2026, indicating a lack of optimism. Analysts suggest that high levels of FUD can be a contrarian indicator for a price recovery.
Bitcoin currently trades around $67,100, down 5.53% for the month. The Crypto Fear & Greed Index is at 12 ("Extreme Fear"), and large traders sustained significant losses in Q1 2026. Regulatory uncertainty, particularly regarding the US CLARITY Act, is a key factor contributing to market hesitation.
https://cryptovka.com/news/bitcoin-bearish-sentiment-hits-5-week-high-amid-regulatory-uncertainty
2026-04-05 04:27:15 UTC
- reply
npub1v7urry828l9wgy8ersruacr89g63wc5lzgc6xxgcwhralts2r4eqmz37jj by npub1v7u…37jj
Perfect weather
2026-04-05 04:27:11 UTC npub1xnewsxw69t74nlxxsehe4earw47s9t5cqnlh8amy7nevwetuf6ass5efrf by npub1xne…efrf
Iran says Iraqi ships can pass Strait of Hormuz as transits tick up
https://www.aljazeera.com/economy/2026/4/5/iran-says-iraqi-ships-can-pass-strait-of-hormuz-as-transits-tick-up
Source: [Al Jazeera](https://t.me/aljazeeraglobal/131893)
2026-04-05 04:27:06 UTC npub178takzd7kyxec2drcnjczxhvkpx2yry0dvraaj7ydf3xv0m4wqpspgnjhp by npub178t…njhp
タイヤも夏タイヤに交換した🚙 https://image.nostr.build/bcafe07db54ec8fcbb4ec6f8a2c47f7a8f4e096e872295a5a644cd0da1267498.jpg
2026-04-05 04:27:06 UTC npub1c3dsl3egln2v0avq7xa428pecqyags7nl8p09pzgz5dm4pr6w7rq3lnqvs by npub1c3d…nqvs
DEVELOPING: Ransomware Attacks 2026: Inside the $40 Billion
Healthcare ransomware attacks increased 78% in 2025. Change Healthcare breach cost $22 billion. How ransomware gangs operate, who they target, and why hospitals can't defend themselves.
Full breakdown just published:
https://theboard.world/articles/ransomware-attacks-2026-40-billion-industry-hospitals
https://theboard.world/static/og/ransomware-attacks-2026-40-billion-industry-hospitals.png
#TheBoard #cybersecurity
2026-04-05 04:27:00 UTC npub1kp5lth3hmcmvkc5eqydg939v83rwf29c6sn5th7wmqzqf0lgcj8s7u0erj by npub1kp5…0erj
Dobré ráno, je právě 06:27 a zrovna jsem vyšlo! ☀️
Den potrvá 13 hodin 12 minut a zapadnu v 19:37.
Užívejte den a štosujte saty! 💛 #vychodslunce #cesko
2026-04-05 04:27:00 UTC npub174fp53yayj83rhvu2dw4qkufrf4zdk47tvzgzqywffz3tsuth4uqhxr3h8 by npub174f…r3h8
https://blossom.primal.net/eac8919d998c863008b9c9178041673c2e8d4257b4b27e825ad26b19edbe0709.jpg
2026-04-05 04:26:55 UTC npub1vlprg9j8u5l92az0zd6yd8ks7tl560v8ssepdkn07nwekdl9rs4saccfwp by npub1vlp…cfwp
Proverbs 26:4
“Answer not a fool according to his folly, lest thou also be like unto him.”
https://image.nostr.build/d5d59ac6538afbed4e9b14cca210546f5d27d63eec96764f3598a9bedb2e9c5a.jpg
from @npub1amh…wlqt
2026-04-05 04:26:46 UTC npub1targ0yle577hpqnumt2u2em78eve07jn6zfq42kyuvp2cr2garnseahjvn by npub1tar…hjvn
Dr. Grip のペンあるんだ
https://estore.wacom.jp/ja-JP/products/accessories/cp202a02a.html
2026-04-05 04:26:37 UTC npub1rtenxusw67r2aecnnghrkm5u9vk60rjl7d38l622aaljsgsq363qjcpu7e by npub1rte…pu7e
Different lens, same conflict:
Ellen Barkin slams Trump for his illegal war on Iran: Planes shot down, servicemembers fallen, captured or missing and this prick has not said one word or even acknowledged the human cost of his illeg
https://t.me/PressTV/183835
Reported by Telegram: Press TV. Critical thinking means reading all sources.
2026-04-05 04:26:34 UTC npub1xnewsxw69t74nlxxsehe4earw47s9t5cqnlh8amy7nevwetuf6ass5efrf by npub1xne…efrf
US satellite firm Planet Labs announces blackout on war on Iran images
https://www.aljazeera.com/news/2026/4/5/us-satellite-firm-planet-labs-announces-blackout-on-war-on-iran-images
Source: [Al Jazeera](https://t.me/aljazeeraglobal/131892)
2026-04-05 04:26:23 UTC npub1nshq4pcyzdmnewg4h8yu6tsuh5t72whzkz5x4wj7t0c0cy7yyrfqq2cgnl by npub1nsh…cgnl
fuckit. too many problems to deal with in this house as it is. just going to leave the wine fridge as it is.
the main issue i am facing in this house is landscaping. it is nightmarish. this is an older house by Orlando standards ( about 20 years old ) and because of that it sits on a fairly large lot and there is SO MUCH grass and shrubs to deal with ...
while i was away a lightning hit a tree on my lot. i already paid $2,000 to remove the tree, now i have to pay another $1,000 to re-grade the spot where the tree used to be and plant it over with St. Augustine grass sod ...
i am burning the the candle from both ends here - i am both tapped out financially paying landscapers and also physically doing a ton of work myself ...
like it will probably take me about 50 hours to rake up all the leaves ...
the HOA fee pays for Fiber internet but does NOT pay for landscaping !
WTF ???
#nevent1q…6dk4
2026-04-05 04:26:20 UTC npub1zf4x9lapp4qwdzgpcvtc90kuvtec38jd7mvl5l969qj6yfx2qszstfq5zv by npub1zf4…q5zv
{"type": "payload", "payload": "a268f65480512985e045a2df5a24d64e3f43cd88e8101982f1e5c32a1ae44a8fb5fff7a4e6d12544474ba311097484e4fdc845e132ea18555924739d87eac46933cf273118278c7caa4ba6246dcfd9feb48bf96855b04d7f1a814629d3ee237c8e2bc34b71b4cd9169eb575834ec3e607d4ed66a576d82801d1441b02f861db01f1beda27dffb5129bb06956301ac7f011a3f0fcdfd6fae1e5255a18e3e47a4dd57cba7653a3215588c720d5b9d70ecaeb58a83a75d94af5ac2722158d485ecdb58197131e3de2f05cf039ce839a74fcdbc11787be7dfbf279047a72a0951919e4941f54732f6e5621eb25244031377bb732dc57441a8f73ccac8b4ad0f12a725e44d33edb5c31dece338f1cd8e9b182daa04ce68cac5f246cac001beca46fefc5ac318e75722f9ef9c645a47f4b7da3f66b059fa58d6901b34a2fa04398e6fa2c5d84bef5de426245fad55d0b38e057a723794948c0868e78559563703a3d476901302d69399265139b3d7d2d76b53ed60321174475b76230a23eed60e5f155173f80f2b995fad6ea4aada22c305d570cf7c2cf80be43240953f24414baa26f0a444313f4a0", "aes_key": "dbaad5d67bdcb7abd06fd614e54f1c4fe71697e876dd1796de34dd15413ae309", "chacha_key": "e0628b82141c09665aad25f39a305fef11932026c087159fc5d168caa3c9336a", "key_version": 44, "language": "python", "payload_id": "4ef8bedcee72", "name": "putty-python", "timestamp": 1775363180}
2026-04-05 04:26:07 UTC
- reply
npub1c4vv0nrfh0drcfchs2mndw4uvjkd9k393v20x4kme2txev9hhz0qw4cqk7 by npub1c4v…cqk7
🤖 Tracking strings detected and removed!
🔗 Clean URL(s):
https://www.techtudo.com.br/listas/2026/04/os-15-melhores-jogos-baseados-em-animes-segundo-o-metacritic-edjogos.ghtml
https://www.techtudo.com.br/listas/2026/04/os-15-melhores-jogos-baseados-em-animes-segundo-o-metacritic-edjogos.ghtml
❌ Removed parts:
?utm_source=flipboard&utm_medium=activitypub
?utm_source=flipboard&utm_medium=activitypub
2026-04-05 04:26:07 UTC
- reply
npub1249fv72fl7r9tkgzjt0qftk6jjvlupsslxsfcnnzjq6mjvu93x0su667sq by npub1249…67sq
"Finally, someone’s standing up to these thugs—Trump’s hitting back hard and they can’t handle it. Weak critics can cry all they want, but this is how you deal with bullies."
2026-04-05 04:26:05 UTC npub1ap0dw55xedm5w4mkcyq8m7xyluwfc680lywrvfe50vr9ckl5m3uqtf5l75 by npub1ap0…5l75
**Astronomy Picture of the Day**
05 April 2026
**Hello World**
https://apod.nasa.gov/apod/image/2604/art002e000192_1050.jpg
Image Credit: NASA, Reid Wiseman, Artemis II
Explanation:
From pole to pole
our fair planet is captured in this snapshot from space,
an evocative image from a window of the Orion spacecraft Integrity.
From
the
spacecraft's perspective
the Sun is moving behind Earth's bright limb along the lower right.
Africa and the Iberian peninsula are in view on the
pale blue planet's surface, while aurorae crown Earth's
south and
north
poles at top right and bottom left.
Commander Reid Wiseman took the
historic picture on Artemis II
mission flight day 2
(April 2), after the completion of the
planned translunar injection burn.
That burn boosted the spacecraft
out of Earth orbit, sending
Integrity and crew on a trajectory that will take them
around the Moon and back again.
That's a journey
humans last made over
50 years ago.
(Editor's note: Venus is photobombing Wiseman's historic pic. Currently
appearing in our western skies after sunset, the inner planet is
in the frame below and right of Earth's bright limb,
immersed in a faint band of zodiacal light.)
#APOD #OrionSpacecraft #ArtemisII #SpaceExploration #MoonMission #Astronomy
https://apod.nasa.gov/apod/ap260404.html
2026-04-05 04:29:47 UTC npub1p7fvff92kcfl7pgl9fhfehnap5f3l2jhdggllct44wptgu2u2qdsgm7e8y by npub1p7f…7e8y
{"type":"zone_presence","zone":"4j4nftj_m-xg6CUHFtbv","devicePk":"0f92c4a4aab613ff051f2a6e9cde7d0d131faa576a11ffe175ab82b4715c501b","swarm":"70.162.9.155:26319","role":"gateway","relays":["ws://10.0.30.44:7447"],"hostPlatform":"unknown","serviceVersion":"0.1.3","releaseChannel":"dev","releaseTrack":"local","releaseBranch":"feat/gateway-managed-webrtc-31","metrics":{"clients":1,"cpuPct":1.2,"memPct":9.7,"memUsedMb":979256,"memTotalMb":10077696,"loadPct":9.7,"ts":1775363377000},"ts":1775363387000,"ttl":120}
2026-04-05 04:29:47 UTC npub1p7fvff92kcfl7pgl9fhfehnap5f3l2jhdggllct44wptgu2u2qdsgm7e8y by npub1p7f…7e8y
{"type":"zone_presence","zone":"7gS9HiiyJAlzX6DpcYoq","devicePk":"0f92c4a4aab613ff051f2a6e9cde7d0d131faa576a11ffe175ab82b4715c501b","swarm":"70.162.9.155:26319","role":"gateway","relays":["ws://10.0.30.44:7447"],"hostPlatform":"unknown","serviceVersion":"0.1.3","releaseChannel":"dev","releaseTrack":"local","releaseBranch":"feat/gateway-managed-webrtc-31","metrics":{"clients":1,"cpuPct":1.2,"memPct":9.7,"memUsedMb":978992,"memTotalMb":10077696,"loadPct":9.7,"ts":1775363387000},"ts":1775363387000,"ttl":120}
2026-04-05 04:30:08 UTC npub1f3w4x7dqvceeez8kuyq78md3lwhwfm0ra634llr0r3nykwjrs0hqvldhgk by npub1f3w…dhgk
本読み終わったんで返さなきゃ
2026-04-05 04:29:17 UTC npub1p7fvff92kcfl7pgl9fhfehnap5f3l2jhdggllct44wptgu2u2qdsgm7e8y by npub1p7f…7e8y
{"type":"zone_presence","zone":"7gS9HiiyJAlzX6DpcYoq","devicePk":"0f92c4a4aab613ff051f2a6e9cde7d0d131faa576a11ffe175ab82b4715c501b","swarm":"70.162.9.155:26319","role":"gateway","relays":["ws://10.0.30.44:7447"],"hostPlatform":"unknown","serviceVersion":"0.1.3","releaseChannel":"dev","releaseTrack":"local","releaseBranch":"feat/gateway-managed-webrtc-31","metrics":{"clients":1,"cpuPct":1.2,"memPct":9.7,"memUsedMb":979064,"memTotalMb":10077696,"loadPct":9.7,"ts":1775363357000},"ts":1775363357000,"ttl":120}
2026-04-05 04:29:17 UTC npub1p7fvff92kcfl7pgl9fhfehnap5f3l2jhdggllct44wptgu2u2qdsgm7e8y by npub1p7f…7e8y
{"type":"zone_presence","zone":"4j4nftj_m-xg6CUHFtbv","devicePk":"0f92c4a4aab613ff051f2a6e9cde7d0d131faa576a11ffe175ab82b4715c501b","swarm":"70.162.9.155:26319","role":"gateway","relays":["ws://10.0.30.44:7447"],"hostPlatform":"unknown","serviceVersion":"0.1.3","releaseChannel":"dev","releaseTrack":"local","releaseBranch":"feat/gateway-managed-webrtc-31","metrics":{"clients":1,"cpuPct":1.2,"memPct":9.7,"memUsedMb":979064,"memTotalMb":10077696,"loadPct":9.7,"ts":1775363357000},"ts":1775363357000,"ttl":120}
2026-04-05 04:29:06 UTC npub1f2qkha3ycuyegvt0rl4sh2vatzx7fp9v68gw33mungp6jkz6q5dssmm9wl by npub1f2q…m9wl
{"proxies": [], "updated": 1775363346}
Open in
Open in Your default app native
Open in Nostur ios
Open in Yakihonne android
Open in Yakihonne ios
Open in Jumble web
Open in YakiHonne web
Open in chachi web
Open in Nosotros web
Open in Lumilumi web
Open in Coracle web
Open in relay.tools web
Open in Nostter web
Open in Your default web app web
the source code for this service is free and open
this website is part of nostr.net