Replies: 20 comments 8 replies
-
Hi there, Thank you for your interest in using Ztnet on FreeBSD! While Ztnet is designed to run in a Docker environment, you should be able to run it manually. Here's an off-the-cuff guide to help you get started. Install PostgreSQL and ZeroTierFirst, make sure PostgreSQL and ZeroTier are installed and configured on your FreeBSD server. Install Node.js and npmNext, install Node.js version 18. Setup Ztnet
|
Beta Was this translation helpful? Give feedback.
-
Thank you very much! I'll try and let you know if it works. |
Beta Was this translation helpful? Give feedback.
-
Agrrr! It fails with
I've manually installed
So it seems I have to wait until they update the package to 8.14.3 or higher. |
Beta Was this translation helpful? Give feedback.
-
try to downgrade sharp to version then install |
Beta Was this translation helpful? Give feedback.
-
Thanks! Downgrade of sharp:
So far looks good, but:
Bad luck :/ |
Beta Was this translation helpful? Give feedback.
-
seesm like prisma does not have pre-compiled engines for FreeBSD. |
Beta Was this translation helpful? Give feedback.
-
I can try to create a installer script for FreeBSD. Will see if i get time later this week. |
Beta Was this translation helpful? Give feedback.
-
Thank you so much. What I've done - just compiled
I'll better wait for your script... I don't have fire in pants ;) |
Beta Was this translation helpful? Give feedback.
-
try setting the env for your compiled version
|
Beta Was this translation helpful? Give feedback.
-
Unfortunately it didn't help. Still wants to download precompiled package. |
Beta Was this translation helpful? Give feedback.
-
sooo, i gave it a shot. Here is a brief overview of how i did it. Install PostgreSQL and ZeroTierpkg update
pkg install zerotier protobuf curl git node
# i used version 13, but 15 will most likely work as well.
pkg install postgresql13-server postgresql13-contrib
sysrc postgresql_enable=yes
service postgresql initdb
service postgresql start
zerotier-one -d Build Prisma BinaryI had to bump up to 16GB ram, and 8 cores on a I9 chip to build everyting without errors. git clone https://github.com/prisma/prisma-engines.git
cd prisma-engines
# Build all workspace binaries
cargo build --release
# Set environment variables
setenv PRISMA_CLI_QUERY_ENGINE_TYPE "binary"
setenv PRISMA_QUERY_ENGINE_BINARY "/root/prisma-engines/target/release/query-engine"
setenv PRISMA_FMT_BINARY "/root/prisma-engines/target/release/prisma-fmt"
setenv PRISMA_SCHEMA_ENGINE_BINARY "/root/prisma-engines/target/release/schema-engine"
# Rename libquery_engine.so to libquery_engine.node
mv /root/prisma-engines/target/release/libquery_engine.so /root/prisma-engines/target/release/libquery_engine.node
# set environment variable
setenv PRISMA_QUERY_ENGINE_LIBRARY /root/prisma-engines/target/release/libquery_engine.node Setup Ztnet
now you should be able to open ip:3000 in browser. As the zerotier-one is not installed in the usual folder Goto Admin => Controller and set zerotier url http://localhost:9993 and the authtoken.secret. |
Beta Was this translation helpful? Give feedback.
-
and btw, here is the compiled binaries if you can use them.
|
Beta Was this translation helpful? Give feedback.
-
OMG, thank you for support! |
Beta Was this translation helpful? Give feedback.
-
OK, so finally I launched "ztnet" on FreeBSD. I use FreeBSD 13.2-STABLE. I followed your descriptions above. Now... Some questions, insights, suggestions :)
I think it would be good for security reasons.
Three indicated items are offline, and should have OFFLINE status.
Once again, thanks for all your help! Much appreciated. |
Beta Was this translation helpful? Give feedback.
-
Do you mean
Understood. I'll try via reverse proxy to achieve HTTPS connection.
You are absolutely right! Downgraded controller to v1.10.6 and the status of offline nodes are now displayed correctly. |
Beta Was this translation helpful? Give feedback.
-
OK, wide env values,not So, I can change listening port, but node still listens on every NICs -> *.4000 I think (for future) it's better to bind only to loopback interface and use any reverse proxy to redirect node process to, for example: http://127.0.0.1:3000[4000 | whatever_port]. Cheers! |
Beta Was this translation helpful? Give feedback.
-
Just another question... :) There is a new tag v0.3.7. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Hi, FreeBSD devs updated |
Beta Was this translation helpful? Give feedback.
-
So i did some testing regards binding the lo interface. Set env setenv HOSTNAME 127.0.0.1 Then modify server.js to use this hostname edit server.listen(currentPort, hostname, async (err) => {
if (err) {
console.error("Failed to start server", err)
process.exit(1)
}
console.log(
'Listening on port',
currentPort,
'url: http://' + hostname + ':' + currentPort
)
}); Now the node is only listen on 127.0.0.1 root@freebsd:~ # sockstat -4 -l | grep 3000
root node 951 21 tcp4 127.0.0.1:3000 *:* |
Beta Was this translation helpful? Give feedback.
-
Yes, that worked, but unfortunately destroyed proxy access via domain name on HTTPS. I know this may be out of place, but ideally the web server is provided by a competitor "ztnuci". |
Beta Was this translation helpful? Give feedback.
-
Hi :)
I'm using FreeBSD on my home serve and don't have docker.
I use ztncui as own hosted controller, but it's not actively developed.
How can I use ztnet without docker?
I can install PostgreSQL database engine as a dependency too, this is not a problem.
Thanks for any tips :)
Beta Was this translation helpful? Give feedback.
All reactions