zoukankan      html  css  js  c++  java
  • Ubuntu 上安装 ArtiPub(一款开源的一文多发平台)

    ArtiPub(Article Publisher 的简称,意为"文章发布者")是一款开源的一文多发平台,可以帮助文章作者将编写好的文章自动发布到掘金、SegmentFault、CSDN、知乎、开源中国等技术媒体平台。

    项目地址:GitHub / Gitee

    为什么创建 ArtiPub?

    程序员和技术人员常常会写技术文章和博客,用作技术分享、产品分享或提供咨询等等。技术博主通常需要在多个媒体渠道发布文章,例如掘金、SegmentFault、CSDN、知乎、简书、微信公众号等等,以求最大的关注度。但是,发布文章到这么多平台费时费神,需要不断地复制粘贴;同时,作者想查看阅读数时还需要来回切换各个网站来进行统计。这非常不方便。ArtiPub 主要就是为了来解决上述这些问题的。

    市面上已经存在一文多发平台了,例如 OpenWrite,为何还要创建 ArtiPub 呢?或许其他一文多发平台也是一个替代方案,但它们要求用户将自己的账户信息例如 Cookie 或账号密码上传到对方服务器,这很不安全,一旦平台发生问题,自己的账户信息会遭到泄漏。虽然我相信一般平台不会恶意操作用户的账户,但如果出现误操作,您的账户隐私将遭到泄漏,平台上的财产也可能遭到损坏,有这样的风险需要考虑。ArtiPub 不要求用户上传账户信息,所有账户信息全部保存在用户自己的数据库里,因此规避了这个安全风险。

    ArtiPub 提供 3 种安装方式,这里我们通过 Docker 安装,这也是官方最推荐的安装方式。

    需求

    • Docker: 18.03+
    • Docker Compose: 1.24.1+
    • Google Chrome

    Install Docker Engine on Ubuntu

    建议您阅读官方文档进行安装。当然这里还是贴上安装方法。

    官方罗列了三种安装方式:Install using the repository、Install from a package、Install using the convenience script。

    作为懒人,我当然选择使用脚本进行安装:

    $ curl -fsSL https://get.docker.com -o get-docker.sh
    $ sudo sh get-docker.sh
    
    <output truncated>
    

    If you would like to use Docker as a non-root user, you should now consider adding your user to the “docker” group with something like:

      sudo usermod -aG docker your-user
    

    Remember to log out and back in for this to take effect!

    Install Docker Compose

    建议您阅读官方文档进行安装。当然这里还是贴上安装方法。

    On Linux, you can download the Docker Compose binary from the Compose repository release page on GitHub.

    1. Run this command to download the current stable release of Docker Compose:

    sudo curl -L "https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    

    To install a different version of Compose, substitute 1.25.5 with the version of Compose you want to use.

    2. Apply executable permissions to the binary:

    sudo chmod +x /usr/local/bin/docker-compose
    

    Test the installation.

    $ docker-compose --version
    docker-compose version 1.25.5, build 8a1c60f6
    

    安装 ArtiPub

    在您的项目目录下创建 docker-compose.yaml 文件,输入如下内容。

    version: '3.3'
    services:
      app:
        image: "tikazyq/artipub:latest"
        environment:
          MONGO_HOST: "mongo"
          ARTIPUB_API_ADDRESS: "http://localhost:3000" # 后端API地址,如果安装地址不在本机,请修改为协议+服务器IP地址+端口号(默认为3000)
        ports:
          - "8000:8000" # frontend
          - "3000:3000" # backend
        depends_on:
          - mongo
      mongo:
        image: mongo:latest
        restart: always
        ports:
          - "27017:27017"
    

    然后在命令行中输入如下命令。

    docker-compose up
    

    然后在 Chrome 浏览器中输入 http://localhost:8000 可以看到界面。


    如果 docker-compose up 报错:

    ERROR: Couldn’t connect to Docker daemon at http+docker://localunixsocket - is it running?
    
    If it’s at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
    

    解决办法参考 ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?

    docker 每次都要 sudo, 或者其他服务启动的时候,提示上述的错误

    • 如果还没有 docker group 就添加一个:

      sudo groupadd docker
      
    • 将用户加入该 group 内。然后退出并重新登录就生效啦。

      sudo gpasswd -a ${USER} docker
      
    • 重启 docker 服务

      sudo service docker restart
      
    • 切换当前会话到新 group 或者重启 X 会话

      newgrp - docker
      

    安装登陆助手

    进入 http://localhost:8000 管理界面后,找到 登陆助手,根据说明进行安装。


    大功告成!

    使用

    我在 Chromium 上测试了一下,发现 ArtiPub v0.1.4 不能发文章到博客园,报错:

    app_1    | [2020-04-13T23:17:42.736] [INFO] default - input editor title and content
    app_1    | Error: Evaluation failed: TypeError: Cannot read property 'focus' of null
    app_1    |     at inputTitle (__puppeteer_evaluation_script__:3:8)
    

    只能等待更新解决。


    寻找知识的源头,探索宇宙的奥秘。
    知识的存放地址:人的大脑里、书里、互联网上、自然界里。
    获取知识的最优路径:精品课程 > 精品书籍 > 官方文档 > 优质文章 > 与人交流(互为补充,构建知识体系)。
    内外兼修,形神合一。

  • 相关阅读:
    mysql8下载安装及配置
    jdk11下载安装及环境变量配置
    展示所有商品案例
    事务(转账实例)
    Part2.7 ESLint
    Part2.6 Webpack
    Part2.5 模块化开发
    Part2.4 gulp 实践
    Part2.3 Grunt
    Part2.2 plop 使用
  • 原文地址:https://www.cnblogs.com/keatonlao/p/12693234.html
Copyright © 2011-2022 走看看