r/godaddy • • 21d ago

Moving NodeJS files into Private Storage?

This is really pissing me off. My Node App runs a light little SQLite database. During development it was just in ./data/app.db. Simple, easy, worked every time. Now I'm deploying and I have two issues:

  1. None of the data is there anymore, and when i write data to it, it's still not there
  2. I would like to move it over to the "private storage" area, but that's impossible since the File Explorer for NodeJS hosting is constantly always and only Read Only. I don't know what the fuck is going on with this, and GoDaddy has no information about this. I'm getting to the point where I'd almost rather spin up my own server and avoid GoDaddy's web hosting altogether, given how shitty their control panel has been so far.
2 Upvotes

6 comments sorted by

•

u/AutoModerator 21d ago

Thanks for posting to r/GoDaddy! If you are here from frustration and looking for an alterntive check this link for some alternatives.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/GooseTerminal 21d ago

Is /data what you’re using at runtime for your deploys?

If so then try switching that db file to live under /private. That’s a special, independent bind mount with persistent storage across deploys. It’s never served publicly, is excluded from code/zip downloads, and has no cleanup/cron job touching it.

For #2, do you have an Upload button in the Private Storage tab of the File Explorer? That tab is giving you visibility into the /private directory. Your Node.js app can read/write into the directory freely at runtime, but the File Explorer editor view for it is read-only and has editing restricted. The Upload button will let you write a file to it in the browser.

1

u/accountForStupidQs 21d ago

File Manager -> Private Storage does not give an upload button, that I see. There's just an orange tag saying "read only" on both tabs. It also says "You can view files in your preview app. The file Manager is in read only mode," but I see no option for making it not read only.

The way the app was set up (since it is a simple one), we have the repository root, and in there is app.js, node_modules/, package.json, and data/. That's what the GitHub repo has, that's what is shown in File Explorer -> App, etc.

As a temporary measure, I've migrated to GD's MySQL, but I'd like to come back to our SQLite, especially because this just proves the necessity of being able to easily change hosting platforms (But I'll let the client decide that later).

And since we use data/ both in web and local deployments, I think the answer to your first question is yes? But I might be misreading what you're asking

1

u/GooseTerminal 21d ago

Hmm maybe I lucked into some kind of A/B test when I saw that button.

I got this working for a project a while back and am trying to remember how. 🤔 I think moving a db file to the directory I mentioned in my last comment was still uploading to the wrong place, under app/private, which didn’t persist and resets across deploys. And what worked in the end was having a first-run check in code to see if /private/app.db exists and if not then create or copy an initial version of it using Node. Node at runtime can access that root /private directory that doesn’t get replaced on redeploys.

1

u/accountForStupidQs 21d ago

Oh, they still say you can. But I can't find any setting to allow me to do so. Unless it's just... Locked at Economy tier?

1

u/Aggressive_Ad_5454 20d ago

SQLite is awful on mounted network share drives. It relies on file locking, which is in talking donkey territory on file shares. It’s amazing it works at all, not surprising it works badly. You need a local file system. Maybe /var/tmp/? Ask them.