Re: [tor-relays] Tor on Rpi (relay.jack...@simplelogin.fr)

2021-02-11 Thread Patrice Bönig

Hello Patrice

would be great if you can share your script , thanks.




Hi,

sure, with pleasure. But I have to say I am not a professional 
programmer. There are surely better ways to do this, but it works for me.

Before you can use it you have to make it executable with this command:

chmod +x build_tor_from_source.sh

And make sure to read the info in the script.

After that you are ready to roll.


regards

Patrice


## build_tor_from_source.sh


###
## This script is for a automatic installation of tor out of the sources.


## What it will do:
#
# 1. It downloads the newest tarball, compiles and installs it.
# 2. It copies the data dir (with the keys) and the torrc.
# 3. It removes all installations files.
# 4. It starts tor as the current user
# 5. It adds tor as crontab (@bootup) of current user
# 6. changes the permissions of the tor logs, tor folder and torrc for 
the current user

# 6. At the end it shows the logs to check the tor startup process


## What are the requirements for this installation script
#
# - the torrc must be in the same folder as this script
# - check the paths used in this script if they fit for your system (the 
default paths are for Pi OS)
# - this script must be in a location where it has write permisssions 
(for example home folder of current user)



## What this script can't do
#
# Tor is not compiled wioth systemd support, so this won't work until 
you switch it on.

###

#! /bin/bash



# echo output colour #
green="tput setaf 2"
white="tput setaf 7"
yellow="tput setaf 3"
red="tput setaf 1"
#



$yellow
echo -e "\n\n"
echo -e "# Tor Installation #"
echo -e "\n"


# show tor version for comparison
$yellow
echo -e "\nTor version on the system ->"
$green
tor --version | cut -b 13-20
echo # new line
$yellow
echo -e "Tor version online available ->"
$green
lynx -nonumbers -dump https://dist.torproject.org | grep 
"https://dist.torproject.org/tor-; | grep -v "alpha" | grep -v "rc" | 
grep -v "asc" | tail -1 | cut -b 33-40



# question for installation
$red
echo -e "\n\n"
read -p "Installing new version? [y/n]: " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then


    $green
    echo -e "\nstopping tor on system...\n"
    $white
    sudo killall tor
    $green
    echo -e "\ndone.\n"


    $green
    echo -e "\nsystem update and installing needed packages...\n"
    $white
    sudo apt update
    sudo apt upgrade -y
    sudo apt install -y libevent-dev libssl-dev zlib1g-dev asciidoc lynx
    $green
    echo -e "\ndone.\n"

    $white
    build_dir="temp"
    mkdir $build_dir
    cd $build_dir # in ./temp


    $green
    echo -e "\ndownloading tor from git repo...\n"
    $white
    lynx -nonumbers -dump https://dist.torproject.org | grep 
"https://dist.torproject.org/tor-; | grep -v "alpha" | grep -v "rc" | 
grep -v "asc" | tail -1 | xargs wget

    tar -xvf tor*.tar.gz
    cd `ls -d */` # in ./temp/tor-*
    $green
    echo -e "\ndone.\n"


    $green
    echo -e "\nbacking up data dir, and changing its user..."
    $white
    sudo cp -arv /var/lib/tor ./tor
    sudo chown -R $(whoami) ./tor
    $green
    echo -e "\ndone.\n"


    $green
    echo -e "\ncompiling, removing old version, installing new 
version...\n"

    $white
    ./configure && make && sudo make uninstall && sudo make install
    $green
    echo -e "\ndone.\n"


    $green
    echo -e "\ncopying torrc and restoring data directory...\n"
    $white
    sudo cp -av ../../torrc /usr/local/etc/tor/torrc
    sudo chwon $(whoami):root /usr/local/etc/tor/torrc
    sudo cp -arv ./tor /var/lib/tor
    $green
    echo -e "\ndone.\n"


    cd .. # in ./temp
    cd .. # in ./


    $green
    echo -e "\nremoving build folder and system files...\n"
    $white
    sudo rm -R $build_dir
    sudo apt autoclean
    sudo apt autoremove
    $green
    echo -e "\ndone.\n"


    $green
    echo -e "\nadding tor as crontab to start tor on boot...\n"
    $white
    if sudo grep -q "@reboot /usr/local/bin/tor --quiet" 
/var/spool/cron/crontabs/$(whoami)

    then
    echo -e "tor is already present as crontab"
    else
    #echo -e "@reboot /usr/local/bin/tor --quiet" | sudo tee -a 
/var/spool/cron/crontabs/$(whoami)

    echo -e "tor is added as crontab"
    fi
    $green
    echo -e "\ndone.\n"


    $green
    echo -e "\nchanging user of log files...\n"
    $white
    sudo chown -R $(whoami) /var/log/tor
    $green
    echo -e "\ndone.\n"


    $green
    echo -e "\nstarting tor...\n"
    $white
    # start tor
    /usr/local/bin/tor --quiet
    echo # new line


    $yellow
    echo -e "\ntor log\n"
    $white
    sudo tail -c+1 -f /var/log/tor/notices.log


else
    $white
    exit 1
fi




Re: [tor-relays] Tor on Rpi

2021-02-09 Thread relay . jackash
Hello Patrice

would be great if you can share your script , thanks.

signature.asc
Description: OpenPGP digital signature
___
tor-relays mailing list
tor-relays@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-relays


Re: [tor-relays] Tor on Rpi

2021-02-08 Thread Roger Dingledine
On Sat, Feb 06, 2021 at 12:31:29PM -, relay.jack...@simplelogin.fr wrote:
> im running a tor relay on rpi 2 with version 0.4.2.7., on the  Tor relay 
> search i see my relay is outdated and flaged as not recomended, however on 
> rpi i have tried update and upgrade many times and always get notification 
> from apt that tor i already de newest version, also tried apt dist-upgrade 
> but no luck.
> 
> Any way to get the last version and get ride of not recomended flag from my 
> relay?

I would suggest adding buster-backports to your sources list, and then
you'll be using a more recent Tor. See this earlier post for hints:
https://archives.seul.org/tor/relays/Feb-2021/msg3.html

(You might notice that somehow that post did not make it to the official
tor-relays archives. I blame some bug in mailman, but also I will leave
that bug alone and try to move on with my life. :)

If you had said something other than rpi, I would have pointed you to
https://support.torproject.org/apt/tor-deb-repo/
but we stopped providing 32-bit arm packages on deb.torproject.org:
https://lists.torproject.org/pipermail/tor-talk/2020-May/045582.html
since we don't have any builders for them.

Hope that helps!
--Roger

___
tor-relays mailing list
tor-relays@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-relays


Re: [tor-relays] Tor on Rpi (relay.jack...@simplelogin.fr)

2021-02-08 Thread Patrice Bönig

Hi,

I am also have a tor relay running, but on a RPI 4. No long time ago I 
stood at the same point as you are now. I than wrote me a skript, where it:


1. pulls the latest source
2. backs up the old data (identity)
3. compiles and installs tor
4. copies the old  data on the new installation
5. adds tor to crontab
6. starts tor

I think you must change some things to your need if you want to use it.
If you want the script I can share it here, if it is allowed. If not I 
can send it to you via mail.


regards
Patrice



Hello
im running a tor relay on rpi 2 with version 0.4.2.7., on the? Tor relay search 
i see my relay is outdated and flaged as not recomended, however on rpi i have 
tried update and upgrade many times and always get notification from apt that 
tor i already de newest version, also tried apt dist-upgrade but no luck.

Any way to get the last version and get ride of not recomended flag from my 
relay?


___
tor-relays mailing list
tor-relays@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-relays


[tor-relays] Tor on Rpi

2021-02-08 Thread relay . jackash
Hello
im running a tor relay on rpi 2 with version 0.4.2.7., on the  Tor relay search 
i see my relay is outdated and flaged as not recomended, however on rpi i have 
tried update and upgrade many times and always get notification from apt that 
tor i already de newest version, also tried apt dist-upgrade but no luck.

Any way to get the last version and get ride of not recomended flag from my 
relay?

Thanks in advanced

publickey - carlostkd@pm.me - 0x9B0CCC19.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
tor-relays mailing list
tor-relays@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-relays