I can not register?
Hello there!
I have been trying to find a good solution to put a web desktop ontop of my NAS and eventually came across Puter. So, naturally I am selfhosting it.
It took me a while to figure out that I had to edit volatile/config/config.json to change the domain, and thus actually make the frontend properly talk to my backend. So far, so do-able.
But when I try to create an account so that I can actually do something, I see this:
internal server error: Error: must call .init(server) before you can call .getio()
at Object.getio (/srv/puter/packages/backend/src/socketio.js:34:19)
at mkdir (/srv/puter/packages/backend/src/helpers.js:1399:45)
at async generate_system_fsentries (/srv/puter/packages/backend/src/helpers.js:1479:22)
at async /srv/puter/packages/backend/src/routers/signup.js:269:5
at async errorHandledHandler (/srv/puter/packages/backend/src/api/eggspress.js:183:14)
I did not change anything aside from the config. This is what got generated and what I modified:
{
"config_name": "generated default config",
"env": "production",
"nginx_mode": true,
"server_id": "192.168.2.128",
"http_port": "auto",
"domain": "192.168.2.128",
"protocol": "http",
"contact_email": "[email protected]",
"services": {
"database": {
"engine": "sqlite",
"path": "puter-database.sqlite"
},
"thumbnails": {
"engine": "purejs"
},
"file-cache": {
"disk_limit": 16384,
"disk_max_size": 16384,
"precache_size": 16384,
"path": "./file-cache"
}
},
"cookie_name": "910173d5-73ef-4ccc-a213-4e6337f57d6e",
"jwt_secret": "<snip>",
"url_signature_secret": "<snip>",
"": null
}
This is running directly on the NAS where the RAID1 is installed into. So after I figure out logins and such, the next thing will be to link Puter to be using my storage. But... first things first. Why can't I register?
Kind regards, Ingwie
You should actually get a temporary account at initial visit of the page which you can "save" as a real account. That said, you're not the first to raise this issue, so there's something going on that we're not reproducing.
I would recommend ensuring that 192.168.2.128 has a domain name on your network (or perhaps on individual clients; ex: /etc/hosts for Linux/Mac) because Puter is going to try to take the domain name you provided and prepend subdomains to it. (api.192.168.2.128 won't resolve to anything but api.my-nas.local could)
We added a default user for initial setup. Let me know if you're able to login with this user.
Impossible to connect to puter for me:
@zarevskaya - can you run this with the "Local Development" instructions and see if you get the same error? If you try, try to catch the stack trace if you can. If there's too much console output that comes after, you can run the commands alarm:list followed by alarm:info <id of alarm> in the development console.
Not better, sorry.
I have the same issue as @zarevskaya. Cannot log in using the deafult user and generated password
If you're running in Docker and the external port is different from the port Puter is listening on, make sure http_port is set to the listen port and pub_port is set to the external port in the config.
Any additional information anyone experiencing this issue can provide about their configuration will be helpful.
Hello and apologies for my late reply; got swamped by work pretty hard...
So, I updated the repo and attempted to try a clean install, but there was no arm64 image - so I modified the docker-compose file to build off of the dockerfile (build: { context: . })
But while building I get this:
Step 11/14 : RUN npm cache clean --force && npm install
---> Running in 4e6913906448
npm WARN using --force Recommended protections disabled.
npm WARN deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: 16.1.1
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup [
npm WARN cleanup '/opt/puter/app/node_modules/better-sqlite3',
npm WARN cleanup [Error: ENOTEMPTY: directory not empty, rmdir '/opt/puter/app/node_modules/better-sqlite3'] {
npm WARN cleanup errno: -39,
npm WARN cleanup code: 'ENOTEMPTY',
npm WARN cleanup syscall: 'rmdir',
npm WARN cleanup path: '/opt/puter/app/node_modules/better-sqlite3'
npm WARN cleanup }
npm WARN cleanup ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path /opt/puter/app/node_modules/diskusage
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | arm64
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration
npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
npm ERR! gyp ERR! find Python checking if "python3" can be used
npm ERR! gyp ERR! find Python - executable path is ""
npm ERR! gyp ERR! find Python - "" could not be run
npm ERR! gyp ERR! find Python checking if "python" can be used
npm ERR! gyp ERR! find Python - executable path is ""
npm ERR! gyp ERR! find Python - "" could not be run
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python You need to install the latest version of Python.
npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
npm ERR! gyp ERR! find Python you can try one of the following options:
npm ERR! gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
npm ERR! gyp ERR! find Python (accepted by both node-gyp and npm)
npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
npm ERR! gyp ERR! find Python npm config set python "/path/to/pythonexecutable"
npm ERR! gyp ERR! find Python For more information consult the documentation at:
npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
npm ERR! gyp ERR! stack at PythonFinder.fail (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:306:11)
npm ERR! gyp ERR! stack at PythonFinder.findPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:164:17)
npm ERR! gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
npm ERR! gyp ERR! stack at async configure (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:23:18)
npm ERR! gyp ERR! stack at async run (/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js:81:18)
npm ERR! gyp ERR! System Linux 6.6.16-current-rockchip64
npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /opt/puter/app/node_modules/diskusage
npm ERR! gyp ERR! node -v v21.7.2
npm ERR! gyp ERR! node-gyp -v v10.0.1
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in: /home/node/.npm/_logs/2024-04-05T21_07_25_583Z-debug-0.log
The command '/bin/sh -c npm cache clean --force && npm install' returned a non-zero code: 1
ERROR: Service 'puter' failed to build : Build failed
Will be fixing the Dockerfile first and get back once I have a booted UI again. Probably quite simple, but just wanted to let you know.
For reference:
# git rev-parse HEAD
343edbff51a250ec558868706661056d8925f4c1
The good news: It works... kinda. Just had to add python3 make gcc g++ to the apk add command so node-gyp worked as expected.
However, now I have this:
I do use a Caddy reverse proxy setup but I can not seem to un-configure the api. part so I will have to go and reconfigure Caddy to make certs for this subdomain - which is a bit of a pain, since it's a shared store with my VPS (the actual, real birb.it server - the one at home is just my router resolving it to itself so I can use all services and then some without having to route outwards first).
Is there a config setting, perhaps?
Anyway, here's the minimal Dockerfile changes.
diff --git a/Dockerfile b/Dockerfile
index 8ccd879..0613eda 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -6,7 +6,7 @@ LABEL license="AGPL-3.0,https://github.com/HeyPuter/puter/blob/master/LICENSE.tx
LABEL version="1.2.46-beta-1"
# Install git (required by Puter to check version)
-RUN apk add --no-cache git
+RUN apk add --no-cache git python3 make gcc g++
# Setup working directory
RUN mkdir -p /opt/puter/app
Got my cert and the setup working. Aright, now to find out where the other problems lie. Among this, I ended up looking at why exactly the api-subdomain is used, and if it can be configured.
Short answer: No. https://github.com/HeyPuter/puter/blob/c6fb75c65f683470e087fdaa70bffaaf5f27ad70/packages/backend/src/routers/df.js#L55
Next: I wondered why it kept trying to access api.os.birb.it:4100. nginx_mode is already true and I specified .http_port in the config.
So far, my search has led me here: https://github.com/HeyPuter/puter/blob/c6fb75c65f683470e087fdaa70bffaaf5f27ad70/packages/backend/src/services/WebServerService.js#L65 and here: https://github.com/HeyPuter/puter/blob/c6fb75c65f683470e087fdaa70bffaaf5f27ad70/packages/backend/src/config.js#L112
Ah, there is the issue: Because I specified 4100, this is where the app is served on (WebServerService.js) but is also what is used when making requests (config.js).
So after all this, I was finally able to not just launch, but also log in using the default_user! Success! It just cost me more headache than I'd've liked. ;)
What I can tell you: Please do split http_port into actual configurations for port used for serving and port used for requesting. This could solve a few issues on it's own, since 443 is a previleged port and your default range is +20; meaning no unprevileged port would be found any time soon to be used by an unprevileged user.
I do have my login now and the likes; so I will go and try to get access to the actual filesystem configured and working. ^^
Hi @IngwiePhoenix, thanks for sending the details of what you ran into during setup! Reports like these are incredibly helpful.
I think the requirement for those Dockerfile changes was introduced by the diskusage dependency. I added an issue to track replacing this with our own implementation.
why exactly the api-subdomain is used, and if it can be configured
The main reason for this is CORS. For the API, we allow requests from any origin because that's how apps work in Puter, but we didn't want to do the same thing for the Puter UI itself. However this is a big pain point for installations, so recent commits on main have this configuration option available:
"experimental_no_subdomain": true,
Please do split http_port into actual configurations for port used for serving and port used for requesting
On this I completely agree, but I'm a little confused; isn't this what we're doing by having both the http_port and pub_port options?
Also can you submit a PR for the Dockerfile changes? I'd git apply it myself but then you won't get credit for it in the change history