Skip to content

Commit

Permalink
v1.9.7: update domains, deprecate updater.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
astro committed Jan 30, 2024
1 parent 41f827c commit 431a541
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 64 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test
name: Test in Ubuntu/Mac/Alpine

on:
push:
Expand All @@ -25,8 +25,8 @@ jobs:
run: $GITHUB_WORKSPACE/hosty.sh -di
- name: Run hosty updater in debug mode
run: $GITHUB_WORKSPACE/updater.sh -d
- name: Run hosty installer answering n/n
run: expect -c "spawn $GITHUB_WORKSPACE/install.sh; expect \"y/n\r\"; send -- \"n\r\"; expect \"y/n\r\"; send -- \"n\r\"; expect \"done.\r\"; expect eof"
- name: Run hosty installer answering n
run: expect -c "spawn $GITHUB_WORKSPACE/install.sh; expect \"y/n\r\"; send -- \"n\r\"; expect \"done.\r\"; expect eof"
- name: Run hosty installer without sudo and with cat
run: expect -c "spawn sh -c {cat $GITHUB_WORKSPACE/install.sh | sh}; expect \"y/n\r\"; send -- \"y\r\"; expect \"y/n\r\"; send -- \"y\r\"; expect \"or 'never':\r\"; send -- \"daily\r\"; expect \"done.\r\"; expect eof"
- name: Run hosty installer without sudo
Expand Down Expand Up @@ -54,8 +54,8 @@ jobs:
run: $GITHUB_WORKSPACE/hosty.sh -di
- name: Run hosty updater in debug mode
run: $GITHUB_WORKSPACE/updater.sh -d
- name: Run hosty installer answering n/n
run: expect -c "spawn $GITHUB_WORKSPACE/install.sh; expect \"y/n\r\"; send -- \"n\r\"; expect \"y/n\r\"; send -- \"n\r\"; expect \"done.\r\"; expect eof"
- name: Run hosty installer answering n
run: expect -c "spawn $GITHUB_WORKSPACE/install.sh; expect \"y/n\r\"; send -- \"n\r\"; expect \"done.\r\"; expect eof"
- name: Run hosty installer without sudo and with cat
run: expect -c "spawn sh -c {cat $GITHUB_WORKSPACE/install.sh | sh}; expect \"y/n\r\"; send -- \"y\r\"; expect \"y/n\r\"; send -- \"y\r\"; expect \"or 'never':\r\"; send -- \"daily\r\"; expect \"done.\r\"; expect eof"
- name: Run hosty installer without sudo
Expand Down Expand Up @@ -86,8 +86,8 @@ jobs:
run: $GITHUB_WORKSPACE/hosty.sh -di
- name: Run hosty updater in debug mode
run: $GITHUB_WORKSPACE/updater.sh -d
- name: Run hosty installer answering n/n
run: expect -c "spawn $GITHUB_WORKSPACE/install.sh; expect \"y/n\r\"; send -- \"n\r\"; expect \"y/n\r\"; send -- \"n\r\"; expect \"done.\r\"; expect eof"
- name: Run hosty installer answering n
run: expect -c "spawn $GITHUB_WORKSPACE/install.sh; expect \"y/n\r\"; send -- \"n\r\"; expect \"done.\r\"; expect eof"
- name: Run hosty installer without sudo and with cat
run: expect -c "spawn sh -c {cat $GITHUB_WORKSPACE/install.sh | sh}; expect \"y/n\r\"; send -- \"y\r\"; expect \"y/n\r\"; send -- \"y\r\"; expect \"or 'never':\r\"; send -- \"daily\r\"; expect \"done.\r\"; expect eof"
- name: Run hosty installer without sudo
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 astro
Copyright (c) 2024 4st.li

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
16 changes: 4 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,26 @@ In the predefined list we don't accept political censorship or paternalistic goa

- curl
- awk
- gpg (optional for automatic hosty version update)
- crontab (optional for automatic hosts file update)

### Install the requirements

- **Ubuntu/Mint/Pop/Debian:**
`$ sudo apt install curl gawk gnupg cron`
`$ sudo apt install curl gawk cron`

- **Arch/Manjaro/Endeavour:**
`$ sudo pacman -S --needed curl gawk gnupg cronie`
`$ sudo pacman -S --needed curl gawk cronie`

- **Fedora/RHEL/Rocky:**
`$ sudo dnf in curl gawk gnupg2 cronie`

- **Mac:**
`$ brew install gnupg`
`$ sudo dnf in curl gawk cronie`

### Install hosty

Just run:

`$ curl -L https://4st.li/hosty/install.sh | sh`

The installer will ask you if you want to always run the latest version of hosty code, to achieve this, code updates are downloaded from this repository in each execution. A verification mechanism is included, hosty will make sure automatically that the updates are signed by me.

Still, you may not like to trust me, you can also install hosty without automatic code updates and manually check if updates are available.

You will also be asked if you want to automatically run hosty to update your hosts file with the latest domains list.
You will be asked if you want to automatically run hosty to update your hosts file with the latest domains list.

## Run hosty

Expand Down
12 changes: 6 additions & 6 deletions hosty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

set -euf

VERSION="1.9.6"
RELEASE_DATE="08/sep/22"
PROJECT_URL="astrolince.com/hosty"
BLACKLIST_DEFAULT_SOURCE="https://raw.githubusercontent.com/astrolince/hosty/master/lists/blacklist.sources"
WHITELIST_DEFAULT_SOURCE="https://raw.githubusercontent.com/astrolince/hosty/master/lists/whitelist.sources"
VERSION="1.9.7"
RELEASE_DATE="29/jan/24"
PROJECT_URL="4st.li/hosty"
BLACKLIST_DEFAULT_SOURCE="https://4st.li/hosty/lists/blacklist.sources"
WHITELIST_DEFAULT_SOURCE="https://4st.li/hosty/lists/whitelist.sources"
BLOCK_IP="0.0.0.0"
INPUT_HOSTS="/etc/hosts"
OUTPUT_HOSTS="/etc/hosts"
Expand Down Expand Up @@ -156,7 +156,7 @@ checkDep sort
checkDep grep

echo "======== hosty v$VERSION ($RELEASE_DATE) ========"
echo "======== $PROJECT_URL ========"
echo "======== $PROJECT_URL ========"
echo

# avoid all system changes if debug mode is enabled
Expand Down
26 changes: 13 additions & 13 deletions hosty.sh.sig
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEERngJi/V4PT9dUG62zDnG13vfAFMFAmMaWSoACgkQzDnG13vf
AFOvPg//WoZAh3VPaqyETEfdPYO1jTLu8R6QIgshJVE6WHVP2Ho8W9Sswd3k/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twL5IAT7R1FPVOGSLappDPN
UlBy4dQqYeP3tcpwrvF3KR7TGc8NmM9eMuAHubHyrWUk8xq8yyiFyQs/Tyf9Hoaz
K5l0/6ss/YWDO0NYoCK22iOac6JzrmjbKQueOkZ+ytgCjP+KqoBfUnOT7oVH78d0
5HnxNhu4O8/at1v5vT1E3S+aGAF/2nUiMhWNj0B5XMuknECInqi+V9LkF4U4wSmx
zN44hXCzp0oC1YND+MubHHf6xvyP4PExGon4mTN0S5FNPjy3GvqmlYZPWRP4FaYg
m6rHbW9xp33FwBcM9w2iXaPdJkL6XLtQwk9T0TnQsi9aJCFlCN8=
=rbA+
-----END PGP SIGNATURE-----
29 changes: 6 additions & 23 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ checkDep() {
checkDep curl

echo "======== welcome to hosty installer ========"
echo "======== astrolince.com/hosty ========"
echo "======== 4st.li/hosty ========"
echo
echo "checking if user has root access..."

Expand Down Expand Up @@ -47,30 +47,13 @@ if [ -f /usr/local/bin/hosty ]; then
echo
fi

echo "do you want to always run the latest version of hosty? (recommended) y/n"
read -r answer </dev/tty
echo

if [ "$answer" = "y" ] || [ "$answer" = "Y" ] || [ "$answer" = "yes" ] || [ "$answer" = "YES" ]; then
echo "installing hosty..."
if [ "$REQUEST_SUDO" = 1 ]; then
sudo curl -L --retry 3 -o /usr/local/bin/hosty https://raw.githubusercontent.com/astrolince/hosty/master/updater.sh
else
curl -L --retry 3 -o /usr/local/bin/hosty https://raw.githubusercontent.com/astrolince/hosty/master/updater.sh
fi
echo
elif [ "$answer" = "n" ] || [ "$answer" = "N" ] || [ "$answer" = "no" ] || [ "$answer" = "NO" ]; then
echo "installing hosty..."
if [ "$REQUEST_SUDO" = 1 ]; then
sudo curl -L --retry 3 -o /usr/local/bin/hosty https://raw.githubusercontent.com/astrolince/hosty/master/hosty.sh
else
curl -L --retry 3 -o /usr/local/bin/hosty https://raw.githubusercontent.com/astrolince/hosty/master/hosty.sh
fi
echo
echo "installing hosty..."
if [ "$REQUEST_SUDO" = 1 ]; then
sudo curl -L --retry 3 -o /usr/local/bin/hosty https://4st.li/hosty/hosty.sh
else
echo "bad answer, exiting..."
exit 1
curl -L --retry 3 -o /usr/local/bin/hosty https://4st.li/hosty/hosty.sh
fi
echo

echo "fixing permissions..."
if [ "$REQUEST_SUDO" = 1 ]; then
Expand Down
4 changes: 2 additions & 2 deletions updater.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ downloadFile() {

# download files
downloadFile "$astrokeys" https://keybase.io/astrolince/pgp_keys.asc
downloadFile "$hosty" https://raw.githubusercontent.com/astrolince/hosty/master/hosty.sh
downloadFile "$signature" https://raw.githubusercontent.com/astrolince/hosty/master/hosty.sh.sig
downloadFile "$hosty" https://4st.li/hosty/hosty.sh
downloadFile "$signature" https://4st.li/hosty/hosty.sh.sig

# verify signature
gpg --dearmor "$astrokeys" >/dev/null 2>&1
Expand Down

0 comments on commit 431a541

Please sign in to comment.