monlovesmango / astral

Nostr client made with Quasar
https://astral.ninja
MIT License
100 stars 38 forks source link

invalid signature on selfhosted docker container #75

Closed cercatrova21 closed 1 year ago

cercatrova21 commented 1 year ago

I did the installation on my Docker host (Debian 5.10.149-2) using the instructions.

docker build -t astral . and docker run -d -p 8080:8000 --name astral astral

Astral runs fine so far, the page loads and I can log in using nos2x plugin and see the notes. However, when I now want to make a post, the error message appears: could not publish post: Error: signature provided by custom signing function is invalid.

I have been able to reproduce the error in several browsers. When I open the version at https://astral.ninja, posting works without error. I have also run the installation several times, always with the same result.

Do any of you have any idea what the error could be here?

monlovesmango commented 1 year ago

hey there! I just posted from my localhost without issue so not sure whats going wrong. have you tried logging out your user and then logging back in? just to be sure its signing for the right key

cercatrova21 commented 1 year ago

Yes. Even tried with another private key, same result.

bavarianledger commented 1 year ago

I can confirm the same error message as @cercatrova21. Tried logging out and in as well.

monlovesmango commented 1 year ago

can you confirm you are using http://localhost:8080/ and not the local ip address? someone on nostr reported this fixed the issue for them.

DireMunchkin commented 1 year ago

@monlovesmango I was also affected by this issue - I tried connecting to localhost and it does work if you do that! I wanted to put Astral on hy home server and connect to it over the web though, so a fix would be appreciated.

cercatrova21 commented 1 year ago

Yes, with local installed version and accessing over localhost, it works. I have also the setup with a homeserver which has multiple docker containers running 24/7 and my goal is, to setup astral there. So also from me, a fix would be very appreciated

monlovesmango commented 1 year ago

ah ok. can you guys try the command below? I use this to run astral in docker on my prod machine (also debian) and its been working without issue.

docker run -d --restart=always -p <local host ip>:<local port>:8000 --name astral astral

and then proxy your home server location to the http://localhost:<local port>. heres what my nginx config looks like (replace 8XXX with your <local port>:

server {
    listen 443 ssl;
    server_name astral.ninja;
    server_tokens off;
    location / {
      limit_except GET {
         deny all;
      }
      proxy_pass 'http://localhost:8XXX';
      proxy_buffering off;
      proxy_set_header X-Real-IP $remote_addr;
      add_header 'Cross-Origin-Opener-Policy' 'same-origin' always;
      add_header 'Cross-Origin-Embedder-Policy' 'require-corp' always;
    }
}

not sure what kind of setup you guys use so this might be a pain. will try to release next version with refactored signing function to see if that resolves the issue.

monlovesmango commented 1 year ago

hey guys I just pushed a new version that has refactored signing. can you see whether you still get the same issue?

DireMunchkin commented 1 year ago

Now I can't build the docker image:

docker build --no-cache --pull -t astral .
Sending build context to Docker daemon  370.5MB
Step 1/10 : FROM node:16.16.0-alpine3.16 as build
16.16.0-alpine3.16: Pulling from library/node
Digest: sha256:1c8769a8c9ed57817ef07162744a3722421333a438185c560aa42a9a1fc6ea23
Status: Image is up to date for node:16.16.0-alpine3.16
 ---> b1ca7421d2e7
Step 2/10 : COPY package.json /app/build/package.json
 ---> 0b7965836ab8
Step 3/10 : COPY yarn.lock /app/build/yarn.lock
 ---> c995e11c7fc9
Step 4/10 : WORKDIR /app/build
 ---> Running in 3bb661cf5bff
Removing intermediate container 3bb661cf5bff
 ---> 23d23aa369ef
Step 5/10 : RUN apk --no-cache --virtual build-dependencies add   python3   make   g++   && yarn   && apk del build-dependencies
 ---> Running in 3d895e720293
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz
(1/25) Upgrading musl (1.2.3-r0 -> 1.2.3-r2)
(2/25) Installing libbz2 (1.0.8-r1)
(3/25) Installing expat (2.5.0-r0)
(4/25) Installing libffi (3.4.2-r1)
(5/25) Installing gdbm (1.23-r0)
(6/25) Installing xz-libs (5.2.5-r1)
(7/25) Installing mpdecimal (2.5.1-r1)
(8/25) Installing ncurses-terminfo-base (6.3_p20220521-r0)
(9/25) Installing ncurses-libs (6.3_p20220521-r0)
(10/25) Installing readline (8.1.2-r0)
(11/25) Installing sqlite-libs (3.38.5-r0)
(12/25) Installing python3 (3.10.9-r0)
(13/25) Installing make (4.3-r0)
(14/25) Installing binutils (2.38-r3)
(15/25) Installing libgomp (11.2.1_git20220219-r2)
(16/25) Installing libatomic (11.2.1_git20220219-r2)
(17/25) Installing gmp (6.2.1-r2)
(18/25) Installing isl22 (0.22-r0)
(19/25) Installing mpfr4 (4.1.0-r0)
(20/25) Installing mpc1 (1.2.1-r0)
(21/25) Installing gcc (11.2.1_git20220219-r2)
(22/25) Installing musl-dev (1.2.3-r2)
(23/25) Installing libc-dev (0.7.2-r3)
(24/25) Installing g++ (11.2.1_git20220219-r2)
(25/25) Installing build-dependencies (20221227.180348)
Executing busybox-1.35.0-r17.trigger
OK: 229 MiB in 40 packages
yarn install v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
error Couldn't find the binary git
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
The command '/bin/sh -c apk --no-cache --virtual build-dependencies add   python3   make   g++   && yarn   && apk del build-dependencies' returned a non-zero code: 1

I tried to add git and openssh into the Dockerfile but now it's complaining about a SSL error instead:

Sending build context to Docker daemon  370.5MB
Step 1/10 : FROM node:16.16.0-alpine3.16 as build
16.16.0-alpine3.16: Pulling from library/node
Digest: sha256:1c8769a8c9ed57817ef07162744a3722421333a438185c560aa42a9a1fc6ea23
Status: Image is up to date for node:16.16.0-alpine3.16
 ---> b1ca7421d2e7
Step 2/10 : COPY package.json /app/build/package.json
 ---> 6b2ae931c3dd
Step 3/10 : COPY yarn.lock /app/build/yarn.lock
 ---> a7e9dc6c3829
Step 4/10 : WORKDIR /app/build
 ---> Running in 9ae28b330993
Removing intermediate container 9ae28b330993
 ---> 90ad0d2bb37a
Step 5/10 : RUN apk --no-cache --virtual build-dependencies add   python3   make   g++   git   openssh   && yarn   && apk del build-dependencies
 ---> Running in 85a4091cef51
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz
(1/39) Upgrading musl (1.2.3-r0 -> 1.2.3-r2)
(2/39) Installing libbz2 (1.0.8-r1)
(3/39) Installing expat (2.5.0-r0)
(4/39) Installing libffi (3.4.2-r1)
(5/39) Installing gdbm (1.23-r0)
(6/39) Installing xz-libs (5.2.5-r1)
(7/39) Installing mpdecimal (2.5.1-r1)
(8/39) Installing ncurses-terminfo-base (6.3_p20220521-r0)
(9/39) Installing ncurses-libs (6.3_p20220521-r0)
(10/39) Installing readline (8.1.2-r0)
(11/39) Installing sqlite-libs (3.38.5-r0)
(12/39) Installing python3 (3.10.9-r0)
(13/39) Installing make (4.3-r0)
(14/39) Installing binutils (2.38-r3)
(15/39) Installing libgomp (11.2.1_git20220219-r2)
(16/39) Installing libatomic (11.2.1_git20220219-r2)
(17/39) Installing gmp (6.2.1-r2)
(18/39) Installing isl22 (0.22-r0)
(19/39) Installing mpfr4 (4.1.0-r0)
(20/39) Installing mpc1 (1.2.1-r0)
(21/39) Installing gcc (11.2.1_git20220219-r2)
(22/39) Installing musl-dev (1.2.3-r2)
(23/39) Installing libc-dev (0.7.2-r3)
(24/39) Installing g++ (11.2.1_git20220219-r2)
(25/39) Installing ca-certificates (20220614-r0)
(26/39) Installing brotli-libs (1.0.9-r6)
(27/39) Installing nghttp2-libs (1.47.0-r0)
(28/39) Installing libcurl (7.83.1-r5)
(29/39) Installing pcre2 (10.40-r0)
(30/39) Installing git (2.36.3-r0)
(31/39) Installing openssh-keygen (9.0_p1-r2)
(32/39) Installing libedit (20210910.3.1-r0)
(33/39) Installing openssh-client-common (9.0_p1-r2)
(34/39) Installing openssh-client-default (9.0_p1-r2)
(35/39) Installing openssh-sftp-server (9.0_p1-r2)
(36/39) Installing openssh-server-common (9.0_p1-r2)
(37/39) Installing openssh-server (9.0_p1-r2)
(38/39) Installing openssh (9.0_p1-r2)
(39/39) Installing build-dependencies (20221227.181210)
Executing busybox-1.35.0-r17.trigger
Executing ca-certificates-20220614-r0.trigger
OK: 248 MiB in 54 packages
yarn install v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
error Command failed.
Exit code: 128
Command: git
Arguments: ls-remote --tags --heads ssh://git@github.com/monlovesmango/nostr-tools.git
Directory: /app/build
Output:
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
The command '/bin/sh -c apk --no-cache --virtual build-dependencies add   python3   make   g++   git   openssh   && yarn   && apk del build-dependencies' returned a non-zero code: 128
monlovesmango commented 1 year ago

please do not pull the image from docker, it is not maintained. you need to build from source. I am not overly familiar with docker and can only vouch for and help with the instructions laid out in the readme.

if you are trying to build on a remote server you can use (replace the 'remote' context with the name of your remote server context): docker --context remote build -t astral .

cercatrova21 commented 1 year ago

Also got some errors while building the docker image. Unable to create anymore.

docker build -t astral .
Sending build context to Docker daemon  5.127MB
Step 1/10 : FROM node:16.16.0-alpine3.16 as build
16.16.0-alpine3.16: Pulling from library/node
213ec9aee27d: Already exists 
015fad1872e1: Pull complete 
c93f3de25c33: Pull complete 
bc5d1f30ff35: Pull complete 
Digest: sha256:1c8769a8c9ed57817ef07162744a3722421333a438185c560aa42a9a1fc6ea23
Status: Downloaded newer image for node:16.16.0-alpine3.16
 ---> b1ca7421d2e7
Step 2/10 : COPY package.json /app/build/package.json
 ---> 1b8ccd20081f
Step 3/10 : COPY yarn.lock /app/build/yarn.lock
 ---> f7931198e106
Step 4/10 : WORKDIR /app/build
 ---> Running in 04387316a4e5
Removing intermediate container 04387316a4e5
 ---> 8523509b98b9
Step 5/10 : RUN apk --no-cache --virtual build-dependencies add   python3   make   g++   && yarn   && apk del build-dependencies
 ---> Running in 8adb76f1de16
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz
(1/25) Upgrading musl (1.2.3-r0 -> 1.2.3-r2)
(2/25) Installing libbz2 (1.0.8-r1)
(3/25) Installing expat (2.5.0-r0)
(4/25) Installing libffi (3.4.2-r1)
(5/25) Installing gdbm (1.23-r0)
(6/25) Installing xz-libs (5.2.5-r1)
(7/25) Installing mpdecimal (2.5.1-r1)
(8/25) Installing ncurses-terminfo-base (6.3_p20220521-r0)
(9/25) Installing ncurses-libs (6.3_p20220521-r0)
(10/25) Installing readline (8.1.2-r0)
(11/25) Installing sqlite-libs (3.38.5-r0)
(12/25) Installing python3 (3.10.9-r0)
(13/25) Installing make (4.3-r0)
(14/25) Installing binutils (2.38-r3)
(15/25) Installing libgomp (11.2.1_git20220219-r2)
(16/25) Installing libatomic (11.2.1_git20220219-r2)
(17/25) Installing gmp (6.2.1-r2)
(18/25) Installing isl22 (0.22-r0)
(19/25) Installing mpfr4 (4.1.0-r0)
(20/25) Installing mpc1 (1.2.1-r0)
(21/25) Installing gcc (11.2.1_git20220219-r2)
(22/25) Installing musl-dev (1.2.3-r2)
(23/25) Installing libc-dev (0.7.2-r3)
(24/25) Installing g++ (11.2.1_git20220219-r2)
(25/25) Installing build-dependencies (20221228.003456)
Executing busybox-1.35.0-r17.trigger
OK: 229 MiB in 40 packages
yarn install v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[4/5] Linking dependencies...
warning "emoji-mart-vue-fast > vue-virtual-scroller@1.0.10" has incorrect peer dependency "vue@^2.6.11".
warning "emoji-mart-vue-fast > vue-virtual-scroller > vue-resize@0.4.5" has incorrect peer dependency "vue@^2.3.0".
warning " > @babel/eslint-parser@7.18.9" has unmet peer dependency "@babel/core@>=7.11.0".
warning " > eslint-webpack-plugin@3.2.0" has unmet peer dependency "webpack@^5.0.0".
warning " > workbox-webpack-plugin@6.5.4" has unmet peer dependency "webpack@^4.4.0 || ^5.9.0".
[5/5] Building fresh packages...
Done in 23.22s.
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.16/main: No such file or directory
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.16/community: No such file or directory
(1/24) Purging build-dependencies (20221228.003456)
(2/24) Purging python3 (3.10.9-r0)
(3/24) Purging make (4.3-r0)
(4/24) Purging g++ (11.2.1_git20220219-r2)
(5/24) Purging gcc (11.2.1_git20220219-r2)
(6/24) Purging binutils (2.38-r3)
(7/24) Purging libatomic (11.2.1_git20220219-r2)
(8/24) Purging libgomp (11.2.1_git20220219-r2)
(9/24) Purging libc-dev (0.7.2-r3)
(10/24) Purging musl-dev (1.2.3-r2)
(11/24) Purging libbz2 (1.0.8-r1)
(12/24) Purging expat (2.5.0-r0)
(13/24) Purging libffi (3.4.2-r1)
(14/24) Purging gdbm (1.23-r0)
(15/24) Purging xz-libs (5.2.5-r1)
(16/24) Purging mpdecimal (2.5.1-r1)
(17/24) Purging readline (8.1.2-r0)
(18/24) Purging ncurses-libs (6.3_p20220521-r0)
(19/24) Purging ncurses-terminfo-base (6.3_p20220521-r0)
(20/24) Purging sqlite-libs (3.38.5-r0)
(21/24) Purging mpc1 (1.2.1-r0)
(22/24) Purging mpfr4 (4.1.0-r0)
(23/24) Purging isl22 (0.22-r0)
(24/24) Purging gmp (6.2.1-r2)
Executing busybox-1.35.0-r17.trigger
OK: 8 MiB in 16 packages
Removing intermediate container 8adb76f1de16
 ---> be196c3848da
Step 6/10 : COPY . /app/build
 ---> 070d1e40cfe4
Step 7/10 : RUN npx quasar build -m pwa
 ---> Running in c3d3c49e183f

 .d88888b.
d88P" "Y88b
888     888
888     888 888  888  8888b.  .d8888b   8888b.  888d888
888     888 888  888     "88b 88K          "88b 888P"
888 Y8b 888 888  888 .d888888 "Y8888b. .d888888 888
Y88b.Y8b88P Y88b 888 888  888      X88 888  888 888
 "Y888888"   "Y88888 "Y888888  88888P' "Y888888 888
       Y8b

 Build mode................ pwa
 Pkg quasar................ v2.9.2
 Pkg @quasar/app-webpack... v3.5.9
 Pkg webpack............... v5
 Debugging................. no
 Publishing................ no

 Configured browser support (>= 88.88% of global marketshare):
 · Chrome for Android >= 104
 · Firefox for Android >= 101
 · Android >= 104
 · Chrome >= 96
 · Edge >= 102
 · Firefox >= 95
 · iOS >= 13.2
 · Opera >= 86
 · Safari >= 14.1

 App • [GenerateSW] Will generate a service-worker file. Ignoring your custom written one.
 App • Chaining "UI" Webpack config
 App • Extending "UI" Webpack config
 App • Cleaned build artifact: "/app/build/dist/pwa"
 App •  WAIT  • Compiling of "UI" in progress...
 App •  DONE  • "UI" compiled with errors • 22602ms

 App •  ERROR  •  UI  in ./src/router/routes.js

Module not found: Can't resolve imported dependency "pages/DevTools.vue"
Did you forget to install it? You can run: yarn add pages/DevTools.vue

 App •  COMPILATION FAILED  • Please check the log above for details.

npm notice 
npm notice New major version of npm available! 8.11.0 -> 9.2.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.2.0>
npm notice Run npm install -g npm@9.2.0 to update!
npm notice 
The command '/bin/sh -c npx quasar build -m pwa' returned a non-zero code: 1
monlovesmango commented 1 year ago

ok this error is because I renamed devTools.vue to DevTools.vue but git didn't pick it up. just pushed another commit that explicitly renames the file to DevTools.vue. can you try again with this latest version?

cercatrova21 commented 1 year ago

it works! Really appreciated your work :-)

monlovesmango commented 1 year ago

thank you for finding that bug! would have never found it locally. we good to close this?