%global _empty_manifest_terminate_build 0 Name: python-thumbor-dash Version: 0.0.20 Release: 1 Summary: A thumbor server extension for DASH License: MIT License URL: https://github.com/mayoreee/thumbor_dash Source0: https://mirrors.aliyun.com/pypi/web/packages/7a/d3/a3772e063e965dd43e5b5cc5bf4c21368cfdd026b54d2d70ce2ab0676eac/thumbor_dash-0.0.20.tar.gz BuildArch: noarch Requires: python3-thumbor Requires: python3-dapiclient Requires: python3-grpcio %description # thumbor_dash A thumbor server extension for DASH ## Setup #### Requirements - Python >= 3.9 - Pip >= 21.1 - Thumbor == 7.0.0a5 See the requirements for setting up `thumbor` in the [documentation](https://thumbor.readthedocs.io/en/latest/installing.html) #### 1. Install thumbor_dash `pip install thumbor_dash` Note: thumbor_dash, thumbor, and other required dependencies will be installed #### 2. Create a thumbor configuration file `thumbor-config > thumbor.conf` #### 3. Add these lines to `thumbor.conf` file ```python # Set allowed dimensions MIN_WIDTH = 1 MIN_HEIGHT = 1 MAX_WIDTH = 1200 MAX_HEIGHT = 800 # Use custom Url signing method (sha256) URL_SIGNER = 'thumbor_dash.url_signers.base64_hmac_sha256' # Allow only signed URL ALLOW_UNSAFE_URL = False # Set user moderation rules REQUEST_TIME_LIMIT = 1 # time between requests in minutes USAGE_VIOLATION_LIMIT = 5 # total number of times a requester can violate the time limit before ban BAN_DURATION = 10 # requester ban duration in minutes # Use custom error handling USE_CUSTOM_ERROR_HANDLING = True ERROR_HANDLER_MODULE = 'thumbor_dash.error_handlers.sentry' # User-defined MN and IP list SEED_IP = 'seed-1.testnet.networks.dash.org' MN_LIST = '34.219.81.129,34.221.42.205,34.208.88.128,54.189.162.193,34.220.124.90,54.201.242.241,54.68.10.46,34.210.81.39,18.237.47.243' ``` ## Usage #### 1. Start thumbor_dash server `thumbor_dash --conf=thumbor.conf` #### 2. Sign image URL ```python thumbor_dash-url --key="" --width= --height= --dashauth="requester():contract():document():field():owner():updatedAt()" --filters="" ``` `output:` ```python //x/dashauth:requester():contract():document():field():owner():updatedAt()/filters:format()/ ``` #### 3. Thumbor_dash image retrieval URL ```python http:////x/dashauth:requester():contract():document():field():owner():updatedAt()/filters:format()/ ``` Note: If running the server locally, `` should be `localhost:8888` ## Example This is a signed `thumbor_dash url`. Simply run `thumbor_dash` and paste this link in your browser. ```python http://localhost:8888/U6lnOyBbSbRmZoxIgj81unAoR-V2GhJj1lAAQ0846Nw=/1200x800/dashauth:requester(856aSH6uEBaHpndZYXDk72NJbZqXokNSPGrs8nKbd7QL):contract(DbBHu3Ct1zD1AYAiw58V7QXT22B3k7qRLDLfaXqiRQp5):document(thumbnailField):field(avatarUrl):owner(856aSH6uEBaHpndZYXDk72NJbZqXokNSPGrs8nKbd7QL):updatedAt(1654864287788)/filters:format(jpeg)/https%3A//github.com/thumbor/thumbor/raw/master/example.jpg ``` # Running thumbor_dash in Docker This is the fastest way to run `thumbor_dash` #### 1. Create a `thumbor.env.txt` file containing the environment variables ```python MIN_WIDTH=1 MIN_HEIGHT=1 MAX_WIDTH=1200 MAX_HEIGHT=800 REQUEST_TIME_LIMIT=1 USAGE_VIOLATION_LIMIT=5 BAN_DURATION=10 USE_CUSTOM_ERROR_HANDLING=True ALLOW_UNSAFE_URL=False URL_SIGNER=thumbor_dash.url_signers.base64_hmac_sha256 ERROR_HANDLER_MODULE=thumbor_dash.error_handlers.sentry SEED_IP=seed-1.testnet.networks.dash.org MN_LIST=34.219.81.129,34.221.42.205,34.208.88.128,54.189.162.193,34.220.124.90,54.201.242.241,54.68.10.46,34.210.81.39,18.237.47.243 ``` #### 2. Start thumbor_dash server in Docker `docker run -p 80:80 --env-file thumbor.env.txt mayoreee/thumbor_dash` When your environment is not ARM-based, add the option `--platform linux/arm64/v8` Note: If running in Docker, `` in the image request URL should be set to `localhost:80` instead of `localhost:8888`. %package -n python3-thumbor-dash Summary: A thumbor server extension for DASH Provides: python-thumbor-dash BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-thumbor-dash # thumbor_dash A thumbor server extension for DASH ## Setup #### Requirements - Python >= 3.9 - Pip >= 21.1 - Thumbor == 7.0.0a5 See the requirements for setting up `thumbor` in the [documentation](https://thumbor.readthedocs.io/en/latest/installing.html) #### 1. Install thumbor_dash `pip install thumbor_dash` Note: thumbor_dash, thumbor, and other required dependencies will be installed #### 2. Create a thumbor configuration file `thumbor-config > thumbor.conf` #### 3. Add these lines to `thumbor.conf` file ```python # Set allowed dimensions MIN_WIDTH = 1 MIN_HEIGHT = 1 MAX_WIDTH = 1200 MAX_HEIGHT = 800 # Use custom Url signing method (sha256) URL_SIGNER = 'thumbor_dash.url_signers.base64_hmac_sha256' # Allow only signed URL ALLOW_UNSAFE_URL = False # Set user moderation rules REQUEST_TIME_LIMIT = 1 # time between requests in minutes USAGE_VIOLATION_LIMIT = 5 # total number of times a requester can violate the time limit before ban BAN_DURATION = 10 # requester ban duration in minutes # Use custom error handling USE_CUSTOM_ERROR_HANDLING = True ERROR_HANDLER_MODULE = 'thumbor_dash.error_handlers.sentry' # User-defined MN and IP list SEED_IP = 'seed-1.testnet.networks.dash.org' MN_LIST = '34.219.81.129,34.221.42.205,34.208.88.128,54.189.162.193,34.220.124.90,54.201.242.241,54.68.10.46,34.210.81.39,18.237.47.243' ``` ## Usage #### 1. Start thumbor_dash server `thumbor_dash --conf=thumbor.conf` #### 2. Sign image URL ```python thumbor_dash-url --key="" --width= --height= --dashauth="requester():contract():document():field():owner():updatedAt()" --filters="" ``` `output:` ```python //x/dashauth:requester():contract():document():field():owner():updatedAt()/filters:format()/ ``` #### 3. Thumbor_dash image retrieval URL ```python http:////x/dashauth:requester():contract():document():field():owner():updatedAt()/filters:format()/ ``` Note: If running the server locally, `` should be `localhost:8888` ## Example This is a signed `thumbor_dash url`. Simply run `thumbor_dash` and paste this link in your browser. ```python http://localhost:8888/U6lnOyBbSbRmZoxIgj81unAoR-V2GhJj1lAAQ0846Nw=/1200x800/dashauth:requester(856aSH6uEBaHpndZYXDk72NJbZqXokNSPGrs8nKbd7QL):contract(DbBHu3Ct1zD1AYAiw58V7QXT22B3k7qRLDLfaXqiRQp5):document(thumbnailField):field(avatarUrl):owner(856aSH6uEBaHpndZYXDk72NJbZqXokNSPGrs8nKbd7QL):updatedAt(1654864287788)/filters:format(jpeg)/https%3A//github.com/thumbor/thumbor/raw/master/example.jpg ``` # Running thumbor_dash in Docker This is the fastest way to run `thumbor_dash` #### 1. Create a `thumbor.env.txt` file containing the environment variables ```python MIN_WIDTH=1 MIN_HEIGHT=1 MAX_WIDTH=1200 MAX_HEIGHT=800 REQUEST_TIME_LIMIT=1 USAGE_VIOLATION_LIMIT=5 BAN_DURATION=10 USE_CUSTOM_ERROR_HANDLING=True ALLOW_UNSAFE_URL=False URL_SIGNER=thumbor_dash.url_signers.base64_hmac_sha256 ERROR_HANDLER_MODULE=thumbor_dash.error_handlers.sentry SEED_IP=seed-1.testnet.networks.dash.org MN_LIST=34.219.81.129,34.221.42.205,34.208.88.128,54.189.162.193,34.220.124.90,54.201.242.241,54.68.10.46,34.210.81.39,18.237.47.243 ``` #### 2. Start thumbor_dash server in Docker `docker run -p 80:80 --env-file thumbor.env.txt mayoreee/thumbor_dash` When your environment is not ARM-based, add the option `--platform linux/arm64/v8` Note: If running in Docker, `` in the image request URL should be set to `localhost:80` instead of `localhost:8888`. %package help Summary: Development documents and examples for thumbor-dash Provides: python3-thumbor-dash-doc %description help # thumbor_dash A thumbor server extension for DASH ## Setup #### Requirements - Python >= 3.9 - Pip >= 21.1 - Thumbor == 7.0.0a5 See the requirements for setting up `thumbor` in the [documentation](https://thumbor.readthedocs.io/en/latest/installing.html) #### 1. Install thumbor_dash `pip install thumbor_dash` Note: thumbor_dash, thumbor, and other required dependencies will be installed #### 2. Create a thumbor configuration file `thumbor-config > thumbor.conf` #### 3. Add these lines to `thumbor.conf` file ```python # Set allowed dimensions MIN_WIDTH = 1 MIN_HEIGHT = 1 MAX_WIDTH = 1200 MAX_HEIGHT = 800 # Use custom Url signing method (sha256) URL_SIGNER = 'thumbor_dash.url_signers.base64_hmac_sha256' # Allow only signed URL ALLOW_UNSAFE_URL = False # Set user moderation rules REQUEST_TIME_LIMIT = 1 # time between requests in minutes USAGE_VIOLATION_LIMIT = 5 # total number of times a requester can violate the time limit before ban BAN_DURATION = 10 # requester ban duration in minutes # Use custom error handling USE_CUSTOM_ERROR_HANDLING = True ERROR_HANDLER_MODULE = 'thumbor_dash.error_handlers.sentry' # User-defined MN and IP list SEED_IP = 'seed-1.testnet.networks.dash.org' MN_LIST = '34.219.81.129,34.221.42.205,34.208.88.128,54.189.162.193,34.220.124.90,54.201.242.241,54.68.10.46,34.210.81.39,18.237.47.243' ``` ## Usage #### 1. Start thumbor_dash server `thumbor_dash --conf=thumbor.conf` #### 2. Sign image URL ```python thumbor_dash-url --key="" --width= --height= --dashauth="requester():contract():document():field():owner():updatedAt()" --filters="" ``` `output:` ```python //x/dashauth:requester():contract():document():field():owner():updatedAt()/filters:format()/ ``` #### 3. Thumbor_dash image retrieval URL ```python http:////x/dashauth:requester():contract():document():field():owner():updatedAt()/filters:format()/ ``` Note: If running the server locally, `` should be `localhost:8888` ## Example This is a signed `thumbor_dash url`. Simply run `thumbor_dash` and paste this link in your browser. ```python http://localhost:8888/U6lnOyBbSbRmZoxIgj81unAoR-V2GhJj1lAAQ0846Nw=/1200x800/dashauth:requester(856aSH6uEBaHpndZYXDk72NJbZqXokNSPGrs8nKbd7QL):contract(DbBHu3Ct1zD1AYAiw58V7QXT22B3k7qRLDLfaXqiRQp5):document(thumbnailField):field(avatarUrl):owner(856aSH6uEBaHpndZYXDk72NJbZqXokNSPGrs8nKbd7QL):updatedAt(1654864287788)/filters:format(jpeg)/https%3A//github.com/thumbor/thumbor/raw/master/example.jpg ``` # Running thumbor_dash in Docker This is the fastest way to run `thumbor_dash` #### 1. Create a `thumbor.env.txt` file containing the environment variables ```python MIN_WIDTH=1 MIN_HEIGHT=1 MAX_WIDTH=1200 MAX_HEIGHT=800 REQUEST_TIME_LIMIT=1 USAGE_VIOLATION_LIMIT=5 BAN_DURATION=10 USE_CUSTOM_ERROR_HANDLING=True ALLOW_UNSAFE_URL=False URL_SIGNER=thumbor_dash.url_signers.base64_hmac_sha256 ERROR_HANDLER_MODULE=thumbor_dash.error_handlers.sentry SEED_IP=seed-1.testnet.networks.dash.org MN_LIST=34.219.81.129,34.221.42.205,34.208.88.128,54.189.162.193,34.220.124.90,54.201.242.241,54.68.10.46,34.210.81.39,18.237.47.243 ``` #### 2. Start thumbor_dash server in Docker `docker run -p 80:80 --env-file thumbor.env.txt mayoreee/thumbor_dash` When your environment is not ARM-based, add the option `--platform linux/arm64/v8` Note: If running in Docker, `` in the image request URL should be set to `localhost:80` instead of `localhost:8888`. %prep %autosetup -n thumbor_dash-0.0.20 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-thumbor-dash -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Thu Jun 08 2023 Python_Bot - 0.0.20-1 - Package Spec generated