31
submitted 5 months ago by Dust0741 to c/selfhosted

I would like a program or website to connect to a computer and be able to edit a file there.

Say I have a server. Call it 192.168.1.2 Say I have a file. Call it /data/editme.txt

I want either a simple link I can bookmark to edit this file, or to a note app (such as Joplin or Obsidian) and also be able to edit this file.

I tried using Syncthing, however I would rather not have to sync the file from one location to another. This file has no need to be stored in multiple locations.

Anything that'll solve this for me?

all 34 comments
sorted by: hot top controversial new old
[-] [email protected] 50 points 5 months ago

You could use Nano (or Vim) over SSH, or set up a Samba-share from the server and mount it in your local OS somewhere.

[-] Synthead 34 points 5 months ago

Vim handles remote files over SCP natively:

vim scp://192.168.1.2//data/editme.txt

[-] [email protected] 28 points 5 months ago

"Use vim in SSH" is not a great answer to asking for a convenient way to edit a single file, because it requires understanding multiple somewhat-complex pieces of technology that OP might not be familiar with and have a reasonably steep learning curve.

But I'd still like to explain why it pops up so much. And the short version is very simple: versatility.

Once you've learned how to SSH into your server you can do a lot more than just edit a file. You can download files with curl directly to your server, you can move around files, copy them, install new software, set up an entire new docker container, update the system, reboot the system and many more things.

So while there's definitely easier-to-use solutions to the one singular task of editing a specific file on the server, the "learn to SSH and use a shell" approach opens up a lot more options in the future.

So if in 5 weeks you need to reboot the machine, but your web-based-file-editing tool doesn't support that option, you'll have to search for a new solution. But if you had learned how to use the shell then a simple "how do I reboot linux from the shell" search will be all that you need.

Also: while many people like using vim, for a beginner in text based remote management I'd recommend something simpler like nano.

[-] REdOG 6 points 5 months ago

Often I use git and just edit my repo files with the GitHub app and then git pull the changes from the server that needa the file. If you're already familiar with git it's probably easier than learning vim. You can probably do it directly to a repo behind ssh. If not then I'd learn vim before git.

[-] Tangent5280 3 points 5 months ago

Do you use your own git server? Or do you use github? I want to use git but i dont want microsofts grubby hands in my data

[-] [email protected] 4 points 5 months ago

You don't need a dedicated git server if you just want a simple place to store git. Simply place a git repository on your server and use ssh://yourserver/path/to/repo as the remote URL and you can push/pull.

If you want more than that (i.e. a nice Web UI and user management, issue tracking, ...) then Gitea is a common solution, but you can even run Gitlab itself locally.

[-] Tangent5280 1 points 5 months ago

that sounds good. thanks.

[-] SquiffSquiff 21 points 5 months ago

Look into ssh

[-] PeachMan 8 points 5 months ago* (last edited 5 months ago)

You're talking about remotely editing a file. That means you'll need remote access to the fileserver where it lives. The common way to do this would be with a network fileshare, but there are many options.

If you want to access the file from OUTSIDE your home network, you need a VPN or something similar. The simplest option is probably Tailscale. Just install it on your server and on your remote device, and boom, both are always magically on the same virtual network.

[-] [email protected] 2 points 5 months ago

I use Zerotier-One for the vpn part, also real easy to setup as an alternative.

[-] Rootiest 7 points 5 months ago* (last edited 5 months ago)

Personally I use vscode remote-ssh for editing random files on other servers if I want/need a GUI for it.

[-] muntedcrocodile 6 points 5 months ago

Try set up ssh then u can ether use a terminal or vscode with the ssh emote something extension

[-] thirdBreakfast 6 points 5 months ago

There's a project called Filebrowser that allows you to edit text files in a web interface. You can just run that on the 192.168.1.2 machine. It's easy to set up simple auth, and you can restrict it to the /data/ directory.

[-] Cyberflunk 3 points 5 months ago
[-] [email protected] 3 points 5 months ago

Deploy code-server and either connect to it with a VPN or open the port needed to connect over the internet.

[-] [email protected] 1 points 5 months ago

Always be careful when opening the port. But yes this is what I do as well, I just keep it behind a VPN

[-] [email protected] 3 points 5 months ago* (last edited 5 months ago)

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

Fewer Letters More Letters
Git Popular version control system, primarily for code
IP Internet Protocol
SSH Secure Shell for remote terminal access
SSL Secure Sockets Layer, for transparent encryption
VPN Virtual Private Network

[Thread #320 for this sub, first seen 1st Dec 2023, 11:15] [FAQ] [Full list] [Contact] [Source code]

[-] hperrin 3 points 5 months ago

WebDAV will handle that, and Joplin has WebDAV client built in.

[-] [email protected] 3 points 5 months ago* (last edited 5 months ago)

WinSCP is a nice GUI app that will connect over various protocols and let you edit a file easily. You can save the connection details so it's just like 2 clicks to edit a file.

Surprised everyone is recommended SSH and vim and stuff when you wanted easy and simple.

[-] TCB13 3 points 5 months ago

Technically speaking the OP would be, most likely, be using SSH as the protocol to connect to the server using WinSCP. But yes, I agree with your point.

[-] [email protected] 2 points 5 months ago

Another way - host the file somewhere like Dropbox/mega, etc. Have the server keep the file synced. Then you can edit it on the web storage.

[-] [email protected] 2 points 5 months ago

Maybe somthing like Nextcloud?

[-] [email protected] 4 points 5 months ago

Rather use a smaller app, like FileBrowser

[-] NeoNachtwaechter 2 points 5 months ago

Yes, it's easy with nextcloud.

[-] TCB13 -1 points 5 months ago

Nothing is easy nor reliable with nextcloud.

[-] [email protected] 0 points 5 months ago

"Nothing is easy nor reliable ~~with nextcloud~~ if you dont know what you're doing."

There, fixed it for you :)

[-] TCB13 2 points 5 months ago

Yes because this https://lemmy.world/comment/5490189 is obviously the user not knowing what he's doing. lol

Magic bullets that never get rendered due to user fault :P

[-] [email protected] 1 points 5 months ago

Well, i didn't say it was perfect.. ;-)

[-] [email protected] 1 points 5 months ago

There are a few choices.

You can create a shortcut (Windows), script or desktop file (Linux). This is probably the easiest method, and works outside on the internet browser.

But as you talked about bookmarks, I am assuming you want to edit directly in your browser. You can host an instance of OnlyOffice Community Edition, and use that as an editor, and save the direct link to service with the appropriate arguments in the URL to recall the file.

[-] TCB13 1 points 5 months ago* (last edited 5 months ago)

I would suggest something quick and simple such as FileBrowser. Another more "expensive" alternative would be to setup an SSH server on the server and use WinSCP to access the thing and edit the file that way.

If you go the FileBrowser route I just would like to recommend you to be careful about opening your "server" to the internet. Setting up a VPN like I described here is recommended.

If you can't have run a VPN client on the target computer (work computer etc) and/or it isn't practical (public machine) at least make sure you run FileBrowser behind a Nginx reverse proxy, use SSL, pick non-standard port and restrict the access to the thing as much as possible with a list of specific allowed IPs or, at least, only for your country. Using some 2FA solution and fail2ban for an extra layer of security is also recommended.

[-] [email protected] 1 points 5 months ago

If you want to edit files in a browser, then it will all depend on what kind of files you want to edit.

If it's office suite related files, I'm leaning towards the Collabora Online suite with Nextcloud. If it's markdown files, I'd go with something like HedgeDoc

[-] [email protected] 0 points 5 months ago

New Lemmy Post: Any way to edit a file over internet? (https://lemmy.world/post/8992771)
Tagging: #SelfHosted

(Replying in the OP of this thread (NOT THIS BOT!) will appear as a comment in the lemmy discussion.)

I am a FOSS bot. Check my README: https://github.com/db0/lemmy-tagginator/blob/main/README.md

this post was submitted on 01 Dec 2023
31 points (89.7% liked)

Selfhosted

37000 readers
339 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 11 months ago
MODERATORS