Skip to content

Commit

Permalink
Support announcements, initial support for auth, use proto from npm p…
Browse files Browse the repository at this point in the history
…ackage, some refactoring, remove docs server
  • Loading branch information
riccardobl committed Apr 13, 2024
1 parent 61f6ff1 commit 5684be2
Show file tree
Hide file tree
Showing 36 changed files with 541 additions and 3,517 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ trash
node_modules
dist
build
tmp
tmp
certs
18 changes: 9 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ WORKDIR /app
RUN apk add --no-cache bash wget python3 py3-pip&& \
export NO_CONDA="1" && \
npm i && npm run build

+
# Runner
FROM node:alpine
RUN mkdir -p /app
Expand All @@ -18,18 +18,18 @@ RUN \
npm i --production && \
chown 1000:1000 -Rf /app

ENV NOSTR_CONNECT_GRPC_BINDING_ADDRESS="0.0.0.0"
ENV NOSTR_CONNECT_GRPC_BINDING_PORT=5000
ENV NOSTR_CONNECT_GRPC_DESCRIPTOR_PATH="/app/build/docs/descriptor.pb"
ENV NOSTR_CONNECT_DOCS_PATH="/app/build/docs"
ENV NOSTR_CONNECT_DOCS_PORT=5001
ENV NOSTR_CONNECT_DOCS_BINDING_ADDRESS="0.0.0.0"
ENV GRPC_BINDING_ADDRESS="0.0.0.0"
ENV GRPC_BINDING_PORT=5000

ENV GRPC_CA_CRT=""
ENV GRPC_SERVER_CRT=""
ENV GRPC_SERVER_KEY=""

# NOSTR_CONNECT_SECRET_KEY empty = generate random key
ENV NOSTR_CONNECT_SECRET_KEY=""
ENV NOSTR_SECRET_KEY=""
ENV NOSTR_RELAYS=""

EXPOSE 5000
EXPOSE 5001

USER 1000
CMD ["npm","run", "start"]
2 changes: 1 addition & 1 deletion build-docker.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
set -e
docker build -t openagents-grpc .
docker build -t openagents-pool .
33 changes: 0 additions & 33 deletions build-docs.sh

This file was deleted.

19 changes: 0 additions & 19 deletions build-proto.sh

This file was deleted.

19 changes: 19 additions & 0 deletions gen-certs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
set -e
mkdir -p certs
cd certs

function newca {
openssl genrsa -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt -subj "/C=CL/ST=RM/L=Santiago/O=Test/OU=Test/CN=ca"
}

function newcert {
name=$1
openssl genrsa -out $name.key 4096
openssl req -new -key $name.key -out $name.csr -subj "/C=CL/ST=RM/L=Santiago/O=Test/OU=$name/CN=localhost"
openssl x509 -req -days 999 -in $name.csr -CA ca.crt -CAkey ca.key -out $name.crt
openssl rsa -in $name.key -out $name.key
}

$@
Loading

0 comments on commit 5684be2

Please sign in to comment.