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


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Question about editing and saving files that are currently read only

    Mastodon
    4
    9
    106
    Loading More Posts
    • 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
      ScottyMojo last edited by

      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.

      jdaviescoates 1 Reply Last reply Reply Quote 0
      • jdaviescoates
        jdaviescoates @ScottyMojo last edited by

        @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 Reply Quote 2
        • robi
          robi last edited by

          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.

          Life of Advanced Technology

          1 Reply Last reply Reply Quote 1
          • S
            ScottyMojo last edited by

            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 robi 2 Replies Last reply Reply Quote 0
            • S
              ScottyMojo @ScottyMojo last edited by

              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 Reply Quote 0
              • robi
                robi @ScottyMojo last edited by

                @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.

                Life of Advanced Technology

                S 1 Reply Last reply Reply Quote 0
                • S
                  ScottyMojo @robi last edited by

                  @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! 😞

                  subven robi 2 Replies Last reply Reply Quote 0
                  • subven
                    subven @ScottyMojo last edited by

                    @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 Reply Quote 0
                    • robi
                      robi @ScottyMojo last edited by

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

                      Life of Advanced Technology

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post
                      Powered by NodeBB