-
-
Notifications
You must be signed in to change notification settings - Fork 30
Setup Uli on Linux for Firefox
Source code for Uli's browser extension is contained within the browser-extension
directory. You can read our learning guide to know more about the various components that make up the browser extension.
- npm : v9.6.7^
- nodejs : v18.17.1^
- Docker: 20.10.7
git clone https://github.com/tattle-made/Uli.git
cd Uli
the REST API server for Uli requires certain credentials to be setup in a file named development.env
. Run touch browser-extension/development.env
to create the file. Open the file and copy-paste the following :
NODE_ENV=development
AWS_BUCKET_NAME=XXXXXXXXXXX
SERVICE_AWS_ACCESS_KEY_ID=XXXXXXXXXX
SERVICE_AWS_SECRET_ACCESS_KEY=XXXXXXX
DB_HOST=db
DB_USERNAME=tattle
DB_PASSWORD=tattle_pw
DB_FIELD_ENCRYPTION_KEY=very-secure-key
The missing values can be ignored for now. You can read the credential guide to fully understand how to fill it. You can also reach out to [email protected] to get some keys that will work with our sandbox environment.
We will use docker to start a SQL server that will be accessible on port 3306. Run cd browser-extension
and docker-compose up db db-gui api-server
. This brings up a SQL service and a SQL web GUI service. Run docker ps
to verify.
Your output should look something like this :
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f15a12c199d3 browser-extension_api-server "/entrypoint.sh node…" 33 seconds ago Up 32 seconds 0.0.0.0:3000->3000/tcp, :::3000->3000/tcp api-server
f87165bfc8f3 adminer "entrypoint.sh php -…" About a minute ago Up 33 seconds 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp browser-extension_db-gui_1
3aacd6a0ff55 mysql "docker-entrypoint.s…" 2 days ago Up 33 seconds 0.0.0.0:3306->3306/tcp, :::3306->3306/tcp, 33060/tcp browser-extension_db_1
To verify if the db gui is working well, visit localhost:8080 and login with the following credentials :
field | value |
---|---|
System | MySQL |
Server | db |
Username | tattle |
Password | tattle_pw |
Database | uli_dev |
In a new tab, run the following commands to configure and start the api-server
docker exec -it api-server npm install
docker exec -it api-server npx sequelize-cli db:migrate
docker exec -it api-server nodemon index.js
(3) will begin a development server for api-server
. Any changes you make to the code withing browser-extension/api-server
will cause the server to reload.
Locate the file manifest.firefox.json
and in the content-security-policy
key, add http://localhost:3000 ws://localhost
to the connect-src
string.
Your content-security-policy
field should look like
"content_security_policy": {
"extension_pages": "default-src 'none'; connect-src http://localhost:3000 ws://localhost https://ogbv-plugin.tattle.co.in/ https://uli-media.tattle.co.in/; font-src https://fonts.gstatic.com; object-src 'none'; script-src 'self'; style-src https://fonts.googleapis.com 'self' 'unsafe-inline'; img-src https://uli-media.tattle.co.in/; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; report-uri 'none';"
}
Add http://localhost/*
to the permissions
key in the manifest. The update permissions should look like this
"permissions": [
"storage",
"webRequest",
"contextMenus",
"https://ogbv-plugin.tattle.co.in/*",
"http://localhost/*"
],
Run npm run dev:firefox
. This should create a directory named dist
in the browser-extension/plugin
directory. The dist
directory should now have the following structure.
dist/
background.js
content-script.js
content-script.js.map
icon16.png
icon32.png
manifest.json
options.html
options.js
options.js.map
To load Uli
- Type
about:debugging
in the address bar and press Enter. - Click on
This Firefox
in the left-hand sidebar. You will now see a Temporary Extensions dropdown. - Within the "Temporary Extension" dropdown, click on the "Load Temporary Add-on.." button and load any file from the dist folder. This will load the extension into the browser.
Uli is all setup on Firefox.
Try the steps mentioned in this video to try Uli out
- About Us
- Our Team
- Contributing to Uli
- Code of Conduct
- Internal Communications
- FAQs
- Curated Issues and Proposals for beginners
- Contributing Code
- Monitoring Issues and Triaging
- Helping review PRs
- Helping with QA
- Helping with Translations
- Sponsor Tattle
- 16 Days of Activism
- Mitigating Harms of Digitally Manipulated Images
- Setup Uli on Windows for Chrome
- Setup Uli on Windows for Chrominum Browsers (Brave, Kiwi etc)
- Setup Uli on Windows for Firefox
- Setup Uli on Windows for Firefox for Android
- Setup Uli on Linux for Chrome
- Setup Uli on Linux for Firefox
- Setup Uli on Linux for Firefox for Android
- Setup Uli on Linux for for Chromium Browsers(Kiwi, Brave etc)