Compare commits

..

1 commit
main ... v0.0.1

Author SHA1 Message Date
a06bf07d9c Change butter site location for kanglam 2026-01-22 17:20:08 +00:00
4 changed files with 43 additions and 233 deletions

View file

@ -33,8 +33,8 @@
- name: Download the butter-box UI zip file - name: Download the butter-box UI zip file
get_url: get_url:
url: "https://likebutter.gitlab.io/butter-box-ui/site-{{ butter_language }}.zip" url: "https://guardianproject.dev/api/packages/butter/generic/butter-kanglam-ui/latest/kanglam-ui.tar.gz"
dest: /tmp/site.zip dest: /tmp/site.tar.gz
mode: '0644' mode: '0644'
- name: Ensure /tmp/butter-site directory exists - name: Ensure /tmp/butter-site directory exists
@ -43,17 +43,28 @@
state: directory state: directory
mode: '0755' mode: '0755'
- name: Unarchive site.zip to /tmp/butter-site - name: Unarchive site.tar.gz to /tmp/butter-site
unarchive: unarchive:
src: /tmp/site.zip src: /tmp/site.tar.gz
dest: /tmp/butter-site dest: /var/www/html
remote_src: yes remote_src: yes
extra_opts: [--strip-components=1]
- name: Copy contents to /var/www/html/ - name: Set permissions for /var/www/html/
copy: become: true
src: /tmp/butter-site/ file:
dest: /var/www/html/ path: /var/www/html/
owner: www-data owner: www-data
group: www-data group: www-data
mode: '0755' mode: '0755'
remote_src: yes recurse: yes
# - name: List files in remote directory
# ansible.builtin.find:
# paths: /var/www/html
# file_type: any
# register: dir_contents
#
# - name: Print directory contents
# ansible.builtin.debug:
# msg: "{{ dir_contents.files | map(attribute='path') | list }}"

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/{{ butter_user }}/create_public_room.sh" dest: /home/pi/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/{{ butter_user }}/create_public_room.sh" command: /home/pi/create_public_room.sh
register: room_creation register: room_creation
ignore_errors: false ignore_errors: false

View file

@ -3,60 +3,39 @@
hosts: all hosts: all
become: true become: true
tasks: tasks:
- name: Install Node.js 22 (needed for matrix-js-sdk) - name: Download pre-built keanu archive
shell: | get_url:
curl -fsSL https://deb.nodesource.com/setup_22.x | bash - url: "https://guardianproject.dev/api/packages/butter/generic/keanu-weblite/latest/keanu-weblite-dev.tar.gz"
apt-get install -y nodejs dest: /tmp
args: mode: '0644'
executable: /bin/bash
- name: Ensure previous keanu-weblite temp directory is removed - name: Create keanu-weblite web directory
file: file:
path: /tmp/keanu-weblite path: "/var/www/html/chat"
state: absent state: directory
delegate_to: localhost owner: www-data
group: www-data
mode: '0755'
recurse: yes
- name: Clone keanu-weblite repository (dev branch) - name: Untar keanu-weblite
git: unarchive:
repo: https://gitlab.com/keanuapp/keanuapp-weblite.git src: "/tmp/keanu-weblite-dev.tar.gz"
dest: /tmp/keanu-weblite dest: "/var/www/html/chat/"
version: dev remote_src: yes
depth: 1 extra_opts: [--strip-components=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: /tmp/keanu-weblite/src/assets/config.json dest: /var/www/html/chat/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: /tmp/keanu-weblite/src/assets/config.json path: /var/www/html/chat/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
@ -72,4 +51,3 @@
name: lighttpd name: lighttpd
state: restarted state: restarted
when: not (is_vmdb2 | bool) when: not (is_vmdb2 | bool)

View file

@ -1,179 +0,0 @@
---
# See https://wiki.debian.org/RaspberryPi3 for known issues and more details.
# image.yml based on revision: ff7fdbf (Switch from qemu-debootstrap to debootstrap., 2024-01-01)
steps:
- mkimg: "{{ output }}"
size: 3100M
- mklabel: gpt
device: "{{ output }}"
############ efi
- mkpart: primary
fs-type: 'fat32'
device: "{{ output }}"
start: 1MiB
end: 132MiB
tag: efi
- set_part_flag: "{{ output }}"
tag: efi
flag: boot
state: enabled
- set_part_flag: "{{ output }}"
tag: efi
flag: esp
state: enabled
############ bios grub
- mkpart: primary
device: "{{ output }}"
start: 132MiB
end: 133MiB
tag: bios_grub
- set_part_flag: "{{ output }}"
tag: bios_grub
flag: bios_grub
state: enabled
############ live
- mkpart: primary
device: "{{ output }}"
start: 133MiB
end: 100%
tag: tag-root
- set_part_flag: "{{ output }}"
tag: tag-root
flag: legacy_boot
state: enabled
- kpartx: "{{ output }}"
- mkfs: vfat
partition: efi
label: EFI
options: -F32
- mkfs: ext4
partition: tag-root
label: boot
- mount: tag-root
- shell: |
dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/mbr/gptmbr.bin of="{{ output }}"
root-fs: tag-root
- unpack-rootfs: tag-root
- debootstrap: trixie
require_empty_target: false
mirror: http://deb.debian.org/debian
target: tag-root
components:
- main
- non-free-firmware
- non-free
unless: rootfs_unpacked
- create-file: /etc/apt/sources.list
contents: |+
deb http://deb.debian.org/debian trixie main non-free-firmware non-free
deb http://deb.debian.org/debian trixie-updates main non-free-firmware non-free
deb http://security.debian.org/debian-security trixie-security main non-free-firmware non-free
unless: rootfs_unpacked
- apt: install
packages:
- avahi-daemon
- curl
- udisks2
- wget
- dhcpcd
- python3
- lighttpd
- unzip
- sudo
- systemd-timesyncd
- ca-certificates
- dosfstools
- iw
- parted
- ssh
- wpasupplicant
- systemd
- systemd-sysv
- init-system-helpers
- syslinux
- linux-image-amd64
tag: tag-root
unless: rootfs_unpacked
- cache-rootfs: tag-root
unless: rootfs_unpacked
- shell: |
echo "butterbox" > "${ROOT?}/etc/hostname"
# Allow root logins locally with no password
sed -i 's,root:[^:]*:,root::,' "${ROOT?}/etc/shadow"
install -m 644 -o root -g root image-specs/rootfs/etc/fstab "${ROOT?}/etc/fstab"
install -m 644 -o root -g root image-specs/rootfs/etc/network/interfaces.d/eth0 "${ROOT?}/etc/network/interfaces.d/eth0"
install -m 600 -o root -g root image-specs/rootfs/etc/network/interfaces.d/wlan0 "${ROOT?}/etc/network/interfaces.d/wlan0"
root-fs: tag-root
# Clean up archive cache (likely not useful) and lists (likely outdated) to
# reduce image size by several hundred megabytes.
- chroot: tag-root
shell: |
apt-get clean
rm -rf /var/lib/apt/lists
- grub: bios
tag: tag-root
console: serial
#
- grub: uefi
tag: tag-root
efi: efi
console: serial
- shell: |
rm "${ROOT?}/etc/resolv.conf"
root-fs: tag-root
# Clear /etc/machine-id and /var/lib/dbus/machine-id, as both should
# be auto-generated upon first boot. From the manpage
# (machine-id(5)):
#
# For normal operating system installations, where a custom image is
# created for a specific machine, /etc/machine-id should be
# populated during installation.
#
# Note this will also trigger ConditionFirstBoot=yes for systemd.
# On Buster, /etc/machine-id should be an emtpy file, not an absent file
# On Bullseye, /etc/machine-id should not exist in an image
- chroot: tag-root
shell: |
rm -f /etc/machine-id /var/lib/dbus/machine-id
echo "uninitialized" > /etc/machine-id
echo "LABEL=BOOT / ext4 rw 0 1" > /etc/fstab
- virtual-filesystems: tag-root
- ansible: tag-root
playbook: ../ansible/main.yml
config_file: ../ansible/ansible.cfg
extra_vars:
butter_language: en
butter_name: butterbox
tags: base,usb,matrix,keanu,website
butter_user: "amd"
ap_mode_supported: "false"