Skip to content
This repository was archived by the owner on Mar 8, 2025. It is now read-only.

Commit

Permalink
Generate market square channel ID on install.
Browse files Browse the repository at this point in the history
  • Loading branch information
ibz committed Mar 12, 2024
1 parent 6aca7a2 commit 00034f0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ if [ ! -f plebeian-market-secrets/mail.json ]; then
echo "{\"server\": \"smtp\", \"username\": \"\", \"password\": \"\", \"default_sender\": \"hello@$DOMAIN_NAME\"}" > plebeian-market-secrets/mail.json
fi

cd && mkdir -p plebeian-market-state/media
cd && mkdir -p plebeian-market-state/media && mkdir -p plebeian-market-state/front-office-config

if [ ! -f plebeian-market-state/front-office-config/config.json ]; then
MARKET_SQUARE_CHANNEL_ID=`openssl rand -hex 32`
echo "{\"admin_pubkeys\": [\"TODO\"], \"homepage_banner_image\": \"\", \"backend_present\": true, \"market_square_channel_id\": \"$MARKET_SQUARE_CHANNEL_ID\" }" > plebeian-market-state/front-office-config/config.json
fi

if [ ! -f .env ]; then
cat << EOF > .env
Expand Down Expand Up @@ -132,6 +137,9 @@ server {
location /media {
alias /media/;
}
location /front-office-config {
alias /front-office-config/;
}
location / {
add_header Access-Control-Allow-Origin *;
root /front-office-app;
Expand Down Expand Up @@ -281,6 +289,7 @@ services:
- "./plebeian-market-nginx:/etc/nginx/conf.d"
- "./plebeian-market-certificates:/cert"
- "./plebeian-market-state/media:/media"
- "./plebeian-market-state/front-office-config:/front-office-config"
- "front-office-app:/front-office-app"
networks:
Expand Down
1 change: 1 addition & 0 deletions web/shared/src/lib/nostr/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {NostrPrivateKey, NostrPublicKey, NostrLoginMethod, stalls, token, Error}
import {getApiBaseUrl, isStaging, getConfigurationFromFile} from "$sharedLib/utils";
import {sendPrivateMessage} from "$sharedLib/services/nostr";
import { v4 as uuidv4 } from "uuid";
import { isDevelopment } from "$sharedLib/utils.js";

export async function getMarketSquareChannelId() {
let configJson = await getConfigurationFromFile();
Expand Down

0 comments on commit 00034f0

Please sign in to comment.