Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update/040 #11

Draft
wants to merge 61 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
dab5b82
chore: Update sdk
Blu-J Mar 3, 2023
c39785b
chore: Update to use the latest sdk
Blu-J Mar 6, 2023
a98b90c
progress
MattDHill Mar 27, 2023
1371738
chore: Update the input spec
Blu-J Mar 31, 2023
6dae60a
merge: master
Blu-J Mar 31, 2023
0ea605d
Merge remote-tracking branch 'origin/master' into feat/new-sdk
Blu-J Mar 31, 2023
944ff28
chore: Testing new styles
Blu-J Mar 31, 2023
a5681bb
wip: Show example of something I think would make main better
Blu-J Apr 3, 2023
c8e31c2
create interface
MattDHill Apr 3, 2023
414766b
wip: Paired
Blu-J Apr 3, 2023
485237f
better interfaces
MattDHill Apr 3, 2023
ea89631
clean up config
MattDHill Apr 3, 2023
9fb30ea
wip: Horrible main 3
Blu-J Apr 4, 2023
4c15b0f
wip(chore): Add documentation for the previous wip
Blu-J Apr 4, 2023
52d6147
progress
MattDHill Apr 5, 2023
def3ffc
update sdk and union select value
MattDHill Apr 6, 2023
449d9f4
main almost there
MattDHill Apr 6, 2023
33af48d
chore: implement the sdk updates for the main.
Blu-J Apr 7, 2023
7440a0f
chore: Small update
Blu-J Apr 7, 2023
c3f7830
chore: Utilize the sdk and main
Blu-J Apr 7, 2023
09868ad
Merge branch 'feat/new-sdk' of github.com:Start9Labs/nostr-rs-relay-w…
Blu-J Apr 7, 2023
ef4c1e7
Merge branch 'feat/new-sdk' of github.com:Start9Labs/nostr-rs-relay-w…
Blu-J Apr 7, 2023
046ff83
Merge branch 'feat/new-sdk' of github.com:Start9Labs/nostr-rs-relay-w…
Blu-J Apr 7, 2023
acb73aa
chore: Update the run command to have better strings
Blu-J Apr 10, 2023
1675609
use get tor hostname
MattDHill Apr 11, 2023
eb42702
chore: Update to the new daemons
Blu-J Apr 11, 2023
6eb0099
Merge branch 'feat/new-sdk' of github.com:Start9Labs/nostr-rs-relay-w…
Blu-J Apr 11, 2023
a2c0021
chore: Update the config to the newest types
Blu-J Apr 11, 2023
73ee68f
minor
MattDHill Apr 12, 2023
1fc068e
chore: Add the types for config
Blu-J Apr 12, 2023
8119f58
chore: Update the properties to follow the new patterns
Blu-J Apr 12, 2023
8d3c827
chore: Update to use the new bound types.
Blu-J Apr 13, 2023
06297cf
main.ts
MattDHill Apr 14, 2023
29ecacf
chore: Update the init/uninit
Blu-J Apr 14, 2023
0c28813
chore: Update and fix the write
Blu-J Apr 17, 2023
c081994
chore: Update to the latest style of the configs and the dependencies.
Blu-J Apr 18, 2023
134f20a
chore: update to the newer types
Blu-J Apr 18, 2023
cfd3688
chore: UPdate nostr for latest version
Blu-J Apr 20, 2023
94044fb
refine config spec
MattDHill Apr 21, 2023
ac1a5d5
update for latest SDK changes
MattDHill Apr 25, 2023
bd8b31d
SDK RC1
MattDHill Apr 26, 2023
75275ed
update latest and prettier
MattDHill Apr 27, 2023
ac75ba4
update to RC2
MattDHill Apr 27, 2023
aee3cca
rc3
MattDHill Apr 27, 2023
cf9c7a1
array for runCommand
MattDHill Apr 30, 2023
8319446
minor
MattDHill May 1, 2023
d37f069
update to latest
MattDHill May 3, 2023
37e21b0
reverse proxy
MattDHill May 3, 2023
ff1cb4b
error free
MattDHill May 3, 2023
0dd645c
update to start9labs sdk
MattDHill May 4, 2023
dfcde85
update sdk properties gone
MattDHill May 4, 2023
2926f98
latest sdk
MattDHill May 5, 2023
f5aacaf
add migration
MattDHill May 7, 2023
b872209
rmdir instead
MattDHill May 8, 2023
7eab233
local sdk, dependencies and more
MattDHill May 11, 2023
8c7c995
export dep mounts
MattDHill May 11, 2023
74aeba8
interfaces
MattDHill May 12, 2023
6c8da0e
fix error
MattDHill May 12, 2023
5fa436b
rc4
MattDHill May 17, 2023
d169f1d
rc5 and new vault type
MattDHill May 21, 2023
99a8dd9
rc7 with store exports
MattDHill Jun 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
nostr.s9pk
image.tar
scripts/*.js
*.s9pk
procedures/*.js
node_modules/
.DS_Store
.vscode/
docker-images
18 changes: 12 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,27 @@ else
endif

# for rebuilding just the arm image. will include docker-images/x86_64.tar into the s9pk if it exists
arm: docker-images/aarch64.tar scripts/embassy.js
arm: docker-images/aarch64.tar procedures/embassy.js
embassy-sdk pack

# for rebuilding just the x86 image. will include docker-images/aarch64.tar into the s9pk if it exists
x86: docker-images/x86_64.tar scripts/embassy.js
x86: docker-images/x86_64.tar procedures/embassy.js
embassy-sdk pack

clean:
rm -rf docker-images
rm -f image.tar
rm -f $(PKG_ID).s9pk
rm -f scripts/*.js
rm -f procedures/*.js

scripts/embassy.js: $(TS_FILES)
deno bundle scripts/embassy.ts scripts/embassy.js
procedures/embassy.js: $(TS_FILES)
cd procedures && npm run build

check: $(TS_FILES)
cd procedures && npm run check

fmt: $(TS_FILES)
cd procedures && npm run prettier

docker-images/aarch64.tar: Dockerfile docker_entrypoint.sh
ifeq ($(ARCH),x86_64)
Expand All @@ -50,7 +56,7 @@ else
docker buildx build --tag start9/$(PKG_ID)/main:$(PKG_VERSION) --build-arg ARCH=x86_64 --build-arg PLATFORM=amd64 --platform=linux/amd64 -o type=docker,dest=docker-images/x86_64.tar .
endif

$(PKG_ID).s9pk: manifest.yaml instructions.md icon.png LICENSE scripts/embassy.js docker-images/aarch64.tar docker-images/x86_64.tar
$(PKG_ID).s9pk: manifest.yaml instructions.md icon.png LICENSE procedures/embassy.js docker-images/aarch64.tar docker-images/x86_64.tar
ifeq ($(ARCH),aarch64)
@echo "embassy-sdk: Preparing aarch64 package ..."
else ifeq ($(ARCH),x86_64)
Expand Down
113 changes: 1 addition & 112 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,112 +1 @@
# Wrapper for nostr

This is a nostr relay, written in Rust. It currently supports the entire relay protocol, and persists data with SQLite. This repository creates the `s9pk` package that is installed to run `nostr` on [embassyOS](https://github.com/Start9Labs/embassy-os/). Learn more about service packaging in the [Developer Docs](https://start9.com/latest/developer-docs/).

## Dependencies

Install the system dependencies below to build this project by following the instructions in the provided links. You can also find detailed steps to setup your environment in the service packaging [documentation](https://github.com/Start9Labs/service-pipeline#development-environment).

- [docker](https://docs.docker.com/get-docker)
- [docker-buildx](https://docs.docker.com/buildx/working-with-buildx/)
- [yq](https://mikefarah.gitbook.io/yq)
- [deno](https://deno.land/)
- [make](https://www.gnu.org/software/make/)
- [embassy-sdk](https://github.com/Start9Labs/embassy-os/tree/master/backend)

## Build environment
Prepare your embassyOS build environment. In this example we are using Ubuntu 20.04.
1. Install docker
```
curl -fsSL https://get.docker.com -o- | bash
sudo usermod -aG docker "$USER"
exec sudo su -l $USER
```
2. Set buildx as the default builder
```
docker buildx install
docker buildx create --use
```
3. Enable cross-arch emulated builds in docker
```
docker run --privileged --rm linuxkit/binfmt:v0.8
```
4. Install yq
```
sudo snap install yq
```
5. Install deno
```
sudo snap install deno
```
6. Install essentials build packages
```
sudo apt-get install -y build-essential openssl libssl-dev libc6-dev clang libclang-dev ca-certificates
```
7. Install Rust
```
curl https://sh.rustup.rs -sSf | sh
# Choose nr 1 (default install)
source $HOME/.cargo/env
```
8. Build and install embassy-sdk
```
cd ~/ && git clone --recursive https://github.com/Start9Labs/embassy-os.git
cd embassy-os/backend/
./install-sdk.sh
embassy-sdk init
```
Now you are ready to build the `nostr` package!

## Cloning

Clone the project locally:

```
git clone https://github.com/Start9Labs/nostr-wrapper.git
cd nostr-wrapper
```

## Building

To build the `nostr` package for all platforms using embassy-sdk version >=0.3.3, run the following command:

```
make
```

To build the `nostr` package for a single platform using embassy-sdk version <=0.3.2, run:

```
# for amd64
make ARCH=x86_64
```
or
```
# for arm64
make ARCH=aarch64
```

## Installing (on embassyOS)

Run the following commands to determine successful install:
> :information_source: Change embassy-server-name.local to your Embassy address

```
embassy-cli auth login
# Enter your embassy password
embassy-cli --host https://embassy-server-name.local package install nostr.s9pk
```

If you already have your `embassy-cli` config file setup with a default `host`, you can install simply by running:

```
make install
```

> **Tip:** You can also install the nostr.s9pk using **Sideload Service** under the **System > Manage** section.

### Verify Install

Go to your Embassy Services page, select **Nostr**, configure and start the service. Then, verify its interfaces are accessible.

**Done!**
# Wrapper for Nostr RS Relay
File renamed without changes
2 changes: 1 addition & 1 deletion instructions.md → assets/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ You will not be able to save the config until you follow the instructions below.

### Running a private relay

Private relays act as a personal backup for your posts, follows, messages,
Private relays act as a private backup for your posts, follows, messages,
settings, etc. Without a private relay, there is no guaranteeing these things
will be saved anywhere, and they could disappear at any time.

Expand Down
4 changes: 0 additions & 4 deletions config.json

This file was deleted.

9 changes: 0 additions & 9 deletions docker_entrypoint.sh

This file was deleted.

94 changes: 0 additions & 94 deletions manifest.yaml

This file was deleted.

Loading