From 12f2681dab1334617656fb33e79dca03372bd652 Mon Sep 17 00:00:00 2001 From: Tony Date: Sat, 24 Oct 2026 03:15:51 +0000 Subject: [PATCH] chore: update ansible script --- scripts/ansible/README.md | 2 +- scripts/ansible/Vagrantfile | 2 +- scripts/ansible/rsshub.env | 2 +- scripts/ansible/rsshub.service | 2 +- scripts/ansible/rsshub.yaml | 52 ++++++++++++++++++---------------- 5 files changed, 32 insertions(+), 28 deletions(-) diff --git a/scripts/ansible/README.md b/scripts/ansible/README.md index 3d6ea29196..a18fb8359c 100644 --- a/scripts/ansible/README.md +++ b/scripts/ansible/README.md @@ -6,7 +6,7 @@ Requires sudo permission ## Usage -On `Ubuntu 20.04`, [install ansible](https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-ansible-on-ubuntu-20-04), then +On `Ubuntu 26.04`, run `sudo apt install ansible`, then ```bash sudo ansible-playbook rsshub.yaml diff --git a/scripts/ansible/Vagrantfile b/scripts/ansible/Vagrantfile index 604af7f5ad..7c39fec969 100644 --- a/scripts/ansible/Vagrantfile +++ b/scripts/ansible/Vagrantfile @@ -1,5 +1,5 @@ Vagrant.configure("2") do |config| - config.vm.box = "generic/ubuntu2004" + config.vm.box = "bento/ubuntu-26.04" config.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: ".git/" config.ssh.extra_args = ["-t", "cd /vagrant; bash --login"] end diff --git a/scripts/ansible/rsshub.env b/scripts/ansible/rsshub.env index e8bf0d7ffb..7175cf88eb 100644 --- a/scripts/ansible/rsshub.env +++ b/scripts/ansible/rsshub.env @@ -1,3 +1,3 @@ NODE_ENV=production CACHE_TYPE=redis -PLAYWRIGHT_WS_ENDPOINT=ws://localhost:3000 +PLAYWRIGHT_CDP_ENDPOINT=ws://localhost:3000?token=rsshub diff --git a/scripts/ansible/rsshub.service b/scripts/ansible/rsshub.service index 0c8352a44e..a44069a350 100644 --- a/scripts/ansible/rsshub.service +++ b/scripts/ansible/rsshub.service @@ -4,7 +4,7 @@ Description=RSSHub is an open source, easy to use, and extensible RSS feed aggre [Service] User=rsshub WorkingDirectory=/home/rsshub/app -ExecStart=yarn start +ExecStart=pnpm start EnvironmentFile=/home/rsshub/app/.env [Install] diff --git a/scripts/ansible/rsshub.yaml b/scripts/ansible/rsshub.yaml index a20900d279..6c8dcb8997 100644 --- a/scripts/ansible/rsshub.yaml +++ b/scripts/ansible/rsshub.yaml @@ -8,51 +8,49 @@ tasks: - name: Check OS fail: - msg: This playbook can only be run on Ubuntu 20.04 at this moment - when: ansible_distribution != 'Ubuntu' or ansible_distribution_version !='20.04' + msg: This playbook can only be run on Ubuntu 26.04 at this moment + when: ansible_distribution != 'Ubuntu' or ansible_distribution_version != '26.04' - name: Install GPG keys for repos - apt_key: - url: '{{ item }}' - state: present - with_items: - - https://deb.nodesource.com/gpgkey/nodesource.gpg.key - - https://download.docker.com/linux/ubuntu/gpg - - https://dl.cloudsmith.io/public/caddy/stable/cfg/gpg/gpg.155B6D79CA56EA34.key + get_url: + url: '{{ item.url }}' + dest: '/etc/apt/keyrings/{{ item.name }}.asc' + loop: + - { name: nodesource, url: https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key } + - { name: docker, url: https://download.docker.com/linux/ubuntu/gpg } + - { name: caddy, url: https://dl.cloudsmith.io/public/caddy/stable/gpg.key } - name: Install repos apt_repository: repo: '{{ item }}' state: present update_cache: yes - with_items: - - deb https://deb.nodesource.com/node_12.x focal main - - deb https://download.docker.com/linux/ubuntu focal stable - - deb https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version main + loop: + - deb [signed-by=/etc/apt/keyrings/nodesource.asc] https://deb.nodesource.com/node_24.x nodistro main + - deb [signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu resolute stable + - deb [signed-by=/etc/apt/keyrings/caddy.asc] https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version main - name: Install prerequisites apt: name: - nodejs - build-essential - - python-is-python2 - redis-server - docker-ce - - python3-pip - - virtualenv - - python3-setuptools + - python3-docker - caddy state: present update_cache: yes - - name: Install python module for docker - pip: - name: docker + - name: Install pnpm + command: npm install -g corepack@latest + - name: Enable pnpm + command: corepack enable pnpm - name: Pull docker image for browserless docker_image: - name: browserless/chrome + name: ghcr.io/browserless/chromium source: pull - name: Start redis systemd: state: restarted enabled: yes - name: redis + name: redis-server daemon_reload: yes - name: Copy caddy configuration template: @@ -67,9 +65,11 @@ - name: Create and start browserless container docker_container: name: browserless - image: browserless/chrome + image: ghcr.io/browserless/chromium state: started restart_policy: always + env: + TOKEN: rsshub published_ports: - '3000:3000' - name: Create the user @@ -83,11 +83,15 @@ dest: /home/rsshub/app update: yes - name: Install repo dependencies - command: yarn install --production + command: pnpm install --frozen-lockfile args: chdir: /home/rsshub/app environment: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: true + - name: Build the app + command: pnpm build + args: + chdir: /home/rsshub/app - name: Copy configuration copy: src: rsshub.env