静看光阴荏苒
不管不顾不问不说也不念

wallabag:保存任何网页,在你需要的时候阅读它

wallabag的简单介绍:它使你不再错过任何内容。输入URL即可保存相应网页,它提取页面内容,以便你在有空时可以阅读。

这个其实有点像我之前水过的archivebox:https://lala.im/6628.html

如果单从抓取页面内容的完整性来说这个不如archivebox,但wallabag功能更多,比如加标签/添加收藏/多用户等等。

安装这里一切从简,直接docker梭哈+nginx反代,先把所有需要用到的软件装一下:

apt -y update
apt -y install curl nginx python-certbot-nginx
curl -sSL https://get.docker.com/ | sh
systemctl start docker
systemctl enable docker
curl -L https://github.com/docker/compose/releases/download/1.25.4/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

新建一个目录/进入目录/新建docker-compose:

mkdir -p /opt/wallabag && cd /opt/wallabag && nano docker-compose.yml

写入如下配置:

version: '3.5'

services: 
    wallabag:
        image: wallabag/wallabag
        container_name: wallabag
        depends_on:
            - wallabag-db
            - wallabag-redis
        environment: 
            - MYSQL_ROOT_PASSWORD=password
            - SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql
            - SYMFONY__ENV__DATABASE_HOST=wallabag-db
            - SYMFONY__ENV__DATABASE_PORT=3306
            - SYMFONY__ENV__DATABASE_NAME=wallabag
            - SYMFONY__ENV__DATABASE_USER=imlala
            - SYMFONY__ENV__DATABASE_PASSWORD=password
            - SYMFONY__ENV__DATABASE_CHARSET=utf8mb4
            - SYMFONY__ENV__REDIS_HOST=wallabag-redis
            - SYMFONY__ENV__REDIS_PORT=6379
            - SYMFONY__ENV__FOSUSER_CONFIRMATION=false
            - SYMFONY__ENV__FOSUSER_REGISTRATION=false
            - SYMFONY__ENV__DOMAIN_NAME=https://wallabag.imlala.best
        ports: 
            - 12345:80
        volumes: 
            - ./data:/var/www/wallabag/web/assets/images
        restart: unless-stopped

    wallabag-db:
        image: mariadb
        container_name: wallabag-db
        environment: 
            - MYSQL_ROOT_PASSWORD=password
        volumes: 
            - ./db:/var/lib/mysql
        restart: unless-stopped

    wallabag-redis:
        image: redis
        container_name: wallabag-redis
        restart: unless-stopped

解释一下这些环境变量的配置:

wallabag容器下的MYSQL_ROOT_PASSWORD和wallabag-db容器下的MYSQL_ROOT_PASSWORD保持一致。

SYMFONY__ENV__DATABASE_PASSWORD是用户数据库的密码,wallabag是通过登录Mariadb的ROOT用户然后自动帮你创建数据库的,所以wallabag-db容器下的环境变量不需要设置创建数据库相关的内容。

SYMFONY__ENV__DOMAIN_NAME是你的站点域名,如果配置反代必须正确填写,如果使用SSL必须加上https。

SYMFONY__ENV__FOSUSER_REGISTRATION是关闭用户注册,仅供你个人使用。

其他没提到的如果你不知道什么意思保持默认的就行了。

配置好了启动即可:

docker-compose up -d

新建一个nginx配置文件:

nano /etc/nginx/conf.d/wallabag.conf

写入如下内容:

server {
    listen       80;
    server_name  wallabag.imlala.best; # 换成你的域名
    client_max_body_size 0;

    error_log /var/log/nginx/wallabag.error.log;
    access_log /var/log/nginx/wallabag.access.log;

    location / {
        proxy_pass              http://127.0.0.1:12345;
        proxy_set_header        Host $host;
        proxy_set_header        X-Real-IP $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header        X-Forwarded-Proto $scheme;
    }
}

签一个ssl证书:

certbot --nginx --agree-tos --no-eff-email --email xxxxx@qq.com

访问你的域名,能看到登录界面说明一切正常:

注:默认的管理员账号密码均是:wallabag

登录进去之后首先修改你的密码这些就不多说了,这里只建议你在开始使用之前,把这个选项改为1:

这样可以保存网页上的图片到本地,目的是让网页尽量保存的完整一点,如果源站删除了,你这里的图片也不会因为源站的改变而受到影响。

使用的话非常简单,输入你要保存的URL按回车即可:

这个URL就被保存下来了:

赞(5)
未经允许不得转载:荒岛 » wallabag:保存任何网页,在你需要的时候阅读它
分享到: 更多 (0)

评论 12

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #1

    这个感觉挺棒的。

    Daniel4年前 (2020-05-30) Google Chrome 81.0.4044.138 Google Chrome 81.0.4044.138 Android 9 Android 9回复
    • 我在等下一个版本更新,下个版本应该有中文支持了 :shock:

      LALA4年前 (2020-05-30) Google Chrome 80.0.3987.163 Google Chrome 80.0.3987.163 Windows 10 x64 Edition Windows 10 x64 Edition回复
  2. #2

    感谢LALA大佬分享了这么多好东西,最近把一大堆吃灰的小鸡给派上用场了 :oops:

    ilala4年前 (2020-05-30) Google Chrome 83.0.4103.61 Google Chrome 83.0.4103.61 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 一大堆吃灰小鸡,土豪 :cool:

      LALA4年前 (2020-05-30) Google Chrome 80.0.3987.163 Google Chrome 80.0.3987.163 Windows 10 x64 Edition Windows 10 x64 Edition回复
  3. #3

    简书的文章捞不到图片,知乎的文章直接404。。。。。强迫症有点顶不住 :grin:

    xinmeow4年前 (2020-06-11) Google Chrome 83.0.4103.61 Google Chrome 83.0.4103.61 Windows 7 x64 Edition Windows 7 x64 Edition回复
    • 有些网站是抓取不到,可以换archivebox试试。

      LALA4年前 (2020-06-11) Google Chrome 80.0.3987.163 Google Chrome 80.0.3987.163 Windows 10 x64 Edition Windows 10 x64 Edition回复
      • 也试了,archivebox实在太难用了。。。。。。要用shell命令行,然后抓一个页面出来一堆页面,自带的搜索搜页面内容还搜不到。。。。。 :eek:

        xinmeow4年前 (2020-06-12) Google Chrome 83.0.4103.97 Google Chrome 83.0.4103.97 Windows 7 x64 Edition Windows 7 x64 Edition回复
        • 那就没啥好用的了,目前就属这两个还不错吧。

          LALA4年前 (2020-06-15) Google Chrome 81.0.4044.92 Google Chrome 81.0.4044.92 Windows 10 x64 Edition Windows 10 x64 Edition回复
  4. #4

    Oops! An Error Occurred
    The server returned a “400 Bad Request”.
    Something is broken. Please let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused.
    怎么办?

    bang4年前 (2020-06-19) Google Chrome 83.0.4103.106 Google Chrome 83.0.4103.106 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • lala知道是哪里出错了吗?
      ip+12345是可以正常访问的[反代开启后]

      bang4年前 (2020-06-19) Google Chrome 83.0.4103.106 Google Chrome 83.0.4103.106 Windows 10 x64 Edition Windows 10 x64 Edition回复
      • 我没遇到过这问题,我猜测是你的这个环境变量没设置对?SYMFONY__ENV__DOMAIN_NAME=

        LALA4年前 (2020-06-19) Google Chrome 81.0.4044.92 Google Chrome 81.0.4044.92 Windows 10 x64 Edition Windows 10 x64 Edition回复

分享创造快乐

广告合作资源投稿