cketti / jitsi-hacks

Jitsi Hacks – Extending Jitsi Meet using injected scripts
https://jitsi-hacks.cketti.eu
Apache License 2.0
34 stars 4 forks source link

How to add it to a server? #3

Open timowevel1 opened 3 years ago

timowevel1 commented 3 years ago

Hey!

First thank you for those amazing hacks. I especially love the emoji one and wondered how to add it to an existing jitsi server so everyone can use them. Can you help me there?

Thanks!

cketti commented 3 years ago

Replace all occurrences of jitsi.example.com with your Jitsi host name.

  1. Create the directory /usr/share/jitsi-hacks/emoji-reaction
  2. Download the following files and save them to the newly created directory:
  3. Edit /usr/share/jitsi-hacks/emoji-reaction/emoji-reaction.js and replace
    const emojiBaseUrl = 'https://jitsi-hacks.cketti.eu/';

    with

    const emojiBaseUrl = 'https://jitsi.example.com/jitsi-hacks/emoji-reaction/';
  4. Edit your web server configuration and point the web path /jitsi-hacks/ to the directory /usr/share/jitsi-hacks/. E.g. for Apache add the following to /etc/apache2/sites-available/jitsi.example.com.conf:
    Alias "/jitsi-hacks/" "/usr/share/jitsi-hacks/"
    <Location /jitsi-hacks/>
      Require all granted
    </Location>
  5. Reload your webserver and make sure the JavaScript file and the images are available under e.g. https://jitsi.example.com/jitsi-hacks/emoji-reaction/emoji-reaction.js
  6. To load the script in Jitsi Meet edit /etc/jitsi/meet/jitsi.example.com-config.js and add the following lines at the top (or bottom; shouldn't really matter):

    function addScript(src) {
        const script = document.createElement('script');
        script.setAttribute('src', src);
        document.body.appendChild(script);
    }
    
    window.addEventListener('DOMContentLoaded', function() {
        addScript('/jitsi-hacks/emoji-reaction/emoji-reaction.js');
    });

    Note: This config file is loaded by clients other than the Jitsi Meet web app. I don't know if they can deal with the modification. Maybe you'll have to find another way to inject the script.

  7. Reload Jitsi Meet in your browser. You should now be good to go.
timowevel1 commented 3 years ago

Thank you so much!


From: cketti notifications@github.com Sent: Saturday, December 5, 2020 7:35:48 PM To: cketti/jitsi-hacks jitsi-hacks@noreply.github.com Cc: timololipop smartie8@hotmail.de; Author author@noreply.github.com Subject: Re: [cketti/jitsi-hacks] How to add it to a server? (#3)

Replace all occurrences of jitsi.example.com with your Jitsi host name.

  1. Create the directory /usr/share/jitsi-hacks/emoji-reaction
  2. Download the following files and save them to the newly created directory:
  3. Edit /usr/share/jitsi-hacks/emoji-reaction/emoji-reaction.js and replace

const emojiBaseUrl = 'https://jitsi-hacks.cketti.eu/';

with

const emojiBaseUrl = 'https://jitsi.example.com/jitsi-hacks/emoji-reaction/';

  1. Edit your web server configuration and point the web path /jitsi-hacks/ to the directory /usr/share/jitsi-hacks/. E.g. for Apache add the following to /etc/apache2/sites-available/jitsi.example.com.conf:

Alias "/jitsi-hacks/" "/usr/share/jitsi-hacks/" <Location /jitsi-hacks/> Require all granted

  1. Reload your webserver and make sure the JavaScript file and the images are available under e.g. https://jitsi.example.com/jitsi-hacks/emoji-reaction/emoji-reaction.js
  2. To load the script in Jitsi Meet edit /etc/jitsi/meet/jitsi.example.com-config.js and add the following lines at the top (or bottom; shouldn't really matter):

function addScript(src) { const script = document.createElement('script'); script.setAttribute('src', src); document.body.appendChild(script); }

window.addEventListener('DOMContentLoaded', function() { addScript('/jitsi-hacks/emoji-reaction/emoji-reaction.js'); });

Note: This config file is loaded by clients other than the Jitsi Meet web app. I don't know if they can deal with the modification. Maybe you'll have to find another way to inject the script.

  1. Reload Jitsi Meet in your browser. You should now be good to go.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/cketti/jitsi-hacks/issues/3#issuecomment-739332293, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGA5FLYCNLQRNLSFX47KI3TSTJ4QJANCNFSM4UOPMUNQ.

0xnor0 commented 3 years ago

This doesn't work anymore :(

cketti commented 3 years ago

"This doesn't work anymore" is not a very useful error description. If it's because the Jitsi Meet web user interface has changed, see https://jitsi-hacks.cketti.eu/2021/04/26/updates-to-support-new-jitsi-ui/