2024-06-26 02:42:21 -04:00
|
|
|
#!/bin/sh
|
2024-05-25 01:12:32 -04:00
|
|
|
|
2025-01-27 10:06:24 -05:00
|
|
|
# Copyright (C) 2024-2025 Thien Tran
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
|
|
|
# use this file except in compliance with the License. You may obtain a copy of
|
|
|
|
# the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
# License for the specific language governing permissions and limitations under
|
|
|
|
# the License.
|
|
|
|
|
2024-11-12 03:36:55 -05:00
|
|
|
set -eu
|
2024-07-03 05:19:13 -04:00
|
|
|
|
2024-05-25 01:12:32 -04:00
|
|
|
unpriv(){
|
2024-11-12 00:07:11 -05:00
|
|
|
sudo -u nobody "${@}"
|
|
|
|
}
|
|
|
|
|
|
|
|
download() {
|
|
|
|
unpriv curl -s --proxy http://127.0.0.1:8082 "${1}" | sudo tee "${2}" > /dev/null
|
2024-05-25 01:12:32 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
umask 022
|
|
|
|
|
|
|
|
sudo mkdir -p /etc/qubes-bind-dirs.d
|
|
|
|
echo 'binds+=( '\'''/etc/loki''\'' )' | sudo tee /etc/qubes-bind-dirs.d/50_user.conf
|
|
|
|
|
2024-11-12 09:47:48 -05:00
|
|
|
# Add repositories
|
2024-11-12 00:07:11 -05:00
|
|
|
download https://deb.oxen.io/pub.gpg /usr/share/keyrings/oxen.gpg
|
2024-05-25 01:12:32 -04:00
|
|
|
echo "deb [signed-by=/usr/share/keyrings/oxen.gpg] https://deb.oxen.io $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/oxen.list
|
|
|
|
|
2024-11-12 09:57:33 -05:00
|
|
|
download https://repository.mullvad.net/deb/mullvad-keyring.asc /usr/share/keyrings/mullvad-keyring.asc
|
2024-11-12 09:47:48 -05:00
|
|
|
echo "deb [signed-by=/usr/share/keyrings/mullvad-keyring.asc arch=$( dpkg --print-architecture )] https://repository.mullvad.net/deb/stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/mullvad.list
|
|
|
|
|
|
|
|
# Install packages
|
2024-05-25 01:12:32 -04:00
|
|
|
sudo apt update
|
2024-11-12 09:57:33 -05:00
|
|
|
sudo apt install -y lokinet mullvad-browser resolvconf
|
2024-05-25 01:12:32 -04:00
|
|
|
|
2024-11-12 00:07:11 -05:00
|
|
|
download https://raw.githubusercontent.com/TommyTran732/QubesOS-Scripts/main/etc/systemd/system/lokinet-dns-fix.service /etc/systemd/system/lokinet-dns-fix.service
|
2024-11-12 09:47:48 -05:00
|
|
|
sudo systemctl enable --now lokinet-dns-fix
|