this post was submitted on 30 Oct 2023
1 points (100.0% liked)

Self-Hosted Main

502 readers
1 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.

For Example

We welcome posts that include suggestions for good self-hosted alternatives to popular online services, how they are better, or how they give back control of your data. Also include hints and tips for less technical readers.

Useful Lists

founded 1 year ago
MODERATORS
 

Hi all,

I seem to see a lot of people using VSC over ssh to see the files and folders on their servers and edit them more conveniently than compared to nano/vim but I'm looking for alternatives for VSC.

I have an increasing number of servers and hosting things with docker compose. Thus I have a lot of /app/docker folders with numerous docker-compose.yaml and other container specific config files.

I dislike VSC so as an alternative I use Notepad++ with nftp plugin (yap, I'm daily driving Windows) to connect to the servers to see and edit said files.

I also tried Jetbrain' fleet but it seems to intall some kind of client on the servers it connects to which requires just enough resources to notably slow down my cheap VPSes.

So other than the 3 examples above, what kind of edit do you know/use to connect to servers and edit files there directly?

top 25 comments
sorted by: hot top controversial new old
[–] [email protected] 2 points 10 months ago

Usually on the remote i use lunarvim(neovim but with some default settings and plugins).

Other than that I usually have everything as a git repo, so i edit on my local/remote ide(pycharm, vscode or vscode server). I edit the files push them to the repo and then i just pull the files on my host.

I know this adds some steps to edit a simple file, but the version control etc can be a massive advantage depending on what you do.

[–] [email protected] 2 points 10 months ago (1 children)

sshfs-win is something if you don't like vscode.

[–] [email protected] 1 points 10 months ago (1 children)

This is interesting. Thanks for mentioning.

[–] [email protected] 1 points 10 months ago (1 children)

Its just networks drives that are actually mounting a folder via SSH.

[–] [email protected] 1 points 10 months ago (1 children)

Does this work with SSH keys?

[–] [email protected] 1 points 10 months ago
[–] [email protected] 1 points 10 months ago
[–] [email protected] 1 points 10 months ago
[–] [email protected] 1 points 10 months ago

I use git to manage my compose files, manifests and config files etc.

I believe Github Actions has a docker workflow, not sure how to use it, but it might be worth looking at as a CI/CD to auto-deploy your containers once they are merged to main.

I use .gitignore for my persistent volume folders if the container will write to them.

[–] [email protected] 1 points 10 months ago (1 children)

For the most part I work directly on the server and use nano. Occasionally offload to VSC if it's a bit more intensive.

I use VSC as my main Dev program at work though, I'm interested to know what you don't like about it?

[–] [email protected] 1 points 10 months ago

not the OP, but really interested on the following.

I was able to setup VSC etc for remote ssh and edit, but the problem is that when you need to sudo, then this does not translate.
VSC will use the credentials of the account you used to connect , but could not figure out how to elevate with sudo or another account when you need to.

did you manage to do that?

[–] [email protected] 1 points 10 months ago

I use Ansible+git to push changes to remote servers. And use ssh+vim sometimes too.

[–] [email protected] 1 points 10 months ago

Depends, but mostly ssh and vi, vim, or neovim depending on what was the default install.

College habits die hard, and I did 4 years of college work with vi/vim.

[–] [email protected] 1 points 10 months ago

I usually use vim/nano directly. I don't see the need to edit file directly very often.

Following good DevOps practice, I usually push server configuration with an ansible playbook and most application are running on Docker. The number of time I need to edit config file is very minimal.

But I would understand if ansible deployment is a bit too far for your self hosted need.

[–] [email protected] 1 points 10 months ago

I usually do Notepad++ over SFTP

I also spun up a code-server instance with access to my configs if I don't have access to Notepad++.

[–] [email protected] 1 points 10 months ago
[–] [email protected] 1 points 10 months ago

SSH to shell in. vi to edit text.

[–] [email protected] 1 points 10 months ago

While i was using Windows - MobaxTerm

Now that i switched to MINT - Tabby

[–] [email protected] 1 points 10 months ago

I connect via winscp to browse files and it has an editor but you can have it open files using whichever program you want. I stick with VS Code.

[–] [email protected] 1 points 10 months ago

filebrowser

[–] [email protected] 1 points 10 months ago
  • windows - mobaXterm
  • linux - nnn file manager on the machine, with fzf plugin, and micro editor
[–] [email protected] 1 points 10 months ago

For sure not best practice, but I have a SMB share on my servers for the Docker folder and mount it on my dev machine.

Recently switched to a dev VM on my hypervisor, which has VSCode Server from Coder running. It also has the different shares mounted. Now I can VPN in from anywhere, switch on my dev VM and do whatever needs doing with my full environment available to me.

[–] [email protected] 1 points 10 months ago

`ssh` then `vim` but within a `screen` session, this way I maintain the state, e.g vim stays open on the configuration file or the code, and I can have multiple "windows" per project, all easy to switch to.

I reattach to the running session with `screen -raAD` and I made a shortcut so that if I type `s` in my terminal I'm in my server, ready to code.

[–] [email protected] 1 points 10 months ago

Why not using VSCodium ? VSCode without the bullshit and extension still works !

[–] [email protected] 1 points 10 months ago

Nautilus on my linux laptop can mount sftp as if it were a physically attached drive. You can even right click empty space in the folder to get the option of "Open in Remote Terminal" or "Open in Local Terminal".