Revert to building keanu-weblite to override default config

This commit is contained in:
Ana Custura 2026-01-23 13:24:19 +00:00
parent 8e4c55a82e
commit 92b589ee67
2 changed files with 44 additions and 22 deletions

View file

@ -168,11 +168,11 @@
- name: Copy public room script - name: Copy public room script
template: template:
src: templates/create_public_room.sh.j2 src: templates/create_public_room.sh.j2
dest: /home/pi/create_public_room.sh dest: "/home/{{ butter_user }}/create_public_room.sh"
mode: '0755' mode: '0755'
- name: Run the create_public_room.sh script - name: Run the create_public_room.sh script
command: /home/pi/create_public_room.sh command: "/home/{{ butter_user }}/create_public_room.sh"
register: room_creation register: room_creation
ignore_errors: false ignore_errors: false

View file

@ -3,39 +3,60 @@
hosts: all hosts: all
become: true become: true
tasks: tasks:
- name: Download pre-built keanu archive - name: Install Node.js 22 (needed for matrix-js-sdk)
get_url: shell: |
url: "https://guardianproject.dev/api/packages/butter/generic/keanu-weblite/latest/keanu-weblite-dev.tar.gz" curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
dest: /tmp apt-get install -y nodejs
mode: '0644' args:
executable: /bin/bash
- name: Create keanu-weblite web directory - name: Ensure previous keanu-weblite temp directory is removed
file: file:
path: "/var/www/html/chat" path: /tmp/keanu-weblite
state: directory state: absent
owner: www-data delegate_to: localhost
group: www-data
mode: '0755'
recurse: yes
- name: Untar keanu-weblite - name: Clone keanu-weblite repository (dev branch)
unarchive: git:
src: "/tmp/keanu-weblite-dev.tar.gz" repo: https://gitlab.com/keanuapp/keanuapp-weblite.git
dest: "/var/www/html/chat/" dest: /tmp/keanu-weblite
remote_src: yes version: dev
extra_opts: [--strip-components=1] depth: 1
delegate_to: localhost
- name: Run npm install
shell: npm install
args:
chdir: /tmp/keanu-weblite
delegate_to: localhost
- name: Download keanu-weblite config file - name: Download keanu-weblite config file
get_url: get_url:
url: "{{ config_base_url }}/keanu-weblite-config.json" url: "{{ config_base_url }}/keanu-weblite-config.json"
dest: /var/www/html/chat/config.json dest: /tmp/keanu-weblite/src/assets/config.json
mode: '0644' mode: '0644'
delegate_to: localhost
- name: Replace REPLACEME with butter_name in config.json - name: Replace REPLACEME with butter_name in config.json
replace: replace:
path: /var/www/html/chat/config.json path: /tmp/keanu-weblite/src/assets/config.json
regexp: 'REPLACEME' regexp: 'REPLACEME'
replace: "{{ butter_name }}" replace: "{{ butter_name }}"
delegate_to: localhost
- name: Run npm build with legacy OpenSSL option
shell: |
export NODE_OPTIONS=--openssl-legacy-provider
npm run build
args:
chdir: /tmp/keanu-weblite
delegate_to: localhost
- name: Copy build output to /var/www/html/chat
become: true
copy:
src: /tmp/keanu-weblite/dist/
dest: /var/www/html/chat/
- name: Set permissions for /var/www/html/chat - name: Set permissions for /var/www/html/chat
become: true become: true
@ -51,3 +72,4 @@
name: lighttpd name: lighttpd
state: restarted state: restarted
when: not (is_vmdb2 | bool) when: not (is_vmdb2 | bool)