diff --git a/.containerignore b/.containerignore new file mode 100644 index 0000000..ae02570 --- /dev/null +++ b/.containerignore @@ -0,0 +1 @@ +release/ \ No newline at end of file diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..674a67d --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,17 @@ +name: 'Close stale issues' +on: + schedule: + - cron: '30 1 * * *' + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v6 + with: + stale-issue-message: 'This issue is stale because it has been open 150 days with no activity. Remove stale label or comment or this will be closed in 14 days.' + days-before-issue-stale: 150 + days-before-issue-close: 14 + days-before-pr-stale: -1 + days-before-pr-close: -1 + exempt-issue-labels: 'longterm,enhancement,parity-with-android,prio:medium,prio:high,electron issue,encrypted room search,build infrastructure' diff --git a/Containerfile.debian b/Containerfile.debian new file mode 100644 index 0000000..041c64e --- /dev/null +++ b/Containerfile.debian @@ -0,0 +1,30 @@ +ARG NODE_VERSION +FROM node:${NODE_VERSION} + +RUN apt-get -qq update && apt-get -qq install --no-install-recommends -y \ + curl \ + g++ \ + gcc \ + git \ + jq \ + libarchive-tools \ + libsecret-1-dev \ + libsqlcipher-dev \ + libssl-dev \ + make \ + openssl \ + pkg-config \ + python \ + tcl \ + vim + +ENV RUSTUP_HOME=/usr/local/rustup \ + CARGO_HOME=/usr/local/cargo \ + PATH=/usr/local/cargo/bin:$PATH +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --profile minimal + +COPY . /project +WORKDIR /project + +# There might be remnants of the host which break the build +RUN make fixup \ No newline at end of file diff --git a/Containerfile.fedora b/Containerfile.fedora new file mode 100644 index 0000000..21b905f --- /dev/null +++ b/Containerfile.fedora @@ -0,0 +1,20 @@ +FROM fedora:latest + +RUN dnf install -y openssl openssl-devel rust cargo llvm15 libsecret libsecret-devel g++ ruby-devel gcc make rpm-build libffi-devel tcl libxcrypt-compat + +# node setup +ARG NODE_VERSION +RUN mkdir -p /usr/local/n +RUN mkdir -p /usr/local/bin /usr/local/lib /usr/local/include /usr/local/share +RUN curl -L https://raw.githubusercontent.com/tj/n/master/bin/n -o n +RUN bash n ${NODE_VERSION} +RUN npm install -g n +RUN npm install -g yarn +RUN npm install -g node-gyp +RUN gem install --no-user-install --no-document fpm + +COPY . /project +WORKDIR /project + +# There might be remnants of the host which break the build +RUN make fixup \ No newline at end of file diff --git a/Makefile b/Makefile index 95fd274..205cea9 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,18 @@ .PHONY: all setup regenerate-i18n web desktop-common linux debian rpm pacman local-pkgbuild local-pkgbuild-install windows windows-portable .PHONY: web-release debian-release rpm-release pacman-release windows-setup-release windows-unpacked-release windows-portable-release windows-release .PHONY: macos-common macos macos-mas macos-release macos-mas-release icns -.PHONY: clean +.PHONY: container-build-debian container-build-fedora +.PHONY: container-web-release container-debian-release container-rpm-release container-appimage-release +.PHONY: clean undo_setup fixup +.PHONY: fix_yarn_cache CFGDIR ?= configs/sc all: web YARN ?= yarnpkg +CONTAINER_ENGINE ?= podman +NODE_VERSION ?= 16 VERSION := $(shell grep version element-desktop/package.json | sed 's|.*: \"\(.*\)\",|\1|') WEB_APP_NAME := $(shell grep '"name"' element-web/package.json | head -n 1 | sed 's|.*: \"\(.*\)\",|\1|') @@ -32,6 +37,9 @@ OUT_WIN64_PORTABLE_BETTER_NAME := $(PRODUCT_NAME)_win-portable_v$(VERSION) OUT_MACOS := $(DESKTOP_OUT)/$(PRODUCT_NAME)-$(VERSION)-universal.dmg OUT_MACOS_MAS := $(DESKTOP_OUT)/mas-universal/$(PRODUCT_NAME).app +CONTAINER_IMAGE_DEBIAN := schildichat-desktop-containerbuild-debian +CONTAINER_IMAGE_FEDORA := schildichat-desktop-containerbuild-fedora + RELEASE_DIR := release CURRENT_RELEASE_DIR := $(RELEASE_DIR)/$(VERSION) @@ -153,10 +161,31 @@ macos-mas-release: macos-mas mkdir -p $(CURRENT_RELEASE_DIR) cp $(OUT_MACOS_MAS) $(CURRENT_RELEASE_DIR) +container-build-debian: + $(CONTAINER_ENGINE) build -t $(CONTAINER_IMAGE_DEBIAN) -f Containerfile.debian --build-arg NODE_VERSION=$(NODE_VERSION) . + +container-build-fedora: + $(CONTAINER_ENGINE) build -t $(CONTAINER_IMAGE_FEDORA) -f Containerfile.fedora --build-arg NODE_VERSION=$(NODE_VERSION) . + +container-web-release: container-build-debian + $(CONTAINER_ENGINE) run --rm -ti -v $(PWD)/release:/project/release --security-opt label=disable $(CONTAINER_IMAGE_DEBIAN):latest make web-release + +container-debian-release: container-build-debian + $(CONTAINER_ENGINE) run --rm -ti -v $(PWD)/release:/project/release --security-opt label=disable $(CONTAINER_IMAGE_DEBIAN):latest make debian-release + +container-rpm-release: container-build-fedora + $(CONTAINER_ENGINE) run --rm -ti -v $(PWD)/release:/project/release --security-opt label=disable $(CONTAINER_IMAGE_FEDORA):latest make rpm-release + +container-appimage-release: container-build-debian + $(CONTAINER_ENGINE) run --rm -ti -v $(PWD)/release:/project/release --security-opt label=disable $(CONTAINER_IMAGE_DEBIAN):latest make appimage-release + bom.lock: element-desktop/yarn.lock element-web/yarn.lock matrix-js-sdk/yarn.lock matrix-react-sdk/yarn.lock ./build-bom.sh bom: bom.lock +fix_yarn_cache: + $(YARN) cache list || $(YARN) cache clean + clean: $(YARN) --cwd matrix-js-sdk clean $(YARN) --cwd matrix-react-sdk clean @@ -166,3 +195,11 @@ clean: rm -rf element-web/dist rm -rf local-pkgbuild rm -f bom.lock + +undo_setup: + rm -rf element-desktop/node_modules element-web/node_modules matrix-react-sdk/node_modules matrix-js-sdk/node_modules i18n-helper/node_modules element-desktop/.hak + +fixup: undo_setup fix_yarn_cache + make setup + make clean + make setup diff --git a/README.md b/README.md index f4d437d..9b1ea85 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ The following are the dependencies required to build SchildiChat Web/Desktop on ``` # apt install vim curl git make gcc g++ python jq libsqlcipher-dev pkg-config libsecret-1-dev libarchive-tools openssl libssl-dev tcl -# curl -sL https://deb.nodesource.com/setup_14.x | bash - +# curl -sL https://deb.nodesource.com/setup_16.x | bash - # apt update # apt install nodejs diff --git a/configs/sc/config.json b/configs/sc/config.json index 2916dee..0402a78 100644 --- a/configs/sc/config.json +++ b/configs/sc/config.json @@ -1,6 +1,11 @@ { "update_base_url": null, - "default_server_name": "matrix.org", + "default_server_config": { + "m.homeserver": { + "base_url": "https://matrix-client.matrix.org", + "server_name": "matrix.org" + } + }, "brand": "SchildiChat", "integrations_ui_url": "https://scalar.vector.im/", "integrations_rest_url": "https://scalar.vector.im/api", @@ -11,10 +16,13 @@ "https://scalar-staging.vector.im/api", "https://scalar-staging.riot.im/scalar/api" ], - "showLabsSettings": true, - "roomDirectory": { + "show_labs_settings": true, + "room_directory": { "servers": [ - "matrix.org" + "matrix.org", + "gitter.im", + "libera.chat", + "schildi.chat" ] }, "enable_presence_by_hs_url": { diff --git a/deploy/update-flathub.sh b/deploy/update-flathub.sh index 31c4ce5..7451aec 100755 --- a/deploy/update-flathub.sh +++ b/deploy/update-flathub.sh @@ -20,8 +20,11 @@ debdate=$(date +%Y-%m-%d -r $debpath) pushd "$repopath" > /dev/null git fetch +git checkout master git reset --hard origin/master +git checkout -B "release-v$version" + yamlFile="chat.schildi.desktop.yaml" xmlFile="chat.schildi.desktop.metainfo.xml" @@ -33,8 +36,8 @@ sed -i "s|^\s\s$| \n /dev/null -echo "Release v$version published on flathub!" +echo "Release v$version published on flathub, now merge that branch as PR: https://github.com/flathub/chat.schildi.desktop/" diff --git a/element-desktop b/element-desktop index bb09b97..ca3c38e 160000 --- a/element-desktop +++ b/element-desktop @@ -1 +1 @@ -Subproject commit bb09b97684db6927539a57ac05356bb7b6dffad3 +Subproject commit ca3c38e98d79a852098df85612fb0c21989d88ca diff --git a/element-web b/element-web index 2a51d27..d8643e4 160000 --- a/element-web +++ b/element-web @@ -1 +1 @@ -Subproject commit 2a51d277c7bc83b1b001d1aae50574bfb812d488 +Subproject commit d8643e4983b11a87831af1729037976d14641454 diff --git a/generate_changelog.sh b/generate_changelog.sh new file mode 100755 index 0000000..1e65601 --- /dev/null +++ b/generate_changelog.sh @@ -0,0 +1,61 @@ +#!/bin/bash + +set -e + +mydir="$(dirname "$(realpath "$0")")" + +pushd "$mydir" > /dev/null + +source ./merge_helpers.sh + +# Check branch +check_branch $branch +forall_repos check_branch $branch + +# Ensure clean git state +forall_repos check_clean_git + +# Fetch upstream +forall_repos git fetch origin > /dev/null 2>/dev/null +forall_repos git fetch upstream > /dev/null 2>/dev/null + +( + # Add new line below git log: https://unix.stackexchange.com/a/345558 + + get_latest_upstream_tag + forelement_repos git log --pretty=format:"- %s" "sc" "^$latest_upstream_tag" "^master" \ + | printf '%s\n' "$(cat)" \ + | sed "s|Merge tag '\\(.*\\)' into sc.*|Update codebase to Element \1|" \ + | sed "s|Merge tag '\\(.*\\)' into merge.*|Update codebase to Element \1|" + + get_current_mxsdk_tags + + pushd "matrix-js-sdk" > /dev/null + git log --pretty=format:"- %s" "sc" "^$current_mxjssdk_tag" "^master" \ + | printf '%s\n' "$(cat)" \ + | grep -v "Merge .*tag" + popd > /dev/null + + pushd "matrix-react-sdk" > /dev/null + git log --pretty=format:"- %s" "sc" "^$current_mxreactsdk_tag" "^master" \ + | printf '%s\n' "$(cat)" \ + | grep -v "Merge .*tag" + popd > /dev/null +) \ + | grep -v "Automatic i18n reversion" \ + | grep -v "Automatic package.json reversion" \ + | grep -v "Merge .*branch" \ + | grep -v "Automatic theme update" \ + | grep -v "Automatic package.json adjustment" \ + | grep -v "Automatic i18n adjustment" \ + | grep -v "Update version to .*-sc\\..*" \ + | grep -v "\\.sh" \ + | grep -v "\\.md" \ + | grep -v "Added translation using Weblate" \ + | grep -v "Translated using Weblate" \ + | grep -v "weblate/sc" \ + | grep -v "\\[.*merge.*\\]" \ + | awk '!seen[$0]++' `# https://stackoverflow.com/a/1444448` \ + || echo "No significant changes since the last stable release" + +popd > /dev/null diff --git a/hard_reset_repos.sh b/hard_reset_repos.sh new file mode 100755 index 0000000..4e17e2a --- /dev/null +++ b/hard_reset_repos.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -e + +mydir="$(dirname "$(realpath "$0")")" + +cd "$mydir" + +source ./merge_helpers.sh + +# Note: this doesn't delete files starting with a dot, +# and in particular not the '.git' directory, which we +# want to keep +forall_repos bash -c 'rm -rf *' +forall_repos git reset HEAD --hard diff --git a/i18n-helper/index.js b/i18n-helper/index.js index f226e47..11e3fc4 100644 --- a/i18n-helper/index.js +++ b/i18n-helper/index.js @@ -35,7 +35,13 @@ function writeStrings(p, strings) { let strings = readStrings(p); for (const key of Object.keys(strings)) { - strings[key] = strings[key].replace(/Element/g, "SchildiChat").replace(/element\.io/g, "schildi.chat"); + strings[key] = strings[key] + .replace(/Element/g, "SchildiChat") + .replace(/element\.io/g, "schildi.chat") + + // It's still Element Call + .replace(/SchildiChat Call/g, "Element Call") + .replace(/SchildiChat-Call/g, "Element-Call"); } if (overlayPath) { diff --git a/i18n-overlays/element-desktop/hu.json b/i18n-overlays/element-desktop/hu.json index 0967ef4..8598663 100644 --- a/i18n-overlays/element-desktop/hu.json +++ b/i18n-overlays/element-desktop/hu.json @@ -1 +1,3 @@ -{} +{ + "Show": "Mutat" +} diff --git a/i18n-overlays/element-desktop/ja.json b/i18n-overlays/element-desktop/ja.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/i18n-overlays/element-desktop/ja.json @@ -0,0 +1 @@ +{} diff --git a/i18n-overlays/element-web/ja.json b/i18n-overlays/element-web/ja.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/i18n-overlays/element-web/ja.json @@ -0,0 +1 @@ +{} diff --git a/i18n-overlays/matrix-react-sdk/cs.json b/i18n-overlays/matrix-react-sdk/cs.json index 861e944..c07e3a1 100644 --- a/i18n-overlays/matrix-react-sdk/cs.json +++ b/i18n-overlays/matrix-react-sdk/cs.json @@ -21,8 +21,8 @@ "MXID": "MXID", "In group chats": "Ve skupinových chatech", "In public rooms": "Ve veřejných místnostech", - "All rooms you're in will appear in Home.": "Všechny místnosti, ve kterých se nacházíte, se zobrazí v domovském zobrazení.", - "Show all rooms in Home": "Ukázat všechny místnosti v domovském zobrazení", + "All rooms you're in will appear in Home.": "Všechny místnosti, ve kterých se nacházíte, se zobrazí v Úvodu.", + "Show all rooms in Home": "Zobrazit všechny místnosti v Úvodu", "Show people in spaces": "Ukázat lidi v prostorech", "Show notification badges for People in Spaces": "Zobrazit odznaky oznámení pro Lidé v prostorech", "Return to the room previously opened in a space": "Návrat do dříve otevřené místnosti v prostoru", diff --git a/i18n-overlays/matrix-react-sdk/en_EN.json b/i18n-overlays/matrix-react-sdk/en_EN.json index 7732df7..2c59706 100644 --- a/i18n-overlays/matrix-react-sdk/en_EN.json +++ b/i18n-overlays/matrix-react-sdk/en_EN.json @@ -49,5 +49,6 @@ "Mixed": "Mixed", "Sound pack": "Sound pack", "Schildi: Softer sounds for reduced anxiety": "Schildi: Softer sounds for reduced anxiety", - "Classic: The same sharp sounds as Element": "Classic: The same sharp sounds as Element" + "Classic: The same sharp sounds as Element": "Classic: The same sharp sounds as Element", + "React with \"%(reaction)s\"": "React with \"%(reaction)s\"" } diff --git a/i18n-overlays/matrix-react-sdk/it.json b/i18n-overlays/matrix-react-sdk/it.json index 72a5b3a..187e9c4 100644 --- a/i18n-overlays/matrix-react-sdk/it.json +++ b/i18n-overlays/matrix-react-sdk/it.json @@ -9,5 +9,26 @@ "Light theme": "Tema chiaro", "Dark theme": "Tema scuro", "Normal priority": "Priorità normale", - "Do you want to join a room notifying you about new releases? This is especially useful if your platform doesn't support automatic updates for SchildiChat (e.g. Windows and macOS).": "Vuoi entrare in una stanza che ti notificherà riguardo nuove release? Sarebbe comodo particolarmente se la tua piattaforma non supporta aggiornamenti automatici (Come per esempio Windows o MacOS.)" + "Do you want to join a room notifying you about new releases? This is especially useful if your platform doesn't support automatic updates for SchildiChat (e.g. Windows and macOS).": "Vuoi entrare in una stanza che ti notificherà riguardo nuove release? Sarebbe comodo particolarmente se la tua piattaforma non supporta aggiornamenti automatici (Come per esempio Windows o MacOS.)", + "Show message bubbles on one side only": "Visualizza bolle messaggi su un lato solo", + "Show message bubbles depending on the width either on both sides or only on one side": "Visualizza bolle messaggi in base alla lunghezza di entrambi i lati o di uno solo", + "User name color mode": "Modalità colore nome utente", + "Room list style": "Stile lista stanze", + "Theme": "Tema", + "Show all rooms in Home": "Visualizza tutte le stanze nella Home", + "All rooms you're in will appear in Home.": "Tutte le stanze in cui partecipi appariranno nella Home.", + "For people": "Per le persone", + "Room list": "Lista stanze", + "Show advanced theme settings": "Visualizza impostazioni avanzate tema", + "Mark rooms as unread": "Permetti di segnare le chat come non lette", + "Message bubbles": "Bolle messaggi", + "Message layout": "Impaginazione messaggi", + "Mark as unread": "Segna come non letto", + "Uniform": "Uniforme", + "Show people in spaces": "Visualizza persone negli spazi", + "MXID": "MXID", + "In public rooms": "Nelle stanze pubbliche", + "In group chats": "Nelle chat di gruppo", + "Font size and typeface": "Dimensione e tipo carattere", + "Hide advanced theme settings": "Nascondi impostazioni avanzate tema" } diff --git a/i18n-overlays/matrix-react-sdk/ja.json b/i18n-overlays/matrix-react-sdk/ja.json new file mode 100644 index 0000000..fedc533 --- /dev/null +++ b/i18n-overlays/matrix-react-sdk/ja.json @@ -0,0 +1,3 @@ +{ + "Normal priority": "常優先度" +} diff --git a/i18n-overlays/matrix-react-sdk/lt.json b/i18n-overlays/matrix-react-sdk/lt.json index 2b32484..7013517 100644 --- a/i18n-overlays/matrix-react-sdk/lt.json +++ b/i18n-overlays/matrix-react-sdk/lt.json @@ -17,5 +17,37 @@ "In group chats": "Pokalbių grupėse", "In public rooms": "Viešuose kambariuose", "Show all rooms in Home": "Rodyti visus kambarius Pradžioje", - "All rooms you're in will appear in Home.": "Visi kambariai kuriuose esate bus rodomi Pradžioje." + "All rooms you're in will appear in Home.": "Visi kambariai kuriuose esate bus rodomi Pradžioje.", + "Hide advanced theme settings": "Slėpti išplėstinius temos nustatymus", + "Show advanced theme settings": "Rodyti išplėstinius temos nustatymus", + "Theme": "Tema", + "Font size and typeface": "Šrifto dydis ir raštas", + "Show message bubbles depending on the width either on both sides or only on one side": "Rodyti žinučių burbulus, priklausomai nuo pločio, abiejose pusėse arba tik vienoje pusėje", + "Sound pack": "Garso paketas", + "Schildi: Softer sounds for reduced anxiety": "Schildi: švelnesni garsai sumažintam nerimui", + "Classic: The same sharp sounds as Element": "Klasikiniai: Tie patys aštrūs garsai kaip ir Element", + "Enable YouTube embed player": "Įgalinti YouTube įterptą grotuvą", + "Add custom theme": "Pridėti pasirinktinę temą", + "Mark as unread": "Žymėti kaip neskaitytą", + "Mark as read": "Žymėti kaip perskaitytą", + "User name color mode": "Naudotojo vardo spalvų režimas", + "Uniform": "Vienodi", + "Show notification badges for People in Spaces": "Rodyti pranešimų ženkliukus žmonėms erdvėse", + "Return to the room previously opened in a space": "Grįžti į anksčiau atidarytą kambarį erdvėje", + "If disabled, the space overview will be shown when switching to another space.": "Jei išjungta, perjungiant į kitą erdvę bus rodoma erdvės apžvalga.", + "Room list style": "Kambarių sąrašo stilius", + "Compact: tiny avatar together with name and preview in one line": "Kompaktiška: mažytis avataras kartu su vardu ir peržiūra vienoje eilutėje", + "Intermediate: medium sized avatar with single-line preview": "Vidutinis: vidutinio dydžio avataras su vienos eilutės peržiūra", + "Roomy: big avatar with two-line preview": "Erdvus: didelis avataras su dviejų eilučių peržiūra", + "PowerLevel": "Galios lygis", + "For people": "Žmonėms", + "Show people in spaces": "Rodyti žmones erdvėse", + "If disabled, you can still add Direct Messages to Personal Spaces. If enabled, you'll automatically see everyone who is a member of the Space.": "Jei išjungta, vis tiek galite pridėti tiesioginius pokalbius į asmenines erdves. Jei ši funkcija įjungta, automatiškai matysite visus, kurie yra erdvės nariai.", + "Mark rooms as unread": "Leisti žymėti pokalbius kaip neskaitytus", + "Home is useful for getting an overview of everything. Keep in mind that disabling it could leave you unable to see certain rooms.": "Pradžia yra naudinga, kad galėtumėte viską apžvelgti. Turėkite omenyje, kad ją išjungę galite nematyti tam tikrų kambarių.", + "Collapse additional buttons": "Sulankstyti papildomus mygtukus", + "Corners": "Kampai", + "Round": "Apvalus", + "Extra round": "Ypač apvalus", + "Mixed": "Mišrus" } diff --git a/i18n-overlays/matrix-react-sdk/pt_BR.json b/i18n-overlays/matrix-react-sdk/pt_BR.json index 5bac536..1b4c8af 100644 --- a/i18n-overlays/matrix-react-sdk/pt_BR.json +++ b/i18n-overlays/matrix-react-sdk/pt_BR.json @@ -40,5 +40,6 @@ "Room list style": "Estilo da lista de salas", "Mark rooms as unread": "Permitir markar conversas como não lidos", "Mark as unread": "Markar como não lido", - "Mark as read": "Markar como lido" + "Mark as read": "Markar como lido", + "Collapse additional buttons": "Recolher botões adicionais" } diff --git a/matrix-js-sdk b/matrix-js-sdk index c2deb2a..af4413b 160000 --- a/matrix-js-sdk +++ b/matrix-js-sdk @@ -1 +1 @@ -Subproject commit c2deb2a20e687b1ef566a3e21ae3c5c18b473dd1 +Subproject commit af4413b7a681d5f590b7674d87b3a103086705d1 diff --git a/matrix-react-sdk b/matrix-react-sdk index bf34169..21ecba2 160000 --- a/matrix-react-sdk +++ b/matrix-react-sdk @@ -1 +1 @@ -Subproject commit bf34169e576fde32cc9b0384eed22220b311ef39 +Subproject commit 21ecba234658a89d22eccb33429d3770b7a28341