JabRef / JabRefOnline

https://www.jabref.org
MIT License
32 stars 10 forks source link

Multi port support #379

Closed starsareintherose closed 3 years ago

starsareintherose commented 3 years ago

If my port 3000 is occupied, how can I run this program?

mohit038-zz commented 3 years ago

You can define PORT as an environment variable in the .env file.

starsareintherose commented 3 years ago

such as PORT=3360 ?

starsareintherose commented 3 years ago

my .env is here

[root@archlinux JabRefOnline]# cat .env
DATABASE_URL="postgresql://root:passwd@localhost:5432/jabref?schema=public"
PORT=3380

but it shows

[root@archlinux JabRefOnline]# yarn dev
yarn run v1.22.11
$ nuxt

 WARN  css-loader@3.6.0 is installed but >=4.2.0 is expected                                   23:34:30

ℹ Merging Tailwind config from ~/tailwind.config.js                           nuxt:tailwindcss 23:34:31

   ╭───────────────────────────────────────────────────────╮
   │                                                       │
   │   Nuxt @ v2.15.8                                      │
   │                                                       │
   │   ▸ Environment: development                          │
   │   ▸ Rendering:   client-side                          │
   │   ▸ Target:      server                               │
   │                                                       │
   │   Listening: http://localhost:3380/                   │
   │                                                       │
   │   Tailwind Viewer: http://localhost:3380/_tailwind/   │
   │                                                       │
   ╰───────────────────────────────────────────────────────╯

ℹ Preparing project for development                                                            23:34:33
ℹ Initial build may take a while                                                               23:34:33
node:events:371
      throw er; // Unhandled 'error' event
      ^

Error: connect ECONNREFUSED 127.0.0.1:6380
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1146:16)
Emitted 'error' event on RedisClient instance at:
    at RedisClient.on_error (/root/JabRefOnline/node_modules/redis/index.js:342:14)
    at Socket.<anonymous> (/root/JabRefOnline/node_modules/redis/index.js:223:14)
    at Socket.emit (node:events:394:28)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6380
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Siedlerchr commented 3 years ago

You need to start redis as well

starsareintherose commented 3 years ago

I have used systemctl to start and enable redis, but it still shows that

[root@archlinux JabRefOnline]# yarn dev
yarn run v1.22.11
$ nuxt

 WARN  css-loader@3.6.0 is installed but >=4.2.0 is expected                                   01:34:57

ℹ Merging Tailwind config from ~/tailwind.config.js                           nuxt:tailwindcss 01:34:58

   ╭───────────────────────────────────────────────────────╮
   │                                                       │
   │   Nuxt @ v2.15.8                                      │
   │                                                       │
   │   ▸ Environment: development                          │
   │   ▸ Rendering:   client-side                          │
   │   ▸ Target:      server                               │
   │                                                       │
   │   Listening: http://localhost:3380/                   │
   │                                                       │
   │   Tailwind Viewer: http://localhost:3380/_tailwind/   │
   │                                                       │
   ╰───────────────────────────────────────────────────────╯

ℹ Preparing project for development                                                            01:35:00
ℹ Initial build may take a while                                                               01:35:00
node:events:371
      throw er; // Unhandled 'error' event
      ^

Error: connect ECONNREFUSED 127.0.0.1:6380
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1146:16)
Emitted 'error' event on RedisClient instance at:
    at RedisClient.on_error (/root/JabRefOnline/node_modules/redis/index.js:342:14)
    at Socket.<anonymous> (/root/JabRefOnline/node_modules/redis/index.js:223:14)
    at Socket.emit (node:events:394:28)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6380
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[root@archlinux JabRefOnline]# systemctl status redis
● redis.service - Advanced key-value store
     Loaded: loaded (/usr/lib/systemd/system/redis.service; enabled; vendor preset: disabled)
     Active: active (running) since Thu 2021-08-19 01:34:35 CST; 32s ago
Siedlerchr commented 3 years ago

in the package json I see that it uses a docker container to start redis on port 6300 https://github.com/JabRef/JabRefOnline/blob/08fd8d5e2ee3c7968f48d41568c6af6f6ecbe993/package.json#L26

starsareintherose commented 3 years ago

That's so sad, I must need to install docker

starsareintherose commented 3 years ago

Things seem okay, but the web shows ERR_CONNECTION_REFUSED

[root@archlinux JabRefOnline]# yarn dev
yarn run v1.22.11
$ nuxt

 WARN  css-loader@3.6.0 is installed but >=4.2.0 is expected                                   01:50:44

ℹ Merging Tailwind config from ~/tailwind.config.js                           nuxt:tailwindcss 01:50:44

   ╭───────────────────────────────────────────────────────╮
   │                                                       │
   │   Nuxt @ v2.15.8                                      │
   │                                                       │
   │   ▸ Environment: development                          │
   │   ▸ Rendering:   client-side                          │
   │   ▸ Target:      server                               │
   │                                                       │
   │   Listening: http://localhost:3380/                   │
   │                                                       │
   │   Tailwind Viewer: http://localhost:3380/_tailwind/   │
   │                                                       │
   ╰───────────────────────────────────────────────────────╯

ℹ Preparing project for development                                                            01:50:47
ℹ Initial build may take a while                                                               01:50:47
ℹ Discovered Components: .nuxt/components/readme.md                                            01:50:47
✔ Builder initialized                                                                          01:50:47
✔ Nuxt files generated                                                                         01:50:47

✔ Client
  Compiled successfully in 55.36s

ℹ Waiting for file changes                                                                     01:51:45
ℹ Memory usage: 500 MB (RSS: 733 MB)                                                           01:51:45
ℹ Listening on: http://localhost:3380/                                                         01:51:45
No issues found.                                                                               01:51:45
Siedlerchr commented 3 years ago

Did you init the postgres database? That was my problem as well. Run yarn prisma:migrate:dev to initialize the database. You may also want to use yarn prisma:seed to fill the database with some initial test data.

Then run and log in using the Test-User provided in the readme: http://localhost:/user/login

starsareintherose commented 3 years ago

I follow the readme, actually.

yarn install
yarn prisma:migrate:dev
yarn dev
Siedlerchr commented 3 years ago

run yarn prisma:seed to fill the database

starsareintherose commented 3 years ago

same error exsit, but a little strange, I can curl it on VPS via localhost, but fail on my PC of the domain via IP or Domain.

[root@archlinux ~]# curl http://localhost:3380/
<!doctype html>
<html >
  <head >
    <title>jabref-online</title><meta data-n-head="1" charset="utf-8"><meta data-n-head="1" name="viewport" content="width=device-width, initial-scale=1"><meta data-n-head="1" data-hid="description" name="description" content="## Servers - Production server: https://jabref.azurewebsites.net This server runs the last released version with data provided by the production database. - Staging server: https://jabref-staging.azurewebsites.net This server usually runs the latest version of the main branch with data provided by the production database. Usually, you do not want to target this server. Its main purpose is to test the main branch before a release. - Test server: https://jabref-dev.azurewebsites.net This server runs the latest version of the main branch with test data that is usually reset on redeployment. The main use of this server is for developers to test the latest version against their application without the fear to delete user data. In particular, you can log in using `alice@jabref.de / EBNPXY35TYkYXHs`."><link data-n-head="1" rel="icon" type="image/x-icon" href="/favicon.ico"><link rel="preload" href="/_nuxt/runtime.js" as="script"><link rel="preload" href="/_nuxt/commons/app.js" as="script"><link rel="preload" href="/_nuxt/vendors/app.js" as="script"><link rel="preload" href="/_nuxt/app.js" as="script">
  </head>
  <body >
    <div id="__nuxt"><style>#nuxt-loading {  background: white;  visibility: hidden;  opacity: 0;  position: absolute;  left: 0;  right: 0;  top: 0;  bottom: 0;  display: flex;  justify-content: center;  align-items: center;  flex-direction: column;  animation: nuxtLoadingIn 10s ease;  -webkit-animation: nuxtLoadingIn 10s ease;  animation-fill-mode: forwards;  overflow: hidden;}@keyframes nuxtLoadingIn {  0% {visibility: hidden;opacity: 0;  }  20% {visibility: visible;opacity: 0;  }  100% {visibility: visible;opacity: 1;  }}@-webkit-keyframes nuxtLoadingIn {  0% {visibility: hidden;opacity: 0;  }  20% {visibility: visible;opacity: 0;  }  100% {visibility: visible;opacity: 1;  }}#nuxt-loading>div,#nuxt-loading>div:after {  border-radius: 50%;  width: 5rem;  height: 5rem;}#nuxt-loading>div {  font-size: 10px;  position: relative;  text-indent: -9999em;  border: .5rem solid #F5F5F5;  border-left: .5rem solid black;  -webkit-transform: translateZ(0);  -ms-transform: translateZ(0);  transform: translateZ(0);  -webkit-animation: nuxtLoading 1.1s infinite linear;  animation: nuxtLoading 1.1s infinite linear;}#nuxt-loading.error>div {  border-left: .5rem solid #ff4500;  animation-duration: 5s;}@-webkit-keyframes nuxtLoading {  0% {-webkit-transform: rotate(0deg);transform: rotate(0deg);  }  100% {-webkit-transform: rotate(360deg);transform: rotate(360deg);  }}@keyframes nuxtLoading {  0% {-webkit-transform: rotate(0deg);transform: rotate(0deg);  }  100% {-webkit-transform: rotate(360deg);transform: rotate(360deg);  }}</style><script>window.addEventListener('error', function () {  var e = document.getElementById('nuxt-loading');  if (e) {e.className += ' error';  }});</script><div id="nuxt-loading" aria-live="polite" role="status"><div>Loading...</div></div><!-- https://projects.lukehaas.me/css-loaders --></div><script>window.__NUXT__={config:{_app:{basePath:"\u002F",assetsPath:"\u002F_nuxt\u002F",cdnURL:null}}}</script>
  <script src="/_nuxt/runtime.js"></script><script src="/_nuxt/commons/app.js"></script><script src="/_nuxt/vendors/app.js"></script><script src="/_nuxt/app.js"></script></body>
</html>
[root@archlinux ~]# curl http://malacology.net:3380
curl: (7) Failed to connect to malacology.net port 3380 after 71 ms: Connection refused

and my PC shows

░▒▓ ~ ▓▒░ curl http://DOMAIN:3380
Unable to round-trip http request to upstream: dial tcp IP:3380: connect: connection refused
tobiasdiez commented 3 years ago

I don't really understand your last comment. It seems that the development server runs successfully on localhost. Not sure why you would expect it to run on your domain. Did you try to run jabref online on your server as well?