Skip to content
30 changes: 27 additions & 3 deletions ansible/roles/network/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,18 @@
regexp: '^Identity=.*'
replace: "Identity=unix-group:netdev;unix-group:sudo:{{ lookup('env', 'USER') }}"
dest: /var/lib/polkit-1/localauthority/10-vendor.d/org.freedesktop.NetworkManager.pkla
when: manage_network|bool
when:
- manage_network|bool
- ansible_distribution_major_version|int <= 12

- name: Set ResultAny to yes
ansible.builtin.replace:
regexp: '^ResultAny=.*'
replace: 'ResultAny=yes'
dest: /var/lib/polkit-1/localauthority/10-vendor.d/org.freedesktop.NetworkManager.pkla
when: manage_network|bool
when:
- manage_network|bool
- ansible_distribution_major_version|int <= 12

- name: Get stat of org.freedesktop.NetworkManager.pkla
ansible.builtin.stat:
Expand All @@ -87,9 +91,29 @@
mkdir -p /etc/polkit-1/localauthority/50-local.d
cp -f /var/lib/polkit-1/localauthority/10-vendor.d/org.freedesktop.NetworkManager.pkla \
/etc/polkit-1/localauthority/50-local.d
when: manage_network|bool
when:
- manage_network|bool
- ansible_distribution_major_version|int <= 12
changed_when: not nm_pkla_path.stat.exists

- name: Create polkit rules for NetworkManager (Trixie+)
ansible.builtin.copy:
dest: /etc/polkit-1/rules.d/50-network-manager.rules
owner: root
group: root
mode: "0644"

Check warning on line 104 in ansible/roles/network/tasks/main.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make sure granting access to others is safe here.

See more on https://sonarcloud.io/project/issues?id=Screenly_screenly-ose&issues=AZ1pQgNngHnljGtNk9aC&open=AZ1pQgNngHnljGtNk9aC&pullRequest=2732
content: |
polkit.addRule(function(action, subject) {
if (action.id.indexOf("org.freedesktop.NetworkManager.") === 0 &&
(subject.isInGroup("netdev") || subject.isInGroup("sudo") ||
subject.user === "{{ lookup('env', 'USER') }}")) {
return polkit.Result.YES;
}
});
when:
- manage_network|bool
- ansible_distribution_major_version|int >= 13

- name: Disable dhcpcd
ansible.builtin.systemd:
state: stopped
Expand Down
29 changes: 15 additions & 14 deletions ansible/roles/system/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -257,20 +257,21 @@
- docker-compose
state: absent

- name: Add Docker apt key (x86)
ansible.builtin.apt_key:
url: https://download.docker.com/linux/debian/gpg
state: present
when: ansible_architecture == "x86_64"
- name: Create keyrings directory
ansible.builtin.file:
path: /etc/apt/keyrings
state: directory
owner: root
group: root
mode: "0755"

Check warning on line 266 in ansible/roles/system/tasks/main.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make sure granting access to others is safe here.

See more on https://sonarcloud.io/project/issues?id=Screenly_screenly-ose&issues=AZ1pLWz-gHnljGtNkdeE&open=AZ1pLWz-gHnljGtNkdeE&pullRequest=2732

- name: Add Docker apt key (Raspberry Pi)
ansible.builtin.apt_key:
url: https://download.docker.com/linux/raspbian/gpg
state: present
when: |
ansible_architecture == "aarch64" or
ansible_architecture == "armv7l" or
ansible_architecture == "armv6l"
- name: Add Docker apt key
ansible.builtin.get_url:
url: https://download.docker.com/linux/debian/gpg
dest: /etc/apt/keyrings/docker.asc
owner: root
group: root
mode: "0644"

Check warning on line 274 in ansible/roles/system/tasks/main.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make sure granting access to others is safe here.

See more on https://sonarcloud.io/project/issues?id=Screenly_screenly-ose&issues=AZ1pLWz-gHnljGtNkdeF&open=AZ1pLWz-gHnljGtNkdeF&pullRequest=2732

- name: Get Debian name
ansible.builtin.command: lsb_release -cs
Expand Down Expand Up @@ -306,7 +307,7 @@
ansible.builtin.lineinfile:
path: /etc/apt/sources.list.d/docker.list
create: true
line: "deb [arch={{ architecture }}] https://download.docker.com/linux/debian {{ debian_name.stdout }} stable"
line: "deb [arch={{ architecture }} signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian {{ debian_name.stdout }} stable"
state: present
owner: root
group: root
Expand Down
33 changes: 5 additions & 28 deletions bin/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

set -euo pipefail

BRANCH="master"
BRANCH="feat/trixie-support"
ANSIBLE_PLAYBOOK_ARGS=()
REPOSITORY="https://github.com/Screenly/Anthias.git"
REPOSITORY="https://github.com/nicomiguelino/Anthias.git"
ANTHIAS_REPO_DIR="/home/${USER}/screenly"
GITHUB_API_REPO_URL="https://api.github.com/repos/Screenly/Anthias"
GITHUB_RELEASES_URL="https://github.com/Screenly/Anthias/releases"
GITHUB_RAW_URL="https://raw.githubusercontent.com/Screenly/Anthias"
GITHUB_RAW_URL="https://raw.githubusercontent.com/nicomiguelino/Anthias"
DOCKER_TAG="latest"
UPGRADE_SCRIPT_PATH="${ANTHIAS_REPO_DIR}/bin/upgrade_containers.sh"
ARCHITECTURE=$(uname -m)
Expand Down Expand Up @@ -363,31 +363,8 @@ function main() {

display_banner "${TITLE_TEXT}"

gum format "${INTRO_MESSAGE[@]}"
echo
gum confirm "Do you still want to continue?" || exit 0
gum confirm "${MANAGE_NETWORK_PROMPT[@]}" && \
export MANAGE_NETWORK="Yes" || \
export MANAGE_NETWORK="No"

VERSION=$(
gum choose \
--header "${VERSION_PROMPT}" \
-- "${VERSION_PROMPT_CHOICES[@]}"
)

if [ "$VERSION" == "latest" ]; then
BRANCH="master"
else
set_custom_version
fi

gum confirm "${SYSTEM_UPGRADE_PROMPT[@]}" && {
SYSTEM_UPGRADE="Yes"
} || {
SYSTEM_UPGRADE="No"
ANSIBLE_PLAYBOOK_ARGS+=("--skip-tags" "system-upgrade")
}
export MANAGE_NETWORK="Yes"
SYSTEM_UPGRADE="Yes"

display_section "User Input Summary"
gum format "**Manage Network:** ${MANAGE_NETWORK}"
Expand Down
Loading