Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
chmac committed Aug 30, 2024
2 parents bb16c06 + 3fb87df commit 8096cbf
Show file tree
Hide file tree
Showing 23 changed files with 4,766 additions and 2,345 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,16 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
node-version: '20'

- name: Write SHA into file
run: echo "export const BUILD_SHA = \"${GITHUB_SHA}\";" > build.ts

- name: Enable Corepack
run: corepack enable

- name: Prepare Yarn
run: corepack prepare [email protected] --activate

- name: Configure git to use HTTPS instead of SSH
run: git config --global url."https://".insteadOf ssh://
Expand All @@ -32,4 +41,3 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules/
dist/
.parcel-cache/
tmp/
.yarn/install-state.gz
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/hydrogen
lts/iron
5 changes: 5 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
nodeLinker: node-modules

npmScopes:
jsr:
npmRegistryServer: "https://npm.jsr.io"
19 changes: 16 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
FROM node:20
##
# NOTE
# This docker file doesn't work, somehow node_modules is not created by `yarn install`
# We're not using this, so leaving it alone for now

FROM node:22

WORKDIR /app

COPY src package.json yarn.lock ./
COPY src /app/src/
COPY public /app/public/
COPY package.json yarn.lock ./

# bugfix, stop npm from using ssh even when https is specified
RUN git config --global url."https://".insteadOf ssh://

RUN corepack enable

RUN mkdir node_modules

RUN yarn install

CMD ["npm", "run", "start"]
# RUN yarn build

CMD ["yarn", "start"]

EXPOSE 1234
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,29 @@ Read and leave **nostr notes on a map**.

This is running at [notes.trustroots.org](https://notes.trustroots.org/). And it is part of our effort to [nostrify trustroots](https://github.com/Trustroots/nostroots).


## Getting started

- Install node and yarn
- Install nvm
- `nvm install` - This is only required one time
- `nvm use`

Then run yarn from corepack. If you have yarn installed globally, you either
need to uninstall it, or instead of running `yarn` run `corepack yarn` instead.
That means substitute every `yarn` call below for `corepack yarn`.

- `yarn`
- `yarn start`
- Open http://localhost:1234

It seems that newer node versions [don't work](https://github.com/Trustroots/nostr-map/issues/21) don't work. You may have to run this to use node v18:
- `nvm install`
- `nvm use`

## Ideas

somewhat concrete:

- [filters](https://github.com/Trustroots/nostr-map/issues/13)
- [chat](https://github.com/Trustroots/nostr-map/issues/14)

vague-ish:

- rideshare related tags
- update location with regular interval
- hashtags, e.g. for circles or events, #hg24 for hitchgathering 2024?
1 change: 1 addition & 0 deletions build.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const BUILD_SHA = "dev";
3 changes: 0 additions & 3 deletions do.md

This file was deleted.

20 changes: 15 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
{
"name": "nostr-map",
"version": "0.1.0",
"version": "0.1.1",
"description": "NOSTR notes on maps",
"source": "src/index.html",
"repository": "[email protected]:chmac/nostr-map.git",
"repository": "[email protected]:trustroots/nostr-map.git",
"author": "Simon & Callum",
"license": "AGPL-3.0-or-later",
"private": false,
"scripts": {
"start": "parcel --no-cache src/index.html",
"build": "yarn build:parcel && yarn build:copy-public",
"build:parcel": "parcel build",
"build:parcel": "parcel build --no-scope-hoist",
"build:copy-public": "cp public/* dist/",
"prettier": "prettier --write src/",
"deploy:build": "parcel build --public-url /nostr-map",
Expand All @@ -22,15 +21,26 @@
"@types/dompurify": "^3.0.5",
"@types/leaflet": "^1.9.0",
"gh-pages": "^5.0.0",
"parcel": "^2.8.3",
"parcel": "^2.12.0",
"prettier": "2.8.3"
},
"dependencies": {
"@henrygd/queue": "npm:@jsr/henrygd__queue@^1.0.6",
"@nostrify/nostrify": "npm:@jsr/nostrify__nostrify@^0.30.0",
"dompurify": "^3.1.4",
"leaflet": "^1.9.3",
"leaflet.sidepanel": "https://github.com/maxwell-ilai/Leaflet.SidePanel",
"nostr-tools": "^1.2.1",
"pluscodes": "^2.6.0",
"process": "^0.11.10",
"sweetalert2": "^11.11.0"
},
"packageManager": "[email protected]",
"@parcel/resolver-default": {
"packageExports": true
},
"alias": {
"process": "process/browser.js",
"buffer": "buffer"
}
}
9 changes: 8 additions & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ export const DEFAULT_RELAYS = [
"wss://relay.primal.net",
"wss://relay.damus.io",
"wss://nostr.manasiwibi.com",
"wss://nos.lol",
];
export const DEV_RELAYS = ["wss://nos.lol"];
// Dev vs production relays don't work because relays copy from each other.
export const DEV_RELAYS = DEFAULT_RELAYS;
export const PANEL_CONTAINER_ID = "panelID";
export const BADGE_CONTAINER_ID = "badge";
export const CONTENT_MINIMUM_LENGTH = 3;
Expand All @@ -27,3 +29,8 @@ export const HITCHMAPS_AUTHOR_PUBLIC_KEY =
"53055ee011e96a00a705b38253b9cbc6614ccbd37df4dad42ec69bbe608c4209" as const;

export const TRUSTROOTS_NPUB_PUT_URL = "https://www.trustroots.org/api/users";
export const TRUSTROOTS_NIP5_URL =
"https://www.trustroots.org/.well-known/nostr.json";

export const POST_VALIDATION_TIMEOUT_SECONDS = 5;
export const POST_ACCEPTANCE_TIMEOUT_SECONDS = 5;
7 changes: 6 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ <h3>Where can I get help?</h3>
target="_blank"
rel="noreferrer"
>reddit</a
>
>,
<a
href="https://satellite.earth/n/Trustroots/npub1lt6a968lk4h6yqduqnxcha628cudulgy8xk607c4xyxn6d6w6kcsmgp8hj"
target="_blank"
rel="noreferrer"
>satellite.earth</a> (a reddit-style nostr application)
or simply leave a note here in the Antarctica area.
</p>
<h3>How does this help in Trustroots?</h3>
Expand Down
Loading

0 comments on commit 8096cbf

Please sign in to comment.