Thanks to visit codestin.com
Credit goes to github.com

Skip to content

nostr-net/njump

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

njump

njump is a HTTP Nostr static gateway that allows you to browse profiles, notes and relays; it is an easy way to preview a resource and then open it with your preferred client. The typical use of njump is to share a resource outside the Nostr world, where the Nostr: schema is not (yet) working.

njump has some special features to effectively share notes on platforms that offer links preview, like Twitter and Telegram.

njump currently lives under njump.me, you can reach it appending a Nostr NIP-19 entity (npub, nevent, nprofile, naddr, etc.) or a NIP-05 address after the domain, e.g. njump.me/nevent1xxxxxx...xxx or njump.me/[email protected]

For more information about njump's philosophy and its use, read the presentation on the homepage.

Supported Kinds

kind description NIP
0 Metadata 1
1 Short Text Note 1
6 Repost 18
11 Thread 7D
1111 Comment 22
1063 File Metadata 94
1311 Live Chat Message 53
30023 Long-form Content 23
30024 Draft Long-form Content 23
30311 Live Event 53
30818 Wiki article 54
31922 Date-Based Calendar Event 52
31923 Time-Based Calendar Event 52

Running

Running locally

The easiest way to start is to run the development server with just (if you have it installed) or with TAILWIND_DEBUG=true go run .. You can also check the contents of justfile to see other useful scripts.

For live-reload you can use air and start it with air -c .air.toml -- this will run it without the local cache, which can be annoying if you're not specifically debugging the part of the code that loads content, so you may want to run it with air -c .air.toml --build.cmd 'go build -o ./tmp/main .'. These run modes will recompile the Tailwind bundle on every restart and they assume you have the tailwind CLI installed globally.

Running from a precompiled binary

You can grab one from the releases, unpack and run it.

Docker

To build and run in a Docker container:

docker build -t njump .
docker run -e DOMAIN=njump.mydomain.com -p 2999:2999 njump

Environment variables

These are the defaults that you can change by setting environment variables in your system before running:

PORT="2999"
DOMAIN="njump.me"
DISK_CACHE_PATH="/tmp/njump-internal"
EVENT_STORE_PATH="/tmp/njump-db"
TAILWIND_DEBUG=
RELAY_CONFIG_PATH=
TRUSTED_PUBKEYS=npub1...,npub1...

RELAY_CONFIG_PATH is path to json file to update relay configuration. You can set relay list like below:

{
  "everything": [
    "wss://relay.nostr.band",
    "wss://nostr.lol"
  ]
}

See relay-config.json.sample for example.

For example, when running from a precompiled binary you can do something like PORT=5000 ./njump.

Translations

Translation files are in locales/ and managed with go-i18n. A helper script is provided at scripts/update_translations.sh.

Updating locale files

  1. Install the command line tool:
go install github.com/nicksnyder/go-i18n/v2/goi18n@latest
  1. Extract and merge strings:
./scripts/update_translations.sh

Contributing translations

European language translations are welcome! To contribute:

  1. Copy locales/en.json to locales/<lang>.json (e.g. fr.json, de.json).
  2. Replace the English text with your translation.
  3. Run the script above to update catalogs.
  4. Commit the new file and open a pull request.

Localization

Translation files are stored in the locales directory. To add support for another language, copy en.json to <lang>.json (or .toml) and replace each English string with its translation. The middleware automatically selects the language from the lang query parameter or the Accept-Language header.

When a translation is missing for the selected language, njump falls back to the English text.

About

mirror of https://git.njump.me/njump

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 60.5%
  • templ 36.1%
  • JavaScript 1.4%
  • Just 0.6%
  • Dockerfile 0.6%
  • CSS 0.6%
  • Shell 0.2%