logo NodeSeekbeta

❗终于可以开源了[NodeCrypt]端到端加密聊天系统——cloudflare workers版

  • @sgm #79

    docker是最开始就写好了的,当时前后端分别是域名和域名/ws,等写好cloudflare workers后发现前后端可以直接是一个域名,不需要/ws,然后搞了半天dockerfile也没能适配,于是删掉了🌚。

  • 这个不错,部署一个,临时和别人分享东西的时候用

    有个问题:
    我在worker部署的时候,好像要手动添加构建命令,也不知道对不对

    npm run build
    

    不然部署的时候就会出现

    2025-06-28T14:04:33.183Z	Initializing build environment...
    2025-06-28T14:04:33.183Z	Initializing build environment...
    2025-06-28T14:04:39.641Z	Success: Finished initializing build environment
    2025-06-28T14:04:39.862Z	Cloning repository...
    2025-06-28T14:04:41.082Z	Detected the following tools from environment: [email protected], [email protected]
    2025-06-28T14:04:41.084Z	Restoring from dependencies cache
    2025-06-28T14:04:41.087Z	Restoring from build output cache
    2025-06-28T14:04:41.741Z	Installing project dependencies: npm clean-install --progress=false
    2025-06-28T14:05:08.327Z	
    2025-06-28T14:05:08.327Z	added 161 packages, and audited 162 packages in 26s
    2025-06-28T14:05:08.327Z	
    2025-06-28T14:05:08.328Z	31 packages are looking for funding
    2025-06-28T14:05:08.328Z	  run `npm fund` for details
    2025-06-28T14:05:08.328Z	
    2025-06-28T14:05:08.328Z	found 0 vulnerabilities
    2025-06-28T14:05:08.399Z	Executing user deploy command: npx wrangler deploy
    2025-06-28T14:05:10.075Z	
    2025-06-28T14:05:10.076Z	 ⛅️ wrangler 4.16.1 (update available 4.22.0)
    2025-06-28T14:05:10.076Z	---------------------------------------------
    2025-06-28T14:05:10.076Z	
    2025-06-28T14:05:10.107Z	
    2025-06-28T14:05:10.219Z	✘ [ERROR] The directory specified by the "assets.directory" field in your configuration file does not exist:
    2025-06-28T14:05:10.220Z	
    2025-06-28T14:05:10.220Z	  /opt/buildhome/repo/dist
    2025-06-28T14:05:10.220Z	
    2025-06-28T14:05:10.221Z	
    2025-06-28T14:05:10.221Z	
    2025-06-28T14:05:10.221Z	Cloudflare collects anonymous telemetry about your usage of Wrangler. Learn more at https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler/telemetry.md
    2025-06-28T14:05:10.246Z	🪵  Logs were written to "/opt/buildhome/.config/.wrangler/logs/wrangler-2025-06-28_14-05-09_296.log"
    2025-06-28T14:05:10.408Z	Failed: error occurred while running deploy command
    

    image

  • @zephyr-cn #93

    正常情况下,会自动写入的,构建里的npm run build就是vite打包,不能缺失。

  • BD

  • 大佬,在服务器端,不想使用docker应该怎么部署呢。

     npm install
     node server/server.js
    

    发现打不开8088端口。
    当我打包成静态文件

    npm run build
    

    发现是能打开界面,但是一直显示在连接中
    nginx配置文件如下

    server
    	{
        listen 80;
        listen 443 ssl http2 ;
        server_name chat.us.kg;
        index index.php index.html index.htm default.php default.htm default.html;
        root /www/chat.us.kg/dist;
    
        #CERT-APPLY-CHECK--END
    
        #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
        #error_page 404/404.html;
        #HTTP_TO_HTTPS_START
        if ($scheme = http) {
            return 301 https://$host$request_uri; 
        }
        #HTTP_TO_HTTPS_END
        ssl_certificate    /ssl/chat.us.kg/cert.crt;
        ssl_certificate_key    /ssl/chat.us.kg/private.key;
        ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
        ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
        ssl_prefer_server_ciphers on;
        ssl_session_cache shared:SSL:10m;
        ssl_session_timeout 10m;
        add_header Strict-Transport-Security "max-age=31536000";
        error_page 497  https://$host$request_uri;
    
        #SSL-END
    
    	client_header_buffer_size 32k;
        large_client_header_buffers 4 32k;
        client_max_body_size 90000m;
     
        sendfile   on;
        tcp_nopush on;
    
    
        #ERROR-PAGE-START  错误页配置,可以注释、删除或修改
        error_page 404 /404.html;
        #error_page 502 /502.html;
        #ERROR-PAGE-END
    
        fastcgi_connect_timeout 300;
        fastcgi_send_timeout 300;
        fastcgi_read_timeout 300;
        fastcgi_buffer_size 64k;
        fastcgi_buffers 4 64k;
        fastcgi_busy_buffers_size 128k;
        fastcgi_temp_file_write_size 256k;
    	fastcgi_intercept_errors on;
    
        location / {
        # 如果请求的文件存在,直接返回该文件
        try_files $uri $uri/ /index.php?$query_string;
        }
    
    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
        }
    
    }
    
    
  • 这个有通知功能么,比如有人发消息了,可以设置bark通知

  • 好东西,希望可以集成一个在线输入法,因为国内的输入法也不安全

  • 已经在cf workers上布署成功,谢谢楼主
    目前的问题是页面一刷新就退出聊天室

  • 感谢楼主

你好啊,陌生人!

我的朋友,看起来你是新来的,如果想参与到讨论中,点击下面的按钮!

📈用户数目📈

目前论坛共有72132位seeker

🎉欢迎新用户🎉