Skip to content

Commit

Permalink
Merge pull request #5 from Start9Labs/no-cache
Browse files Browse the repository at this point in the history
no cache dependency
  • Loading branch information
hzrd149 authored Feb 13, 2024
2 parents ed70503 + 88e753c commit a24e830
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 51 deletions.
26 changes: 1 addition & 25 deletions docker_entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,7 @@
#!/bin/sh
set -e

cat /root/start9/config.yaml

CACHE_RELAY_ENABLED=$(yq '.enable-cache-relay' /root/start9/config.yaml)
#CACHE_RELAY=$(yq '.cache-relay' /root/start9/config.yaml)
CACHE_RELAY=nostr.embassy:8080

PROXY_PASS_BLOCK=""
if [ -n "$CACHE_RELAY" ] && [ "$CACHE_RELAY_ENABLED" = "true" ]; then
echo "Cache relay set to $CACHE_RELAY"
sed -i 's/CACHE_RELAY_ENABLED = false/CACHE_RELAY_ENABLED = true/g' /usr/share/nginx/html/index.html
PROXY_PASS_BLOCK="$PROXY_PASS_BLOCK
location /local-relay {
proxy_pass http://$CACHE_RELAY/;
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection "upgrade";
}
"
else
echo "No cache relay set"
fi

echo "Starting noStrudel ..."
printf "\n\n [i] Starting noStrudel ...\n\n"

CONF_FILE="/etc/nginx/conf.d/default.conf"
NGINX_CONF="server {
Expand All @@ -40,8 +18,6 @@ server {
server_name localhost;
merge_slashes off;
$PROXY_PASS_BLOCK
root /usr/share/nginx/html;
index index.html index.htm;
Expand Down
9 changes: 1 addition & 8 deletions manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,7 @@ interfaces:
protocols:
- tcp
- http
dependencies:
nostr:
version: ">0.8.0"
critical: true
requirement:
type: "opt-in"
how: Can use the browser cache or local relay
description: Optionally used to cache events
dependencies: {}
backup:
create:
type: docker
Expand Down
19 changes: 1 addition & 18 deletions scripts/procedures/getConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,4 @@

import { compat, types as T } from "../deps.ts";

export const getConfig: T.ExpectedExports.getConfig = compat.getConfig({
"enable-cache-relay": {
name: "Use local relay for caching",
description:
"If you enable the option, noStrudel will cache Nostr events on your personal Nostr relay, which is fast and makes the cache available to all your logged in clients. If you disable this option, noStrudel will instead cache Nostr events in the browser's storage, which is slower and does not sync across clients.",
type: "boolean",
default: false,
},
"cache-relay": {
name: "Cache Relay",
description: "A local relay to use for caching events",
type: "pointer",
subtype: "package",
"package-id": "nostr",
target: "lan-address",
interface: "websocket",
},
});
export const getConfig: T.ExpectedExports.getConfig = compat.getConfig({});

0 comments on commit a24e830

Please sign in to comment.