开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

How to _manually_ set config path for d-rats_repeater.py use?


 
Edited

Hi:
I have a D-Rats 0.4.1 installation running with Ubuntu 22.04 laptop (Gtk ok).? My goal is to be able to make D-Rats repeater work in a Ubuntu Server (no Gtk).

I set a testbed with a PI 4 and fresh install of Ubuntu Server 22.04.? Libraries installed without problem.? I can start d-rats_repeater via sudo /usr/bin/python3.11 /home/dratsrepeater/D-Rats/d-rats_repeater.py -C

So far repeater.log file is created at .d-rats-ev and even maps directory.? As expected when trying the -c CONFIG invocation I get the Gtk coul'nt initialize error.? I tried manually creating the CONFIG dir and cp the repeater.config from the Ubuntu 22.04 Laptop as work around.? Not working

Browsing through files I know d-rats_repeater.py settings can be set a lines 473-484. So call id I can set at that file (not my preference but..)

THE QUESTION is:? Anyway to set the CONFIG directory manually?? I mean bypassing the -c CONFIG (which will not work on systems without Gtk).?

The config.py file? ?have this code gives me hope what I need (hard-set path to repeater.config) could be possible:
?logger.info("sys.path=%s", sys.path)
? ? # mm: fn = "/home/dan/.d-rats/d-rats.config"
? ? filename = "d-rats.config"

Well, hope someone could point to the right direction. Again d-rats_repeater.py get started without errors in Ubuntu 22.04 with no Gtk.? Still very possible some functionality will trigger errors but want to go step by step.?

Thanks in advance!

Edfel
KP4AJ



 

On 7/31/2023 6:47 PM, Edfel Rivera wrote:
[Edited Message Follows]
Hi:
I have a D-Rats 0.4.1 installation running with Ubuntu 22.04 laptop (Gtk ok).? My goal is to be able to make D-Rats repeater work in a Ubuntu Server (no Gtk).
I had a longer reply written and the Windows 8.1 computer crashed and it was all lost, so now just a summary:

If you are making changes or going into new feature, you need to be using the github work flow in the wiki, or you will be using out of date code and that makes it harder to eventually merge it back in.



Before reporting issues, please check to see if they are known issues, they may be fixed since the release was made.



The daemon issue is known and has been fixed, but since it is just log noise did not merit a new release being made.

The version issue you encountered is known and as you can see was fixed in master. A new release was not made since it only shows up if you use a github tarball instead of one of the two currently documented install methods in the WIKI.

You have not been looking at the proper options for the d-rats repeater code. The "-C OR --console" option as should be displayed with the --help option and is visible in the source says to run with out a GUI.

The d-rats repeater service should definitely not be run as root, it should be run with a dedicated non-privileged account. Setting all that stuff for an end user should be done by a debian / rpm or equivalent package.

73,
-John


 

Hi John:
Thank you for the reply, help, and for your patience.?

73'

Edfel
KP4AJ


 

Hi:
Well this experimental 'hack' seems to do the trick for my specific need.? Will try to learn python and about git and try to find a more generalized solution for others.? For the hack > Edit the file d-rats_repeater.py

xxx/d-rats is the directory you will be placing the repeater.config file. You edit d-rats_repeater.py around? line 1230.??

# CUSTOM PATH Case No Gtk at server
? ? #def_config_dir = platform.config_dir()
? ? import os.path
? ? cpath="/xxx"
? ? def_config_dir = os.path.join(cpath,'d-rats')

Seems to be working. For example I set id to ZZZZZ /xxx/d-rats/repeater.config and it was shown at the repeater log.? Deleted the repeater log and now set id (repeater.config) to KP4AJ and started d-rats_repeater again. repeater.log shows id as KP4AJ.

Please note you need a repeater.config from a working installation. My case I use from a Ubuntu 22.04 laptop.? Please note I am newbie, almost zero knowledge of python, experimenting with a PI 4. So use at your own risk. Still have to look for John point regarding how should run d-rats_repeater.py from non-privileged user.? ?

Also will try to set same directory for the repeater.log which is still at .d-rats-ev.??

73'

Edfel
KP4AJ


 

Hi:
Important: Will look into repeater.log path code as it is being affected by the hack. Have to check all d-rats_repeater.py instances that use?def_config_dir as is was changed.? Should not be a major problem, I hope.?

73'

Edfel
KP4AJ?


 

Hi Again:
Found the repeater.log file at /home/dratsrepeater/.d-rats-ev? ?Ignore previous message.? But anyway this changes requires testing so not breaks other things.?

Seems that the dratsrepeater.service posted yesterday changes the _location_ of the repeater.log file (from the way I was calling previously the repeater).? It is now being placed to /home/dratsrepeater-user/.d-rats-ev

As I have integrated both changes into the test unit that might explain why I did'nt found a while ago the repeater.log. The manually setting for d-rats_repeater.py code seems to not affect repater.log file creation.? But will look so both files (config.repeater repeater.log) be at same directory. Remember this is experimentation.?

73'

Edfel
KP4AJ