0
0

Priviblur: implemented PussTheCat image and Redis cache

This commit is contained in:
Opnxng 2024-05-26 11:55:58 +08:00
parent f961254f7c
commit 893c0bbffd
3 changed files with 65 additions and 18 deletions

View File

@ -5,3 +5,13 @@
owner: 1000 owner: 1000
group: 1000 group: 1000
mode: 0755 mode: 0755
- name: Create valkey-data directory
ansible.builtin.file:
path: "{{ docker_dir }}/priviblur/valkey-data"
state: directory
owner: 999
group: 1000
mode: 0755
become: true

View File

@ -3,7 +3,7 @@ version: '3.7'
services: services:
priviblur: priviblur:
container_name: priviblur container_name: priviblur
image: git.opnxng.com/opnxng/priviblur:latest image: quay.io/pussthecatorg/priviblur
security_opt: security_opt:
- no-new-privileges - no-new-privileges
environment: environment:
@ -19,6 +19,30 @@ services:
networks: networks:
- priviblur - priviblur
priviblur-redis:
container_name: priviblur-redis
image: docker.io/valkey/valkey:alpine
command: valkey-server --save 30 1 --loglevel warning
security_opt:
- no-new-privileges
environment:
#- PUID=1000
#- PGID=1000
- TZ=Asia/Singapore
volumes:
- {{ docker_dir }}/priviblur/valkey-data:/data
user: "999:1000"
read_only: true
cap_drop:
- ALL
cap_add:
- SETGID
- SETUID
- DAC_OVERRIDE
restart: unless-stopped
networks:
- priviblur
networks: networks:
priviblur: priviblur:
name: priviblur name: priviblur

View File

@ -1,26 +1,38 @@
# Controls deployment options # Controls deployment options
[deployment] [deployment]
# host = "127.0.0.1" host = "0.0.0.0" # Set to 127.0.0.1 if you use a reverse proxy, or access it locally
host = "0.0.0.0"
port = 8000 port = 8000
# Amount of worker Priviblur instances to spawn. Increases speed significantly. # Amount of worker Priviblur instances to spawn. Increases speed significantly.
# workers = 1 # workers = 1
# # If you're running Priviblur behind a remote proxy, one or more of the following must be set
# # can also be set via env variables by captialzing and prefixing with PRIVIBLUR_
# #
# # For more information see
# # https://sanic.dev/en/guide/advanced/proxy-headers.html
# #
# # Default: None
# #
# forwarded_secret =
# real_ip_header =
# proxies_count =
# Controls behaviors pertaining to the way Priviblur requests Tumblr # # Controls redis cache options
[priviblur_backend] # # Ignore to disable the cache
# #
# # To enable caching, Redis is required, you then have to uncomment "url" and set it accordingly. Every other options in this section will use their default value (indicated next to them) if they are kept commented out.
[cache]
# For docker use the following:
url = "redis://priviblur-redis:6379"
# Number of seconds to cache poll results from active polls
cache_active_poll_results_for = 3600
# Number of seconds to cache poll results from expired polls
cache_expired_poll_results_for = 86400
# Number of seconds to cache feed (explore, search, etc) results for
cache_feed_for = 3600
# Number of seconds to cache blog feed (blog posts, blog search, blog tagged posts, etc) results for
cache_blog_feed_for = 3600
# Number of seconds to cache individual posts for
cache_blog_post_for = 300
# # Controls behaviors pertaining to the way Priviblur requests Tumblr
# [priviblur_backend]
# # Timeout for requests to Tumblr's API # # Timeout for requests to Tumblr's API
# main_response_timeout = 10 # main_response_timeout = 10
@ -32,7 +44,7 @@
# #
# Use Python's numerical logging levels # Use Python's numerical logging levels
# https://docs.python.org/3/howto/logging.html#logging-levels # https://docs.python.org/3/howto/logging.html#logging-levels
[logging] # [logging]
# # Sanic (Server)'s logging level' # # Sanic (Server)'s logging level'
# sanic_logging_level = 30 # sanic_logging_level = 30
@ -42,6 +54,7 @@
# # Priviblur extractor's logging level # # Priviblur extractor's logging level
# priviblur_extractor_logging_level = 20 # priviblur_extractor_logging_level = 20
[misc]
# [misc]
# # Enable sanic's dev mode # # Enable sanic's dev mode
# dev_mode = false # dev_mode = false