• 4 Posts
  • 27 Comments
Joined duela 9 hilabete
cake
Cake day: urt. 08, 2022

help-circle
rss

I guess that depends on how you define success:

  • If I make an instance for writers, and 30 writers use it … success.
  • If I make an instance for my friends, and we use it … success.

Personally - I’d rather have a tight-knit community than a zillion spammers regurgitating low-effort posts (like many reddit subs).

The cool thing about success is - you get to decide what it means.


1 - I’ve completed your suggestions.

You are correct - I had forked the ‘Main’ branch, which runs a different js-client than UI-16.7.

So I merged 16.7 into my fork… and everything WORKS.

Thank you - that was helpful.

[I also set up Drone. Yes, it builds very fast.]

**

2 - Perhaps “LEMMY_DATABASE_URL” shows an obsolete value in the config docs:

  • It is listed as - postgres://lemmy:pw@LEMMY_DB:5432/lemmy
  • And perhaps should be - postgres://lemmy:pw@POSTGRES:5432/lemmy

That 2nd string worked for me anyway - on an ansible install. (the former gives a 404 fetch error).

**

Thank you very much again.

Lemmy is running smooth and looking great.

I hope you are doing alright.


I forked the UI at 15.4, to build some new UI features.

Next I will manually add those features to this clean fork of Lemmy-UI 16.7 (so all code is up-to-date).

If I may ask, do you recognize what this issue might be?

These pages work:

  • Home page loads perfectly (when there are 0 posts)
  • Create a community works
  • visiting a community works (when there are 0 posts)
  • New user registration succeeds

However, I get a loading spinner and Uncaught TypeError: Cannot read properties of undefined (reading “____” ) on the following pages [in console]:

  • Create Post (reading “at”)
  • User Profile (reading “split”)
  • Settings (reading “map”)

And if I do create a post [by using ‘default UI’, and then switching back to ‘forked UI’], then Post-List pages also give that error:

  • Community, Home (reading “split").

So my question is:

Do you see a likely cause from that pattern?

(Perhaps a backend/database connection - an undefined string).

If you have an idea, I would love to know.

ENVIRONMENT:

  • Docker + NGINX logs seem to be clean.

  • I have not modified the ‘UI fork’ code.

  • I have not modified anything on the VPS - only added these Environment Variables in docker-compose.yml (in various combinations):

  environment:
   - LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy:8536
   - LEMMY_UI_LEMMY_EXTERNAL_HOST=ggg.com
   - LEMMY_UI_HTTPS=true
   - LEMMY_UI_DISABLE_CSP=true
   - LEMMY_UI_HOST=0.0.0.0:1234
  • The install was done by ansible.

Thank you for your time and work. Lemmy is awesome.

[I am learning about drone now.]


Thank you for the reply.

If I can eliminate QEMU, I’d love to (it’s slow).

Have you shared your workflow.yml anywhere? (for the lemmy-ui DockerHub image build)

**

This is my current workflow.yml (for Github Actions).

The reason I added QEMU was:

1 - Github Actions was only building the ‘forked-UI’ docker-image for AMD64.

2 - I then added buildx and specified a platform in the workflow:

 - name: Buildx
   uses: docker/setup-buildx-action@v1

 - name: Build and push
   uses: docker/build-push-action@v2
   with:
     context: .
     platforms: linux/arm64/v8

Which failed with:

 Error: buildx failed to solve: process "/dev/.buildkit_qemu_emulator /bin/sh -c 
 yarn install --pure-lockfile" did not complete successfully: exit code: 1

3 - I then added the QEMU step, and the build succeeded.

**

*Lemmy-Translations

I also had to add an “Update lemmy-translations” step:

   - name: Update submodules
     run: git submodule update --init --recursive

otherwise the build would fail with:

   /usr/src/app/generate_translations.js:7
   files.forEach(filename => {
      		       ^
   TypeError: Cannot read properties of undefined (reading 'forEach')
   at /usr/src/app/generate_translations.js:7:9
   at FSReqCallback.oncomplete (node:fs:201:23)

After adding that “Update Submodules” step, the build succeeds.

Is there a better way to do it?

**

I am 100% open to any suggestions/critiques (and if your workflow.yml is public, I will study it and learn).


It’s fixed!

The issue was - the ‘New UI’ docker image was automatically building for AMD64, but the Linux server is an ARM64/v8.

I had to add QEMU and multi-platform build commands to the docker-image.yml file (in Github Actions).

This creates an additional docker image for ARM64 machines, which loads successfully.

This was discovered by manually building a docker container, and receiving the following message: WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

Thank you very much for replying KSYNWA! It helped me target the right area to find the problem.

I’m sure I’ll be back with another question, as I’m kinda wingin it over here.


When I list docker containers, there is no Port mapped to the ‘New-UI’ image container.

However, when running the ‘default lemmy-UI’ image container, the Port is mapped to 127.0.0.1:15153->1234/tcp

It seems I must create a new Container, using the ‘New-UI’ image, and map the Port to 127.0.0.1:15153->1234/tcp (unless an Environment Variable can do it)

^ Now I have to figure out that exact docker command. (because docker run -d -p 127.0.0.1:15153:1234 [ImageID] does not successfully create a mapped container.)


NGINX was setup by the ansible install (it is running directly on the VPS).

The reverse-proxy ports were chosen by the ansible install. They work correctly when running the default lemmy-ui.

I have not modified anything in the ‘Lemmy-UI fork’ code (only added the docker-image.yml build file on github).

I have not modified anything on the VPS (other than the Environment Variables in docker-compose.yml, listed above).


SOLVED - Lemmy UI Fork - 502 Bad Gateway error
SOLUTION: The issue was - the ‘New UI’ docker image was automatically building for AMD64, but the Linux server is an ARM64/v8. I had to add QEMU and multi-platform build commands to the docker-image.yml file (in Github Actions). This creates an additional docker image for ARM64 machines, which loads and runs successfully. This was discovered by manually building a docker container, and receiving the following message: `WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested` So if you get that message, you must build your docker image for the platform you are on (or multiple platforms). ** == ** == ** == ** == ** == ** == ** ORIGINAL ERROR: **THE SETUP and ERROR** 1. I made a fresh ansible install, on a fresh ubuntu 20.04 server - the Lemmy instance runs perfectly. 2. I made a fresh fork of the 16.7 Lemmy-UI. 3. I built a docker-image of that forked UI, and loaded it via docker-compose (here is my [docker-image.yml build file](https://privatebin.at/?5882ef055652c602#3gVWY9YzphzrkFNmFLK6KLxWhfR4Fqtx9idoCFrZhnGx) ). Now I am getting a “502 Bad Gateway - nginx” error (the site does not load). NGINX error log shows: ``` connect() failed (111: Connection refused) while connecting to upstream, client: 75.222.232.212, server: ggg.com, request: "GET / HTTP/2.0", upstream: "http://0.0.0.0:15153/", host: "ggg.com" ``` - Nginx config has not been modified (but here is the config anyway - [ggg.conf](https://privatebin.at/?a4ba45299811eda8#GJwMDhkY1GvB4MhX914MwjxHgA9zKXpSCfhNA4rtaRcM)) - Docker log is clean. ** **DIAGNOSIS** When I list docker containers, there is no PORT mapped to the ‘New-UI’ image container. (However, when running the ‘default lemmy-UI’ image container, the PORT is successfully mapped to 127.0.0.1:15153->1234/tcp) It seems I must create a new Container, using the ‘New-UI’ image, and map the PORT to 127.0.0.1:15153->1234/tcp (unless an Environment Variable can do it). ^ Now I must figure out that exact docker command. (because `docker run -d -p 127.0.0.1:15153:1234 [ImageID]` does not successfully create the container.) ** Here are the Env Vars I’ve added (in various combinations/values): ``` lemmy-ui: environment: - LEMMY_UI_HTTPS=true - LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy:8536 - LEMMY_UI_LEMMY_EXTERNAL_HOST=ggg.com - LEMMY_UI_DISABLE_CSP=true # - LEMMY_UI_LEMMY_WS_HOST=lemmy:8536 # - LEMMY_UI_HOST=0.0.0.0:1234 ``` here is [the full docker-compose.yml](https://privatebin.at/?a00b49548bb76418#3dprkF35H671DFVfyRiGs5tY1FRrNXV9fnBK7ndxugF1) (only changed Env Vars)
fedilink

Hey I think that is a great idea. I agree that mental/spiritual freedom is reached through the breath.

That will be a great strategy and you can definitely help people who are ready to try it.


That console log is from visiting this lemmy.ml site. (I would though)


This is the console message:


8efQT4fKR1.jpg:1 - Failed to load resource: the server responded with a status of 500 ()

/pictrs/image/bhQ7ELa4oq.webp:1 - Failed to load resource: the server responded with a status of 500 ()

1:1 Refused to load manifest from 'https://lemmy.ml/static/assets/manifest.webmanifest' because it violates the following Content Security Policy directive: "default-src 'none'". Note that 'manifest-src' was not explicitly set, so 'default-src' is used as a fallback.

(with 8 images responding status 500)


I have an instance running on a 1GB RAM server.

It’s just for feature development, but it runs smoothly.


You’ve never used them before.



Adding the UI Environment Variables
QUESTION: Where should we declare those new UI Environment Variables? (from the [readme](https://github.com/LemmyNet/lemmy-ui#readme)) ANSWER: Add the new UI Environment Variables to *docker-compose.yml* (on the server). Like this: ``` lemmy-ui: image: ggg/ui2:latest ports: - "127.0.0.1:23587:1234" restart: always environment: - LEMMY_INTERNAL_HOST=lemmy:8536 - LEMMY_EXTERNAL_HOST=ggg.quest - LEMMY_HTTPS=true - LEMMY_UI_LEMMY_EXTERNAL_HOST=ggg.com - LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy:8536 - LEMMY_UI_HTTPS=true depends_on: - lemmy ```
fedilink

That’s awesome. Big respect to the devs for the isomorphic conversion.



The key (for google) is to use search parameters. Such as…

site:stackoverflow.com “javascript” “header”

  • site:stackoverflow.com - includes only stackoverflow.com results.
  • “javascript” “header” - those terms must exist on a webpage, for it to be included in search results.

And Startpage gives the same results as Google, but without trackers or AMP results (via an automatic proxy)



Also, it’s good if you have an urge to help people.

I’m just trying to talk with you about the best way to help someone overcome struggles.


I agree, it’s not their fault.

The question I’m asking you is:

  • If your intention is to ‘troll’, can you really help someone?
  • Are you gonna offer them months of sincere encouragement?
  • Do you have an idea for how to heal them?

It’s good to be kind.

But if your intention is to ‘troll’, can you really help someone?

Say a person answers your question - “my dad was an alcoholic and my mom was a skitzo.”

Okay - then what?

  • Are you gonna offer them months of sincere encouragement?
  • Do you have an idea for how to heal them?

If not, then it’s a pretty shallow ‘kindness’.


Clarifying the Ansible Instructions - 2 Questions
A couple questions about the [lemmy-ansible](https://github.com/LemmyNet/lemmy-ansible) instructions: *** **Step 1 - “Clone this repo: /lemmy-ansible.git”** *QUESTION 1* - Clone it to my local machine, correct? (not directly onto the VPS) ***ANSWER: - Yes, clone lemmy-ansible to local.*** *** **Step 2 - “Edit the config file”** *QUESTION 2* - By default, config.hjson has values like hostname: "{{ domain }}" - and - password: "{{ postgres_password }}". - Are those “{{values}}” automatically pulled from the hosts file? - or just directly edit them in the config.hjson file? ***ANSWER: - Edit them directly in the config.hjson file.*** *** Thank you for your patience. I want to do it right / understand. ***UPDATE: Installed Lemmy on VPS via SSH***
fedilink

2 Noob Questions - lemmy File Location / Migration
Hello Lemmy people, I’m trying to wrap my head around where editable files ultimately ‘live’ after Ansible install to a VPS. For example: 1. If you want to modify a specific cell in a Postgres table using Arctype (or another SQL GUI) - would you be: - directly modifying the VPS instance? - or modifying a mirrored database on your local computer? *** 2. If you setup Lemmy using a ‘1 year free trial’ from a VPS (like digital ocean)...and then want to migrate the Lemmy instance to another VPS (like Hetzner), would you be: - ‘pushing’ the custom Lemmy instance from your local computer to a new VPS? - or directly migrating the files from one VPS to the other? --- I realize these are noob questions. Thank you for your patience. Lemmy looks really cool.
fedilink