sinamics / ztnet

ZTNET - ZeroTier Web UI for Private Controllers with Multiuser and Organization Support.
https://ztnet.network
GNU General Public License v3.0
392 stars 36 forks source link

[Support]: Standalone installation ( public key is not available ) #337

Closed TeemAlive closed 2 months ago

TeemAlive commented 3 months ago

📝 Inquiry

没有标注arm机器无法使用,但我使用直装代码安装后,程序并没有在运行

🔖 Version

最新

🔧 Deployment Type

💻 Operating System

Ubuntu

📚 Any Other Information That May Be Helpful

Welcome to Ubuntu 18.04.6 LTS (GNU/Linux 5.4.0-1102-oracle aarch64)


(" "(" ") (" \ |" \ /" "| (" ") _/ :)))/ _/ |.\ \ | (: __) )_/ \/
/ / _ / |: \ \ | \/ | _ /
// _
|. | |. \ . | // _
) |. |
(: / "\ \: | | \ \ | (: "| \: |
___) __| _|\
) ___) __|

[-] Running script for Ubuntu.Last updated: 03 Mar 2024

ZTNET installation script. This script will perform the following actions:

  1. Install PostgreSQL if it's not already present.
  2. Ensure Node.js version 18 is installed.
  3. Install Zerotier if it's missing.
  4. Clone the ZTnet repository into the /tmp folder and build artifacts from the latest tag.
  5. Transfer the artifacts to the /opt/ztnet directory.

❔ Enter the ZTnet server IP address or domain name. Press Enter to use the default. [Default: 10.0.0.27]:(xx) ❔ Use silent (non-verbose) installation with minimal output? (Yes/No) [Default: Yes]: no

[✔] Running script for Ubuntu. [✔] Starting installation... [-] Updating apt... WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Hit:1 https://deb.nodesource.com/node_18.x nodistro InRelease Get:2 http://deb.debian.org/debian buster-backports InRelease [51.4 kB] Hit:3 http://download.zerotier.com/debian/bionic bionic InRelease Get:4 https://download.docker.com/linux/ubuntu bionic InRelease [64.4 kB] Err:2 http://deb.debian.org/debian buster-backports InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 Hit:5 http://ports.ubuntu.com/ubuntu-ports bionic-security InRelease Hit:6 http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports bionic InRelease Get:7 http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports bionic-updates InRelease [88.7 kB] Hit:8 http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports bionic-backports InRelease Get:9 http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports bionic-updates/main arm64 Packages [1846 kB] Reading package lists... W: GPG error: http://deb.debian.org/debian buster-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 E: The repository 'http://deb.debian.org/debian buster-backports InRelease' is not signed. [✔] Updating apt... [✔] git is already installed. [✔] curl is already installed. [✔] jq is already installed. [-] Installing postgresql... WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists... Building dependency tree... Reading state information... postgresql is already the newest version (10+190ubuntu0.1). 0 upgraded, 0 newly installed, 0 to remove and 46 not upgraded. [✔] Installing postgresql... [-] Installing postgresql-contrib... WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists... Building dependency tree... Reading state information... postgresql-contrib is already the newest version (10+190ubuntu0.1). 0 upgraded, 0 newly installed, 0 to remove and 46 not upgraded. [✔] Installing postgresql-contrib... [✔] Setting environment variables... [✔] Checking PostgreSQL user permissions... [✔] User exists with required permissions. [-] Installing Node.js 18, this may take a while...Hit:1 http://download.zerotier.com/debian/bionic bionic InRelease Get:2 https://download.docker.com/linux/ubuntu bionic InRelease [64.4 kB] Get:3 http://deb.debian.org/debian buster-backports InRelease [51.4 kB] Err:3 http://deb.debian.org/debian buster-backports InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 Hit:4 http://ports.ubuntu.com/ubuntu-ports bionic-security InRelease Hit:5 http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports bionic InRelease Hit:6 http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports bionic-updates InRelease Hit:7 http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports bionic-backports InRelease Reading package lists... W: GPG error: http://deb.debian.org/debian buster-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 E: The repository 'http://deb.debian.org/debian buster-backports InRelease' is not signed. Reading package lists... Building dependency tree... Reading state information... ca-certificates is already the newest version (20230311ubuntu0.18.04.1). curl is already the newest version (7.58.0-2ubuntu3.24). gnupg is already the newest version (2.2.4-1ubuntu1.6). 0 upgraded, 0 newly installed, 0 to remove and 46 not upgraded. Get:1 http://deb.debian.org/debian buster-backports InRelease [51.4 kB] Get:2 https://download.docker.com/linux/ubuntu bionic InRelease [64.4 kB] Hit:3 https://deb.nodesource.com/node_18.x nodistro InRelease Err:1 http://deb.debian.org/debian buster-backports InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 Hit:4 http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports bionic InRelease Hit:5 http://ports.ubuntu.com/ubuntu-ports bionic-security InRelease Hit:6 http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports bionic-updates InRelease Hit:7 http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports bionic-backports InRelease Hit:8 http://download.zerotier.com/debian/bionic bionic InRelease Reading package lists... W: GPG error: http://deb.debian.org/debian buster-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 E: The repository 'http://deb.debian.org/debian buster-backports InRelease' is not signed. Reading package lists... Building dependency tree... Reading state information... Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:

The following packages have unmet dependencies: nodejs : Depends: libc6 (>= 2.28) but 2.27-3ubuntu1.5 is to be installed E: Unable to correct problems, you have held broken packages. Reading package lists... Building dependency tree... Reading state information... Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:

The following packages have unmet dependencies: npm : Depends: nodejs Depends: node-abbrev (>= 1.0.4) but it is not going to be installed Depends: node-ansi (>= 0.3.0-2) but it is not going to be installed Depends: node-ansi-color-table but it is not going to be installed Depends: node-archy but it is not going to be installed Depends: node-block-stream but it is not going to be installed Depends: node-fstream (>= 0.1.22) but it is not going to be installed Depends: node-fstream-ignore but it is not going to be installed Depends: node-github-url-from-git but it is not going to be installed Depends: node-glob (>= 3.1.21) but it is not going to be installed Depends: node-graceful-fs (>= 2.0.0) but it is not going to be installed Depends: node-inherits but it is not going to be installed Depends: node-ini (>= 1.1.0) but it is not going to be installed Depends: node-lockfile but it is not going to be installed Depends: node-lru-cache (>= 2.3.0) but it is not going to be installed Depends: node-minimatch (>= 0.2.11) but it is not going to be installed Depends: node-mkdirp (>= 0.3.3) but it is not going to be installed Depends: node-gyp (>= 0.10.9) but it is not going to be installed Depends: node-nopt (>= 3.0.1) but it is not going to be installed Depends: node-npmlog but it is not going to be installed Depends: node-once but it is not going to be installed Depends: node-osenv but it is not going to be installed Depends: node-read but it is not going to be installed Depends: node-read-package-json (>= 1.1.0) but it is not going to be installed Depends: node-request (>= 2.25.0) but it is not going to be installed Depends: node-retry but it is not going to be installed Depends: node-rimraf (>= 2.2.2) but it is not going to be installed Depends: node-semver (>= 2.1.0) but it is not going to be installed Depends: node-sha but it is not going to be installed Depends: node-slide but it is not going to be installed Depends: node-tar (>= 0.1.18) but it is not going to be installed Depends: node-underscore but it is not going to be installed Depends: node-which but it is not going to be installed E: Unable to correct problems, you have held broken packages. [✔] Installing Node.js 18, this may take a while... [-] Installing ZeroTier... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 17657 100 17657 0 0 39412 0 --:--:-- --:--:-- --:--:-- 39412

*** ZeroTier Service Quick Install for Unix-like Systems

*** Tested OSes / distributions:

MacOS (10.13+) (just installs ZeroTier One.pkg) Debian Linux (7+) RedHat/CentOS Linux (6+) Fedora Linux (16+) SuSE Linux (12+) Mint Linux (18+)

Supported architectures vary by OS / distribution. We try to support every system architecture supported by the target.

*** Please report problems to contact@zerotier.com and we will try to fix.

*** Detecting Linux Distribution

*** Found Ubuntu, creating /etc/apt/sources.list.d/zerotier.list Get:1 http://deb.debian.org/debian buster-backports InRelease [51.4 kB] Hit:2 http://download.zerotier.com/debian/bionic bionic InRelease Get:3 https://download.docker.com/linux/ubuntu bionic InRelease [64.4 kB] Hit:4 https://deb.nodesource.com/node_18.x nodistro InRelease Err:1 http://deb.debian.org/debian buster-backports InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 Hit:5 http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports bionic InRelease Hit:6 http://ports.ubuntu.com/ubuntu-ports bionic-security InRelease Hit:7 http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports bionic-updates InRelease Hit:8 http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports bionic-backports InRelease Reading package lists... W: GPG error: http://deb.debian.org/debian buster-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 E: The repository 'http://deb.debian.org/debian buster-backports InRelease' is not signed. Reading package lists... Building dependency tree... Reading state information... gpg is already the newest version (2.2.4-1ubuntu1.6). 0 upgraded, 0 newly installed, 0 to remove and 46 not upgraded.

*** Installing zerotier-one package... Hit:1 http://download.zerotier.com/debian/bionic bionic InRelease Get:2 http://deb.debian.org/debian buster-backports InRelease [51.4 kB] Get:3 https://download.docker.com/linux/ubuntu bionic InRelease [64.4 kB] Hit:4 https://deb.nodesource.com/node_18.x nodistro InRelease Err:2 http://deb.debian.org/debian buster-backports InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 Hit:5 http://ports.ubuntu.com/ubuntu-ports bionic-security InRelease Hit:6 http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports bionic InRelease Hit:7 http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports bionic-updates InRelease Hit:8 http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports bionic-backports InRelease Reading package lists... W: GPG error: http://deb.debian.org/debian buster-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 E: The repository 'http://deb.debian.org/debian buster-backports InRelease' is not signed. Reading package lists... Building dependency tree... Reading state information... zerotier-one is already the newest version (1.12.2). 0 upgraded, 0 newly installed, 0 to remove and 46 not upgraded.

Package installation failed! Unfortunately there may not be a package for your architecture or distribution. For the source go to: *** https://github.com/zerotier/ZeroTierOne

Cloning into '/tmp/ztnet/repo'... [✔] Installing ZeroTier... [✔] Cloned Ztnet repository. [-] Checking out tag: 0.5.11Note: checking out '0.5.11'.

You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example:

git checkout -b

HEAD is now at 1354c3f Merge pull request #318 from sinamics/wrap_listening_list [✔] Checking out tag: 0.5.11 [-] Installing dependencies...main: line 245: npm: command not found Authentication failed for user ztnet. [✔] Installing dependencies... [-] Operation completed.

The user 'ztnet' currently lacks read/write access to the database 'ztnet'. To address this issue, we recommend generating a new password. Please note, generating a new password will not affect the existing database in any way. The new password will be securely stored in the '/opt/ztnet/.env' file for future use.

❔ Do you want to generate a new password? (Yes/No) [Default: Yes]: Yes [✔] Operation completed. [-] Generating new password...Usage: grep [OPTION]... PATTERN [FILE]... Try 'grep --help' for more information. [✔] Generating new password... [-] Database migrations...main: line 245: npx: command not found [✔] Database migrations... [-] Seed Database...main: line 245: npx: command not found [✔] Seed Database... [-] Building Ztnet artifacts... This may take a while.main: line 245: npm: command not found [✔] Building Ztnet artifacts... This may take a while. [-] Copying files to /opt/ztnet...cp: cannot stat '/tmp/ztnet/repo/.next/standalone/.': No such file or directory cp: cannot stat '/tmp/ztnet/repo/.next/static': No such file or directory [✔] Copying files to /opt/ztnet... [-] Creating systemd service...

Cleaning up... NOTE!

ZTnet is waiting for you at: http://(xx):3000

root@teem01:~# systemctl status ztnet ● ztnet.service - ZTnet Service Loaded: loaded (/etc/systemd/system/ztnet.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Wed 2024-03-13 16:42:07 CST; 2min 10s ago Process: 23608 ExecStart=/usr/bin/node /opt/ztnet/server.js (code=exited, status=203/EXEC) Main PID: 23608 (code=exited, status=203/EXEC)

Mar 13 16:42:07 teem01 systemd[1]: ztnet.service: Service hold-off time over, scheduling restart. Mar 13 16:42:07 teem01 systemd[1]: ztnet.service: Scheduled restart job, restart counter is at 5. Mar 13 16:42:07 teem01 systemd[1]: Stopped ZTnet Service. Mar 13 16:42:07 teem01 systemd[1]: ztnet.service: Start request repeated too quickly. Mar 13 16:42:07 teem01 systemd[1]: ztnet.service: Failed with result 'exit-code'. Mar 13 16:42:07 teem01 systemd[1]: Failed to start ZTnet Service.

sinamics commented 3 months ago

The problem is related to GPG errors with the backports repository. Try adding the keys manually: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 6ED0E7B82643E131

I guess you see those errors if you just type sudo apt update

sinamics commented 3 months ago

can you please post the output of this command: cat /etc/apt/sources.list

Seems like you got debian source links in your ubuntu?

TeemAlive commented 3 months ago

root@teem01:~# cat /etc/apt/sources.list

Note, this file is written by cloud-init on first boot of an instance

modifications made here will not survive a re-bundle.

if you wish to make changes you can:

a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg

or do the same in user-data

b.) add sources in /etc/apt/sources.list.d

c.) make changes to template file /etc/cloud/templates/sources.list.tmpl

See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to

newer versions of the distribution.

deb http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports/ focal main restricted

deb-src http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports/ bionic main restricted

Major bug fix updates produced after the final release of the

distribution.

deb http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted

deb-src http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted

N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu

team. Also, please note that software in universe WILL NOT receive any

review or updates from the Ubuntu security team.

deb http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports/ focal universe

deb-src http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports/ bionic universe

deb http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports/ focal-updates universe

deb-src http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports/ bionic-updates universe

N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu

team, and may not be under a free licence. Please satisfy yourself as to

your rights to use the software. Also, please note that software in

multiverse WILL NOT receive any review or updates from the Ubuntu

security team.

deb http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports/ focal multiverse

deb-src http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports/ bionic multiverse

deb http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports/ focal-updates multiverse

deb-src http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports/ bionic-updates multiverse

N.B. software from this repository may not have been tested as

extensively as that contained in the main release, although it includes

newer versions of some applications which may provide useful features.

Also, please note that software in backports WILL NOT receive any review

or updates from the Ubuntu security team.

deb http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted universe multiverse

deb-src http://ap-sydney-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted universe multiverse

Uncomment the following two lines to add software from Canonical's

'partner' repository.

This software is not part of Ubuntu, but is offered by Canonical and the

respective vendors as a service to Ubuntu users.

deb http://archive.canonical.com/ubuntu bionic partner

deb-src http://archive.canonical.com/ubuntu bionic partner

deb http://ports.ubuntu.com/ubuntu-ports focal-security main restricted

deb-src http://ports.ubuntu.com/ubuntu-ports bionic-security main restricted

deb http://ports.ubuntu.com/ubuntu-ports focal-security universe

deb-src http://ports.ubuntu.com/ubuntu-ports bionic-security universe

deb http://ports.ubuntu.com/ubuntu-ports focal-security multiverse

deb-src http://ports.ubuntu.com/ubuntu-ports bionic-security multiverse

root@teem01:~#

TeemAlive commented 3 months ago

Ubuntu与Debian的软件包在大多数情况下是兼容的。 我是初学者,不确定两者会不会有冲突,我也将Ubuntu 18.04.6 LTS升级为Ubuntu 20.04.6 LTS 希望我的安装过程对软件维护有所帮助

github-actions[bot] commented 2 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 2 months ago

This issue was closed because it has been inactive for 3 days since being marked as stale.