SOLVED Install text editor in container (Wordpress or other)

slacks425

Dabbler
Joined
Aug 6, 2023
Messages
13
Hello,
I'm migrating some apps from an old Synology to my new TrueNAS Scale server. I'm still learning and have a lot to learn, but it's frustrating how I can get stuck on little things sometimes.
While migrating some Wordpress sites, I faced the upload limit of 2MB (when my backup is >300MB). Easy fix, I can edit the wp-config.php file to increase that. But once in the Shell of Wordpress (official version), I found wp-config.php but I have no way to edit the file. I tried vi, nano, vim, emacs, nothing seams install for that in the container. I tried apt-get update, apt-get install nano, but it's not allowed (permission issue).
How to solve that easily? Can I mount the container volume from a Linux PC somehow? Can I install a text editor in another way?
I shouldn't be the first to have this issue? (I found one guy with the same issue but he was using the Truecharts version, and the thread end up unsolved).
Thanks in advance for any help.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
If you're using the TrueCharts version of the app, there's a checkbox for "Codeserver" in the app configuration--I'd expect that installs VS Code Server with your app for this purpose, though I haven't had occasion to use it thus far. No idea how you'd do it in the "official" app.
 

slacks425

Dabbler
Joined
Aug 6, 2023
Messages
13
Ok I didn't want to use TrueCharts for my 2 main apps (Nextcloud and Wordpress) and stick with official which should hopefully be more stable and not broken by update.
My workaround for Wordpress is to create folder for data, db and dbbackup and point to it, then I can edit in SSH with root user directly. But in the end it didn't solve my issue that was to increase the maximum upload size, this I could resolve with a Wordpress plugin, strange but it worked. Wordress is not fully migrated, except I still have issue with recreating the SSL certificate from Let's Encrypt in Nginx. Still working on this now.

Note that to close the topic, it was apparently still possible to edit directly in the shell from the docker using: busybox vi /path/to/file
 

sfatula

Guru
Joined
Jul 5, 2022
Messages
608
You could extend the standard Wordpress or Nextcloud docker images and simply install a text editor. But then you'd have to know docker, and, probably host your own image repo. But that's what I do for all my containers. Certainly wouldn't be your preferred method due to your comment on "official".
 

slacks425

Dabbler
Joined
Aug 6, 2023
Messages
13
You could extend the standard Wordpress or Nextcloud docker images and simply install a text editor. But then you'd have to know docker, and, probably host your own image repo. But that's what I do for all my containers. Certainly wouldn't be your preferred method due to your comment on "official".
Yes of course if I would be to the level to create my own docker image I would not be stuck at such problem in the first place. I come from 9 years on Synology and most of what I did on it was achieved only in the GUI and often it worked at first try as intended using the default apps and services (create users persmissions, smb/NFS share, generate Let's Encrypt cert, reverse proxy, full data and app-data backup to external server, deploy apps, ...), far away from my first experience with TrueNAS where the simpliest thing was already a challenge.
Thus Docker was already a bit challenging for me on Synology but I managed to run some (only from GUI), until my machine was struggling to run that much apps in parallel and I had to stop using Docker.
So I wanted to level up with my self-build server, more power, SSD pool for apps and user files, HDD for media, all running on an open source OS but I have to learn of course. I start with official apps for the most ciritcal apps, TrueCharts for the fun stuff not so critical, if possible without modification from the standard configuration, and when I will get more comfortable I could explore tweaking around, external Docker image, modified Docker and full VM probably.
Now I have Wordpress running, fully migrated from the Synology, Nginx with all my Let's Encrylt certificates (from 3 different registrars) and several rules pointing to TrueNAS apps and other local machines. Little by little I'm getting there. Next is the to run Nextcloud with external access from my domain. Then the easiest the media center suite of apps (I already suceed on my test TrueNAS machine, I just have to duplicate and start clean).
 
Top