Skip to content
This repository was archived by the owner on Aug 24, 2024. It is now read-only.

Commit 07b9278

Browse files
committed
feat(repo): Added support for [Element.io](https://element.io) repository
1 parent fb604bb commit 07b9278

File tree

9 files changed

+284
-45
lines changed

9 files changed

+284
-45
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
strategy:
4141
fail-fast: false
4242
matrix:
43-
release: [ "buster" ]
43+
release: [ "buster", "bullseye" ]
4444
steps:
4545
- uses: actions/checkout@v2
4646
with:
@@ -87,7 +87,7 @@ jobs:
8787
strategy:
8888
fail-fast: false
8989
matrix:
90-
release: ["stretch", "buster"]
90+
release: ["stretch", "buster", "bullseye"]
9191
steps:
9292
- uses: actions/checkout@v2
9393
with:
@@ -97,4 +97,4 @@ jobs:
9797
uses: docker/setup-qemu-action@v1
9898

9999
- name: Test on ARM64 ${{ matrix.release }}
100-
run: ./tests/local.sh --build --trace --distro arm64v8/debian --release "${{ matrix.release }}" --cfg config/arm.yml
100+
run: ./tests/local.sh --build --trace --distro arm64v8/debian --release "${{ matrix.release }}" --cfg config/arm-debian.yml

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Effortless way to setup your fresh Ubuntu, Linux Mint and Debian installation.
88
[![netlify][netlify-badge]][netlify]
99
[![version][version]][changelog]
1010
[![license][gpl-badge]][license]
11-
![dl](https://img.shields.io/github/downloads/tprasadtp/ubuntu-post-install/total?logo=github&label=DL)
1211

1312
![Bash](https://static.prasadt.com/logo64/bash.png)
1413

@@ -98,6 +97,7 @@ Also handles adding several tweaks and fixes necessary to add repositories and P
9897
| ----------------------- | ----------------- | ------------------------------------------------------------ |
9998
| [Brave Browser][] | brave_browser | brave-browser |
10099
| Docker | docker | docker-ce, docker-ce-rootless-extras, docker-ce-cli |
100+
| [Element.io][element] | element_io | element-desktop
101101
| [GitHub - CLI][] | github | gh |
102102
| [Google - Bazel][] | bazel | bazel |
103103
| Google - Chrome | chrome | google-chrome-stable, google-chrome-beta |
@@ -144,8 +144,6 @@ See [Contributing and forks](/CONTRIBUTING.md)
144144
- [snwh/ubuntu-post-install](https://github.com/snwh/ubuntu-post-install): Has few features like setting up dotfiles, but has limited config options and requires shell to be interactive. Only few external repositories are supported.
145145
- [Ansible](https://ansible.com) : Requires python on your system. Much more deteministic and better idempotency. There are plenty of roles and collections available on ansible-galaxy. But it adds more complexity and you have to write your own playbooks.
146146

147-
![Analytics](https://ga-beacon.prasadt.com/UA-101760811-3/github/ubuntu-post-install?flat)
148-
149147
[FAQ]: https://ae.prasadt.com/faq/dependencies/
150148
[docs]: https://ae.prasadt.com/
151149
[known-issues]: https://ae.prasadt.com/faq/errors/
@@ -172,6 +170,7 @@ See [Contributing and forks](/CONTRIBUTING.md)
172170
[license]: https://github.com/tprasadtp/ubuntu-post-install/blob/master/LICENSE
173171

174172
[Brave Browser]: https://brave.com/linux/
173+
[element]: https://element.io
175174
[GitHub - CLI]: https://cli.github.com
176175
[Google - gVisor]: https://gvisor.dev
177176
[Miniconda]: https://www.anaconda.com/blog/rpm-and-debian-repositories-for-miniconda

after-effects

Lines changed: 59 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ function term_exit_handler() {
115115
# error did not lead to exit but we will exit with non zero indicating error occured
116116
# otherwise dont alter it
117117
if [[ $exit_code -eq 0 ]]; then
118-
return 1
118+
exit 1
119119
fi
120120
done
121121
else
@@ -236,7 +236,7 @@ function __logger_core() {
236236
;;
237237
error)
238238
declare -r lvl_str="ERROR"
239-
declare -r lvl_sym=""
239+
declare -r lvl_sym=""
240240
declare -r lvl_color="${AE_COLOR_RED}"
241241
;;
242242
critical)
@@ -410,8 +410,8 @@ function __setup_platform_vars() {
410410
readonly AE_UBUNTU_CODENAME_LATEST_LTS="focal"
411411
readonly AE_UBUNTU_CODENAME_PREV_LTS="bionic"
412412

413-
readonly AE_DEBIAN_CODENAME_LATEST="buster"
414-
readonly AE_DEBIAN_CODENAME_UPCOMING="bullseye"
413+
readonly AE_DEBIAN_CODENAME_LATEST="bullseye"
414+
readonly AE_DEBIAN_CODENAME_UPCOMING="bookworm"
415415

416416
#============================ Switches/ booleans & Vars ================================
417417

@@ -1092,6 +1092,7 @@ function _set_yaml_config() {
10921092
_check_bool "AE_RUN_CONFIG_REPO_PROTONVPN" "${AE_RUN__config__add_repo__protonvpn[0]}"
10931093
_check_bool "AE_RUN_CONFIG_REPO_NEURODEBIAN" "${AE_RUN__config__add_repo__neurodebian[0]}"
10941094
_check_bool "AE_RUN_CONFIG_REPO_MINICONDA" "${AE_RUN__config__add_repo__miniconda[0]}"
1095+
_check_bool "AE_RUN_CONFIG_REPO_ELEMENT_IO" "${AE_RUN__config__add_repo__element_io[0]}"
10951096

10961097
# Debian Components
10971098
_check_bool "AE_RUN_CONFIG_REPO_DEBIAN_NONFREE" "${AE_RUN__config__add_repo__debian_nonfree[0]}"
@@ -1291,7 +1292,7 @@ function _fix_repo_not_available() {
12911292
# (may not be LTS) for adding repository
12921293

12931294
log_debug "Check and apply codename fixes"
1294-
if [ "$AE_RUN_FIX" == "true" ]; then
1295+
if [[ $AE_RUN_FIX == "true" ]] && [[ $AE_RUN_IS_DEBIAN != "true" ]]; then
12951296
# Check LTS fallback flag is being used
12961297
# if running on current LTS, and fix mode is LTS fallback to last LTS.
12971298
if [[ $AE_RUN_FIX_MODE_LTS == "true" ]] && [[ $AE_RUN_CODENAME == "${AE_UBUNTU_CODENAME_LATEST_LTS}" ]]; then
@@ -1303,7 +1304,7 @@ function _fix_repo_not_available() {
13031304
elif [[ $AE_RUN_FIX_MODE_LTS != "true" ]] && [[ $AE_RUN_CODENAME == "${AE_UBUNTU_CODENAME_LATEST}" ]]; then
13041305
log_warn "Using previous release ${AE_UBUNTU_CODENAME_PREV} as fallback"
13051306

1306-
# fallback is non LTS so it might disapper/become unsupported! warn
1307+
# fallback is non LTS so it might disapper/become unsupported!
13071308
if [[ $AE_UBUNTU_CODENAME_PREV != "$AE_UBUNTU_CODENAME_LATEST_LTS" ]]; then
13081309
log_warn "Fallback Ubuntu (${AE_UBUNTU_CODENAME_LATEST}) is a non LTS release!"
13091310
fi
@@ -1437,7 +1438,8 @@ function add_ppas() {
14371438
fi
14381439
done
14391440
else
1440-
log_error "This is Debian. PPAs are not available."
1441+
log_error "PPAs are not supported on Debian!"
1442+
AE_RUN_STACK_ERR+=("config-error:config.tasks.ppa")
14411443
fi
14421444

14431445
}
@@ -1629,10 +1631,12 @@ deb https://desktop-download.mendeley.com/download/apt stable main"
16291631
log_success "OK"
16301632
else
16311633
log_error "Adding Google Chrome Repository failed"
1634+
AE_RUN_STACK_ERR+=("add-repo-error:config.add_repo.chrome")
16321635
fi
16331636

16341637
else
16351638
log_error "Google Chrome is not supported on this architecture($AE_ARCH)"
1639+
AE_RUN_STACK_ERR+=("add-repo-unsupported:config.add_repo.chrome")
16361640
fi
16371641
else
16381642
log_debug "Skipped Google chrome repository"
@@ -1653,6 +1657,7 @@ deb https://desktop-download.mendeley.com/download/apt stable main"
16531657
fi
16541658
else
16551659
log_error "Spotify Desktop is not supported on this architecture(${AE_ARCH})"
1660+
AE_RUN_STACK_ERR+=("add-repo-unsupported:config.add_repo.spotify")
16561661
fi
16571662
else
16581663
log_debug "Skipped adding Spotify repository"
@@ -1673,6 +1678,7 @@ deb https://desktop-download.mendeley.com/download/apt stable main"
16731678
fi
16741679
else
16751680
log_error "Skype for Linux is not supported on this architecture(${AE_ARCH})"
1681+
AE_RUN_STACK_ERR+=("add-repo-unsupported:config.add_repo.skype")
16761682
fi
16771683
else
16781684
log_debug "Skipped Skype for Linux."
@@ -1692,7 +1698,8 @@ deb https://desktop-download.mendeley.com/download/apt stable main"
16921698
log_error "Failed to addd Signal for desktop repository!"
16931699
fi
16941700
else
1695-
log_error "Signal for Desktop is not supported on this architecture(${AE_ARCH})"
1701+
log_error "Signal for Desktop is not supported on this (${AE_ARCH})"
1702+
AE_RUN_STACK_ERR+=("add-repo-unsupported:config.add_repo.signal")
16961703
fi
16971704
else
16981705
log_debug "Skipped adding Signal for desktop repository"
@@ -1713,6 +1720,7 @@ deb https://desktop-download.mendeley.com/download/apt stable main"
17131720
fi
17141721
else
17151722
log_error "Mendeley Desktop is not supported on this architecture(${AE_ARCH})"
1723+
AE_RUN_STACK_ERR+=("add-repo-unsupported:config.add_repo.mendeley")
17161724
fi
17171725

17181726
else
@@ -1728,6 +1736,7 @@ deb https://desktop-download.mendeley.com/download/apt stable main"
17281736
log_error "Latest version of WINE depends on libfaudio0 package,"
17291737
log_error "which is not available on your distribution!"
17301738
log_warn "For more information visit https://forum.winehq.org/viewtopic.php?f=8&t=32192"
1739+
AE_RUN_STACK_ERR+=("add-repo-unsupported:config.add_repo.winehq")
17311740
else
17321741
__add_repo_keys --format "asc" \
17331742
--file-prefix "wine-hq" \
@@ -1747,6 +1756,7 @@ deb https://desktop-download.mendeley.com/download/apt stable main"
17471756
fi
17481757
else
17491758
log_error "WineHQ is not supported on this architecture(${AE_ARCH})"
1759+
AE_RUN_STACK_ERR+=("add-repo-unsupported:config.add_repo.winehq")
17501760
fi
17511761
else
17521762
log_info "Skipped adding WineHQ."
@@ -1787,6 +1797,7 @@ deb https://desktop-download.mendeley.com/download/apt stable main"
17871797
fi
17881798
else
17891799
log_error "GCSFUSE is not supported on this architecture(${AE_ARCH})"
1800+
AE_RUN_STACK_ERR+=("add-repo-unsupported:config.add_repo.gcsfuse")
17901801
fi
17911802

17921803
else
@@ -1877,6 +1888,7 @@ deb https://desktop-download.mendeley.com/download/apt stable main"
18771888
fi
18781889
else
18791890
log_error "Microsoft Edge is not supported on this architecture($AE_ARCH)!"
1891+
AE_RUN_STACK_ERR+=("add-repo-unsupported:config.add_repo.edge")
18801892
fi
18811893
else
18821894
log_debug "Skipped adding Microsoft Edge repository"
@@ -1893,6 +1905,7 @@ deb https://desktop-download.mendeley.com/download/apt stable main"
18931905
fi
18941906
else
18951907
log_error "Microsoft Teams is not supported on this architecture($AE_ARCH)!"
1908+
AE_RUN_STACK_ERR+=("add-repo-unsupported:config.add_repo.teams")
18961909
fi
18971910
else
18981911
log_debug "Skipped adding Microsoft Teams repository"
@@ -1949,6 +1962,7 @@ deb https://desktop-download.mendeley.com/download/apt stable main"
19491962

19501963
else
19511964
log_error "Hashicorp repository is not supported on this architecture($AE_ARCH)!"
1965+
AE_RUN_STACK_ERR+=("add-repo-unsupported:config.add_repo.hashicorp")
19521966
fi
19531967
else
19541968
log_debug "Skipped adding Hashicorp repository"
@@ -1970,6 +1984,7 @@ deb https://desktop-download.mendeley.com/download/apt stable main"
19701984

19711985
else
19721986
log_error "Bazel repository is not supported on this architecture($AE_ARCH)!"
1987+
AE_RUN_STACK_ERR+=("add-repo-unsupported:config.add_repo.bazel")
19731988
fi
19741989
else
19751990
log_debug "Skipped adding Bazel repository"
@@ -1995,6 +2010,7 @@ deb https://desktop-download.mendeley.com/download/apt stable main"
19952010
else
19962011
log_error "gVisor is not supported on this architecture(${AE_ARCH})"
19972012
log_dev "Visit https://gvisor.dev/ for more info"
2013+
AE_RUN_STACK_ERR+=("add-repo-unsupported:config.add_repo.gvisor")
19982014
fi
19992015

20002016
else
@@ -2020,10 +2036,7 @@ deb https://desktop-download.mendeley.com/download/apt stable main"
20202036

20212037
else
20222038
log_error "Podman is not supported on ${AE_DISTRO_NAME}/${AE_ARCH}"
2023-
if [[ ${AE_RUN_DISTRO_NAME} == "debian" ]]; then
2024-
log_warn "Podman depends on libseccomp2 from backports repository."
2025-
log_warn "See https://podman.io/getting-started/installation."
2026-
fi
2039+
AE_RUN_STACK_ERR+=("add-repo-unsupported:config.add_repo.podman")
20272040
fi
20282041

20292042
else
@@ -2047,6 +2060,7 @@ deb https://desktop-download.mendeley.com/download/apt stable main"
20472060

20482061
else
20492062
log_error "SublimeText repository is not supported on this architecture($AE_ARCH)!"
2063+
AE_RUN_STACK_ERR+=("add-repo-unsupported:config.add_repo.sublimetext")
20502064
fi
20512065
else
20522066
log_debug "Skipped adding SublimeText repository"
@@ -2078,6 +2092,7 @@ deb https://desktop-download.mendeley.com/download/apt stable main"
20782092

20792093
else
20802094
log_error "Brave Browser repository is not supported on this architecture($AE_ARCH)!"
2095+
AE_RUN_STACK_ERR+=("add-repo-unsupported:config.add_repo.brave_browser")
20812096
fi
20822097
else
20832098
log_debug "Skipped adding Brave Browser repository"
@@ -2103,11 +2118,12 @@ deb https://desktop-download.mendeley.com/download/apt stable main"
21032118
if echo "deb [arch=amd64 signed-by=${AE_APT_KEYRINGS_DIR}/slack-archive-keyring.gpg] https://packagecloud.io/slacktechnologies/slack/debian/ jessie main #Slack" >${AE_APT_SOURCES_DIR}/slack.list; then
21042119
log_success "OK"
21052120
else
2106-
log_error "Failed to add Brave Browser repository"
2121+
log_error "Failed to add Slack repository"
21072122
fi
21082123

21092124
else
21102125
log_error "Slack is not supported on this architecture($AE_ARCH)!"
2126+
AE_RUN_STACK_ERR+=("add-repo-unsupported:config.add_repo.slack")
21112127
fi
21122128
else
21132129
log_debug "Skipped adding Slack repository"
@@ -2139,6 +2155,8 @@ deb https://desktop-download.mendeley.com/download/apt stable main"
21392155

21402156
else
21412157
log_error "Vivaldi Browser repository is not supported on this architecture($AE_ARCH)!"
2158+
AE_RUN_STACK_ERR+=("add-repo-unsupported:config.add_repo.vivaldi")
2159+
21422160
fi
21432161
else
21442162
log_debug "Skipped adding Vivaldi Browser repository"
@@ -2179,7 +2197,7 @@ deb https://desktop-download.mendeley.com/download/apt stable main"
21792197
fi
21802198
else
21812199
log_error "Miniconda repository is not supported on this architecture($AE_ARCH)!"
2182-
AE_RUN_STACK_ERR+=("repo-unsupported-error::config.add_repo.miniconda")
2200+
AE_RUN_STACK_ERR+=("add-repo-unsupported:config.add_repo.miniconda")
21832201
fi
21842202
else
21852203
log_debug "Skipped adding Miniconda repository"
@@ -2206,12 +2224,35 @@ deb [signed-by=${AE_APT_KEYRINGS_DIR}/neurodebian-archive-keyring.gpg] http://ne
22062224
fi
22072225
else
22082226
log_error "NeuroDebian repository is not supported on this architecture($AE_ARCH)!"
2209-
AE_RUN_STACK_ERR+=("repo-unsupported-error::config.add_repo.neurodebian")
2227+
AE_RUN_STACK_ERR+=("add-repo-unsupported::config.add_repo.neurodebian")
22102228
fi
22112229
else
22122230
log_debug "Skipped adding NeuroDebian repository"
22132231
fi
22142232

2233+
# Element (riot.im)
2234+
if [[ $AE_RUN_CONFIG_REPO_ELEMENT_IO == "true" ]]; then
2235+
if [ "$AE_ARCH" == "amd64" ]; then
2236+
log_info "Element / Riot (Matrix Client)"
2237+
__add_repo_keys \
2238+
--format "gpg" \
2239+
--file-prefix "element-io-archive-keyring" \
2240+
--key-url "https://packages.riot.im/debian/riot-im-archive-keyring.gpg"
2241+
2242+
if echo "deb [signed-by=/usr/share/keyrings/element-io-archive-keyring.gpg] https://packages.riot.im/debian/ default main #element.io" >${AE_APT_SOURCES_DIR}/element-io.list; then
2243+
log_success "OK"
2244+
else
2245+
log_error "Failed to add Element.io/Riot.im repository"
2246+
AE_RUN_STACK_ERR+=("repo-add-error::config.add_repo.element")
2247+
fi
2248+
else
2249+
log_error "NeuElement.io/Riot.imroDebian repository is not supported on this architecture($AE_ARCH)!"
2250+
AE_RUN_STACK_ERR+=("add-repo-unsupported::config.add_repo.element")
2251+
fi
2252+
else
2253+
log_debug "Skipped adding Element.io/Riot.im repository"
2254+
fi
2255+
22152256
# ROS2
22162257
# Arch support varies on distro so lot of ugly elifs.
22172258
ros2_supported="false"
@@ -2566,6 +2607,7 @@ function purge_not_required() {
25662607
if [[ $exit_status -eq 0 ]]; then
25672608
log_success "Done!"
25682609
else
2610+
AE_RUN_STACK_ERR+=("install-error::config.purge")
25692611
log_error "Something went wrong while purging packages."
25702612
log_error "Please see the log file for more details."
25712613
fi
@@ -2631,6 +2673,7 @@ function install_apps() {
26312673
if [[ $exit_status -eq 0 ]]; then
26322674
log_success "Done!"
26332675
else
2676+
AE_RUN_STACK_ERR+=("install-error::config.install.apt.${array}")
26342677
log_error "Something went wrong while installing packages in set - $array."
26352678
log_error "Please see the log file for more details."
26362679
fi
@@ -2933,6 +2976,7 @@ function _process_menu() {
29332976
-------------------------------------------------------
29342977
Brave Browser : $AE_RUN_CONFIG_REPO_BRAVE_BROWSER
29352978
Docker Community Edition : $AE_RUN_CONFIG_REPO_DOCKER
2979+
Element.io/Riot.im : $AE_RUN_CONFIG_REPO_ELEMENT_IO
29362980
GitHub CLI : $AE_RUN_CONFIG_REPO_GH
29372981
Google - Bazel : $AE_RUN_CONFIG_REPO_BAZEL
29382982
Google - Chrome : $AE_RUN_CONFIG_REPO_CHROME

0 commit comments

Comments
 (0)