chore: update ansible script

This commit is contained in:
Tony
2026-10-24 03:15:51 +00:00
parent ab97c63292
commit 12f2681dab
5 changed files with 32 additions and 28 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -1,3 +1,3 @@
NODE_ENV=production
CACHE_TYPE=redis
PLAYWRIGHT_WS_ENDPOINT=ws://localhost:3000
PLAYWRIGHT_CDP_ENDPOINT=ws://localhost:3000?token=rsshub
+1 -1
View File
@@ -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]
+28 -24
View File
@@ -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