Skip to content

Setup OGProxy for use in NodeBB

Moved Let's Build It
110 5 55.3k 2
  • So I no longer need my effect code if all the URL links, even internal ones, are in an Iframe so managed by OGProxy 😉
    You could have told me before I racked my brains little trickster ha ha 😊

    But I thought it would cause perf issues so I guess you found a workaround for that 😉

    @phenomlab said in Setup OGProxy for use in NodeBB:

    @DownPW can you pm me a link to an internal URL ? Something I’d like to check.

    On my Domain ?

    wrote on last edited by
    #33

    @DownPW sorry. Yes, I did find a workaround.

    Yes, your Dev instance please.

  • wrote on last edited by
    #34

    Hi, I’ve followed all steps but unfortunately don’t get it to work. Here’s the console output:

    OGProxy: Domains containing (or starting with) http://xx.xxx.xxx.xxx are in the ignore list and will not be parsed.
    OGProxy: Paths containing /post are in the ignore list and will not be parsed. 
    OGProxy: Parsing DOM for any URLs that should be converted to previews.
    
  • Hi, I’ve followed all steps but unfortunately don’t get it to work. Here’s the console output:

    OGProxy: Domains containing (or starting with) http://xx.xxx.xxx.xxx are in the ignore list and will not be parsed.
    OGProxy: Paths containing /post are in the ignore list and will not be parsed. 
    OGProxy: Parsing DOM for any URLs that should be converted to previews.
    
    wrote on last edited by
    #35

    @dave1904 is the server running ?

  • wrote on last edited by
    #36

    @phenomlab Yes

    ● ogproxy.service - OGProxy Server
         Loaded: loaded (/etc/systemd/system/ogproxy.service; enabled; vendor preset: enabled)
         Active: active (running) since Tue 2023-06-13 21:32:17 UTC; 34min ago
       Main PID: 948850 (node)
          Tasks: 7 (limit: 1131)
         Memory: 16.0M
         CGroup: /system.slice/ogproxy.service
                 └─948850 /usr/bin/node /home/ogproxy/ogproxy/server.js
    
  • @phenomlab Yes

    ● ogproxy.service - OGProxy Server
         Loaded: loaded (/etc/systemd/system/ogproxy.service; enabled; vendor preset: enabled)
         Active: active (running) since Tue 2023-06-13 21:32:17 UTC; 34min ago
       Main PID: 948850 (node)
          Tasks: 7 (limit: 1131)
         Memory: 16.0M
         CGroup: /system.slice/ogproxy.service
                 └─948850 /usr/bin/node /home/ogproxy/ogproxy/server.js
    
    wrote on last edited by
    #37

    @dave1904 can you provide your nginx config?

  • @dave1904 can you provide your nginx config?

    wrote on last edited by
    #38

    @phenomlab I have send you a pm

  • @phenomlab I have send you a pm

    wrote on last edited by
    #39

    @dave1904 thanks. Any errors in the console?

  • wrote on last edited by
    #40
    This post is deleted!
  • wrote on last edited by dave1904
    #41

    @phenomlab Yes:

    OPTIONS
    
    https://media.werkself-forum.de/ogproxy?url=https://www1.wdr.de/sport/fussball/erste-bundesliga/bundesliga-teamcheck-winter-bayer-leverkusen-100.html
    
    CORS Missing Allow Origin
    

    It seems to me that I missed something in the nginx configuration.

  • @phenomlab Yes:

    OPTIONS
    
    https://media.werkself-forum.de/ogproxy?url=https://www1.wdr.de/sport/fussball/erste-bundesliga/bundesliga-teamcheck-winter-bayer-leverkusen-100.html
    
    CORS Missing Allow Origin
    

    It seems to me that I missed something in the nginx configuration.

    wrote on last edited by phenomlab
    #42

    @dave1904 not the nginx configuration, but in server.js under this specific section

    app.use(cors({ origin: 'FULL_FQDN_OF_YOUR_ORIGIN_HERE' }));
    
  • wrote on last edited by
    #43

    @DownPW @dave1904 can you please replace your function code (found in function.js and used in the custom JS part of NodeBB) to use the below - please also remember to replace your proxy and apiKey values

    https://github.com/phenomlab/ogproxy/blob/main/function.js

    I have found a couple of bugs this morning and fixed them. The original post has also been updated.

    Thanks

  • wrote on last edited by phenomlab
    #44

    I’ve added a new hover effect that will enlarge the image by 1.5 when activated. If you’d like this feature, you’ll need to pull the latest function.js code and use this to replace the existing in your custom JS console.

    You will also need this additional CSS

    .card-image-container {
        max-width: 100%;
        max-height: 250px;
        overflow: hidden;
        border-top-left-radius: 0.375rem !important;
        border-top-right-radius: 0.375rem !important;
    }
    
    #card-image {
        -webkit-transition: all 0.8s ease;
        -moz-transition: all 0.8s ease;
        transition: all 0.8s ease;
    }
    #card-image:hover {
        transform: scale(1.1);
      }
    

    If you’d rather not have this feature, just remove the CSS block above.

  • wrote on last edited by
    #45

    Another update - code has been amended in GIT to fix the previewLinks() function crashing in chat 🙂

  • wrote on last edited by DownPW
    #46

    Can you give procedure to update?

  • Can you give procedure to update?

    wrote on last edited by phenomlab
    #47

    @DownPW Sure - you just need to copy the code from the below

    https://github.com/phenomlab/ogproxy/blob/main/function.js

    And, of course, replace these two values with your own that you already have

    var proxy = "FULL_FQDN_OF_YOUR_OGPROXY_HERE";
    var apiKey = "YOUR_API_KEY_HERE";
    

    No need to restart the OGProxy service 🙂

  • phenomlab phenomlab referenced this topic on
  • wrote on last edited by
    #48

    Update done 😉

    Thanks for your work dude 😉

  • Update done 😉

    Thanks for your work dude 😉

    wrote on last edited by
    #49

    @DownPW all good now?

  • wrote on last edited by DownPW
    #50

    I will try chat ASAP
    and it seems github private url doesn’t work but I think it’s normal because it’s a private repo

    image.png

  • I will try chat ASAP
    and it seems github private url doesn’t work but I think it’s normal because it’s a private repo

    image.png

    wrote on last edited by
    #51

    @DownPW that should still render but be replaced with substitute text and images. Anything in the browser console?

  • wrote on last edited by DownPW
    #52

    nope nothing in log

    And i Have this bug on the chat render (testing now)

    image.png


Related Topics