Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Cloudron Forum

Apps | Demo | Docs | Install

How do you manage so many apps of the same type when a simple change needs to be made?

Scheduled Pinned Locked Moved Discuss
automation
10 Posts 5 Posters 393 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • d19dotcaD Online
    d19dotcaD Online
    d19dotca
    wrote on last edited by girish
    #1

    I'm curious... how do people prefer to manage a situation where they have many app instances of the same type and need to modify or tweak a single setting that's found in one of the files of the app (i.e. the filesystem).

    My use-case:

    • I have approximately 20 WordPress app installs. They pretty much all come from a "template" app of it I have running so that the php.ini settings and wp-config.php settings have the consistent values I'd like for things like upload size and what-not.
    • I want to remove a line or replace a line so that the php.ini settings are consistent across all apps (now that they need to change in my use-case from the template that's been going strong for a while). I.e. I want to decrease the file size upload setting on php.ini from whatever value it is now (I think around 100MB) to 25 MB.

    How would I change them all at once rather than having to go in one by one? Since these are file-system level, I guess sed would be the right tool to modify these values? Any other preferred manners for doing this kind of a system-wide change across all app instances of a certain type? Or does this have to be done one-by-one as a manual process?

    My question really applies to pretty much any app I think, but WordPress is the example in my use-case.

    Just to clarify, for WordPress in particular I use MainWP for managing all my WP instances in terms of plugins and updates and everything, but that only reaches as far as WP itself, anything outside of it like the web server or the php.ini file can’t be modified by it.

    --
    Dustin Dauncey
    www.d19.ca

    1 Reply Last reply
    1
  • robiR Offline
    robiR Offline
    robi
    wrote on last edited by
    #2

    There's a few ways... depending on the protocol you want to use.

    There are multi-server ssh apps that will log into X servers and run a script or even live execute all terminal commands on each. Not sure about interactive editing of files but something to try.

    Similar can be done with (S)FTP, replacing needed files via a script.

    N8N can be used to automate such things as well API wise, by replacing the file in question too.

    One could also spin up a provisioning system such as Ansible and write a recipe for making those changes.

    Many other cloud tools exist to make changes to a large number of hosts. CFEngine, Puppet, Chef, etc..

    Life of sky tech

    d19dotcaD 1 Reply Last reply
    1
  • d19dotcaD Online
    d19dotcaD Online
    d19dotca
    replied to robi on last edited by
    #3

    @robi Hmm, interesting. Thanks for the suggestions

    Some of those definitely seem overkill for the rare occurrence for this task in my particular use-case (like Chef and Ansible), but good to know still.

    I wonder about the SFTP / SCP option though… I sort of assumed that wouldn’t work because I’d need to know the silly app ID’s first for all of them unless I can use wildcards for the paths I guess like I could using something like sed.

    I’m not familiar with N8N so I’ll check into that too.

    Thanks Robi.

    --
    Dustin Dauncey
    www.d19.ca

    fbartelsF 1 Reply Last reply
    0
  • fbartelsF Offline
    fbartelsF Offline
    fbartels App Dev
    replied to d19dotca on last edited by
    #4

    Specific to Cloudron you can also use the Cloudron cli. It has the ability to push and pull files from apps (you can specify the app in question by it's install location) and exec into apps to run commands like sed.

    d19dotcaD 1 Reply Last reply
    6
  • d19dotcaD Online
    d19dotcaD Online
    d19dotca
    replied to fbartels on last edited by d19dotca
    #5

    @fbartels ah yes! Great idea. I hadn’t used the CLI for that before. I see the documentation for that here and looks pretty simple. I assume I can specify many apps at a time, but will test soon.

    https://docs.cloudron.io/packaging/cli/

    --
    Dustin Dauncey
    www.d19.ca

    girishG 1 Reply Last reply
    1
  • girishG Do not disturb
    girishG Do not disturb
    girish Staff
    replied to d19dotca on last edited by
    #6

    @d19dotca said in How do you manage so many apps of the same type when a simple change needs to be made?:

    I assume I can specify many apps at a time, but will test soon.

    You have to execute the command multiple times with the --app <app.example.com> argument. So, a for loop of sorts.

    1 Reply Last reply
    2
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #7

    Exactly, looping through would work here. You could likely automate this depending on the change you need to make. I like the approach of making a git repo for just support and maintenance scripts.

    1 Reply Last reply
    4
  • d19dotcaD Online
    d19dotcaD Online
    d19dotca
    wrote on last edited by d19dotca
    #8

    So just wanted to add that I ran the commands to the Cloudron CLI (tested with one then with a number of —app added to the same command) and it seemed to work perfectly. Thank you for that suggestion! 🙂

    --
    Dustin Dauncey
    www.d19.ca

    robiR 1 Reply Last reply
    2
  • robiR Offline
    robiR Offline
    robi
    replied to d19dotca on last edited by
    #9

    @d19dotca can you provide example scripts that worked for you?

    Life of sky tech

    d19dotcaD 1 Reply Last reply
    0
  • d19dotcaD Online
    d19dotcaD Online
    d19dotca
    replied to robi on last edited by d19dotca
    #10

    @robi Actually for me, it wasn't really scripted and was more manual in nature.

    Basically ran the cloudron list command, then copied out all the WordPress manifest ID types and put it together in a command sequence like this:

    cloudron push --app <www.example1.com> /Users/<username>/Desktop/php.ini /app/data/php.ini && \
    cloudron push --app <www.example2.com> /Users/<username>/Desktop/php.ini /app/data/php.ini && \
    cloudron push --app <www.example3.com> /Users/<username>/Desktop/php.ini /app/data/php.ini && \
    cloudron push --app <www.example4.com> /Users/<username>/Desktop/php.ini /app/data/php.ini && \
    cloudron push --app <www.example5.com> /Users/<username>/Desktop/php.ini /app/data/php.ini && \
    cloudron push --app <www.example6.com> /Users/<username>/Desktop/php.ini /app/data/php.ini && \
    cloudron push --app <www.example7.com> /Users/<username>/Desktop/php.ini /app/data/php.ini && \
    cloudron push --app <www.example8.com> /Users/<username>/Desktop/php.ini /app/data/php.ini && \
    cloudron push --app <www.example9.com> /Users/<username>/Desktop/php.ini /app/data/php.ini && \
    cloudron push --app <www.example0.com> /Users/<username>/Desktop/php.ini /app/data/php.ini
    

    ...etc.

    I haven't scripted it, but I will certainly look into doing that in the future if these types of tasks come up more often.

    --
    Dustin Dauncey
    www.d19.ca

    1 Reply Last reply
    1

  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Login

  • Don't have an account? Register

  • Login or register to search.