tincapp icon indicating copy to clipboard operation
tincapp copied to clipboard

Conf file edition

Open yangfl opened this issue 8 years ago • 12 comments

I would like to see that *.conf can be directly edited from UI. Especially it would be better if network.conf can be edited on the fly.

yangfl avatar Oct 12 '17 04:10 yangfl

Yes. Please. I've been having to open it in termux for the time being, which is fairly inconvenient.

LivInTheLookingGlass avatar Oct 12 '17 05:10 LivInTheLookingGlass

Implementing correctly a graphical interface to edit keys-values would require too much work in my opinion. Contributions are welcome.

The app could also open a file manager in the configuration directory from the configuration screen.

It is currently possible to edit the configuration files from other Android applications that can access the content of the SD card. They can be edited with the Amaze file manager and its included text editor or remotely with Termux+sshd, for example.

pacien avatar Oct 12 '17 11:10 pacien

I think the info page of a connecting network is just a good template - just make it editable. It won't cover all but still good enough (since usually other files are pre-copied to SD card and only network.conf need to be created).

Sorry for my zero knowledge on Android development, otherwise I'd like to contribute :(

yangfl avatar Oct 12 '17 13:10 yangfl

The app could also open a file manager in the configuration directory from the configuration screen.

Even better, just add an "open in editor" button. It should be possible to let Android offer the correct applications (I've seen this used to good effect by other apps).

I was just going to add this as a feature request, but since this issue was already open this seemed like a better place for it.

For specific implementation ideas:

A long press on the network name should result in a menu, with a few options:

  • "Open tinc.conf in editor"
  • "Open network.conf in editor"
  • "Open configuration directory in file manager"
  • "Open log directory in file manager"

larsks avatar Mar 14 '18 15:03 larsks

I wanted to make the links to the configuration and log directories clickable. Surprisingly and sadly, there is no way to easily launch a file browser or editor using an Intent on Android. Starting with Android N, the system forbids such Intents.

pacien avatar Mar 14 '18 19:03 pacien

That is surprising! What a bummer.

larsks avatar Mar 15 '18 01:03 larsks

On my device (Samsung Galaxy Tab A (2016)) the configuration is saved under /storage/emulated/0/Android/data/org.pacien.tincapp/files and termux doesn't have access to this directory (even with storage permission on Android 8.1.0). Hence, I have no way of editing the configuration. In my case, files have to be on the external SD card in order to be edited by the applications.

Beetix avatar Apr 19 '19 10:04 Beetix

@Beetix wrote:

On my device (Samsung Galaxy Tab A (2016)) the configuration is saved under /storage/emulated/0/Android/data/org.pacien.tincapp/files and termux doesn't have access to this directory (even with storage permission on Android 8.1.0). Hence, I have no way of editing the configuration. In my case, files have to be on the external SD card in order to be edited by the applications.

I've just tested accessing the configuration directory using Termux on an emulator running Android 8.1.0. You indeed need to grant the storage access permission to Termux and restart that app, closing any running session before it can successfully access the directory.

pacien avatar Apr 19 '19 12:04 pacien

Thank you. I confirm that it works. It's my mistake... I must have been looking under /storage/emulated/0/data/ and not /storage/emulated/0/Android/data/

Beetix avatar Apr 21 '19 08:04 Beetix