Youtube View Bot Termux

4 views
Skip to first unread message

Yoshi Heffernan

unread,
Aug 3, 2024, 5:54:09 PM8/3/24
to liquaconnui

Realizing that the /sdcard directory on Android is a symlink, I tried to find the location of the actual directory -- learning that it is not just a symlink, but a symlink to another symlink, and the actual directory is /storage/emulated/0

So in short --- I don't know whether termux used to run with the permissions of the sdcard_r group or whether the o permissions used to allow read-write -- but I need to know which of the two it used to be and how to fix things - because being able to access the contents of the internal SD card is kinda critical.

No, my device is not rooted, nor do I plan to root it - so I can not give any information that I'd have to root the device to obtain. However, not being rooted never in the past prevented me from having read access to the /sdcard directory - so this is new (and disturbing).

Granted - it's been a few months since previously I tried to do this - but this new limitation from Android seriously hampers the usability of termux and who-knows-what-else -- as I need to be able to have access to files that are on my SD Card. (I can still do a lot, even if not everything, even without write permissions -- but am pretty much stuck in the water if I can't get read permissions, as is presently the case.)

Newer versions of Android require apps to ask for permission during runtime. You may have noticed this already. One example is Chrome asking for the Storage permission when you try to download something for the first time. For Termux, this is a problem. Permissions default to "not allowed," so when Termux needs a permission for a task, because Termux hasn't been updated to ask for these permissions, it instead tries to perform the task anyway and throws an error as a result. Unfortunately, the developer(s) have to fix this themselves. Thankfully, Android gives you ways to manage app permissions manually. Until the developer(s) update Termux accordingly, this is probably the only way.

You've now given Termux access to your storage. You can test this with the command below:
ls /sdcard/
If you don't get a permission denied error, it worked! You shouldn't need to do this again unless you reinstall Termux.

it's July of 2017 & I had this same problem, googled for it, & arrived here. Matthew Read 's comment pointed the way to the solution, but there's no answer that spells it out clearly, so here' s the tl;dr of it:

Lets say I have a nice collection of family photos on my desktop computer annexed in a folder called family. Lets say we have numcopies set at 1. I keep only the best photos, so it always takes up about 1gb. In the family folder I have nice organized sub-folders and I add new images occasionally. I have an Android tablet that sits on my coffee table and I want visitors to be able to open the tablet, run some gallery app and view all my family photos. Sometimes i'll grab the tablet and take it with me to family gatherings, so I want all the photos on in, ready for offline viewing.

With this use case, perhaps I run assistant inside termux. I clone family into /data/data/com.termux/files/home set it as standard group transfer and call it t, I also clone it into /storage/emulated/0, set it as standard group client, and call this crippled client repo c. Our c folder should now be accessible to any Android photo gallery app. As we make changes to family, on our desktop, assistant on the Android tablet brings them in, when we have wifi, it will probably copy them directly to c?

If I take a photo on my tablet, put it in the c directory (which is accessible from my photo app), then this photo should be copied directly to family (if I have wifi). If I don't have have wifi, this photo should be immediately copied to t in which case I have two copies of the file on my tablet (I think)? If I delete the photo from the crippled filesystem c I still have the one that was already copied to t. If I re-connect to wifi, perhaps the photo will get sent to family from t. It might stay in t since it is missing from c, not sure how this would work (but anyhow, see archive folders in the next paragraph).

Maybe I want to save some space on my tablet (deleting from photo app might work?, but archiving is more likely to work). So I open up my photo app, browse to my c folder and start putting a bunch of files in a sub-folder named archive. They are then immediately deleted from my tablet (unless they were never synced to family in which case I have two copies of them, so I would still have a copy sitting in transfer t). If I archive files when I have no wifi, presumably they will just get moved to t by assistant since git-annex cannot verify the copy at family?

The particular repository I'm looking at for a first stage is a wedding photo repository. It contains both the working directories of the photographers involved (some JPEG, some RAW-based with git-versioned Makefiles and sidecars to get the JPEGs which are then checked in with numcopies=0), where some photographers have their files in multiples copies to reflect their pre-sorting. The final photos are also copied to a release directory in various combinations ("complete couple's selection", "pictures released to guests", "other pictures of guests") which were then distributed by a process outside of git-annex' control (zip files were created and distributed over a web server).

This copying workflow usually works greatly with git-annex v5 (or v6 when files are always kept locked): even if files were checked in by different contributors with different default hash settings, copying a file means copying a symlink.

On the tablet, when I clone the repository on the crippled side of the file system, the initial checkout takes quite some time, and the 3gb get blown to 8gb due to the file being copied not only to the "complete couple's selection", but also to the other selections and the occasional picture in the photographers' directories.

The next repository I'd like to do this with is our family photo repository, containing an average of four persons' digitized analog and digital photos starting in 2002 and contains about 700gb of images; that repository has not that much duplication, but the interesting files (often a "Selection" folder per event that contains copies with appropriately named files for a sequence) are still checked in in duplicate.

proot would only change the view of programs launched under it. I could probably do that (if git annex works under proot on the tablet in question at all; I had to disable it to get it running on Android 7.1 (compatible; LineageOS 14.1)).

ad SDCardFS / FAT32: It seems that both the fuse wrapper around the SD card (be it actually formatted FAT32 because it's the external one, or ext4 as is the encrypted internal one on my device) and SDCardFS (which, it appears to me, is just Google moving the fuse wrapper into the kernel) won't expose the functionality we want.

What I've seen when just setting up a new device is that the Storage Access Framework (looks like Android's idea of gvfs / kvfs with a spike of flatpak-portals to me: a userland file system that operates on saf:/ and content:// URIs rather than files, probably does file operations by means of IPC and receiving file handlers) might help:

In the LineageOS built-in file manager, I don't see two "virtual SD cards" (the internal and the external one), but also a "Termux" "device" with proper logo and "0B free", which allows me to peek into the termux home directory (but not its usr directory). From that file manager I even see the photos inside a regular (symlinked) checkout, and can open them with the Simple Gallery app. (Provided they end with '.jpg' and not '.JPG', but that's probably a detail of the file manager).

I did not yet find another app that sees this "Termux" device; Ghost Commander only sees "Documents" and the internal and external SD cards; the "Dir" file manager exposes a SAF selection only when creating directories on external SD (and then shows the same selection as Ghost Commander), the Simple tools (Simple File Manager, Simple gallery) show "Internal", "SD Card" and "Root" in their own storage selection (might be pre-SAF; similar situation also for the Amaze file manager).

If we could reproduce what the builtin file manager does to access the files, that might be a solution here. Termux obviously already helps in this by exporting the home directory (since 0.34), but maybe they also can do more (like exporting XDG user directories for quick access?).

Create a text file called hi.txt from Termux in /data/data/com.termux/files/home AKA $HOME. Launch Turbo Editor enable Use the Storage Access Framework in Preferences menu. Click Open a file Open from Termux, click hi.txt, edit file, save. Now I can see changes in Termux. Nice.

Have you tried the older version of the Termux app or checked what the release differences are? The screenshots are too small to make any sense of but I suspect the issue is more around the emulation of the shell environment than n8n itself.

That is a bit odd, Are you able to change the node version in Termux? Do you know what version of n8n you had installed before that was working? It may be worth installing that version again to see if that is working.

Another thing I found when looking at Termux issues with SQlite is you may need to run pkg install clang libsqlite pkg-config before trying to install the node module so it might be worth giving that a bash.

its already latest version,and i did use termux version i installed before and issue still persist
i even use different phone as well
i think the problem is in n8n installation itself bcs last time before i updated n8n its worked,and no matter what kind of termux version,it still working
but now after new n8n updates,it stopped working

Hey,ive tried installed n8n over other (non rooted) phone and still doesnt work
i will attach you full screen record log here
_MDEQ/view?usp=sharing
I dont know how to install older version of n8n and i have no idea the old version of termux ive installed

c80f0f1006
Reply all
Reply to author
Forward
0 new messages