#分享#Yarr:一个UI很漂亮的RSS阅读器

今天浏览LALA大佬的荒岛,看到一个不错的资源,正好自己需要,所以就转过来了,原贴:https://lala.im/7402.html

Yarr是一个用Go开发的RSS阅读器,前端界面非常干净清爽,和macos莫名般配。

目前该项目还在积极开发中,作者后续应该会添加更多的功能。下面我水一下部署的过程。

由于作者没有预编译好的二进制文件,这里需要我们自己编译。安装一下需要用到的软件:

<span class="pln">apt </span><span class="pun">-</span><span class="pln">y install build</span><span class="pun">-</span><span class="pln">essential supervisor nginx python</span><span class="pun">-</span><span class="pln">certbot</span><span class="pun">-</span><span class="pln">nginx apache2</span><span class="pun">-</span><span class="pln">utils wget systemctl start supervisor nginx systemctl enable supervisor nginx</span>

1 2 3 < span class = "pln" > apt < / span > < span class = "pun" > - < / span > < span class = "pln" > y install build < / span > < span class = "pun" > - < / span > < span class = "pln" > essential supervisor nginx python < / span > < span class = "pun" > - < / span > < span class = "pln" > certbot < / span > < span class = "pun" > - < / span > < span class = "pln" > nginx apache2 < / span > < span class = "pun" > - < / span > < span class = "pln" > utils wget systemctl start supervisor nginx systemctl enable supervisor nginx < / span >

安装Go语言:

<span class="pln">wget https</span><span class="pun">:</span><span class="com">//golang.org/dl/go1.15.2.linux-amd64.tar.gz</span><span class="pln"> tar </span><span class="pun">-</span><span class="pln">C </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span> <span class="pun">-</span><span class="pln">xzf go1</span><span class="pun">.</span><span class="lit">15.2</span><span class="pun">.</span><span class="pln">linux</span><span class="pun">-</span><span class="pln">amd64</span><span class="pun">.</span><span class="pln">tar</span><span class="pun">.</span><span class="pln">gz echo </span><span class="str">'export PATH=$PATH:/usr/local/go/bin'</span> <span class="pun">&gt;</span> <span class="str">/etc/</span><span class="pln">profile</span><span class="pun">.</span><span class="pln">d</span><span class="pun">/</span><span class="pln">golang</span><span class="pun">.</span><span class="pln">sh source </span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">profile</span><span class="pun">.</span><span class="pln">d</span><span class="pun">/</span><span class="pln">golang</span><span class="pun">.</span><span class="pln">sh</span>

1 2 3 4 < span class = "pln" > wget https < / span > < span class = "pun" > : < / span > < span class = "com" > //golang.org/dl/go1.15.2.linux-amd64.tar.gz</span><span class="pln"> tar < / span > < span class = "pun" > - < / span > < span class = "pln" > C < / span > < span class = "pun" > / < / span > < span class = "pln" > usr < / span > < span class = "pun" > / < / span > < span class = "kwd" > local < / span > < span class = "pun" > - < / span > < span class = "pln" > xzf go1 < / span > < span class = "pun" > . < / span > < span class = "lit" > 15.2 < / span > < span class = "pun" > . < / span > < span class = "pln" > linux < / span > < span class = "pun" > - < / span > < span class = "pln" > amd64 < / span > < span class = "pun" > . < / span > < span class = "pln" > tar < / span > < span class = "pun" > . < / span > < span class = "pln" > gz echo < / span > < span class = "str" > 'export PATH=$PATH:/usr/local/go/bin' < / span > < span class = "pun" > & gt ; < / span > < span class = "str" > / etc / < / span > < span class = "pln" > profile < / span > < span class = "pun" > . < / span > < span class = "pln" > d < / span > < span class = "pun" > / < / span > < span class = "pln" > golang < / span > < span class = "pun" > . < / span > < span class = "pln" > sh source < / span > < span class = "pun" > / < / span > < span class = "pln" > etc < / span > < span class = "pun" > / < / span > < span class = "pln" > profile < / span > < span class = "pun" > . < / span > < span class = "pln" > d < / span > < span class = "pun" > / < / span > < span class = "pln" > golang < / span > < span class = "pun" > . < / span > < span class = "pln" > sh < / span >

拉取项目文件并编译:

<span class="pln">cd </span><span class="pun">/</span><span class="pln">opt git clone https</span><span class="pun">:</span><span class="com">//github.com/nkanaev/yarr.git </span><span class="pln"> git clone https</span><span class="pun">:</span><span class="com">//github.com/nkanaev/gofeed.git </span><span class="pln"> mv gofeed yarr cd yarr make build_linux</span>

1 2 3 4 5 6 < span class = "pln" > cd < / span > < span class = "pun" > / < / span > < span class = "pln" > opt git clone https < / span > < span class = "pun" > : < / span > < span class = "com" > //github.com/nkanaev/yarr.git </span><span class="pln"> git clone https < / span > < span class = "pun" > : < / span > < span class = "com" > //github.com/nkanaev/gofeed.git </span><span class="pln"> mv gofeed yarr cd yarr make build_linux < / span >

完成之后在下面的目录可以看到编译好的二进制文件:

<span class="str">/opt/</span><span class="pln">yarr</span><span class="pun">/</span><span class="pln">_output</span><span class="pun">/</span><span class="pln">linux</span>

1 < span class = "str" > / opt / < / span > < span class = "pln" > yarr < / span > < span class = "pun" > / < / span > < span class = "pln" > _output < / span > < span class = "pun" > / < / span > < span class = "pln" > linux < / span >

新建一个supervisor的配置文件:

<span class="pln">nano </span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">supervisor</span><span class="pun">/</span><span class="pln">conf</span><span class="pun">.</span><span class="pln">d</span><span class="pun">/</span><span class="pln">yarr</span><span class="pun">.</span><span class="pln">conf</span>

1 < span class = "pln" > nano < / span > < span class = "pun" > / < / span > < span class = "pln" > etc < / span > < span class = "pun" > / < / span > < span class = "pln" > supervisor < / span > < span class = "pun" > / < / span > < span class = "pln" > conf < / span > < span class = "pun" > . < / span > < span class = "pln" > d < / span > < span class = "pun" > / < / span > < span class = "pln" > yarr < / span > < span class = "pun" > . < / span > < span class = "pln" > conf < / span >

写入如下配置:

<span class="pun">[</span><span class="pln">program</span><span class="pun">:</span><span class="pln">yarr</span><span class="pun">]</span><span class="pln"> priority</span><span class="pun">=</span><span class="lit">1</span><span class="pln"> environment</span><span class="pun">=</span><span class="pln">XDG_CONFIG_HOME</span><span class="pun">=</span><span class="str">"$HOME/.config"</span><span class="pln"> directory</span><span class="pun">=</span><span class="str">/opt/</span><span class="pln">yarr</span><span class="pun">/</span><span class="pln">_output</span><span class="pun">/</span><span class="pln">linux command</span><span class="pun">=</span><span class="str">/opt/</span><span class="pln">yarr</span><span class="pun">/</span><span class="pln">_output</span><span class="pun">/</span><span class="pln">linux</span><span class="pun">/</span><span class="pln">yarr </span><span class="pun">-</span><span class="pln">addr </span><span class="lit">127.0</span><span class="pun">.</span><span class="lit">0.1</span><span class="pun">:</span><span class="lit">7070</span><span class="pln"> autostart</span><span class="pun">=</span><span class="kwd">true</span><span class="pln"> autorestart</span><span class="pun">=</span><span class="kwd">true</span><span class="pln"> redirect_stderr</span><span class="pun">=</span><span class="kwd">true</span><span class="pln"> stdout_logfile</span><span class="pun">=</span><span class="str">/var/</span><span class="pln">log</span><span class="pun">/</span><span class="pln">supervisor</span><span class="pun">/</span><span class="pln">yarr</span><span class="pun">.</span><span class="pln">log</span>

1 2 3 4 5 6 7 8 9 < span class = "pun" > [ < / span > < span class = "pln" > program < / span > < span class = "pun" > : < / span > < span class = "pln" > yarr < / span > < span class = "pun" > ] < / span > < span class = "pln" > priority < / span > < span class = "pun" >= < / span > < span class = "lit" > 1 < / span > < span class = "pln" > environment < / span > < span class = "pun" >= < / span > < span class = "pln" > XDG_CONFIG_HOME < / span > < span class = "pun" >= < / span > < span class = "str" > "$HOME/.config" < / span > < span class = "pln" > directory < / span > < span class = "pun" >= < / span > < span class = "str" > / opt / < / span > < span class = "pln" > yarr < / span > < span class = "pun" > / < / span > < span class = "pln" > _output < / span > < span class = "pun" > / < / span > < span class = "pln" > linux command < / span > < span class = "pun" >= < / span > < span class = "str" > / opt / < / span > < span class = "pln" > yarr < / span > < span class = "pun" > / < / span > < span class = "pln" > _output < / span > < span class = "pun" > / < / span > < span class = "pln" > linux < / span > < span class = "pun" > / < / span > < span class = "pln" > yarr < / span > < span class = "pun" > - < / span > < span class = "pln" > addr < / span > < span class = "lit" > 127.0 < / span > < span class = "pun" > . < / span > < span class = "lit" > 0.1 < / span > < span class = "pun" > : < / span > < span class = "lit" > 7070 < / span > < span class = "pln" > autostart < / span > < span class = "pun" >= < / span > < span class = "kwd" > true < / span > < span class = "pln" > autorestart < / span > < span class = "pun" >= < / span > < span class = "kwd" > true < / span > < span class = "pln" > redirect_stderr < / span > < span class = "pun" >= < / span > < span class = "kwd" > true < / span > < span class = "pln" > stdout_logfile < / span > < span class = "pun" >= < / span > < span class = "str" > / var / < / span > < span class = "pln" > log < / span > < span class = "pun" > / < / span > < span class = "pln" > supervisor < / span > < span class = "pun" > / < / span > < span class = "pln" > yarr < / span > < span class = "pun" > . < / span > < span class = "pln" > log < / span >

启动yarr:

<span class="pln">supervisorctl update</span>

1 < span class = "pln" > supervisorctl update < / span >

yarr有一点美中不足的是没有身份验证的功能,所以在上面的supervisor中,我把它监听到本地。

接下来使用nginx反向代理,利用nginx加一个http身份验证。首先新建一个nginx配置文件:

<span class="pln">nano </span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">nginx</span><span class="pun">/</span><span class="pln">conf</span><span class="pun">.</span><span class="pln">d</span><span class="pun">/</span><span class="pln">yarr</span><span class="pun">.</span><span class="pln">conf</span>

1 < span class = "pln" > nano < / span > < span class = "pun" > / < / span > < span class = "pln" > etc < / span > < span class = "pun" > / < / span > < span class = "pln" > nginx < / span > < span class = "pun" > / < / span > < span class = "pln" > conf < / span > < span class = "pun" > . < / span > < span class = "pln" > d < / span > < span class = "pun" > / < / span > < span class = "pln" > yarr < / span > < span class = "pun" > . < / span > < span class = "pln" > conf < / span >

写入如下配置:

<span class="pln">server </span><span class="pun">{</span><span class="pln"> listen </span><span class="lit">80</span><span class="pun">;</span><span class="pln"> server_name yarr</span><span class="pun">.</span><span class="pln">imlala</span><span class="pun">.</span><span class="pln">best</span><span class="pun">;</span><span class="pln"> location </span><span class="pun">/</span> <span class="pun">{</span><span class="pln"> auth_basic </span><span class="str">"Please Login"</span><span class="pun">;</span><span class="pln"> auth_basic_user_file htpasswd</span><span class="pun">;</span><span class="pln"> proxy_pass http</span><span class="pun">:</span><span class="com">//127.0.0.1:7070;</span> <span class="pun">}</span> <span class="pun">}</span>

1 2 3 4 5 6 7 8 9 10 < span class = "pln" > server < / span > < span class = "pun" > { < / span > < span class = "pln" >      listen        < / span > < span class = "lit" > 80 < / span > < span class = "pun" > ; < / span > < span class = "pln" >      server_name   yarr < / span > < span class = "pun" > . < / span > < span class = "pln" > imlala < / span > < span class = "pun" > . < / span > < span class = "pln" > best < / span > < span class = "pun" > ; < / span > < span class = "pln" >        location < / span > < span class = "pun" > / < / span > < span class = "pun" > { < / span > < span class = "pln" >          auth_basic < / span > < span class = "str" > "Please Login" < / span > < span class = "pun" > ; < / span > < span class = "pln" >          auth_basic_user_file htpasswd < / span > < span class = "pun" > ; < / span > < span class = "pln" >          proxy_pass http < / span > < span class = "pun" > : < / span > < span class = "com" > //127.0.0.1:7070;</span>      < span class = "pun" > } < / span > < span class = "pun" > } < / span >

使用下面的命令生成一个htpasswd文件(imlala是用户名注意替换:)

<span class="pln">htpasswd </span><span class="pun">-</span><span class="pln">c </span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">nginx</span><span class="pun">/</span><span class="pln">htpasswd imlala</span>

1 < span class = "pln" > htpasswd < / span > < span class = "pun" > - < / span > < span class = "pln" > c < / span > < span class = "pun" > / < / span > < span class = "pln" > etc < / span > < span class = "pun" > / < / span > < span class = "pln" > nginx < / span > < span class = "pun" > / < / span > < span class = "pln" > htpasswd imlala < / span >

重载nginx:

<span class="pln">systemctl reload nginx</span>

1 < span class = "pln" > systemctl reload nginx < / span >

如果需要SSL,使用下面的命令可以帮你自动配置SSL证书:

<span class="pln">certbot </span><span class="pun">--</span><span class="pln">nginx </span><span class="pun">--</span><span class="pln">agree</span><span class="pun">-</span><span class="pln">tos </span><span class="pun">--</span><span class="kwd">no</span><span class="pun">-</span><span class="pln">eff</span><span class="pun">-</span><span class="pln">email </span><span class="pun">--</span><span class="pln">email example@qq</span><span class="pun">.</span><span class="pln">com</span>

1 < span class = "pln" > certbot < / span > < span class = "pun" > -- < / span > < span class = "pln" > nginx < / span > < span class = "pun" > -- < / span > < span class = "pln" > agree < / span > < span class = "pun" > - < / span > < span class = "pln" > tos < / span > < span class = "pun" > -- < / span > < span class = "kwd" > no < / span > < span class = "pun" > - < / span > < span class = "pln" > eff < / span > < span class = "pun" > - < / span > < span class = "pln" > email < / span > < span class = "pun" > -- < / span > < span class = "pln" > email example @ qq < / span > < span class = "pun" > . < / span > < span class = "pln" > com < / span >

 

《#分享#Yarr:一个UI很漂亮的RSS阅读器》留言数:0

    发表留言