import{_ as e,o as a,c as t,R as n}from"./chunks/framework.44fd0451.js";const g=JSON.parse('{"title":"Nezha server over Argo tunnel","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/case/case5.md","filePath":"en_US/case/case5.md","lastUpdated":1698060756000}'),s={name:"en_US/case/case5.md"},o=n(`

Nezha server over Argo tunnel

Contributors:

GitHub project: Argo-Nezha-Service-Container

Mirror backup (not live update): Argo-Nezha-Service-Container


Catalog


Project Features.

image

How to get Argo authentication: json or token

The Argo Tunnel authentication methods are json and token, use one of the two methods.

(Methods 1 - Josn):

Easily get Argo tunnel json information through Cloudflare Json Generation Network: https://fscarmen.cloudflare.now.cc

image

Visit Cloudflare website, add the domain name of the client reporting data (tcp) and ssh (optional) in the DNS record of the corresponding domain, and turn on Orange Cloud to enable CDN.

imageimage

(Methods 2 - Token): Manually generate Argo tunnel token information via Cloudflare website.

Go to the cf website: https://dash.cloudflare.com/ and go to zero trust to generate token tunnels and messages.

imageimageimageimageimageimageimage

Prepare variables to be used

image

Add https:// to the beginning of the panel's domain name and /oauth2/callback to the end of the callback address.

imageimageimageimageimage

PaaS Deployment Example

Image fscarmen/argo-nezha:latest, supports amd64 and arm64 architectures.

Variables used

Variable NameRequiredRemarks
GH_USERYesgithub username for panel admin authorization
GH_CLIENTIDyesapply on github
GH_CLIENTSECRETyesapply on github
GH_BACKUP_USERNoThe github username for backing up Nezha's server-side database on github, if not filled in, it is the same as the account GH_USER for panel management authorization
GH_REPONoThe github repository for backing up Nezha's server-side database files on github
GH_EMAILNogithub's mailbox for git push backups to remote repositories
GH_PATNogithub's PAT
ARGO_AUTHYesArgo Json from https://fscarmen.cloudflare.now.cc
Argo token from Cloudflare official website
DATA_DOMAINYesClient-server communication argo domain name
WEB_DOMAINYesPanel argo domain
SSH_DOMAINNossh for argo domain
SSH_PASSWORDnopassword for ssh, only works after setting SSH_JSON, default password

Koyeb

Deploy to Koyeb

imageimageimageimageimage

VPS Deployment Example

docker deployment

docker run -dit \\
           --name nezha_dashboard \\
           --restart always \\
           -e GH_USER=<fill in github username> \\
           -e GH_EMAIL=<fill in github email> \\
           -e GH_PAT=<fill in the obtained> \\
           -e GH_REPO=<fill in customized> \\
           -e GH_CLIENTID=<fill in acquired> \\
           -e GH_CLIENTSECRET=<fill in acquired> \\
           -e ARGO_AUTH='<Fill in the fetched Argo json or token>' \\
           -e WEB_DOMAIN=<fill in customized> \\
           -e DATA_DOMAIN=<fill in customized> \\
           -e SSH_DOMAIN=<fill in customized> \\
           -e SSH_PASSWORD=<insert customized> \\
           fscarmen/argo-nezha

docker-compose deployment

version: '3.8'
services.
    argo-nezha.
        image: fscarmen/argo-nezha
        container_name: nezha_dashboard
        restart: always
        environment:
            - GH_USER=<fill in github username>
            - GH_EMAIL=<fill in your github email>
            - GH_PAT=<<fill in obtained>
            - GH_REPO=<fill in customized>
            - GH_CLIENTID=<fill in obtained>
            - GH_CLIENTSECRET=<fill in fetched>
            - ARGO_AUTH='<Fill in the fetched Argo json or token>'
            - WEB_DOMAIN=<fill customized>
            - DATA_DOMAIN=<fill in customized>
            - SSH_DOMAIN=<insert customized>
            - SSH_PASSWORD=<fill customized>

Client Access

Transfer via gRPC, no additional configuration required. Use the installation method given in the panel, for example

curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && sudo ./nezha.sh install_agent data.seales.nom.za 443 eAxO9IF519fKFODlW0 --tls

SSH access

<filepath>/cloudflared access ssh --hostname ssh.seals.nom.za
imageimageimage

Automatically restore backups

The following is an example of restoring a file with the name dashboard-2023-04-23-13:08:37.tar.gz.

! image

Manually restore the backup

bash /dashboard/restore.sh <filename>
image

Migrating data

tar czvf dashboard.tar.gz /dashboard

Main catalog files and descriptions

.
|-- dashboard
|   |-- app                  # Nezha panel main program
|   |-- argo.json            # Argo tunnel json file, which records information about using the tunnel.
|   |-- argo.yml             # Argo tunnel yml file, used for streaming web, gRPC and ssh protocols under a single tunnel with different domains.
|   |-- backup.sh            # Backup data scripts
|   |-- data
|   |   |-- config.yaml      # Configuration for the Nezha panel, e.g. Github OAuth2 / gRPC domain / port / TLS enabled or not.
|   |   \`-- sqlite.db        # SQLite database file that records all severs and cron settings for the panel.
|   |-- entrypoint.sh        # The main script, which is executed after the container is run.
|   |-- nezha.csr            # SSL/TLS certificate signing request
|   |-- nezha.key            # Private key information for SSL/TLS certificate.
|   |-- nezha.pem            # SSL/TLS Privacy Enhancement Email
|   \`-- restore.sh           # Restore backup scripts
|-- usr
|   \`-- local
|       \`-- bin
|           |-- cloudflared  # Cloudflare Argo tunnel main program.
|           |-- grpcwebproxy # gRPC reverse proxy main program.
|           \`-- nezha-agent  # Nezha client, used to monitor the localhost.
|-- dbfile                   # Record the name of the latest restore or backup file
\`-- version                  # Record the current panel app version

Acknowledgements for articles and projects by

Disclaimer

`,85),r=[o];function l(i,c,h,d,p,m){return a(),t("div",null,r)}const f=e(s,[["render",l]]);export{g as __pageData,f as default};