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


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
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
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Mastodon
  3. Question about editing and saving files that are currently read only

Question about editing and saving files that are currently read only

Scheduled Pinned Locked Moved Mastodon
9 Posts 4 Posters 1.2k Views 4 Watching
  • 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.
    • S Offline
      S Offline
      ScottyMojo
      wrote on last edited by
      #1

      I need to edit some Mastodon files but I keep getting a read only error in the terminal. :w! doesn't work. I also tried to chmod write permission to the file but it's a no go. How do I write the file after I've made changes? The files that I need to change are not available in the File Manager.

      jdaviescoatesJ 1 Reply Last reply
      0
      • S ScottyMojo

        I need to edit some Mastodon files but I keep getting a read only error in the terminal. :w! doesn't work. I also tried to chmod write permission to the file but it's a no go. How do I write the file after I've made changes? The files that I need to change are not available in the File Manager.

        jdaviescoatesJ Offline
        jdaviescoatesJ Offline
        jdaviescoates
        wrote on last edited by
        #2

        @ScottyMojo in short, you can't.

        The read only file sysyem is why updates, backups, cloning etc Just Work on Cloudron.

        I use Cloudron with Gandi & Hetzner

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

          If you want to make temporary changes that will revert on every App restart & upgrade, you can make those read-only changes in Recovery mode, which is in the Repair section of the App settings.

          If you mention the files you want to modify and an acceptable use case, there is a potential to generate a feature request to have the files exposed for editing in a future package update.

          Otherwise security is paramount and the read-only filesystem is a major part of that architecture.

          Conscious tech

          1 Reply Last reply
          1
          • S Offline
            S Offline
            ScottyMojo
            wrote on last edited by
            #4

            I read that trying to tie in the Cloudron user management doesn't work very well so during installation, I selected to let all of the user management be handled by Mastodon. The side effect to this is that I would like to create "admin" as a username for my admin account. However, in 4.x, there are reserved usernames that aren't allowing an account with the username to be created. After reading various posts, it sounds like I need to edit reserved_usernames in config/settings.yml.

            I also need to edit the media_attachment.rb file located in app/models/

            Thus far, I think those are the only files that I need to edit but I was wanting to play with the theme files too.

            Is it possible for me to open SSH as root from my Digital Ocean droplet and edit / write the files? If so, where is the Mastodon installation located? I can't find it. Do I need to chmod the file first and if so, is chmod +rwx filename the correct permissions?

            Thank you greatly for your guidance!

            S robiR 2 Replies Last reply
            0
            • S ScottyMojo

              I read that trying to tie in the Cloudron user management doesn't work very well so during installation, I selected to let all of the user management be handled by Mastodon. The side effect to this is that I would like to create "admin" as a username for my admin account. However, in 4.x, there are reserved usernames that aren't allowing an account with the username to be created. After reading various posts, it sounds like I need to edit reserved_usernames in config/settings.yml.

              I also need to edit the media_attachment.rb file located in app/models/

              Thus far, I think those are the only files that I need to edit but I was wanting to play with the theme files too.

              Is it possible for me to open SSH as root from my Digital Ocean droplet and edit / write the files? If so, where is the Mastodon installation located? I can't find it. Do I need to chmod the file first and if so, is chmod +rwx filename the correct permissions?

              Thank you greatly for your guidance!

              S Offline
              S Offline
              ScottyMojo
              wrote on last edited by
              #5

              To elaborate a bit more on the username issue, I also tried to manually create the "admin" username via command line but the reserved message displayed and couldn't create the account.

              Here is the example that I tried:

              RAILS_ENV=production bin/tootctl accounts create
              alice
              --email alice@example.com
              --confirmed
              --role Owner

              However, please note that this is just the example. I replaced the username and email address accordingly.

              From the sounds of things, I need to edit the reserved_usernames in config/settings.yml which will hopefully let me create the account, then grant it admin privileges via command line.

              i.e.

              RAILS_ENV=production bin/tootctl accounts modify alice --role admin

              1 Reply Last reply
              0
              • S ScottyMojo

                I read that trying to tie in the Cloudron user management doesn't work very well so during installation, I selected to let all of the user management be handled by Mastodon. The side effect to this is that I would like to create "admin" as a username for my admin account. However, in 4.x, there are reserved usernames that aren't allowing an account with the username to be created. After reading various posts, it sounds like I need to edit reserved_usernames in config/settings.yml.

                I also need to edit the media_attachment.rb file located in app/models/

                Thus far, I think those are the only files that I need to edit but I was wanting to play with the theme files too.

                Is it possible for me to open SSH as root from my Digital Ocean droplet and edit / write the files? If so, where is the Mastodon installation located? I can't find it. Do I need to chmod the file first and if so, is chmod +rwx filename the correct permissions?

                Thank you greatly for your guidance!

                robiR Offline
                robiR Offline
                robi
                wrote on last edited by
                #6

                @ScottyMojo said in Question about editing and saving files that are currently read only:

                Is it possible for me to open SSH as root from my Digital Ocean droplet and edit / write the files? If so, where is the Mastodon installation located? I can't find it. Do I need to chmod the file first and if so, is chmod +rwx filename the correct permissions?

                As I mentioned you do this via Recovery mode which makes the filesystem temporarily writable.

                From the UI, App Settings, Repair, Enter Recovery Mode.

                Then you use the convenient Terminal button from the top right of App Settings and it opens a shell right into the App container in your browser. No need to ssh.

                Conscious tech

                S 1 Reply Last reply
                0
                • robiR robi

                  @ScottyMojo said in Question about editing and saving files that are currently read only:

                  Is it possible for me to open SSH as root from my Digital Ocean droplet and edit / write the files? If so, where is the Mastodon installation located? I can't find it. Do I need to chmod the file first and if so, is chmod +rwx filename the correct permissions?

                  As I mentioned you do this via Recovery mode which makes the filesystem temporarily writable.

                  From the UI, App Settings, Repair, Enter Recovery Mode.

                  Then you use the convenient Terminal button from the top right of App Settings and it opens a shell right into the App container in your browser. No need to ssh.

                  S Offline
                  S Offline
                  ScottyMojo
                  wrote on last edited by
                  #7

                  @robi I put Mastodon in recovery mode, successfully made the edit and saved the file but when going out of recovery mode, Mastodon was restarted and my edit was gone! 😞

                  subvenS robiR 2 Replies Last reply
                  0
                  • S ScottyMojo

                    @robi I put Mastodon in recovery mode, successfully made the edit and saved the file but when going out of recovery mode, Mastodon was restarted and my edit was gone! 😞

                    subvenS Offline
                    subvenS Offline
                    subven
                    wrote on last edited by
                    #8

                    @ScottyMojo surprise, you were told earlier. If you can't make the changes while beeing in recovery mode, there is no way other then directly writing to the DB. I don't see the need nor your use case though and nothing speaks against an admin account that is named administrator (not reserved).

                    However, you can try to push #20695 so this gets added as a feature.

                    1 Reply Last reply
                    0
                    • S ScottyMojo

                      @robi I put Mastodon in recovery mode, successfully made the edit and saved the file but when going out of recovery mode, Mastodon was restarted and my edit was gone! 😞

                      robiR Offline
                      robiR Offline
                      robi
                      wrote on last edited by
                      #9

                      @ScottyMojo right, if you read the linked docs it says you need to start the app manually keeping recovery mode.

                      Conscious tech

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                        • Login

                        • Don't have an account? Register

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