kartevonmorgen / kartevonmorgen.ts

Mapping-Frontend to find and add sustainable Organisations (Initiatives, Companies) and Events on Kartevonmorgen.org / MapofTomorrow.org
https://kartevonmorgen.org/
GNU General Public License v3.0
11 stars 12 forks source link

Server for the new Frontend #2

Closed wellemut closed 2 years ago

wellemut commented 3 years ago

Markus Could you grant Access for @navid_kalaei to our server via SSH with rights to install dependencies, (Yarn) be able to execute applications (pn2), Continous integration and continous deplyment? Please for two domains https://test.kartevonmorgen.org/ (internal testing) https://beta.kartevonmorgen.org/ (testing with clients)

wellemut commented 3 years ago

Navid Kalaei, [10.03.21 22:34] oh no, we don't need to setup a new server completely from zero, it's just a node app that can be run beside other applications

Markus Kohlhase, [10.03.21 22:41] @navid_kalaei can you create a Nix Package for your service? Then it should be easy to integrate

Markus Kohlhase, [10.03.21 22:41] https://github.com/svanderburg/node2nix

Markus Kohlhase, [10.03.21 22:42] here you probably can find some upstream examples: https://github.com/NixOS/nixpkgs

Navid Kalaei, [10.03.21 22:49] How it's differentiated from containers?

Navid Kalaei, [10.03.21 22:52] And how I can test that??? Couldn't we setup a GitHub Action to make life easier?

wellemut commented 3 years ago
wellemut commented 3 years ago

@navid-kalaei If you know NixOS you could build a Package and send it to @flosse . If you feel comftable with, you can also manage the whole NixOS Server by yourself.

But If you prefer a different system, let me know what system we can buy for you. Only limitation: All Servers must be in Germany. So what would be the german alternative to https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&filter=next.js&utm_campaign=create-next-app-readme?

wellemut commented 3 years ago

I will by this server: https://www.netcup.eu/bestellen/produkt.php?produkt=2005 @flosse please provide me with our netcup credentials

@dmitrap do you have your own server in the meantime? It would be no problem for us, if you use this server too

dmitrap commented 3 years ago

that's pretty cool, maybe we'll migrate after 3 month that i still paid for our own server! :)

пт, 3 сент. 2021 г. в 21:17, Helmut Wolman @.***>:

I will by this server: https://www.netcup.eu/bestellen/produkt.php?produkt=2005 @flosse https://github.com/flosse please provide me with our netcup credentials

@dmitrap https://github.com/dmitrap do you have your own server in the meantime? It would be no problem for us, if you use this server too

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kartevonmorgen/kartevonmorgen.ts/issues/2#issuecomment-912656925, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEWNU2HG74RAT7Z24CQDPCDUADYK5ANCNFSM4YYDNQWQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

wellemut commented 3 years ago

Which one do we need:

wellemut commented 3 years ago

@navid-kalaei Please check if this hosting packets is also working for your frontend: https://www.netcup.eu/hosting/ Markus says, you have much less to maintain if you use this. Just for one Frontend you do not have to provide a whole Server-OS.

wellemut commented 3 years ago

Due to our clients needs, to fulfill the IT-Securitiy of the Germany Agency for Security in IT (https://www.bsi.bund.de/DE/Themen/Unternehmen-und-Organisationen/Standards-und-Zertifizierung/IT-Grundschutz/it-grundschutz_node.html) we are not allowed to use netcup.eu but we have to move to https://www.hetzner.com/de/webhosting!

Hetzner is also Green hostet. Netcup seems do be cheaper. Do we need SSH`? grafik

Hetzner offers SSH only for 9,9€/month (https://www.hetzner.com/webhosting/matrix-mobile) grafik

wellemut commented 3 years ago

@navid-kalaei Alternativly to the Webhosting for 9,90€/Month we can use a Root Server (Cloud) for 4,15 € https://www.hetzner.com/de/cloud @flosse would install NixOS there, but if you @navid-kalaei have a different suggestions, please share it. Maybe you also know, how we could use a server without SSH access? Then we could use a Level 1 Webhosting for 1,90 €https://www.hetzner.com/de/webhosting and we would not have to maintain the server.

navid-kalaei commented 2 years ago

thank you very much @wellemut for your research. there are some points that needs to get cleared.

  1. NixOS is not related to the front-end. Any OS including Ubuntu which is more available from the hosting websites is capable of running Node.js and as the consequence Next.js
  2. I suggest to purchase a server with a more popular OS rather than NixOS since it's a very uncommon operating system and it's benefits are not sensible. not only me but also future developers will face problems with their deployment. as the result the deployment procedure will be deligated to SlowTec automatically which will comes with inter-organization calls and delays
  3. SSH is compulsory since with our requirements exporting static HTMLs is not possible. (references are provided below)
  4. As the time I am writing this comment, no sensitive data will be stored on the front-end server
  5. The term defending the security has many meanings. most of the standard data centers protect the servers and backup their data regularly, could you please explain more about the security flaws you are concerned with so we can have a more precise discussion and find solutions if necessary?
  6. I can setup the server for the front-end on a normal operating system if you want

logs when trying to export static HTML files:

warn  - rewrites, redirects, and headers are not applied when exporting your application, detected (redirects). See more info here: https://nextjs.org/docs/messages/export-no-custom-routes
info  - Copying "static build" directory
info  - No "exportPathMap" found in "/home/max/WebstormProjects/kartevonmorgenssr/next.config.js". Generating map from "./pages"
Error: i18n support is not compatible with next export. See here for more info on deploying: https://nextjs.org/docs/deployment
    at /home/max/WebstormProjects/kartevonmorgenssr/node_modules/next/dist/export/index.js:247:19
    at async Span.traceAsyncFn (kartevonmorgenssr/node_modules/next/dist/trace/trace.js:74:20)
wellemut commented 2 years ago

@alex0107 Offers to do our hosting of backend and frontend on a Server he has ordered from Hetzner.

@navid-kalaei Could you please make sure, that all Server-Dependencies are correctly and fully described here: https://github.com/kartevonmorgen/kartevonmorgen.ts#test-platform (Including OS, Node.js ...)

@flosse Can you please describe all Server-Requirements here https://github.com/kartevonmorgen/openfairdb/#build

Alex will provide Debian on his server and will give you test access. Do you think this could work?

alex0107 commented 2 years ago

@navid-kalaei is it possible to start the new frontend with node.js instead of pm2 or can we create and use a Docker-Image?

navid-kalaei commented 2 years ago

@alex0107 Offers to do our hosting of backend and frontend on a Server he has ordered from Hetzner.

@navid-kalaei Could you please make sure, that all Server-Dependencies are correctly and fully described here: https://github.com/kartevonmorgen/kartevonmorgen.ts#test-platform (Including OS, Node.js ...)

@flosse Can you please describe all Server-Requirements here https://github.com/kartevonmorgen/openfairdb/#build

Alex will provide Debian on his server and will give you test access. Do you think this could work?

the described requirements are the configuration for the current server and is performing very well for the testing purposes. for the production my estimation is it's also enough for production. at some point we may need to upgrade the computation power but in my eyes we are far from that time

navid-kalaei commented 2 years ago

@navid-kalaei is it possible to start the new frontend with node.js instead of pm2 or can we create and use a Docker-Image?

pm2 is just a process manager that watches for lifetime of the process, for example when the process stops unexpectedly or runs out of memory pm2 restarts the process. so the answer is yes. we can run the project with node, however we should somehow be able to monitor the lifetime and the runtime and collect its logs.

Docker is very recommended however I have some questions:

alex0107 commented 2 years ago
  • the build script halts at its last stage with the message of server-side renders at runtime (uses getInitialProps or getServerSideProps). my guess is it's related to SWC as it's happening since I've updated Next version from 10 to 12. how we can terminate the build script when it reaches the end of the procedure?

I've tested with the linux command timeout but that doesn't work as expected...and I think that isn't a really good bugfix ;)

  • who will be responsible to manage the docker file and containers?

Maybe I? If there will be a new release, I can quickly upgrade the container or maybe we can use continuous deployment?

navid-kalaei commented 2 years ago

TL;DR: next-translate detects page props wrong. vinissimus/next-translate#486 Solution: downgrade to next-translate 1.0.1

Experience documentation:

Hypothesises

we use next-translate for the localization.

  1. the halting problem is related to the yarn's caching policy? to test that I have cleared the dependancies and cleared the cache but didn't work. here are the commands I run:
    rm -rf node_modules
    yarn cache clean
    yarn install
    yarn build:dev
  2. on the build time, some warning pops out. is the halting related to the conflicts between dependencies or legacy modules? my answer is no because of two reasons. I always try to have dependencies updated and the message logs are warning not error, warnings are very usual and won't break projects. on the other hand, before migrating to Next 12 we did not break dependencies.

my latest hypothesis was related to upgrading Next from 10 to 12. which happened to be wrong because Next 12 benefits from SWC instead of Babel and it was a major change

Solution

downgraded next-translate from 1.0.6 to 1.0.1.

How I tracked that down

disabled all pages and components until nothing left but next.config.js and then I started to disable plugins one after another

alex0107 commented 2 years ago

After testing I found out the source-code is only compatible with Debian buster and Node 16 (Node 17 and / or bullseye not working)

navid-kalaei commented 2 years ago

@alex0107 there's a possibility of duplication at issue #70 . where are you going to discuss further? should we consider the build process closed and continue the server management here?

alex0107 commented 2 years ago

@navid-kalaei sorry, I opened the issue before you have answered in this issue. Let's continue here.

wellemut commented 2 years ago

Three Problems

  1. Process of compiling did not complete, because of the package "next translate"
  2. The Linux-Distribution of Alex was not working. Now, with Debian it is working
  3. The Node Version 17 is not working, only 16 LTS (LongTermService Release)
wellemut commented 2 years ago

@alex0107 did you already manage to deploy the frontend somewhere?

navid-kalaei commented 2 years ago

Three Problems

  1. Process of compiling did not complete, because of the package "next translate"
  2. The Linux-Distribution of Alex was not working. Now, with Debian it is working
  3. The Node Version 17 is not working, only 16 LTS (LongTermService Release)

just to mention the problems are already solved

wellemut commented 2 years ago

@alex0107 please send me your server IP, so I can set DNS entry for a test-URL to your server. Most important for now is our new frontend. We can manage the backend later.

wellemut commented 2 years ago
navid-kalaei commented 2 years ago
wellemut commented 2 years ago

The new server now (new.kartevonmorgen.org) runs on Hetzner and is Managed by @alex0107