mirror of
https://github.com/NoCLin/LightMirrors
synced 2025-07-27 04:20:31 +08:00
move to subdir
This commit is contained in:
parent
ad4fca6006
commit
b6a13cf1ff
@ -1,9 +1,10 @@
|
|||||||
services:
|
services:
|
||||||
lightmirrors:
|
lightmirrors:
|
||||||
image: lightmirrors/mirrors
|
image: lightmirrors/mirrors
|
||||||
build: ./mirrors
|
build:
|
||||||
|
context: ./src
|
||||||
volumes:
|
volumes:
|
||||||
- ./mirrors:/app
|
- ./src/:/app
|
||||||
- ./data/cache:/app/cache
|
- ./data/cache:/app/cache
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
|
@ -8,7 +8,6 @@ ADD https://hub.gitmirror.com/https://github.com/mayswind/AriaNg/releases/downlo
|
|||||||
|
|
||||||
RUN unzip AriaNg-1.3.7.zip && rm AriaNg-1.3.7.zip
|
RUN unzip AriaNg-1.3.7.zip && rm AriaNg-1.3.7.zip
|
||||||
|
|
||||||
|
|
||||||
ADD requirements.txt /app/requirements.txt
|
ADD requirements.txt /app/requirements.txt
|
||||||
|
|
||||||
RUN pip install -r /app/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/
|
RUN pip install -r /app/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/
|
||||||
@ -17,6 +16,6 @@ WORKDIR /app
|
|||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
CMD ["python", "server.py"]
|
CMD ["python", "mirrorsrun/server.py"]
|
||||||
|
|
||||||
|
|
@ -4,7 +4,7 @@ import uuid
|
|||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
|
|
||||||
from config import RPC_SECRET, ARIA2_RPC_URL
|
from mirrorsrun.config import RPC_SECRET, ARIA2_RPC_URL
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
@ -11,9 +11,9 @@ from starlette.requests import Request
|
|||||||
from starlette.responses import Response
|
from starlette.responses import Response
|
||||||
from starlette.status import HTTP_500_INTERNAL_SERVER_ERROR, HTTP_504_GATEWAY_TIMEOUT
|
from starlette.status import HTTP_500_INTERNAL_SERVER_ERROR, HTTP_504_GATEWAY_TIMEOUT
|
||||||
|
|
||||||
from aria2_api import add_download
|
from mirrorsrun.aria2_api import add_download
|
||||||
|
|
||||||
from config import CACHE_DIR, EXTERNAL_URL_ARIA2
|
from mirrorsrun.config import CACHE_DIR, EXTERNAL_URL_ARIA2
|
||||||
from typing import Optional, Callable
|
from typing import Optional, Callable
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
@ -1,3 +1,7 @@
|
|||||||
|
import os
|
||||||
|
import sys
|
||||||
|
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
import signal
|
import signal
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
@ -10,17 +14,17 @@ from starlette.requests import Request
|
|||||||
from starlette.responses import RedirectResponse, Response
|
from starlette.responses import RedirectResponse, Response
|
||||||
from starlette.staticfiles import StaticFiles
|
from starlette.staticfiles import StaticFiles
|
||||||
|
|
||||||
from config import (
|
from mirrorsrun.config import (
|
||||||
BASE_DOMAIN,
|
BASE_DOMAIN,
|
||||||
RPC_SECRET,
|
RPC_SECRET,
|
||||||
EXTERNAL_URL_ARIA2,
|
EXTERNAL_URL_ARIA2,
|
||||||
EXTERNAL_HOST_ARIA2,
|
EXTERNAL_HOST_ARIA2,
|
||||||
SCHEME,
|
SCHEME,
|
||||||
)
|
)
|
||||||
from sites.docker import docker
|
from mirrorsrun.sites.docker import docker
|
||||||
from sites.npm import npm
|
from mirrorsrun.sites.npm import npm
|
||||||
from sites.pypi import pypi
|
from mirrorsrun.sites.pypi import pypi
|
||||||
from sites.torch import torch
|
from mirrorsrun.sites.torch import torch
|
||||||
|
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
|
|
0
src/mirrorsrun/sites/__init__.py
Normal file
0
src/mirrorsrun/sites/__init__.py
Normal file
@ -9,8 +9,8 @@ import httpx
|
|||||||
from starlette.requests import Request
|
from starlette.requests import Request
|
||||||
from starlette.responses import Response
|
from starlette.responses import Response
|
||||||
|
|
||||||
from proxy.direct import direct_proxy
|
from mirrorsrun.proxy.direct import direct_proxy
|
||||||
from proxy.file_cache import try_file_based_cache
|
from mirrorsrun.proxy.file_cache import try_file_based_cache
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
from starlette.requests import Request
|
from starlette.requests import Request
|
||||||
|
|
||||||
from proxy.direct import direct_proxy
|
from mirrorsrun.proxy.direct import direct_proxy
|
||||||
|
|
||||||
BASE_URL = "https://registry.npmjs.org/"
|
BASE_URL = "https://registry.npmjs.org/"
|
||||||
|
|
@ -3,8 +3,8 @@ import re
|
|||||||
from starlette.requests import Request
|
from starlette.requests import Request
|
||||||
from starlette.responses import Response
|
from starlette.responses import Response
|
||||||
|
|
||||||
from proxy.direct import direct_proxy
|
from mirrorsrun.proxy.direct import direct_proxy
|
||||||
from proxy.file_cache import try_file_based_cache
|
from mirrorsrun.proxy.file_cache import try_file_based_cache
|
||||||
|
|
||||||
pypi_file_base_url = "https://files.pythonhosted.org"
|
pypi_file_base_url = "https://files.pythonhosted.org"
|
||||||
pypi_base_url = "https://pypi.org"
|
pypi_base_url = "https://pypi.org"
|
@ -1,8 +1,8 @@
|
|||||||
from starlette.requests import Request
|
from starlette.requests import Request
|
||||||
from starlette.responses import Response
|
from starlette.responses import Response
|
||||||
|
|
||||||
from proxy.file_cache import try_file_based_cache
|
from mirrorsrun.proxy.file_cache import try_file_based_cache
|
||||||
from proxy.direct import direct_proxy
|
from mirrorsrun.proxy.direct import direct_proxy
|
||||||
|
|
||||||
BASE_URL = "https://download.pytorch.org"
|
BASE_URL = "https://download.pytorch.org"
|
||||||
|
|
0
mirrors/poetry.lock → src/poetry.lock
generated
0
mirrors/poetry.lock → src/poetry.lock
generated
Loading…
x
Reference in New Issue
Block a user