/etc/systemd/system/pyfilebrowser.service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import functools | |
import time | |
def timed_cache(max_age, maxsize=128, typed=False): | |
"""Least-recently-used cache decorator with time-based cache invalidation. | |
See Also: | |
- ``lru_cache`` takes all params of the function and creates a key | |
- If even one key is changed, it will map to new entry thus refreshed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import os | |
import time | |
from threading import Thread | |
from typing import Union | |
import inflect | |
import requests | |
import tqdm |
Preferred File Location
/var/www/html
Assign www-data
as owner
sudo chown www-data:www-data /var/www/html/error.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
from http import HTTPStatus | |
import httpx | |
import uvicorn.logging | |
from fastapi import FastAPI, HTTPException, Request, Response | |
from fastapi.routing import APIRoute | |
TARGET_URL = "http://127.0.0.1:8080" # Change this to the URL you want to proxy requests to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
from http import HTTPStatus | |
import httpx | |
import uvicorn.logging | |
from fastapi import FastAPI, HTTPException, Request, Response | |
from fastapi.routing import APIRoute | |
TARGET_URL = "http://127.0.0.1:8080" # Change this to the URL you want to proxy requests to | |
CLIENT = httpx.Client() |
OlderNewer