【问题标题】:How to apply Node.js secuirty updates?如何应用 Node.js 安全更新?
【发布时间】:2018-09-02 15:56:19
【问题描述】:

如何应用 node.js 安全补丁? 在 ubuntu 16.04 上使用流星 js 时是否有特定的流程来应用安全补丁?

【问题讨论】:

  • 欢迎来到 Stack Overflow。我可以建议你把这个问题放在askubuntu.com 上吗?那里的贡献者可能有很好的答案。

标签: node.js security meteor patch


【解决方案1】:

当您在生产模式下运行流星时,它作为(纯)node.js 应用程序运行。因此,对您的问题的简短回答是仅更新节点(取决于您如何安装它;可能是sudo apt-get update -y && sudo apt-get install nodejs -y)。

您可以使用多种工具来部署流星应用程序(例如meteor-up),但它们都具有基本相同的两个步骤,您自己很容易做到:

  1. 将您的流星应用程序捆绑到 node.js 应用程序中 meteor build ../my-build-output-folder --server https://my.production.site.url --architecture os.linux.x86_64

    这将在您指定的文件夹中创建一个 meteor-server.tar.gz 文件,其中包含 node.js 应用程序。然后该过程(根据捆绑包中包含的README 文件):

    1. meteor-server.tar.gz 文件传输到您的服务器
    2. tar -zxvf meteor-server.tar.gz提取节点应用
    3. 包含的README 文件告诉您其余的:

自述文件:

This is a Meteor application bundle. It has only one external dependency:
Node.js v8.11.4. To run the application:

  $ (cd programs/server && npm install)
  $ export MONGO_URL='mongodb://user:password@host:port/databasename'
  $ export ROOT_URL='http://example.com'
  $ export MAIL_URL='smtp://user:password@mailhost:port/'
  $ node main.js

Use the PORT environment variable to set the port where the
application will listen. The default is 80, but that will require
root on most systems.
  1. 设置系统以在重新启动时存活,例如upstartpm2supervisorddocker

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-12-05
    • 1970-01-01
    • 2015-09-20
    • 2021-09-14
    • 2021-10-18
    • 2011-09-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多