diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..4be8bb97 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,41 @@ +# EditorConfig is awesome: https://EditorConfig.org +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_style = space +indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true + +[Dockerfile] +indent_size = 4 + +[{docker-compose.yml,package.json,.travis.yml,.pcit.yml,.drone.yml}] +indent_size = 2 +indent_style = space + +### YAML +[*.{yml,yaml}] +indent_style = space +indent_size = 2 + +[*.md] +trim_trailing_whitespace = true +indent_size = 2 + +[*.py] +indent_size = 4 + +[*.php] +indent_size = 4 + +[*.{go,java}] +indent_size = 4 + +[*.xml] +indent_size = 4 + +[Makefile] +indent_style = tab diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..4e2718b4 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,18 @@ +* text eol=lf +*.png binary +*.jpg binary +*.tgz binary +*.zip binary +*.gz binary +*.md text +*.txt text +*.bash text eol=lf +*.sh text eol=lf +*.yaml text +*.yml text +*.7z binary +*.gz binary +*.tar binary +*.tgz binary +*.zip binary +*.py text diff=python \ No newline at end of file diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..4fb062d4 --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,3 @@ +# Code of Conduct + +- TODO diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..dd84ea78 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..bbcbbe7d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/pull.yml b/.github/pull.yml new file mode 100644 index 00000000..a68270a1 --- /dev/null +++ b/.github/pull.yml @@ -0,0 +1,5 @@ +version: "1" +rules: + - base: master + upstream: imxieke:master + mergeMethod: hardreset diff --git a/images/mariadb/scripts b/.github/workflows/.gitkeep similarity index 100% rename from images/mariadb/scripts rename to .github/workflows/.gitkeep diff --git a/.github/workflows/docker-aerospike.yml b/.github/workflows/docker-aerospike.yml new file mode 100644 index 00000000..bbe7b998 --- /dev/null +++ b/.github/workflows/docker-aerospike.yml @@ -0,0 +1,33 @@ +name: Docker Build Images AeroSpike + +on: + workflow_dispatch: + branches: + - master + schedule: + # Runs at 02:00 UTC on Mon. + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: aerospike + IMAGE_TAGS: "ce-5.3 ce-5.4 ce-5.5 ce-5.6 ce-5.7 ee-5.3 ee-5.4 ee-5.5 ee-5.6 ee-5.7 latest" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + for tag in ${IMAGE_TAGS}; do + docker build . -f images/${{ env.IMAGE_NAME }}/${tag}/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + - name: Push Docker Image To Github Package + run: | + for tag in ${IMAGE_TAGS}; do + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done diff --git a/.github/workflows/docker-alinux.yml b/.github/workflows/docker-alinux.yml new file mode 100644 index 00000000..515b88a8 --- /dev/null +++ b/.github/workflows/docker-alinux.yml @@ -0,0 +1,35 @@ +name: Docker Build Aliyun Linux + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: alinux + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + docker build . -f images/${{ env.IMAGE_NAME }}/3/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:3 + docker tag ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:3 ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:latest + docker build . -f images/${{ env.IMAGE_NAME }}/2/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:2 + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:latest + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:3 + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:2 diff --git a/.github/workflows/docker-alpine.yml b/.github/workflows/docker-alpine.yml new file mode 100644 index 00000000..aa614066 --- /dev/null +++ b/.github/workflows/docker-alpine.yml @@ -0,0 +1,35 @@ +name: Docker Build Alpine + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + IMAGE_NAME: alpine + IMAGE_TAGS: "latest edge 3.17 3.16 3.15 3.14 3.13 3.12" + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker Image + run: | + for tag in ${IMAGE_TAGS}; do + docker build . -f images/${{ env.IMAGE_NAME }}/${tag}/Dockerfile -t ${{ env.DOCKER_REGISTRY_GITHUB }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + + - name: Login to Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.DOCKER_REGISTRY_GITHUB }} + + - name: Push Docker Image To Github Package + run: | + for tag in ${IMAGE_TAGS}; do + docker push ${{ env.DOCKER_REGISTRY_GITHUB }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done diff --git a/.github/workflows/docker-altlinux.yml b/.github/workflows/docker-altlinux.yml new file mode 100644 index 00000000..feda2e21 --- /dev/null +++ b/.github/workflows/docker-altlinux.yml @@ -0,0 +1,36 @@ +name: Docker Build Images altlinux + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: altlinux + IMAGE_TAGS: "latest p10 p9 p8 sisyphus" + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + for tag in ${IMAGE_TAGS}; do + docker build . -f images/${{ env.IMAGE_NAME }}/${tag}/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + for tag in ${IMAGE_TAGS}; do + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done diff --git a/.github/workflows/docker-build-daily.yml b/.github/workflows/docker-build-daily.yml new file mode 100644 index 00000000..23817f8f --- /dev/null +++ b/.github/workflows/docker-build-daily.yml @@ -0,0 +1,66 @@ +name: Docker Build Images Daily + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + docker build . -f images/rabbitmq/latest/Dockerfile -t ${{ env.REGISTRY }}/dockenv/rabbitmq:latest + docker build . -f images/memcached/latest/Dockerfile -t ${{ env.REGISTRY }}/dockenv/memcached:latest + docker build . -f images/archlinux/latest/Dockerfile -t ${{ env.REGISTRY }}/dockenv/archlinux:latest + docker build . -f images/gentoo/latest/Dockerfile -t ${{ env.REGISTRY }}/dockenv/gentoo:latest + docker build . -f images/manjaro/latest/Dockerfile -t ${{ env.REGISTRY }}/dockenv/manjaro:latest + docker build . -f images/caddy/latest/Dockerfile -t ${{ env.REGISTRY }}/dockenv/caddy:latest + docker build . -f images/varnish/latest/Dockerfile -t ${{ env.REGISTRY }}/dockenv/varnish:latest + docker build . -f images/almalinux/latest/Dockerfile -t ${{ env.REGISTRY }}/dockenv/almalinux:latest + docker build . -f images/almalinux/8.4/Dockerfile -t ${{ env.REGISTRY }}/dockenv/almalinux:8.4 + docker build . -f images/amazonlinux/latest/Dockerfile -t ${{ env.REGISTRY }}/dockenv/amazonlinux:latest + docker build . -f images/busybox/latest/Dockerfile -t ${{ env.REGISTRY }}/dockenv/busybox:latest + docker build . -f images/busybox/glibc/Dockerfile -t ${{ env.REGISTRY }}/dockenv/busybox:glibc + docker build . -f images/busybox/musl/Dockerfile -t ${{ env.REGISTRY }}/dockenv/busybox:musl + docker build . -f images/kali/latest/Dockerfile -t ${{ env.REGISTRY }}/dockenv/kali:latest + docker build . -f images/rockylinux/latest/Dockerfile -t ${{ env.REGISTRY }}/dockenv/rockylinux:latest + docker build . -f images/rockylinux/8/Dockerfile -t ${{ env.REGISTRY }}/dockenv/rockylinux:8 + docker build . -f images/scientificlinux/latest/Dockerfile -t ${{ env.REGISTRY }}/dockenv/scientificlinux:latest + docker build . -f images/scientificlinux/7/Dockerfile -t ${{ env.REGISTRY }}/dockenv/scientificlinux:7 + docker build . -f images/phpmyadmin/latest/Dockerfile -t ${{ env.REGISTRY }}/dockenv/phpmyadmin:latest + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + docker push ${{ env.REGISTRY }}/dockenv/rabbitmq:latest + docker push ${{ env.REGISTRY }}/dockenv/phpmyadmin:latest + docker push ${{ env.REGISTRY }}/dockenv/memcached:latest + docker push ${{ env.REGISTRY }}/dockenv/archlinux:latest + docker push ${{ env.REGISTRY }}/dockenv/gentoo:latest + docker push ${{ env.REGISTRY }}/dockenv/manjaro:latest + docker push ${{ env.REGISTRY }}/dockenv/caddy:latest + docker push ${{ env.REGISTRY }}/dockenv/varnish:latest + docker push ${{ env.REGISTRY }}/dockenv/almalinux:latest + docker push ${{ env.REGISTRY }}/dockenv/almalinux:8.4 + docker push ${{ env.REGISTRY }}/dockenv/amazonlinux:latest + docker push ${{ env.REGISTRY }}/dockenv/busybox:latest + docker push ${{ env.REGISTRY }}/dockenv/busybox:glibc + docker push ${{ env.REGISTRY }}/dockenv/busybox:musl + docker push ${{ env.REGISTRY }}/dockenv/kali:latest + docker push ${{ env.REGISTRY }}/dockenv/rockylinux:latest + docker push ${{ env.REGISTRY }}/dockenv/rockylinux:8 + docker push ${{ env.REGISTRY }}/dockenv/scientificlinux:latest + docker push ${{ env.REGISTRY }}/dockenv/scientificlinux:7 diff --git a/.github/workflows/docker-build-weekly.yml b/.github/workflows/docker-build-weekly.yml new file mode 100644 index 00000000..08537303 --- /dev/null +++ b/.github/workflows/docker-build-weekly.yml @@ -0,0 +1,53 @@ +name: Docker Build Images Weekly + +on: + workflow_dispatch: + branches: + - master + schedule: + # Runs at 02:00 UTC on Mon. + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + docker build . -f images/geckodriver/latest/Dockerfile -t ${{ env.REGISTRY }}/dockenv/geckodriver:latest + docker build . -f images/chromedriver/latest/Dockerfile -t ${{ env.REGISTRY }}/dockenv/chromedriver:latest + docker build . -f images/rsync/latest/Dockerfile -t ${{ env.REGISTRY }}/dockenv/rsync:latest + docker build . -f images/acme/latest/Dockerfile -t ${{ env.REGISTRY }}/dockenv/acme:latest + docker build . -f images/beanstalkd/latest/Dockerfile -t ${{ env.REGISTRY }}/dockenv/beanstalkd:latest + docker build . -f images/beanstalkd/1.12/Dockerfile -t ${{ env.REGISTRY }}/dockenv/beanstalkd:1.12 + docker build . -f images/haproxy/latest/Dockerfile -t ${{ env.REGISTRY }}/dockenv/haproxy:latest + docker build . -f images/pgadmin4/latest/Dockerfile -t ${{ env.REGISTRY }}/dockenv/pgadmin4:latest + docker build . -f images/portainer/latest/Dockerfile -t ${{ env.REGISTRY }}/dockenv/portainer:latest + docker build . -f images/postgres/latest/Dockerfile -t ${{ env.REGISTRY }}/dockenv/postgres:latest + docker build . -f images/voidlinux/latest/Dockerfile -t ${{ env.REGISTRY }}/dockenv/voidlinux:latest + docker build . -f images/voidlinux/musl/Dockerfile -t ${{ env.REGISTRY }}/dockenv/voidlinux:musl + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + docker push ${{ env.REGISTRY }}/dockenv/geckodriver:latest + docker push ${{ env.REGISTRY }}/dockenv/chromedriver:latest + docker push ${{ env.REGISTRY }}/dockenv/rsync:latest + docker push ${{ env.REGISTRY }}/dockenv/acme:latest + docker push ${{ env.REGISTRY }}/dockenv/beanstalkd:latest + docker push ${{ env.REGISTRY }}/dockenv/beanstalkd:1.12 + docker push ${{ env.REGISTRY }}/dockenv/haproxy:latest + docker push ${{ env.REGISTRY }}/dockenv/pgadmin4:latest + docker push ${{ env.REGISTRY }}/dockenv/portainer:latest + docker push ${{ env.REGISTRY }}/dockenv/postgres:latest + docker push ${{ env.REGISTRY }}/dockenv/voidlinux:latest + docker push ${{ env.REGISTRY }}/dockenv/voidlinux:musl diff --git a/.github/workflows/docker-centos.yml b/.github/workflows/docker-centos.yml new file mode 100644 index 00000000..7a61e646 --- /dev/null +++ b/.github/workflows/docker-centos.yml @@ -0,0 +1,38 @@ +name: Docker Build CentOS + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: centos + IMAGE_TAGS: "7.9 8.3 8.4 stream stream8 stream9 stream9-dev" + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + for tag in ${IMAGE_TAGS}; do + docker build . -f images/${{ env.IMAGE_NAME }}/${tag}/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + docker tag ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:8.4 ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:latest + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + for tag in ${IMAGE_TAGS}; do + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:latest diff --git a/.github/workflows/docker-cirros.yml b/.github/workflows/docker-cirros.yml new file mode 100644 index 00000000..77ffe937 --- /dev/null +++ b/.github/workflows/docker-cirros.yml @@ -0,0 +1,36 @@ +name: Docker Build Cirros + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: cirros + IMAGE_TAGS: "latest 0.5 0" + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + for tag in ${IMAGE_TAGS}; do + docker build . -f images/${{ env.IMAGE_NAME }}/${tag}/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + for tag in ${IMAGE_TAGS}; do + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done diff --git a/.github/workflows/docker-clearlinux.yml b/.github/workflows/docker-clearlinux.yml new file mode 100644 index 00000000..74947ca2 --- /dev/null +++ b/.github/workflows/docker-clearlinux.yml @@ -0,0 +1,36 @@ +name: Docker Build Clearlinux + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: clearlinux + IMAGE_TAGS: "latest base" + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + for tag in ${IMAGE_TAGS}; do + docker build . -f images/${{ env.IMAGE_NAME }}/${tag}/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + for tag in ${IMAGE_TAGS}; do + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done diff --git a/.github/workflows/docker-debian.yml b/.github/workflows/docker-debian.yml new file mode 100644 index 00000000..988ea35f --- /dev/null +++ b/.github/workflows/docker-debian.yml @@ -0,0 +1,37 @@ +name: Docker Build Debian + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: debian + IMAGE_TAGS: "latest bullseye buster stretch jessie testing sid" + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + for tag in ${IMAGE_TAGS}; do + docker build . -f images/${{ env.IMAGE_NAME }}/${tag}/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + for tag in ${IMAGE_TAGS}; do + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + diff --git a/.github/workflows/docker-dotnet.yml b/.github/workflows/docker-dotnet.yml new file mode 100644 index 00000000..0c90d9dd --- /dev/null +++ b/.github/workflows/docker-dotnet.yml @@ -0,0 +1,38 @@ +name: Docker Build Dotnet + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: dotnet + IMAGE_TAGS: "2 3 5 6" + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + for tag in ${IMAGE_TAGS}; do + docker build . -f images/${{ env.IMAGE_NAME }}/${tag}/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + docker tag ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:6 ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:latest + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + for tag in ${IMAGE_TAGS}; do + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:latest diff --git a/.github/workflows/docker-elastic.yml b/.github/workflows/docker-elastic.yml new file mode 100644 index 00000000..61527e70 --- /dev/null +++ b/.github/workflows/docker-elastic.yml @@ -0,0 +1,36 @@ +name: Docker Build Elastic + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: elastic + IMAGE_TAGS: "latest 7 6" + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + for tag in ${IMAGE_TAGS}; do + docker build . -f images/${{ env.IMAGE_NAME }}/${tag}/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + for tag in ${IMAGE_TAGS}; do + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done diff --git a/.github/workflows/docker-fedora.yml b/.github/workflows/docker-fedora.yml new file mode 100644 index 00000000..e14d9e8f --- /dev/null +++ b/.github/workflows/docker-fedora.yml @@ -0,0 +1,36 @@ +name: Docker Build Fedora + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: fedora + IMAGE_TAGS: "latest 36 35 34 33" + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + for tag in ${IMAGE_TAGS}; do + docker build . -f images/${{ env.IMAGE_NAME }}/${tag}/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + for tag in ${IMAGE_TAGS}; do + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done diff --git a/.github/workflows/docker-go.yml b/.github/workflows/docker-go.yml new file mode 100644 index 00000000..51d4f50e --- /dev/null +++ b/.github/workflows/docker-go.yml @@ -0,0 +1,36 @@ +name: Docker Build Go + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: go + IMAGE_TAGS: "latest 1.15 1.16 1.17" + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + for tag in ${IMAGE_TAGS}; do + docker build . -f images/${{ env.IMAGE_NAME }}/${tag}/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + for tag in ${IMAGE_TAGS}; do + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done diff --git a/.github/workflows/docker-hhvm.yml b/.github/workflows/docker-hhvm.yml new file mode 100644 index 00000000..048fbf9f --- /dev/null +++ b/.github/workflows/docker-hhvm.yml @@ -0,0 +1,36 @@ +name: Docker Build Images HHVM + +on: + workflow_dispatch: + branches: + - master + schedule: + # Runs at 02:00 UTC on Mon. + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: hhvm + IMAGE_TAGS: "latest 3 4" + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + for tag in ${IMAGE_TAGS}; do + docker build . -f images/${{ env.IMAGE_NAME }}/${tag}/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + for tag in ${IMAGE_TAGS}; do + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done diff --git a/.github/workflows/docker-kibana.yml b/.github/workflows/docker-kibana.yml new file mode 100644 index 00000000..2ce7a910 --- /dev/null +++ b/.github/workflows/docker-kibana.yml @@ -0,0 +1,36 @@ +name: Docker Build Kibana + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: kibana + IMAGE_TAGS: "latest 6 7" + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + for tag in ${IMAGE_TAGS}; do + docker build . -f images/${{ env.IMAGE_NAME }}/${tag}/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + for tag in ${IMAGE_TAGS}; do + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done diff --git a/.github/workflows/docker-logstash.yml b/.github/workflows/docker-logstash.yml new file mode 100644 index 00000000..018d2402 --- /dev/null +++ b/.github/workflows/docker-logstash.yml @@ -0,0 +1,36 @@ +name: Docker Build Logstash + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: logstash + IMAGE_TAGS: "latest 6 7" + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + for tag in ${IMAGE_TAGS}; do + docker build . -f images/${{ env.IMAGE_NAME }}/${tag}/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + for tag in ${IMAGE_TAGS}; do + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done diff --git a/.github/workflows/docker-mariadb.yml b/.github/workflows/docker-mariadb.yml new file mode 100644 index 00000000..6cacd6de --- /dev/null +++ b/.github/workflows/docker-mariadb.yml @@ -0,0 +1,36 @@ +name: Docker Build Mariadb + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: mariadb + IMAGE_TAGS: "latest 10.2 10.3 10.4 10.5 10.6 10.7" + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + for tag in ${IMAGE_TAGS}; do + docker build . -f images/${{ env.IMAGE_NAME }}/${tag}/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + for tag in ${IMAGE_TAGS}; do + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done diff --git a/.github/workflows/docker-megaia.yml b/.github/workflows/docker-megaia.yml new file mode 100644 index 00000000..d5ad7c9f --- /dev/null +++ b/.github/workflows/docker-megaia.yml @@ -0,0 +1,36 @@ +name: Docker Build Magaia Linux + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: megaia + IMAGE_TAGS: "latest 7 8" + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + for tag in ${IMAGE_TAGS}; do + docker build . -f images/${{ env.IMAGE_NAME }}/${tag}/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + for tag in ${IMAGE_TAGS}; do + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done diff --git a/.github/workflows/docker-mongo.yml b/.github/workflows/docker-mongo.yml new file mode 100644 index 00000000..5b04eac3 --- /dev/null +++ b/.github/workflows/docker-mongo.yml @@ -0,0 +1,36 @@ +name: Docker Build MongoDB + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: mongo + IMAGE_TAGS: "latest 4.4 5.0" + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + for tag in ${IMAGE_TAGS}; do + docker build . -f images/${{ env.IMAGE_NAME }}/${tag}/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + for tag in ${IMAGE_TAGS}; do + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done diff --git a/.github/workflows/docker-mssql.yml b/.github/workflows/docker-mssql.yml new file mode 100644 index 00000000..655f5bdb --- /dev/null +++ b/.github/workflows/docker-mssql.yml @@ -0,0 +1,36 @@ +name: Docker Build mssql + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: mssql + IMAGE_TAGS: "latest 2017 2019" + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + for tag in ${IMAGE_TAGS}; do + docker build . -f images/${{ env.IMAGE_NAME }}/${tag}/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + for tag in ${IMAGE_TAGS}; do + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done diff --git a/.github/workflows/docker-mysql.yml b/.github/workflows/docker-mysql.yml new file mode 100644 index 00000000..88064ac9 --- /dev/null +++ b/.github/workflows/docker-mysql.yml @@ -0,0 +1,38 @@ +name: Docker Build MYSQL + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: mysql + IMAGE_TAGS: "5.6 5.7 8.0" + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + for tag in ${IMAGE_TAGS}; do + docker build . -f images/${{ env.IMAGE_NAME }}/${tag}/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + docker tag ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:8.0 ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:latest + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + for tag in ${IMAGE_TAGS}; do + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:latest diff --git a/.github/workflows/docker-openeuler.yml b/.github/workflows/docker-openeuler.yml new file mode 100644 index 00000000..bfd59bd1 --- /dev/null +++ b/.github/workflows/docker-openeuler.yml @@ -0,0 +1,36 @@ +name: Docker Build OpenEuler + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: openeuler + IMAGE_TAGS: "latest 20.09 21.09" + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + for tag in ${IMAGE_TAGS}; do + docker build . -f images/${{ env.IMAGE_NAME }}/${tag}/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + for tag in ${IMAGE_TAGS}; do + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done diff --git a/.github/workflows/docker-opensuse.yml b/.github/workflows/docker-opensuse.yml new file mode 100644 index 00000000..61210774 --- /dev/null +++ b/.github/workflows/docker-opensuse.yml @@ -0,0 +1,37 @@ +name: Docker Build OpenSuse + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: opensuse + IMAGE_TAGS: "leap tumbleweed" + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + for tag in ${IMAGE_TAGS}; do + docker build . -f images/${{ env.IMAGE_NAME }}/${tag}/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + docker tag ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:tumbleweed ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:latest + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + for tag in ${IMAGE_TAGS}; do + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done diff --git a/.github/workflows/docker-oraclelinux.yml b/.github/workflows/docker-oraclelinux.yml new file mode 100644 index 00000000..c9ca23f7 --- /dev/null +++ b/.github/workflows/docker-oraclelinux.yml @@ -0,0 +1,36 @@ +name: Docker Build Oracle Linux + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: oraclelinux + IMAGE_TAGS: "latest 7 8 7-slim 8-slim" + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + for tag in ${IMAGE_TAGS}; do + docker build . -f images/${{ env.IMAGE_NAME }}/${tag}/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + for tag in ${IMAGE_TAGS}; do + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done diff --git a/.github/workflows/docker-photon.yml b/.github/workflows/docker-photon.yml new file mode 100644 index 00000000..cf862c9d --- /dev/null +++ b/.github/workflows/docker-photon.yml @@ -0,0 +1,36 @@ +name: Docker Build Photon + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: photon + IMAGE_TAGS: "latest 1 2 3 4" + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + for tag in ${IMAGE_TAGS}; do + docker build . -f images/${{ env.IMAGE_NAME }}/${tag}/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + for tag in ${IMAGE_TAGS}; do + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done diff --git a/.github/workflows/docker-redis.yml b/.github/workflows/docker-redis.yml new file mode 100644 index 00000000..43392f06 --- /dev/null +++ b/.github/workflows/docker-redis.yml @@ -0,0 +1,37 @@ +name: Docker Build Redis + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: redis + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + docker build . -f images/${{ env.IMAGE_NAME }}/latest/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:latest + docker build . -f images/${{ env.IMAGE_NAME }}/6.2/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:6.2 + docker build . -f images/${{ env.IMAGE_NAME }}/6.0/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:6.0 + docker build . -f images/${{ env.IMAGE_NAME }}/5.0/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:5.0 + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:latest + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:6.2 + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:6.0 + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:5.0 diff --git a/.github/workflows/docker-rhel.yml b/.github/workflows/docker-rhel.yml new file mode 100644 index 00000000..15809694 --- /dev/null +++ b/.github/workflows/docker-rhel.yml @@ -0,0 +1,39 @@ +name: Docker Build rhel + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: rhel + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + docker build . -f images/${{ env.IMAGE_NAME }}/8/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:8 + docker tag ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:8 ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:latest + docker build . -f images/${{ env.IMAGE_NAME }}/7/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:7 + docker build . -f images/${{ env.IMAGE_NAME }}/6/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:6 + docker build . -f images/${{ env.IMAGE_NAME }}/minimal/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:minimal + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:latest + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:8 + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:7 + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:6 + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:minimal diff --git a/.github/workflows/docker-selenium.yml b/.github/workflows/docker-selenium.yml new file mode 100644 index 00000000..3a2d05ee --- /dev/null +++ b/.github/workflows/docker-selenium.yml @@ -0,0 +1,36 @@ +name: Docker Build Selenium + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: selenium + IMAGE_TAGS: "node-chrome node-edge node-firefox standalone-chrome standalone-edge standalone-firefox" + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + for tag in ${IMAGE_TAGS}; do + docker build . -f images/${{ env.IMAGE_NAME }}/${tag}/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + for tag in ${IMAGE_TAGS}; do + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done diff --git a/.github/workflows/docker-ubuntu.yml b/.github/workflows/docker-ubuntu.yml new file mode 100644 index 00000000..2e6c2645 --- /dev/null +++ b/.github/workflows/docker-ubuntu.yml @@ -0,0 +1,36 @@ +name: Docker Build Ubuntu + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ubuntu + IMAGE_TAGS: "latest 22.10 22.04 21.10 21.04 20.10 20.04 18.04 16.04" + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + for tag in ${IMAGE_TAGS}; do + docker build . -f images/${{ env.IMAGE_NAME }}/${tag}/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + for tag in ${IMAGE_TAGS}; do + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done diff --git a/.github/workflows/docker-zookeeper.yml b/.github/workflows/docker-zookeeper.yml new file mode 100644 index 00000000..b10514dc --- /dev/null +++ b/.github/workflows/docker-zookeeper.yml @@ -0,0 +1,36 @@ +name: Docker Build Zookeeper + +on: + workflow_dispatch: + branches: + - master + schedule: + - cron: '0 2 * * *' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: zookeeper + IMAGE_TAGS: "latest 3.5 3.6 3.7" + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: | + for tag in ${IMAGE_TAGS}; do + docker build . -f images/${{ env.IMAGE_NAME }}/${tag}/Dockerfile -t ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done + + - name: Login Github Package Registry + run: | + docker login -u ${{secrets.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ env.REGISTRY }} + + - name: Push Docker Image To Github Package + run: | + for tag in ${IMAGE_TAGS}; do + docker push ${{ env.REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag} + done diff --git a/.gitignore b/.gitignore index c5b4a052..e1fdaeff 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,14 @@ +.env *.tar *.tgz *.tar.* *.tgz.* *.zip -.DS_Store +*.DS_Store *.log -/conf.ini +*.swp +*.pid + +/tmp +/examples +/runtime diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..8272b49e --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,16 @@ +{ + "files.associations": { + "env-example": "dotenv", + "Dockerfile-*": "dockerfile", + "Dockerfile.*": "dockerfile", + "*.ign": "json", + "*.fcc": "yaml", + ".ini*": "ini" + }, + "files.autoSave": "onFocusChange", + "editor.fontSize": 16, + "gitlens.advanced.fileHistoryFollowsRenames": true, + "gitlens.advanced.fileHistoryShowAllBranches": true, + "gitlens.blame.heatmap.location": "left" +} + diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..e11331c6 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright 2016 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index d84a795b..1d235e3a 100755 --- a/README.md +++ b/README.md @@ -1,40 +1,36 @@ -### Xiekers Docker Images Repo! - -# Debian - stretch(9) - -``` -Buildbot ---> Archlinux aur Build Bot -golang ---> go language support environment -h5ai ---> online file view -java ---> java(8) language support environment. -nextcloud ---> an open source, self-hosted file share and communication platform, like owncloud. -owncloud ---> an open source, self-hosted file sync and share app platform. -php7 ---> php(7) language support environment running in alpine include nginx php7! -rsync ---> an open source utility that provides fast incremental file transfer. -sshd ---> support remote access via ssh ,running in debian buster -ttyd ---> Share your terminal over the web -``` - -### Run - -``` -$ run shadowsocks -docker run -d -p 6443:6443 -e PASSWORD=passwd registry.cn-hongkong.aliyuncs.com/imxieke/shadowsocks -``` - -``` -docker run -d -p 3308:3306 -e MYSQL_ROOT_PASSWORD=19960318 registry.cn-hongkong.aliyuncs.com/imxieke/mysql:latest --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci -``` - -### Linux - - alpine A minimal Linux - amazonlinux Amazon Distribution,Base RHEL - archlinux A simple, lightweight distribution - debian Debian is a Linux distribution that's composed entirely of free and open-source software. - deepin a beautiful open source GNU/Linux, Base Debian - ubuntu Ubuntu is a Debian-based Linux operating system based on free software. - -#### images/name/Dockerfile is latest version image -#### images/name/Dockerfile.dev is dev version image +

Dockenv

+ +

+ + + +

Cloudflying Docker Images Repo

+

+remove /var/lib/pacman folder will be loss package info +## Docker Registry Address +### China Shanghai +- registry.cn-shanghai.aliyuncs.com/dockenv +## Oversea +- ghcr.io/dockenv + +## Directory or File Comments + + +| Name | Note | +|---|---| +| conf | Docker Container Conf | +| docs | Current Project Document | +| images | Docker Images | +| runtime | Docker runtime Attachment | +| scripts | Some Docker Tools Scripts | +| dockenv | Docker Images Utils | + +## Docker Image +> view from [here](/docs/images.md) + +## Issues +> view from [here](/docs/issues.md) + +### License + +The MIT License (MIT) diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..80c872d9 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,10 @@ +# Security Policy + +## example image + +| name | tag | +| ------- | ------------------ | +| ubuntu | 22.04 | + +## Reporting a Vulnerability +[Click here to Open new issue with bug report](https://github.com/imxieke/dockenv/issues/new?assignees=&labels=&template=bug_report.md&title=Reporting\ a\ Vulnerability) diff --git a/_config.yml b/_config.yml deleted file mode 100644 index c4192631..00000000 --- a/_config.yml +++ /dev/null @@ -1 +0,0 @@ -theme: jekyll-theme-cayman \ No newline at end of file diff --git a/conf/elk/README.md b/conf/elk/README.md new file mode 100644 index 00000000..aa6527e3 --- /dev/null +++ b/conf/elk/README.md @@ -0,0 +1,21 @@ +当前默认的xpack配置为Trial版30天使用,密码在docker-compose的es主节点配置的 +若想要开启集群内部安全通信ssl CA认证则将es的几个yml文件的xpack注释打开,同时将trial版配置注释掉 +然后进入master节点 + +创建证书: bin/elasticsearch-certutil cert -out config/elastic-certificates.p12 -pass "" + +创建证书目录: mkdir config/certs + +mv config/elastic-*.p12 config/certs/ + +chown -R elasticsearch:root config/certs/ + +再把证书文件 certs 复制到其他节点并赋予权限。 + +重启 elasticsearch + +重置密码: bin/elasticsearch-setup-passwords interactive + +注意: filebeat.yml权限 + +重置密码: `docker-compose exec -T elasticsearch bin/elasticsearch-setup-passwords auto --batch` \ No newline at end of file diff --git a/conf/elk/docker-compose.yml b/conf/elk/docker-compose.yml new file mode 100644 index 00000000..61e35fb0 --- /dev/null +++ b/conf/elk/docker-compose.yml @@ -0,0 +1,208 @@ +version: "3.2" +services: + es-master: + container_name: es-master + hostname: es-master + image: elasticsearch:7.4.2 + restart: always + ports: + - 9200:9200 + - 9300:9300 + volumes: + - ./elasticsearch/master/conf/es-master.yml:/usr/share/elasticsearch/config/elasticsearch.yml + - ./elasticsearch/master/data:/usr/share/elasticsearch/data + - ./elasticsearch/master/logs:/usr/share/elasticsearch/logs + - ./escerts:/usr/share/elasticsearch/config/certs + environment: + - "ES_JAVA_OPTS=-Xms512m -Xmx512m" + - TIMEZONE=Asia/ShangHai + - ELASTIC_PASSWORD=123456 + #ulimits: + # memlock: + # soft: -1 + # hard: -1 + # nofile: + # soft: 65536 + # hard: 65536 + networks: + - elknet + + es-slave1: + container_name: es-slave1 + image: elasticsearch:7.4.2 + restart: always + ports: + - 9201:9200 + - 9301:9300 + volumes: + - ./elasticsearch/slave1/conf/es-slave1.yml:/usr/share/elasticsearch/config/elasticsearch.yml + - ./elasticsearch/slave1/data:/usr/share/elasticsearch/data + - ./elasticsearch/slave1/logs:/usr/share/elasticsearch/logs + - ./escerts:/usr/share/elasticsearch/config/certs + environment: + - "ES_JAVA_OPTS=-Xms512m -Xmx512m" + - TIMEZONE=Asia/ShangHai + #ulimits: + # memlock: + # soft: -1 + # hard: -1 + # nofile: + # soft: 65536 + # hard: 65536 + networks: + - elknet + + es-slave2: + container_name: es-slave2 + image: elasticsearch:7.4.2 + restart: always + ports: + - 9202:9200 + - 9302:9300 + volumes: + - ./elasticsearch/slave2/conf/es-slave2.yml:/usr/share/elasticsearch/config/elasticsearch.yml + - ./elasticsearch/slave2/data:/usr/share/elasticsearch/data + - ./elasticsearch/slave2/logs:/usr/share/elasticsearch/logs + - ./escerts:/usr/share/elasticsearch/config/certs + environment: + - "ES_JAVA_OPTS=-Xms512m -Xmx512m" + - TIMEZONE=Asia/ShangHai + #ulimits: + # memlock: + # soft: -1 + # hard: -1 + # nofile: + # soft: 65536 + # hard: 65536 + networks: + - elknet + + # kibana + kibana: + container_name: kibana + hostname: kibana + image: kibana:7.4.2 + restart: always + ports: + - 5601:5601 + volumes: + - ./kibana/conf/kibana.yml:/usr/share/kibana/config/kibana.yml + environment: + - elasticsearch.hosts=http://es-master:9200 + - TIMEZONE=Asia/ShangHai + depends_on: + - es-master + - es-slave1 + - es-slave2 + networks: + - elknet + + # logstash + logstash: + container_name: logstash + hostname: logstash + image: logstash:7.4.2 + command: logstash -f ./conf/logstash-filebeat.conf + restart: always + volumes: + # 映射到容器中 + - ./logstash/conf/logstash-filebeat.conf:/usr/share/logstash/conf/logstash-filebeat.conf + - ./logstash/conf/logstash.yml:/usr/share/logstash/config/logstash.yml + environment: + - elasticsearch.hosts=http://es-master:9200 + # 解决logstash监控连接报错 + - xpack.monitoring.elasticsearch.hosts=http://es-master:9200 + - TIMEZONE=Asia/ShangHai + ports: + - 5044:5044 + depends_on: + - es-master + - es-slave1 + - es-slave2 + networks: + - elknet + + # filebeat + filebeat: + container_name: filebeat + hostname: filebeat + image: docker.elastic.co/beats/filebeat:7.4.2 + restart: always + volumes: + - ./filebeat/conf/filebeat.yml:/usr/share/filebeat/filebeat.yml + - ./logs:/var/log + - /www/docker/log:/var/laravellog + - ./filebeat/logs:/usr/share/filebeat/logs + - ./filebeat/data:/usr/share/filebeat/data + # 将指定容器连接到当前连接,可以设置别名,避免ip方式导致的容器重启动态改变的无法连接情况 + environment: + - TIMEZONE=Asia/ShangHai + links: + - logstash + # 依赖服务[可无] + depends_on: + - es-master + - es-slave1 + - es-slave2 + networks: + - elknet + + # es-head + es-head: + container_name: es-head + image: mobz/elasticsearch-head:5 + restart: always + ports: + - 9100:9100 + depends_on: + - es-master + - es-slave1 + - es-slave2 + networks: + - elknet + + # es监控工具 + cerebro: + container_name: cerebro + image: lmenezes/cerebro + restart: always + ports: + - 9001:9000 + command: + - -Dhosts.0.host=http://es-master:9200 + networks: + - elknet + + # es索引管理 + #curator: + # container_name: curator + # image: elastic/curator + # environment: + # ELASTICSEARCH_HOST: http://es-master:9200 + # CRON: "30 0 * * *" # 每天 0 点 30 分清理 ${UNIT_COUNT} 天之前的索引 + # CONFIG_FILE: /usr/share/curator/config/curator.yml + # COMMAND: /usr/share/curator/config/delete_log_files_curator.yml + # UNIT_COUNT: 10 + # network_mode: "host" + # restart: always + # depends_on: + # - es-master + # - es-slave1 + # - es-slave2 + + # docker可视化工具 + #portainer: + # container_name: portainer + # image: portainer/portainer + # ports: + # - 9002:9002 + # command: -H unix:///var/run/docker.sock + # volumes: + # - /var/run/docker.sock:/var/run/docker.sock + # - ./portainer-data:/data + # networks: + # - elknet + +networks: + elknet: + driver: bridge \ No newline at end of file diff --git a/conf/elk/elk.sh b/conf/elk/elk.sh new file mode 100644 index 00000000..64236c6d --- /dev/null +++ b/conf/elk/elk.sh @@ -0,0 +1,117 @@ +#./bin/bash +# 定义颜色 +BLUE_COLOR="\033[36m" +RED_COLOR="\033[31m" +GREEN_COLOR="\033[32m" +VIOLET_COLOR="\033[35m" +RES="\033[0m" + +echo -e "${BLUE_COLOR}# ######################################################################${RES}" +echo -e "${BLUE_COLOR}# Docker ELK Shell Script #${RES}" +echo -e "${BLUE_COLOR}# Blog: www.voocel.com #${RES}" +echo -e "${BLUE_COLOR}# Email: voocel@gmail.com #${RES}" +echo -e "${BLUE_COLOR}# ######################################################################${RES}" + +if [ "$(free -g|awk '/^Mem/{print $2-$3}')" -le 4 ];then + echo "可用内存小于4g,退出!" + exit +fi + +#优化系统 +#if [ -z "$(grep vm.max_map_count /etc/sysctl.conf)" ];then +# echo 'vm.max_map_count=655360' >>/etc/sysctl.conf +#else +# sed -i 's/vm.max_map_count.*/vm.max_map_count=655360/g' /etc/sysctl.conf +#fi +#sysctl -p + +# 创建目录 +echo -e "${BLUE_COLOR}---> create [elasticsearch]directory start.${RES}" +if [ ! -d "./elasticsearch/" ]; then +mkdir -p ./elasticsearch/master/conf ./elasticsearch/master/data ./elasticsearch/master/logs \ + ./elasticsearch/slave1/conf ./elasticsearch/slave1/data ./elasticsearch/slave1/logs \ + ./elasticsearch/slave2/conf ./elasticsearch/slave2/data ./elasticsearch/slave2/logs +fi +if [ ! -d "./escerts/" ]; then +mkdir ./escerts +fi +if [ ! -d "./logs/" ]; then +mkdir ./logs +fi + +echo -e "${RED_COLOR}---> create [kibana]directory start.${RES}" +if [ ! -d "./kibana/" ]; then +mkdir -p ./kibana/conf ./kibana/logs +fi + + echo -e "${GREEN_COLOR}---> create [logstash]directory start.${RES}" + if [ ! -d "./logstash/" ]; then + mkdir -p ./logstash/conf ./logstash/logs + fi + +echo -e "${GREEN_COLOR}---> create [filebeat]directory start.${RES}" +if [ ! -d "./filebeat/" ]; then +mkdir -p ./filebeat/conf ./filebeat/logs ./filebeat/data +fi + +echo -e "${VIOLET_COLOR}---> create [nginx]directory start.${RES}" +if [ ! -d "./nginx/" ]; then +mkdir -p ./nginx/conf ./nginx/logs ./nginx/www +fi +echo -e "${BLUE_COLOR}===> create directory success.${RES}" + +# 目录授权(data/logs 都要授读/写权限) +echo -e "${BLUE_COLOR}---> directory authorize start.${RES}" +if [ -d "./elasticsearch/" ]; then +chmod 777 ./elasticsearch/master/data/ ./elasticsearch/master/logs/ \ + ./elasticsearch/slave1/data/ ./elasticsearch/slave1/logs/ \ + ./elasticsearch/slave2/data/ ./elasticsearch/slave2/logs +fi +if [ -d "./escerts/" ]; then +chmod 777 ./escerts +fi + +if [ -d "./filebeat/" ]; then +chmod 777 ./filebeat/data/ ./filebeat/logs/ +fi +echo -e "${BLUE_COLOR}===> directory authorize success.${RES}" + +# 移动配置文件 +echo -e "${BLUE_COLOR}---> move [elasticsearch]config file start.${RES}" +if [ -f "./es-master.yml" ] && [ -f "./es-slave1.yml" ] && [ -f "./es-slave2.yml" ]; then +mv ./es-master.yml ./elasticsearch/master/conf +mv ./es-slave1.yml ./elasticsearch/slave1/conf +mv ./es-slave2.yml ./elasticsearch/slave2/conf +fi + +echo -e "${RED_COLOR}---> move [kibana]config file start.${RES}" +if [ -f "./kibana.yml" ]; then +mv ./kibana.yml ./kibana/conf +fi + + echo -e "${GREEN_COLOR}---> move [logstash]config file start.${RES}" + if [ -f "./logstash-filebeat.conf" ]; then + mv ./logstash-filebeat.conf ./logstash/conf + fi + if [ -f "./logstash.yml" ]; then + mv ./logstash.yml ./logstash/conf + chmod 777 ./logstash/conf/logstash.yml ./logstash/logs + fi + +echo -e "${GREEN_COLOR}---> move [filebeat]config file start.${RES}" +if [ -f "./filebeat.yml" ]; then +mv ./filebeat.yml ./filebeat/conf +chown root:root filebeat.yml +chmod 644 ./filebeat/filebeat.yml +fi + +echo -e "${VIOLET_COLOR}---> move [nginx]config file start.${RES}" +if [ -f "./nginx.conf" ]; then +mv ./nginx.conf ./nginx/conf +fi +echo -e "${BLUE_COLOR}===> move config files success.${RES}" +echo -e "${GREEN_COLOR}>>>>>>>>>>>>>>>>>> The End <<<<<<<<<<<<<<<<<<${RES}" + +# 部署项目 +echo -e "${BLUE_COLOR}==================> Docker deploy Start <==================${RES}" +docker-compose up --build -d \ No newline at end of file diff --git a/conf/elk/es-master.yml b/conf/elk/es-master.yml new file mode 100644 index 00000000..9e29ba9f --- /dev/null +++ b/conf/elk/es-master.yml @@ -0,0 +1,43 @@ +# 集群名称 +cluster.name: es-cluster +# 节点名称 +node.name: es-master +# 是否可以成为master节点 +node.master: true +# 是否允许该节点存储数据,默认开启 +node.data: false +# 锁住内存,不被使用到交换分区去, 生产必须为true,内存锁定检查,目的是内存地址直接映射,减少一次copy时间 +#bootstrap.memory_lock: true +# 系统过滤检查,防止数据损坏,考虑集群安全,生产设置成false +#bootstrap.system_call_filter: false +# 网络绑定 +network.host: 0.0.0.0 +# 设置对外服务的http端口 +http.port: 9200 +# 设置节点间交互的tcp端口 +transport.port: 9300 +# 集群发现 +discovery.seed_hosts: + - es-master + - es-slave1 + - es-slave2 +# 手动指定可以成为 mater 的所有节点的 name 或者 ip,这些配置将会在第一次选举中进行计算 +cluster.initial_master_nodes: + - es-master +# 支持跨域访问 +http.cors.enabled: true +http.cors.allow-origin: "*" +http.cors.allow-headers: Authorization,X-Requested-With,Content-Length,Content-Type +# 安全认证 +xpack.license.self_generated.type: trial +xpack.security.enabled: true +xpack.monitoring.collection.enabled: true + +################################ basic ssl ######################################### +# xpack.security.enabled: true +# xpack.license.self_generated.type: basic +# xpack.security.transport.ssl.enabled: true +# xpack.security.transport.ssl.verification_mode: certificate +# xpack.security.transport.ssl.keystore.path: certs/elastic-certificates.p12 +# xpack.security.transport.ssl.truststore.path: certs/elastic-certificates.p12 +#################################################################################### \ No newline at end of file diff --git a/conf/elk/es-slave1.yml b/conf/elk/es-slave1.yml new file mode 100644 index 00000000..eb858000 --- /dev/null +++ b/conf/elk/es-slave1.yml @@ -0,0 +1,41 @@ +# 集群名称 +cluster.name: es-cluster +# 节点名称 +node.name: es-slave1 +# 是否可以成为master节点 +node.master: true +# 是否允许该节点存储数据,默认开启 +node.data: true +# 锁住内存,不被使用到交换分区去 +#bootstrap.memory_lock: true +# 网络绑定 +network.host: 0.0.0.0 +# 设置对外服务的http端口 +http.port: 9201 +# 设置节点间交互的tcp端口 +#transport.port: 9301 +# 集群发现 +discovery.seed_hosts: + - es-master + - es-slave1 + - es-slave2 +# 手动指定可以成为 mater 的所有节点的 name 或者 ip,这些配置将会在第一次选举中进行计算 +cluster.initial_master_nodes: + - es-master +# 支持跨域访问 +http.cors.enabled: true +http.cors.allow-origin: "*" +http.cors.allow-headers: Authorization,X-Requested-With,Content-Length,Content-Type +# 安全认证 +xpack.license.self_generated.type: trial +xpack.security.enabled: true +xpack.monitoring.collection.enabled: true + +################################ basic ssl ######################################### +# xpack.security.enabled: true +# xpack.license.self_generated.type: basic +# xpack.security.transport.ssl.enabled: true +# xpack.security.transport.ssl.verification_mode: certificate +# xpack.security.transport.ssl.keystore.path: certs/elastic-certificates.p12 +# xpack.security.transport.ssl.truststore.path: certs/elastic-certificates.p12 +#################################################################################### \ No newline at end of file diff --git a/conf/elk/es-slave2.yml b/conf/elk/es-slave2.yml new file mode 100644 index 00000000..dd70fd4a --- /dev/null +++ b/conf/elk/es-slave2.yml @@ -0,0 +1,41 @@ +# 集群名称 +cluster.name: es-cluster +# 节点名称 +node.name: es-slave2 +# 是否可以成为master节点 +node.master: true +# 是否允许该节点存储数据,默认开启 +node.data: true +# 锁住内存,不被使用到交换分区去 +#bootstrap.memory_lock: true +# 网络绑定 +network.host: 0.0.0.0 +# 设置对外服务的http端口 +http.port: 9202 +# 设置节点间交互的tcp端口 +#transport.port: 9302 +# 集群发现 +discovery.seed_hosts: + - es-master + - es-slave1 + - es-slave2 +# 手动指定可以成为 mater 的所有节点的 name 或者 ip,这些配置将会在第一次选举中进行计算 +cluster.initial_master_nodes: + - es-master +# 支持跨域访问 +http.cors.enabled: true +http.cors.allow-origin: "*" +http.cors.allow-headers: Authorization,X-Requested-With,Content-Length,Content-Type +# 安全认证 +xpack.license.self_generated.type: trial +xpack.security.enabled: true +xpack.monitoring.collection.enabled: true + +################################ basic ssl ######################################### +# xpack.security.enabled: true +# xpack.license.self_generated.type: basic +# xpack.security.transport.ssl.enabled: true +# xpack.security.transport.ssl.verification_mode: certificate +# xpack.security.transport.ssl.keystore.path: certs/elastic-certificates.p12 +# xpack.security.transport.ssl.truststore.path: certs/elastic-certificates.p12 +#################################################################################### \ No newline at end of file diff --git a/conf/elk/filebeat.yml b/conf/elk/filebeat.yml new file mode 100644 index 00000000..c267532c --- /dev/null +++ b/conf/elk/filebeat.yml @@ -0,0 +1,54 @@ +filebeat.inputs: +- type: log + enabled: true + paths: + - /var/log/*.log + multiline.pattern: ^\[ + multiline.negate: true + multiline.match: after + fields: + log_source: nginx + +- type: log + enabled: true + paths: + # 日志文件路径列表,可用通配符,不递归 + - /var/laravellog/*.log + # - /var/log/php/php-fpm.log + # 正则表达式,匹配日记与 2020-06-01 为开头的记录为同一条日记记录。Filebeat 将所有不以 2020-06-01 开始的行与之前的行进行合并。 + multiline.pattern: '^[0-9]{4}/[0-9]{2}/[0-9]{2}' + # multiline.negate 与 multiline.match 配合使用。 multiline.pattern=^b 则以 b 开头的行是一条完整日志的开始,它和后面多个不以 b 开头的行组成一条完整日志 + multiline.negate: true + multiline.match: after + # timeout 表示超时时间,如果超过 timeout 还没有新的一行日志产生,则自动结束当前的多行、形成一条日志发出去。 + multiline.timeout: 5s + # Filebeat 以多快的频率去 prospector 指定的目录下面检测文件更新(比如是否有新增文件),如果设置为 0s,则 Filebeat 会尽可能快地感知更新(占用的 CPU 会变高)。默认是 10s。 + scan_frequency: 5s + fields: + log_source: laravel + +filebeat.config.modules: + path: ${path.config}/modules.d/*.yml + reload.enabled: false + +setup.template.settings: + index.number_of_shards: 1 + +setup.dashboards.enabled: false + +setup.kibana: + host: "http://kibana:5601" + +# 直接传输至es +#output.elasticsearch: +# hosts: ["http://es-master:9200"] +# index: "filebeat-%{[beat.version]}-%{+yyyy.MM.dd}" +# username: 'elastic' +# password: '123456' + +output.logstash: + hosts: ["logstash:5044"] + +processors: + - add_host_metadata: ~ + - add_cloud_metadata: ~ \ No newline at end of file diff --git a/conf/elk/kibana.yml b/conf/elk/kibana.yml new file mode 100644 index 00000000..02a21e53 --- /dev/null +++ b/conf/elk/kibana.yml @@ -0,0 +1,14 @@ +# 服务端口 +server.port: 5601 +# 服务IP +server.host: "0.0.0.0" +# ES +elasticsearch.hosts: ["http://es-master:9200"] +# 汉化 +i18n.locale: "zh-CN" + +xpack.monitoring.ui.container.elasticsearch.enabled: true + +# X-Pack安全凭证 +elasticsearch.username: "elastic" +elasticsearch.password: "123456" \ No newline at end of file diff --git a/conf/elk/logstash-filebeat.conf b/conf/elk/logstash-filebeat.conf new file mode 100644 index 00000000..738711c4 --- /dev/null +++ b/conf/elk/logstash-filebeat.conf @@ -0,0 +1,61 @@ +input { + # 来源beats + beats { + # 端口 + port => "5044" + } +} + +#input { + # 来源文件 +# file { +# path => ["/var/log/logstash/nginx.log"] +# start_position => "beginning" +# sincedb_path => "nul" +# type => "nginx" +# codec => "json" +# } +#} + +# 分析、过滤插件,可以多个 +filter { + if[fields][log_source] == "nginx" { + #grok{ + #match => { "message" => "%{IPORHOST:http_host} %{IPORHOST:clientip} - %{USERNAME:remote_user} \[%{HTTPDATE:timestamp}\]\"(?:%{WORD:http_verb} %{NOTSPACE:http_request}(?: HTTP/%{NUMBER:http_version})?|%{DATA:raw_http_request})\" %{NUMBER:response} (?:%{NUMBER:bytes_read}|-) %{QS:referrer} %{QS:agent} %{QS:xforwardedfor} %{NUMBER:request_time:float}"} + #} + json { + source => "message" + remove_field => "message" + } + } + if[fields][log_source] == "laravel" { + grok { + match => [ "message","\[%{TIMESTAMP_ISO8601:logtime}\] %{WORD:env}\.%{LOGLEVEL:level}\: %{GREEDYDATA:msg}" ] + } + } + geoip { + source => "clientip" + } +} + +output { + if[fields][log_source] == "nginx" { + # 输出选择elasticsearch + elasticsearch { + hosts => ["http://es-master:9200"] + index => "nginx-%{+YYYY.MM.dd}" + user => "elastic" + password => "123456" + } + } + if[fields][log_source] == "laravel" { + #if [level] == "ERROR" { + elasticsearch { + hosts => ["http://es-master:9200"] + index => "laravel-%{+YYYY.MM.dd}" + user => "elastic" + password => "123456" + } + #} + } +} \ No newline at end of file diff --git a/conf/elk/logstash.yml b/conf/elk/logstash.yml new file mode 100644 index 00000000..07b0b3ff --- /dev/null +++ b/conf/elk/logstash.yml @@ -0,0 +1,6 @@ +http.host: "0.0.0.0" +xpack.monitoring.elasticsearch.hosts: ["http://es-master:9200"] + +xpack.monitoring.enabled: true +xpack.monitoring.elasticsearch.username: "elastic" +xpack.monitoring.elasticsearch.password: "123456" \ No newline at end of file diff --git a/conf/elk/nginx.conf b/conf/elk/nginx.conf new file mode 100644 index 00000000..dc58d481 --- /dev/null +++ b/conf/elk/nginx.conf @@ -0,0 +1,53 @@ +worker_processes 1; +events { + worker_connections 1024; +} + +http { + include mime.types; + default_type application/octet-stream; + sendfile on; + keepalive_timeout 65; + + # log_format main '{"@timestamp":"$time_iso8601",' + # '"host":"$server_addr",' + # '"clientip":"$remote_addr",' + # '"size":"$body_bytes_sent",' + # '"responsetime":"$request_time",' + # '"user_agent":"$http_user_agent",' + # '"request":"$request",' + # '"request_method":"$request_method",' + # '"uri":"$uri",' + # '"domain":"$host",' + # '"xff":"$http_x_forwarded_for",' + # '"referer":"$http_referer",' + # '"status":"$status"}'; + # access_log /var/log/nginx.log main; + + # Nginx 负载均衡实现服务器的集群 + upstream spring-boot-es { + #weight 权重(数字越大,表明请求到的机会越大) + server 192.168.0.111:60 weight=5; + server 192.168.0.112:60 weight=5; + # 备份服务器 + server 192.168.0.110:60 backup; + } + + server { + listen 80; + server_name localhost; + + location / { + proxy_pass http://spring-boot-es; + proxy_set_header Host $host; + # proxy_set_header X-Forwarded-Host $server_name; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root html; + } + } +} \ No newline at end of file diff --git a/conf/mongo/conf/mongo.conf b/conf/mongo/conf/mongo.conf new file mode 100644 index 00000000..4324517a --- /dev/null +++ b/conf/mongo/conf/mongo.conf @@ -0,0 +1,43 @@ +# mongod.conf + +# for documentation of all options, see: +# http://docs.mongodb.org/manual/reference/configuration-options/ + +# Where and how to store data. +storage: + dbPath: /var/lib/mongodb + journal: + enabled: true +# engine: +# mmapv1: +# wiredTiger: + +# where to write logging data. +systemLog: + destination: file + logAppend: true + path: /var/log/mongodb/mongod.log + +# network interfaces +net: + port: 27017 + bindIp: 127.0.0.1 + + +# how the process runs +processManagement: + timeZoneInfo: /usr/share/zoneinfo + +#security: + +#operationProfiling: + +#replication: + +#sharding: + +## Enterprise-Only Options: + +#auditLog: + +#snmp: \ No newline at end of file diff --git a/conf/mongo/conf/mongod.yml b/conf/mongo/conf/mongod.yml new file mode 100644 index 00000000..355a2135 --- /dev/null +++ b/conf/mongo/conf/mongod.yml @@ -0,0 +1,44 @@ +# mongod.conf + +# for documentation of all options, see: +# http://docs.mongodb.org/manual/reference/configuration-options/ + +# Where and how to store data. +storage: + dbPath: /data/db + journal: + enabled: true + directoryPerDB: true +# engine: +# mmapv1: +# wiredTiger: + +# where to write logging data. +systemLog: + destination: file + logAppend: true + path: /var/log/mongodb/mongod.log + +# network interfaces +net: + port: 27017 + bindIp: 0.0.0.0 + + +# how the process runs +# processManagement: + +security: + authorization: enabled + +#operationProfiling: + +#replication: + +#sharding: + +## Enterprise-Only Options: + +#auditLog: + +#snmp: diff --git a/conf/mysql/createdb.sql.example b/conf/mysql/createdb.sql.example new file mode 100644 index 00000000..b0371854 --- /dev/null +++ b/conf/mysql/createdb.sql.example @@ -0,0 +1,28 @@ +# +# Copy createdb.sql.example to createdb.sql +# then uncomment then set database name and username to create you need databases +# +# example: .env MYSQL_USER=appuser and needed db name is myshop_db +# +# CREATE DATABASE IF NOT EXISTS `myshop_db` ; +# GRANT ALL ON `myshop_db`.* TO 'appuser'@'%' ; +# +# +# this sql script will auto run when the mysql container starts and the $DATA_PATH_HOST/mysql not found. +# +# if your $DATA_PATH_HOST/mysql exists and you do not want to delete it, you can run by manual execution: +# +# docker-compose exec mysql bash +# mysql -u root -p < /docker-entrypoint-initdb.d/createdb.sql +# + +#CREATE DATABASE IF NOT EXISTS `dev_db_1` COLLATE 'utf8_general_ci' ; +#GRANT ALL ON `dev_db_1`.* TO 'default'@'%' ; + +#CREATE DATABASE IF NOT EXISTS `dev_db_2` COLLATE 'utf8_general_ci' ; +#GRANT ALL ON `dev_db_2`.* TO 'default'@'%' ; + +#CREATE DATABASE IF NOT EXISTS `dev_db_3` COLLATE 'utf8_general_ci' ; +#GRANT ALL ON `dev_db_3`.* TO 'default'@'%' ; + +FLUSH PRIVILEGES ; \ No newline at end of file diff --git a/conf/mysql/my.conf b/conf/mysql/my.conf new file mode 100644 index 00000000..203ac0ac --- /dev/null +++ b/conf/mysql/my.conf @@ -0,0 +1,146 @@ +# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# +# The MySQL Community Server configuration file. +# +# For explanations see +# http://dev.mysql.com/doc/mysql/en/server-system-variables.html + +# For advice on how to change settings please see +# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html +[client] +port=3306 +socket = /var/run/mysqld/mysqld.sock +default-character-set=utf8 + +[mysql] +no-auto-rehash +default-character-set = utf8mb4 + +# Only allow UPDATEs and DELETEs that use keys. +#safe-updates + +[mysqld] +# Instead of skip-networking the default is now to listen only on +# localhost which is more compatible and is not less secure. +bind-address = 0.0.0.0 + +user = mysql +pid-file = /var/run/mysqld/mysqld.pid +socket = /var/run/mysqld/mysqld.sock +port = 3306 +character-set-server=utf8mb4 +collation-server=utf8mb4_unicode_ci +skip-name-resolve +skip-character-set-client-handshake +init_connect='SET NAMES utf8mb4' +# Disabling symbolic-links is recommended to prevent assorted security risks +symbolic-links=0 +# Remove leading # and set to the amount of RAM for the most important data +# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. +# innodb_buffer_pool_size = 128M +# +# Remove leading # to turn on a very important data integrity option: logging +# changes to the binary log between backups. +# log_bin +# +# Remove leading # to set options mainly useful for reporting servers. +# The server defaults are faster for transactions and fast SELECTs. +# Adjust sizes as needed, experiment to find the optimal values. +table_open_cache = 512 +max_heap_table_size = 64M +thread_cache_size = 64 +join_buffer_size = 128M +sort_buffer_size = 2M +datadir=/var/lib/mysql +socket=/var/lib/mysql/mysql.sock +default-storage-engine=INNODB +max_connections=512 +max_connect_errors = 9999999 +skip-host-cache +skip-name-resolve +query_cache_size = 64M +max_allowed_packet = 4M +server_id=1 +log-bin=mysql-bin +slow_query_log = 1 +slow_query_log_file =/var/lib/mysql-logs/slow.log +# slow-query-log-file = /var/log/mysql/mysql-slow.log # 5.6+ +# log-slow-queries = /var/log/mysql/mysql-slow.log +long_query_time = 2 +log-queries-not-using-indexes +log-error = /var/log/mysql/error.log +max_connections = 1024 +back_log = 128 +wait_timeout = 100 +interactive_timeout = 200 +sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES +innodb_thread_concurrency = 4 +query_cache_limit = 2M +key_buffer_size = 256M + +# *** myisam Specific options *** +read_buffer_size = 2M +read_rnd_buffer_size = 16M +bulk_insert_buffer_size = 64M +myisam_sort_buffer_size = 128M +myisam_max_sort_file_size = 10G +myisam_repair_threads = 1 +myisam_recover_options +default-authentication-plugin=mysql_native_password +sql-mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION" + +[myisamchk] +key_buffer_size = 512M +sort_buffer_size = 512M +read_buffer = 8M +write_buffer = 8M +# Disabling symbolic-links is recommended to prevent assorted security risks +symbolic-links =0 +thread_stack = 192K +transaction_isolation = REPEATABLE-READ +tmp_table_size = 64M +datadir = /var/lib/mysql +lc-messages-dir = /usr/share/mysql +explicit_defaults_for_timestamp + +[mysqld_safe] +# Increase the amount of open files allowed per process. Warning: Make +# sure you have set the global system limit high enough! The high value +# is required for a large number of opened tables +open-files-limit = 60000 + +[mysqld_safe] +log-error = /var/log/mysqld.log +pid-file = /var/run/mysqld/mysqld.pid +socket = /var/run/mysqld/mysqld.sock +nice = 0 + +[mysqldump] +quick +max_allowed_packet = 16M +log-error = /var/log/mysql/error.log + +# Recommended in standard MySQL setup +sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES + +[mysqlhotcopy] +interactive-timeout + +# * IMPORTANT: Additional settings that can override those from this file! +# The files must end with '.cnf', otherwise they'll be ignored. +# +!includedir /etc/mysql/conf.d/ diff --git a/conf/nginx/conf.d/.gitkeep b/conf/nginx/conf.d/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/conf/redis.conf b/conf/redis.conf new file mode 100644 index 00000000..105de0ac --- /dev/null +++ b/conf/redis.conf @@ -0,0 +1,1377 @@ +# Redis configuration file example. +# +# Note that in order to read the configuration file, Redis must be +# started with the file path as first argument: +# +# ./redis-server /path/to/redis.conf + +# Note on units: when memory size is needed, it is possible to specify +# it in the usual form of 1k 5GB 4M and so forth: +# +# 1k => 1000 bytes +# 1kb => 1024 bytes +# 1m => 1000000 bytes +# 1mb => 1024*1024 bytes +# 1g => 1000000000 bytes +# 1gb => 1024*1024*1024 bytes +# +# units are case insensitive so 1GB 1Gb 1gB are all the same. + +################################## INCLUDES ################################### + +# Include one or more other config files here. This is useful if you +# have a standard template that goes to all Redis servers but also need +# to customize a few per-server settings. Include files can include +# other files, so use this wisely. +# +# Notice option "include" won't be rewritten by command "CONFIG REWRITE" +# from admin or Redis Sentinel. Since Redis always uses the last processed +# line as value of a configuration directive, you'd better put includes +# at the beginning of this file to avoid overwriting config change at runtime. +# +# If instead you are interested in using includes to override configuration +# options, it is better to use include as the last line. +# +# include /path/to/local.conf +# include /path/to/other.conf + +################################## MODULES ##################################### + +# Load modules at startup. If the server is not able to load modules +# it will abort. It is possible to use multiple loadmodule directives. +# +# loadmodule /path/to/my_module.so +# loadmodule /path/to/other_module.so + +################################## NETWORK ##################################### + +# By default, if no "bind" configuration directive is specified, Redis listens +# for connections from all the network interfaces available on the server. +# It is possible to listen to just one or multiple selected interfaces using +# the "bind" configuration directive, followed by one or more IP addresses. +# +# Examples: +# +# bind 192.168.1.100 10.0.0.1 +# bind 127.0.0.1 ::1 +# +# ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the +# internet, binding to all the interfaces is dangerous and will expose the +# instance to everybody on the internet. So by default we uncomment the +# following bind directive, that will force Redis to listen only into +# the IPv4 loopback interface address (this means Redis will be able to +# accept connections only from clients running into the same computer it +# is running). +# +# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES +# JUST COMMENT THE FOLLOWING LINE. +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +bind 0.0.0.0 + +# Protected mode is a layer of security protection, in order to avoid that +# Redis instances left open on the internet are accessed and exploited. +# +# When protected mode is on and if: +# +# 1) The server is not binding explicitly to a set of addresses using the +# "bind" directive. +# 2) No password is configured. +# +# The server only accepts connections from clients connecting from the +# IPv4 and IPv6 loopback addresses 127.0.0.1 and ::1, and from Unix domain +# sockets. +# +# By default protected mode is enabled. You should disable it only if +# you are sure you want clients from other hosts to connect to Redis +# even if no authentication is configured, nor a specific set of interfaces +# are explicitly listed using the "bind" directive. +protected-mode yes + +# Accept connections on the specified port, default is 6379 (IANA #815344). +# If port 0 is specified Redis will not listen on a TCP socket. +port 6379 + +# TCP listen() backlog. +# +# In high requests-per-second environments you need an high backlog in order +# to avoid slow clients connections issues. Note that the Linux kernel +# will silently truncate it to the value of /proc/sys/net/core/somaxconn so +# make sure to raise both the value of somaxconn and tcp_max_syn_backlog +# in order to get the desired effect. +tcp-backlog 511 + +# Unix socket. +# +# Specify the path for the Unix socket that will be used to listen for +# incoming connections. There is no default, so Redis will not listen +# on a unix socket when not specified. +# +# unixsocket /tmp/redis.sock +# unixsocketperm 700 + +# Close the connection after a client is idle for N seconds (0 to disable) +timeout 0 + +# TCP keepalive. +# +# If non-zero, use SO_KEEPALIVE to send TCP ACKs to clients in absence +# of communication. This is useful for two reasons: +# +# 1) Detect dead peers. +# 2) Take the connection alive from the point of view of network +# equipment in the middle. +# +# On Linux, the specified value (in seconds) is the period used to send ACKs. +# Note that to close the connection the double of the time is needed. +# On other kernels the period depends on the kernel configuration. +# +# A reasonable value for this option is 300 seconds, which is the new +# Redis default starting with Redis 3.2.1. +tcp-keepalive 300 + +################################# GENERAL ##################################### + +# By default Redis does not run as a daemon. Use 'yes' if you need it. +# Note that Redis will write a pid file in /var/run/redis.pid when daemonized. +daemonize no + +# If you run Redis from upstart or systemd, Redis can interact with your +# supervision tree. Options: +# supervised no - no supervision interaction +# supervised upstart - signal upstart by putting Redis into SIGSTOP mode +# supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET +# supervised auto - detect upstart or systemd method based on +# UPSTART_JOB or NOTIFY_SOCKET environment variables +# Note: these supervision methods only signal "process is ready." +# They do not enable continuous liveness pings back to your supervisor. +supervised no + +# If a pid file is specified, Redis writes it where specified at startup +# and removes it at exit. +# +# When the server runs non daemonized, no pid file is created if none is +# specified in the configuration. When the server is daemonized, the pid file +# is used even if not specified, defaulting to "/var/run/redis.pid". +# +# Creating a pid file is best effort: if Redis is not able to create it +# nothing bad happens, the server will start and run normally. +pidfile /var/run/redis_6379.pid + +# Specify the server verbosity level. +# This can be one of: +# debug (a lot of information, useful for development/testing) +# verbose (many rarely useful info, but not a mess like the debug level) +# notice (moderately verbose, what you want in production probably) +# warning (only very important / critical messages are logged) +loglevel notice + +# Specify the log file name. Also the empty string can be used to force +# Redis to log on the standard output. Note that if you use standard +# output for logging but daemonize, logs will be sent to /dev/null +logfile "" + +# To enable logging to the system logger, just set 'syslog-enabled' to yes, +# and optionally update the other syslog parameters to suit your needs. +# syslog-enabled no + +# Specify the syslog identity. +# syslog-ident redis + +# Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7. +# syslog-facility local0 + +# Set the number of databases. The default database is DB 0, you can select +# a different one on a per-connection basis using SELECT where +# dbid is a number between 0 and 'databases'-1 +databases 16 + +# By default Redis shows an ASCII art logo only when started to log to the +# standard output and if the standard output is a TTY. Basically this means +# that normally a logo is displayed only in interactive sessions. +# +# However it is possible to force the pre-4.0 behavior and always show a +# ASCII art logo in startup logs by setting the following option to yes. +always-show-logo yes + +################################ SNAPSHOTTING ################################ +# +# Save the DB on disk: +# +# save +# +# Will save the DB if both the given number of seconds and the given +# number of write operations against the DB occurred. +# +# In the example below the behaviour will be to save: +# after 900 sec (15 min) if at least 1 key changed +# after 300 sec (5 min) if at least 10 keys changed +# after 60 sec if at least 10000 keys changed +# +# Note: you can disable saving completely by commenting out all "save" lines. +# +# It is also possible to remove all the previously configured save +# points by adding a save directive with a single empty string argument +# like in the following example: +# +# save "" + +save 900 1 +save 300 10 +save 60 10000 + +# By default Redis will stop accepting writes if RDB snapshots are enabled +# (at least one save point) and the latest background save failed. +# This will make the user aware (in a hard way) that data is not persisting +# on disk properly, otherwise chances are that no one will notice and some +# disaster will happen. +# +# If the background saving process will start working again Redis will +# automatically allow writes again. +# +# However if you have setup your proper monitoring of the Redis server +# and persistence, you may want to disable this feature so that Redis will +# continue to work as usual even if there are problems with disk, +# permissions, and so forth. +stop-writes-on-bgsave-error yes + +# Compress string objects using LZF when dump .rdb databases? +# For default that's set to 'yes' as it's almost always a win. +# If you want to save some CPU in the saving child set it to 'no' but +# the dataset will likely be bigger if you have compressible values or keys. +rdbcompression yes + +# Since version 5 of RDB a CRC64 checksum is placed at the end of the file. +# This makes the format more resistant to corruption but there is a performance +# hit to pay (around 10%) when saving and loading RDB files, so you can disable it +# for maximum performances. +# +# RDB files created with checksum disabled have a checksum of zero that will +# tell the loading code to skip the check. +rdbchecksum yes + +# The filename where to dump the DB +dbfilename dump.rdb + +# The working directory. +# +# The DB will be written inside this directory, with the filename specified +# above using the 'dbfilename' configuration directive. +# +# The Append Only File will also be created inside this directory. +# +# Note that you must specify a directory here, not a file name. +dir ./ + +################################# REPLICATION ################################# + +# Master-Replica replication. Use replicaof to make a Redis instance a copy of +# another Redis server. A few things to understand ASAP about Redis replication. +# +# +------------------+ +---------------+ +# | Master | ---> | Replica | +# | (receive writes) | | (exact copy) | +# +------------------+ +---------------+ +# +# 1) Redis replication is asynchronous, but you can configure a master to +# stop accepting writes if it appears to be not connected with at least +# a given number of replicas. +# 2) Redis replicas are able to perform a partial resynchronization with the +# master if the replication link is lost for a relatively small amount of +# time. You may want to configure the replication backlog size (see the next +# sections of this file) with a sensible value depending on your needs. +# 3) Replication is automatic and does not need user intervention. After a +# network partition replicas automatically try to reconnect to masters +# and resynchronize with them. +# +# replicaof + +# If the master is password protected (using the "requirepass" configuration +# directive below) it is possible to tell the replica to authenticate before +# starting the replication synchronization process, otherwise the master will +# refuse the replica request. +# +# masterauth + +# When a replica loses its connection with the master, or when the replication +# is still in progress, the replica can act in two different ways: +# +# 1) if replica-serve-stale-data is set to 'yes' (the default) the replica will +# still reply to client requests, possibly with out of date data, or the +# data set may just be empty if this is the first synchronization. +# +# 2) if replica-serve-stale-data is set to 'no' the replica will reply with +# an error "SYNC with master in progress" to all the kind of commands +# but to INFO, replicaOF, AUTH, PING, SHUTDOWN, REPLCONF, ROLE, CONFIG, +# SUBSCRIBE, UNSUBSCRIBE, PSUBSCRIBE, PUNSUBSCRIBE, PUBLISH, PUBSUB, +# COMMAND, POST, HOST: and LATENCY. +# +replica-serve-stale-data yes + +# You can configure a replica instance to accept writes or not. Writing against +# a replica instance may be useful to store some ephemeral data (because data +# written on a replica will be easily deleted after resync with the master) but +# may also cause problems if clients are writing to it because of a +# misconfiguration. +# +# Since Redis 2.6 by default replicas are read-only. +# +# Note: read only replicas are not designed to be exposed to untrusted clients +# on the internet. It's just a protection layer against misuse of the instance. +# Still a read only replica exports by default all the administrative commands +# such as CONFIG, DEBUG, and so forth. To a limited extent you can improve +# security of read only replicas using 'rename-command' to shadow all the +# administrative / dangerous commands. +replica-read-only yes + +# Replication SYNC strategy: disk or socket. +# +# ------------------------------------------------------- +# WARNING: DISKLESS REPLICATION IS EXPERIMENTAL CURRENTLY +# ------------------------------------------------------- +# +# New replicas and reconnecting replicas that are not able to continue the replication +# process just receiving differences, need to do what is called a "full +# synchronization". An RDB file is transmitted from the master to the replicas. +# The transmission can happen in two different ways: +# +# 1) Disk-backed: The Redis master creates a new process that writes the RDB +# file on disk. Later the file is transferred by the parent +# process to the replicas incrementally. +# 2) Diskless: The Redis master creates a new process that directly writes the +# RDB file to replica sockets, without touching the disk at all. +# +# With disk-backed replication, while the RDB file is generated, more replicas +# can be queued and served with the RDB file as soon as the current child producing +# the RDB file finishes its work. With diskless replication instead once +# the transfer starts, new replicas arriving will be queued and a new transfer +# will start when the current one terminates. +# +# When diskless replication is used, the master waits a configurable amount of +# time (in seconds) before starting the transfer in the hope that multiple replicas +# will arrive and the transfer can be parallelized. +# +# With slow disks and fast (large bandwidth) networks, diskless replication +# works better. +repl-diskless-sync no + +# When diskless replication is enabled, it is possible to configure the delay +# the server waits in order to spawn the child that transfers the RDB via socket +# to the replicas. +# +# This is important since once the transfer starts, it is not possible to serve +# new replicas arriving, that will be queued for the next RDB transfer, so the server +# waits a delay in order to let more replicas arrive. +# +# The delay is specified in seconds, and by default is 5 seconds. To disable +# it entirely just set it to 0 seconds and the transfer will start ASAP. +repl-diskless-sync-delay 5 + +# Replicas send PINGs to server in a predefined interval. It's possible to change +# this interval with the repl_ping_replica_period option. The default value is 10 +# seconds. +# +# repl-ping-replica-period 10 + +# The following option sets the replication timeout for: +# +# 1) Bulk transfer I/O during SYNC, from the point of view of replica. +# 2) Master timeout from the point of view of replicas (data, pings). +# 3) Replica timeout from the point of view of masters (REPLCONF ACK pings). +# +# It is important to make sure that this value is greater than the value +# specified for repl-ping-replica-period otherwise a timeout will be detected +# every time there is low traffic between the master and the replica. +# +# repl-timeout 60 + +# Disable TCP_NODELAY on the replica socket after SYNC? +# +# If you select "yes" Redis will use a smaller number of TCP packets and +# less bandwidth to send data to replicas. But this can add a delay for +# the data to appear on the replica side, up to 40 milliseconds with +# Linux kernels using a default configuration. +# +# If you select "no" the delay for data to appear on the replica side will +# be reduced but more bandwidth will be used for replication. +# +# By default we optimize for low latency, but in very high traffic conditions +# or when the master and replicas are many hops away, turning this to "yes" may +# be a good idea. +repl-disable-tcp-nodelay no + +# Set the replication backlog size. The backlog is a buffer that accumulates +# replica data when replicas are disconnected for some time, so that when a replica +# wants to reconnect again, often a full resync is not needed, but a partial +# resync is enough, just passing the portion of data the replica missed while +# disconnected. +# +# The bigger the replication backlog, the longer the time the replica can be +# disconnected and later be able to perform a partial resynchronization. +# +# The backlog is only allocated once there is at least a replica connected. +# +# repl-backlog-size 1mb + +# After a master has no longer connected replicas for some time, the backlog +# will be freed. The following option configures the amount of seconds that +# need to elapse, starting from the time the last replica disconnected, for +# the backlog buffer to be freed. +# +# Note that replicas never free the backlog for timeout, since they may be +# promoted to masters later, and should be able to correctly "partially +# resynchronize" with the replicas: hence they should always accumulate backlog. +# +# A value of 0 means to never release the backlog. +# +# repl-backlog-ttl 3600 + +# The replica priority is an integer number published by Redis in the INFO output. +# It is used by Redis Sentinel in order to select a replica to promote into a +# master if the master is no longer working correctly. +# +# A replica with a low priority number is considered better for promotion, so +# for instance if there are three replicas with priority 10, 100, 25 Sentinel will +# pick the one with priority 10, that is the lowest. +# +# However a special priority of 0 marks the replica as not able to perform the +# role of master, so a replica with priority of 0 will never be selected by +# Redis Sentinel for promotion. +# +# By default the priority is 100. +replica-priority 100 + +# It is possible for a master to stop accepting writes if there are less than +# N replicas connected, having a lag less or equal than M seconds. +# +# The N replicas need to be in "online" state. +# +# The lag in seconds, that must be <= the specified value, is calculated from +# the last ping received from the replica, that is usually sent every second. +# +# This option does not GUARANTEE that N replicas will accept the write, but +# will limit the window of exposure for lost writes in case not enough replicas +# are available, to the specified number of seconds. +# +# For example to require at least 3 replicas with a lag <= 10 seconds use: +# +# min-replicas-to-write 3 +# min-replicas-max-lag 10 +# +# Setting one or the other to 0 disables the feature. +# +# By default min-replicas-to-write is set to 0 (feature disabled) and +# min-replicas-max-lag is set to 10. + +# A Redis master is able to list the address and port of the attached +# replicas in different ways. For example the "INFO replication" section +# offers this information, which is used, among other tools, by +# Redis Sentinel in order to discover replica instances. +# Another place where this info is available is in the output of the +# "ROLE" command of a master. +# +# The listed IP and address normally reported by a replica is obtained +# in the following way: +# +# IP: The address is auto detected by checking the peer address +# of the socket used by the replica to connect with the master. +# +# Port: The port is communicated by the replica during the replication +# handshake, and is normally the port that the replica is using to +# listen for connections. +# +# However when port forwarding or Network Address Translation (NAT) is +# used, the replica may be actually reachable via different IP and port +# pairs. The following two options can be used by a replica in order to +# report to its master a specific set of IP and port, so that both INFO +# and ROLE will report those values. +# +# There is no need to use both the options if you need to override just +# the port or the IP address. +# +# replica-announce-ip 5.5.5.5 +# replica-announce-port 1234 + +################################## SECURITY ################################### + +# Require clients to issue AUTH before processing any other +# commands. This might be useful in environments in which you do not trust +# others with access to the host running redis-server. +# +# This should stay commented out for backward compatibility and because most +# people do not need auth (e.g. they run their own servers). +# +# Warning: since Redis is pretty fast an outside user can try up to +# 150k passwords per second against a good box. This means that you should +# use a very strong password otherwise it will be very easy to break. +# +# requirepass foobared + +# Command renaming. +# +# It is possible to change the name of dangerous commands in a shared +# environment. For instance the CONFIG command may be renamed into something +# hard to guess so that it will still be available for internal-use tools +# but not available for general clients. +# +# Example: +# +# rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52 +# +# It is also possible to completely kill a command by renaming it into +# an empty string: +# +# rename-command CONFIG "" +# +# Please note that changing the name of commands that are logged into the +# AOF file or transmitted to replicas may cause problems. + +################################### CLIENTS #################################### + +# Set the max number of connected clients at the same time. By default +# this limit is set to 10000 clients, however if the Redis server is not +# able to configure the process file limit to allow for the specified limit +# the max number of allowed clients is set to the current file limit +# minus 32 (as Redis reserves a few file descriptors for internal uses). +# +# Once the limit is reached Redis will close all the new connections sending +# an error 'max number of clients reached'. +# +# maxclients 10000 + +############################## MEMORY MANAGEMENT ################################ + +# Set a memory usage limit to the specified amount of bytes. +# When the memory limit is reached Redis will try to remove keys +# according to the eviction policy selected (see maxmemory-policy). +# +# If Redis can't remove keys according to the policy, or if the policy is +# set to 'noeviction', Redis will start to reply with errors to commands +# that would use more memory, like SET, LPUSH, and so on, and will continue +# to reply to read-only commands like GET. +# +# This option is usually useful when using Redis as an LRU or LFU cache, or to +# set a hard memory limit for an instance (using the 'noeviction' policy). +# +# WARNING: If you have replicas attached to an instance with maxmemory on, +# the size of the output buffers needed to feed the replicas are subtracted +# from the used memory count, so that network problems / resyncs will +# not trigger a loop where keys are evicted, and in turn the output +# buffer of replicas is full with DELs of keys evicted triggering the deletion +# of more keys, and so forth until the database is completely emptied. +# +# In short... if you have replicas attached it is suggested that you set a lower +# limit for maxmemory so that there is some free RAM on the system for replica +# output buffers (but this is not needed if the policy is 'noeviction'). +# +# maxmemory + +# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory +# is reached. You can select among five behaviors: +# +# volatile-lru -> Evict using approximated LRU among the keys with an expire set. +# allkeys-lru -> Evict any key using approximated LRU. +# volatile-lfu -> Evict using approximated LFU among the keys with an expire set. +# allkeys-lfu -> Evict any key using approximated LFU. +# volatile-random -> Remove a random key among the ones with an expire set. +# allkeys-random -> Remove a random key, any key. +# volatile-ttl -> Remove the key with the nearest expire time (minor TTL) +# noeviction -> Don't evict anything, just return an error on write operations. +# +# LRU means Least Recently Used +# LFU means Least Frequently Used +# +# Both LRU, LFU and volatile-ttl are implemented using approximated +# randomized algorithms. +# +# Note: with any of the above policies, Redis will return an error on write +# operations, when there are no suitable keys for eviction. +# +# At the date of writing these commands are: set setnx setex append +# incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd +# sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby +# zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby +# getset mset msetnx exec sort +# +# The default is: +# +# maxmemory-policy noeviction + +# LRU, LFU and minimal TTL algorithms are not precise algorithms but approximated +# algorithms (in order to save memory), so you can tune it for speed or +# accuracy. For default Redis will check five keys and pick the one that was +# used less recently, you can change the sample size using the following +# configuration directive. +# +# The default of 5 produces good enough results. 10 Approximates very closely +# true LRU but costs more CPU. 3 is faster but not very accurate. +# +# maxmemory-samples 5 + +# Starting from Redis 5, by default a replica will ignore its maxmemory setting +# (unless it is promoted to master after a failover or manually). It means +# that the eviction of keys will be just handled by the master, sending the +# DEL commands to the replica as keys evict in the master side. +# +# This behavior ensures that masters and replicas stay consistent, and is usually +# what you want, however if your replica is writable, or you want the replica to have +# a different memory setting, and you are sure all the writes performed to the +# replica are idempotent, then you may change this default (but be sure to understand +# what you are doing). +# +# Note that since the replica by default does not evict, it may end using more +# memory than the one set via maxmemory (there are certain buffers that may +# be larger on the replica, or data structures may sometimes take more memory and so +# forth). So make sure you monitor your replicas and make sure they have enough +# memory to never hit a real out-of-memory condition before the master hits +# the configured maxmemory setting. +# +# replica-ignore-maxmemory yes + +############################# LAZY FREEING #################################### + +# Redis has two primitives to delete keys. One is called DEL and is a blocking +# deletion of the object. It means that the server stops processing new commands +# in order to reclaim all the memory associated with an object in a synchronous +# way. If the key deleted is associated with a small object, the time needed +# in order to execute the DEL command is very small and comparable to most other +# O(1) or O(log_N) commands in Redis. However if the key is associated with an +# aggregated value containing millions of elements, the server can block for +# a long time (even seconds) in order to complete the operation. +# +# For the above reasons Redis also offers non blocking deletion primitives +# such as UNLINK (non blocking DEL) and the ASYNC option of FLUSHALL and +# FLUSHDB commands, in order to reclaim memory in background. Those commands +# are executed in constant time. Another thread will incrementally free the +# object in the background as fast as possible. +# +# DEL, UNLINK and ASYNC option of FLUSHALL and FLUSHDB are user-controlled. +# It's up to the design of the application to understand when it is a good +# idea to use one or the other. However the Redis server sometimes has to +# delete keys or flush the whole database as a side effect of other operations. +# Specifically Redis deletes objects independently of a user call in the +# following scenarios: +# +# 1) On eviction, because of the maxmemory and maxmemory policy configurations, +# in order to make room for new data, without going over the specified +# memory limit. +# 2) Because of expire: when a key with an associated time to live (see the +# EXPIRE command) must be deleted from memory. +# 3) Because of a side effect of a command that stores data on a key that may +# already exist. For example the RENAME command may delete the old key +# content when it is replaced with another one. Similarly SUNIONSTORE +# or SORT with STORE option may delete existing keys. The SET command +# itself removes any old content of the specified key in order to replace +# it with the specified string. +# 4) During replication, when a replica performs a full resynchronization with +# its master, the content of the whole database is removed in order to +# load the RDB file just transferred. +# +# In all the above cases the default is to delete objects in a blocking way, +# like if DEL was called. However you can configure each case specifically +# in order to instead release memory in a non-blocking way like if UNLINK +# was called, using the following configuration directives: + +lazyfree-lazy-eviction no +lazyfree-lazy-expire no +lazyfree-lazy-server-del no +replica-lazy-flush no + +############################## APPEND ONLY MODE ############################### + +# By default Redis asynchronously dumps the dataset on disk. This mode is +# good enough in many applications, but an issue with the Redis process or +# a power outage may result into a few minutes of writes lost (depending on +# the configured save points). +# +# The Append Only File is an alternative persistence mode that provides +# much better durability. For instance using the default data fsync policy +# (see later in the config file) Redis can lose just one second of writes in a +# dramatic event like a server power outage, or a single write if something +# wrong with the Redis process itself happens, but the operating system is +# still running correctly. +# +# AOF and RDB persistence can be enabled at the same time without problems. +# If the AOF is enabled on startup Redis will load the AOF, that is the file +# with the better durability guarantees. +# +# Please check http://redis.io/topics/persistence for more information. + +appendonly no + +# The name of the append only file (default: "appendonly.aof") + +appendfilename "appendonly.aof" + +# The fsync() call tells the Operating System to actually write data on disk +# instead of waiting for more data in the output buffer. Some OS will really flush +# data on disk, some other OS will just try to do it ASAP. +# +# Redis supports three different modes: +# +# no: don't fsync, just let the OS flush the data when it wants. Faster. +# always: fsync after every write to the append only log. Slow, Safest. +# everysec: fsync only one time every second. Compromise. +# +# The default is "everysec", as that's usually the right compromise between +# speed and data safety. It's up to you to understand if you can relax this to +# "no" that will let the operating system flush the output buffer when +# it wants, for better performances (but if you can live with the idea of +# some data loss consider the default persistence mode that's snapshotting), +# or on the contrary, use "always" that's very slow but a bit safer than +# everysec. +# +# More details please check the following article: +# http://antirez.com/post/redis-persistence-demystified.html +# +# If unsure, use "everysec". + +# appendfsync always +appendfsync everysec +# appendfsync no + +# When the AOF fsync policy is set to always or everysec, and a background +# saving process (a background save or AOF log background rewriting) is +# performing a lot of I/O against the disk, in some Linux configurations +# Redis may block too long on the fsync() call. Note that there is no fix for +# this currently, as even performing fsync in a different thread will block +# our synchronous write(2) call. +# +# In order to mitigate this problem it's possible to use the following option +# that will prevent fsync() from being called in the main process while a +# BGSAVE or BGREWRITEAOF is in progress. +# +# This means that while another child is saving, the durability of Redis is +# the same as "appendfsync none". In practical terms, this means that it is +# possible to lose up to 30 seconds of log in the worst scenario (with the +# default Linux settings). +# +# If you have latency problems turn this to "yes". Otherwise leave it as +# "no" that is the safest pick from the point of view of durability. + +no-appendfsync-on-rewrite no + +# Automatic rewrite of the append only file. +# Redis is able to automatically rewrite the log file implicitly calling +# BGREWRITEAOF when the AOF log size grows by the specified percentage. +# +# This is how it works: Redis remembers the size of the AOF file after the +# latest rewrite (if no rewrite has happened since the restart, the size of +# the AOF at startup is used). +# +# This base size is compared to the current size. If the current size is +# bigger than the specified percentage, the rewrite is triggered. Also +# you need to specify a minimal size for the AOF file to be rewritten, this +# is useful to avoid rewriting the AOF file even if the percentage increase +# is reached but it is still pretty small. +# +# Specify a percentage of zero in order to disable the automatic AOF +# rewrite feature. + +auto-aof-rewrite-percentage 100 +auto-aof-rewrite-min-size 64mb + +# An AOF file may be found to be truncated at the end during the Redis +# startup process, when the AOF data gets loaded back into memory. +# This may happen when the system where Redis is running +# crashes, especially when an ext4 filesystem is mounted without the +# data=ordered option (however this can't happen when Redis itself +# crashes or aborts but the operating system still works correctly). +# +# Redis can either exit with an error when this happens, or load as much +# data as possible (the default now) and start if the AOF file is found +# to be truncated at the end. The following option controls this behavior. +# +# If aof-load-truncated is set to yes, a truncated AOF file is loaded and +# the Redis server starts emitting a log to inform the user of the event. +# Otherwise if the option is set to no, the server aborts with an error +# and refuses to start. When the option is set to no, the user requires +# to fix the AOF file using the "redis-check-aof" utility before to restart +# the server. +# +# Note that if the AOF file will be found to be corrupted in the middle +# the server will still exit with an error. This option only applies when +# Redis will try to read more data from the AOF file but not enough bytes +# will be found. +aof-load-truncated yes + +# When rewriting the AOF file, Redis is able to use an RDB preamble in the +# AOF file for faster rewrites and recoveries. When this option is turned +# on the rewritten AOF file is composed of two different stanzas: +# +# [RDB file][AOF tail] +# +# When loading Redis recognizes that the AOF file starts with the "REDIS" +# string and loads the prefixed RDB file, and continues loading the AOF +# tail. +aof-use-rdb-preamble yes + +################################ LUA SCRIPTING ############################### + +# Max execution time of a Lua script in milliseconds. +# +# If the maximum execution time is reached Redis will log that a script is +# still in execution after the maximum allowed time and will start to +# reply to queries with an error. +# +# When a long running script exceeds the maximum execution time only the +# SCRIPT KILL and SHUTDOWN NOSAVE commands are available. The first can be +# used to stop a script that did not yet called write commands. The second +# is the only way to shut down the server in the case a write command was +# already issued by the script but the user doesn't want to wait for the natural +# termination of the script. +# +# Set it to 0 or a negative value for unlimited execution without warnings. +lua-time-limit 5000 + +################################ REDIS CLUSTER ############################### +# +# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +# WARNING EXPERIMENTAL: Redis Cluster is considered to be stable code, however +# in order to mark it as "mature" we need to wait for a non trivial percentage +# of users to deploy it in production. +# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +# +# Normal Redis instances can't be part of a Redis Cluster; only nodes that are +# started as cluster nodes can. In order to start a Redis instance as a +# cluster node enable the cluster support uncommenting the following: +# +# cluster-enabled yes + +# Every cluster node has a cluster configuration file. This file is not +# intended to be edited by hand. It is created and updated by Redis nodes. +# Every Redis Cluster node requires a different cluster configuration file. +# Make sure that instances running in the same system do not have +# overlapping cluster configuration file names. +# +# cluster-config-file nodes-6379.conf + +# Cluster node timeout is the amount of milliseconds a node must be unreachable +# for it to be considered in failure state. +# Most other internal time limits are multiple of the node timeout. +# +# cluster-node-timeout 15000 + +# A replica of a failing master will avoid to start a failover if its data +# looks too old. +# +# There is no simple way for a replica to actually have an exact measure of +# its "data age", so the following two checks are performed: +# +# 1) If there are multiple replicas able to failover, they exchange messages +# in order to try to give an advantage to the replica with the best +# replication offset (more data from the master processed). +# Replicas will try to get their rank by offset, and apply to the start +# of the failover a delay proportional to their rank. +# +# 2) Every single replica computes the time of the last interaction with +# its master. This can be the last ping or command received (if the master +# is still in the "connected" state), or the time that elapsed since the +# disconnection with the master (if the replication link is currently down). +# If the last interaction is too old, the replica will not try to failover +# at all. +# +# The point "2" can be tuned by user. Specifically a replica will not perform +# the failover if, since the last interaction with the master, the time +# elapsed is greater than: +# +# (node-timeout * replica-validity-factor) + repl-ping-replica-period +# +# So for example if node-timeout is 30 seconds, and the replica-validity-factor +# is 10, and assuming a default repl-ping-replica-period of 10 seconds, the +# replica will not try to failover if it was not able to talk with the master +# for longer than 310 seconds. +# +# A large replica-validity-factor may allow replicas with too old data to failover +# a master, while a too small value may prevent the cluster from being able to +# elect a replica at all. +# +# For maximum availability, it is possible to set the replica-validity-factor +# to a value of 0, which means, that replicas will always try to failover the +# master regardless of the last time they interacted with the master. +# (However they'll always try to apply a delay proportional to their +# offset rank). +# +# Zero is the only value able to guarantee that when all the partitions heal +# the cluster will always be able to continue. +# +# cluster-replica-validity-factor 10 + +# Cluster replicas are able to migrate to orphaned masters, that are masters +# that are left without working replicas. This improves the cluster ability +# to resist to failures as otherwise an orphaned master can't be failed over +# in case of failure if it has no working replicas. +# +# Replicas migrate to orphaned masters only if there are still at least a +# given number of other working replicas for their old master. This number +# is the "migration barrier". A migration barrier of 1 means that a replica +# will migrate only if there is at least 1 other working replica for its master +# and so forth. It usually reflects the number of replicas you want for every +# master in your cluster. +# +# Default is 1 (replicas migrate only if their masters remain with at least +# one replica). To disable migration just set it to a very large value. +# A value of 0 can be set but is useful only for debugging and dangerous +# in production. +# +# cluster-migration-barrier 1 + +# By default Redis Cluster nodes stop accepting queries if they detect there +# is at least an hash slot uncovered (no available node is serving it). +# This way if the cluster is partially down (for example a range of hash slots +# are no longer covered) all the cluster becomes, eventually, unavailable. +# It automatically returns available as soon as all the slots are covered again. +# +# However sometimes you want the subset of the cluster which is working, +# to continue to accept queries for the part of the key space that is still +# covered. In order to do so, just set the cluster-require-full-coverage +# option to no. +# +# cluster-require-full-coverage yes + +# This option, when set to yes, prevents replicas from trying to failover its +# master during master failures. However the master can still perform a +# manual failover, if forced to do so. +# +# This is useful in different scenarios, especially in the case of multiple +# data center operations, where we want one side to never be promoted if not +# in the case of a total DC failure. +# +# cluster-replica-no-failover no + +# In order to setup your cluster make sure to read the documentation +# available at http://redis.io web site. + +########################## CLUSTER DOCKER/NAT support ######################## + +# In certain deployments, Redis Cluster nodes address discovery fails, because +# addresses are NAT-ted or because ports are forwarded (the typical case is +# Docker and other containers). +# +# In order to make Redis Cluster working in such environments, a static +# configuration where each node knows its public address is needed. The +# following two options are used for this scope, and are: +# +# * cluster-announce-ip +# * cluster-announce-port +# * cluster-announce-bus-port +# +# Each instruct the node about its address, client port, and cluster message +# bus port. The information is then published in the header of the bus packets +# so that other nodes will be able to correctly map the address of the node +# publishing the information. +# +# If the above options are not used, the normal Redis Cluster auto-detection +# will be used instead. +# +# Note that when remapped, the bus port may not be at the fixed offset of +# clients port + 10000, so you can specify any port and bus-port depending +# on how they get remapped. If the bus-port is not set, a fixed offset of +# 10000 will be used as usually. +# +# Example: +# +# cluster-announce-ip 10.1.1.5 +# cluster-announce-port 6379 +# cluster-announce-bus-port 6380 + +################################## SLOW LOG ################################### + +# The Redis Slow Log is a system to log queries that exceeded a specified +# execution time. The execution time does not include the I/O operations +# like talking with the client, sending the reply and so forth, +# but just the time needed to actually execute the command (this is the only +# stage of command execution where the thread is blocked and can not serve +# other requests in the meantime). +# +# You can configure the slow log with two parameters: one tells Redis +# what is the execution time, in microseconds, to exceed in order for the +# command to get logged, and the other parameter is the length of the +# slow log. When a new command is logged the oldest one is removed from the +# queue of logged commands. + +# The following time is expressed in microseconds, so 1000000 is equivalent +# to one second. Note that a negative number disables the slow log, while +# a value of zero forces the logging of every command. +slowlog-log-slower-than 10000 + +# There is no limit to this length. Just be aware that it will consume memory. +# You can reclaim memory used by the slow log with SLOWLOG RESET. +slowlog-max-len 128 + +################################ LATENCY MONITOR ############################## + +# The Redis latency monitoring subsystem samples different operations +# at runtime in order to collect data related to possible sources of +# latency of a Redis instance. +# +# Via the LATENCY command this information is available to the user that can +# print graphs and obtain reports. +# +# The system only logs operations that were performed in a time equal or +# greater than the amount of milliseconds specified via the +# latency-monitor-threshold configuration directive. When its value is set +# to zero, the latency monitor is turned off. +# +# By default latency monitoring is disabled since it is mostly not needed +# if you don't have latency issues, and collecting data has a performance +# impact, that while very small, can be measured under big load. Latency +# monitoring can easily be enabled at runtime using the command +# "CONFIG SET latency-monitor-threshold " if needed. +latency-monitor-threshold 0 + +############################# EVENT NOTIFICATION ############################## + +# Redis can notify Pub/Sub clients about events happening in the key space. +# This feature is documented at http://redis.io/topics/notifications +# +# For instance if keyspace events notification is enabled, and a client +# performs a DEL operation on key "foo" stored in the Database 0, two +# messages will be published via Pub/Sub: +# +# PUBLISH __keyspace@0__:foo del +# PUBLISH __keyevent@0__:del foo +# +# It is possible to select the events that Redis will notify among a set +# of classes. Every class is identified by a single character: +# +# K Keyspace events, published with __keyspace@__ prefix. +# E Keyevent events, published with __keyevent@__ prefix. +# g Generic commands (non-type specific) like DEL, EXPIRE, RENAME, ... +# $ String commands +# l List commands +# s Set commands +# h Hash commands +# z Sorted set commands +# x Expired events (events generated every time a key expires) +# e Evicted events (events generated when a key is evicted for maxmemory) +# A Alias for g$lshzxe, so that the "AKE" string means all the events. +# +# The "notify-keyspace-events" takes as argument a string that is composed +# of zero or multiple characters. The empty string means that notifications +# are disabled. +# +# Example: to enable list and generic events, from the point of view of the +# event name, use: +# +# notify-keyspace-events Elg +# +# Example 2: to get the stream of the expired keys subscribing to channel +# name __keyevent@0__:expired use: +# +# notify-keyspace-events Ex +# +# By default all notifications are disabled because most users don't need +# this feature and the feature has some overhead. Note that if you don't +# specify at least one of K or E, no events will be delivered. +notify-keyspace-events "" + +############################### ADVANCED CONFIG ############################### + +# Hashes are encoded using a memory efficient data structure when they have a +# small number of entries, and the biggest entry does not exceed a given +# threshold. These thresholds can be configured using the following directives. +hash-max-ziplist-entries 512 +hash-max-ziplist-value 64 + +# Lists are also encoded in a special way to save a lot of space. +# The number of entries allowed per internal list node can be specified +# as a fixed maximum size or a maximum number of elements. +# For a fixed maximum size, use -5 through -1, meaning: +# -5: max size: 64 Kb <-- not recommended for normal workloads +# -4: max size: 32 Kb <-- not recommended +# -3: max size: 16 Kb <-- probably not recommended +# -2: max size: 8 Kb <-- good +# -1: max size: 4 Kb <-- good +# Positive numbers mean store up to _exactly_ that number of elements +# per list node. +# The highest performing option is usually -2 (8 Kb size) or -1 (4 Kb size), +# but if your use case is unique, adjust the settings as necessary. +list-max-ziplist-size -2 + +# Lists may also be compressed. +# Compress depth is the number of quicklist ziplist nodes from *each* side of +# the list to *exclude* from compression. The head and tail of the list +# are always uncompressed for fast push/pop operations. Settings are: +# 0: disable all list compression +# 1: depth 1 means "don't start compressing until after 1 node into the list, +# going from either the head or tail" +# So: [head]->node->node->...->node->[tail] +# [head], [tail] will always be uncompressed; inner nodes will compress. +# 2: [head]->[next]->node->node->...->node->[prev]->[tail] +# 2 here means: don't compress head or head->next or tail->prev or tail, +# but compress all nodes between them. +# 3: [head]->[next]->[next]->node->node->...->node->[prev]->[prev]->[tail] +# etc. +list-compress-depth 0 + +# Sets have a special encoding in just one case: when a set is composed +# of just strings that happen to be integers in radix 10 in the range +# of 64 bit signed integers. +# The following configuration setting sets the limit in the size of the +# set in order to use this special memory saving encoding. +set-max-intset-entries 512 + +# Similarly to hashes and lists, sorted sets are also specially encoded in +# order to save a lot of space. This encoding is only used when the length and +# elements of a sorted set are below the following limits: +zset-max-ziplist-entries 128 +zset-max-ziplist-value 64 + +# HyperLogLog sparse representation bytes limit. The limit includes the +# 16 bytes header. When an HyperLogLog using the sparse representation crosses +# this limit, it is converted into the dense representation. +# +# A value greater than 16000 is totally useless, since at that point the +# dense representation is more memory efficient. +# +# The suggested value is ~ 3000 in order to have the benefits of +# the space efficient encoding without slowing down too much PFADD, +# which is O(N) with the sparse encoding. The value can be raised to +# ~ 10000 when CPU is not a concern, but space is, and the data set is +# composed of many HyperLogLogs with cardinality in the 0 - 15000 range. +hll-sparse-max-bytes 3000 + +# Streams macro node max size / items. The stream data structure is a radix +# tree of big nodes that encode multiple items inside. Using this configuration +# it is possible to configure how big a single node can be in bytes, and the +# maximum number of items it may contain before switching to a new node when +# appending new stream entries. If any of the following settings are set to +# zero, the limit is ignored, so for instance it is possible to set just a +# max entires limit by setting max-bytes to 0 and max-entries to the desired +# value. +stream-node-max-bytes 4096 +stream-node-max-entries 100 + +# Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in +# order to help rehashing the main Redis hash table (the one mapping top-level +# keys to values). The hash table implementation Redis uses (see dict.c) +# performs a lazy rehashing: the more operation you run into a hash table +# that is rehashing, the more rehashing "steps" are performed, so if the +# server is idle the rehashing is never complete and some more memory is used +# by the hash table. +# +# The default is to use this millisecond 10 times every second in order to +# actively rehash the main dictionaries, freeing memory when possible. +# +# If unsure: +# use "activerehashing no" if you have hard latency requirements and it is +# not a good thing in your environment that Redis can reply from time to time +# to queries with 2 milliseconds delay. +# +# use "activerehashing yes" if you don't have such hard requirements but +# want to free memory asap when possible. +activerehashing yes + +# The client output buffer limits can be used to force disconnection of clients +# that are not reading data from the server fast enough for some reason (a +# common reason is that a Pub/Sub client can't consume messages as fast as the +# publisher can produce them). +# +# The limit can be set differently for the three different classes of clients: +# +# normal -> normal clients including MONITOR clients +# replica -> replica clients +# pubsub -> clients subscribed to at least one pubsub channel or pattern +# +# The syntax of every client-output-buffer-limit directive is the following: +# +# client-output-buffer-limit +# +# A client is immediately disconnected once the hard limit is reached, or if +# the soft limit is reached and remains reached for the specified number of +# seconds (continuously). +# So for instance if the hard limit is 32 megabytes and the soft limit is +# 16 megabytes / 10 seconds, the client will get disconnected immediately +# if the size of the output buffers reach 32 megabytes, but will also get +# disconnected if the client reaches 16 megabytes and continuously overcomes +# the limit for 10 seconds. +# +# By default normal clients are not limited because they don't receive data +# without asking (in a push way), but just after a request, so only +# asynchronous clients may create a scenario where data is requested faster +# than it can read. +# +# Instead there is a default limit for pubsub and replica clients, since +# subscribers and replicas receive data in a push fashion. +# +# Both the hard or the soft limit can be disabled by setting them to zero. +client-output-buffer-limit normal 0 0 0 +client-output-buffer-limit replica 256mb 64mb 60 +client-output-buffer-limit pubsub 32mb 8mb 60 + +# Client query buffers accumulate new commands. They are limited to a fixed +# amount by default in order to avoid that a protocol desynchronization (for +# instance due to a bug in the client) will lead to unbound memory usage in +# the query buffer. However you can configure it here if you have very special +# needs, such us huge multi/exec requests or alike. +# +# client-query-buffer-limit 1gb + +# In the Redis protocol, bulk requests, that are, elements representing single +# strings, are normally limited ot 512 mb. However you can change this limit +# here. +# +# proto-max-bulk-len 512mb + +# Redis calls an internal function to perform many background tasks, like +# closing connections of clients in timeout, purging expired keys that are +# never requested, and so forth. +# +# Not all tasks are performed with the same frequency, but Redis checks for +# tasks to perform according to the specified "hz" value. +# +# By default "hz" is set to 10. Raising the value will use more CPU when +# Redis is idle, but at the same time will make Redis more responsive when +# there are many keys expiring at the same time, and timeouts may be +# handled with more precision. +# +# The range is between 1 and 500, however a value over 100 is usually not +# a good idea. Most users should use the default of 10 and raise this up to +# 100 only in environments where very low latency is required. +hz 10 + +# Normally it is useful to have an HZ value which is proportional to the +# number of clients connected. This is useful in order, for instance, to +# avoid too many clients are processed for each background task invocation +# in order to avoid latency spikes. +# +# Since the default HZ value by default is conservatively set to 10, Redis +# offers, and enables by default, the ability to use an adaptive HZ value +# which will temporary raise when there are many connected clients. +# +# When dynamic HZ is enabled, the actual configured HZ will be used as +# as a baseline, but multiples of the configured HZ value will be actually +# used as needed once more clients are connected. In this way an idle +# instance will use very little CPU time while a busy instance will be +# more responsive. +dynamic-hz yes + +# When a child rewrites the AOF file, if the following option is enabled +# the file will be fsync-ed every 32 MB of data generated. This is useful +# in order to commit the file to the disk more incrementally and avoid +# big latency spikes. +aof-rewrite-incremental-fsync yes + +# When redis saves RDB file, if the following option is enabled +# the file will be fsync-ed every 32 MB of data generated. This is useful +# in order to commit the file to the disk more incrementally and avoid +# big latency spikes. +rdb-save-incremental-fsync yes + +# Redis LFU eviction (see maxmemory setting) can be tuned. However it is a good +# idea to start with the default settings and only change them after investigating +# how to improve the performances and how the keys LFU change over time, which +# is possible to inspect via the OBJECT FREQ command. +# +# There are two tunable parameters in the Redis LFU implementation: the +# counter logarithm factor and the counter decay time. It is important to +# understand what the two parameters mean before changing them. +# +# The LFU counter is just 8 bits per key, it's maximum value is 255, so Redis +# uses a probabilistic increment with logarithmic behavior. Given the value +# of the old counter, when a key is accessed, the counter is incremented in +# this way: +# +# 1. A random number R between 0 and 1 is extracted. +# 2. A probability P is calculated as 1/(old_value*lfu_log_factor+1). +# 3. The counter is incremented only if R < P. +# +# The default lfu-log-factor is 10. This is a table of how the frequency +# counter changes with a different number of accesses with different +# logarithmic factors: +# +# +--------+------------+------------+------------+------------+------------+ +# | factor | 100 hits | 1000 hits | 100K hits | 1M hits | 10M hits | +# +--------+------------+------------+------------+------------+------------+ +# | 0 | 104 | 255 | 255 | 255 | 255 | +# +--------+------------+------------+------------+------------+------------+ +# | 1 | 18 | 49 | 255 | 255 | 255 | +# +--------+------------+------------+------------+------------+------------+ +# | 10 | 10 | 18 | 142 | 255 | 255 | +# +--------+------------+------------+------------+------------+------------+ +# | 100 | 8 | 11 | 49 | 143 | 255 | +# +--------+------------+------------+------------+------------+------------+ +# +# NOTE: The above table was obtained by running the following commands: +# +# redis-benchmark -n 1000000 incr foo +# redis-cli object freq foo +# +# NOTE 2: The counter initial value is 5 in order to give new objects a chance +# to accumulate hits. +# +# The counter decay time is the time, in minutes, that must elapse in order +# for the key counter to be divided by two (or decremented if it has a value +# less <= 10). +# +# The default value for the lfu-decay-time is 1. A Special value of 0 means to +# decay the counter every time it happens to be scanned. +# +# lfu-log-factor 10 +# lfu-decay-time 1 + +########################### ACTIVE DEFRAGMENTATION ####################### +# +# WARNING THIS FEATURE IS EXPERIMENTAL. However it was stress tested +# even in production and manually tested by multiple engineers for some +# time. +# +# What is active defragmentation? +# ------------------------------- +# +# Active (online) defragmentation allows a Redis server to compact the +# spaces left between small allocations and deallocations of data in memory, +# thus allowing to reclaim back memory. +# +# Fragmentation is a natural process that happens with every allocator (but +# less so with Jemalloc, fortunately) and certain workloads. Normally a server +# restart is needed in order to lower the fragmentation, or at least to flush +# away all the data and create it again. However thanks to this feature +# implemented by Oran Agra for Redis 4.0 this process can happen at runtime +# in an "hot" way, while the server is running. +# +# Basically when the fragmentation is over a certain level (see the +# configuration options below) Redis will start to create new copies of the +# values in contiguous memory regions by exploiting certain specific Jemalloc +# features (in order to understand if an allocation is causing fragmentation +# and to allocate it in a better place), and at the same time, will release the +# old copies of the data. This process, repeated incrementally for all the keys +# will cause the fragmentation to drop back to normal values. +# +# Important things to understand: +# +# 1. This feature is disabled by default, and only works if you compiled Redis +# to use the copy of Jemalloc we ship with the source code of Redis. +# This is the default with Linux builds. +# +# 2. You never need to enable this feature if you don't have fragmentation +# issues. +# +# 3. Once you experience fragmentation, you can enable this feature when +# needed with the command "CONFIG SET activedefrag yes". +# +# The configuration parameters are able to fine tune the behavior of the +# defragmentation process. If you are not sure about what they mean it is +# a good idea to leave the defaults untouched. + +# Enabled active defragmentation +# activedefrag yes + +# Minimum amount of fragmentation waste to start active defrag +# active-defrag-ignore-bytes 100mb + +# Minimum percentage of fragmentation to start active defrag +# active-defrag-threshold-lower 10 + +# Maximum percentage of fragmentation at which we use maximum effort +# active-defrag-threshold-upper 100 + +# Minimal effort for defrag in CPU percentage +# active-defrag-cycle-min 5 + +# Maximal effort for defrag in CPU percentage +# active-defrag-cycle-max 75 + +# Maximum number of set/hash/zset/list fields that will be processed from +# the main dictionary scan +# active-defrag-max-scan-fields 1000 diff --git a/conf/supervisord.conf b/conf/supervisord.conf new file mode 100644 index 00000000..890ce0d6 --- /dev/null +++ b/conf/supervisord.conf @@ -0,0 +1,20 @@ +[program:php] +command=php -m +;directory=/www/localhost/ +priority=999 ; the relative start priority (default 999) +autostart=true ; start at supervisord start (default: true) +autorestart=true ; retstart at unexpected quit (default: true) +startsecs=10 ; number of secs prog must stay running (def. 10) +startretries=3 ; max # of serial start failures (default 3) +exitcodes=0,2 ; 'expected' exit codes for process (default 0,2) +stopsignal=QUIT ; signal used to kill process (default TERM) +stopwaitsecs=10 ; max num secs to wait before SIGKILL (default 10) +user=root ; setuid to this UNIX account to run the program +log_stdout=true +log_stderr=true ; if true, log program stderr (def false) +logfile=/var/log/supervisor/php.log +logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) +logfile_backups=10 ; # of logfile backups (default 10) +stdout_logfile_maxbytes=20MB ; stdout 日志文件大小,默认 50MB +stdout_logfile_backups=20 ; stdout 日志文件备份数 +stdout_logfile=/var/log/supervisor/php.stdout.log diff --git a/conf/systemd/anbox-session-manager.service b/conf/systemd/anbox-session-manager.service new file mode 100644 index 00000000..c9da4643 --- /dev/null +++ b/conf/systemd/anbox-session-manager.service @@ -0,0 +1,9 @@ +[Unit] +Description=Anbox Session Manager + +[Service] +Environment="EGL_PLATFORM=x11" +ExecStart=/snap/bin/anbox session-manager + +[Install] +WantedBy=graphical-session.target diff --git a/conf/systemd/kdeconnect-indicator.service b/conf/systemd/kdeconnect-indicator.service new file mode 100644 index 00000000..92981532 --- /dev/null +++ b/conf/systemd/kdeconnect-indicator.service @@ -0,0 +1,8 @@ +[Unit] +Description=KDEConnect Indicator + +[Service] +ExecStart=/usr/bin/kdeconnect-indicator + +[Install] +WantedBy=graphical-session.target diff --git a/conf/systemd/kdeconnectd.service b/conf/systemd/kdeconnectd.service new file mode 100644 index 00000000..adca8652 --- /dev/null +++ b/conf/systemd/kdeconnectd.service @@ -0,0 +1,8 @@ +[Unit] +Description=KDEConnect Service + +[Service] +ExecStart=/usr/lib/x86_64-linux-gnu/libexec/kdeconnectd + +[Install] +WantedBy=graphical-session.target diff --git a/conf/systemd/synapse.service b/conf/systemd/synapse.service new file mode 100644 index 00000000..80feeaec --- /dev/null +++ b/conf/systemd/synapse.service @@ -0,0 +1,8 @@ +[Unit] +Description=synapse service + +[Service] +ExecStart=/usr/bin/synapse --startup --display=:0 + +[Install] +WantedBy=graphical-session.target diff --git a/dockenv b/dockenv new file mode 100755 index 00000000..c1f50775 --- /dev/null +++ b/dockenv @@ -0,0 +1,375 @@ +#!/usr/bin/env bash +# Docker Env +START_TIME=$(date +%s) + +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin" +export LC_ALL=en_US.UTF-8 +export LANG=en_US.UTF-8 +export LANGUAGE=en_US.UTF-8 +export LC_CTYPE=en_US.UTF-8 + +CUR_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) +IMAGE_PATH=${CUR_PATH}/images + +source ${CUR_PATH}/.env + +if [[ -z "$(command -v docker)" ]]; then + function docker() { + /Users/imxieke/.boxs/bin/all/docker $@ + } +fi + +for denv in $* ;do + [[ "$(echo $denv | grep '\-\-registry\-prefix=')" ]] && DOCKER_REGISTRY_PREFIX=$(echo $denv | awk -F '=' '{print $2}') + [[ "$(echo $denv | grep '\-\-registry\-prefix=')" ]] && DOCKER_REGISTRY_PREFIX=$(echo $denv | awk -F '=' '{print $2}') + [[ "$(echo $denv | grep '\-\-with=github')" ]] && ENABLE_GITHUB_REGISTRY=true + [[ "$(echo $denv | grep '\-\-with=coding')" ]] && ENABLE_CODING_REGISTRY=true + [[ "$(echo $denv | grep '\-\-with=baidu')" ]] && ENABLE_BAIDU_REGISTRY=true + [[ "$(echo $denv | grep '\-\-with=huawei')" ]] && ENABLE_HUAWEI_REGISTRY=true + [[ "$(echo $denv | grep '\-\-with=aliyun')" ]] && ENABLE_ALIYUN_REGISTRY=true + [[ "$(echo $denv | grep '\-\-with=tencent')" ]] && ENABLE_TENCENT_REGISTRY=true + [[ "$(echo $denv | grep '\-\-with=gitlab')" ]] && ENABLE_GITLAB_REGISTRY=true + [[ "$(echo $denv | grep '\-\-with=quay')" ]] && ENABLE_QUAY_REGISTRY=true + [[ "$(echo $denv | grep '\-\-with=gcr')" ]] && ENABLE_GCR_REGISTRY=true + [[ "$(echo $denv | grep '\-\-with=gar')" ]] && ENABLE_GAR_REGISTRY=true + [[ "$(echo $denv | grep '\-\-with=azure')" ]] && ENABLE_AZURE_REGISTRY=true + [[ "$(echo $denv | grep '\-\-with=ucloud')" ]] && ENABLE_UCLOUD_REGISTRY=true + [[ "$(echo $denv | grep '\-\-with=amazon')" ]] && ENABLE_AMAZON_REGISTRY=true + [[ "$(echo $denv | grep '\-\-with=ecr')" ]] && ENABLE_ECR_REGISTRY=true + [[ "$(echo $denv | grep '\-\-prefix')" ]] && DOCKER_REGISTRY_PREFIX=$(echo $denv | awk -F '=' '{print $2}') +done + +_red() { + printf '\033[1;31;31m%b\033[0m' "$1" +} + +_green() { + printf '\033[1;31;32m%b\033[0m' "$1" +} + +_yellow() { + printf '\033[1;31;33m%b\033[0m' "$1" +} + +_info() { + _green "[Info] " + printf -- "%s" "$1" + printf "\n" +} + +_warn() { + _yellow "[Warning] " + printf -- "%s" "$1" + printf "\n" +} + +_error() { + _red "[Error] " + printf -- "%s" "$1" + printf "\n" + exit 1 +} + +# Build Images +do_build() +{ + NAME=$2 + VERSION=$3 + cd ${IMAGE_PATH} + if [[ -d "$NAME" ]]; then + if [[ -z "${VERSION}" ]]; then + VERSION='latest' + fi + cd ${NAME}/${VERSION} + DOCKER_BUILDKIT=0 + + # --no-cache + if [[ -n "${DOCKER_REGISTRY_PREFIX}" ]]; then + docker build --progress plain --no-cache -t ${DOCKER_REGISTRY_PREFIX}/${NAME}:$VERSION . + else + docker build --progress plain --no-cache -t ${NAME}:$VERSION . + fi + + [[ -n "${ENABLE_GITHUB_REGISTRY}" ]] && docker tag ${DOCKER_REGISTRY_PREFIX}/${NAME}:$VERSION ${DOCKER_REGISTRY_GITHUB}/${NAME}:$VERSION + [[ -n "${ENABLE_CODING_REGISTRY}" ]] && docker tag ${DOCKER_REGISTRY_PREFIX}/${NAME}:$VERSION ${DOCKER_REGISTRY_CODING}/${NAME}:$VERSION + [[ -n "${ENABLE_BAIDU_REGISTRY}" ]] && docker tag ${DOCKER_REGISTRY_PREFIX}/${NAME}:$VERSION ${DOCKER_REGISTRY_BAIDU}/${NAME}:$VERSION + [[ -n "${ENABLE_HUAWEI_REGISTRY}" ]] && docker tag ${DOCKER_REGISTRY_PREFIX}/${NAME}:$VERSION ${DOCKER_REGISTRY_HK_HUAWEI}/${NAME}:$VERSION + + [[ -n "${ENABLE_ALIYUN_SH_REGISTRY}" ]] && docker tag ${DOCKER_REGISTRY_PREFIX}/${NAME}:$VERSION ${DOCKER_REGISTRY_ALIYUN_SH}/${NAME}:$VERSION + [[ -n "${ENABLE_ALIYUN_HK_REGISTRY}" ]] && docker tag ${DOCKER_REGISTRY_PREFIX}/${NAME}:$VERSION ${DOCKER_REGISTRY_ALIYUN_HK}/${NAME}:$VERSION + + [[ -n "${ENABLE_TENCENT_GZ_REGISTRY}" ]] && docker tag ${DOCKER_REGISTRY_PREFIX}/${NAME}:$VERSION ${DOCKER_REGISTRY_TENCENT_GZ}/${NAME}:$VERSION + [[ -n "${ENABLE_TENCENT_HK_REGISTRY}" ]] && docker tag ${DOCKER_REGISTRY_PREFIX}/${NAME}:$VERSION ${DOCKER_REGISTRY_TENCENT_HK}/${NAME}:$VERSION + + [[ -n "${ENABLE_GITLAB_REGISTRY}" ]] && docker tag ${DOCKER_REGISTRY_PREFIX}/${NAME}:$VERSION ${DOCKER_REGISTRY_GITLAB}/${NAME}:$VERSION + [[ -n "${ENABLE_QUAY_REGISTRY}" ]] && docker tag ${DOCKER_REGISTRY_PREFIX}/${NAME}:$VERSION ${DOCKER_REGISTRY_QUAY}/${NAME}:$VERSION + [[ -n "${ENABLE_GCR_REGISTRY}" ]] && docker tag ${DOCKER_REGISTRY_PREFIX}/${NAME}:$VERSION ${DOCKER_REGISTRY_GCR}/${NAME}:$VERSION + [[ -n "${ENABLE_GAR_REGISTRY}" ]] && docker tag ${DOCKER_REGISTRY_PREFIX}/${NAME}:$VERSION ${DOCKER_REGISTRY_GAR}/${NAME}:$VERSION + [[ -n "${ENABLE_AZURE_REGISTRY}" ]] && docker tag ${DOCKER_REGISTRY_PREFIX}/${NAME}:$VERSION ${DOCKER_REGISTRY_AZURE}/${NAME}:$VERSION + [[ -n "${ENABLE_UCLOUD_REGISTRY}" ]] && docker tag ${DOCKER_REGISTRY_PREFIX}/${NAME}:$VERSION ${DOCKER_REGISTRY_UCLOUD}/${NAME}:$VERSION + [[ -n "${ENABLE_AMAZON_REGISTRY}" ]] && docker tag ${DOCKER_REGISTRY_PREFIX}/${NAME}:$VERSION ${DOCKER_REGISTRY_AMAZON}/${NAME}:$VERSION + [[ -n "${ENABLE_ECR_REGISTRY}" ]] && docker tag ${DOCKER_REGISTRY_PREFIX}/${NAME}:$VERSION ${DOCKER_REGISTRY_RCR}/${NAME}:$VERSION + fi +} + +# 批量构建 +do_builds() +{ + NAME=$2 + VERSION=$3 + cd ${IMAGE_PATH} + if [[ -d "$NAME" ]]; then + cd ${NAME} + for ver in $(ls); do + VERSION="${ver}" + if [[ -f "${IMAGE_PATH}/${NAME}/${VERSION}/Dockerfile" ]]; then + cd "${IMAGE_PATH}/${NAME}/${VERSION}" + do_build build ${NAME} ${VERSION} + _info "${NAME}:${VERSION} Build Complete" + # CMD="docker build --no-cache -t ${DOCKER_REGISTRY_PREFIX}/${NAME}:$VERSION ." + fi + done + fi +} + +# Push Images to Registry +do_push() +{ + NAME=$2 + VERSION=$3 + cd ${IMAGE_PATH} + if [[ -d "$NAME" ]]; then + cd ${NAME}/${VERSION} + if [[ -z "${VERSION}" ]]; then + VERSION='latest' + fi + + [[ -n "${ENABLE_GITHUB_REGISTRY}" ]] && docker push ${DOCKER_REGISTRY_GITHUB}/${NAME}:$VERSION + [[ -n "${ENABLE_CODING_REGISTRY}" ]] && docker push ${DOCKER_REGISTRY_CODING}/${NAME}:$VERSION + [[ -n "${ENABLE_BAIDU_REGISTRY}" ]] && docker push ${DOCKER_REGISTRY_BAIDU}/${NAME}:$VERSION + [[ -n "${ENABLE_HUAWEI_REGISTRY}" ]] && docker push ${DOCKER_REGISTRY_HUAWEI}/${NAME}:$VERSION + [[ -n "${ENABLE_ALIYUN_SH_REGISTRY}" ]] && docker push ${DOCKER_REGISTRY_ALIYUN_SH}/${NAME}:$VERSION + [[ -n "${ENABLE_ALIYUN_HK_REGISTRY}" ]] && docker push ${DOCKER_REGISTRY_ALIYUN_HK}/${NAME}:$VERSION + [[ -n "${ENABLE_TENCENT_GZ_REGISTRY}" ]] && docker push ${DOCKER_REGISTRY_TENCENT_GZ}/${NAME}:$VERSION + [[ -n "${ENABLE_TENCENT_HK_REGISTRY}" ]] && docker push ${DOCKER_REGISTRY_TENCENT_HK}/${NAME}:$VERSION + [[ -n "${ENABLE_GITLAB_REGISTRY}" ]] && docker push ${DOCKER_REGISTRY_GITLAB}/${NAME}:$VERSION + [[ -n "${ENABLE_QUAY_REGISTRY}" ]] && docker push ${DOCKER_REGISTRY_QUAY}/${NAME}:$VERSION + [[ -n "${ENABLE_GCR_REGISTRY}" ]] && docker push ${DOCKER_REGISTRY_GCR}/${NAME}:$VERSION + [[ -n "${ENABLE_GAR_REGISTRY}" ]] && docker push ${DOCKER_REGISTRY_GAR}/${NAME}:$VERSION + [[ -n "${ENABLE_AZURE_REGISTRY}" ]] && docker push ${DOCKER_REGISTRY_AZURE}/${NAME}:$VERSION + [[ -n "${ENABLE_UCLOUD_REGISTRY}" ]] && docker push ${DOCKER_REGISTRY_UCLOUD}/${NAME}:$VERSION + [[ -n "${ENABLE_AMAZON_REGISTRY}" ]] && docker push ${DOCKER_REGISTRY_AMAZON}/${NAME}:$VERSION + [[ -n "${ENABLE_ECR_REGISTRY}" ]] && docker push ${DOCKER_REGISTRY_RCR}/${NAME}:$VERSION + + if [[ -n "${DOCKER_REGISTRY_PREFIX}" ]]; then + docker push ${DOCKER_REGISTRY_PREFIX}/${NAME}:$VERSION + else + docker push ${NAME}:$VERSION + fi + + + fi +} + +# 批量上传 +do_pushs() +{ + NAME=$2 + VERSION=$3 + cd ${IMAGE_PATH} + if [[ -d "$NAME" ]]; then + cd ${NAME} + for ver in $(ls); do + VERSION="${ver}" + if [[ -f "${IMAGE_PATH}/${NAME}/${VERSION}/Dockerfile" ]]; then + cd "${IMAGE_PATH}/${NAME}/${VERSION}" + do_push push ${NAME} ${VERSION} + _info "${NAME}:${VERSION} Push Complete" + fi + done + fi +} + +do_pull() +{ + NAME=$2 + VERSION=$3 + if [[ -z "$NAME" ]]; then + echo -e "pull requires exactly 1 argument See \n'docker pull --help'." + fi + if [[ -z "$VERSION" ]]; then + VERSION="latest" + fi + CMD="docker pull ${DOCKER_REGISTRY_PREFIX}/${NAME}:${VERSION}" + ${CMD} +} + +do_run() +{ + echo '' +} + +do_login() +{ + case $2 in + 'docker') + # docker login -u ${DOCKER_REGISTRY_BAIDU_USERNAME} -p ${DOCKER_REGISTRY_BAIDU_PASSWORD} registry.baidubce.com + echo ${DOCKER_REGISTRY_PASSWORD} | docker login -u ${DOCKER_REGISTRY_USERNAME} --password-stdin + ;; + 'baidu') + # docker login -u ${DOCKER_REGISTRY_BAIDU_USERNAME} -p ${DOCKER_REGISTRY_BAIDU_PASSWORD} registry.baidubce.com + echo ${DOCKER_REGISTRY_BAIDU_PASSWORD} | docker login -u ${DOCKER_REGISTRY_BAIDU_USERNAME} --password-stdin registry.baidubce.com + ;; + 'coding') + docker login -u ${DOCKER_REGISTRY_CODING_USERNAME} -p ${DOCKER_REGISTRY_CODING_PASSWORD} pkgs-docker.pkg.coding.net + ;; + # 阿里云杭州 + 'aliyun-hz') + docker login -u ${DOCKER_REGISTRY_ALIYUN_USERNAME} -p ${DOCKER_REGISTRY_ALIYUN_PASSWORD} registry.cn-hangzhou.aliyuncs.com + ;; + # 阿里云杭州 + 'aliyun-sg') + docker login -u ${DOCKER_REGISTRY_ALIYUN_USERNAME} -p ${DOCKER_REGISTRY_ALIYUN_PASSWORD} registry.ap-southeast-1.aliyuncs.com + ;; + # 阿里云硅谷 silicon valley + 'aliyun-sv') + docker login -u ${DOCKER_REGISTRY_ALIYUN_USERNAME} -p ${DOCKER_REGISTRY_ALIYUN_PASSWORD} registry.us-west-1.aliyuncs.com + ;; + # 阿里云迪拜 Dubai + 'aliyun-db') + docker login -u ${DOCKER_REGISTRY_ALIYUN_USERNAME} -p ${DOCKER_REGISTRY_ALIYUN_PASSWORD} registry.me-east-1.aliyuncs.com + ;; + # 阿里云杭州 + 'aliyun-kr') + docker login -u ${DOCKER_REGISTRY_ALIYUN_USERNAME} -p ${DOCKER_REGISTRY_ALIYUN_PASSWORD} registry.ap-northeast-2.aliyuncs.com + ;; + # 阿里云上海 + 'aliyun-sh') + docker login -u ${DOCKER_REGISTRY_ALIYUN_USERNAME} -p ${DOCKER_REGISTRY_ALIYUN_PASSWORD} registry.cn-shanghai.aliyuncs.com + ;; + # 阿里云 Japan + 'aliyun-jp') + docker login -u ${DOCKER_REGISTRY_ALIYUN_USERNAME} -p ${DOCKER_REGISTRY_ALIYUN_PASSWORD} registry.ap-northeast-1.aliyuncs.com + ;; + # 阿里云香港 + 'aliyun-hk') + docker login -u ${DOCKER_REGISTRY_ALIYUN_USERNAME} -p ${DOCKER_REGISTRY_ALIYUN_PASSWORD} registry.cn-hongkong.aliyuncs.com + ;; + # 默认广州节点 + 'tencent') + docker login -u ${DOCKER_REGISTRY_TENCENT_USERNAME} -p ${DOCKER_REGISTRY_TENCENT_PASSWORD} ccr.ccs.tencentyun.com + ;; + 'tencent-sg') + docker login -u ${DOCKER_REGISTRY_TENCENT_USERNAME} -p ${DOCKER_REGISTRY_TENCENT_PASSWORD} sgccr.ccs.tencentyun.com + ;; + 'tencent-hk') + docker login -u ${DOCKER_REGISTRY_TENCENT_USERNAME} -p ${DOCKER_REGISTRY_TENCENT_PASSWORD} hkccr.ccs.tencentyun.com + ;; + 'tencent-kr') + docker login -u ${DOCKER_REGISTRY_TENCENT_USERNAME} -p ${DOCKER_REGISTRY_TENCENT_PASSWORD} krccr.ccs.tencentyun.com + ;; + 'tencent-jp') + docker login -u ${DOCKER_REGISTRY_TENCENT_USERNAME} -p ${DOCKER_REGISTRY_TENCENT_PASSWORD} jpccr.ccs.tencentyun.com + ;; + 'huawei-hk') + docker login -u ${DOCKER_REGISTRY_HUAWEI_USERNAME} -p ${DOCKER_REGISTRY_HUAWEI_PASSWORD} swr.ap-southeast-1.myhuaweicloud.com + ;; + # 美西硅谷 + 'tencent-usw') + docker login -u ${DOCKER_REGISTRY_TENCENT_USERNAME} -p ${DOCKER_REGISTRY_TENCENT_PASSWORD} uswccr.ccs.tencentyun.com + ;; + *) + echo 'Unknow Platform' + ;; + esac +} + +_run_compose() +{ + if [[ -f "${CUR_PATH}/docker-compose.yml" ]]; then + docker-compose up $@ + fi +} + +_stop_compose() +{ + if [[ -f "${CUR_PATH}/docker-compose.yml" ]]; then + docker-compose stop $@ + fi +} + +_rm_compose() +{ + if [[ -f "${CUR_PATH}/docker-compose.yml" ]]; then + docker-compose stop $@ + docker-compose rm $@ + fi +} + +usage() +{ + echo " Docker Env Build Tool +/-----------------------------------\\ +| build image name tag +| push image name tag +| pull image name tag +| login login to registry ,avaiable platform : baidu coding aliyun-hk tencent tencent-hk tencent-sg tencent-kr tencent-jp tencent-usw (silicon valley) +| +|Params: +| --registry-prefix set docker prefix, example : docker.com/user +\\-----------------------------------/" +} + +case $1 in + build) + do_build $* + ;; + builds) + do_builds $* + ;; + compose) + arg=$@ + arg=$(echo $arg | sed "s#${1}##g") + arg=$(echo $arg | sed "s#${2}##g") + case "$2" in + run) + _run_compose $arg + ;; + stop) + _stop_compose $arg + ;; + rm) + _rm_compose $arg + ;; + *) + echo "Unknow Options $2" + exit 1 + ;; + esac + + ;; + run) + do_run $* + ;; + push) + do_push $* + ;; + pushs) + do_pushs $* + ;; + pull) + do_pull $* + ;; + login) + do_login $* + ;; + *) usage + ;; +esac + +END_TIME=$(date +%s) +FULL_EXEC_TIME=$(expr ${END_TIME} - ${START_TIME}) +_info "==> Total Time: ${FULL_EXEC_TIME} Second " diff --git a/docker-compose.yml b/docker-compose.yml index 2e843929..89797757 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,43 +1,418 @@ -version: '3' services: - - redis: - image: redis:alpine - ports: - - "6379:6379" - networks: - - frontend + nginx: + image: ${DOCKER_REGISTRY_COMPOSE}/nginx:latest + container_name: nginx + restart: always deploy: - replicas: 2 - update_config: # 配置如何更新服务 - parallelism: 2 # 每次要更新的容器数量 - delay: 10s # 更新下一组容器前要等待的时间 resources: limits: - cpus: "0.1" + cpus: "1" memory: 512M - restart_policy: - condition: on-failure - max_attempts: 3 - delay: 10s - mysql: - network_mode: "bridge" + ports: + - "8080:80" + - "443:443" + volumes: + - ./runtime/logs/nginx:/var/log/nginx + - ./runtime/conf/nginx:/etc/nginx + - /Users/imxieke/Code/Project/boxs:/data + # - ./conf/nginx/nginx.conf:/etc/nginx/nginx.conf + links: + # set php74 aliasor direct to use mysql57 no alias set + - php74:php74 + networks: + - boxs + + php74: + image: ${DOCKER_REGISTRY_COMPOSE}/php:74 + container_name: php74 + restart: always + depends_on: + - mysql57 + ports: + - "19000:9000" + volumes: + - ./runtime/logs/php74:/var/log/php-fpm + - /Users/imxieke/Code/Project/boxs:/data + networks: + - boxs + dns: + - 223.5.5.5 + - 8.8.8.8 + + php80: + image: ${DOCKER_REGISTRY_COMPOSE}/php:80 + container_name: php80 + restart: always + depends_on: + - mysql57 + - redis + - memcached + links: + - mysql57:mysql57 + - redis:redis + - memcached:memcached + ports: + - "29000:9000" + volumes: + - /Users/imxieke/Code/Project/boxs:/data + - ./runtime/logs/php80/:/var/log/php-fpm/ + networks: + - boxs + dns: + - 223.5.5.5 + - 8.8.8.8 + + php81: + image: ${DOCKER_REGISTRY_COMPOSE}/php:81 + container_name: php81 + restart: always + depends_on: + - mysql57 + ports: + - "39000:9000" + volumes: + - ./runtime/logs/php81/:/var/log/php-fpm/ + networks: + - boxs + dns: + - 223.5.5.5 + - 8.8.8.8 + + php82: + image: ${DOCKER_REGISTRY_COMPOSE}/php:82 + container_name: php82 + restart: always + depends_on: + - mysql57 + ports: + - "49000:9000" + volumes: + - ./runtime/logs/php82/:/var/log/php-fpm/ + networks: + - boxs + dns: + - 223.5.5.5 + - 8.8.8.8 + + # hhvm: + # image: ${DOCKER_REGISTRY_COMPOSE}/hhvm:latest + # expose: + # - "9000" + + mysql57: + image: ${DOCKER_REGISTRY_COMPOSE}/mysql:5.7 + hostname: mysql57 + container_name: mysql57 + restart: always + expose: + - "3306" + ports: + - "${MYSQL57_PORT}:3306" + volumes: + # - ./runtime/data/mysql57:/var/lib/mysql + - mysql57:/var/lib/mysql + - ./runtime/logs/mysql57/:/var/log/mysql environment: - MYSQL_ROOT_PASSWORD: "111111" - MYSQL_USER: 'test' - MYSQL_PASS: '111111' - image: "mysql:latest" + - TZ=${TIMEZONE} + - MYSQL_ROOT_PASSWORD=${MYSQL57_ROOT_PASSWORD} + - MYSQL_DATABASE=${MYSQL57_DATABASE} + - MYSQL_USER=${MYSQL57_USER} + - MYSQL_PASSWORD=${MYSQL57_PASSWORD} + command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci + #only for container without host + networks: + - boxs + + postgres15: + image: ${DOCKER_REGISTRY_COMPOSE}/postgres:15 + hostname: postgres15 + container_name: postgres15 restart: always + ports: + - "5432:5432" volumes: - - "./db:/var/lib/mysql" - - "./conf/my.cnf:/etc/my.cnf" - - "./init:/docker-entrypoint-initdb.d/" + - postgres15:/var/lib/postgresql/data + environment: + - POSTGRES_DB=default + - POSTGRES_USER=dockenv + - POSTGRES_PASSWORD=dockenv + + mysql80: + image: ${DOCKER_REGISTRY_COMPOSE}/mysql:8.0 + hostname: mysql80 + container_name: mysql80 + restart: always + # Only for Container + expose: + - "3306" ports: - - "3306:3306" + - "${MYSQL80_PORT}:3306" + volumes: + - mysql80:/var/lib/mysql + - ./runtime/logs/mysql80/:/var/log/mysql + environment: + - TZ=${TIMEZONE} + - MYSQL_ROOT_PASSWORD=${MYSQL80_ROOT_PASSWORD} + - MYSQL_DATABASE=${MYSQL80_DATABASE} + - MYSQL_USER=${MYSQL80_USER} + - MYSQL_PASSWORD=${MYSQL80_PASSWORD} + command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci + #only for container without host + networks: + boxs: + ipv4_address: ${MYSQL80_IP} -networks: - frontend: - backend: + mariadb: + image: ${DOCKER_REGISTRY_COMPOSE}/mariadb:latest + hostname: mariadb + container_name: mariadb + restart: always + expose: + - "3306" + ports: + - "${MARIADB_PORT}:3306" + volumes: + - mariadb:/var/lib/mysql + - ./runtime/logs/mariadb/:/var/log/mysql + environment: + - TZ=${TIMEZONE} + - MYSQL_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD} + - MYSQL_DATABASE=${MARIADB_DATABASE} + - MYSQL_USER=${MARIADB_USER} + - MYSQL_PASSWORD=${MARIADB_PASSWORD} + command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci + #only for container without host + networks: + boxs: + ipv4_address: ${MARIADB_IP} + + redis: + image: ${DOCKER_REGISTRY_COMPOSE}/redis:latest + container_name: redis + hostname: redis + ports: + - "6379:6379/tcp" + networks: + boxs: + ipv4_address: ${REDIS_IP} + restart: always + volumes: + - ./runtime/conf/redis:/etc/redis + - redis:/data + - ./runtime/logs/redis:/var/log/redis + command: redis-server /etc/redis/redis.conf + + memcached: + image: ${DOCKER_REGISTRY_COMPOSE}/memcached:latest + hostname: memcached + container_name: memcached + ports: + - ${MEMCACHED_PORT}:11211 + + mongo: + image: ${DOCKER_REGISTRY_COMPOSE}/mongo:latest + ports: + - ${MONGO_PORT}:27017 + restart: always + volumes: + - mongo:/data/db + - ./runtime/conf/mongo:/data/configdb + - ./runtime/logs/mongo:/var/log/mongo + environment: + TZ: ${TIMEZONE} + MONGO_INITDB_ROOT_USERNAME: ${MONGO_ROOT_USERNAME} + MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ROOT_PASSWORD} + # command: mongod --config /etc/mongod.conf + networks: + - boxs + + elastic: + image: ${DOCKER_REGISTRY_COMPOSE}/elastic:latest + hostname: elastic + container_name: elastic + restart: always + environment: + - ELASTIC_PASSWORD=dockenv + # - ENROLLMENT_TOKEN=dockenv + - cluster.name=dockenv + - discovery.type=single-node + # 默认禁用 elasticsearch https 和登陆账号密码 仅适用于 Docker 测试环境 + - xpack.security.enabled=false + - xpack.security.enrollment.enabled=false + - xpack.security.http.ssl.enabled=false + - xpack.security.transport.ssl.enabled=false + # - bootstrap.memory_lock=true + # - "ES_JAVA_OPTS=-Xms512m -Xmx512m" + # - script.painless.regex.enabled=true + # - node.master=false + # - node.data=true + - TZ=${TIMEZONE} + ulimits: + memlock: + soft: -1 + hard: -1 + nofile: + soft: 65536 + hard: 65536 + volumes: + - elastic:/usr/share/elasticsearch/data + # - ${ELASTICSEARCH_CONF_FILE}:/usr/share/elasticsearch/config/elasticsearch.yml + ports: + - "9200:9200" + - "9300:9300" + networks: + boxs: + ipv4_address: ${ELASTICSEARCH_IP} + + kibana: + image: ${DOCKER_REGISTRY_COMPOSE}/kibana:latest + hostname: kibana + container_name: kibana + restart: always + environment: + - SERVER_NAME=kibana + - ELASTICSEARCH_HOSTS=["http://${ELASTICSEARCH_IP}:9200"] + # - ELASTICSEARCH_HOSTS=https://elastic:9200 + ports: + - "5601:5601" + depends_on: + - elastic + links: + - elastic:elastic + networks: + boxs: + ipv4_address: ${KIBANA_IP} + + logstash: + image: ${DOCKER_REGISTRY_COMPOSE}/logstash:latest + hostname: logstash + container_name: logstash + restart: always + ports: + - "9600:9600" + - "5044:5044" + networks: + boxs: + ipv4_address: ${LOGSTASH_IP} + + rabbitmq: + image: ${DOCKER_REGISTRY_COMPOSE}/rabbitmq:latest + hostname: rabbitmq + container_name: rabbitmq + restart: always + ports: + - "4369:4369" + - "5671:5671" + - "5672:5672" + - "15691:15691" + - "15692:15692" + - "25672:25672" + environment: + TZ: "${TIMEZONE}" + RABBITMQ_DEFAULT_USER: "${RABBITMQ_DEFAULT_USER}" + RABBITMQ_DEFAULT_PASS: "${RABBITMQ_DEFAULT_PASS}" + RABBITMQ_NODE_IP_ADDRESS: "${RBMQ_IP}" + volumes: + - ./runtime/data/rabbitmq:/var/lib/rabbitmq + - ./runtime/logs/rabbitmq:/var/log/rabbitmq + networks: + boxs: + ipv4_address: ${RBMQ_IP} + + # portainer: + # image: ${DOCKER_REGISTRY_COMPOSE}/portainer:latest + # hostname: portainer + # container_name: portainer + # restart: always + # ports: + # - "9000:9000" + # volumes: + # - /var/run/docker.sock:/var/run/docker.sock:cached + # - ./runtime/data/portainer/:/data:cached + # networks: + # boxs: + + # aria2: + # image: ${DOCKER_REGISTRY_COMPOSE}/aria2:latest + # hostname: aria2 + # container_name: aria2 + # ports: + # - "6800:6800" + # - "6801:6801" + # - "6802-6999:6802-6999" + # volumes: + # - $HOME/Downloads:/data/downloads:rw + # # - /Users/imxieke/Code/Project/dockenv/images/aria2/conf:/etc/aria2c + # environment: + # RPC_SECRET: dockenv + # ARIA2_PORT: 6800 + # WEBUI_PORT: 6801 + # DHT_PORT: "6802-6999" + # networks: + # boxs: + + # gitea: + # image: ${DOCKER_REGISTRY_COMPOSE}/gitea:latest + # hostname: gitea + # container_name: gitea + # restart: always + # environment: + # - USER_UID=1000 + # - USER_GID=1000 + # # - GITEA_CUSTOM=/etc/gitea + # ports: + # - "3000:3000" + # - "3022:22" + # depends_on: + # - mysql80 + # links: + # - mysql80:mysql80 + # volumes: + # - gitea:/data + # # - ./runtime/conf/gitea:/etc/gitea + # networks: + # boxs: + + # default password ,default user: root + # grep 'Password:' /etc/gitlab/initial_root_password + # gitlab: + # # image: ${DOCKER_REGISTRY_COMPOSE}/gitea:latest + # image: registry.gitlab.cn/omnibus/gitlab-jh:latest + # hostname: gitlab + # container_name: gitlab + # restart: always + # shm_size: 256mb + # environment: + # - GITLAB_ROOT_PASSWORD=dockenv@gitlab + # ports: + # - "2022:22" + # - "2080:80" + # - "2443:443" + # volumes: + # # - gitlabconf:/etc/gitlab + # - ./runtime/conf/gitlab:/etc/gitlab + # # - gitlablogs:/var/log/gitlab + # - ./runtime/logs/gitlab:/var/log/gitlab + # - gitlabdata:/var/opt/gitlab + # networks: + # boxs: volumes: - db-data: + redis: + mongo: + mariadb: + mongo-conf: + mysql57: + mysql80: + postgres15: + elastic: + # gitea: + +networks: + boxs: + driver: bridge + ipam: + driver: default + config: + - subnet: ${SUBNET_IP} + gateway: ${GATEWAY_IP} diff --git a/docs/TODO.md b/docs/TODO.md new file mode 100644 index 00000000..d7c17a29 --- /dev/null +++ b/docs/TODO.md @@ -0,0 +1,106 @@ +## bug + +aria2 +PAS_SECRET 自定义 secret 无效 + +脚本一键更新 .env 内版本信息 + +- 自动更新镜像 +- curl -sL https://github.com/docker-library/kibana/raw/master/6/Dockerfile | grep 'Kibana'| cut -d ' ' -f 3 +- https://www.docker.elastic.co + +## Docker Compose +- mongo +- postgresql +- Elastic +- logstash +- Kibana +- Filebeat + + ## Net Tools + - mtr + - traceroute + - traceroute6 + - tracepath + - ping + - dig + - nslookup + - host + - whois + - netstat + +## Kali 安全工具 +- 网络安全 +- 信息安全 + +php.ini +- expose_php = On + +- boxs: +- [SourceGraph](https://github.com/sourcegraph/sourcegraph) + +- https://github.com/mongo-express/mongo-express +- geth +- openethereum +- opensuuse +- /Users/imxieke/.boxs/bin/all/check-person-project-git-status + +- 优化 Nginx Redis PHP Mysql Memcached Leveldb 环境 +- neovim oh-my-zsh 配置个人习惯 +- fix systemctl not work inside docker container +- xfconf-query -c xsettings -p /Net/ThemeName -s "Numix" +- xfconf-query -c xfwm4 -p /general/theme -s "Numix" +- xfce-theme-manager +- 配置 Neovim zsh 插件 + + +## AUR +- menulibre +- xfonts-wqy +- xfonts-75dpi xfonts-scalable xfonts-cyrillic fonts-mononoki +- ttf-ubuntu-font-family xfonts-base xfonts-100dpi +- rar p7zip-full p7zip-rar +- qdirstat +- kazam + +## Create AUR +- chromium-codecs-ffmpeg +- chromium-browser-l10n + +## pkgs + +ubuntu-kylin-software-center +unity-tweak-tool +/opt/google/chrome/chrome --user-data-dir=/root --window-position=0,0 --window-size=1366,748 --force-device-scale-factor=1 --no-default-browser-check --no-first-run --disable-translate + +## Desktop App +- elementary/appcenter +- https://github.com/elementary-tweaks/elementary-tweaks + +## 拆包查看文件 +ukui-themes + +## Github action workflow TODO +- aria2 +- deepin +- openrestry +- nginx +- percona +- php +- shadowsocks +- sshd +- tengine +- ttyd +- vscode-remote +- xcloud + +## Docker +- https://github.com/sonatype/docker-nexus-iq-server +- https://github.com/sonatype/docker-nexus +- https://github.com/sonatype/docker-nexus3 +- docker pull sonatype/nexus:oss +- https://developer.confluent.io/quickstart/kafka-docker/ +- zookeeper +- kafka +- minio +- rockylinux 9 diff --git a/docs/add-sites.md b/docs/add-sites.md new file mode 100644 index 00000000..aee60b6a --- /dev/null +++ b/docs/add-sites.md @@ -0,0 +1,74 @@ +# 如何新建一个站点 + +比如部署一个Yii2项目 https://github.com/duiying/Yii2-Admin , 并且可以通过 http://frontend.yii2.test 访问 + +#### 1. 配置Nginx +```shell +# Docker-LNMP/docker/config/proxy/conf.d 目录下新建一个配置文件 yii2-docker.conf +[root@localhost Docker-LNMP]# vim docker/config/proxy/conf.d/yii2-docker.conf +``` +yii2-docker.conf 内容如下: +``` +server { + + listen 80; + + server_name frontend.yii2.test; + root /data/www/Yii2-Admin/frontend/web; + index index.php index.html index.htm; + + location / { + # Redirect everything that isn't a real file to index.php + try_files $uri $uri/ /index.php$is_args$args; + } + + # deny accessing php files for the /assets directory + location ~ ^/assets/.*\.php$ { + deny all; + } + + location ~ \.php$ { + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_pass cgi:9000; + try_files $uri =404; + } + + location ~* /\. { + deny all; + } + +} +``` + +#### 2. 克隆项目 +```shell +# Docker-LNMP/www 目录下安装 https://github.com/duiying/Yii2-Admin , 安装过程如下: +[root@localhost Docker-LNMP]# cd www +[root@localhost www]# ls +index.php +[root@localhost www]# git clone https://github.com/duiying/Yii2-Admin.git +[root@localhost www]# ls +index.php Yii2-Admin + +# 更改目录权限 +[root@localhost www]# chmod -R 777 Yii2-Admin/ +``` + +#### 3. 修改本地hosts + +``` +# 192.168.246.128是虚拟机IP地址 +192.168.246.128 frontend.yii2.test +``` + +#### 4. 重启Nginx +```shell +[root@localhost Docker-LNMP]# docker restart proxy +proxy +``` + +#### 5. 浏览器访问 +http://frontend.yii2.test + +![yii2-index](https://raw.githubusercontent.com/duiying/img/master/yii2-index.png) \ No newline at end of file diff --git a/docs/configuration.md b/docs/configuration.md new file mode 100644 index 00000000..0e39c0c9 --- /dev/null +++ b/docs/configuration.md @@ -0,0 +1,235 @@ +# Configuration + +## Usage + +To create a new environment, type the following command: + +```shell +make profile +``` + +To start the environment, type the following command: + +For default configuration + +```shell +make servers +``` + +For specific configuration + +```shell +make run +``` + +Several containers are created from profile configuration: + +| Description | Container's name | +| ------------------------------ | ---------------- | +| Maildev hub mail | `maildev` | +| Web server ( Apache or Nginx ) | `web` | +| PHP or Node container | `base` | +| Cache server | `cache` | +| Database server | `db` | +| Database admin tool | `dbadmin` | +| Queuer server | `queuer` | + +You can customize database container name with profile's variable `CONTAINER_DB_NAME`. By default `CONTAINER_DB_NAME` is setted to `db`. + +`composer` is available through `php` container: + +```shell +docker exec php composer -v +``` + +To open default home page in browser + +```shell +make homepage +``` + +### Hosts + +You can add your own hosts file for all your projects. + +With NGinx + +In `conf/nginx/vhosts` directory, all your `yourhost.conf` file. A default host file is available for example : `/conf/nginx/vhosts/default.conf`. + +```conf +server { + + listen 80; + server_name localhost; + root /var/www/html; + index index.php index.html index.htm; + + location ~* \.PHP$ { + fastcgi_index index.php; + fastcgi_pass base:9000; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + } + +} +``` + +With Apache + +In `conf/apache/vhosts` directory, all your `yourhost.conf` file. A default host file is available for example : `/conf/apache/vhosts/default.conf`. + +```conf + + ServerName localhost + DocumentRoot /var/www/html/projects + + + Require all granted + + +``` + +`/var/www/html/projects` can be defined with `PROJECTS_PATH_DEST` environment variable in profile file in `profiles` directory. + +### SSL support + +The SSL support is possible during development. To activate it on one of your vhosts, you must follow steps: + +- Create the SSL self-signed certificate + +you can use the command: + +```shell +make certificate +``` + +- Add the activation of SSL in VHost file + +On Nginx: + +```shell + listen 443 ssl; + + ssl_certificate /etc/nginx/ssl/envdev.crt; + ssl_certificate_key /etc/nginx/ssl/envdev.key; +``` + +On Apache: + +```shell + + ... + + SSLEngine on + SSLCertificateFile /usr/local/apache2/conf/custom/envdev.crt + SSLCertificateKeyFile /usr/local/apache2/conf/custom/envdev.key + + ... +``` + +where `envdev` is the name chosen during the step of the certificate creation. + +Don't forget to restart `web` container to restart the web server + +```shell +docker restart web +``` + +Tips: If you certificate is out of date, you can renew it with the command: + +```shell +make renewal +``` + +## Customization + +You can create profile file to manage applications and tools with the command: + +```shell +make profile +``` + +The following versions, paths and ports can be configured : + +| Description | Variable name | Possible values | Default | +| :------------------------------- | :----------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------: | +| Language | LANGUAGE_SERVER | `php`, `node` | N/A | +| Language Version | BASE_VERSION | `7.0-fpm`, `7.1-fpm`, `7.2-fpm`, `7.0-fpm-alpine`, `7.1-fpm-alpine`, `7.2-fpm-alpine`, `7.3-fpm`, `7.3-fpm-alpine`, `7.4-fpm`, `7.4-fpm-alpine`, `13.6`, `12.14`, `10.18` | `7.4-fpm` for PHP, `13.6` for Node | +| Language Static Container IP | BASE_STATIC_IP | 172.16.238.0/24 | 172.16.238.12 | +| Web Server type | WEB_SERVER | `nginx`, `apache` | `nginx` | +| Web Server version | WEB_VERSION | [Apache](https://hub.docker.com/r/library/httpd/tags/) / [Nginx](https://hub.docker.com/r/library/nginx/tags/) | `1.15-alpine` | +| Web Server Static Container IP | WEB_STATIC_IP | 172.16.238.0/24 | 172.16.238.14 | +| Database type | DB_SERVER | `mariadb`, `mysql`, `mongodb` | `mysql` | +| Database version | DB_VERSION | [Mysql](https://hub.docker.com/r/library/mysql/tags/) / [MariaDB](https://hub.docker.com/r/library/mariadb/tags/) / [MongoDB](https://hub.docker.com/r/library/mongo/tags/) | `5.7` | +| Database container name | CONTAINER_DB_NAME | any | `db` | +| Database Static Container IP | DB_STATIC_IP | 172.16.238.0/24 | 172.16.238.13 | +| Projects Path | PROJECTS_PATH | any | `/your/projects/directory/path` | +| Projects path destination | PROJECTS_PATH_DEST | any | `/var/www/html/projects` | +| HTTP web port | WEB_PORT | any | `80` | +| HTTPS web port | WEBSSL_PORT | any | `443` | +| MailDev port | MAILDEV_PORT | any | `1080` | +| MailDev Static Container IP | MAILDEV_STATIC_IP | 172.16.238.0/24 | 172.16.238.10 | +| DBAdmin tool port | DBADMIN_PORT | any | `9090` | +| DBAdmin version | DBADMIN_VERSION | [Phpmyadmin](https://hub.docker.com/r/phpmyadmin/phpmyadmin/tags/) / [MongoExpress](https://hub.docker.com/r/library/mongo-express/tags/) | `4.8` | +| DBAdmin Static Container IP | DBADMIN_STATIC_IP | 172.16.238.0/24 | 172.16.238.11 | +| Cache server type | CACHE_SERVER | `redis`, `memcached` | `redis` | +| Cache server port | CACHE_PORT | any | `6380` | +| Cache server version | CACHE_VERSION | any | `4.0-alpine` | +| Cache server Static Container IP | CACHE_STATIC_IP | 172.16.238.0/24 | 172.16.238.15 | +| Queuer server | QUEUER_SERVER | `rabbitmq` | `rabbitmq` | +| Queuer server port | QUEUER_PORT | any | `15672` | +| Queuer Static Container IP | QUEUER_STATIC_IP | 172.16.238.0/24 | 172.16.238.16 | + +If you access to the url `http://envdev.localhost` a page summarizes all projets and propose access link to tools (PHPMyAdmin, MailDev, PHPInfo). +This page is also available with command : + +```shell +make homepage +``` + +### Nginx configuration + +Nginx configuration file is available at `/conf/nginx/nginx.conf` to custom the web server configuration. + +### Apache configuration + +Apache configuration file is available at `/conf/apache/httpd.conf` to custom the web server configuration. + +### PHP configuration + +A custom php.ini file is available at `/conf/php/php.ini`. The default PHP configuration is with these options: + +```conf +date.timezone = Europe/Paris +display_errors=1 +error_reporting=E_ALL +log_errors = on +error_log = /var/log/php_errors.log +memory_limit = 256M +upload_max_filesize = 200M +post_max_size = 40M +``` + +### Projects configuration + +To simplify projects source sharing between containers, you can install source projects in the path define in `profiles` directory with variable `PROJECTS_PATH`. + +Naturally, you can change the default path. In this case, the default summary will not be available. + +The destination path in container is also available with variable `PROJECTS_PATH_DEST` in `profiles` directory. + +### Wrappers + +Wrappers are available in `wrappers` directory. + +They can be used, for instance, to IDE integration. + +- PHP wrapper +- Node wrapper +- Git wrapper +- Composer wrapper +- Grunt wrapper +- Gulp wrapper +- Npm wrapper +- Yarn wrapper +- Typescript wrapper diff --git a/docs/docker.md b/docs/docker.md new file mode 100644 index 00000000..286a4480 --- /dev/null +++ b/docs/docker.md @@ -0,0 +1,40 @@ +常用命令 + +进入容器 +``` +docker-compose exec [images] bash # 例如 docker-compose exec php-fpm bash +``` +创建并启动一个容器,在run后面加上-d参数,则会创建一个守护式容器在后台运行 + +``` + docker rmun +``` +查看已经创建的容器 + +``` +docker ps -a +``` +查看已经启动的容器 +```shell +docker ps -s +``` +启动容器名为con_name的容器 +``` +docker start con_name +``` +停止容器名为con_name的容器 +``` +docker stop con_name +``` +删除容器名为con_name的容器 +``` +docker rm con_name +``` +重命名一个容器 +``` +docker rename old_name new_name +``` +将终端附着到正在运行的容器名为con_name的容器的终端上面去,前提是创建该容器时指定了相应的sh +``` +docker attach con_name +``` diff --git a/docs/error.md b/docs/error.md new file mode 100644 index 00000000..c2d4a66a --- /dev/null +++ b/docs/error.md @@ -0,0 +1,69 @@ +### 目录 + +- 安装composer时候出现错误 +- 启动后出现类似的错误 +- 修改默认数据库账号密码 +- 容器内数据库连接127.0.0.1连不上怎么办 + +### 1、安装composer时候出现错误 +``` +curl: (56) SSL read: error:00000000:lib(0):func(0):reason(0), errno 104 +``` +解决方法 + +> 网络请求问题,重新执行一下 `docker-compose up` + +### 2、启动后出现类似的错误 +``` +Removing intermediate container d91a90bb00b5 + ---> 40e52ab712e3 +Successfully built 40e52ab712e3 +Successfully tagged services_nginx:latest +Creating services_mysql-db_1 ... error +Creating services_mysql-db_1 ... +Creating services_redis-db_1 ... error + +ERROR: for services_mysql-db_1 Cannot start service mysql-db: driver failed programming external connectivity on endpoint services_mysql-db_1 (2cce096d8d21d8324c101d2bd50f8f90b55f37a253be57a4fbfc9098bcf20d61): Error starting userland proxy: listen tcp 0.0.0.0:3306: bind: address already in use + +ERROR: for services_redis-db_1 Cannot start service redis-db: driver failed programming external connectivity on endpoint services_redis-db_1 (617a4e9988ef5c3d0f74bbe4988a916d9f654d3f168bbead9451c3b97842e0bc): Error starting userland proxy: listen tcp 0.0.0.0:6379: bind: address already in use + +ERROR: for redis-db Cannot start service redis-db: driver failed programming external connectivity on endpoint services_redis-db_1 (617a4e9988ef5c3d0f74bbe4988a916d9f654d3f168bbead9451c3b97842e0bc): Error starting userland proxy: listen tcp 0.0.0.0:6379: bind: address already in use + +ERROR: for mysql-db Cannot start service mysql-db: driver failed programming external connectivity on endpoint services_mysql-db_1 (2cce096d8d21d8324c101d2bd50f8f90b55f37a253be57a4fbfc9098bcf20d61): Error starting userland proxy: listen tcp 0.0.0.0:3306: bind: address already in use +ERROR: Encountered errors while bringing up the project. +``` + +解决方法 + +> 由于映射端口冲突导致的,修改 docker-composer.yml 文件里面对应的容器映射端口,比如 3306:3306 => 3307:3306 + + +### 3、修改默认数据库账号密码 + +解决方法 + +编辑 `services\docker-compose.yml`文件在46行左右修改初始密码 +``` + MYSQL_ROOT_PASSWORD: 5eNyjNf # root密码 自行修改 + MYSQL_DATABASE: rageframe # 数据库名 + MYSQL_USER: rageframe + MYSQL_PASSWORD: 2589632147 +``` + +### 4、容器内数据库连接127.0.0.1连不上怎么办 + +解决方法 + +> 使用显示所有容器IP地址 + +``` +docker inspect --format='{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq) +``` +会输出如下类似的,可以看出mysql地址为172.21.0.2,redis地址为172.21.0.3 +``` +/services_nginx_1 - 172.21.0.5 +/services_php-fpm_1 - 172.21.0.4 +/services_mysql-db_1 - 172.21.0.2 +/services_redis-db_1 - 172.21.0.3 +/priceless_ptolemy - +``` \ No newline at end of file diff --git a/docs/https.md b/docs/https.md new file mode 100644 index 00000000..da10e9ea --- /dev/null +++ b/docs/https.md @@ -0,0 +1,71 @@ +# Nginx 配置 HTTPS + +Nginx 虚拟主机基本配置请参考 [Nginx 配置虚拟主机](vhost.md) 小节。 + + +## 申请 SSL 证书 + +申请 SSL 证书的平台自选,本人将申请的证书命名如下: +- laravel.local.pem +- laravel.local.key + +并将证书放到 docker-lnmp/nginx/ssl 目录下: +``` +cp -i 你的目录/laravel.local.pem 你的目录/docker-lnmp/nginx/ssl/ +cp -i 你的目录/laravel.local.key 你的目录/docker-lnmp/nginx/ssl/ +``` + + +## 添加 server 配置 + +docker-lnmp/nginx/sites/laravel.conf 文件再添加一个 server 项,配置如下: +``` +server { + + listen 443 ssl; + + server_name laravel.local; + root /var/www/laravel/public; + + index index.php index.html index.htm; + + # 将证书放到 docker-lnmp/nginx/ssl 目录下,将下面的证书改成当前域名的,路径用下面的 + ssl_certificate /etc/nginx/ssl/laravel.local.pem; + ssl_certificate_key /etc/nginx/ssl/laravel.local.key; + ssl_session_timeout 5m; + ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_prefer_server_ciphers on; + + location / { + try_files $uri $uri/ /index.php?$query_string; + + if (!-d $request_filename) { + rewrite ^/(.+)/$ /$1 permanent; + } + + if (!-e $request_filename) { + rewrite ^/(.*)$ /index.php?/$1 last; + break; + } + } + + location ~ \.php$ { + fastcgi_pass php-fpm:9000; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + } + +} +``` + +如需将 http 请求全部跳转至 https,监听 80 的 server 添加如下配置即可: +``` +return 301 https://$server_name$request_uri; +``` + +## 重启服务 + +参照基本命令。 + diff --git a/docs/images.md b/docs/images.md new file mode 100644 index 00000000..15b453b9 --- /dev/null +++ b/docs/images.md @@ -0,0 +1,142 @@ +## Docker Image + +## Dockerfile 介绍 +- portainer docker 容器管理 UI +- thumbor 是一个非常强大的图片处理服务,可以实现图片裁剪、缩放、滤镜,甚至是人脸识别。 +- ide-theia 运行在浏览器里的开发环境 +- Dejavu ElasticSearch Web UI +- Graylog 开源的日志聚合、分析、审计、展现和预警工具。功能上和ELK类似,但比 ELK 要简单 +- ICEcoder WebIDE +- Grafana 跨平台的开源的度量分析和可视化工具 +- Solr 独立的企业级搜索应用服务器 +- mosquitto Eclipse Mosquitto 是一个开源消息代理 +- Kibana 日志分析平台 为 Logstash 和 ElasticSearch 提供的日志分析的 Web 接口。可对日志进行搜索、可视化、分析 +- minio 分布式存储对象存储方案 +- percona 数据库 类似 Mariadb 兼容 mysql +- traefik 反向代理工具 类似 nginx +- sqs ElasticMQ server + web UI +- Cassandra 开源分布式NoSQL数据库系统 +- Manticore database designed specifically for search, including full-text search +- rethinkdb 存储 JSON 文档的分布式数据库 +- couthdb 面向文档的数据库管理系统 +- mailcatcher 抓取和查看邮件 +- jupyterhub Jupyter notebook 的多用户服务器 +- Truffle 以太坊的Solidity语言的一套开发框架 +- ganache 以太坊节点仿真环境 +- ldap LDAP容器 +- nginx-stream 支持4层转发的nginx官方版本 +- openresty 支持lua脚本的nginx容器 +- tengine 阿里开源nginx版本,支持lua +- Buildbot Archlinux aur Build Bot +- golang go language support environment +- h5ai online file view +- java java(8) language support environment. +- nextcloud an open source, self-hosted file share and communication platform, like owncloud. +- owncloud an open source, self-hosted file sync and share app platform. +- php7 php(7) language support environment running in alpine include nginx php7! +- rsync an open source utility that provides fast incremental file transfer. +- sshd support remote access via ssh ,running in debian buster +- ttyd Share your terminal over the web + +#### Linux/Unix Open System + +| Name | Comments | +|---|---| +| ALinux | Aliyun Linux | +| Alpine | A minimal Linux | +| Almalinux | An Open Source, community owned and governed, forever-free enterprise Linux distribution, compatible with rhel && CentOS | +| Altlinux | based on RPM Package Manager (RPM) | +| amazonlinux | Amazon Distribution,Base RHEL | +| Archlinux | A simple, lightweight distribution | +| Cirros | | +| Clearlinux | open source, rolling release Linux distribution | +| Debian | Debian is a Linux distribution that's composed entirely of free and open-source software. | +| Deepin | a beautiful open source GNU/Linux, Base Debian | +| Centos | Community Enterprise Operating System | +| Fedora | like RHEL | +| Gentoo | a highly flexible, source-based Linux distribution. | +| Kali | Debian-derived Linux distribution designed for digital forensics and penetration testing. It is maintained and funded by Offensive Security. | +| Manjaro | based on the Arch Linux | +| Megaia | community-based Linux distribution | +| Openeuler | debian-like | +| opensuse |openSUSE is a project that serves to promote the use of free and open-source software. openSUSE is well known for its Linux distributions | +| Oraclelinux | based on the rhel | +| Photon | an open-source minimalist Linux operating system from VMware that is optimized for cloud computing platforms | +| Rockylinux | based on the rhel | +| rhel | Red Hat Enterprise Linux operating system | +| Scientific Linux | based on Red Hat Enterprise Linux | +| Ubuntu | Ubuntu is a Debian-based Linux operating system based on free software. | + + +## Rolling Release +- Archlinux +- Alpine Edge +- Debian testing +- Gentoo +- kali kali-rolling (default) +- Manjaro (Base Archlinux) +- opensuse tumbleweed +- solus + - TODO + - https://github.com/solus-project + - https://getsol.us + - https://github.com/sileshn/SolusWSL +- voidlinux + +#### App image +- inotify-tools +- phpRedisAdmin +- aerospike key-value + +### WebDriver +- chromedriver +- geckodriver + +## TODO +- shadowsocks +- tengine +- Canddy2 + +## Docker Composer +- mount to local volume for data log etc... +- varnish +- haproxy +- selenium +- mailhog + +## Env +- Web Server + - [Canndy](https://caddyserver.com) + - [Nginx](http://nginx.org) + - Openresty + - Tengine +- SQL + - [MYSQL](https://www.mysql.com) + - [MariaDB](https://mariadb.org) + - [SQLite](https://www.sqlite.org) + - [PostGreSQL](https://www.postgresql.org) + - [MongoDB](https://www.mongodb.com) +- Mysql Manager + - [PHPMyAdmin](https://www.phpmyadmin.net) + - [Adminer](https://www.adminer.org) +- NOSQL + - [Aerospike](https://aerospike.com) + - [Redis](https://redis.io) + - [Memcached](https://memcached.org) +- Message Queue (Broker) + - [RabbitMQ](https://www.rabbitmq.com) + - [beanstalkd](https://beanstalkd.github.io) + - [Apache Kafka](http://kafka.apache.org) +- full-text search engine + - [elastic](https://www.elastic.co) +- Editor + - [NeoVim](https://neovim.io) + - [Sublime Text](https://www.sublimetext.com) + - [Visual Studio Code](https://code.visualstudio.com) +- Git Version Repo + - [Github](https://github.com) + - [BitBucket](https://bitbucket.org) + - [Gitlab](https://about.gitlab.com) + - [Azure](https://dev.azure.com) +- Daemon + - superviosr diff --git a/docs/issues.md b/docs/issues.md new file mode 100644 index 00000000..d6eb8ee6 --- /dev/null +++ b/docs/issues.md @@ -0,0 +1,32 @@ +## add user to docker group + +### add user to `docker` group + +`sudo usermod -aG ${USER} docker` + +## docker compose 修改后不生效 +> 重新创建容器即可 + +`docker-compose up -d servie` + +## Linux Config Docker Mirrors +```bash +# macOS Docker +$ mkdir -p ~/.docker +# Linux Docker +$ sudo mkdir -p /etc/docker +$ sudo tee /etc/docker/daemon.json <<-'EOF' +{ + "registry-mirrors": ["https://muehonsf.mirror.aliyuncs.com"] +} +EOF +$ sudo systemctl daemon-reload +$ sudo systemctl restart docker +``` + +## 学习文档 +[Docker 配置详解](https://www.jianshu.com/p/2217cfed29d7) + +[Docker 入门教程](http://www.ruanyifeng.com/blog/2018/02/docker-tutorial.html) + +[Docker 微服务教程](http://www.ruanyifeng.com/blog/2018/02/docker-wordpress-tutorial.html) diff --git a/docs/nginx.md b/docs/nginx.md new file mode 100644 index 00000000..8ba38fc3 --- /dev/null +++ b/docs/nginx.md @@ -0,0 +1,47 @@ +Nginx中if语句中的判断条件 +一、if语句中的判断条件(nginx) + +1、正则表达式匹配: + +==:等值比较; +~:与指定正则表达式模式匹配时返回“真”,判断匹配与否时区分字符大小写; +~*:与指定正则表达式模式匹配时返回“真”,判断匹配与否时不区分字符大小写; +!~:与指定正则表达式模式不匹配时返回“真”,判断匹配与否时区分字符大小写; +!~*:与指定正则表达式模式不匹配时返回“真”,判断匹配与否时不区分字符大小写; + + + +2、文件及目录匹配判断: + +-f, !-f:判断指定的路径是否为存在且为文件; +-d, !-d:判断指定的路径是否为存在且为目录; +-e, !-e:判断指定的路径是否存在,文件或目录均可; +-x, !-x:判断指定路径的文件是否存在且可执行; + +有些公司可能有这样的需求,如:我的网站或者网页游戏需要更新,所有的用户或者玩家访问到的是一个停服更新页面,而本公司的IP可以访问,甚至说本公司的某个内网IP可以访问,用于确认更新成功与否,针对这个问题写了如下的访问控制规则: + +Nginx多重条件判断(只是一个简单的例子,自己可以更改或者增加更多的判断条件),下面是两个例子和写法: +1、可以作为nginx的停服更新使用,仅允许222.222.222.222或者内网的两个IP访问,其他IP都rewrite到停服页面 +Nginx.conf中加入在你项目的正确位置 +set $my_ip ''; +if ( $remote_addr = 222.222.222.222){set $my_ip 1;} #注意这里的$remote_addr如何用了负载均衡的话,这里应该是$http_x_forwarded_for +if ( $remote_addr = 192.168.1.170 ){ set $my_ip 1;} +if ( $remote_addr = 192.168.1.169 ){ set $my_ip 1;} +if ( $my_ip != 1) {rewrite ^/design/(.*)\.php$ /tingfu.html?$1&;} #将*.php转到tingfu.html + + 2、访问某个php应用的时候我只想让内部的某个IP访问,其他的IP都转到另一个PHP上。如下: +访问test.php,且IP不等222.222.222.222的跳转到55555.php: +set $test ''; +if ( $request_uri ~* /img/test.php ) { + set $test P; +} + + +if ( $http_x_forwarded_for !~* ^222\.222\.222\.222.* ) { + set $test "${test}C"; +} + + +if ( $test = PC ) { #当条件符合 访问test.php并且 ip不是222.222.222.222的 转发到55555.php +rewrite ^(.*)$ /img/55555.php permanent; +} \ No newline at end of file diff --git a/docs/presentation.md b/docs/presentation.md new file mode 100644 index 00000000..5e302244 --- /dev/null +++ b/docs/presentation.md @@ -0,0 +1,146 @@ +# Presentation + +## Environment composition + +This environment provides the following tools to develop in PHP or in NodeJS via profiles. + +### Core + +- [PHP](http://php.net) + +Available version : + + - `7.0-fpm` + - `7.1-fpm` + - `7.2-fpm` + - `7.3-fpm` + - `7.4-fpm` + - `7.0-fpm-alpine` + - `7.1-fpm-alpine` + - `7.2-fpm-alpine` + - `7.3-fpm-alpine` + - `7.4-fpm-alpine` + +Default: `7.4-fpm`. + +- [Node](https://nodejs.org/) + +Available version : + + - `10.18` + - `12.14` + - `13.6` + +Default: `13.6` + +- Database + +Two different database are available : + +- [MySQL](https://www.mysql.com) +- [MongoDB](https://www.mongodb.com) + +The database wished is configured in `.env` file. Default: `mysql` + +- Web server + +Two web server are available : + +- [Nginx](https://nginx.org) +- [Apache](https://httpd.apache.org/) + +All of them are in Alpine version. + +- Cache server + +Two cache server are available : + +- [Redis](https://redis.io/) +- [Memcached](https://memcached.org/) + +- Queuer server + +- [RabbitMQ](https://www.rabbitmq.com/) + +All of them are in Alpine version + +### Tools + +#### Database admin + +- [MongoExpress](https://github.com/mongo-express/mongo-express) : Manage Mongo database instances +- [PHPMyAdmin](https://www.phpmyadmin.net/) : Manage MySql/MariaDB database instances + +#### Mail catcher + +- [MailDev](http://danfarrelly.nyc/MailDev) : SMTP Server + Web Interface for viewing and testing emails during development + +#### Composer + +- [Composer](https://getcomposer.org) : Dependency Manager for PHP + +#### NodeJs + +- [NodeJs](https://nodejs.org/en) : JavaScript runtime + +#### Npm + +- [Npm](https://www.npmjs.com/) : Package manager + +#### Grunt + +- [Grunt](https://gruntjs.com/) : Javascript task runner + +#### Gulp + +- [Gulp](https://gulpjs.com/) : Javascript task runner + +#### Yarn + +- [Yarn](https://yarnpkg.com/en/) : Package manager + +#### Makefile + +A `Makefile` is available in command line to manage several actions. + +Type following command to display help : + +```shell +make +``` + +or + +```shell +make help +``` + +Output: + +```shell +help: Show this help +envdev: Get EnvDev version +profile: Create new profile +delete: Delete profile +run: Run a profile +servers: Start default containers +start: Start default containers +stop: Stop all running containers +certificate: Generate a SSL certificate +renewal: Renewal a knowed SSL certificate +homepage: Launch EnvDev homepage in default browser +terminal: Create a terminal on PHP container +terminalroot: Create a terminal on PHP container as root +``` + +### Optional tools + +Optional tools are available to use in EnvDev. They are not included by default but can be added easily. + +- [APIGen](https://github.com/ApiGen/ApiGen) : Documentation for your PHP project + +Image container : [`vfac/apigen`](https://hub.docker.com/r/vfac/apigen/) + +- [Deployer](https://deployer.org) : Deployment tool for PHP + +Image container : [`vfac/deployer`](https://hub.docker.com/r/vfac/deployer/) diff --git a/docs/tmp.md b/docs/tmp.md new file mode 100644 index 00000000..7c442947 --- /dev/null +++ b/docs/tmp.md @@ -0,0 +1,721 @@ +其中 `mysql` 服务中的 `image: mysql:5.7` 是表明使用的是 `mysql:5.7` 这个镜像。而 `nginx` 和 `php` 服务中的 `image` 含义更为复杂。一方面是说,要使用其中名字的镜像,另一方面,如果这个镜像不存在,则利用其下方指定的 `build` 指令进行构建。在单机环境,这里的 `image` 并非必须,只保留 `build` 就可以。但是在 Swarm 环境中,需要集群中全体主机使用同一个镜像,每个机器自己构建就不合适了,指定了 `image` 后,就可以在单机 `build` 并 `push` 到 registry,然后在集群中执行 `up` 的时候,才可以自动从 registry 下载所需镜像。 + +这里的镜像名看起来也有些不同: + +```bash +image: "${DOCKER_USER}/lnmp-nginx:v1.2" +``` + +其中的 `${DOCKER_USER}` 这种用法是环境变量替换,当存在环境变量 `DOCKER_USER` 时,将会用其值替换 `${DOCKER_USER}`。而环境变量从哪里来呢?除了在 Shell 中 `export` 对应的环境变量外,Docker Compose 还支持一个默认的环境变量文件,既 `.env` 文件。你可以在项目中看到,`docker-compose.yml` 的同级目录下,存在一个 `.env` 文件,里面定义了环境变量。 + +```bash +DOCKER_USER=twang2218 +``` + +每次执行 `docker-compose` 命令的时候,这个 `.env` 文件就会自动被加载,所以是一个用来定制 compose 文件非常方便的地方。这里我只定义了一个环境变量 `DOCKER_USER`,当然,可以继续一行一个定义更多的环境变量。 + +初次之外,还可以明确指定环境变量文件。具体的配置请查看 [`docker-compose` 官方文档](https://docs.docker.com/compose/compose-file/#envfile)。 + +## 镜像 + +### mysql 服务镜像 + +`mysql` 服务均直接使用的是 Docker 官方镜像。使用官方镜像并非意味着无法定制,Docker 官方提供的镜像,一般都具有一定的定制能力。 + +```yml + mysql: + image: mysql:5.7 + ... + environment: + TZ: 'Asia/Shanghai' + MYSQL_ROOT_PASSWORD: Passw0rd + command: ['mysqld', '--character-set-server=utf8'] + ... +``` + +在这个例子中,`mysql` 服务就通过环境变量 `MYSQL_ROOT_PASSWORD`,设定了 MySQL 数据库初始密码为 `Passw0rd`,并且通过 `TZ` 环境变量指定了国内时区。 + +并且,我重新指定了启动容器的命令,在 `command` 中,添加了额外的参数。`--character-set-server=utf8`,指定了默认字符集。 + +### nginx 服务镜像 + +`nginx` 官方镜像基本满足需求,但是我们需要添加默认网站的配置文件、以及网站页面目录。 + +```Dockerfile +FROM nginx:1.11 +ENV TZ=Asia/Shanghai +COPY ./nginx.conf /etc/nginx/conf.d/default.conf +COPY ./site /usr/share/nginx/html +``` + +镜像定制很简单,就是指定时区后,将配置文件、网站页面目录复制到指定位置。 + +### php 服务镜像 + +`php` 服务较为特殊,由于官方 `php` 镜像未提供连接 `mysql` 所需的插件,所以 `php` 服务无法直接使用官方镜像。在这里,正好用其作为例子,演示如何基于官方镜像,安装插件,定制自己所需的镜像。 + +对应的[`Dockerfile.php`](https://coding.net/u/twang2218/p/docker-lnmp/git/blob/master/Dockerfile.php): + +```Dockerfile +FROM php:7-fpm + +ENV TZ=Asia/Shanghai + +COPY sources.list /etc/apt/sources.list + +RUN set -xe \ + && echo "构建依赖" \ + && buildDeps=" \ + build-essential \ + php5-dev \ + libfreetype6-dev \ + libjpeg62-turbo-dev \ + libmcrypt-dev \ + libpng12-dev \ + " \ + && echo "运行依赖" \ + && runtimeDeps=" \ + libfreetype6 \ + libjpeg62-turbo \ + libmcrypt4 \ + libpng12-0 \ + " \ + && echo "安装 php 以及编译构建组件所需包" \ + && apt-get update \ + && apt-get install -y ${runtimeDeps} ${buildDeps} --no-install-recommends \ + && echo "编译安装 php 组件" \ + && docker-php-ext-install iconv mcrypt mysqli pdo pdo_mysql zip \ + && docker-php-ext-configure gd \ + --with-freetype-dir=/usr/include/ \ + --with-jpeg-dir=/usr/include/ \ + && docker-php-ext-install gd \ + && echo "清理" \ + && apt-get purge -y --auto-remove \ + -o APT::AutoRemove::RecommendsImportant=false \ + -o APT::AutoRemove::SuggestsImportant=false \ + $buildDeps \ + && rm -rf /var/cache/apt/* \ + && rm -rf /var/lib/apt/lists/* + +COPY ./php.conf /usr/local/etc/php/conf.d/php.conf +COPY ./site /usr/share/nginx/html +``` + +前面几行很简单,指定了基础镜像为 [`php:7-fpm`](https://hub.docker.com/_/php/),并且设定时区为中国时区,然后用[网易的 Debian 源](http://mirrors.163.com/.help/debian.html)替代默认的源,避免伟大的墙影响普通的包下载。接下来的那一个很多行的 `RUN` 需要特别的说一下。 + +初学 Docker,不少人会误以为 `Dockerfile` 等同于 Shell 脚本,于是错误的用了很多个 `RUN`,每个 `RUN` 对应一个命令。这是错误用法,会导致最终镜像极为臃肿。`Dockerfile` 是镜像定制文件,其中每一个命令都是在定义这一层该如何改变,因此应该[遵循最佳实践](https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/),将同一类的东西写入一层,并且在结束时清理任何无关的文件。 + +这一层的目的是安装、构建 PHP 插件,因此真正所需要的是构建好的插件、以及插件运行所需要的依赖库,其它任何多余的文件都不应该存在。所以,在这里可以看到,依赖部分划分为了“构建依赖”以及“运行依赖”,这样在安装后,可以把不再需要的“构建依赖”删除掉,避免因为构建而导致这层多了一些不需要的文件。 + +这里使用的是官方 `php` 镜像中所带的 `docker-php-ext-install` 来安装 php 的插件,并且在需要时,使用 `docker-php-ext-configure` 来配置构建参数。这两个脚本是官方镜像中为了帮助镜像定制所提供的,很多官方镜像都有这类为镜像定制特意制作的脚本或者程序。这也是官方镜像易于扩展复用的原因之一,他们在尽可能的帮助使用、定制镜像。 + +更多关于如何定制镜像的信息可以从 Docker Hub 官方镜像的文档中看到: + +最后的清理过程中,可以看到除了清除“构建依赖”、以及相关无用软件外,还彻底清空了 `apt` 的缓存。任何不需要的东西,都应该清理掉,确保这一层构建完毕后,仅剩所需的文件。 + +在 `Dockerfile` 的最后,复制配置文件和网页目录到指定位置。 + +## 网络 + +在这个例子中,演示了如何使用自定义网络,并利用服务名通讯。 + +首先,在 `docker-compose.yml` 文件尾部,全局 `networks` 部分定义了两个自定义网络,分别名为 `frontend`,`backend`。 + +```yml +networks: + frontend: + backend: +``` + +每个自定义网络都可以配置很多东西,包括网络所使用的驱动、网络地址范围等设置。但是,你可能会注意到这里 `frontend`、`backend` 后面是空的,这是指一切都使用默认,换句话说,在单机环境中,将意味着使用 `bridge` 驱动;而在 Swarm 环境中,使用 `overlay` 驱动,而且地址范围完全交给 Docker 引擎决定。 + +然后,在前面`services`中,每个服务下面的也有一个 `networks` 部分,这部分是用于定义这个服务要连接到哪些网络上。 + +```yml +services: + nginx: + ... + networks: + - frontend + php: + ... + networks: + - frontend + - backend + mysql: + ... + networks: + - backend + +``` + +在这个例子中, + +* `nginx` 接到了名为 `frontend` 的前端网络; +* `mysql` 接到了名为 `backend` 的后端网络; +* 而作为中间的 `php` 同时连接了 `frontend` 和 `backend` 网络上。 + +连接到同一个网络的容器,可以进行互连;而不同网络的容器则会被隔离。 +所以在这个例子中,`nginx` 可以和 `php` 服务进行互连,`php` 也可以和 `mysql` 服务互连,因为它们连接到了同一个网络中; +而 `nginx` 和 `mysql` 并不处于同一网络,所以二者无法通讯,这起到了隔离的作用。 + +处于同一网络的容器,可以使用**服务名**访问对方。比如,在这个例子中的 `./site/index.php` 里,就是使用的 `mysql` 这个服务名去连接的数据库服务器。 + +```php + +``` + +可以注意到,在这段数据库连接的代码里,数据库密码是通过环境变量,`$_ENV["MYSQL_PASSWORD"]`,读取的,因此密码并非写死于代码中。在运行时,可以通过环境变量将实际环境的密码传入容器。在这个例子里,就是在 `docker-compose.yml` 文件中指定的环境变量: + +```yml +version: '2' +services: +... + php: +... + environment: + MYSQL_PASSWORD: Passw0rd +... +``` + +关于 Docker 自定义网络,可以看一下官方文档的介绍: + + +关于在 Docker Compose 中使用自定义网络的部分,可以看官方这部分文档: + + +## 存储 + +在这三个服务中,`nginx` 和 `php` 都是无状态服务,它们都不需要本地存储。但是,`mysql` 是数据库,需要存储动态数据文件。我们知道 Docker 是要求容器存储层里不放状态,所有的状态(也就是动态的数据)的持久化都应该使用卷,在这里就是使用命名卷保存数据的。 + +```yaml +volumes: + mysql-data: +``` + +在 `docker-compose.yml` 文件的后面,有一个全局的 `volumes` 配置部分,用于定义的是命名卷,这里我们定义了一个名为 `mysql-data` 的命名卷。这里卷的定义后还可以加一些卷的参数,比如卷驱动、卷的一些配置,而这里省略,意味着都使用默认值。也就是说使用 `local` 也就是最简单的本地卷驱动,将来建立的命名卷可能会位于 `/var/lib/docker/volumes` 下,不过不需要、也不应该直接去这个位置访问其内容。 + +在 `mysql` 服务的部分,同样有一个 `volumes` 配置,这里配置的是容器运行时需要挂载什么卷、或绑定宿主的目录。在这里,我们使用了之前定义的命名卷 `mysql-data`,挂载到容器的 `/var/lib/mysql`。 + +```yaml +mysql: + image: mysql:5.7 + volumes: + - mysql-data:/var/lib/mysql +... +``` + +## 依赖 + +服务的启动顺序有时候比较关键,Compose 在这里可以提供一定程度的启动控制。比如这个例子中,我是用了依赖关系 `depends_on` 来进行配置。 + +```yml + +services: + nginx: + ... + depends_on: + - php + php: + ... + depends_on: + - mysql + mysql: + ... +``` + +在这里,`nginx` 需要使用 `php` 服务,所以这里依赖关系上设置了 `php`,而 `php` 服务则需要操作 `mysql`,所以它依赖了 `mysql`。 + +在 `docker-compose up -d` 的时候,会根据依赖控制服务间的启动顺序,对于这个例子,则会以 `mysql` → `php` → `nginx` 的顺序启动服务。 + +需要注意的是,这里的启动顺序的控制是有限度的,并非彻底等到所依赖的服务可以工作后,才会启动下一个服务。而是确定容器启动后,则开始启动下一个服务。因此,这里的顺序控制可能依旧会导致某项服务启动时,它所依赖的服务并未准备好。比如 `php` 启动后,有可能会出现 `mysql` 服务的数据库尚未初始化完。对于某些应用来说,这个控制,依旧可能导致报错说无法连接所需服务。 + +如果需要应用级别的服务依赖等待,需要在 `entrypoint.sh` 这类脚本中,加入服务等待的部分。而且,也可以通过 `restart: always` 这种设置,让应用启动过程中,如果依赖服务尚未准备好,而报错退出后,有再一次尝试的机会。 + +此外,Docker 支持健康检查,在 docker-compose.yml `v2` 的格式下,可以要求依赖条件对方服务启动完成: + +```yaml + depends_on: + condition: service_healthy +``` + +进一步信息,请参考官网文档:https://docs.docker.com/compose/compose-file/compose-file-v2/#depends_on + +# 单机操作 + +## 启动 + +```bash +docker-compose up -d +``` + +*如果构建过程中,发现镜像下载极为缓慢、甚至失败。这是伟大的墙在捣乱。你需要去配置加速器,具体文章可以参看我的 [Docker 问答录](http://blog.lab99.org/post/docker-2016-07-14-faq.html#docker-pull-hao-man-a-zen-me-ban)。* + +如果修改了配置文件,可能需要明确重新构建,可以使用命令 `docker-compose build`。 + +## 查看服务状态 + +```bash +docker-compose ps +``` + +## 查看服务日志 + +```bash +docker-compose logs +``` + +## 访问服务 + +`nginx` 将会守候 `80` 端口, + +* 如果使用的 Linux 或者 `Docker for Mac`,可以直接在本机访问 +* 如果是使用 `Docker Toolbox` 的话,则应该使用虚拟机地址,如 ,具体虚拟机地址查询使用命令 `docker-machine ip default`。 +* 如果是自己安装的 Ubuntu、CentOS 类的虚拟机,直接进虚拟机查看地址。 + +如果访问后,看到了 `成功连接 MySQL 服务器` 就说明数据库连接正常。 + + + +## 停止服务 + +```bash +docker-compose down +``` + +# Swarm 集群编排 + +在单机环境中使用容器,可能经常会用到绑定宿主目录的情况,这在开发时很方便。但是在集群环境中部署应用的时候,挂载宿主目录就变得非常不方便了。 + +在集群环境中,Swarm 可能会调度容器运行于任何一台主机上,如果一个主机失败后,可能还会再次调度到别的主机上,确保服务可以继续。在这种情况下,如果使用绑定宿主目录的形式,就必须同时在所有主机上的相同位置,事先准备好其内容,并且要保持同步。这并不是一个好的解决方案。 + +因此为了在集群环境中部署方便,比较好的做法是,将应用代码、配置文件等直接放入镜像。就如同这个例子中我们看到的 `nginx`、`php` 服务的镜像一样,在使用 `Dockerfile` 定制的过程中,将配置和应用代码放入镜像。 + +`nginx` 的服务镜像 `Dockerfile` + +```Dockerfile +... +COPY ./nginx.conf /etc/nginx/conf.d/default.conf +COPY ./site /usr/share/nginx/html +``` + +`php` 的服务镜像 `Dockerfile` + +```Dockerfile +... +COPY ./php.conf /usr/local/etc/php/conf.d/php.conf +COPY ./site /usr/share/nginx/html +``` + +Docker Swarm 目前分为两代。第一代是以容器形式运行,被称为 Docker Swarm;而第二代是自 `1.12` 以后以 `SwarmKit` 为基础集成进 `docker` 的 Swarm,被称为 Docker Swarm Mode。 + +## 一代 Swarm + +[一代 Swarm](https://docs.docker.com/swarm/) 是 Docker 团队最早的集群编排的尝试,以容器形式运行,需要外置键值库(如 etcd, consul, zookeeper),需要手动配置 `overlay` 网络。其配置比 `kubernetes` 要简单,但是相比后面的第二代来说还是稍显复杂。 + +这里提供了一个脚本,`run1.sh`,用于建立一代 Swarm,以及启动服务、横向扩展。 + +### 建立 swarm 集群 + +在安装有 `docker-machine` 以及 VirtualBox 的虚拟机上(比如装有 Docker Toolbox 的Mac/Windows),使用 `run1.sh` 脚本即可创建集群: + +```bash +./run1.sh create +``` + +### 启动 + +```bash +./run1.sh up +``` + +### 横向扩展 + +```bash +./run1.sh scale 3 5 +``` + +这里第一个参数是 nginx 容器的数量,第二个参数是 php 容器的数量。 + +### 访问服务 + +`nginx` 将会守候 80 端口。利用 `docker ps` 可以查看具体集群哪个节点在跑 nginx 以及 IP 地址。如 + +```bash +$ eval $(./run1.sh env) +$ docker ps +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +d85a2c26dd7d twang2218/lnmp-php:v1.2 "php-fpm" 9 minutes ago Up 9 minutes 9000/tcp node1/dockerlnmp_php_5 +c81e169c164d twang2218/lnmp-php:v1.2 "php-fpm" 9 minutes ago Up 9 minutes 9000/tcp node1/dockerlnmp_php_2 +b43de77c9340 twang2218/lnmp-php:v1.2 "php-fpm" 9 minutes ago Up 9 minutes 9000/tcp master/dockerlnmp_php_4 +fdcb718b6183 twang2218/lnmp-php:v1.2 "php-fpm" 9 minutes ago Up 9 minutes 9000/tcp node3/dockerlnmp_php_3 +764b10b17dc4 twang2218/lnmp-nginx:v1.2 "nginx -g 'daemon off" 9 minutes ago Up 9 minutes 192.168.99.104:80->80/tcp, 443/tcp master/dockerlnmp_nginx_3 +e92b34f998bf twang2218/lnmp-nginx:v1.2 "nginx -g 'daemon off" 9 minutes ago Up 9 minutes 192.168.99.106:80->80/tcp, 443/tcp node2/dockerlnmp_nginx_2 +077ee73c8148 twang2218/lnmp-nginx:v1.2 "nginx -g 'daemon off" 22 minutes ago Up 22 minutes 192.168.99.105:80->80/tcp, 443/tcp node3/dockerlnmp_nginx_1 +1931249a66c1 e8920543aee8 "php-fpm" 22 minutes ago Up 22 minutes 9000/tcp node2/dockerlnmp_php_1 +cf71bca309dd mysql:5.7 "docker-entrypoint.sh" 22 minutes ago Up 22 minutes 3306/tcp node1/dockerlnmp_mysql_1 +``` + +如这种情况,就可以使用 , , 来访问服务。 + +### 停止服务 + +```bash +./run1.sh down +``` + +### 销毁集群 + +```bash +./run1.sh remove +``` + +## 二代 Swarm (Swarm Mode) + +[二代 Swarm](https://docs.docker.com/engine/swarm/),既 Docker Swarm Mode,是自 1.12 之后引入的原生的 Docker 集群编排机制。吸取一代 Swarm 的问题,大幅改变了架构,并且大大简化了集群构建。内置了分布式数据库,不在需要配置外置键值库;内置了内核级负载均衡;内置了边界负载均衡。 + +和一代 Swarm 的例子一样,为了方便说明,这里提供了一个 `run2.sh` 来帮助建立集群、运行服务。 + +### 建立 swarm 集群 + +在安装有 `docker-machine` 以及 VirtualBox 的虚拟机上(比如装有 Docker Toolbox 的Mac/Windows),使用 `run2.sh` 脚本即可创建集群: + +```bash +./run2.sh create +``` + +*使用 Digital Ocean, AWS之类的云服务的话,就没必要本地使用 VirtualBox,不过需要事先配置好对应的 `docker-machine` 所需的环境变量。* + +### 启动 + +```bash +./run2.sh up +``` + +### 横向扩展 + +```bash +./run2.sh scale 10 5 +``` + +这里第一个参数是 nginx 容器的数量,第二个参数是 php 容器的数量。 + +### 列出服务状态 + +我们可以使用标准的命令列出所有服务以及状态: + +```bash +$ docker service ls +ID NAME REPLICAS IMAGE COMMAND +2lnqjas6rov4 mysql 1/1 mysql:5.7 mysqld --character-set-server=utf8 +ahqktnscjlkl php 5/5 twang2218/lnmp-php:v1.2 +bhoodda99ebt nginx 10/10 twang2218/lnmp-nginx:v1.2 +``` + +我们也可以通过下面的命令列出具体的每个服务对应的每个容器状态: + +```bash +$ ./run2.sh ps ++ docker service ps -f desired-state=running nginx +ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR +87xr5oa577hl9amelznpy7s7z nginx.1 twang2218/lnmp-nginx:v1.2 node2 Running Running 3 hours ago +7dwmc22qaftz0xrvijij9dnuw nginx.2 twang2218/lnmp-nginx:v1.2 node3 Running Running 22 minutes ago +00rus0xed3y851pcwkbybop80 nginx.3 twang2218/lnmp-nginx:v1.2 manager Running Running 22 minutes ago +5ypct2dnfu6ducnokdlk82dne nginx.4 twang2218/lnmp-nginx:v1.2 manager Running Running 22 minutes ago +7qshykjq8cqju0zt6yb9dkktq nginx.5 twang2218/lnmp-nginx:v1.2 node2 Running Running 22 minutes ago +e2cux4vj2femrb3wc33cvm70n nginx.6 twang2218/lnmp-nginx:v1.2 node1 Running Running 22 minutes ago +9uwbn5tm49k7vxesucym4plct nginx.7 twang2218/lnmp-nginx:v1.2 node1 Running Running 22 minutes ago +6d8v5asrqwnz03hvm2jh96rq3 nginx.8 twang2218/lnmp-nginx:v1.2 node1 Running Running 22 minutes ago +eh44qdsiv7wq8jbwh2sr30ada nginx.9 twang2218/lnmp-nginx:v1.2 node3 Running Running 22 minutes ago +51l7nirwtv4gxnzbhkx6juvko nginx.10 twang2218/lnmp-nginx:v1.2 node2 Running Running 22 minutes ago ++ docker service ps -f desired-state=running php +ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR +4o3pqdva92vjdbfygdn0agp32 php.1 twang2218/lnmp-php:v1.2 manager Running Running 3 hours ago +bf3d6g4rr8cax4wucu9lixgmh php.2 twang2218/lnmp-php:v1.2 node3 Running Running 22 minutes ago +9xq9ozbpea7evllttvyxk7qtf php.3 twang2218/lnmp-php:v1.2 manager Running Running 22 minutes ago +8umths3p8rqib0max6b6wiszv php.4 twang2218/lnmp-php:v1.2 node2 Running Running 22 minutes ago +0fxe0i1n2sp9nlvfgu4xlc0fx php.5 twang2218/lnmp-php:v1.2 node1 Running Running 22 minutes ago ++ docker service ps -f desired-state=running mysql +ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR +3ozjwfgwfcq89mu7tqzi1hqeu mysql.1 mysql:5.7 node3 Running Running 3 hours ago +``` + +### 访问服务 + +`nginx` 将会守候 80 端口,由于二代 Swarm 具有边界负载均衡 (Routing Mesh, Ingress Load balance),因此,集群内所有节点都会守护 80 端口,无论是 Manager 还是 Worker,无论是否有 `nginx` 容器在其上运行。当某个节点接到 80 端口服务请求后,会自动根据容器所在位置,利用 overlay 网络将请求转发过去。因此,访问任意节点的 80 端口都应该可以看到服务。 + +通过下面的命令可以列出所有节点,访问其中任意地址都应该可以看到应用页面: + +```bash +$ ./run2.sh nodes +manager http://192.168.99.101 +node1 http://192.168.99.103 +node2 http://192.168.99.102 +node3 http://192.168.99.104 +``` + +### 停止服务 + +```bash +./run2.sh down +``` + +### 销毁集群 + +```bash +./run2.sh remove +``` + +sudo curl -sSL https://get.daocloud.io/docker | sh + + +安装 docker compose,资料:[install-compose](https://docs.docker.com/compose/install/#install-compose) + +``` + sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose + chmod +x /usr/local/bin/docker-compose) + + +## 4.管理命令 +### 4.1 服务器启动和构建命令 +如需管理服务,请在命令后面加上服务器名称,例如: +```bash +$ docker-compose up # 创建并且启动所有容器 +$ docker-compose up -d # 创建并且后台运行方式启动所有容器 +$ docker-compose up nginx php mysql # 创建并且启动nginx、php、mysql的多个容器 +$ docker-compose up -d nginx php mysql # 创建并且已后台运行的方式启动nginx、php、mysql容器 + + +$ docker-compose start php # 启动服务 +$ docker-compose stop php # 停止服务 +$ docker-compose restart php # 重启服务 +$ docker-compose build php # 构建或者重新构建服务 + +$ docker-compose rm php # 删除并且停止php容器 +$ docker-compose down # 停止并删除容器,网络,图像和挂载卷 +``` + + +Mongodb 与 adminmongo +mongodb 映射到`27017`端口 +``` +可以通过账号密码登录 +mongo --port 27017 -u 账号 -p 密码 +如果不知道密码 +你使用超级管理员账号 +use admin + +创建用户密码 +db.createUser({user: "账号",pwd: "密码",roles: [{role: "userAdminAnyDatabase", db: "admin" }]}) #对某个数据库的进行授权. + +修改数据库密码: +db.changeUserPassword("账号","密码"); + +show dbs 查看数据库 +use dbname 进入数据库 +show users 查看当前数据库用户权限 + +``` +adminmongo 端口为:`1234` 链接为: +``` +http://localhost:1234 可以登录里面查看mongodb的信息 +登录的时候需要验证链接和密码 +一般数据为: +mongodb://账号:密码@IP:27017/admin(数据库) +``` + +-mysql 設定遠端連線 +- 進入 docker mysql 容器:winpty docker exec -it mysql-57 bash +- 登入 mysql:mysql -h 127.0.0.1 -u root -p +- 給予 mysql 登入權限:GRANT ALL PRIVILGEGS ON *.* TO 'root'@'%'; +- 更新權限:FLUSH PRIVILGEGS; + +```DOCKERFILE +FROM php:7.2-fpm +ENV TZ=Asia/Taipei +RUN apt-get update \ + && apt-get install -y \ + cron \ + openssl \ + libfreetype6-dev \ + libicu-dev \ + libjpeg62-turbo-dev \ + libpng-dev \ + redis \ + git +RUN pecl install redis +RUN docker-php-ext-install \ + gd \ + mbstring \ + pdo \ + pdo_mysql +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +``` + + +[mysqld] +user = root +datadir = /data/mysql +port = 3306 +log-bin = /data/mysql/mysql-bin + + +; 更多配置项可见:http://php.net/manual/zh/ini.list.php + +memory_limit = 512M +post_max_size = 1024M +upload_max_filesize = 1024M + +url -sS https://getcomposer.org/installer |php7 + + +#去掉ip绑定限制 +sed -i -e "s/listen\s*=\s*127.0.0.1:9000/listen = 9000/g" /etc/php5/php-fpm.conf + +# extends +pecl install swoole +pecl install libevent + +addgroup -S topone4tvs && adduser -S -G topone4tvs topone4tvs +chown -R topone4tvs:topone4tvs /var/www/ + +apk add openssh +ssh-keygen -t rsa -b 2048 -f /etc/ssh/ssh_host_rsa_key +sed -i -e "s/#HostKey \/etc\/ssh\/ssh_host_rsa_key/HostKey \/etc\/ssh\/ssh_host_rsa_key/g" /etc/ssh/sshd_config +ssh-keygen -t rsa +touch ~/.ssh/authorized_keys + + +/usr/local/etc/php/conf.d +echo "extension=apcu.so" > /usr/local/etc/php/conf.d/apcu.ini +echo "extension=ev.so" > /usr/local/etc/php/conf.d/z-ev.ini + +cp /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini + +sed -i 's/extension_dir/;extension_dir/g' /usr/local/etc/php/php.ini +sed -i 's/;extension_dir\ =\ ".\/"/extension_dir\ =\ "\/usr\/local\/lib\/php\/extensions\/no-debug-non-zts-20190902\/"/g' /usr/local/etc/php/php.ini +sed -i 's/;extension_dir\ =\ ".\/"/extension_dir\ =\ "\/usr\/local\/lib\/php\/extensions\/no-debug-non-zts-20190902\/"/g' /usr/local/etc/php/php.ini + +/usr/local/lib/php/extensions/no-debug-non-zts-20190902/ +/usr/local/etc/php + +gnu-libiconv-dev +imap-dev +icu-dev +libzip-dev + +kldap-dev +openldap-dev + +# Install composer +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer \ + && chmod 755 /usr/bin/composer + +# Install additional PHP libraries +RUN docker-php-ext-install bcmath pdo_mysql + +# Install libraries for compiling GD, then build it +RUN apk add --no-cache freetype libpng libjpeg-turbo freetype-dev libpng-dev libjpeg-turbo-dev \ + && docker-php-ext-install gd \ + && apk del --no-cache freetype-dev libpng-dev libjpeg-turbo-dev + +# Add ZIP archives support +RUN apk add --update --no-cache zlib-dev libzip-dev \ + && docker-php-ext-install zip + + # Install tools required for build stage +RUN apk add --update --no-cache \ + bash curl wget rsync ca-certificates openssl openssh git tzdata openntpd \ + libxrender fontconfig libc6-compat \ + mysql-client gnupg binutils-gold autoconf \ + g++ gcc gnupg libgcc linux-headers make python + + + +# Install xdebug +RUN pecl install xdebug \ + && docker-php-ext-enable xdebug + +# Enable XDebug +ADD xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini + +https://dl.dropbox.com/u/5721940/vagrant-boxes/vagrant-centos-6.4-x86_64-vmware_fusion.box +http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box + + +## 目录注释 +- 一般有 ~/ /usr /usr/local 三个位置存放安装文件 +- ~/.config/xfce4/panel/launcher-* xfce panel- 的启动器图标 类似桌面的快捷方式 +- ~/.local/share/applications +- /usr/local/share/applications +- /usr/share/applications +- /usr/local/share/fonts +- /usr/share/fonts +- ~/.local/share/icons +- /usr/local/share/icons +- /usr/share/icons + + +## TODO +- fix PATH +- https://github.com/elementary + +https://flathub.org/repo/ +https://dl.flathub.org/repo/appstream/ +https://flathub.org/repo/appstream/ +https://flathub.org/beta-repo/appstream/org.gimp.GIMP.flatpakref +https://nightly.gnome.org/repo/appstream/org.gimp.GIMP.flatpakref + +https://rpmfusion.org/ + +fastly.cdn.snapcraft.io +darkbowser.canonical.com +canonical-bos01.cdn.snapcraft.io + +https://api.snapcraft.io/api/v1/snaps/download/99T7MUlRhtI3U0QFgl5mXXESAiSwt776_11993.snap + + +## TODO +- 考虑将常用程序写在脚本内 使用时一键安装 +- anbox 找一个替代品 +- uengine + +## Feature +- Web Server + - [Nginx](https://github.com/nginx/nginx) + - [OpenRestry](https://github.com/openresty/openresty) + -[Tengine](https://github.com/alibaba/tengine) +- golang +- nodejs +- python +- ruby +- rust +- dotnet +- code-server (VSCode Web Version) + + +## Sound +``` +#set ALSA sound to HDMI output +sudo amixer cset numid=3 2 +sudo amixer cset numid=1 100% + +# run applications in the background + +echo "starting pulseaudio ..." +sudo pulseaudio --system --high-priority --no-cpu-limit -v -L 'module-alsa-sink device=plughw:0,1' >/dev/null 2>&1 & + + +## Chrome +if [ -z "$ALSADEV" ]; then + zenity --error --text "To support audio, please read README.md and run container with --device /dev/snd -e ALSADEV=..." + exit 1 +fi + +exec /usr/bin/google-chrome --no-sandbox --alsa-output-device="$ALSADEV" "$@" + +``` diff --git a/docs/vhost.md b/docs/vhost.md new file mode 100644 index 00000000..3f0f9b8b --- /dev/null +++ b/docs/vhost.md @@ -0,0 +1,51 @@ +# Nginx 配置虚拟主机 + + +## 添加域名映射 + +宿主机 /etc/hosts 文件中添加域名映射,配置如下: +``` +127.0.0.1 laravel.local +``` + + +## 添加 server 配置 + +目录 docker-lnmp/nginx/sites 下新增 laravel.conf 文件,配置如下: +``` +server { + + listen 80; + + server_name laravel.local; + root /var/www/laravel/public; + + index index.php index.html index.htm; + + location / { + try_files $uri $uri/ /index.php?$query_string; + + if (!-d $request_filename) { + rewrite ^/(.+)/$ /$1 permanent; + } + + if (!-e $request_filename) { + rewrite ^/(.*)$ /index.php?/$1 last; + break; + } + } + + location ~ \.php$ { + fastcgi_pass php-fpm:9000; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + } + +} +``` + + +## 3. 重启服务 + +参照基本命令。 diff --git a/images/acme/latest/Dockerfile b/images/acme/latest/Dockerfile new file mode 100644 index 00000000..57189be6 --- /dev/null +++ b/images/acme/latest/Dockerfile @@ -0,0 +1,9 @@ +FROM ghcr.io/dockenv/alpine:latest + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +RUN apk add --no-cache acme.sh + +CMD ["/bin/ash"] diff --git a/images/aerospike/ce-5.3/Dockerfile b/images/aerospike/ce-5.3/Dockerfile new file mode 100644 index 00000000..6ea084f2 --- /dev/null +++ b/images/aerospike/ce-5.3/Dockerfile @@ -0,0 +1,9 @@ +FROM aerospike:ce-5.3.0.16 +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +EXPOSE 3000 3001 3002 + +ENTRYPOINT ["/usr/bin/dumb-init", "--", "/entrypoint.sh"] + +CMD ["asd"] diff --git a/images/aerospike/ce-5.4/Dockerfile b/images/aerospike/ce-5.4/Dockerfile new file mode 100644 index 00000000..e3b828b9 --- /dev/null +++ b/images/aerospike/ce-5.4/Dockerfile @@ -0,0 +1,9 @@ +FROM aerospike:ce-5.4.0.11 +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +EXPOSE 3000 3001 3002 + +ENTRYPOINT ["/usr/bin/dumb-init", "--", "/entrypoint.sh"] + +CMD ["asd"] diff --git a/images/aerospike/ce-5.5/Dockerfile b/images/aerospike/ce-5.5/Dockerfile new file mode 100644 index 00000000..99b6704d --- /dev/null +++ b/images/aerospike/ce-5.5/Dockerfile @@ -0,0 +1,9 @@ +FROM aerospike:ce-5.5.0.9 +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +EXPOSE 3000 3001 3002 + +ENTRYPOINT ["/usr/bin/dumb-init", "--", "/entrypoint.sh"] + +CMD ["asd"] diff --git a/images/aerospike/ce-5.6/Dockerfile b/images/aerospike/ce-5.6/Dockerfile new file mode 100644 index 00000000..a55c2a16 --- /dev/null +++ b/images/aerospike/ce-5.6/Dockerfile @@ -0,0 +1,9 @@ +FROM aerospike:ce-5.6.0.13 +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +EXPOSE 3000 3001 3002 + +ENTRYPOINT ["/usr/bin/dumb-init", "--", "/entrypoint.sh"] + +CMD ["asd"] diff --git a/images/aerospike/ce-5.7/Dockerfile b/images/aerospike/ce-5.7/Dockerfile new file mode 100644 index 00000000..507becba --- /dev/null +++ b/images/aerospike/ce-5.7/Dockerfile @@ -0,0 +1,9 @@ +FROM aerospike:ce-5.7.0.8 +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +EXPOSE 3000 3001 3002 + +ENTRYPOINT ["/usr/bin/dumb-init", "--", "/entrypoint.sh"] + +CMD ["asd"] diff --git a/images/aerospike/ee-5.3/Dockerfile b/images/aerospike/ee-5.3/Dockerfile new file mode 100644 index 00000000..21ba8ef8 --- /dev/null +++ b/images/aerospike/ee-5.3/Dockerfile @@ -0,0 +1,9 @@ +FROM aerospike:ee-5.3.0.16 +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +EXPOSE 3000 3001 3002 + +ENTRYPOINT ["/usr/bin/dumb-init", "--", "/entrypoint.sh"] + +CMD ["asd"] diff --git a/images/aerospike/ee-5.4/Dockerfile b/images/aerospike/ee-5.4/Dockerfile new file mode 100644 index 00000000..2657799b --- /dev/null +++ b/images/aerospike/ee-5.4/Dockerfile @@ -0,0 +1,9 @@ +FROM aerospike:ee-5.4.0.11 +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +EXPOSE 3000 3001 3002 + +ENTRYPOINT ["/usr/bin/dumb-init", "--", "/entrypoint.sh"] + +CMD ["asd"] diff --git a/images/aerospike/ee-5.5/Dockerfile b/images/aerospike/ee-5.5/Dockerfile new file mode 100644 index 00000000..2e97061e --- /dev/null +++ b/images/aerospike/ee-5.5/Dockerfile @@ -0,0 +1,9 @@ +FROM aerospike:ee-5.5.0.9 +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +EXPOSE 3000 3001 3002 + +ENTRYPOINT ["/usr/bin/dumb-init", "--", "/entrypoint.sh"] + +CMD ["asd"] diff --git a/images/aerospike/ee-5.6/Dockerfile b/images/aerospike/ee-5.6/Dockerfile new file mode 100644 index 00000000..512d1e33 --- /dev/null +++ b/images/aerospike/ee-5.6/Dockerfile @@ -0,0 +1,9 @@ +FROM aerospike:ee-5.6.0.13 +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +EXPOSE 3000 3001 3002 + +ENTRYPOINT ["/usr/bin/dumb-init", "--", "/entrypoint.sh"] + +CMD ["asd"] diff --git a/images/aerospike/ee-5.7/Dockerfile b/images/aerospike/ee-5.7/Dockerfile new file mode 100644 index 00000000..ebc79be3 --- /dev/null +++ b/images/aerospike/ee-5.7/Dockerfile @@ -0,0 +1,9 @@ +FROM aerospike:ee-5.7.0.8 +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +EXPOSE 3000 3001 3002 + +ENTRYPOINT ["/usr/bin/dumb-init", "--", "/entrypoint.sh"] + +CMD ["asd"] diff --git a/images/aerospike/latest/Dockerfile b/images/aerospike/latest/Dockerfile new file mode 100644 index 00000000..4f913c49 --- /dev/null +++ b/images/aerospike/latest/Dockerfile @@ -0,0 +1,12 @@ +FROM aerospike:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +# COPY aerospike.conf /etc/aerospike/aerospike.conf + +EXPOSE 3000 3001 3002 + +ENTRYPOINT ["/usr/bin/dumb-init", "--", "/entrypoint.sh"] + +CMD ["asd"] diff --git a/images/aerospike/latest/aerospike.conf b/images/aerospike/latest/aerospike.conf new file mode 100644 index 00000000..5e577759 --- /dev/null +++ b/images/aerospike/latest/aerospike.conf @@ -0,0 +1,77 @@ +# Aerospike database configuration file. + +# This stanza must come first. +service { + user root + group root + paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1. + pidfile /var/run/aerospike/asd.pid + service-threads 4 + transaction-queues 4 + transaction-threads-per-queue 4 + proto-fd-max 15000 +} + +logging { + + # Log file must be an absolute path. + file /var/log/aerospike/aerospike.log { + context any info + } + + # Send log messages to stdout + console { + context any critical + } +} + +network { + service { + address any + port 3000 + + # Uncomment the following to set the `access-address` parameter to the + # IP address of the Docker host. This will the allow the server to correctly + # publish the address which applications and other nodes in the cluster to + # use when addressing this node. + # access-address + } + + heartbeat { + + # mesh is used for environments that do not support multicast + mode mesh + port 3002 + + # use asinfo -v 'tip:host=;port=3002' to inform cluster of + # other mesh nodes + mesh-port 3002 + + interval 150 + timeout 10 + } + + fabric { + port 3001 + } + + info { + port 3003 + } +} + +namespace test { + replication-factor 2 + memory-size 1G + default-ttl 5d # 5 days, use 0 to never expire/evict. + + # storage-engine memory + + # To use file storage backing, comment out the line above and use the + # following lines instead. + storage-engine device { + file /opt/aerospike/data/test.dat + filesize 4G + data-in-memory true # Store data in memory in addition to file. + } +} diff --git a/images/alinux/2/Dockerfile b/images/alinux/2/Dockerfile new file mode 100644 index 00000000..b964aadc --- /dev/null +++ b/images/alinux/2/Dockerfile @@ -0,0 +1,5 @@ +FROM alibaba-cloud-linux-2-registry.cn-hangzhou.cr.aliyuncs.com/alinux2/alinux2:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +CMD [ "bash" ] diff --git a/images/alinux/3/Dockerfile b/images/alinux/3/Dockerfile new file mode 100644 index 00000000..6cff2b28 --- /dev/null +++ b/images/alinux/3/Dockerfile @@ -0,0 +1,5 @@ +FROM alibaba-cloud-linux-3-registry.cn-hangzhou.cr.aliyuncs.com/alinux3/alinux3:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +CMD [ "bash" ] diff --git a/images/alinux/latest/Dockerfile b/images/alinux/latest/Dockerfile new file mode 100644 index 00000000..6cff2b28 --- /dev/null +++ b/images/alinux/latest/Dockerfile @@ -0,0 +1,5 @@ +FROM alibaba-cloud-linux-3-registry.cn-hangzhou.cr.aliyuncs.com/alinux3/alinux3:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +CMD [ "bash" ] diff --git a/images/almalinux/8.4/Dockerfile b/images/almalinux/8.4/Dockerfile new file mode 100644 index 00000000..3be95444 --- /dev/null +++ b/images/almalinux/8.4/Dockerfile @@ -0,0 +1,5 @@ +FROM almalinux:8.4 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +CMD [ "/bash" ] diff --git a/images/almalinux/latest/Dockerfile b/images/almalinux/latest/Dockerfile new file mode 100644 index 00000000..50a7557b --- /dev/null +++ b/images/almalinux/latest/Dockerfile @@ -0,0 +1,5 @@ +FROM almalinux:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +CMD [ "/bash" ] diff --git a/images/alpine/3.10/Dockerfile b/images/alpine/3.10/Dockerfile new file mode 100644 index 00000000..58197c14 --- /dev/null +++ b/images/alpine/3.10/Dockerfile @@ -0,0 +1,7 @@ +FROM alpine:3.10 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +RUN sed -i 's/dl-cdn.alpinelinux.org/repo.huaweicloud.com/g' /etc/apk/repositories + +CMD [ "/bin/sh" ] diff --git a/images/alpine/3.11/Dockerfile b/images/alpine/3.11/Dockerfile new file mode 100644 index 00000000..f1ce657f --- /dev/null +++ b/images/alpine/3.11/Dockerfile @@ -0,0 +1,7 @@ +FROM alpine:3.11 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +RUN sed -i 's/dl-cdn.alpinelinux.org/repo.huaweicloud.com/g' /etc/apk/repositories + +CMD [ "/bin/sh" ] diff --git a/images/alpine/3.12/Dockerfile b/images/alpine/3.12/Dockerfile new file mode 100644 index 00000000..945d5480 --- /dev/null +++ b/images/alpine/3.12/Dockerfile @@ -0,0 +1,7 @@ +FROM alpine:3.12 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +RUN sed -i 's/dl-cdn.alpinelinux.org/repo.huaweicloud.com/g' /etc/apk/repositories + +CMD [ "/bin/sh" ] diff --git a/images/alpine/3.13/Dockerfile b/images/alpine/3.13/Dockerfile new file mode 100644 index 00000000..fc4e81d6 --- /dev/null +++ b/images/alpine/3.13/Dockerfile @@ -0,0 +1,7 @@ +FROM alpine:3.13 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +RUN sed -i 's/dl-cdn.alpinelinux.org/repo.huaweicloud.com/g' /etc/apk/repositories + +CMD [ "/bin/sh" ] diff --git a/images/alpine/3.14/Dockerfile b/images/alpine/3.14/Dockerfile new file mode 100644 index 00000000..dab2455e --- /dev/null +++ b/images/alpine/3.14/Dockerfile @@ -0,0 +1,7 @@ +FROM alpine:3.14 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +RUN sed -i 's/dl-cdn.alpinelinux.org/repo.huaweicloud.com/g' /etc/apk/repositories + +CMD [ "/bin/sh" ] diff --git a/images/alpine/3.15/Dockerfile b/images/alpine/3.15/Dockerfile new file mode 100644 index 00000000..b805782a --- /dev/null +++ b/images/alpine/3.15/Dockerfile @@ -0,0 +1,8 @@ +FROM alpine:3.15 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +RUN sed -i 's/dl-cdn.alpinelinux.org/repo.huaweicloud.com/g' /etc/apk/repositories + +CMD [ "/bin/sh" ] diff --git a/images/alpine/3.16/Dockerfile b/images/alpine/3.16/Dockerfile new file mode 100644 index 00000000..933ba175 --- /dev/null +++ b/images/alpine/3.16/Dockerfile @@ -0,0 +1,8 @@ +FROM alpine:3.16 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +RUN sed -i 's/dl-cdn.alpinelinux.org/repo.huaweicloud.com/g' /etc/apk/repositories + +CMD [ "/bin/sh" ] diff --git a/images/alpine/3.17/Dockerfile b/images/alpine/3.17/Dockerfile new file mode 100644 index 00000000..8997e1c6 --- /dev/null +++ b/images/alpine/3.17/Dockerfile @@ -0,0 +1,8 @@ +FROM alpine:3.17 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +RUN sed -i 's/dl-cdn.alpinelinux.org/repo.huaweicloud.com/g' /etc/apk/repositories + +CMD [ "/bin/sh" ] diff --git a/images/alpine/3.7/Dockerfile b/images/alpine/3.7/Dockerfile new file mode 100644 index 00000000..1d0fcb4b --- /dev/null +++ b/images/alpine/3.7/Dockerfile @@ -0,0 +1,7 @@ +FROM alpine:3.7 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +RUN sed -i 's/dl-cdn.alpinelinux.org/repo.huaweicloud.com/g' /etc/apk/repositories + +CMD [ "/bin/sh" ] diff --git a/images/alpine/3.8/Dockerfile b/images/alpine/3.8/Dockerfile new file mode 100644 index 00000000..0c413c54 --- /dev/null +++ b/images/alpine/3.8/Dockerfile @@ -0,0 +1,7 @@ +FROM alpine:3.8 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +RUN sed -i 's/dl-cdn.alpinelinux.org/repo.huaweicloud.com/g' /etc/apk/repositories + +CMD [ "/bin/sh" ] diff --git a/images/alpine/3.9/Dockerfile b/images/alpine/3.9/Dockerfile new file mode 100644 index 00000000..d19a8433 --- /dev/null +++ b/images/alpine/3.9/Dockerfile @@ -0,0 +1,7 @@ +FROM alpine:3.9 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +RUN sed -i 's/dl-cdn.alpinelinux.org/repo.huaweicloud.com/g' /etc/apk/repositories + +CMD [ "/bin/sh" ] diff --git a/images/alpine/Dockerfile b/images/alpine/Dockerfile deleted file mode 100644 index 485c8876..00000000 --- a/images/alpine/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM alpine:edge -LABEL MAINTAINER="Cloudflying" \ - MAIL="" - -ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" -RUN echo "http://mirrors.aliyun.com/alpine/edge/main" >/etc/apk/repositories \ - && echo "http://mirrors.aliyun.com/alpine/edge/community" >>/etc/apk/repositories \ - && rm -fr /var/cache/apk/* \ - && rm -fr /tmp/* diff --git a/images/alpine/Dockerfile.dev b/images/alpine/Dockerfile.dev deleted file mode 100644 index 93e0bd26..00000000 --- a/images/alpine/Dockerfile.dev +++ /dev/null @@ -1,9 +0,0 @@ -FROM registry.cn-hongkong.aliyuncs.com/imxieke/alpine:latest -LABEL MAINTAINER="Cloudflying" \ - MAIL="oss@live.hk" - -RUN apk --no-cache add bash neovim git curl wget zsh \ - gcc g++ make cmake automake autoconf luajit-dev libc-dev pcre pcre-dev \ - readline-dev openssl openssl-dev musl musl-dev - -CMD /bin/bash \ No newline at end of file diff --git a/images/alpine/README.md b/images/alpine/README.md deleted file mode 100644 index 06a91a95..00000000 --- a/images/alpine/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Alpine Linux - -### how connect to container : -``` -docker run -d --name=alpine -p 22:22 registry.cn-hongkong.aliyuncs.com/imxieke/alpine:latest -ssh root@host -p 22 -password: alpine -``` diff --git a/images/alpine/dev/Dockerfile b/images/alpine/dev/Dockerfile new file mode 100644 index 00000000..8e13b4a3 --- /dev/null +++ b/images/alpine/dev/Dockerfile @@ -0,0 +1,8 @@ +FROM ghcr.io/dockenv/alpine:edge +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +RUN apk add --no-cache bash git jq procps bash-completion iputils + +CMD [ "/bin/sh" ] diff --git a/images/alpine/edge/Dockerfile b/images/alpine/edge/Dockerfile new file mode 100644 index 00000000..14453958 --- /dev/null +++ b/images/alpine/edge/Dockerfile @@ -0,0 +1,8 @@ +FROM alpine:edge +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +RUN sed -i 's/dl-cdn.alpinelinux.org/repo.huaweicloud.com/g' /etc/apk/repositories + +CMD [ "/bin/sh" ] diff --git a/images/alpine/latest/Dockerfile b/images/alpine/latest/Dockerfile new file mode 100644 index 00000000..3aafab22 --- /dev/null +++ b/images/alpine/latest/Dockerfile @@ -0,0 +1,8 @@ +FROM alpine:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +RUN sed -i 's/dl-cdn.alpinelinux.org/repo.huaweicloud.com/g' /etc/apk/repositories + +CMD [ "/bin/sh" ] diff --git a/images/altlinux/latest/Dockerfile b/images/altlinux/latest/Dockerfile new file mode 100644 index 00000000..dcb04b49 --- /dev/null +++ b/images/altlinux/latest/Dockerfile @@ -0,0 +1,6 @@ +FROM alt:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +CMD [ "/bin/bash" ] diff --git a/images/altlinux/p10/Dockerfile b/images/altlinux/p10/Dockerfile new file mode 100644 index 00000000..f96e0cc4 --- /dev/null +++ b/images/altlinux/p10/Dockerfile @@ -0,0 +1,6 @@ +FROM alt:p10 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +CMD [ "/bin/bash" ] diff --git a/images/altlinux/p8/Dockerfile b/images/altlinux/p8/Dockerfile new file mode 100644 index 00000000..fe48a258 --- /dev/null +++ b/images/altlinux/p8/Dockerfile @@ -0,0 +1,6 @@ +FROM alt:p8 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +CMD [ "/bin/bash" ] diff --git a/images/altlinux/p9/Dockerfile b/images/altlinux/p9/Dockerfile new file mode 100644 index 00000000..6323ee7e --- /dev/null +++ b/images/altlinux/p9/Dockerfile @@ -0,0 +1,6 @@ +FROM alt:p9 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +CMD [ "/bin/bash" ] diff --git a/images/altlinux/sisyphus/Dockerfile b/images/altlinux/sisyphus/Dockerfile new file mode 100644 index 00000000..68e11673 --- /dev/null +++ b/images/altlinux/sisyphus/Dockerfile @@ -0,0 +1,6 @@ +FROM alt:sisyphus +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +CMD [ "/bin/bash" ] diff --git a/images/amazonlinux/Dockerfile b/images/amazonlinux/Dockerfile deleted file mode 100644 index 0eed8b71..00000000 --- a/images/amazonlinux/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM amazonlinux:latest - -CMD ["/bin/bash"] \ No newline at end of file diff --git a/images/amazonlinux/latest/Dockerfile b/images/amazonlinux/latest/Dockerfile new file mode 100644 index 00000000..fe124a3e --- /dev/null +++ b/images/amazonlinux/latest/Dockerfile @@ -0,0 +1,7 @@ +FROM amazonlinux:latest + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +CMD ["/bin/bash"] diff --git a/images/android/latest/Dockerfile b/images/android/latest/Dockerfile new file mode 100644 index 00000000..facb0ef0 --- /dev/null +++ b/images/android/latest/Dockerfile @@ -0,0 +1,14 @@ +FROM daocloud.io/library/centos:7.2.1511 + +RUN yum install java-1.8.0-openjdk* zip unzip which -y &&\ + yum clean all &&\ + echo "export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.201.b09-2.el7_6.x86_64" >> /etc/profile &&\ + echo "export JRE_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.201.b09-2.el7_6.x86_64" >> /etc/profile &&\ + echo "export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib" >> /etc/profile &&\ + echo "export PATH=$PATH:$JAVA_HOME/bin" >> /etc/profile &&\ + curl -s "https://get.sdkman.io" | bash &&\ + echo 'source "/root/.sdkman/bin/sdkman-init.sh"' >> /etc/profile &&\ + source /etc/profile &&\ + sdk install gradle + +CMD ["/usr/sbin/init"] \ No newline at end of file diff --git a/images/archlinux-vnc/Dockerfile b/images/archlinux-vnc/Dockerfile deleted file mode 100644 index 120cbaf3..00000000 --- a/images/archlinux-vnc/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -FROM registry.cn-hongkong.aliyuncs.com/imxieke/archlinux:vncenv -LABEL MAINTAINER="Cloudflying" \ - MAIL="" -ENV HOME=/root -ENV AUTHORIZED_KEYS **None** \ - DISPLAY=:1 \ - TERM=xterm \ - VNC_PORT=5901 \ - NO_VNC_PORT=6901 \ - NO_VNC_HOME=$HOME/noVNC \ - VNC_COL_DEPTH=32 \ - VNC_RESOLUTION=1360x768 \ - VNC_PW=123456 \ - VNC_VIEW_ONLY=false - -WORKDIR /root - -ADD run.sh / - -RUN chmod +x /*.sh - -ADD conf/.xinitrc /root/.xinitrc -ADD conf/.ratpoisonrc /root/.ratpoisonrc -ADD conf/.xsession /root/.xsession -ADD conf/vnc/xstartup /root/.vnc/xstartup - -EXPOSE $VNC_PORT $NO_VNC_PORT 22 - -CMD /run.sh diff --git a/images/archlinux-vnc/conf/.ratpoisonrc b/images/archlinux-vnc/conf/.ratpoisonrc deleted file mode 100644 index d91a59a4..00000000 --- a/images/archlinux-vnc/conf/.ratpoisonrc +++ /dev/null @@ -1 +0,0 @@ -exec $XPROG diff --git a/images/archlinux-vnc/conf/.xinitrc b/images/archlinux-vnc/conf/.xinitrc deleted file mode 100644 index a8d4f092..00000000 --- a/images/archlinux-vnc/conf/.xinitrc +++ /dev/null @@ -1,6 +0,0 @@ -XAUTHORITY=$HOME/.Xauthority -export XAUTHORITY -LANG=en_US.UTF-8 -export LANG -echo $$ > /tmp/xsession.pid -. $HOME/.xsession \ No newline at end of file diff --git a/images/archlinux-vnc/conf/.xsession b/images/archlinux-vnc/conf/.xsession deleted file mode 100644 index 49451b17..00000000 --- a/images/archlinux-vnc/conf/.xsession +++ /dev/null @@ -1,3 +0,0 @@ -XKL_XMODMAP_DISABLE=1 -export XKL_XMODMAP_DISABLE -exec dbus-run-session mate-session \ No newline at end of file diff --git a/images/archlinux-vnc/conf/build.sh b/images/archlinux-vnc/conf/build.sh deleted file mode 100644 index cae08f7c..00000000 --- a/images/archlinux-vnc/conf/build.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -pacman -S --noconfirm --force xorg-server xorg-apps i3-wm zsh vim git wget net-tools bzip2 python python-pip python-numpy supervisor \ - xterm gettext -pip install websocket websocketproxy -echo '#!/bin/sh' > ${HOME}/.xinitrc -echo 'exec i3' >> ${HOME}/.xinitrc \ No newline at end of file diff --git a/images/archlinux-vnc/conf/vnc/xstartup b/images/archlinux-vnc/conf/vnc/xstartup deleted file mode 100644 index bab56dc7..00000000 --- a/images/archlinux-vnc/conf/vnc/xstartup +++ /dev/null @@ -1,11 +0,0 @@ -# The black/white grid as background doesn't suit my taste. -xsetroot -solid black & -# Ratpoison is compatible with xcompmgr! now you can have real transparency -#fire up ratpoison! -#exec /usr/bin/ratpoison -XAUTHORITY=$HOME/.Xauthority -export XAUTHORITY -LANG=en_US.UTF-8 -export LANG -echo $$ > /tmp/xsession.pid -. $HOME/.xsession \ No newline at end of file diff --git a/images/archlinux-vnc/run.sh b/images/archlinux-vnc/run.sh deleted file mode 100644 index 5f03fe55..00000000 --- a/images/archlinux-vnc/run.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -# start up supervisord, all daemons should launched by supervisord. -#/usr/bin/supervisord -c /root/supervisord.conf - -# Create System User -USER="arch" -PASS="archlinux" -useradd -d /home/$USER -m $USER -s /bin/bash -echo "$USER:$PASS" |chpasswd -echo "root:$PASS" | chpasswd -echo "$USER ALL=NOPASSWD: ALL" >>/etc/sudoers - -## change vnc password -echo -e "\n------------------ change VNC password ------------------" -# first entry is control, second is view (if only one is valid for both) -mkdir -p "$HOME/.vnc" -PASSWD_PATH="$HOME/.vnc/passwd" -if [[ $VNC_VIEW_ONLY == "true" ]]; then - echo "start VNC server in VIEW ONLY mode!" - #create random pw to prevent access - echo $(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 20) | vncpasswd -f > $PASSWD_PATH -fi - -echo "$VNC_PW" | vncpasswd -f >> $PASSWD_PATH -chmod 600 $PASSWD_PATH - -## start Desktop and vncserver, noVNC webclient -#$NO_VNC_HOME/utils/launch.sh --vnc $VNC_IP:$VNC_PORT --listen $NO_VNC_PORT & -vncserver -kill $DISPLAY || rm -rfv /tmp/.X*-lock /tmp/.X11-unix || echo "remove old vnc locks to be a reattachable container" -vncserver $DISPLAY -depth $VNC_COL_DEPTH -geometry $VNC_RESOLUTION -exec dbus-run-session startxfce4 - -VNC_IP=$(hostname -i) -# Print Log -echo "======================================================================" -echo -e "\n\n------------- VNC environment started -------------------------" -echo -e "\nVNCSERVER started on DISPLAY= $DISPLAY \n\t=> connect via VNC viewer with $VNC_IP:$VNC_PORT" -echo -e "\nnoVNC HTML client started:\n\t=> connect via http://$VNC_IP:$NO_VNC_PORT/?password=...\n" -echo "You can now connect to this container via SSH using: " -echo " ssh $USER@HOST -p port " -echo "Enter the $USER password '$PASS' when prompted " -echo "Please remember to change the above password as soon as possible! " -echo "======================================================================" -echo " Archlinux Xfce4 is Running " -echo "======================================================================" - -exec /usr/sbin/sshd -D diff --git a/images/archlinux-vnc/supervisord.conf b/images/archlinux-vnc/supervisord.conf deleted file mode 100644 index 015a0549..00000000 --- a/images/archlinux-vnc/supervisord.conf +++ /dev/null @@ -1,54 +0,0 @@ -[supervisord] -nodaemon=false - -[program:ssh] -priority=10 -directory=/ -command=/usr/sbin/sshd -D -user=root -autostart=true -autorestart=true -stopsignal=QUIT - -[program:startxfce4] -priority=10 -directory=/root -command=/usr/bin/startxfce4 -d -user=root -autostart=true -autorestart=true -stopsignal=QUIT -environment=DISPLAY=":1",HOME="/root" -stdout_logfile=/var/log/xfce4.log -stderr_logfile=/var/log/xfce4.err - -[program:chrome] -environment=HOME="/root",DISPLAY=":1",USER="root" -command=/opt/google/chrome/chrome --user-data-dir=/root --window-position=0,0 --window-size=1366,748 --force-device-scale-factor=1 --no-default-browser-check --no-first-run --disable-translate -user=root -autorestart=true -priority=200 - -[program:xvfb] -priority=10 -directory=/ -command=/usr/bin/Xvfb :1 -screen 0 1366x768x16 -user=root -autostart=true -autorestart=true -stopsignal=QUIT -stdout_logfile=/var/log/xvfb.log -stderr_logfile=/var/log/xvfb.err - -[program:x11vnc] -priority=10 -directory=/ -command=x11vnc -display :1 -xkb -#command=x11vnc -display :1 -listen localhost -xkb -user=root -autostart=true -autorestart=true -stopsignal=QUIT -stdout_logfile=/var/log/x11vnc.log -stderr_logfile=/var/log/x11vnc.err - diff --git a/images/archlinux/Dockerfile b/images/archlinux/Dockerfile deleted file mode 100644 index bcefca39..00000000 --- a/images/archlinux/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM imxieke/archlinux:base -LABEL MAINTAINER="Cloudflying" \ - MAIL="" - -# RUN pacman -Syyu --force --noconfirm \ - # && pacman -Scc --noconfirm \ - # && rm -fr /var/cache/pacman/pkg/* \ - # && rm -fr /var/lib/pacman/* - -CMD /bin/bash \ No newline at end of file diff --git a/images/archlinux/Dockerfile.base b/images/archlinux/Dockerfile.base deleted file mode 100755 index 48c762e9..00000000 --- a/images/archlinux/Dockerfile.base +++ /dev/null @@ -1,26 +0,0 @@ -FROM scratch -LABEL MAINTAINER="Cloudflying" \ - MAIL="" - -ADD arch.tar / - -ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" \ - LANG='en_US.UTF-8' \ - LANGUAGE='en_US:en' \ - LC_TIME='en_US.UTF-8' \ - LC_PAPER='en_US.UTF-8' \ - LC_MEASUREMENT='en_US.UTF-8' \ - TZ='Asia/Shanghai' - -RUN echo "Server = https://mirrors.ustc.edu.cn/archlinux/\$repo/os/\$arch" > /etc/pacman.d/mirrorlist \ - && rm -fr /etc/localtime \ - && ln --symbolic "/usr/share/zoneinfo/${TZ}" /etc/localtime \ - && echo "Asia/Shanghai" > /etc/timezone \ - && pacman-key --init \ - && pacman-key --populate archlinux \ - && pacman -Syyu --noconfirm \ - && pacman -Scc --noconfirm \ - && rm -fr /var/cache/pacman/pkg/* \ - && rm -fr /var/lib/pacman/* - -CMD /bin/bash \ No newline at end of file diff --git a/images/archlinux/Dockerfile.dev b/images/archlinux/Dockerfile.dev deleted file mode 100644 index 03589a96..00000000 --- a/images/archlinux/Dockerfile.dev +++ /dev/null @@ -1,11 +0,0 @@ -FROM registry.cn-hongkong.aliyuncs.com/imxieke/archlinux:latest -LABEL MAINTAINER="Cloudflying" \ - MAIL="" - -RUN pacman -Syyu --noconfirm \ - && pacman -S --noconfirm --force gcc make cmake neovim git \ - && rm -fr /var/cache/pacman/pkg/* \ - && pacman -Scc --noconfirm \ - && rm -fr /var/lib/pacman/* - -CMD /bin/bash diff --git a/images/archlinux/Dockerfile.vncenv b/images/archlinux/Dockerfile.vncenv deleted file mode 100644 index a2c40a9e..00000000 --- a/images/archlinux/Dockerfile.vncenv +++ /dev/null @@ -1,18 +0,0 @@ -FROM registry.cn-hongkong.aliyuncs.com/imxieke/archlinux:latest -LABEL MAINTAINER="Cloudflying" \ - MAIL="" - -RUN pacman --noconfirm --force -Syy \ - && pacman -S --noconfirm --force archlinux-keyring \ - && pacman -S --noconfirm --force openssh sudo supervisor xorg xfce4 x11vnc xterm \ - xorg-twm xorg-xclock expect ratpoison ttf-droid ttf-dejavu \ - && rm -fr /var/cache/pacman/pkg/* \ - && pacman -Scc --noconfirm \ - && rm -fr /var/lib/pacman/* \ - && mkdir -p /var/run/sshd \ - && mkdir -p /root/.vnc \ - && sed -i "s/UsePrivilegeSeparation.*/UsePrivilegeSeparation no/g" /etc/ssh/sshd_config \ - && sed -i "s/UsePAM.*/UsePAM no/g" /etc/ssh/sshd_config \ - && sed -i "s/PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config \ - && ssh-keygen -A -CMD ['bash'] diff --git a/images/archlinux/README.md b/images/archlinux/README.md deleted file mode 100644 index a83d27cf..00000000 --- a/images/archlinux/README.md +++ /dev/null @@ -1 +0,0 @@ -# Archlinux Running on Docker \ No newline at end of file diff --git a/images/archlinux/base/Dockerfile b/images/archlinux/base/Dockerfile new file mode 100644 index 00000000..e5ed538e --- /dev/null +++ b/images/archlinux/base/Dockerfile @@ -0,0 +1,18 @@ +# Base Archlinux Image + +FROM archlinux/archlinux:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +ENV PATH="/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin" \ + TZ='Asia/Shanghai' + +ADD pacman.conf /etc/pacman.conf + +RUN echo "Server = https://repo.huaweicloud.com/archlinux/\$repo/os/\$arch" > /etc/pacman.d/mirrorlist \ + && rm -fr /etc/localtime \ + && ln --symbolic "/usr/share/zoneinfo/${TZ}" /etc/localtime \ + && echo "${TZ}" > /etc/timezone + +CMD /bin/bash diff --git a/images/archlinux/base/pacman.conf b/images/archlinux/base/pacman.conf new file mode 100644 index 00000000..a4cfcaa1 --- /dev/null +++ b/images/archlinux/base/pacman.conf @@ -0,0 +1,112 @@ +# +# /etc/pacman.conf +# +# See the pacman.conf(5) manpage for option and repository directives + +# +# GENERAL OPTIONS +# +[options] +# The following paths are commented out with their default values listed. +# If you wish to use different paths, uncomment and update the paths. +#RootDir = / +#DBPath = /var/lib/pacman/ +CacheDir = /var/cache/pacman/pkg/ +#LogFile = /var/log/pacman.log +#GPGDir = /etc/pacman.d/gnupg/ +#HookDir = /etc/pacman.d/hooks/ +HoldPkg = pacman glibc manjaro-system +# If upgrades are available for these packages they will be asked for first +# SyncFirst = manjaro-system archlinux-keyring manjaro-keyring +#XferCommand = /usr/bin/curl -L -C - -f -o %o %u +#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u +#CleanMethod = KeepInstalled +#UseDelta = 0.7 +Architecture = auto + +# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup +#IgnorePkg = +#IgnoreGroup = + +#NoUpgrade = +#NoExtract = + +# Misc options +#UseSyslog +#Color +#NoProgressBar +# We cannot check disk space from within a chroot environment +CheckSpace +#VerbosePkgLists +#ParallelDownloads = 5 + +# By default, pacman accepts packages signed by keys that its local keyring +# trusts (see pacman-key and its man page), as well as unsigned packages. +SigLevel = Required DatabaseOptional +LocalFileSigLevel = Optional +#RemoteFileSigLevel = Required + +# NOTE: You must run `pacman-key --init` before first using pacman; the local +# keyring can then be populated with the keys of all official Manjaro Linux +# packagers with `pacman-key --populate archlinux manjaro`. + +# +# REPOSITORIES +# - can be defined here or included from another file +# - pacman will search repositories in the order defined here +# - local/custom mirrors can be added here or in separate files +# - repositories listed first will take precedence when packages +# have identical names, regardless of version number +# - URLs will have $repo replaced by the name of the current repo +# - URLs will have $arch replaced by the name of the architecture +# +# Repository entries are of the format: +# [repo-name] +# Server = ServerName +# Include = IncludePath +# +# The header [repo-name] is crucial - it must be present and +# uncommented to enable the repo. +# + +# The testing repositories are disabled by default. To enable, uncomment the +# repo name header and Include lines. You can add preferred servers immediately +# after the header, and they will be used before the default mirrors. + +[core] +SigLevel = PackageRequired +Include = /etc/pacman.d/mirrorlist + +[extra] +SigLevel = PackageRequired +Include = /etc/pacman.d/mirrorlist + +[community] +SigLevel = PackageRequired +Include = /etc/pacman.d/mirrorlist + +# If you want to run 32 bit applications on your x86_64 system, +# enable the multilib repositories as required here. + +[multilib] +SigLevel = PackageRequired +Include = /etc/pacman.d/mirrorlist + +# An example of a custom package repository. See the pacman manpage for +# tips on creating your own repositories. +#[custom] +#SigLevel = Optional TrustAll +#Server = file:///home/custompkgs + +[options] +NoExtract = usr/share/help/* !usr/share/help/en* !usr/share/help/C/* +NoExtract = usr/share/gtk-doc/html/* usr/share/doc/* +NoExtract = usr/share/locale/* usr/share/X11/locale/* usr/share/i18n/* +NoExtract = !*locale*/en*/* !usr/share/i18n/charmaps/UTF-8.gz !usr/share/*locale*/locale.* +NoExtract = !usr/share/*locales/en_?? !usr/share/*locales/i18n* !usr/share/*locales/iso* +NoExtract = !usr/share/*locales/trans* +NoExtract = !usr/share/X11/locale/C/* +NoExtract = !usr/share/X11/locale/compose.dir !usr/share/X11/locale/iso8859-1/* +NoExtract = !usr/share/*locales/C !usr/share/*locales/POSIX !usr/share/i18n/charmaps/ANSI_X3.4-1968.gz +NoExtract = usr/share/man/* usr/share/info/* +NoExtract = usr/share/vim/vim*/lang/* diff --git a/images/archlinux/dev/Dockerfile b/images/archlinux/dev/Dockerfile new file mode 100644 index 00000000..5654b2f6 --- /dev/null +++ b/images/archlinux/dev/Dockerfile @@ -0,0 +1,10 @@ +FROM ghcr.io/dockenv/archlinux:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +RUN pacman -Syy \ + && pacman -S --noconfirm base-devel neovim git \ + && pacman -Scc --noconfirm \ + && rm -fr /var/cache/pacman/pkg/* + +CMD /bin/bash diff --git a/images/archlinux/latest/Dockerfile b/images/archlinux/latest/Dockerfile new file mode 100644 index 00000000..ba4ef9bc --- /dev/null +++ b/images/archlinux/latest/Dockerfile @@ -0,0 +1,15 @@ +FROM ghcr.io/dockenv/archlinux:base +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +RUN ln -sf /proc/self/mounts /etc/mtab \ + && pacman -Syy \ + # Init keyring + && pacman-key --init \ + && pacman -S --noconfirm archlinux-keyring \ + # && pacman -Su --noconfirm \ + && pacman -Scc --noconfirm \ + && rm -fr /var/cache/pacman/pkg/* \ + && rm -fr /var/lib/pacman/sync/*.db + +CMD /bin/bash diff --git a/images/aria2/Dockerfile b/images/aria2/Dockerfile deleted file mode 100644 index cc1a389b..00000000 --- a/images/aria2/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -FROM registry.cn-hongkong.aliyuncs.com/imxieke/alpine:latest -LABEL MAINTAINER="Cloudflying" \ - MAIL="oss@live.hk" - -ENV ARIA2_PORT=6880 -ENV ARIA2_SECRET=aria2cpwd -ENV WEBUI_PORT=8080 - -RUN apk add --no-cache aria2 darkhttpd && \ - mkdir -p /etc/aria2c && \ - mkdir -p /data/downloads && \ - wget https://dev.tencent.com/u/imxieke/p/packages/git/raw/master/code/aria-webui/webui.zip -O /data/webui.zip && \ - unzip /data/webui.zip -d /data/ && \ - chmod 777 -R /data/ && \ - touch /etc/aria2c/aria2c.session - -ADD conf/run.sh /data/run.sh -ADD conf/aria2c.conf /etc/aria2c/aria2c.conf - -RUN chmod +x /data/*.sh && \ - chmod 777 -R /etc/aria2c/ - - -VOLUME ["/data"] -EXPOSE ${ARIA2_PORT} - -CMD ["/data/run.sh"] \ No newline at end of file diff --git a/images/aria2/conf/aria2c.conf b/images/aria2/conf/aria2c.conf deleted file mode 100644 index e5f32030..00000000 --- a/images/aria2/conf/aria2c.conf +++ /dev/null @@ -1,135 +0,0 @@ -## 文件保存相关 ## - -# 文件保存目录 -dir=/data/downloads -# 启用磁盘缓存, 0为禁用缓存, 需1.16以上版本, 默认:16M -disk-cache=32M -# 断点续传 -continue=true - -# 文件预分配方式, 能有效降低磁盘碎片, 默认:prealloc -# 预分配所需时间: none < falloc ? trunc < prealloc -# falloc和trunc则需要文件系统和内核支持 -# NTFS建议使用falloc, EXT3/4建议trunc, MAC 下需要注释此项 -file-allocation=trunc - -## 下载连接相关 ## - -# 最大同时下载任务数, 运行时可修改, 默认:5 -max-concurrent-downloads=64 -# 同一服务器连接数, 添加时可指定, 默认:1 -# 官方的aria2最高设置为16, 如果需要设置任意数值请重新编译aria2 -max-connection-per-server=16 -# 整体下载速度限制, 运行时可修改, 默认:0(不限制) -#max-overall-download-limit=0 -# 单个任务下载速度限制, 默认:0(不限制) -#max-download-limit=0 -# 整体上传速度限制, 运行时可修改, 默认:0(不限制) -#max-overall-upload-limit=0 -# 单个任务上传速度限制, 默认:0(不限制) -#max-upload-limit=0 -# 禁用IPv6, 默认:false -# disable-ipv6=true -# 禁用https证书检查 -check-certificate=false -# 整体上传速度限制, 运行时可修改, 默认:0 -max-overall-upload-limit=1024kb -# 单个任务上传速度限制, 默认:0 -max-upload-limit=500kb -# 连接超时时间, 默认:60 -timeout=10 -# 最大重试次数, 设置为0表示不限制重试次数, 默认:5 -max-tries=5 -# 设置重试等待的秒数, 默认:0 -retry-wait=3 -# 最小文件分片大小, 添加时可指定, 取值范围1M -1024M, 默认:20M -# 假定size=10M, 文件为20MiB 则使用两个来源下载; 文件为15MiB 则使用一个来源下载 -min-split-size=20M -# 单个任务最大线程数, 添加时可指定, 默认:5 -# 建议同max-connection-per-server设置为相同值 -split=64 - -## 进度保存相关 ## - -# 从会话文件中读取下载任务 -input-file=/etc/aria2c/aria2c.session -# 在Aria2退出时保存错误的、未完成的下载任务到会话文件 -save-session=/etc/aria2c/aria2c.session -# 定时保存会话, 0为退出时才保存, 需1.16.1以上版本, 默认:0 -save-session-interval=5 - -## RPC相关设置 ## - -# 启用RPC, 默认:false -enable-rpc=true -# 允许所有来源, 默认:false -rpc-allow-origin-all=true -# 允许外部访问, 默认:false -rpc-listen-all=true -# RPC端口, 仅当默认端口被占用时修改 -rpc-listen-port=6800 -# 设置的RPC授权令牌, v1.18.4新增功能, 取代 --rpc-user 和 --rpc-passwd 选项 -rpc-secret=aria2pwd -# 启动SSL -# rpc-secure=true -# 证书文件, 如果启用SSL则需要配置证书文件, 例如用https连接aria2 -# rpc-certificate= -# rpc-private-key= -# 保存上传的种子文件 -rpc-save-upload-metadata=false - -## BT/PT下载相关 ## - -# 当下载的是一个种子(以.torrent结尾)时, 自动开始BT任务, 默认:true -follow-torrent=true -# 强制保存会话, 即使任务已经完成, 默认:false -# 较新的版本开启后会在任务完成后依然保留.aria2文件 -#force-save=false -# 继续之前的BT任务时, 无需再次校验, 默认:false -bt-seed-unverified=true -# 保存磁力链接元数据为种子文件(.torrent文件), 默认:false -bt-save-metadata=true -# 单个种子最大连接数, 默认:55 0表示不限制 -bt-max-peers=0 -# 最小做种时间, 单位:分 -# seed-time = 60 -# 分离做种任务 -bt-detach-seed-only=true -# BT监听端口, 当端口被屏蔽时使用, 默认:6881-6999 -listen-port=51413 -# 单个种子最大连接数, 默认:55 -bt-max-peers=64 -# 打开DHT功能, PT需要禁用, 默认:true -enable-dht=true -# 打开IPv6 DHT功能, PT需要禁用 -# enable-dht6=true -# DHT网络监听端口, 默认:6881-6999 -dht-listen-port=6881-6999 -# 本地节点查找, PT需要禁用, 默认:false -bt-enable-lpd=true -# 种子交换, PT需要禁用, 默认:true -enable-peer-exchange=true -# 每个种子限速, 对少种的PT很有用, 默认:50K -#bt-request-peer-speed-limit=50K -# 客户端伪装, PT需要 -# peer-id-prefix=-UT341- -peer-id-prefix=-TR2770- -# user-agent=uTorrent/341(109279400)(30888) -user-agent=Transmission/2.77 -# 当种子的分享率达到这个数时, 自动停止做种, 0为一直做种, 默认:1.0 -seed-ratio=1.0 -# 强制保存会话, 话即使任务已经完成, 默认:false -# 较新的版本开启后会在任务完成后依然保留.aria2文件 -#force-save=false -# BT校验相关, 默认:true -#bt-hash-check-seed=true -# 继续之前的BT任务时, 无需再次校验, 默认:false -bt-seed-unverified=true -# 保存磁力链接元数据为种子文件(.torrent文件), 默认:false -#bt-save-metadata=false -#仅下载种子文件 -bt-metadata-only=true -#通过网上的种子文件下载,种子保存在内存 https://github.com/ngosang/trackerslist -follow-torrent=true -bt-tracker=udp://tracker.leechers-paradise.org:6969/announce,udp://tracker.opentrackr.org:1337/announce,udp://9.rarbg.to:2710/announce,udp://9.rarbg.me:2710/announce,udp://exodus.desync.com:6969/announce,udp://retracker.lanta-net.ru:2710/announce,udp://tracker.tiny-vps.com:6969/announce,udp://open.demonii.si:1337/announce,udp://tracker.torrent.eu.org:451/announce,udp://torrentclub.tech:6969/announce,udp://open.stealth.si:80/announce,udp://denis.stalker.upeer.me:6969/announce,udp://tracker.cyberia.is:6969/announce,udp://tracker.moeking.me:6969/announce,udp://ipv4.tracker.harry.lu:80/announce,udp://tracker.openbittorrent.com:80/announce,udp://tracker3.itzmx.com:6961/announce,udp://explodie.org:6969/announce,udp://valakas.rollo.dnsabr.com:2710/announce -# aria2c --conf-path=/etc/aria2c/aria2c.conf -D \ No newline at end of file diff --git a/images/aria2/conf/docker-entrypoint.sh b/images/aria2/conf/docker-entrypoint.sh deleted file mode 100644 index 406c6baf..00000000 --- a/images/aria2/conf/docker-entrypoint.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env sh - -COPY docker-entrypoint.sh /usr/local/bin/ -ENTRYPOINT ["docker-entrypoint.sh"] - -tail -f /var/log/auth.log \ No newline at end of file diff --git a/images/aria2/conf/run.sh b/images/aria2/conf/run.sh deleted file mode 100644 index 774f21b6..00000000 --- a/images/aria2/conf/run.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env sh - -sed -i "s/6800/${ARIA2_PORT}/g" /etc/aria2c/aria2c.conf -sed -i "s/aria2pwd/${ARIA2_SECRET}/g" /etc/aria2c/aria2c.conf - -aria2c --conf-path=/etc/aria2c/aria2c.conf -D -darkhttpd /data/ --port ${WEBUI_PORT} \ No newline at end of file diff --git a/images/aria2/docker-compose.yml b/images/aria2/docker-compose.yml deleted file mode 100644 index eba8aed6..00000000 --- a/images/aria2/docker-compose.yml +++ /dev/null @@ -1,23 +0,0 @@ -version: '3' -services: - redis: - image: registry.cn-hongkong.aliyuncs.com/imxieke/aria2:latest - ports: - - "6800:6800/tcp" - - "8080:8080/tcp" - volumes: - - $HOME/Downloads:/downloads - environment: - ARIA2_PORT: 6800 - ARIA2_SECRET: aria2pwd - WEBUI_PORT: 8080 - restart: on-failur - deploy: - resources: - limits: - cpus: "0.5" - memory: 512M - restart_policy: - condition: on-failure - max_attempts: 3 - delay: 10s \ No newline at end of file diff --git a/images/aria2/latest/Dockerfile b/images/aria2/latest/Dockerfile new file mode 100644 index 00000000..8e516cb0 --- /dev/null +++ b/images/aria2/latest/Dockerfile @@ -0,0 +1,24 @@ +FROM ghcr.io/dockenv/alpine:3.16 +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +COPY conf/ /etc/aria2c/ + +RUN sed -i 's/dl-cdn.alpinelinux.org/repo.huaweicloud.com/g' /etc/apk/repositories \ + && apk add --no-cache darkhttpd aria2 \ + && mkdir -p /etc/aria2c \ + && chmod -R 777 /etc/aria2c \ + && mkdir -p /opt/ariang \ + && chmod -R 777 /opt/ariang \ + && cd /opt/ariang \ + && wget https://github.com/mayswind/AriaNg/releases/download/1.2.4/AriaNg-1.2.4-AllInOne.zip \ + && unzip AriaNg-1.2.4-AllInOne.zip && rm -fr LICENSE && rm -fr AriaNg-1.2.4-AllInOne.zip \ + && mv /etc/aria2c/entrypoint.sh /usr/bin/entrypoint.sh \ + && chmod +x /usr/bin/entrypoint.sh + +# 6080 Aria2 +# 6081 Aria2 WebUI +# 6802-6999 DOT Port +EXPOSE 6080 6081 6802-6999 + +CMD ["/usr/bin/entrypoint.sh"] diff --git a/images/aria2/latest/conf/aria2c.conf b/images/aria2/latest/conf/aria2c.conf new file mode 100644 index 00000000..f4e11edb --- /dev/null +++ b/images/aria2/latest/conf/aria2c.conf @@ -0,0 +1,271 @@ +## 下载连接相关 ## + +# 最大同时下载任务数, 运行时可修改, 默认:5 +max-concurrent-downloads=64 +# 同一服务器连接数, 添加时可指定, 默认:1 +# 官方的aria2最高设置为16, 如果需要设置任意数值请重新编译aria2 +max-connection-per-server=16 +# 整体下载速度限制, 运行时可修改, 默认:0(不限制) +max-overall-download-limit=0 +# 单个任务下载速度限制, 默认:0(不限制) +max-download-limit=0 +# 整体上传速度限制, 运行时可修改, 默认:0(不限制) +max-overall-upload-limit=0 +# 单个任务上传速度限制, 默认:0(不限制) +max-upload-limit=500kb +# 连接超时时间(秒)。默认:60 +connect-timeout=10 +# 禁用IPv6, 默认:false +# disable-ipv6=true +# 禁用https证书检查 +check-certificate=false +# 连接超时时间, 默认:60 +timeout=60 +# 最大重试次数, 设置为0表示不限制重试次数, 默认:5 +max-tries=5 +# 设置重试等待的秒数, 默认:0 +retry-wait=3 +# 比如此项值为 10M, 当文件为 20MB 会分成两段并使用两个来源下载, 文件为 15MB 则只使用一个来源下载。 +# 理论上值越小使用下载分段就越多,所能获得的实际线程数就越大,下载速度就越快,但受限于所下载文件服务器的策略。 +# 最小文件分片大小, 添加时可指定, 取值范围1M -1024M, 默认:20M +# 假定size=10M, 文件为20MiB 则使用两个来源下载; 文件为15MiB 则使用一个来源下载 +min-split-size=50M +# 单个任务最大线程数, 添加时可指定, 默认:5 +# 建议同max-connection-per-server设置为相同值 +split=64 +# GZip 支持,默认:false +http-accept-gzip=true +# URI 复用,默认: true +reuse-uri=false +# 禁用 netrc 支持,默认:false +no-netrc=true +# 允许覆盖,当相关控制文件(.aria2)不存在时从头开始重新下载。默认:false +allow-overwrite=false +# 文件自动重命名,此选项仅在 HTTP(S)/FTP 下载中有效。新文件名在名称之后扩展名之前加上一个点和一个数字(1..9999)。默认:true +auto-file-renaming=true +# HTTP/FTP 下载分片大小,所有分割都必须是此项值的倍数,最小值为 1M (增强版为 1K),默认:1M +piece-length=1M +# 允许分片大小变化。默认:false +# false:当分片大小与控制文件中的不同时将会中止下载 +# true:丢失部分下载进度继续下载 +allow-piece-length-change=true +# 使用 UTF-8 处理 Content-Disposition ,默认:false +content-disposition-default-utf8=true + +## 文件保存相关 ## + +# 文件保存目录 Docker +dir=/data +# 断点续传 +continue=true +# 始终尝试断点续传,无法断点续传则终止下载,默认:true +always-resume=false +# 不支持断点续传的 URI 数值,当 always-resume=false 时生效。 +# 达到这个数值从将头开始下载,值为 0 时所有 URI 不支持断点续传时才从头开始下载。 +max-resume-failure-tries=0 +# 文件未找到重试次数,默认:0 (禁用) +# 重试时同时会记录重试次数,所以也需要设置 max-tries 这个选项 +max-file-not-found=10 +# 获取服务器文件时间,默认:false +remote-time=true + +# 启用磁盘缓存, 0为禁用缓存, 需1.16以上版本, 默认:16M +disk-cache=32M + +## 日志设置 ## + +# 日志文件保存路径,忽略或设置为空为不保存,默认:不保存 +log=/var/log/aria2.log + +# 日志级别,可选 debug, info, notice, warn, error 。默认:debug +log-level=notice + +# 控制台日志级别,可选 debug, info, notice, warn, error ,默认:notice +console-log-level=notice +# 下载进度摘要输出间隔时间(秒),0 为禁止输出。默认:60 +summary-interval=0 + +# 文件预分配方式, 能有效降低磁盘碎片, 默认:prealloc +# 预分配所需时间: none < falloc ? trunc < prealloc +# falloc和trunc则需要文件系统和内核支持 +# NTFS建议使用falloc, EXT3/4建议trunc, MAC 下需要注释此项 +# 文件预分配方式, 可选:none, prealloc, trunc, falloc, 默认:prealloc +# 预分配对于机械硬盘可有效降低磁盘碎片、提升磁盘读写性能、延长磁盘寿命。 +# 机械硬盘使用 ext4(具有扩展支持),btrfs,xfs 或 NTFS(仅 MinGW 编译版本)等文件系统建议设置为 falloc +# 若无法下载,提示 fallocate failed.cause:Operation not supported 则说明不支持,请设置为 none +# prealloc 分配速度慢, trunc 无实际作用,不推荐使用。 +# 固态硬盘不需要预分配,只建议设置为 none ,否则可能会导致双倍文件大小的数据写入,从而影响寿命。 +# file-allocation=none + +# 文件预分配大小限制。小于此选项值大小的文件不预分配空间,单位 K 或 M,默认:5M +no-file-allocation-limit=64M + +# 安静模式,禁止在控制台输出日志,默认:false +quiet=true + +## 进度保存相关 ## + +# 从会话文件中读取下载任务 +input-file=/etc/aria2c/aria2c.session +# 在Aria2退出时保存错误的、未完成的下载任务到会话文件 +save-session=/etc/aria2c/aria2c.session +# 定时保存会话, 0为退出时才保存, 需1.16.1以上版本, 默认:0 +save-session-interval=60 +# 自动保存任务进度的间隔时间(秒),0 为进程正常退出时保存,默认:60 +auto-save-interval=1 +# 强制保存,即使任务已完成也保存信息到会话文件, 默认:false +# 开启后会在任务完成后保留 .aria2 文件,文件被移除且任务存在的情况下重启后会重新下载。 +# 关闭后已完成的任务列表会在重启后清空。 +force-save=false + +## RPC相关设置 ## + +# 启用RPC, 默认:false +enable-rpc=true +# 允许所有来源, 默认:false +rpc-allow-origin-all=true +# 允许外部访问, 默认:false +rpc-listen-all=true +# RPC端口, 仅当默认端口被占用时修改 +rpc-listen-port=6800 +# 设置的RPC授权令牌, v1.18.4新增功能, 取代 --rpc-user 和 --rpc-passwd 选项 +rpc-secret=haspwd +# 启动SSL +# rpc-secure=true +# 证书文件, 如果启用SSL则需要配置证书文件, 例如用https连接aria2 +# rpc-certificate= +# rpc-private-key= +# 保存通过 WebUI(RPC) 上传的种子文件(.torrent),默认:true +# 所有涉及种子文件保存的选项都建议开启,不保存种子文件有任务丢失的风险。 +# 通过 RPC 自定义临时下载目录可能不会保存种子文件。 +rpc-save-upload-metadata=true +# RPC 最大请求大小 +rpc-max-request-size=10M + + +## 高级选项 ## + +# 启用异步 DNS 功能。默认:true +#async-dns=true + +# 指定异步 DNS 服务器列表,未指定则从 /etc/resolv.conf 中读取。 +#async-dns-server=119.29.29.29,223.5.5.5,8.8.8.8,1.1.1.1 +# 指定单个网络接口,可能的值:接口,IP地址,主机名 +# 如果接口具有多个 IP 地址,则建议指定 IP 地址。 +# 已知指定网络接口会影响依赖本地 RPC 的连接的功能场景,即通过 localhost 和 127.0.0.1 无法与 Aria2 服务端进行讯通。 +#interface= + +# 指定多个网络接口,多个值之间使用逗号(,)分隔。 +# 使用 interface 选项时会忽略此项。 +#multiple-interface + +## BT/PT下载相关 ## + +# 当下载的是一个种子(以.torrent结尾)时, 自动开始BT任务, 默认:true +# 下载种子文件(.torrent)自动开始下载, 默认:true,可选:false|mem +# true:保存种子文件 +# false:仅下载种子文件 +# mem:将种子保存在内存中 +follow-torrent=true +# 继续之前的BT任务时, 无需再次校验, 默认:false +bt-seed-unverified=true +# 保存磁力链接元数据为种子文件(.torrent文件), 默认:false +bt-save-metadata=true +# 单个种子最大连接数, 默认:55 0表示不限制 +bt-max-peers=0 +# 最小做种时间, 单位:分 +# seed-time = 60 +# 分离做种任务 +bt-detach-seed-only=true +# 删除 BT 下载任务中未选择文件,默认:false +bt-remove-unselected-file=true +# Try to download first and last pieces of each file first. This is useful for previewing files. +bt-prioritize-piece=head=32M,tail=32M +# BT监听端口, 当端口被屏蔽时使用, 默认:6881-6999 +listen-port=6802-6999 +# 单个种子最大连接数, 默认:55 +bt-max-peers=0 +# 加载已保存的元数据文件(.torrent),默认:false +bt-load-saved-metadata=true +# BT最低加密等级,可选:plain(明文),arc4(加密),默认:plain +#bt-min-crypto-level=arc4 +# BT强制加密, 默认: false +# 启用后将拒绝旧的 BT 握手协议并仅使用混淆握手及加密。可以解决部分运营商对 BT 下载的封锁,且有一定的防版权投诉与迅雷吸血效果。 +# 此选项相当于后面两个选项(bt-require-crypto=true, bt-min-crypto-level=arc4)的快捷开启方式,但不会修改这两个选项的值。 +bt-force-encryption=true +# BT加密需求,默认:false 强制加密, 防迅雷必备 +# 启用后拒绝与旧的 BitTorrent 握手协议(\19BitTorrent protocol)建立连接,始终使用混淆处理握手。 +#bt-require-crypto=true +# 打开DHT功能, PT需要禁用, 默认:true +enable-dht=true +# 打开IPv6 DHT功能, PT需要禁用 +enable-dht6=true +# DHT网络监听端口, 默认:6881-6999 +dht-listen-port=6802-6999 +# DHT(IPv4)文件 +dht-file-path=/etc/aria2c/dht.dat +# DHT(IPv6)文件 +dht-file-path6=/etc/aria2c/dht6.dat +# IPv4 DHT 网络引导节点 +dht-entry-point=dht.transmissionbt.com:6881 +# IPv6 DHT 网络引导节点 +dht-entry-point6=dht.transmissionbt.com:6881 + +# 本地节点查找, PT需要禁用, 默认:false +bt-enable-lpd=true +# 种子交换, PT需要禁用, 默认:true +enable-peer-exchange=true +# 每个种子限速, 对少种的PT很有用, 默认:50K +#bt-request-peer-speed-limit=10M +# 客户端伪装, PT需要 -UT341- -TR2770- -TR2940- +peer-id-prefix=-TR2770- +# user-agent=uTorrent/341(109279400)(30888) +# user agent uTorrent/341(109279400)(30888) +user-agent=Transmission/2.77 +# user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4160.0 Safari/537.36 Edg/85.0.537.0 +# BT 客户端伪装 +# PT 下载需要保持 user-agent 和 peer-agent 两个参数一致 +# 部分 PT 站对 Aria2 有特殊封禁机制,客户端伪装不一定有效,且有封禁账号的风险。 +#user-agent=qBittorrent/4.2.5 +#peer-agent=qBittorrent/4.2.5 +peer-agent=Transmission/2.94 +# 当种子的分享率达到这个数时, 自动停止做种, 0为一直做种, 默认:1.0 +seed-ratio=1.0 +# BT校验相关, 默认:true +bt-hash-check-seed=false +# 仅下载种子文件 +bt-metadata-only=false +#通过网上的种子文件下载,种子保存在内存 https://github.com/ngosang/trackerslist +follow-torrent=true +# BT tracker 服务器连接超时时间(秒)。默认:60 +# 建立连接后,此选项无效,将使用 bt-tracker-timeout 选项的值 +bt-tracker-connect-timeout=10 +# BT tracker 服务器超时时间(秒)。默认:60 +bt-tracker-timeout=10 +# follow-torrent=mem +bt-tracker=http://1337.abcvg.info:80/announce,http://207.241.226.111:6969/announce,http://207.241.231.226:6969/announce,http://[2001:1b10:1000:8101:0:242:ac11:2]:6969/announce,http://[2a04:ac00:1:3dd8::1:2710]:2710/announce,http://dfireworks.eu.org:6969/announce,http://fxtt.ru:80/announce,http://i-p-v-6.tk:6969/announce,http://incine.ru:6969/announce,http://ipv4announce.sktorrent.eu:6969/announce,http://ipv6.1337.cx:6969/announce,http://ipv6.govt.hu:6969/announce,http://nyaa.tracker.wf:7777/announce,http://open-v6.demonoid.ch:6969/announce,http://open.acgnxtracker.com:80/announce,http://open.nyap2p.com:8080/announce,http://opentracker.i2p.rocks:6969/announce,http://opentracker.xyz:80/announce,http://retracker.hotplug.ru:2710/announce,http://share.camoe.cn:8080/announce,http://t.acg.rip:6699/announce,http://t.nyaatracker.com:80/announce,http://t.overflow.biz:6969/announce,http://t.publictracker.xyz:6969/announce,http://torrent-team.net:80/announce.php,http://torrenttracker.nwc.acsalaska.net:6969/announce,http://tr.cili001.com:8070/announce,http://tracker.aeerso.space:6969/announce,http://tracker.birkenwald.de:6969/announce,http://tracker.bt4g.com:2095/announce,http://tracker.dler.com:6969/announce,http://tracker.dler.org:6969/announce,http://tracker.files.fm:6969/announce,http://tracker.gbitt.info:80/announce,http://tracker.ipv6tracker.ru:80/announce,http://tracker.k.vu:6969/announce,http://tracker.lelux.fi:80/announce,http://tracker.mywaifu.best:6969/announce,http://tracker.noobsubs.net:80/announce,http://tracker.opentrackr.org:1337/announce,http://tracker.srv00.com:6969/announce,http://tracker1.itzmx.com:8080/announce,http://tracker2.dler.org:80/announce,http://tracker2.itzmx.com:6961/announce,http://tracker3.itzmx.com:6961/announce,http://vps02.net.orel.ru:80/announce,http://widemus.de:6969/announce,https://1337.abcvg.info:443/announce,https://carbon-bonsai-621.appspot.com:443/announce,https://chihaya-heroku.120181311.xyz:443/announce,https://opentracker.i2p.rocks:443/announce,https://tr.abiir.top:443/announce,https://tr.abir.ga:443/announce,https://tr.burnabyhighstar.com:443/announce,https://tr.ready4.icu:443/announce,https://track.plop.pm:8989/announce,https://tracker.4.babico.name.tr:443/announce,https://tracker.expli.top:443/announce,https://tracker.foreverpirates.co:443/announce,https://tracker.imgoingto.icu:443/announce,https://tracker.kuroy.me:443/announce,https://tracker.lelux.fi:443/announce,https://tracker.lilithraws.cf:443/announce,https://tracker.lilithraws.org:443/announce,https://tracker.logirl.moe:443/announce,https://tracker.nanoha.org:443/announce,https://tracker.tamersunion.org:443/announce,https://tracker1.520.jp:443/announce,https://trackme.theom.nz:443/announce,https://xtremex.herokuapp.com:443/announce,udp://184.105.151.166:6969/announce,udp://207.241.226.111:6969/announce,udp://207.241.231.226:6969/announce,udp://52.58.128.163:6969/announce,udp://6ahddutb1ucc3cp.ru:6969/announce,udp://9.rarbg.com:2810/announce,udp://91.216.110.52:451/announce,udp://960303.xyz:6969/announce,udp://[2001:1b10:1000:8101:0:242:ac11:2]:6969/announce,udp://[2001:470:1:189:0:1:2:3]:6969/announce,udp://[2a03:7220:8083:cd00::1]:451/announce,udp://[2a04:ac00:1:3dd8::1:2710]:2710/announce,udp://[2a0f:e586:f:f::220]:6969/announce,udp://aarsen.me:6969/announce,udp://admin.videoenpoche.info:6969/announce,udp://astrr.ru:6969/announce,udp://ben.kerbertools.xyz:6969/announce,udp://black-bird.ynh.fr:6969/announce,udp://bt.ktrackers.com:6666/announce,udp://bt1.archive.org:6969/announce,udp://bt2.archive.org:6969/announce,udp://bubu.mapfactor.com:6969/announce,udp://camera.lei001.com:6969/announce,udp://chennuo.xyz:6969/announce,udp://concen.org:6969/announce,udp://cutiegirl.ru:6969/announce,udp://cutscloud.duckdns.org:6969/announce,udp://davidkirkevans.com:6969/announce,udp://epider.me:6969/announce,udp://exodus.desync.com:6969/announce,udp://fe.dealclub.de:6969/announce,udp://fh2.cmp-gaming.com:6969/announce,udp://free.open.tracker.4.starka.st:15480/announce,udp://h3o2.me:1337/announce,udp://htz3.noho.st:6969/announce,udp://ipv4.tracker.harry.lu:80/announce,udp://ipv6.69.mu:6969/announce,udp://ipv6.tracker.harry.lu:80/announce,udp://ipv6.tracker.monitorit4.me:6969/announce,udp://isk.richardsw.club:6969/announce,udp://itera.bz:6969/announce,udp://k1.com.br:6969/announce,udp://keke.re:6969/announce,udp://laze.cc:6969/announce,udp://lloria.fr:6969/announce,udp://mail.artixlinux.org:6969/announce,udp://mail.zasaonsk.ga:6969/announce,udp://mirror.aptus.co.tz:6969/announce,udp://moonburrow.club:6969/announce,udp://movies.zsw.ca:6969/announce,udp://mserver.link:6969/announce,udp://mts.tvbit.co:6969/announce,udp://new-line.net:6969/announce,udp://open.demonii.com:1337/announce,udp://open.free-tracker.ga:6969/announce,udp://open.publictracker.xyz:6969/announce,udp://open.stealth.si:80/announce,udp://open.tracker.cl:1337/announce,udp://open.tracker.ink:6969/announce,udp://open.xxtor.com:3074/announce,udp://opentor.org:2710/announce,udp://opentracker.i2p.rocks:6969/announce,udp://p4p.arenabg.com:1337/announce,udp://psyco.fr:6969/announce,udp://public.publictracker.xyz:6969/announce,udp://qtstm32fan.ru:6969/announce,udp://rep-art.ynh.fr:6969/announce,udp://retracker.hotplug.ru:2710/announce,udp://retracker.lanta-net.ru:2710/announce,udp://run.publictracker.xyz:6969/announce,udp://sanincode.com:6969/announce,udp://shizzle.hammetjus.nl:6969/announce,udp://smtp-relay.odysseylabel.com.au:6969/announce,udp://smtp.flawcra.cc:6969/announce,udp://tamas3.ynh.fr:6969/announce,udp://themaninashed.com:6969/announce,udp://thouvenin.cloud:6969/announce,udp://thug.rocks:6969/announce,udp://torrentclub.space:6969/announce,udp://torrents.artixlinux.org:6969/announce,udp://tr.bangumi.moe:6969/announce,udp://tr.cili001.com:8070/announce,udp://tracker.0x.tf:6969/announce,udp://tracker.4.babico.name.tr:3131/announce,udp://tracker.6.babico.name.tr:6969/announce,udp://tracker.altrosky.nl:6969/announce,udp://tracker.artixlinux.org:6969/announce,udp://tracker.auctor.tv:6969/announce,udp://tracker.beeimg.com:6969/announce,udp://tracker.birkenwald.de:6969/announce,udp://tracker.bitsearch.to:1337/announce,udp://tracker.cyberia.is:6969/announce,udp://tracker.ddunlimited.net:6969/announce,udp://tracker.dler.com:6969/announce,udp://tracker.dler.org:6969/announce,udp://tracker.edkj.club:6969/announce,udp://tracker.filemail.com:6969/announce,udp://tracker.jordan.im:6969/announce,udp://tracker.leech.ie:1337/announce,udp://tracker.lelux.fi:6969/announce,udp://tracker.moeking.me:6969/announce,udp://tracker.monitorit4.me:6969/announce,udp://tracker.openbittorrent.com:6969/announce,udp://tracker.opentrackr.org:1337/announce,udp://tracker.pomf.se:80/announce,udp://tracker.publictracker.xyz:6969/announce,udp://tracker.srv00.com:6969/announce,udp://tracker.swateam.org.uk:2710/announce,udp://tracker.theoks.net:6969/announce,udp://tracker.tiny-vps.com:6969/announce,udp://tracker.torrent.eu.org:451/announce,udp://tracker.zemoj.com:6969/announce,udp://tracker1.bt.moack.co.kr:80/announce,udp://tracker1.itzmx.com:8080/announce,udp://tracker1.myporn.club:9337/announce,udp://tracker2.dler.com:80/announce,udp://tracker2.dler.org:80/announce,udp://tracker2.itzmx.com:6961/announce,udp://tracker3.itzmx.com:6961/announce,udp://tracker4.itzmx.com:2710/announce,udp://tracker6.lelux.fi:6969/announce,udp://transkaroo.joustasie.net:6969/announce,udp://u4.trakx.crim.ist:1337/announce,udp://uploads.gamecoast.net:6969/announce,udp://v2.iperson.xyz:6969/announce,udp://vibe.sleepyinternetfun.xyz:1738/announce,udp://www.2600.com:6969/announce,udp://www.torrent.eu.org:451/announce,udp://yahor.ftp.sh:6969/announce,udp://zecircle.xyz:6969/announce,ws://hub.bugout.link:80/announce,wss://tracker.openwebtorrent.com:443/announceudp://tracker.opentrackr.org:1337/announce,http://tracker.openbittorrent.com:80/announce,udp://explodie.org:6969/announce,http://tracker3.ctix.cn:2095/announce,http://tracker2.ctix.cn:2095/announce,http://tracker.nucozer-tracker.ml:2710/announce,http://tracker.corpscorp.online:80/announce,http://retracker.joxnet.ru:80/announce,http://open.tracker.ink:6969/announce,http://bt.okmp3.ru:2710/announce,udp://tracker.skyts.net:6969/announce,udp://public.tracker.vraphim.com:6969/announce,udp://bt.oiyo.tk:6969/announce,https://tracker.4.babico.name.tr/announce,http://tracker1.bt.moack.co.kr:80/announce,http://tracker.skyts.net:6969/announce,http://open.acgtracker.com:1096/announce0.159171sShowPageTrace + +## 执行额外命令 ## + +# 下载停止后执行的命令 +# 从 正在下载 到 删除、错误、完成 时触发。暂停被标记为未开始下载,故与此项无关。 +#on-download-stop=/root/.aria2/delete.sh + +# 下载完成后执行的命令 +# 此项未定义则执行 下载停止后执行的命令 (on-download-stop) +#on-download-complete=/root/.aria2/clean.sh + +# 下载错误后执行的命令 +# 此项未定义则执行 下载停止后执行的命令 (on-download-stop) +#on-download-error= + +# 下载暂停后执行的命令 +#on-download-pause= + +# 下载开始后执行的命令 +#on-download-start= + +# BT 下载完成后执行的命令 +#on-bt-download-complete= + +# sudo -Hu www aria2c --conf-path=/etc/aria2c/aria2c.conf -D diff --git a/images/aria2/latest/conf/aria2c.session b/images/aria2/latest/conf/aria2c.session new file mode 100644 index 00000000..e69de29b diff --git a/images/aria2/latest/conf/dht.dat b/images/aria2/latest/conf/dht.dat new file mode 100644 index 00000000..11dec6e8 Binary files /dev/null and b/images/aria2/latest/conf/dht.dat differ diff --git a/images/aria2/latest/conf/dht6.dat b/images/aria2/latest/conf/dht6.dat new file mode 100644 index 00000000..7b643350 Binary files /dev/null and b/images/aria2/latest/conf/dht6.dat differ diff --git a/images/aria2/latest/conf/entrypoint.sh b/images/aria2/latest/conf/entrypoint.sh new file mode 100644 index 00000000..597dd923 --- /dev/null +++ b/images/aria2/latest/conf/entrypoint.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env sh +### + # @Author: Cloudflying + # @Date: 2021-09-19 01:25:54 + # @LastEditTime: 2022-07-14 17:36:57 + # @LastEditors: Cloudflying + # @Description: + # @FilePath: /dockenv/images/aria2/latest/conf/entrypoint.sh +### +ARIA2_CONF='/etc/aria2c/aria2c.conf' +if [[ -z "${ARIA2_PORT}" ]]; then + ARIA2_PORT=6800 +fi + +if [[ -z "${WEBUI_PORT}" ]]; then + WEBUI_PORT=6801 +fi + +if [[ -z "${DHT_PORT}" ]]; then + DHT_PORT='6802-6999' +fi + +if [[ -z "${RPC_SECRET}" ]]; then + RPC_SECRET='haspwd' +fi + +sed -i "s/rpc-listen-port=.*/rpc-listen-port=${ARIA2_PORT}/g" ${ARIA2_CONF} +sed -i "s/rpc-secret=.*/rpc-secret=${RPC_SECRET}/g" ${ARIA2_CONF} +sed -i "s/dht-listen-port.*/dht-listen-port=${DHT_PORT}/g" ${ARIA2_CONF} + +aria2c --conf-path=/etc/aria2c/aria2c.conf -D +darkhttpd /opt/ariang --port ${WEBUI_PORT} --daemon >>/dev/null +echo -e " + Welcome to Aria2c Container is Running + +Aria2 Port : 127.0.0.1:${ARIA2_PORT} +WEBUI Port : 127.0.0.1:${WEBUI_PORT} +RPC Secret : ${RPC_SECRET} + +" +touch /var/log/aria2.log +tail -f /var/log/aria2.log diff --git a/images/base/alpine/Dockerfile b/images/base/alpine/Dockerfile new file mode 100644 index 00000000..c21e2b36 --- /dev/null +++ b/images/base/alpine/Dockerfile @@ -0,0 +1,9 @@ +FROM ghcr.io/dockenv/alpine:3.16 +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +ADD https://github.com/krallin/tini/releases/download/v0.19.0/tini-muslc-amd64 /usr/bin/tini + +RUN chmod +x /usr/bin/tini + +CMD ["sh"] diff --git a/images/base/ubuntu/Dockerfile b/images/base/ubuntu/Dockerfile new file mode 100644 index 00000000..8885b3df --- /dev/null +++ b/images/base/ubuntu/Dockerfile @@ -0,0 +1,9 @@ +FROM ghcr.io/dockenv/ubuntu:22.04 +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +ADD https://github.com/krallin/tini/releases/download/v0.19.0/tini-amd64 /usr/bin/tini + +RUN chmod +x /usr/bin/tini + +CMD ["bash"] diff --git a/images/beanstalkd-console/latest/Dockerfile b/images/beanstalkd-console/latest/Dockerfile new file mode 100644 index 00000000..6562a298 --- /dev/null +++ b/images/beanstalkd-console/latest/Dockerfile @@ -0,0 +1,17 @@ +FROM php:latest + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +RUN apt-get update \ + && apt-get install -y curl \ + && curl -sL https://github.com/ptrofimov/beanstalk_console/archive/master.tar.gz | tar xvz -C /tmp \ + && mv /tmp/beanstalk_console-master /source + && apt-get remove --purge -y curl && \ + && apt-get autoclean \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +EXPOSE 2080 + +CMD [ "/bin/bash" ]ash -c 'BEANSTALK_SERVERS=$BEANSTALKD_PORT_11300_TCP_ADDR:11300 php -S 0.0.0.0:2080 -t /source/public' diff --git a/images/beanstalkd/1.12/Dockerfile b/images/beanstalkd/1.12/Dockerfile new file mode 100644 index 00000000..9cb9c22a --- /dev/null +++ b/images/beanstalkd/1.12/Dockerfile @@ -0,0 +1,12 @@ +FROM ghcr.io/dockenv/alpine:3.14 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +RUN apk add --no-cache beanstalkd + +VOLUME /var/lib/beanstalkd/data + +EXPOSE 11300 + +CMD ["/usr/bin/beanstalkd"] diff --git a/images/beanstalkd/latest/Dockerfile b/images/beanstalkd/latest/Dockerfile new file mode 100644 index 00000000..6f0f2dd1 --- /dev/null +++ b/images/beanstalkd/latest/Dockerfile @@ -0,0 +1,12 @@ +FROM ghcr.io/dockenv/alpine:latest + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +RUN apk add --no-cache beanstalkd + +VOLUME /var/lib/beanstalkd/data + +EXPOSE 11300 + +CMD ["/usr/bin/beanstalkd"] diff --git a/images/boxs/README.md b/images/boxs/README.md new file mode 100644 index 00000000..390917c9 --- /dev/null +++ b/images/boxs/README.md @@ -0,0 +1,38 @@ +## Boxs +> 一键开箱即用 PHP 开发环境, 后期增加其他环境 如 Python Go Node ... + +## Version +- latest + - `cli` version dev env base debian + - Components + - `vscode-server` visual studio code run in web + - `docker run -d -p 8080:8080 -e CODE_PASSWD=vscode ghcr.io/dockenv/boxs:vscode` + - `code-server` visual studio code run in web +- xfce + - Ubuntu Xfce4 Desktop base debian +- vscode +- sshd + - sshd run on debian nullseye Pure OS Env, No php Python and more env + - `docker run -d -p 22:22 ghcr.io/dockenv/boxs:sshd` +- builder + - Archlinux Builder, only for build Archlinux Package + +## TODO +- locales 无法找到字符 +- Desktop + - 无声音 pulseaudio + +## Env +- doggo nali htop exa +- code-server + +## cli +- kotlin +- rust 解压后 1.2G +- +- + +```php +echo phpinfo(); +``` + diff --git a/images/boxs/alpine/Dockerfile b/images/boxs/alpine/Dockerfile new file mode 100644 index 00000000..de81828c --- /dev/null +++ b/images/boxs/alpine/Dockerfile @@ -0,0 +1,35 @@ +FROM ghcr.io/dockenv/alpine:edge +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +ENV RUN_USER="boxs" \ + PASSWD="boxs" \ + AUTHORIZED_KEYS='**None**' \ + DEBIAN_FRONTEND=noninteractive + +ENV HOME_DIR=/home/$RUN_USER + +RUN apk add --no-cache sudo git zsh neovim net-tools wget curl axel aria2 shadow openssh util-linux-misc \ + binutils file openrc procps htop neofetch gawk sed jq tar \ + && useradd -d /home/${RUN_USER} -c "Packages Builder" -m -s /bin/zsh ${RUN_USER} \ + && echo "${RUN_USER}:${PASSWD}" | chpasswd \ + && echo "root:${PASSWD}" | chpasswd \ + && echo "${RUN_USER} ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers \ + && git clone --depth 1 https://github.com/ohmyzsh/ohmyzsh.git ${HOME_DIR}/.oh-my-zsh \ + && cp ${HOME_DIR}/.oh-my-zsh/templates/zshrc.zsh-template ${HOME_DIR}/.zshrc \ + && sed -i 's/ZSH_THEME.*/ZSH_THEME="strug"/g' ${HOME_DIR}/.zshrc \ + && chown -R ${RUN_USER}:${RUN_USER} ${HOME_DIR} \ + && ssh-keygen -A \ + && sed -i 's/^#ClientAliveInterval.*/ClientAliveInterval 60/g' /etc/ssh/sshd_config \ + && sed -i 's/^#PermitRootLogin.*/PermitRootLogin no/g' /etc/ssh/sshd_config \ + && sed -i "s/^#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/g" /etc/ssh/sshd_config \ + && ln -s /bin/nvim /bin/e \ + && ln -s /bin/nvim /bin/vim \ + && ln -s /bin/nvim /bin/vi + +USER ${RUN_USER} +WORKDIR ${HOME_DIR} + +EXPOSE 22 80 + +CMD ["zsh"] diff --git a/images/boxs/alpine/entrypoint.sh b/images/boxs/alpine/entrypoint.sh new file mode 100644 index 00000000..0b9cf48f --- /dev/null +++ b/images/boxs/alpine/entrypoint.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +### + # @Author: Cloudflying + # @Date: 2022-06-24 23:30:33 + # @LastEditTime: 2022-06-24 23:38:35 + # @LastEditors: Cloudflying + # @Description: + # @FilePath: /dockenv/images/boxs/latest/entrypoint.sh +### + +# Change default password when -e PASSWD is set , default is ${PASWD} + +if [[ -n "${PASSWD}" ]]; then + echo "boxs:${PASSWD}" | sudo chpasswd + echo "root:${PASSWD}" | sudo chpasswd +fi + +HOST_IP=$(hostname -i) + +echo "======================================================================" > /tmp/.boxs.run.log +echo "You can now connect to this container via SSH using: " >> /tmp/.boxs.run.log +echo " ssh ${USER}@${HOST_IP} -p port " >> /tmp/.boxs.run.log +echo "Enter the ${USER} password => '${PASSWD}' when prompted " >> /tmp/.boxs.run.log +echo "Please remember to change the above password as soon as possible! " >> /tmp/.boxs.run.log +echo "======================================================================" >> /tmp/.boxs.run.log +echo " Boxs ssh is Running " >> /tmp/.boxs.run.log +echo "======================================================================" >> /tmp/.boxs.run.log +sudo service ssh start > /dev/null +tail -f /tmp/.boxs.run.log diff --git a/images/boxs/builder/Dockerfile b/images/boxs/builder/Dockerfile new file mode 100644 index 00000000..aab53037 --- /dev/null +++ b/images/boxs/builder/Dockerfile @@ -0,0 +1,52 @@ +FROM ghcr.io/dockenv/archlinux:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +ENV RUN_USER="boxs" \ + PASSWD="boxs" \ + AUTHORIZED_KEYS='**None**' \ + DEBIAN_FRONTEND=noninteractive + +ENV HOME_DIR=/home/$RUN_USER + +COPY conf/makepkg.conf /etc/makepkg.conf + +# electron12 electron13 electron16 is abandoned +# asar electron electron17 electron18 electron19 +# gtk2 xdg-utils +# nodejs npm \ +RUN pacman -Syy \ + && pacman -S --noconfirm --overwrite \* glibc \ + && pacman -S --noconfirm --overwrite \* \ + openssh git zsh neovim net-tools wget axel curl axel namcap \ + base-devel dpkg cmake \ + file tree which \ + unarchiver unzip unrar p7zip \ + meson nss alsa-lib libsecret \ + go python python2 python-pip \ + squashfs-tools \ + && useradd -d /home/${RUN_USER} -c "Packages Builder" -m -s /bin/zsh ${RUN_USER} \ + && echo "${RUN_USER}:${PASSWD}" | chpasswd \ + && echo "root:${PASSWD}" | chpasswd \ + && echo "${RUN_USER} ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers \ + && git clone --depth 1 https://github.com/ohmyzsh/ohmyzsh.git ${HOME_DIR}/.oh-my-zsh \ + && cp ${HOME_DIR}/.oh-my-zsh/templates/zshrc.zsh-template ${HOME_DIR}/.zshrc \ + && sed -i 's/ZSH_THEME.*/ZSH_THEME="strug"/g' ${HOME_DIR}/.zshrc \ + && chown -R ${RUN_USER}:${RUN_USER} ${HOME_DIR} \ + && ssh-keygen -A \ + && sed -i 's/^#ClientAliveInterval.*/ClientAliveInterval 60/g' /etc/ssh/sshd_config \ + && sed -i 's/^#PermitRootLogin.*/PermitRootLogin no/g' /etc/ssh/sshd_config \ + && sed -i "s/^#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/g" /etc/ssh/sshd_config \ + && ln -s /bin/nvim /bin/e \ + && ln -s /bin/nvim /bin/vim \ + && ln -s /bin/nvim /bin/vi \ + && pacman -Scc --noconfirm \ + && rm -fr /var/cache/pacman/* + +USER ${RUN_USER} +WORKDIR ${HOME_DIR} + +EXPOSE 22 80 + +CMD ["/bin/zsh"] +#sudo service ssh start diff --git a/images/boxs/builder/README.md b/images/boxs/builder/README.md new file mode 100644 index 00000000..13cd7e5d --- /dev/null +++ b/images/boxs/builder/README.md @@ -0,0 +1,2 @@ +## Builder +Archlinux 编译环境 diff --git a/images/boxs/builder/conf/makepkg.conf b/images/boxs/builder/conf/makepkg.conf new file mode 100644 index 00000000..8136a1a0 --- /dev/null +++ b/images/boxs/builder/conf/makepkg.conf @@ -0,0 +1,160 @@ +#!/hint/bash +# +# /etc/makepkg.conf +# + +######################################################################### +# SOURCE ACQUISITION +######################################################################### +# +#-- The download utilities that makepkg should use to acquire sources +# Format: 'protocol::agent' +# 'http::/usr/bin/curl -qgb "" -fLC - --retry 3 --retry-delay 3 -o %o %u' +DLAGENTS=('file::/usr/bin/curl -qgC - -o %o %u' + 'ftp::/usr/bin/curl -qgfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u' + 'http::/usr/bin/axel -n 16 -c -k -a -U Mozilla/5.0 -o %o %u' + 'https::/usr/bin/axel -n 16 -c -k -a -U Mozilla/5.0 -o %o %u' + 'rsync::/usr/bin/rsync --no-motd -z %u %o' + 'scp::/usr/bin/scp -C %u %o') + +# Other common tools: +# /usr/bin/snarf +# /usr/bin/lftpget -c +# /usr/bin/wget + +#-- The package required by makepkg to download VCS sources +# Format: 'protocol::package' +VCSCLIENTS=('bzr::bzr' + 'fossil::fossil' + 'git::git' + 'hg::mercurial' + 'svn::subversion') + +######################################################################### +# ARCHITECTURE, COMPILE FLAGS +######################################################################### +# +CARCH="x86_64" +CHOST="x86_64-pc-linux-gnu" + +#-- Compiler and Linker Flags +#CPPFLAGS="" +CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions \ + -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \ + -fstack-clash-protection -fcf-protection" +CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS" +LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now" +LTOFLAGS="-flto=auto" +#RUSTFLAGS="-C opt-level=2" +#-- Make Flags: change this for DistCC/SMP systems +MAKEFLAGS="-j8" +#-- Debugging flags +DEBUG_CFLAGS="-g" +DEBUG_CXXFLAGS="$DEBUG_CFLAGS" +#DEBUG_RUSTFLAGS="-C debuginfo=2" + +######################################################################### +# BUILD ENVIRONMENT +######################################################################### +# +# Makepkg defaults: BUILDENV=(!distcc !color !ccache check !sign) +# A negated environment option will do the opposite of the comments below. +# +#-- distcc: Use the Distributed C/C++/ObjC compiler +#-- color: Colorize output messages +#-- ccache: Use ccache to cache compilation +#-- check: Run the check() function if present in the PKGBUILD +#-- sign: Generate PGP signature file +# +BUILDENV=(!distcc color !ccache check !sign) +# +#-- If using DistCC, your MAKEFLAGS will also need modification. In addition, +#-- specify a space-delimited list of hosts running in the DistCC cluster. +#DISTCC_HOSTS="" +# +#-- Specify a directory for package building. +#BUILDDIR=/tmp/makepkg + +######################################################################### +# GLOBAL PACKAGE OPTIONS +# These are default values for the options=() settings +######################################################################### +# +# Makepkg defaults: OPTIONS=(!strip docs libtool staticlibs emptydirs !zipman !purge !debug !lto) +# A negated option will do the opposite of the comments below. +# +#-- strip: Strip symbols from binaries/libraries +#-- docs: Save doc directories specified by DOC_DIRS +#-- libtool: Leave libtool (.la) files in packages +#-- staticlibs: Leave static library (.a) files in packages +#-- emptydirs: Leave empty directories in packages +#-- zipman: Compress manual (man and info) pages in MAN_DIRS with gzip +#-- purge: Remove files specified by PURGE_TARGETS +#-- debug: Add debugging flags as specified in DEBUG_* variables +#-- lto: Add compile flags for building with link time optimization +# +OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug !lto) + +#-- File integrity checks to use. Valid: md5, sha1, sha224, sha256, sha384, sha512, b2 +INTEGRITY_CHECK=(sha256) +#-- Options to be used when stripping binaries. See `man strip' for details. +STRIP_BINARIES="--strip-all" +#-- Options to be used when stripping shared libraries. See `man strip' for details. +STRIP_SHARED="--strip-unneeded" +#-- Options to be used when stripping static libraries. See `man strip' for details. +STRIP_STATIC="--strip-debug" +#-- Manual (man and info) directories to compress (if zipman is specified) +MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info}) +#-- Doc directories to remove (if !docs is specified) +DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc}) +#-- Files to be removed from all packages (if purge is specified) +PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod) +#-- Directory to store source code in for debug packages +DBGSRCDIR="/usr/src/debug" + +######################################################################### +# PACKAGE OUTPUT +######################################################################### +# +# Default: put built package and cached source in build directory +# +#-- Destination: specify a fixed directory where all packages will be placed +#PKGDEST=/home/packages +#-- Source cache: specify a fixed directory where source files will be cached +#SRCDEST=/home/sources +#-- Source packages: specify a fixed directory where all src packages will be placed +#SRCPKGDEST=/home/srcpackages +#-- Log files: specify a fixed directory where all log files will be placed +#LOGDEST=/home/makepkglogs +#-- Packager: name/email of the person or organization building packages +PACKAGER="Cloud Flying " +#-- Specify a key to use for package signing +#GPGKEY="" + +######################################################################### +# COMPRESSION DEFAULTS +######################################################################### +# +COMPRESSGZ=(gzip -c -f -n) +COMPRESSBZ2=(bzip2 -c -f) +COMPRESSXZ=(xz -c -z -) +COMPRESSZST=(zstd -c -z -q -) +COMPRESSLRZ=(lrzip -q) +COMPRESSLZO=(lzop -q) +COMPRESSZ=(compress -c -f) +COMPRESSLZ4=(lz4 -q) +COMPRESSLZ=(lzip -c -f) + +######################################################################### +# EXTENSION DEFAULTS +######################################################################### +# +PKGEXT='.pkg.tar.zst' +SRCEXT='.src.tar.gz' + +######################################################################### +# OTHER +######################################################################### +# +#-- Command used to run pacman as root, instead of trying sudo and su +#PACMAN_AUTH=() diff --git a/images/boxs/cli-base/Dockerfile b/images/boxs/cli-base/Dockerfile new file mode 100644 index 00000000..4faec405 --- /dev/null +++ b/images/boxs/cli-base/Dockerfile @@ -0,0 +1,8 @@ +FROM ghcr.io/dockenv/debian:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +ADD build.sh /tmp/build.sh + +RUN chmod +x /tmp/build.sh && bash /tmp/build.sh diff --git a/images/boxs/cli-base/build.sh b/images/boxs/cli-base/build.sh new file mode 100644 index 00000000..fb3e625a --- /dev/null +++ b/images/boxs/cli-base/build.sh @@ -0,0 +1,105 @@ +#!/usr/bin/env bash +### + # @Author: Cloudflying + # @Date: 2021-12-21 01:00:07 + # @LastEditTime: 2022-07-01 20:48:26 + # @LastEditors: Cloudflying + # @Description: + # @FilePath: /dockenv/images/boxs/cli-base/build.sh +### +set -e + +apt update -y --fix-missing +apt-get install -y --no-install-recommends --no-install-suggests \ + sudo lsb-release ca-certificates apt-transport-https software-properties-common gnupg2 wget curl unzip zip + +echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/sury-php.list + +wget -qO - https://packages.sury.org/php/apt.gpg | apt-key add - + +apt update -y + +# apt search php8.0 | grep -v 'dbg' | grep -v 'gmagick' | grep -v 'interbase' | grep -v 'lua' | grep '^php' | grep '/' | awk -F '/' '{print $1}' | tr '\n' ' ' +apt-get install -y --no-install-recommends --no-install-suggests php5.6 php5.6-amqp php5.6-apcu php5.6-bcmath php5.6-bz2 php5.6-cgi php5.6-cli php5.6-common php5.6-curl php5.6-dba php5.6-dev php5.6-enchant php5.6-fpm php5.6-gd php5.6-geoip php5.6-gmp php5.6-gnupg php5.6-grpc php5.6-http php5.6-igbinary php5.6-imagick php5.6-imap php5.6-inotify php5.6-intl php5.6-json php5.6-ldap php5.6-lz4 php5.6-mailparse php5.6-mbstring php5.6-mcrypt php5.6-memcache php5.6-memcached php5.6-mongo php5.6-mongodb php5.6-msgpack php5.6-mysql php5.6-oauth php5.6-odbc php5.6-opcache php5.6-pgsql php5.6-phalcon3 php5.6-propro php5.6-protobuf php5.6-ps php5.6-pspell php5.6-radius php5.6-raphf php5.6-readline php5.6-recode php5.6-redis php5.6-rrd php5.6-smbclient php5.6-snmp php5.6-soap php5.6-solr php5.6-sqlite3 php5.6-ssh2 php5.6-stomp php5.6-tidy php5.6-uploadprogress php5.6-xdebug php5.6-xhprof php5.6-xml php5.6-xmlrpc php5.6-xsl php5.6-yaml php5.6-zip php5.6-zmq php5.6-zstd +apt-get install -y --no-install-recommends --no-install-suggests php7.4 php7.4-amqp php7.4-apcu php7.4-apcu-bc php7.4-ast php7.4-bcmath php7.4-bz2 php7.4-cgi php7.4-cli php7.4-common php7.4-curl php7.4-dba php7.4-decimal php7.4-dev php7.4-ds php7.4-enchant php7.4-fpm php7.4-gd php7.4-geoip php7.4-gmp php7.4-gnupg php7.4-grpc php7.4-http php7.4-igbinary php7.4-imagick php7.4-imap php7.4-inotify php7.4-intl php7.4-json php7.4-ldap php7.4-lz4 php7.4-mailparse php7.4-maxminddb php7.4-mbstring php7.4-mcrypt php7.4-memcache php7.4-memcached php7.4-mongodb php7.4-msgpack php7.4-mysql php7.4-oauth php7.4-odbc php7.4-opcache php7.4-pcov php7.4-pgsql php7.4-phalcon4 php7.4-pinba php7.4-propro php7.4-protobuf php7.4-ps php7.4-pspell php7.4-psr php7.4-radius php7.4-raphf php7.4-readline php7.4-redis php7.4-rrd php7.4-smbclient php7.4-snmp php7.4-soap php7.4-solr php7.4-sqlite3 php7.4-ssh2 php7.4-stomp php7.4-swoole php7.4-sybase php7.4-tideways php7.4-tidy php7.4-uopz php7.4-uploadprogress php7.4-uuid php7.4-vips php7.4-xdebug php7.4-xhprof php7.4-xml php7.4-xmlrpc php7.4-xsl php7.4-yaml php7.4-zip php7.4-zmq php7.4-zstd +apt-get install -y --no-install-recommends --no-install-suggests php8.0 php8.0-amqp php8.0-apcu php8.0-ast php8.0-bcmath php8.0-bz2 php8.0-cgi php8.0-cli php8.0-common php8.0-curl php8.0-dba php8.0-decimal php8.0-dev php8.0-ds php8.0-enchant php8.0-fpm php8.0-gd php8.0-gmp php8.0-gnupg php8.0-grpc php8.0-http php8.0-igbinary php8.0-imagick php8.0-imap php8.0-inotify php8.0-intl php8.0-ldap php8.0-lz4 php8.0-mailparse php8.0-maxminddb php8.0-mbstring php8.0-mcrypt php8.0-memcache php8.0-memcached php8.0-mongodb php8.0-msgpack php8.0-mysql php8.0-oauth php8.0-odbc php8.0-opcache php8.0-pcov php8.0-pgsql php8.0-protobuf php8.0-ps php8.0-pspell php8.0-psr php8.0-raphf php8.0-readline php8.0-redis php8.0-rrd php8.0-smbclient php8.0-snmp php8.0-soap php8.0-solr php8.0-sqlite3 php8.0-ssh2 php8.0-swoole php8.0-sybase php8.0-tidy php8.0-uopz php8.0-uploadprogress php8.0-uuid php8.0-vips php8.0-xdebug php8.0-xhprof php8.0-xml php8.0-xmlrpc php8.0-xsl php8.0-yaml php8.0-zip php8.0-zmq php8.0-zstd +# 不兼容 使用了 8.1 抛弃的函数 +# php8.1-swoole php8.1-protobuf php8.1-gnupg php8.1-solr +apt-get install -y --no-install-recommends --no-install-suggests php8.1 php8.1-amqp php8.1-apcu php8.1-ast php8.1-bcmath php8.1-bz2 php8.1-cgi php8.1-cli php8.1-common php8.1-curl php8.1-dba php8.1-decimal php8.1-dev php8.1-ds php8.1-enchant php8.1-fpm php8.1-gd php8.1-gmp php8.1-grpc php8.1-igbinary php8.1-imagick php8.1-imap php8.1-inotify php8.1-intl php8.1-ldap php8.1-lz4 php8.1-mailparse php8.1-maxminddb php8.1-mbstring php8.1-mcrypt php8.1-memcache php8.1-memcached php8.1-mongodb php8.1-msgpack php8.1-mysql php8.1-oauth php8.1-odbc php8.1-opcache php8.1-pcov php8.1-pgsql php8.1-ps php8.1-pspell php8.1-psr php8.1-raphf php8.1-readline php8.1-redis php8.1-rrd php8.1-smbclient php8.1-snmp php8.1-soap php8.1-sqlite3 php8.1-ssh2 php8.1-sybase php8.1-tidy php8.1-uopz php8.1-uploadprogress php8.1-uuid php8.1-vips php8.1-xdebug php8.1-xhprof php8.1-xml php8.1-xmlrpc php8.1-xsl php8.1-yaml php8.1-zip php8.1-zmq php8.1-zstd + +# Custom PHP Configure +sed -i 's#;curl.cainfo.*#curl.cainfo = /etc/ssl/certs/ca-certificates.crt#g' /etc/php/*/*/php.ini +sed -i 's#;date.timezone.*#date.timezone = Asia/Shanghai#g' /etc/php/*/*/php.ini +sed -i 's#max_file_uploads.*#max_file_uploads = 512#g' /etc/php/*/*/php.ini +sed -i 's#post_max_size.*#post_max_size = 512M#g' /etc/php/*/*/php.ini +sed -i 's#upload_max_filesize.*#upload_max_filesize = 512M#g' /etc/php/*/*/php.ini +sed -i 's#memory_limit.*#memory_limit = 512M#g' /etc/php/*/*/php.ini +sed -i 's#;cgi.fix_pathinfo.*#cgi.fix_pathinfo=0#g' /etc/php/*/*/php.ini +sed -i 's#display_errors.*#display_errors = On#g' /etc/php/*/*/php.ini +sed -i 's#error_reporting.*#error_reporting = E_ALL#g' /etc/php/*/*/php.ini + +# Python +apt-get install -y --no-install-recommends --no-install-suggests python3 python3-pip python3-neovim +# pip config set global.index-url https://pkgs-pypi.pkg.coding.net/mirrors/pypi/simple +# pip config set install.trusted-host pkgs-pypi.pkg.coding.net + +# Node +# curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - +# curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null +# echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | tee /etc/apt/sources.list.d/yarn.list +# apt-get update -y +# apt-get install -y --no-install-recommends --no-install-suggests nodejs yarn + +# npm config set registry https://registry.npm.taobao.org +# npm config set disturl https://npm.taobao.org/dist +# npm config set electron_mirror https://npm.taobao.org/mirrors/electron/ +# npm config set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver/ +# npm config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/ +# npm config set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs/ +# npm config set puppeteer_download_host https://npm.taobao.org/mirrors/ +# npm config set selenium_cdnurl https://npm.taobao.org/mirrors/selenium/ +# npm config set node_inspector_cdnurl https://npm.taobao.org/mirrors/node-inspector/ + +# yarn config set registry https://registry.npm.taobao.org/ -g +# yarn config set disturl https://npm.taobao.org/dist/ -g +# yarn config set electron_mirror https://npm.taobao.org/mirrors/electron/ -g +# yarn config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/ -g +# yarn config set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs/ -g +# yarn config set puppeteer_download_host https://npm.taobao.org/mirrors/ --gl +# yarn config set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver/ -g +# yarn config set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver/ -g +# yarn config set fse_binary_host_mirror https://npm.taobao.org/mirrors/fsevents/ -g +# yarn config set selenium_cdnurl https://npm.taobao.org/mirrors/selenium/ --g +# yarn config set node_inspector_cdnurl https://npm.taobao.org/mirrors/node-inspector/ --g + +# Go +# GO_VERSION=$(curl -sL https://github.com/golang/go/tags | grep 'releases/tag/go' | grep -v beta | awk -F '"' '{print $2}' | awk -F 'releases/tag/go' '{print $2}' | head -n 1) +# wget -c --no-check-certificate --quiet https://go.dev/dl/go1.17.5.linux-amd64.tar.gz -O /tmp/go.tar.gz +# wget -c --no-check-certificate --quiet "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" -O /tmp/go.tar.gz +# tar -xf /tmp/go.tar.gz -C /opt +# ln -s /opt/go/bin/* /usr/bin/ + +# Kotlin +# 采用内置方式在容器内部选择性安装 +# KOTLIN_VERSION=$(curl -fsSLI -o /dev/null -w "%{url_effective}" https://github.com/JetBrains/kotlin/releases/latest | awk -F 'tag/v' '{print $2}') +# cd /tmp +# wget -c --no-check-certificate --quiet https://github.com/JetBrains/kotlin/releases/download/v${KOTLIN_VERSION}/kotlin-compiler-${KOTLIN_VERSION}.zip +# wget -c --no-check-certificate --quiet https://github.com/JetBrains/kotlin/releases/download/v${KOTLIN_VERSION}/kotlin-native-linux-x86_64-${KOTLIN_VERSION}.tar.gz +# unzip kotlin-compiler-${KOTLIN_VERSION}.zip && mv kotlinc /opt +# tar -xf kotlin-native-linux-x86_64-${KOTLIN_VERSION}.tar.gz && mv kotlin-native-linux-x86_64-${KOTLIN_VERSION} /opt/kotlin-native +# ln -s /opt/kotlinc/bin/ /usr/bin/ +# ln -s /opt/kotlin-native/bin/ /usr/bin + +# curl -sL https://packages.microsoft.com/debian/11/prod/dists/bullseye/Release.gpg | gpg --dearmor | apt-key add - +# echo "deb [arch=amd64] https://packages.microsoft.com/debian/11/prod bullseye main" | tee /etc/apt/sources.list.d/microsoft.list + +# import Dotnet GPG Key +# gpg --keyserver keyserver.ubuntu.com --recv-keys EB3E94ADBE1229CF +# gpg --armor --export | apt-key add - +# apt-get install -y --no-install-recommends --no-install-suggests dotnet-sdk-5.0 + +rm -fr /tmp/* +apt autoremove -y +apt-get clean -y +apt-get autoclean -y +rm -fr /var/lib/apt/lists/* diff --git a/images/boxs/latest/Dockerfile b/images/boxs/latest/Dockerfile new file mode 100644 index 00000000..2881d6db --- /dev/null +++ b/images/boxs/latest/Dockerfile @@ -0,0 +1,34 @@ +FROM ghcr.io/dockenv/debian:sid +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +# PreDefine Variable +ENV LANG='en_US.UTF-8' \ + LANGUAGE='en_US.UTF-8' \ + LC_ALL='en_US.UTF-8' \ + LC_CTYPE='en_US.UTF-8' \ + RUN_USER="boxs" \ + USER_PASSWD="boxs" \ + AUTHORIZED_KEYS='**None**' \ + DEBIAN_FRONTEND=noninteractive \ + SSH_PORT=22 \ + IDE_PORT=8818 \ + IDE_PASSWD=ideboxs + + +ENV HOME_DIR=/home/$RUN_USER +ADD conf /tmp/conf + +RUN bash /tmp/conf/init.sh && rm -fr /tmp/* + +USER ${RUN_USER} +WORKDIR $HOME_DIR + +# 5901 vnc port +# 6901 novnc port +# 8188 code-server default port +# 15555 tabnine port +EXPOSE 22 6080 6800 8188 15555 + +CMD ["/usr/bin/entrypoint"] diff --git a/images/boxs/latest/conf/entrypoint.sh b/images/boxs/latest/conf/entrypoint.sh new file mode 100644 index 00000000..c29d6136 --- /dev/null +++ b/images/boxs/latest/conf/entrypoint.sh @@ -0,0 +1,54 @@ +#!/usr/bin/env bash +### + # @Author: Cloudflying + # @Date: 2022-06-25 00:21:46 + # @LastEditTime: 2022-07-02 01:42:24 + # @LastEditors: Cloudflying + # @Description: + # @FilePath: /dockenv/images/boxs/latest/conf/entrypoint.sh +### + +# Change default password when -e PASSWD is set , default is ${DEFAULT_PASSWD} +HOME_DIR='/home/boxs' +DEFAULT_PASSWD=$(cat /dev/random | head -n 1 | sha256sum | head -c 12) + +# Set Default Password If is empty will be set as ${DEFAULT_PASSWD} +if [[ -z "${USER_PASSWD}" ]]; then + USER_PASSWD=${DEFAULT_PASSWD} +fi + +if [[ -z "${IDE_PASSWD}" ]]; then + IDE_PASSWD=${DEFAULT_PASSWD} +fi + +# Reset User And Root Passwd +if [[ -n "${USER_PASSWD}" ]]; then + echo "root:${USER_PASSWD}" | sudo chpasswd + echo "boxs:${USER_PASSWD}" | sudo chpasswd +fi + +# Reset SSH Port +if [[ -n "${SSH_PORT}" ]]; then + sudo sed -i "s/^#Port.*/Port ${SSH_PORT}/g" /etc/ssh/sshd_config +fi + +# Reset Code Server Password +if [[ -n "${IDE_PASSWD}" ]]; then + sed -i "s#password:.*#password: ${IDE_PASSWD}#g" ${HOME_DIR}/.config/code-server/config.yaml +fi + +if [[ -z "${IDE_PORT}" ]]; then + sed -i "s#bind-addr:.*#bind-addr: 0.0.0.0:${IDE_PORT}#g" ${HOME_DIR}/.config/code-server/config.yaml +fi + +HOST_IP=$(hostname -i) + +echo "======================================================================" +echo "You can now connect to this container via SSH using: " +echo " ssh ${RUN_USER}@${HOST_IP} -p ${SSH_PORT} " +echo "Enter the ${RUN_USER} password => ${USER_PASSWD} when prompted " +echo "Please remember to change the above password as soon as possible! " +echo "======================================================================" +echo " Boxs ssh is Running " +echo "======================================================================" +sudo /usr/bin/supervisord -c /etc/supervisor/supervisord.conf -n diff --git a/images/boxs/latest/conf/init.sh b/images/boxs/latest/conf/init.sh new file mode 100644 index 00000000..0f5eb966 --- /dev/null +++ b/images/boxs/latest/conf/init.sh @@ -0,0 +1,265 @@ +#!/usr/bin/env bash +### + # @Author: Cloudflying + # @Date: 2022-07-01 12:36:33 + # @LastEditTime: 2022-07-11 19:24:20 + # @LastEditors: Cloudflying + # @Description: Init Docker Images + # @FilePath: /dockenv/images/boxs/latest/conf/init.sh +### +[ -f '/tmp/conf/entrypoint.sh' ] && cp /tmp/conf/entrypoint.sh /usr/bin/entrypoint && chmod +x /usr/bin/entrypoint + +# short package install command +pkg_add() +{ + apt-get install -y --no-install-recommends --no-install-suggests $@ +} + +# 下载二进制文件 并赋予执行权限 +# @param $1 Save Name Or Platform +# @param $2 Platform is exist +# Common Executable Binary,example shell php python +# ~/.bin/all +# Linux +# ~/.bin/lin +# macOS +# ~/.bin/mac +add_bin() +{ + BIN_DIR=${HOME}/.bin + if [[ "${1}" != 'lin' ]]; then + SAVE_PATH="${BIN_DIR}/lin/$2" + elif [[ "${1}" != 'mac' ]]; then + SAVE_PATH=="${BIN_DIR}/mac/$2" + else + SAVE_PATH="${BIN_DIR}/$2" + fi + wget -c $1 -O $SAVE_PATH + chmod +x ${SAVE_PATH} +} + +# 添加 VSCode 扩展到 Code Server +# 如 微软开发的 Remote 系列则只允许在 VSC 运行 +# usage: vsc_ext_add id +vsc_ext_add() +{ + EXT_DIR=${HOME}/.code-server/exts + mkdir -p /tmp/vsc-ext + EXT_ID=$(echo "$1" | tr '[A-Z]' '[a-z]') + EXT_URL="https://marketplace.visualstudio.com/items?itemName=${EXT_ID}" + EXT_FILE_URL=$(curl -sL ${EXT_URL} | grep -Eo 'https://\S+gallerycdn.vsassets.io/extensions\S+Default' | head -n 1 | sed 's#Icons.Default#VSIXPackage#g') + EXT_AUTHOR=$(echo "$EXT_FILE_URL" | awk -F 'extensions/' '{print $2}' | awk -F '/' '{print $1}') + EXT_NAME=$(echo "$EXT_FILE_URL" | awk -F 'extensions/' '{print $2}' | awk -F '/' '{print $2}') + EXT_VER=$(echo "$EXT_FILE_URL" | awk -F 'extensions/' '{print $2}' | awk -F '/' '{print $3}') + FULL_NAME="${EXT_AUTHOR}.${EXT_NAME}-${EXT_VER}" + wget -c ${EXT_FILE_URL} -O /tmp/vsc-ext/${FULL_NAME}.vsix + unzip -qo /tmp/vsc-ext/${FULL_NAME}.vsix -d /tmp/vsc-ext/ + mv /tmp/vsc-ext/extension ${EXT_DIR}/${FULL_NAME} +} + +apt update -y +apt upgrade -y + +# Install Packages +pkg_add ca-certificates locales openssh-server sudo zsh git jq procps htop less file wget curl iputils-ping net-tools \ + neovim supervisor python3-pip + +pkg_add 7zip brotli bzip2 gzip lunzip lzip unar unrar unzip p7zip p7zip-full p7zip-rar rar unrar-free zip zstd + +# PHP And Composer +pkg_add php8.1-amqp php8.1-ast php8.1-bz2 php8.1-dba php8.1-dev php8.1-ds php8.1-fpm php8.1-gd php8.1-gearman php8.1-gmp php8.1-gnupg php8.1-http php8.1-igbinary php8.1-imap php8.1-interbase php8.1-intl php8.1-ldap php8.1-mailparse php8.1-mbstring php8.1-mongodb php8.1-mysql php8.1-oauth php8.1-pgsql php8.1-phpdbg php8.1-ps php8.1-pspell php8.1-psr php8.1-raphf php8.1-readline php8.1-redis php8.1-rrd php8.1-snmp php8.1-soap php8.1-sqlite3 php8.1-ssh2 php8.1-sybase php8.1-tidy php8.1-uopz php8.1-uploadprogress php8.1-uuid php8.1-xdebug php8.1-xml php8.1-xsl php8.1-yaml php8.1-zip php8.1-zmq php8.1-apcu php8.1-bcmath php8.1-curl php8.1-enchant php8.1-imagick php8.1-memcache php8.1-memcached php8.1-msgpack php8.1-odbc php8.1-pcov php8.1-xmlrpc php8.1-smbclient +wget -qc https://getcomposer.org/download/latest-stable/composer.phar -O /usr/bin/composer +chmod +x /usr/bin/composer + +# for neovim +pip install -U setuptools +pip install pynvim websockets pip_search "python-lsp-server[all]" + +# Node +pkg_add nodejs npm +# npm i -g webpack yarn eslint @unibeautify/cli typescript +# npm i -g typescript-language-server vim-language-server + +# Config Language And timezone +sed -i "s/# en_US.UTF-8/en_US.UTF-8/" /etc/locale.gen +sed -i "s/# zh_CN.UTF-8/zh_CN.UTF-8/" /etc/locale.gen +# locale-gen +echo 'Asia/Shanghai' > /etc/timezone +rm -fr /etc/localtime +ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime + +# Config User +useradd -d /home/${RUN_USER} -m -s /bin/zsh ${RUN_USER} +echo "${RUN_USER}:${USER_PASSWD}" | chpasswd +echo "root:${USER_PASSWD}" | chpasswd +# Config sudo SuperPower +echo "${RUN_USER} ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers + +# Config ohmyzsh +git clone --depth 1 https://github.com/ohmyzsh/ohmyzsh.git ${HOME_DIR}/.oh-my-zsh +cp ${HOME_DIR}/.oh-my-zsh/templates/zshrc.zsh-template ${HOME_DIR}/.zshrc +sed -i 's/ZSH_THEME.*/ZSH_THEME="strug"/g' ${HOME_DIR}/.zshrc + +# Config SSH +ssh-keygen -A +sed -i 's/^#ClientAliveInterval.*/ClientAliveInterval 60/g' /etc/ssh/sshd_config +sed -i 's/^#PermitRootLogin.*/PermitRootLogin no/g' /etc/ssh/sshd_config +sed -i 's/^#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/g' /etc/ssh/sshd_config + +# Link vim symbol +ln -sf /usr/bin/nvim /bin/e +ln -sf /usr/bin/nvim /bin/vi +ln -sf /usr/bin/nvim /bin/vim + +[ ! -d '/run/sshd' ] && mkdir -p /run/sshd +[ ! -d '/etc/supervisor/conf.d' ] && mkdir -p /etc/supervisor/conf.d +[ -f '/tmp/conf/services.conf' ] && cp /tmp/conf/services.conf /etc/supervisor/conf.d/services.conf + +# install extension for code-server +ext_add() +{ + code-server --extensions-dir /home/boxs/.code-server/exts --install-extension $@ +} + +# Config code-server +if [[ -z "$(command -v code-server)" ]]; then + CODE_SERVER_LATEST_VER=$(curl -sI https://github.com/coder/code-server/releases/latest | grep '/releases/tag' | grep -Eo '/v\S+.[0-9]' | sed 's#/v##g') + # sudo systemctl enable --now code-server@$USER + CODE_SERVER_URL="https://github.com/coder/code-server/releases/download/v${CODE_SERVER_LATEST_VER}/code-server_${CODE_SERVER_LATEST_VER}_amd64.deb" + wget -c ${CODE_SERVER_URL} -O /tmp/code-server_${CODE_SERVER_LATEST_VER}_amd64.deb + dpkg -i /tmp/code-server_${CODE_SERVER_LATEST_VER}_amd64.deb + + mkdir -p ${HOME_DIR}/.code-server/exts + mkdir -p ${HOME_DIR}/.code-server/User + mkdir -p ${HOME_DIR}/.config/code-server + +cat > ${HOME_DIR}/.config/code-server/config.yaml < ${HOME_DIR}/.code-server/User/settings.json << EOF +{ + "workbench.colorTheme": "Solarized Light", + "sublimeTextKeymap.promptV3Features": true, + "editor.multiCursorModifier": "ctrlCmd", + "editor.snippetSuggestions": "top", + "editor.formatOnPaste": true, + "workbench.iconTheme": "vscode-icons", + "window.menuBarVisibility": "classic", + "database-client.highlightSQLBlock": true, + "database-client.showUser": true, + "database-client.showTrigger": true, + "database-client.showQuery": true, + "database-client.showFilter": true, + "database-client.escapedAllObjectName": true, + "tabnine.experimentalAutoImports": true, + "tabnine.receiveBetaChannelUpdates": true, + "editor.fontSize": 16, + "extensions.autoUpdate": "onlyEnabledExtensions" +} +EOF + # Add Code Server Extensions + # 有些插件仅支持运行在 VSCode 如 remote ssh + # defined to run only in code-server for the Desktop + # Utils + ext_add vscode-icons-team.vscode-icons + ext_add ms-vscode.sublime-keybindings + ext_add editorconfig.editorconfig + ext_add eamodio.gitlens + ext_add esbenp.prettier-vscode + ext_add cweijan.vscode-ssh + ext_add dbaeumer.vscode-eslint + ext_add rangav.vscode-thunder-client + + # Autocomplete + ext_add tabnine.tabnine-vscode + ext_add codiga.vscode-plugin + + # Database + ext_add cweijan.vscode-mysql-client2 + + # PHP + ext_add zobo.php-intellisense + ext_add bmewburn.vscode-intelephense-client + ext_add neilbrayfield.php-docblocker + # A static analysis tool for finding errors in PHP applications + ext_add getpsalm.psalm-vscode-plugin + + # Language support + ext_add xadillax.viml + ext_add octref.vetur # Vue + # ext_add redhat.vscode-yaml + # 不兼容 Code Server + # ext_add ms-ceintl.vscode-language-pack-zh-hans + + # SanderRonde.phpstan-vscode + # swordev.phpstan + + mkdir -p ${HOME_DIR}/.config/TabNine + cp -fr /tmp/conf/tabnine_config.json ${HOME_DIR}/.config/TabNine/tabnine_config.json +fi + +echo "==> Final Initialize environment" +PHP_VER=8.1 +sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/${PHP_VER}/*/php.ini +sed -i "s/display_errors = .*/display_errors = On/" /etc/php/${PHP_VER}/*/php.ini +sed -i "s/memory_limit = .*/memory_limit = 256M/" /etc/php/${PHP_VER}/*/php.ini +sed -i "s/date.timezone.*/date.timezone = 'Asia\/Shanghai'/" /etc/php/${PHP_VER}/*/php.ini +sed -i "s/upload_max_filesize = .*/upload_max_filesize = 512M/" /etc/php/${PHP_VER}/*/php.ini +sed -i "s/post_max_size = .*/post_max_size = 512M/" /etc/php/${PHP_VER}/*/php.ini +sed -i "s/max_file_uploads =.*/max_file_uploads = 256/g" /etc/php/${PHP_VER}/*/php.ini +sed -i "s/display_startup_errors =.*/display_startup_errors = On/g" /etc/php/${PHP_VER}/*/php.ini +sed -i "s/log_errors =.*/log_errors = On/g" /etc/php/${PHP_VER}/*/php.ini +sed -i "s/default_charset =.*/default_charset = "UTF-8"/g" /etc/php/${PHP_VER}/*/php.ini +sed -i "s/max_execution_time =.*/max_execution_time = 300/g" /etc/php/${PHP_VER}/*/php.ini +sed -i "s#^pm.max_children.*#pm.max_children = 32#" /etc/php/${PHP_VER}/fpm/php-fpm.conf + +# Fetch Binary +add_bin https://github.com/phpstan/phpstan/releases/download/1.8.0/phpstan.phar phpstan +add_bin https://phpmd.org/static/latest/phpmd.phar phpmd +add_bin https://phar.phpunit.de/phpcpd.phar phpcpd +add_bin https://phar.io/releases/phive.phar phive +add_bin https://github.com/phpro/grumphp/releases/download/v1.13.0/grumphp.phar grumphp +add_bin https://github.com/deployphp/deployer/releases/download/v7.0.0-rc.8/deployer.phar deployer +add_bin https://phar.phpunit.de/phpunit.phar phpunit +add_bin https://phar.phpbu.de/phpbu.phar phpbu +add_bin https://github.com/vimeo/psalm/releases/download/4.24.0/psalm.phar psalm +add_bin https://www.phing.info/get/phing-latest.phar phing +add_bin https://github.com/theseer/phpdox/releases/download/0.12.0/phpdox-0.12.0.phar phpdox +add_bin https://github.com/phan/phan/releases/download/5.3.2/phan.phar phan +add_bin https://phpdoc.org/phpDocumentor.phar phpDocumentor +add_bin https://doctum.long-term.support/releases/dev/doctum.phar doctum +add_bin https://github.com/mihaeu/dephpend/releases/download/0.8.0/dephpend-0.8.0.phar dephpend +add_bin https://cs.symfony.com/download/php-cs-fixer-v3.phar hp-cs-fixer +add_bin https://phar.phpunit.de/phploc.phar phploc +add_bin https://github.com/infection/infection/releases/download/0.26.13/infection.phar infection +add_bin https://github.com/squizlabs/PHP_CodeSniffer/releases/download/3.7.1/phpcbf.phar phpcbf +add_bin https://github.com/squizlabs/PHP_CodeSniffer/releases/download/3.7.1/phpcs.phar phpcs +add_bin https://github.com/qossmic/deptrac/releases/download/0.23.0/deptrac.phar deptrac +add_bin https://www.laravel-enlightn.com/security-checker.phar security-checker + +echo "==> Fix User Permission" +chown -R ${RUN_USER}:${RUN_USER} ${HOME_DIR} +chmod -R 755 ${HOME_DIR} +sudo -u ${RUN_USER} mkdir -p ${HOME_DIR}/.config/composer +sudo -u ${RUN_USER} composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ +sudo -u ${RUN_USER} composer global --no-plugins --no-scripts require phpstan/phpstan +sudo -u ${RUN_USER} composer global --no-plugins --no-scripts require vimeo/psalm +sudo -u ${RUN_USER} composer global --no-plugins --no-scripts require phpunit/phpunit +sudo -u ${RUN_USER} composer global --no-plugins --no-scripts require phan/phan + +echo "==> Clean Container" +rm -fr /root/.npm +rm -fr /root/.wget-hsts +rm -fr /root/.config +rm -fr /root/.local + +apt autoremove -y +apt-get clean -y +apt-get autoclean -y +rm -fr /var/lib/apt/lists/* diff --git a/images/boxs/latest/conf/services.conf b/images/boxs/latest/conf/services.conf new file mode 100644 index 00000000..f163c853 --- /dev/null +++ b/images/boxs/latest/conf/services.conf @@ -0,0 +1,25 @@ +[supervisord] +user=root +nodaemon=true + +[program:sshd] +startretries=3 +command=/usr/sbin/sshd -D +user=root +autorestart=true +priority=100 +redirect_stderr=true +stopsignal=QUIT +stdout_logfile=/var/log/sshd.log +stderr_logfile=/var/log/sshd.err + +[program:coder] +startretries=3 +user=boxs +command=sudo -u boxs code-server --config /home/boxs/.config/code-server/config.yaml +autorestart=true +priority=100 +redirect_stderr=true +stopsignal=QUIT +stdout_logfile=/var/log/coder.log +stderr_logfile=/var/log/coder.err diff --git a/images/boxs/latest/conf/tabnine_config.json b/images/boxs/latest/conf/tabnine_config.json new file mode 100644 index 00000000..3e1382e6 --- /dev/null +++ b/images/boxs/latest/conf/tabnine_config.json @@ -0,0 +1,48 @@ +{ + "version": "4.4.54", + "hide_promotional_message": false, + "beta_enabled": "No", + "ignore_all_lsp": false, + "creation_time": "2022-07-01T18:56:45.542642109Z", + "guuid": null, + "semantic_status": {}, + "enable_telemetry": true, + "user_understands_that_enabling_tabnine_cloud_sends_code_to_tabnine_servers": true, + "deep_completions_work_mode": "Hybrid", + "hosted_deep_completions_enabled": "Disabled", + "tabnine_cloud_host": null, + "tabnine_cloud_certificate_domain": null, + "tabnine_cloud_port": null, + "cloud_whitelist": [], + "num_of_suggestions": 5, + "line_suggestions": null, + "omit_prefix_suggestions": null, + "api_key": null, + "api_base_url": null, + "binary_update_interval_seconds": null, + "local_enabled": "Unset", + "disable_local_when_using_battery": false, + "hide_deep_information_message": false, + "enable_power_saving_mode": false, + "rate_limit_interval_seconds": null, + "rate_limit_amount": null, + "generation": 50, + "local_model_size": null, + "model_hash_override": null, + "local_indexing": null, + "heartbeat_interval_seconds": null, + "last_service_level": null, + "override_beams": null, + "override_context_length": null, + "onboarding": null, + "has_git_repos": null, + "gusr": null, + "exclude_file_masks": null, + "inline_suggestions_mode": null, + "use_specialized_model_if_available": null, + "empty_line_suggestions": null, + "snippets_enabled_v2": null, + "inline_suggestions_mode_clients": null, + "tabnine_hub_port": 15555, + "manually_selected_model": null +} diff --git a/images/boxs/scripts/bootstrap.sh b/images/boxs/scripts/bootstrap.sh new file mode 100644 index 00000000..1bf7f416 --- /dev/null +++ b/images/boxs/scripts/bootstrap.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash +### + # @Author: Cloudflying + # @Date: 2021-10-20 00:07:29 + # @LastEditTime: 2021-10-20 00:51:52 + # @LastEditors: Cloudflying + # @Description: + # @FilePath: /dockenv/images/boxs/unity/bootstrap.sh +### + +apt update -y +apt install -y --no-install-recommends x11vnc dbus dbus-x11 x11-utils xauth alsa-utils xvfb zenity supervisor +apt install -y --no-install-recommends mesa-utils libgl1-mesa-dri xserver-xorg-video-fbdev xserver-xorg-video-vesa +apt install -y --no-install-recommends git zsh locales xinit net-tools ttf-ubuntu-font-family ttf-wqy-zenhei +apt install -y --no-install-recommends unity unity-control-center unity-lens-applications unity-lens-files unity-scopes-runner unity-session +apt install -y --no-install-recommends yelp gvfs-bin lightdm nautilus notify-osd software-properties-common +apt install -y --no-install-recommends usbutils wireless-tools wpasupplicant xdg-user-dirs xdg-user-dirs-gtk +apt install -y --no-install-recommends fonts-freefont-ttf fonts-urw-base35 ghostscript libatk-adaptor libuuid-perl +apt install -y --no-install-recommends ubuntu-release-upgrader-core ubuntu-system-service ubuntu-advantage-tools ubuntu-artwork ubuntu-drivers-common ubuntu-release-upgrader-core ubuntu-release-upgrader-gtk ubuntu-settings ubuntu-sounds ubuntu-wallpapers ubuntu-wallpapers-focal ubuntu-release-upgrader-gtk ubuntu-settings ubuntu-sounds +apt install -y --no-install-recommends python3-aptdaemon python3-colorama python3-dateutil python3-debconf python3-debian python3-defer python3-distro-info python3-distupgrade python3-ibus-1.0 python3-macaroonbakery python3-nacl python3-protobuf python3-pymacaroons python3-rfc3339 python3-software-properties python3-tz python3-update-manager python3-xkit python3-yaml python3-aptdaemon.gtk3widgets python3-click +apt install -y --no-install-recommends python3 python3-pip gedit zip unzip xorg zenity rfkill ca-certificates genisoimage file-roller eog +apt install -y --no-install-recommends pkg-config yelp xz-utils upower alsa-base alsa-utils anacron +apt install -y --no-install-recommends update-manager update-manager-core update-notifier update-notifier-common +apt install -y --no-install-recommends ubuntu-unity-desktop + + +pip install numpy websockify xdg -i https://mirrors.aliyun.com/pypi/simple/ + +locale-gen en_US.UTF-8 +mkdir -p /tmp/.deps +cd /tmp/.deps +wget -c https://cloudflying-generic.pkg.coding.net/storage/mirrors/pkgs/tigervnc/tigervnc-1.10.0.x86_64.tar.gz +# wget -c https://cloudflying-generic.pkg.coding.net/storage/mirrors/pkgs/websockify/websockify-0.10.0.tar.gz +wget -c https://cloudflying-generic.pkg.coding.net/storage/mirrors/pkgs/novnc/noVNC-1.2.0.tar.gz +tar -xf tigervnc-1.10.0.x86_64.tar.gz +cp -fr tigervnc-1.10.0.x86_64/* / +# tar -xf websockify*.tar.gz +# cp -fr websockify-0.10.0 /opt/websockify +tar -xf noVNC-1.2.0.tar.gz +cp -fr noVNC-1.2.0 /opt/novnc +cd && rm -fr /tmp/.deps +cp /opt/novnc/vnc.html /opt/novnc/index.html + +USER='boxs' +PASSWD='boxs' + +useradd -d /home/${USER} -m -s /bin/zsh ${USER} +echo "${USER}:${PASSWD}" | chpasswd +echo "root:${PASSWD}" | chpasswd +echo "${USER} ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers +git clone --depth 1 https://gitee.com/mirr/oh-my-zsh.git ${HOME_DIR}/.oh-my-zsh +cp ${HOME_DIR}/.oh-my-zsh/templates/zshrc.zsh-template ${HOME_DIR}/.zshrc +sed -i 's/ZSH_THEME.*/ZSH_THEME="strug"/g' ${HOME_DIR}/.zshrc diff --git a/images/ubuntu/unity/startup.sh b/images/boxs/scripts/startup.sh similarity index 71% rename from images/ubuntu/unity/startup.sh rename to images/boxs/scripts/startup.sh index c9e36440..9cacc4a5 100644 --- a/images/ubuntu/unity/startup.sh +++ b/images/boxs/scripts/startup.sh @@ -4,9 +4,9 @@ echo "=> Set vnc password" if [ ! -f $HOME/.vnc/passwd ] ; then echo "$USER:$PASSWD" | chpasswd # Set up vncserver - su $USER -c "mkdir $HOME/.vnc \ - && echo '$PASSWD' | vncpasswd -f > $HOME/.vnc/passwd \ - && chmod 600 $HOME/.vnc/passwd && touch $HOME/.Xresources" + su $USER -c "mkdir $HOME/.vnc + echo '$PASSWD' | vncpasswd -f > $HOME/.vnc/passwd + chmod 600 $HOME/.vnc/passwd && touch $HOME/.Xresources" chown -R $USER:$USER $HOME else VNC_PID=`find $HOME/.vnc -name '*.pid'` diff --git a/images/ubuntu/unity/startup_bak.sh b/images/boxs/scripts/startup_bak.sh similarity index 100% rename from images/ubuntu/unity/startup_bak.sh rename to images/boxs/scripts/startup_bak.sh diff --git a/images/ubuntu/unity/unity.sh b/images/boxs/scripts/unity.sh similarity index 100% rename from images/ubuntu/unity/unity.sh rename to images/boxs/scripts/unity.sh diff --git a/images/ubuntu/unity/xfce_startup.sh b/images/boxs/scripts/xfce_startup.sh similarity index 100% rename from images/ubuntu/unity/xfce_startup.sh rename to images/boxs/scripts/xfce_startup.sh diff --git a/images/boxs/scripts/zenity-apt.sh b/images/boxs/scripts/zenity-apt.sh new file mode 100644 index 00000000..499e161d --- /dev/null +++ b/images/boxs/scripts/zenity-apt.sh @@ -0,0 +1,534 @@ +#!/usr/bin/env bash +### + # @Author: Cloudflying + # @Date: 2021-10-25 00:27:07 + # @LastEditTime: 2021-10-25 00:27:07 + # @LastEditors: Cloudflying + # @Description:#!/bin/bash +# AlicFeng https://www.samego.com alic@samego.com 价值源于技术,技术源于分享 +# build date 2017.05.16 +# last modified date 2017.05.16 + +# mian func 构建图形化界面 +function main(){ + GUI=$(zenity --list --checklist \ + --height="700" \ + --width="1100" \ + --title="Elementary OS 快速配置工具" \ + --text="请从下面列表中选择需要设置或安装的项目" \ + --column="选择" --column="工具名称" --column="工具描述" \ + TRUE "更新系统源列表" "更新系统源列表清单" \ + FALSE "Google Chrome" "Google公司开发的免费网页浏览器,十分推荐" \ + FALSE "Firefox" "即火狐浏览器,一个安全高效且体积小的浏览器,它具有速度快、隐私保护、不同设备之间同步数据、个性化定制等特性" \ + FALSE "Gparted" "GParted是一个分区工具,它可以用于创建、删除、移动分区,调整分区大小,检查、复制分区等操作" \ + FALSE "FileZilla" "FileZilla是一个免费开源的FTP软件,分为客户端版本和服务器版本,具备所有的FTP软件功能" \ + FALSE "WPS" "WPS是由金山软件股份有限公司自主研发的一款办公软件套装,可以实现办公软件最常用的文字、表格、演示等多种功能" \ + FALSE "有道翻译" "有道词典是由网易有道出品的全球首款基于搜索引擎技术的全能免费语言翻译软件,为全年龄段学习人群提供优质顺畅的查词翻译服务" \ + FALSE "网易云音乐" "网易云音乐是一款专注于发现与分享的音乐产品,依托专业音乐人、DJ、好友推荐及社交功能,为用户打造全新的音乐生活" \ + FALSE "VLC" "VLC是一款自由、开源的跨平台多媒体播放器及框架,可播放大多数多媒体文件,以及 DVD、音频 CD、VCD 及各类流媒体协议" \ + FALSE "Kazam" "Kazam 是 Ubuntu 上一款简易的桌面屏幕录制工具,它只能录制整个屏幕,可以录制声音" \ + FALSE "Smplayer" "Smplayer是一款开源的跨平台软件,其在Linux、Windows系统中有重要地位,影音播放能力很强大" \ + FALSE "Silentcast" "Silentcast是一款专注于GIF录制工具" \ + FALSE "媒体解码框架" "附带暗转媒体解码框架,完善PC、建议安装" \ + FALSE "Audience" "Audience是一款简洁而强大的视频播放器,怎么说呢:简洁到不能再简洁。它是ElementaryOS系统默认的视频播放器" \ + FALSE "Gimp" "Gimp是一个图片编辑器,优雅地取代windows、mac下的另一个ps软件" \ + FALSE "gedit" "gedit是一个基于GNOME桌面环境下兼容UTF-8的文本编辑器" \ + FALSE "x11vnc" "x11vnc是一种位图显示的视窗系统 。x11vnc服务端可以实现Windows远程Linux桌面系统" \ + FALSE "Shadowsocks-qt5" "Shadowsocks-qt5是一个科学上网利器工具。" \ + FALSE "VirtualBox" "VirtualBox是一款由德国 Innotek 公司开发的开源虚拟机软件。它不仅具有丰富的特色以及轻量级的体积,而且性能也很优异" \ + FALSE "Steam" "Steam是一个整合游戏下载平台,Linuxer游戏者嗨翻天" \ + FALSE "electronic-wechat" "electronic-wechat是一个基于nodeJS开发的Linux系统微信。前提已经安装nodeJS、npm" \ + FALSE "Transmission" "Transmission 是一个 BitTorrent 客户端软件,它支持速度限制、制作种子、远程控制、磁力链接、数据加密、损坏修复、数据来源交换等功能" \ + FALSE "thunderbird" "thunderbird是又是一个简洁易用的邮箱客户端" \ + FALSE "Okular" "Okular 是一个 PDF 文档阅读软件,支持 PDF、TIFF、CHM、ODF、EPUB、mobi 等文档格式" \ + FALSE "FocusWriter" "FocusWriter 是一款写作软件" \ + FALSE "Typora" "Typora是极简的Markdown编辑器,合并了写作和预览。支持表格、代码编辑,拖拽插图等,非常好用;推荐安装" \ + FALSE "OBS Studio" "OBS Studio 是一款跨平台的,开源的视频录制和在线直播客户端软件。我觉得一点不好的体验就是不能刻录整个屏幕" \ + FALSE "Remmina" "Remmina是一个用远程桌面软件,提供了RDP、VNC、XDMCP、SSH等远程连接协议的支持,远程客户端推荐" \ + FALSE "Meld" "Meld是针对开发者的视觉差异和合并工具。MELD帮助您比较文件、目录和版本控制的项目。既可以查看差异有可以同步" \ + FALSE "TeamViewer" "CS架构的远程工具" \ + FALSE "Deepin-Scrot" "deepin-scrot是深度团队开发的一个截图工具,推荐" \ + FALSE "Albert Spotlight" "Albert Spotlight是 Ubuntu的一项快速、随打即找、系统支援的桌面搜寻特色" \ + FALSE "Guake Terminal" "Guake是一个下拉式的gnome桌面环境下的终端程序,因此你只需要按一个键就可以调用他,然后再按一次以便隐藏他.一句话:GuakeTerminal是linux下完美帅气的终端。非常推荐" \ + FALSE "bleachbit" "bleachbit是系统ubuntu系统减肥的一门"中药",用于清理系统没用的垃圾文件" \ + FALSE "psensor" "psensor是监控系统硬件实时状况的一款软件" \ + FALSE "catfish" "catfish简称文件搜索神器。" \ + FALSE "docky" "dockey是一款一个号称花钱也买不到的菜单启动器。为什么这麽说的?很简单:它是开源的,很简洁更美观" \ + FALSE "Indicator Netspeed" "indicator-sysmonitor是一个系统动态信息监控工具。可以实时查看电脑的cpu,内存占用率,更可以查看网速,非常方便" \ + FALSE "TLP" "TLP 是一款Linux流行的电源工具软件。你可以使用TLP来调整系统电池,有助于有更好延长电池寿命" \ + FALSE "menulibre" "menulibre是一个简洁易用的菜单编辑器" \ + FALSE "Jetbrains全家桶" "Jetbrains_IDEA 全家桶基基于java语言开的一个工具套餐,而且基本覆盖了主流的开发编程语言,还包含了开发ios/macOS的工具" \ + FALSE "Brackets" "Brackets是一款使用 HTML,CSS,JavaScript 创建的开源的针对 Web 开发的编辑器" \ + FALSE "Sublime Text" "Sublime Text是一个轻量、简洁、高效、跨平台的编辑器" \ + FALSE "Atom" "Atom是GitHub推出的一款基于Web技术开发的桌面端的编辑器,其主要的特点是现代, 易用, 可定制" \ + FALSE "sqliteman" "sqliteman是一款小巧的图形化管理SQLite数据库的软件。轻量级、小巧、功能全面。为它点个赞,推荐" \ + FALSE "Git、GitG" "Git是一个开源的分布式版本控制系统,gitg是一个用于查看Git版本控制系统的工具,基于Gnome桌面环境" \ + FALSE "monodevelop" "MonoDevelop 是个适用于Linux、Mac和Windows的开放源代码集成开发环境,目前支持的语言有Python、Vala、C#、Java、BOO、Nemerle、Visual Basic .NET、CIL、C与C++" \ + FALSE "MySQL workbench" "MySQL workbench是一款专为MySQL设计的ER/数据库建模工具,但是在ElementaryOS还是存在不少的问题的" \ + FALSE "genymotion" "Genymotion是一套完整的工具,它提供了Android虚拟环境,支持Windows、Linux和Mac OS等操作系统,容易安装和使用,开发安卓绝配" \ + FALSE "asm" "Android Screen Monitor简称ASM,是一款监视手机或者模拟器屏幕的工具" \ + FALSE "enca、iconv" "enca、iconv都是文件编码转换工具" \ + FALSE "Figlet" "Figlet是一个将字符串在终端生成一个logo的终端工具" \ + FALSE "oh-my-zsh" "oh-my-zsh是终极Shell,就这么一句话" \ + FALSE "Asciinema" "Asciinema 是一个用 ClojureScript 编写的开源命令行录屏工具" \ + FALSE "Aria2" "aria2是 Linux 下一个命令行下轻量级、多协议、多来源的高速下载工具" \ + FALSE "Proxychains4" "Proxychains4是一个终端挂代理的工具,可自由切换代理。使用简单只需要在命令前加上proxychains4即可" \ + TRUE "清理修复软件" "清理无用的软件安装包以及依赖,修复不能运行的软件" \ + --separator="|"); + + if [[ $GUI ]] + then + notify-send -t 0 "价值源于技术,技术源于分享" "给AlicFeng的Linux_env一个start呗" -i face-smile-big + # 更新系统操作 + if [[ $GUI == *"更新系统源列表"* ]] + then + showDoingTask 更新系统源列表 + sudo apt-get update -y && showResultTip 更新系统源列表 + fi + + # 安装Google Chrome浏览器 + if [[ $GUI == *"Google Chrome浏览器"* ]] + then + showDoingTask "安装Google Chrome浏览器" + sudo apt-get install google-chrome-stable -y && showResultTip "安装Google Chrome浏览器" + fi + + # 安装Google Chrome浏览器 + if [[ $GUI == *"Firefox浏览器"* ]] + then + showDoingTask Firefox浏览器 + sudo apt-get install firefox -y && showResultTip "安装Firefox浏览器" + fi + + # 安装Gparted + if [[ $GUI == *"Gparted"* ]] + then + showDoingTask Gparted + sudo apt-get install gparted -y && showResultTip "安装Gparted" + fi + + # 安装FileZilla + if [[ $GUI == *"FileZilla"* ]] + then + showDoingTask FileZilla + sudo apt-get install filezilla && showResultTip "安装FileZilla" + fi + + # 安装WPS + if [[ $GUI == *"WPS"* ]] + then + showDoingTask WPS + wget -c -P $(pwd) http://kdl.cc.ksosoft.com/wps-community/download/a21/wps-office_10.1.0.5672~a21_amd64.deb -O wps.deb + sudo dpkg -i wps.deb && sudo apt-get install -fy && showResultTip "WPS" + fi + + # 安装有道词典 + if [[ $GUI == *"有道词典"* ]] + then + showDoingTask "有道词典" + wget -c -P $(pwd) http://codown.youdao.com/cidian/linux/youdao-dict_1.1.0-0-deepin_amd64.deb -O youdao.deb + sudo dpkg -i youdao.deb && sudo apt-get install -fy && showResultTip "有道词典" + fi + + # 安装网易云音乐 + if [[ $GUI == *"网易云音乐"* ]] + then + showDoingTask "网易云音乐" + wget -c -P $(pwd) http://s1.music.126.net/download/pc/netease-cloud-music_1.0.0_amd64_ubuntu16.04.deb -O netease.deb + sudo dpkg -i netease.deb && sudo apt-get install -fy && showResultTip "网易云音乐" + fi + + # 安装VLC + if [[ $GUI == *"VLC"* ]] + then + showDoingTask "VLC" && sudo apt-get install vlc -y && showResultTip "VLC" + fi + + # 安装Kazam + if [[ $GUI == *"Kazam"* ]] + then + showDoingTask "Kazam" && sudo add-apt-repository ppa:and471/kazam-daily-builds -y && sudo apt-get update >/dev/null>&1 + sudo apt-get install kazam && sudo add-apt-repository ppa:and471/kazam-daily-builds -ry && showResultTip "Kazam" + fi + + # 安装SMPlayer + if [[ $GUI == *"SMPlayer"* ]] + then + showDoingTask "SMPlayer" && sudo apt-get install smplayer -y && showResultTip "SMPlayer" + fi + + # 安装SilentCast + if [[ $GUI == *"SilentCast"* ]] + then + showDoingTask "SilentCast" && sudo add-apt-repository ppa:sethj/silentcast -y && sudo apt-get update >/dev/null>&1 + sudo apt-get install silentcast && sudo add-apt-repository ppa:sethj/silentcast -ry showResultTip "SilentCast" + fi + + # 安装Audience + if [[ $GUI == *"Audience"* ]] + then + showDoingTask "Audience" && sudo apt-get install audience -y && showResultTip "Audience" + fi + + # 安装媒体解码框架 + if [[ $GUI == *"媒体解码框架"* ]] + then + showDoingTask "媒体解码框架" + sudo apt-add-repository ppa:mc3man/trusty-media -y && sudo apt-get update >/dev/null>&1 + sudo apt-get install Ubuntu-restricted-extras ffmpeg gstreamer0.10-plugins-ugly \ + libavcodec-extra-54 libvdpau-va-gl1 libmad0 mpg321 gstreamer1.0-libav + sudo apt-add-repository ppa:mc3man/trusty-media -ry && showResultTip "媒体解码框架" + fi + + # 安装Gimp + if [[ $GUI == *"Gimp"* ]] + then + showDoingTask "Gimp" && sudo add-apt-repository ppa:otto-kesselgulasch/gimp -y && sudo apt-get update >/dev/null>&1 + sudo apt-get install gimp && sudo add-apt-repository ppa:otto-kesselgulasch/gimp -ry showResultTip "Gimp" + fi + + # 安装Krita + if [[ $GUI == *"Krita"* ]] + then + showDoingTask "Krita" && sudo add-apt-repository ppa:kubuntu-ppa/backports -y && \ + sudo apt-get update >/dev/null>&1 && sudo apt-get install kdelibs-bin kbuildsycoca4 --noincremental krita -y \ + && sudo add-apt-repository ppa:kubuntu-ppa/backports -ry showResultTip "Krita" + fi + + # 安装gedit + if [[ $GUI == *"gedit"* ]] + then + showDoingTask "gedit" && sudo apt-get install gedit -y && showResultTip "gedit" + fi + + # 安装x11vnc + if [[ $GUI == *"x11vnc"* ]] + then + showDoingTask "x11vnc" && sudo apt-get install x11vnc -y && showResultTip "x11vnc" + fi + + # 安装Shadowsocks-qt5 + if [[ $GUI == *"Shadowsocks-qt5"* ]] + then + showDoingTask "Shadowsocks-qt5" && sudo add-apt-repository ppa:hzwhuang/ss-qt5 -y && sudo apt-get update >/dev/null>&1 + sudo apt-get install shadowsocks-qt5 && sudo add-apt-repository ppa:hzwhuang/ss-qt5 -ry showResultTip "Shadowsocks-qt5" + fi + + # 安装VirtualBox + if [[ $GUI == *"VirtualBox"* ]] + then + showDoingTask "VirtualBox" + wget -c -P $(pwd) http://download.virtualbox.org/virtualbox/5.1.14/virtualbox-5.1_5.1.14-112924~Ubuntu~xenial_amd64.deb -O virtualbox.deb + sudo dpkg -i virtualbox.deb && sudo apt-get install -fy && showResultTip "VirtualBox" + fi + + # 安装Steam + if [[ $GUI == *"Steam"* ]] + then + showDoingTask "Steam" && sudo apt-get install steam -y && showResultTip "Steam" + fi + + # 安装微信electronic-wechat + if [[ $GUI == *"electronic-wechat"* ]] + then + showDoingTask "electronic-wechat" && \ + git clone https://github.com/geeeeeeeeek/electronic-wechat.git && \ + cd electronic-wechat && \ + npm install && sudo npm start && \ + showResultTip "electronic-wechat" + fi + + # 安装Transmission + if [[ $GUI == *"Transmission"* ]] + then + showDoingTask "Transmission" && sudo apt-get install transmission -y && showResultTip "Transmission" + fi + + # 安装ThunderBird + if [[ $GUI == *"GThunderBirdmp"* ]] + then + showDoingTask "ThunderBird" && sudo apt-get install thunderbird -y && showResultTip "ThunderBird" + fi + + # 安装Okular + if [[ $GUI == *"Okular"* ]] + then + showDoingTask "Okular" && sudo apt-get install okular -y && showResultTip "Okular" + fi + + # 安装FocusWriter + if [[ $GUI == *"FocusWriter"* ]] + then + showDoingTask "FocusWriter" && sudo apt-get install focuswriter -y && showResultTip "FocusWriter" + fi + + # 安装Typora + if [[ $GUI == *"Typora"* ]] + then + showDoingTask "Typora" && sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA300B7755AFCFAE \ + && sudo add-apt-repository 'deb https://typora.io linux/' && sudo apt-get update >/dev/null>&1 \ + && sudo apt-get install typora -y && showResultTip "Typora" + fi + + # 安装OBS Studio + if [[ $GUI == *"OBS Studio"* ]] + then + showDoingTask "OBS Studio" + sudo apt-get install ffmpeg -y + sudo add-apt-repository ppa:obsproject/obs-studio -y + sudo apt-get update && sudo apt-get install obs-studio -y + sudo add-apt-repository ppa:obsproject/obs-studio -ry + showResultTip "OBS Studio" + fi + + # 安装Remmina + if [[ $GUI == *"Remmina"* ]] + then + showDoingTask "Remmina" && sudo apt-get install remmina -y && showResultTip "Remmina" + fi + + # 安装Meld + if [[ $GUI == *"Meld"* ]] + then + showDoingTask "Meld" && sudo apt-get install meld -y && showResultTip "Meld" + fi + + # 安装TeamViewer + if [[ $GUI == *"TeamViewer"* ]] + then + showDoingTask "TeamViewer" && \ + wget -c -P $(pwd) https://download.teamviewer.com/download/teamviewer_i386.deb \ + && sudo dpkg -i teamviewer_i386.deb && sudo apt-get install -fy && showResultTip "TeamViewer" + fi + + # 安装Deepin-Scrot + if [[ $GUI == *"Deepin-Scrot"* ]] + then + showDoingTask "Deepin-Scrot" && \ + wget -c -P $(pwd) http://packages.linuxdeepin.com/deepin/pool/main/d/deepin-scrot/deepin-scrot_2.0-0deepin_all.deb \ + && sudo dpkg -i deepin-scrot_2.0-0deepin_all.deb && sudo apt-get install -fy && showResultTip "Deepin-Scrot" + fi + + # 安装Albert Spotlight + if [[ $GUI == *"Albert Spotlight"* ]] + then + showDoingTask "Albert Spotlight" && sudo add-apt-repository ppa:hzwhuang/ss-qt5 -y && sudo apt-get update >/dev/null>&1 + sudo apt-get install albert && sudo add-apt-repository ppa:noobslab/macbuntu -ry showResultTip "Albert Spotlight" + fi + + # 安装Guake Terminal + if [[ $GUI == *"Guake TerminalGimp"* ]] + then + showDoingTask "Guake Terminal" && sudo apt-get install guake -y && showResultTip "Guake Terminal" + fi + + # 安装bleachbit + if [[ $GUI == *"bleachbit"* ]] + then + showDoingTask "bleachbit" && sudo add-apt-repository ppa:n-muench/programs-ppa -y && sudo apt-get update >/dev/null>&1 + sudo apt-get install bleachbit && sudo add-apt-repository ppa:n-muench/programs-ppa -ry showResultTip "bleachbit" + fi + + # 安装psensor + if [[ $GUI == *"psensor"* ]] + then + showDoingTask "psensor" && sudo add-apt-repository ppa:jfi/ppa -y && sudo apt-get update >/dev/null>&1 + sudo apt-get install lm-sensors hddtemp psensor -y && sudo add-apt-repository ppa:jfi/ppa -ry \ + && showResultTip "psensor" + fi + + # 安装catfish + if [[ $GUI == *"catfish"* ]] + then + showDoingTask "catfish" && sudo apt-get install catfish -y && showResultTip "catfish" + fi + + # 安装docky + if [[ $GUI == *"docky"* ]] + then + showDoingTask "docky" && sudo apt-get install docky -y && showResultTip "docky" + fi + + # 安装Indicator Netspeed + if [[ $GUI == *"Indicator Netspeed"* ]] + then + showDoingTask "Indicator Netspeed" && sudo add-apt-repository ppa:nilarimogard/webupd8 -y && sudo apt-get update >/dev/null>&1 + sudo apt-get install indicator-netspeed -y && sudo add-apt-repository ppa:nilarimogard/webupd8 -ry \ + && showResultTip "Indicator Netspeed" + fi + + # 安装TLP + if [[ $GUI == *"TLP"* ]] + then + showDoingTask "TLP" && sudo add-apt-repository ppa:linrunner/tlp -y && sudo apt-get update >/dev/null>&1 + sudo apt-get install tlp tlp-rdw -y && sudo add-apt-repository ppa:linrunner/tlp -ry && showResultTip "TLP" + fi + + # 安装menulibre + if [[ $GUI == *"menulibre"* ]] + then + showDoingTask "menulibre" && sudo add-apt-repository ppa:menulibre-dev/devel -y && sudo apt-get update >/dev/null>&1 + sudo apt-get install menulibre -y && sudo add-apt-repository ppa:menulibre-dev/devel -ry && showResultTip "menulibre" + fi + + # 安装Jetbrains全家桶 + if [[ $GUI == *"Jetbrains全家桶"* ]] + then + echo "Jetbrains全家桶Office Website➜ https://www.jetbrains.com" + fi + + # 安装Brackets + if [[ $GUI == *"Brackets"* ]] + then + showDoingTask "Brackets" && sudo add-apt-repository ppa:webupd8team/brackets -y && sudo apt-get update >/dev/null>&1 + sudo apt-get install brackets -y && sudo add-apt-repository ppa:webupd8team/brackets -ry && showResultTip "Brackets" + fi + + # 安装Sublime Text + if [[ $GUI == *"Sublime Text"* ]] + then + echo "Sublime Text Website➜ https://www.sublimetext.com/" + fi + + # 安装Atom + if [[ $GUI == *"Atom"* ]] + then + showDoingTask "Atom" && sudo add-apt-repository ppa:webupd8team/atom -y && sudo apt-get update >/dev/null>&1 + sudo apt-get install atom -y && sudo add-apt-repository ppa:webupd8team/atom -ry && showResultTip "Atom" + fi + + # 安装sqliteman + if [[ $GUI == *"sqliteman"* ]] + then + showDoingTask "sqliteman" && sudo apt-get install sqliteman -y && showResultTip "sqliteman" + fi + + # 安装Git、GitG + if [[ $GUI == *"Git、GitG"* ]] + then + showDoingTask "Git、GitG" && sudo apt-get install git gitg -y && showResultTip "Git、GitG" + fi + + # 安装Gimp + if [[ $GUI == *"monodevelop"* ]] + then + showDoingTask "monodevelop" && sudo apt-get install monodevelop g++ xterm -y && showResultTip "monodevelop" + fi + + # 安装MySQL workbench + if [[ $GUI == *"MySQL workbench"* ]] + then + showDoingTask "MySQL workbench" && wget -c -P $(pwd) \ + https://cdn.mysql.com//Downloads/MySQLGUITools/mysql-workbench-community-6.3.9-1ubuntu16.04-amd64.deb \ + && sudo dpkg -i mysql-workbench-community-6.3.9-1ubuntu16.04-amd64.deb && sudo apt-get install -fy \ + && showResultTip "MySQL workbench" + fi + + # 安装genymotion + if [[ $GUI == *"genymotion"* ]] + then + echo "Sorry please manual installation,Website➜ http://www.genymotion.net/" + fi + + # 安装Gimp + if [[ $GUI == *"asm"* ]] + then + showDoingTask "asm" + wget -c -P $(pwd) https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/android-screen-monitor/ASM_2_50.zip + showResultTip "下载asm" + fi + + # 安装enca、iconv + if [[ $GUI == *"enca、iconv"* ]] + then + showDoingTask "enca、iconv" && sudo apt-get install enca iconv -y && showResultTip "enca、iconv" + fi + + # 安装Figlet + if [[ $GUI == *"Figlet"* ]] + then + showDoingTask "Figlet" && sudo apt-get install figlet -y && showResultTip "Figlet" + fi + + # oh-my-zsh + if [[ $GUI == *"oh-my-zsh"* ]] + then + showDoingTask "oh-my-zsh" && sudo apt-get install git -y \ + wget -c -P $(pwd) https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh && \ + sudo sh $(pwd)/install.sh && rm $(pwd)/install.sh && showResultTip "oh-my-zsh" + fi + + # 安装Asciinema + if [[ $GUI == *"Asciinema"* ]] + then + showDoingTask "Asciinema" && sudo apt-get install asciinema -y && showResultTip "Asciinema" + fi + + # 安装Aria2 + if [[ $GUI == *"Aria2"* ]] + then + showDoingTask "Aria2" && sudo apt-get install aria2 -y && showResultTip "Aria2" + fi + + # 安装Proxychains4 + if [[ $GUI == *"Proxychains4"* ]] + then + showDoingTask "Proxychains4" && git clone https://github.com/rofl0r/proxychains-ng.git && \ + cd proxychains-ng && sudo ./configure –prefix=/usr –sysconfdir=/etc && sudo make && sudo make install && \ + sudo make install-config && cd .. && rm -rf proxychains-ng && showResultTip "Aria2" + fi + + # 清理修复软件 + if [[ $GUI == *"清理修复软件"* ]] + then + clear && sudo apt-get install -y && sudo apt-get autoremove && sudo apt-get autoclean && showResultTip "清理修复软件" + fi + + # 完成通知 + clear && about && open + fi +} + +# 显示任务生在执行 +showDoingTask(){ + clear + echo "Hello $USER , Terminal is installing $1 ..." + notify-send -i utilities-terminal "AShellTools快速配置工具" "Hello $USER , Terminal is installing $1" +} + +# 显示安装结果 +showResultTip(){ + notify-send -t 0 -i utilities-terminal "AShellTools快速配置工具" "$USER☺$1完成" +} + + +# 关于 +function about(){ +clear +cat </dev/null 2>&1 && figlet " Alic Feng Shell") +Author:AlicFeng Email:alic@samego.com 价值源于技术,贡献源于分享 +------------------------------------------------------------------------------ +EOF +} + +# 浏览器打开 +function open(){ +( +cat < open_alicfeng_github.py + python open_alicfeng_github.py >/dev/null 2>&1 & + #rm open_alicfeng_github.py +} + +# 程序入口 +main + + # @FilePath: /dockenv/images/boxs/scripts/zenity-apt.sh +### diff --git a/images/boxs/scripts/zenity-gui-ssh.sh b/images/boxs/scripts/zenity-gui-ssh.sh new file mode 100644 index 00000000..32f0d6ee --- /dev/null +++ b/images/boxs/scripts/zenity-gui-ssh.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash +### + # @Author: Cloudflying + # @Date: 2021-10-25 00:24:37 + # @LastEditTime: 2021-10-25 00:24:37 + # @LastEditors: Cloudflying + # @Description: + # @FilePath: /dockenv/images/boxs/scripts/zenity-gui-ssh.sh +### + + +# AlicFeng https://www.samego.com alic@samego.com 价值源于技术,技术源于分享 +# build date 2017.05.16 +# last modified date 2017.05.16 + +# mian func 构建图形化界面 ssh +function main(){ + GUI=$(zenity --list --checklist \ + --height="400" \ + --width="600" \ + --title="samegoShell" \ + --text="SSH UI Login For AlicFeng" \ + --column="选择" --column="主机" --column="密码" --column="描述" \ + FALSE "localhost" "fenglican" "localhost" \ + FALSE "localhost0" "fenglican" "localhost" \ + --separator="|"); + + if [[ $GUI ]] + then + # 更新系统操作 + if [[ $GUI == *"localhost"* ]] + then + sshpass -p fenglican ssh -p 22 alic@192.168.31.46 + fi + + # 完成通知 + #clear && about + fi +} + +# 关于 +function about(){ +clear +cat </dev/null 2>&1 && figlet " Alic Feng Shell") +Author:AlicFeng Email:alic@samego.com 价值源于技术,贡献源于分享 +------------------------------------------------------------------------------ +EOF +} + +# 程序入口 +main diff --git a/images/boxs/xfce-arch-base/Dockerfile b/images/boxs/xfce-arch-base/Dockerfile new file mode 100644 index 00000000..e8b35708 --- /dev/null +++ b/images/boxs/xfce-arch-base/Dockerfile @@ -0,0 +1,57 @@ +FROM ghcr.io/dockenv/archlinux:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" +ENV DEBIAN_FRONTEND=noninteractive + +RUN pacman -Syyu --noconfirm \ + && pacman-key --init \ + && pacman-key --populate archlinux \ + # inetutils Provide hostname ftp telnet command etc ... + # xorg-xrandr 设置分辨率 + && pacman -S --noconfirm dbus exo garcon tumbler ristretto parole inetutils xorg-xrandr xorg-server \ + && pacman -S --noconfirm xfce4-appfinder xfce4-panel xfce4-session xfce4-settings xfce4-terminal xfconf xfdesktop xfwm4 \ + xfce4-artwork xfwm4-themes xfce4-cpufreq-plugin xfce4-cpugraph-plugin xfce4-datetime-plugin xfce4-dict xfce4-diskperf-plugin \ + xfce4-eyes-plugin xfce4-mount-plugin xfce4-mpc-plugin xfce4-notifyd xfce4-pulseaudio-plugin xfce4-screenshooter \ + xfce4-systemload-plugin xfce4-taskmanager xfce4-time-out-plugin xfce4-timer-plugin xfce4-whiskermenu-plugin \ + # File Manage + && pacman -S --noconfirm thunar thunar-archive-plugin thunar-volman \ + && pacman -S --noconfirm tigervnc python python-pip python-pynvim openssh dialog \ + && pip install wheel numpy websockify -i https://repo.huaweicloud.com/pypi/simple/ \ + # build desktop require + && pacman -S --noconfirm supervisor sudo wget curl git neovim tree less zsh bat net-tools \ + && git clone --depth 1 https://e.coding.net/pkgs/oh-my-zsh/oh-my-zsh.git /tmp/oh-my-zsh \ + # && pacman -S --noconfirm expect httpie axel jq screen iftop enca \ + # Archive Compress + # && pacman -S --noconfirm unarchiver zip unzip bzip2 unrar zstd gzip p7zip xz \ + # && pacman -S --noconfirm procps gnu-netcat htop rsync iproute2 whois \ + # && pacman -S --noconfirm ncdu catfish bleachbit meld synapse fzf remmina strace \ + # && pacman -S --noconfirm sshfs proxychains-ng \ + # Mail Client + # && pacman -S --noconfirm thunderbird \ + # Downloader qbittorrent-nox ktorrent rtorrent deluge transmission-cli or transmission-gtk or -qt + # && pacman -S --noconfirm aria2 \ + # && pacman -S --noconfirm qbittorrent \ + # Documents && Office + # 进入系统后自定义安装 + # Calibre 图书创作工具 + # && pacman -S --noconfirm okular calibre fbreader libreoffice-still libreoffice-still-zh-cn \ + # && pacman -S --noconfirm midori \ + # productivity and creative suite && Image Manipulation + # && pacman -S --noconfirm calligra gimp gimp-help-zh_cn \ + # && pacman -S --noconfirm krita krita-plugin-gmic \ + # screencast and screenshot + # kazam 将输入的字符转为 ASCII logo + # recordmydesktop 命令行版本录屏 + # simplescreenrecorder 录屏 + # && pacman -S --noconfirm shutter asciinema recordmydesktop simplescreenrecorder \ + # FTP Client + # && pacman -S --noconfirm filezilla \ + # && pacman -S --noconfirm firefox firefox-developer-edition firefox-i18n-zh-cn firefox-developer-edition-i18n-zh-cn \ + # Security + # && pacman -S --noconfirm clamav clamtk ufw gufw \ + # fonts + # noto-fonts-cjk 文件过大 292 MB + # noto-fonts 114M + # && pacman -S --noconfirm ttf-ubuntu-font-family noto-fonts-emoji wqy-microhei wqy-zenhei wqy-microhei ttf-fira-code ttf-fira-mono ttf-jetbrains-mono woff-fira-code ttf-liberation powerline-fonts \ + && rm -fr /var/cache/pacman/pkg/* \ + && rm -fr /var/lib/pacman/sync/* diff --git a/images/boxs/xfce-arch/Dockerfile b/images/boxs/xfce-arch/Dockerfile new file mode 100644 index 00000000..425a6d84 --- /dev/null +++ b/images/boxs/xfce-arch/Dockerfile @@ -0,0 +1,31 @@ +FROM ghcr.io/dockenv/boxs:xfce-arch-base +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +ENV USER="boxs" \ + PASSWD="boxs" \ + AUTHORIZED_KEYS='**None**' \ + DEBIAN_FRONTEND=noninteractive \ + TERM=xterm \ + NO_VNC_HOME=/opt/noVNC \ + VNC_COL_DEPTH=24 \ + VNC_RESOLUTION=1920x1080 \ + VNC_PASSWD=boxsvnc \ + DISPLAY=:1 \ + VNC_PORT=5901 \ + NO_VNC_PORT=6901 \ + SSH_PORT=22 + +ENV HOME_DIR=/home/$USER +ENV VNC_PASSWD_PATH="${HOME_DIR}/.vnc" + +COPY conf /tmp/conf + +RUN bash /tmp/conf/bootstrap.sh && rm -fr /tmp/conf/bootstrap.sh + +USER ${USER} +WORKDIR ${HOME_DIR} + +EXPOSE 22 80 443 6080 ${VNC_PORT} ${NO_VNC_PORT} + +CMD ["/bin/bash", "/usr/bin/entrypoint"] diff --git a/images/boxs/xfce-arch/bootstrap.sh b/images/boxs/xfce-arch/bootstrap.sh new file mode 100644 index 00000000..b845efaa --- /dev/null +++ b/images/boxs/xfce-arch/bootstrap.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +### + # @Author: Cloudflying + # @Date: 2021-10-25 17:32:09 + # @LastEditTime: 2021-12-06 22:47:35 + # @LastEditors: Cloudflying + # @Description: + # @FilePath: /dockenv/images/boxs/xfce-arch/bootstrap.sh +### + +mkdir -p ~/.vnc +echo 'boxsvnc' | vncpasswd -f > ~/.vnc/passwd +chmod 600 ~/.vnc/passwd + +/usr/bin/vncserver :1 > /tmp/vnc.log 2>&1 & +dbus-launch /usr/bin/xfce4-session --display=:1 > /tmp/xfce4-session.log 2>&1 & +# dbus-launch /usr/bin/startxfce4 +xfwm4 +xfsettingsd +xfdesktop +xfce4-session +wrapper-2.0:149 + +# yelp yelp-xsl zenity pavucontrol x11vnc + # multimedia Pic Viewer + # inkscape vector-based drawing program + # apt install -y --no-install-recommends nomacs smplayer inkscape \ + # Twin panel file management for your desktop + # kdiff3 kcompare arj unarj + # && apt install -y --no-install-recommends krusader krename \ diff --git a/images/boxs/xfce-arch/conf/00-motd b/images/boxs/xfce-arch/conf/00-motd new file mode 100644 index 00000000..1727caec --- /dev/null +++ b/images/boxs/xfce-arch/conf/00-motd @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + # Ubuntu 20.04.3 LTS (GNU/Linux 5.10.47-linuxkit x86_64) +OSNAME=$(grep '^NAME=' /etc/os-release | awk -F '"' '{print $2}') +DISTRIB_DESCRIPTION=$(grep 'VERSION=' /etc/os-release | awk -F '"' '{print $2}') +echo "Welcome to ${OSNAME} ${DISTRIB_DESCRIPTION} ($(uname -o) $(uname -r) $(uname -m)) " +printf "\n" +printf " * Documentation: https://help.ubuntu.com\n" +printf " * Management: https://landscape.canonical.com\n" +printf " * Support: https://ubuntu.com/advantage\n" +echo -e "\n" +echo "System load :$(uptime | awk -F ':' '{print $5}')" +echo "Processes : $(ps -aux | wc -l)" +echo "Logged users : $(who | wc -l)" +echo "Usage of / : $(df -h | grep '/$' | awk -F ' ' '{print $5}') of $(df -h | grep '/$' | awk -F ' ' '{print $2}')" +echo "Last login : $(last boxs | grep boxs | awk -F ' ' '{print $4" "$5" "$6" "$7}') from $(last boxs | grep boxs | awk -F ' ' '{print $3}')" + +echo -e "\nSystem infomation:\n" + +echo "CPU :$(grep '^model\ name' /proc/cpuinfo | head -n 1 | awk -F ':' '{print $2}') x $(grep -c 'processor' /proc/cpuinfo)" +echo "Mem : $(free -h | grep '^Mem' | awk -F ' ' '{print $2}')" +echo "Swap : $(free -h | grep '^Swap' | awk -F ' ' '{print $2}')" + +if [[ -f '/.dockerenv' ]]; then + echo "" + echo "This system has been minimized by removing packages and content that are" + echo "not required on a system that users do not log into." + echo "" + echo "To restore this content, you can run the 'unminimize' command." +fi + +# if the current release is under development there won't be a new one +if [ "$(lsb_release -sd | cut -d' ' -f4)" = "(development" ]; then + exit 0 +fi +if [ -x /usr/lib/ubuntu-release-upgrader/release-upgrade-motd ]; then + exec /usr/lib/ubuntu-release-upgrader/release-upgrade-motd +fi + +if [ -x /usr/lib/update-notifier/update-motd-hwe-eol ]; then + exec /usr/lib/update-notifier/update-motd-hwe-eol +fi + +if [ -x /usr/lib/update-notifier/update-motd-fsck-at-reboot ]; then + exec /usr/lib/update-notifier/update-motd-fsck-at-reboot +fi + +if [ -x /usr/lib/update-notifier/update-motd-reboot-required ]; then + exec /usr/lib/update-notifier/update-motd-reboot-required +fi diff --git a/images/boxs/xfce-arch/conf/bootstrap.sh b/images/boxs/xfce-arch/conf/bootstrap.sh new file mode 100644 index 00000000..45b25c21 --- /dev/null +++ b/images/boxs/xfce-arch/conf/bootstrap.sh @@ -0,0 +1,137 @@ +#!/usr/bin/env bash +### + # @Author: Cloudflying + # @Date: 2021-10-18 22:48:51 + # @LastEditTime: 2021-12-06 21:31:09 + # @LastEditors: Cloudflying + # @Description: + # @FilePath: /dockenv/images/boxs/xfce-arch/conf/bootstrap.sh +### +mv /tmp/conf/entrypoint.sh /usr/bin/entrypoint +chmod +x /usr/bin/entrypoint + +echo "==> Fix local env" +# rm -fr /etc/update-motd.d/* +# mv /tmp/conf/00-motd /etc/update-motd.d/00-header + +# sed -i 's/mirrors.aliyun.com/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list +# sed -i 's/mirrors.aliyun.com/mirror.nju.edu.cn/g' /etc/apt/sources.list +# sed -i 's/mirrors.aliyun.com/mirrors.cloud.tencent.com/g' /etc/apt/sources.list +# sed -i 's/mirrors.aliyun.com/mirrors.huaweicloud.com/g' /etc/apt/sources.list +# sed -i 's/mirrors.aliyun.com/mirror.lzu.edu.cn/g' /etc/apt/sources.list +# sed -i 's/mirrors.aliyun.com/mirrors.163.com/g' /etc/apt/sources.list + +mkdir -p /tmp/.deps +cd /tmp/.deps + +# if [[ -z "$(command -v vncserver)" ]]; then +# wget -qc https://cloudflying-generic.pkg.coding.net/storage/mirrors/pkgs/tigervnc/tigervnc-1.10.0.x86_64.tar.gz +# tar -xf tigervnc-1.10.0.x86_64.tar.gz +# cp -fr tigervnc-1.10.0.x86_64/* / +# fi + +if [[ ! -d '/opt/novnc' ]]; then + wget -qc https://cloudflying-generic.pkg.coding.net/storage/mirrors/pkgs/novnc/noVNC-1.2.0.tar.gz + tar -xf noVNC-1.2.0.tar.gz + mv noVNC-1.2.0 /opt/novnc + sed -i "#s#noVNC#Docker Ubuntu Xfce4 Desktop#g" /opt/novnc/vnc.html +fi + +cd && rm -fr /tmp/.deps + +if [[ ! -f "${HOME_DIR}/.zshrc" ]]; then + useradd -d /home/${USER} -m -s "$(command -v zsh)" ${USER} + echo "${USER}:${PASSWD}" | chpasswd + echo "root:${PASSWD}" | chpasswd + echo "${USER} ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers + # git clone --depth 1 https://e.coding.net/pkgs/oh-my-zsh/oh-my-zsh.git ${HOME_DIR}/.oh-my-zsh + cp -fr /tmp/oh-my-zsh ${HOME_DIR}/.oh-my-zsh + # cp ${HOME_DIR}/.oh-my-zsh/templates/zshrc.zsh-template ${HOME_DIR}/.zshrc + mv /tmp/conf/zshrc ${HOME_DIR}/.zshrc + sed -i 's/ZSH_THEME.*/ZSH_THEME="strug"/g' ${HOME_DIR}/.zshrc +fi + +[ ! -d '/run/sshd' ] && mkdir -p /run/sshd +[ ! -d '/etc/supervisor.d' ] && mkdir -p /etc/supervisor.d +[ -f '/tmp/conf/supervisord.conf' ] && mv /tmp/conf/supervisord.conf /etc/supervisor.d/supervisord.ini + +# 程序启动文件 快捷方式 +mkdir -p ${HOME_DIR}/.local/share/applications/desktop +# 存放icon图标和cursor主题 +mkdir -p ${HOME_DIR}/.local/share/icons +mkdir -p ${HOME_DIR}/.fonts +# 存放主题文件 含有 xfwm4 目录 +mkdir -p ${HOME_DIR}/.themes +mkdir -p ${HOME_DIR}/.backgrounds +# 自启动程序放置目录 .desktop 文件 +mkdir -p ${HOME_DIR}/.config/autostart + +if [[ -z "${SSH_PORT}" ]]; then + SSH_PORT=22 +fi + +echo '==> Config SSH Configure' +# Archlinux 需要手动生成 +ssh-keygen -A +sed -i 's/^#ClientAliveInterval.*/ClientAliveInterval 60/g' /etc/ssh/sshd_config +sed -i 's/^#PermitRootLogin.*/PermitRootLogin no/g' /etc/ssh/sshd_config +sed -i "s/^#Port.*/Port ${SSH_PORT}/g" /etc/ssh/sshd_config +sed -i "s/^#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/g" /etc/ssh/sshd_config +# 不使用公匙 +# sed -i "s/UsePAM.*/UsePAM no/g" /etc/ssh/sshd_config + + +mkdir -p /var/log/ +touch /var/log/sshd.log + +# 更新本地环境 +# 本地语言 +# echo "LANG=en_US.UTF-8" >> /etc/environment +# echo "LC_ALL=en_US.UTF-8" >> /etc/environment +# echo "LANG=en_US.UTF-8" > /etc/locale.conf +# echo "LC_ALL=en_US.UTF-8" >> /etc/locale.conf + +# LANG="en_US.UTF-8" +# LANGUAGE="en_US.UTF-8" +# LC_CTYPE="UTF-8" +# LC_MESSAGES="en_US.UTF-8" +# LC_TIME="en_US.UTF-8" +# LC_ALL="en_US.UTF-8" +# locale-gen en_US.UTF-8 zh_CN.UTF-8 + +# 本地时区设定 +echo 'Asia/Shanghai' > /etc/timezone +rm -fr /etc/localtime && ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime + +# 删除环境不需要的字体 主题 文档等等 +rm -fr /usr/share/themes/Daloa +rm -fr /usr/share/themes/Kokodi +rm -fr /usr/share/themes/Moheli +rm -fr /usr/share/themes/Default-xhdpi +rm -fr /usr/share/themes/Default-hdpi + +# neovim +mkdir -p ${HOME_DIR}/.config/nvim +mv /tmp/conf/init.vim ${HOME_DIR}/.config/nvim/init.vim + +rm -fr /tmp/* + +mkdir -p ${HOME_DIR}/.pip && touch ${HOME_DIR}/.pip/pip.conf + +echo "[global] +index-url = https://mirrors.aliyun.com/pypi/simple/ + +[install] +trusted-host=mirrors.aliyun.com" > ${HOME_DIR}/.pip/pip.conf + +mkdir -p $VNC_PASSWD_PATH +echo "$VNC_PASSWD" | vncpasswd -f > $VNC_PASSWD_PATH/passwd +chown -R ${USER}:${USER} ${HOME_DIR} +chmod -R 755 ${HOME_DIR} +chmod 600 $VNC_PASSWD_PATH/passwd +# Systemd Autostart +# ls -lha /usr/lib/systemd/system/ +# ls -lha /etc/systemd/system/multi-user.target.wants/ +mkdir -p /etc/systemd/system/multi-user.target.wants/ +ln -s /usr/lib/systemd/system/sshd.service /etc/systemd/system/multi-user.target.wants/sshd.service +ln -s /usr/lib/systemd/system/supervisord.service /etc/systemd/system/multi-user.target.wants/supervisord.service diff --git a/images/boxs/xfce-arch/conf/boxs-init.sh b/images/boxs/xfce-arch/conf/boxs-init.sh new file mode 100644 index 00000000..adc1faee --- /dev/null +++ b/images/boxs/xfce-arch/conf/boxs-init.sh @@ -0,0 +1,62 @@ +#!/usr/bin/env bash +### + # @Author: Cloudflying + # @Date: 2021-10-26 13:29:54 + # @LastEditTime: 2021-10-26 13:33:14 + # @LastEditors: Cloudflying + # @Description: XFCE Boxs Environment Init + # @FilePath: /dockenv/images/boxs/xfce-arch/conf/boxs-init.sh +### + +#golang env +init_golang(){ + echo "Setting Golang Environment" + mkdir -p $HOME_DIR/.go/bin + mkdir -p $HOME_DIR/.go/src + mkdir -p $HOME_DIR/.go/pkg + echo "export GOBIN="$HOME_DIR/.go/bin"" >> $HOME_DIR/.zshrc + echo "export GOPATH="$HOME_DIR/.go/"" >> $HOME_DIR/.zshrc +} + +init_node(){ + echo "Set Node Environment" + # sudo -Hu ${USER} npm config set registry https://registry.npm.taobao.org + echo "registry=https://registry.npm.taobao.org" > ${HOME_DIR}/.npmrc + # echo "Install yarn" + # npm install -g yarn + # npm install -g webpack + # npm install -g bower + # npm install -g gulp-cli + # npm install -g grunt-cli +} + +init_php(){ + USER=$1 + # Set Some PHP CLI Settings + sudo sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.2/cli/php.ini + sudo sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.2/cli/php.ini + sudo sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.2/cli/php.ini + wget https://coding.net/u/imxieke/p/attachment/git/raw/master/pkgs/zray-standalone-php72.tar.gz -O - | sudo tar -xzf - -C /opt + chown -R ${USER}:${USER} /opt/zray + ln -sf /opt/zray/zray.ini /etc/php/7.2/cli/conf.d/zray.ini + ln -sf /opt/zray/zray.ini /etc/php/7.2/fpm/conf.d/zray.ini + ln -sf /opt/zray/lib/zray.so /usr/lib/php/20170718/zray.so + + # Current is 1.6.5 version + wget https://coding.net/u/imxieke/p/attachment/git/raw/master/pkgs/composer.phar -O /bin/composer + chmod +x /bin/composer + sudo -Hu ${USER} composer config -g repo.packagist composer https://packagist.laravel-china.org + + # WordPress Cli + wget https://coding.net/u/imxieke/p/attachment/git/raw/master/pkgs/wp-cli.phar -O /bin/wp-cli + chmod +x /bin/composer + + #Adminer php mysql manager + mkdir -p /var/www/tools + wget https://coding.net/u/imxieke/p/attachment/git/raw/master/code/adminer-4.6.3.php -O /var/www/tools/adminer.php + #vim /etc/nginx/sites-available/homestead.app + #insert new location below location /: + #location /ZendServer { + # try_files $uri $uri/ /ZendServer/index.php?$args; + #} +} diff --git a/images/boxs/xfce-arch/conf/entrypoint.sh b/images/boxs/xfce-arch/conf/entrypoint.sh new file mode 100644 index 00000000..1ccf1175 --- /dev/null +++ b/images/boxs/xfce-arch/conf/entrypoint.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +### + # @Author: Cloudflying + # @Date: 2021-10-19 14:13:26 + # @LastEditTime: 2021-12-06 23:17:34 + # @LastEditors: Cloudflying + # @Description: + # @FilePath: /dockenv/images/boxs/xfce-arch/conf/entrypoint.sh +### +HOST_IP=$(hostname -i) +# echo '==> start vncserver and noVNC webclient && dbus' +# sudo /etc/init.d/dbus start > /dev/null + +if [[ "$VNC_PASSWD" != 'boxs' ]]; then + chmod 755 $VNC_PASSWD_PATH/passwd + echo "$VNC_PASSWD" | vncpasswd -f > $VNC_PASSWD_PATH/passwd + chmod 600 $VNC_PASSWD_PATH/passwd +fi + +vncserver -kill $DISPLAY > /dev/null 2>&1 || rm -rfv /tmp/.X*-lock /tmp/.X11-unix +rm -fr /tmp/.X1* +# /bin/vncserver $DISPLAY -depth $VNC_COL_DEPTH -geometry ${VNC_RESOLUTION} > /tmp/vncserver.log 2>&1 & + +# 重置 SSH 端口 +if [[ "${SSH_PORT}" != 22 ]]; then + sudo sed -i "s/^Port.*/Port ${SSH_PORT}/g" /etc/ssh/sshd_config + # sudo service ssh restart > /dev/null +fi + +sudo /usr/bin/supervisord -c /etc/supervisor.d/supervisord.ini -l /var/log/supervisord.log -j /var/run/supervisord.pid +# /usr/bin/vncserver :1 + +echo "======================================================================" +echo "You can now connect to this container via SSH using: " +echo " ssh ${USER}@${HOST_IP} -p ${SSH_PORT} " +echo "Enter the ${USER} password => '${PASSWD}' when prompted " +echo "Please remember to change the above password as soon as possible! " +echo "================Boxs VNC Config=======================================" +echo " VNC Port : ${VNC_PORT} " +echo " noVNC Port : ${NO_VNC_PORT} " +echo " VNC Password : ${VNC_PASSWD} " +echo "======================================================================" +echo " Boxs is Running " +echo "======================================================================" +# redirect log put desktop will not work +# /usr/bin/vncserver :1 2>1 >> /var/run/vncserver.log +/usr/bin/vncserver :1 +tail -f /etc/os-release > /dev/null diff --git a/images/boxs/xfce-arch/conf/entrypoint.sh.bak b/images/boxs/xfce-arch/conf/entrypoint.sh.bak new file mode 100644 index 00000000..7c1c1308 --- /dev/null +++ b/images/boxs/xfce-arch/conf/entrypoint.sh.bak @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +### + # @Author: Cloudflying + # @Date: 2021-10-19 14:13:26 + # @LastEditTime: 2021-10-27 14:52:28 + # @LastEditors: Cloudflying + # @Description: + # @FilePath: /dockenv/images/boxs/xfce-arch/conf/entrypoint.sh +### +HOST_IP=$(hostname -i) +# echo '==> start vncserver and noVNC webclient && dbus' +# sudo /etc/init.d/dbus start > /dev/null + +if [[ "$VNC_PASSWD" != 'boxs' ]]; then + chmod 755 $VNC_PASSWD_PATH/passwd + echo "$VNC_PASSWD" | vncpasswd -f > $VNC_PASSWD_PATH/passwd + chmod 600 $VNC_PASSWD_PATH/passwd +fi + +vncserver -kill $DISPLAY > /dev/null 2>&1 || rm -rfv /tmp/.X*-lock /tmp/.X11-unix +rm -fr /tmp/.X1* +# /bin/vncserver $DISPLAY -depth $VNC_COL_DEPTH -geometry ${VNC_RESOLUTION} > /tmp/vncserver.log 2>&1 & + +# 重置 SSH 端口 +if [[ "${SSH_PORT}" != 22 ]]; then + sudo sed -i "s/^Port.*/Port ${SSH_PORT}/g" /etc/ssh/sshd_config + # sudo service ssh restart > /dev/null +fi + +sudo /usr/bin/supervisord -c /etc/supervisor.d/supervisord.ini -l /var/log/supervisord.log -j /var/run/supervisord.pid +# /usr/bin/vncserver :1 + +echo "======================================================================" +echo "You can now connect to this container via SSH using: " +echo " ssh ${USER}@${HOST_IP} -p ${SSH_PORT} " +echo "Enter the ${USER} password => '${PASSWD}' when prompted " +echo "Please remember to change the above password as soon as possible! " +echo "================Boxs VNC Config=======================================" +echo " VNC Port : ${VNC_PORT} " +echo " noVNC Port : ${NO_VNC_PORT} " +echo " VNC Password : ${VNC_PASSWD} " +echo "======================================================================" +echo " Boxs is Running " +echo "======================================================================" +# tail -f /etc/os-release > /dev/null +/usr/bin/vncserver :1 diff --git a/images/boxs/xfce-arch/conf/init.vim b/images/boxs/xfce-arch/conf/init.vim new file mode 100644 index 00000000..bd62ef42 --- /dev/null +++ b/images/boxs/xfce-arch/conf/init.vim @@ -0,0 +1,32 @@ +syntax on " enable syntax highlighting +set hidden " Required for operations modifying multiple buffers like rename. + +" 启用主题 +set background=light + +filetype plugin indent on " enable indentations +set list +set modeline +set mouse=a " enable mouse interaction +set incsearch ignorecase smartcase hlsearch " highlight text while searching + +set number " 显示行号 + +set ruler +set wrap " wrap text 自动折行 +set nobackup " 设置取消备份 禁止临时文件生成 +set fenc=utf-8 " 文件编码 +set encoding=utf-8 +set cursorline " 突出显示当前行 +set cursorcolumn " 突出显示当前列 + +set laststatus=2 +" set noshowmode " 不显示运行模式 +set ignorecase +set smartcase +set autoindent smartindent " enable indentation +set tabstop=4 +set shiftwidth=4 +set emoji " enable emojis +set history=1000 " history limit +set title " tab title as file name diff --git a/images/boxs/xfce-arch/conf/supervisord.conf b/images/boxs/xfce-arch/conf/supervisord.conf new file mode 100644 index 00000000..02c059ee --- /dev/null +++ b/images/boxs/xfce-arch/conf/supervisord.conf @@ -0,0 +1,42 @@ +[supervisord] +user=root +nodaemon=false + +[program:sshd] +startretries=3 +command=/bin/sshd -D +user=root +autorestart=true +priority=10 +stdout_logfile=/var/log/sshd.log +redirect_stderr=true +stopsignal=QUIT + +[program:novnc] +startretries=3 +priority=250 +directory=/opt/novnc +command=/opt/novnc/utils/launch.sh --vnc 0.0.0.0:5901 --listen 6901 +user=root +autostart=true +autorestart=true +stopsignal=QUIT +stdout_logfile=/var/log/novnc.log +redirect_stderr=true +stopasgroup=true + +;example +;[program:boxs] +;priority=10 +;autorestart = true ; 程序异常退出后自动重启 +;autostart = true ; 在 supervisord 启动的时候也自动启动 +;command = gunicorn -w 8 -b 0.0.0.0:17510 wsgi:app ; 启动命令 +;directory = path/to/app ; 程序的启动目录 +;environment=DISPLAY=":1",HOME="/root" +;startsecs = 5 ; 启动 5 秒后没有异常退出,就当作已经正常启动了 +;startretries = 3 ; 启动失败自动重试次数,默认是 3 +;stopsignal=QUIT +;redirect_stderr = true ; 把 stderr 重定向到 stdout,默认 false +;stdout_logfile=/var/log/xfce4.log +;stderr_logfile=/var/log/xfce4.err +;user = boxs ; 用哪个用户启动 diff --git a/images/boxs/xfce-arch/conf/supervisord.ini.bak b/images/boxs/xfce-arch/conf/supervisord.ini.bak new file mode 100644 index 00000000..3220a889 --- /dev/null +++ b/images/boxs/xfce-arch/conf/supervisord.ini.bak @@ -0,0 +1,51 @@ + + +;[program:xfce4-session] +;priority=15 +;directory=/ +command=dbus-launch /usr/bin/xfce4-session --display=:1 +# environment=HOME='/home/boxs',XDG_RUNTIME_DIR='/run/user/1000',DBUS_SESSION_BUS_ADDRESS='/run/user/1000/bus' +user=boxs +autostart=true +autorestart=true +stopsignal=QUIT +stdout_logfile=/var/log/xfce4-session.log +stderr_logfile=/var/log/xfce4-session.err + +[program:vnc] +priority=10 +directory=/home/boxs +command=/usr/bin/vncserver :1 +# environment=HOME='/home/boxs' +environment=HOME='/home/boxs',XDG_RUNTIME_DIR='/run/user/1000',DBUS_SESSION_BUS_ADDRESS='unix:path=/run/user/1000/bus',XDG_SESSION_ID=17,XDG_SESSION_TYPE=tty,XDG_SESSION_CLASS=user +user=boxs +autostart=true +autorestart=true +stopsignal=QUIT +stdout_logfile=/var/log/vncserver.log +stderr_logfile=/var/log/vncserver.err + +[program:vnc] +priority=10 +directory=/home/boxs +command=/usr/bin/vncserver :1 +;environment=HOME='/home/boxs',DBUS_SESSION_BUS_ADDRESS='unix:path=/run/user/1000/bus',XDG_SESSION_ID=17,XDG_SESSION_TYPE=tty,XDG_SESSION_CLASS=user,DISPLAY=:1.0,DESKTOP_SESSION=xfce,XDG_SESSION_DESKTOP=xfceGTK_MODULES=canberra-gtk-module:canberra-gtk-module,XDG_CONFIG_DIRS=/etc/xdg,GDMSESSION=xfce +environment=HOME='/home/boxs',XDG_RUNTIME_DIR='/run/user/1000',DBUS_SESSION_BUS_ADDRESS='unix:path=/run/user/1000/bus' +user=boxs +autostart=true +autorestart=true +stopsignal=QUIT +stdout_logfile=/var/log/vncserver.log +stderr_logfile=/var/log/vncserver.err + +[program:xfce4-session] +priority=15 +;directory=/ +command=dbus-launch /usr/bin/xfce4-session --display=:1 +environment=HOME='/home/boxs',XDG_RUNTIME_DIR='/run/user/1000',DBUS_SESSION_BUS_ADDRESS='/run/user/1000/bus' +user=boxs +autostart=true +autorestart=true +stopsignal=QUIT +stdout_logfile=/var/log/xfce4-session.log +stderr_logfile=/var/log/xfce4-session.err diff --git a/images/boxs/xfce-arch/conf/zshrc b/images/boxs/xfce-arch/conf/zshrc new file mode 100644 index 00000000..74c22cf1 --- /dev/null +++ b/images/boxs/xfce-arch/conf/zshrc @@ -0,0 +1,118 @@ +### + # @Author: Cloudflying + # @Date: 2021-10-25 11:08:11 + # @LastEditTime: 2021-12-06 23:09:29 + # @LastEditors: Cloudflying + # @Description: + # @FilePath: /dockenv/images/boxs/xfce-arch/conf/zshrc +### +# If you come from bash you might have to change your $PATH. +export PATH=$HOME/.bin:$HOME/.local/bin:$PATH +# export MANPATH="/usr/local/man:$MANPATH" + +# Path to your oh-my-zsh installation. +export ZSH=$HOME/.oh-my-zsh + +# Set name of the theme to load --- if set to "random", it will +# load a random theme each time oh-my-zsh is loaded, in which case, +# to know which specific one was loaded, run: echo $RANDOM_THEME +# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes +ZSH_THEME="strug" + +# Set list of themes to pick from when loading at random +# Setting this variable when ZSH_THEME="strug" +# a theme from this variable instead of looking in $ZSH/themes/ +# If set to an empty array, this variable will have no effect. +# ZSH_THEME="strug" + +# Uncomment the following line to use case-sensitive completion. +# CASE_SENSITIVE="true" + +# Uncomment the following line to use hyphen-insensitive completion. +# Case-sensitive completion must be off. _ and - will be interchangeable. +# HYPHEN_INSENSITIVE="true" + +# Uncomment the following line to disable bi-weekly auto-update checks. +# DISABLE_AUTO_UPDATE="true" + +# Uncomment the following line to automatically update without prompting. +# DISABLE_UPDATE_PROMPT="true" + +# Uncomment the following line to change how often to auto-update (in days). +# export UPDATE_ZSH_DAYS=13 + +# Uncomment the following line if pasting URLs and other text is messed up. +# DISABLE_MAGIC_FUNCTIONS="true" + +# Uncomment the following line to disable colors in ls. +# DISABLE_LS_COLORS="true" + +# Uncomment the following line to disable auto-setting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment the following line to enable command auto-correction. +# ENABLE_CORRECTION="true" + +# Uncomment the following line to display red dots whilst waiting for completion. +# Caution: this setting can cause issues with multiline prompts (zsh 5.7.1 and newer seem to work) +# See https://github.com/ohmyzsh/ohmyzsh/issues/5765 +# COMPLETION_WAITING_DOTS="true" + +# Uncomment the following line if you want to disable marking untracked files +# under VCS as dirty. This makes repository status check for large repositories +# much, much faster. +# DISABLE_UNTRACKED_FILES_DIRTY="true" + +# Uncomment the following line if you want to change the command execution time +# stamp shown in the history command output. +# You can set one of the optional three formats: +# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# or set a custom format using the strftime function format specifications, +# see 'man strftime' for details. +# HIST_STAMPS="mm/dd/yyyy" + +# Would you like to use another custom folder than $ZSH/custom? +# ZSH_CUSTOM=/path/to/new-custom-folder + +# Which plugins would you like to load? +# Standard plugins can be found in $ZSH/plugins/ +# Custom plugins may be added to $ZSH_CUSTOM/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +# Add wisely, as too many plugins slow down shell startup. +plugins=(git composer) + +source $ZSH/oh-my-zsh.sh + +# User configuration + +# You may need to manually set your language environment +export LANG=en_US.UTF-8 +export LANGUAGE=en_US.UTF-8 +export LC_ALL=en_US.UTF-8 + +if [[ -z "${SHELL}" ]]; then + SHELL=$(command -v zsh) +fi + +# Set Default Editor +if [[ ! -z $(command -v nvim) ]]; then + export EDITOR='nvim' + export VISUAL='nvim' +elif [[ ! -z $(command -v vim) ]]; then + export EDITOR='vim' + export VISUAL='vim' +fi + +alias vi=$(which ${EDITOR}) +alias vim=$(which ${EDITOR}) + +alias ssh="ssh -o ServerAliveInterval=60" +alias ping='ping -c 5' + +# Compilation flags +# export ARCHFLAGS="-arch x86_64" + +# Set personal aliases, overriding those provided by oh-my-zsh libs, +# plugins, and themes. Aliases can be placed here, though oh-my-zsh +# users are encouraged to define aliases within the ZSH_CUSTOM folder. +# For a full list of active aliases, run `alias`. diff --git a/images/boxs/xfce-base/Dockerfile b/images/boxs/xfce-base/Dockerfile new file mode 100644 index 00000000..4873fc94 --- /dev/null +++ b/images/boxs/xfce-base/Dockerfile @@ -0,0 +1,94 @@ +FROM ghcr.io/dockenv/debian:sid +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +ENV DEBIAN_FRONTEND=noninteractive + + +RUN echo "deb http://repo.huaweicloud.com/debian sid main" > /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/debian sid contrib" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/debian sid non-free" >> /etc/apt/sources.list \ + && apt update -y \ + && apt upgrade -y \ + && apt install -y xfce4 xfce4-terminal xfce4-whiskermenu-plugin xfce4-datetime-plugin xfce4-goodies \ + xfce4-panel-profiles xfce4-screenshooter xfce4-systemload-plugin xfce4-taskmanager \ + # System +# for compile +# apt_add build-essential + && apt install -y systemd init lsb-release apt-transport-https apt-utils software-properties-common \ + && apt install -y --no-install-recommends locales supervisor sudo openssh-server \ + && apt install -y --no-install-recommends python3 python3-pip python3-apt iso-codes openssl gnupg lsof \ + universal-ctags strace psmisc file psutils dnsutils expect \ + && apt install -y --no-install-recommends bat zsh git wget curl httpie axel neovim jq tree screen less iftop enca \ + # Archive Compress + && apt install -y --no-install-recommends 7zip brotli bzip2 lunzip lzip rpm rar unalz unar unrar unzip unrar-free zip zstd gzip \ + p7zip p7zip-full p7zip-rar \ + # cabextract xz-utils \ + && apt install -y --no-install-recommends net-tools procps htop netcat-openbsd rsync iproute2 whois \ + # Python Plguins + && apt install -y --no-install-recommends python3-software-properties python3-neovim \ + && apt install -y --no-install-recommends xinit xauth pkg-config yelp yelp-xsl zenity \ + # dialog Displays user-friendly dialog boxes from shell scripts + && apt install -y --no-install-recommends pavucontrol apulse dialog xvfb alsamixergui alsa-utils alsa-oss alsa-tools alsa-tools-gui \ + # 测试是否可以删除 libgl1-mesa-dri libnss-wrapper mesa-utils + # xserver-xorg-video-fbdev xserver-xorg-video-vesa xserver-xorg-input-evdev + && apt install -y tigervnc-standalone-server xrdp xorgxrdp x11vnc dbus dbus-x11 xdg-utils openbox openbox-menu \ + # && apt install -y --no-install-recommends fonts-ubuntu fonts-noto-mono ttf-ubuntu-font-family ttf-wqy-zenhei xfonts-base xfonts-100dpi \ + # xfonts-75dpi xfonts-scalable xfonts-cyrillic ttf-wqy-zenhei fonts-wqy-zenhei fonts-wqy-microhei xfonts-wqy fonts-mononoki \ + # fonts-noto-mono fonts-liberation \ + && pip install websockify \ + # editor 考虑 sublime text 为替代品 + # && apt install -y --no-install-recommends gedit \ + # 暂时不考虑使用 + # for system service 17 MB + # && apt install -y --no-install-recommends gvfs gvfs-backends gvfs-bin gvfs-fuse \ + # 139 MB + # && apt install -y --no-install-recommends fuse3 fuse-overlayfs fuse2fs fusecram fusefat fuseiso fusesmb \ + # 美化 + # mcdu ncurses disk usage viewer + # catfish 文件搜索神器 + # bleachbit 清理系统垃圾文件 + # meld 视觉差异和合并工具。MELD帮助您比较文件、目录和版本控制的项目 + # synapse 启动器 类似 alfred 的简陋版本 + # fzf 命令行文件快速搜索 + # thunderbird Mail Client + # && apt install -y --no-install-recommends menulibre ncdu catfish bleachbit meld synapse fzf thunderbird \ + # Remote Desktop + # && apt install --no-install-recommends -y remmina remmina-plugin-rdp remmina-plugin-vnc remmina-plugin-secret \ + # remmina-plugin-exec remmina-plugin-kwallet remmina-plugin-nx remmina-plugin-spice remmina-plugin-www remmina-plugin-xdmcp + + # multimedia Pic Viewer + # inkscape vector-based drawing program + # apt install -y --no-install-recommends nomacs smplayer inkscape \ + # Twin panel file management for your desktop + # kdiff3 kcompare arj unarj + # && apt install -y --no-install-recommends krusader krename \ + # && apt install -y --no-install-recommends language-pack-zh-hans \ + # Other Packages + # && apt install -y --no-install-recommends sshfs proxychains4 tcpdump \ + # Downloader + # && apt install -y --no-install-recommends aria2 rtorrent qbittorrent deluge deluged deluge-console deluge-web \ + # && apt install -y --no-install-recommends tmux ffmpeg \ + # midori 轻量级浏览器 + # && apt install -y --no-install-recommends midori firefox firefox-locale-zh-hans \ + # Security + # clamtk GUI 不好用 + # gufw ufw GUI + # && apt install --no-install-recommends -y clamav clamtk ufw gufw \ + # Okular universal document viewer 文档阅读软件,支持 PDF、TIFF、CHM、ODF、EPUB、mobi 等文档格式 + # && apt install --no-install-recommends -y okular \ + # Office + # libreoffice + # && apt install --no-install-recommends -y libreoffice libreoffice-help-zh-cn libreoffice-l10n-zh-cn \ + # File Manager + # && apt install --no-install-recommends -y thunar thunar-archive-plugin thunar-gtkhash thunar-volman + # && apt install -y --no-install-recommends chromium-browser chromium-browser-l10n chromium-bsu-data chromium-codecs-ffmpeg \ + # Editor && IDE + # && apt install -y --no-install-recommends mousepad geany + # Install sound dev 暂时用不到 + # && apt install -y --no-install-recommends libasound2-dev libwebkit2gtk-4.0-dev + # && apt install -y --fix-missing \ + && apt autoremove -y \ + && apt-get autoclean -y \ + && rm -fr /var/lib/apt/lists/* diff --git a/images/boxs/xfce/Dockerfile b/images/boxs/xfce/Dockerfile new file mode 100644 index 00000000..4f7c53ef --- /dev/null +++ b/images/boxs/xfce/Dockerfile @@ -0,0 +1,31 @@ +FROM ghcr.io/dockenv/boxs:xfce-base +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +COPY conf /tmp/conf + +ENV USER="boxs" \ + PASSWD="boxs" \ + AUTHORIZED_KEYS='**None**' \ + DEBIAN_FRONTEND=noninteractive \ + TERM=xterm \ + NO_VNC_HOME=/opt/noVNC \ + VNC_COL_DEPTH=24 \ + VNC_RESOLUTION=1920x1080 \ + VNC_PASSWD=vncboxs \ + DISPLAY=:1 \ + VNC_PORT=5901 \ + NO_VNC_PORT=6901 \ + SSH_PORT=22 + +ENV HOME_DIR=/home/$USER + +RUN bash /tmp/conf/bootstrap.sh && rm -fr /tmp/conf/bootstrap.sh + +USER ${USER} +WORKDIR ${HOME_DIR} + +EXPOSE 22 80 443 6080 ${VNC_PORT} ${NO_VNC_PORT} + +CMD ["/bin/bash", "/usr/bin/entrypoint"] diff --git a/images/boxs/xfce/conf/00-motd b/images/boxs/xfce/conf/00-motd new file mode 100644 index 00000000..6215f9a8 --- /dev/null +++ b/images/boxs/xfce/conf/00-motd @@ -0,0 +1,57 @@ +### + # @Author: Cloudflying + # @Date: 2021-10-23 01:14:23 + # @LastEditTime: 2022-07-01 17:40:32 + # @LastEditors: Cloudflying + # @Description: + # @FilePath: /dockenv/images/boxs/xfce/conf/00-motd +### +#!/usr/bin/env bash + # Ubuntu 20.04.3 LTS (GNU/Linux 5.10.47-linuxkit x86_64) +OSNAME=$(grep '^NAME=' /etc/os-release | awk -F '"' '{print $2}') +DISTRIB_DESCRIPTION=$(grep 'VERSION=' /etc/os-release | awk -F '"' '{print $2}') +echo "Welcome to ${OSNAME} ${DISTRIB_DESCRIPTION} ($(uname -o) $(uname -r) $(uname -m)) " +printf "\n" +printf " * Documentation: https://www.debian.org/support\n" +printf " * Management: https://landscape.canonical.com\n" +printf " * Support: https://www.debian.org/support\n" +echo -e "\n" +echo "System load :$(uptime | awk -F ':' '{print $5}')" +echo "Processes : $(ps -aux | wc -l)" +echo "Logged users : $(who | wc -l)" +echo "Usage of / : $(df -h | grep '/$' | awk -F ' ' '{print $5}') of $(df -h | grep '/$' | awk -F ' ' '{print $2}')" +echo "Last login : $(last boxs | grep boxs | awk -F ' ' '{print $4" "$5" "$6" "$7}') from $(last boxs | grep boxs | awk -F ' ' '{print $3}')" + +echo -e "\nSystem infomation:\n" + +echo "CPU :$(grep '^model\ name' /proc/cpuinfo | head -n 1 | awk -F ':' '{print $2}') x $(grep -c 'processor' /proc/cpuinfo)" +echo "Mem : $(free -h | grep '^Mem' | awk -F ' ' '{print $2}')" +echo "Swap : $(free -h | grep '^Swap' | awk -F ' ' '{print $2}')" + +if [[ -f '/.dockerenv' ]]; then + echo "" + echo "This system has been minimized by removing packages and content that are" + echo "not required on a system that users do not log into." + echo "" + echo "To restore this content, you can run the 'unminimize' command." +fi + +# if the current release is under development there won't be a new one +if [ "$(lsb_release -sd | cut -d' ' -f4)" = "(development" ]; then + exit 0 +fi +if [ -x /usr/lib/ubuntu-release-upgrader/release-upgrade-motd ]; then + exec /usr/lib/ubuntu-release-upgrader/release-upgrade-motd +fi + +if [ -x /usr/lib/update-notifier/update-motd-hwe-eol ]; then + exec /usr/lib/update-notifier/update-motd-hwe-eol +fi + +if [ -x /usr/lib/update-notifier/update-motd-fsck-at-reboot ]; then + exec /usr/lib/update-notifier/update-motd-fsck-at-reboot +fi + +if [ -x /usr/lib/update-notifier/update-motd-reboot-required ]; then + exec /usr/lib/update-notifier/update-motd-reboot-required +fi diff --git a/images/boxs/xfce/conf/bootstrap.sh b/images/boxs/xfce/conf/bootstrap.sh new file mode 100644 index 00000000..8205ae17 --- /dev/null +++ b/images/boxs/xfce/conf/bootstrap.sh @@ -0,0 +1,124 @@ +#!/usr/bin/env bash +### + # @Author: Cloudflying + # @Date: 2021-10-18 22:48:51 + # @LastEditTime: 2022-07-01 18:59:24 + # @LastEditors: Cloudflying + # @Description: + # @FilePath: /dockenv/images/boxs/xfce/conf/bootstrap.sh +### + +cp /tmp/conf/entrypoint.sh /usr/bin/entrypoint +chmod +x /usr/bin/entrypoint + +echo "==> Fix local env" +# rm -fr /etc/update-motd.d/* +# cp /tmp/conf/00-motd /etc/update-motd.d/00-header + +# sed -i 's/mirrors.aliyun.com/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list +# sed -i 's/mirrors.aliyun.com/mirror.nju.edu.cn/g' /etc/apt/sources.list +# sed -i 's/mirrors.aliyun.com/mirrors.cloud.tencent.com/g' /etc/apt/sources.list +# sed -i 's/mirrors.aliyun.com/mirrors.huaweicloud.com/g' /etc/apt/sources.list +# sed -i 's/mirrors.aliyun.com/mirror.lzu.edu.cn/g' /etc/apt/sources.list +# sed -i 's/mirrors.aliyun.com/mirrors.163.com/g' /etc/apt/sources.list + +mkdir -p ${HOME_DIR}/.pip && touch ${HOME_DIR}/.pip/pip.conf + +echo "[global] +index-url = https://mirrors.aliyun.com/pypi/simple/ + +[install] +trusted-host=mirrors.aliyun.com" > ${HOME_DIR}/.pip/pip.conf + +mkdir -p /tmp/.deps +cd /tmp/.deps + +# if [[ -z "$(command -v vncserver)" ]]; then +# wget -qc https://cloudflying-generic.pkg.coding.net/storage/mirrors/pkgs/tigervnc/tigervnc-1.10.0.x86_64.tar.gz +# tar -xf tigervnc-1.10.0.x86_64.tar.gz +# cp -fr tigervnc-1.10.0.x86_64/* / +# fi + +if [[ ! -d '/opt/noVNC' ]]; then + wget -qc https://github.com/novnc/noVNC/archive/refs/heads/master.zip -O /tmp/novnc.zip + unzip -q /tmp/novnc.zip -d /opt/ && mv /opt/noVNC-master /opt/noVNC + sed -i "s#noVNC#Xfce4 Desktop Running in Debian on Docker#g" /opt/noVNC/vnc.html +fi + +cd && rm -fr /tmp/.deps + +if [[ ! -f "${HOME_DIR}/.zshrc" ]]; then + useradd -d /home/${USER} -m -s "$(command -v zsh)" ${USER} + echo "${USER}:${PASSWD}" | chpasswd + echo "root:${PASSWD}" | chpasswd + echo "${USER} ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers + git clone --depth 1 https://e.coding.net/pkgs/oh-my-zsh/oh-my-zsh.git ${HOME_DIR}/.oh-my-zsh + # cp ${HOME_DIR}/.oh-my-zsh/templates/zshrc.zsh-template ${HOME_DIR}/.zshrc + cp /tmp/conf/zshrc ${HOME_DIR}/.zshrc + # sed -i 's/ZSH_THEME.*/ZSH_THEME="strug"/g' ${HOME_DIR}/.zshrc +fi + +[ ! -d '/run/sshd' ] && mkdir -p /run/sshd +[ ! -d '/etc/supervisor/conf.d' ] && mkdir -p /etc/supervisor/conf.d +[ -f '/tmp/conf/supervisord.conf' ] && cp /tmp/conf/supervisord.conf /etc/supervisor/conf.d/supervisord.conf + +# 程序启动文件 快捷方式 +mkdir -p ${HOME_DIR}/.local/share/applications/desktop +# 存放icon图标和cursor主题 +mkdir -p ${HOME_DIR}/.local/share/icons +mkdir -p ${HOME_DIR}/.fonts +# 存放主题文件 含有 xfwm4 目录 +mkdir -p ${HOME_DIR}/.themes +mkdir -p ${HOME_DIR}/.backgrounds +# 自启动程序放置目录 .desktop 文件 +mkdir -p ${HOME_DIR}/.config/autostart + +if [[ -z "${SSH_PORT}" ]]; then + SSH_PORT=22 +fi + +echo '==> Config SSH Configure' +sed -i 's/^#ClientAliveInterval.*/ClientAliveInterval 60/g' /etc/ssh/sshd_config +sed -i 's/^#PermitRootLogin.*/PermitRootLogin no/g' /etc/ssh/sshd_config +sed -i "s/^#Port.*/Port ${SSH_PORT}/g" /etc/ssh/sshd_config +# 不使用公匙 +# sed -i "s/UsePAM.*/UsePAM no/g" /etc/ssh/sshd_config + + +mkdir -p /var/log/ +touch /var/log/sshd.log + +# 更新本地环境 +# 本地语言 +echo "LANG=en_US.UTF-8" >> /etc/environment +echo "LC_ALL=en_US.UTF-8" >> /etc/environment +echo "LANG=en_US.UTF-8" > /etc/locale.conf +echo "LC_ALL=en_US.UTF-8" >> /etc/locale.conf + +# LANG="en_US.UTF-8" +# LANGUAGE="en_US.UTF-8" +# LC_CTYPE="UTF-8" +# LC_MESSAGES="en_US.UTF-8" +# LC_TIME="en_US.UTF-8" +# LC_ALL="en_US.UTF-8" +locale-gen en_US.UTF-8 zh_CN.UTF-8 + +# 本地时区设定 +echo 'Asia/Shanghai' > /etc/timezone +rm -fr /etc/localtime && ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime + +# 删除环境不需要的字体 主题 文档等等 +rm -fr /usr/share/themes/Daloa +rm -fr /usr/share/themes/Kokodi +rm -fr /usr/share/themes/Moheli +rm -fr /usr/share/themes/Default-xhdpi +rm -fr /usr/share/themes/Default-hdpi + +# neovim +mkdir -p ${HOME_DIR}/.config/nvim +cp /tmp/conf/init.vim ${HOME_DIR}/.config/nvim/init.vim + +chmod -R 755 ${HOME_DIR} +chown -R ${USER}:${USER} ${HOME_DIR} + +rm -fr /tmp/* diff --git a/images/boxs/xfce/conf/entrypoint.sh b/images/boxs/xfce/conf/entrypoint.sh new file mode 100644 index 00000000..913e3103 --- /dev/null +++ b/images/boxs/xfce/conf/entrypoint.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +### + # @Author: Cloudflying + # @Date: 2021-10-19 14:13:26 + # @LastEditTime: 2022-07-01 19:57:15 + # @LastEditors: Cloudflying + # @Description: + # @FilePath: /dockenv/images/boxs/xfce/conf/entrypoint.sh +### + +# Init User Env +[ -z "${USER}" ] && USER="boxs" +[ -z "${PASSWD}" ] && PASSWD="boxs" +[ -z "${HOME_DIR}" ] && HOME_DIR="/home/${USER}" + +HOST_IP=$(hostname -i) +# echo '==> start vncserver and noVNC webclient && dbus' +sudo /etc/init.d/dbus start > /dev/null + +VNC_PASSWD_PATH="${HOME_DIR}/.vnc" +mkdir -p $VNC_PASSWD_PATH +echo "$VNC_PASSWD" | vncpasswd -f >> $VNC_PASSWD_PATH/passwd +chmod 600 $VNC_PASSWD_PATH/passwd +touch ${HOME_DIR}/.Xauthority +chmod 644 ${HOME_DIR}/.Xauthority + +# Pulse Audio + +# vncserver -kill $DISPLAY > /dev/null 2>&1 || rm -rfv /tmp/.X*-lock /tmp/.X11-unix +# rm -fr /tmp/.X1* +vncserver $DISPLAY -depth $VNC_COL_DEPTH -geometry ${VNC_RESOLUTION} -localhost no -autokill yes > /tmp/vncserver.log 2>&1 & + +# 重置 SSH 端口 +if [[ -n "${SSH_PORT}" ]]; then + sudo sed -i "s/^Port.*/Port ${SSH_PORT}/g" /etc/ssh/sshd_config + # sudo service ssh restart > /dev/null +fi + +echo "======================================================================" +echo "You can now connect to this container via SSH using: " +echo " ssh ${USER}@${HOST_IP} -p ${SSH_PORT} " +echo "Enter the ${USER} password => '${PASSWD}' when prompted " +echo "Please remember to change the above password as soon as possible! " +echo "================Boxs VNC Config=======================================" +echo " VNC Port : ${VNC_PORT} " +echo " noVNC Port : ${NO_VNC_PORT} " +echo " VNC Password : ${VNC_PASSWD} " +echo "======================================================================" +echo " Boxs is Running " +echo "======================================================================" +# sudo /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf -l /var/log/supervisord.log -j /var/run/supervisord.pid -n +sudo /usr/bin/supervisord -c /etc/supervisor/supervisord.conf -n diff --git a/images/boxs/xfce/conf/init.sh b/images/boxs/xfce/conf/init.sh new file mode 100644 index 00000000..06736c38 --- /dev/null +++ b/images/boxs/xfce/conf/init.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +### + # @Author: Cloudflying + # @Date: 2022-07-01 20:05:12 + # @LastEditTime: 2022-07-05 17:57:12 + # @LastEditors: Cloudflying + # @Description: init System + # @FilePath: /dockenv/images/boxs/xfce/conf/init.sh +### + +# short package install command +apt_add() +{ + apt-get install -y --no-install-recommends --no-install-suggests $@ +} + +# System Base Package +apt install -y lsb-release ca-certificates apt-transport-https software-properties-common apt-utils + +# systemd +apt install -y systemd init + +# for compile +pkg_add build-essential + +# Secret +pkg_add gnupg2 + +# crontab and service manager +pkg_add cron supervisor + +pkg_add python3 python3-pip + +# for neovim +pip install pynvim pyright +pip install jedi==0.18.0 + +pkg_add nodejs npm + diff --git a/images/boxs/xfce/conf/init.vim b/images/boxs/xfce/conf/init.vim new file mode 100644 index 00000000..c54c57db --- /dev/null +++ b/images/boxs/xfce/conf/init.vim @@ -0,0 +1,37 @@ +syntax on " enable syntax highlighting +set hidden " Required for operations modifying multiple buffers like rename. + +" 启用主题 +set background=dark +" colorscheme palenight +" colorscheme hyper +" colorscheme wombat +" colorscheme zacks +" colorscheme Base4Tone_Classic_A_Dark + +filetype plugin indent on " enable indentations +set list +set modeline +set mouse=a " enable mouse interaction +set incsearch ignorecase smartcase hlsearch " highlight text while searching + +set number " 显示行号 + +set ruler +set wrap " wrap text 自动折行 +set nobackup " 设置取消备份 禁止临时文件生成 +set fenc=utf-8 " 文件编码 +set encoding=utf-8 +set cursorline " 突出显示当前行 +set cursorcolumn " 突出显示当前列 + +set laststatus=2 +" set noshowmode " 不显示运行模式 +set ignorecase +set smartcase +set autoindent smartindent " enable indentation +set tabstop=4 +set shiftwidth=4 +set emoji " enable emojis +set history=1000 " history limit +set title " tab title as file name diff --git a/images/boxs/xfce/conf/pulse-client.conf b/images/boxs/xfce/conf/pulse-client.conf new file mode 100644 index 00000000..3cc69423 --- /dev/null +++ b/images/boxs/xfce/conf/pulse-client.conf @@ -0,0 +1,9 @@ +# Connect to the host's server using the mounted UNIX socket +default-server = unix:/tmp/pulse-socket + +# Prevent a server running in the container +autospawn = no +daemon-binary = /bin/true + +# Prevent the use of shared memory +enable-shm = false diff --git a/images/boxs/xfce/conf/supervisord.conf b/images/boxs/xfce/conf/supervisord.conf new file mode 100644 index 00000000..7bc407df --- /dev/null +++ b/images/boxs/xfce/conf/supervisord.conf @@ -0,0 +1,112 @@ +[supervisord] +user=root +nodaemon=true + +[program:sshd] +startretries=3 +command=/usr/sbin/sshd -D +user=root +autorestart=true +priority=100 +redirect_stderr=true +stopsignal=QUIT +stdout_logfile=/var/log/sshd.log +stderr_logfile=/var/log/sshd.err + +[program:novnc] +startretries=3 +priority=250 +directory=/opt/noVNC +command=/opt/noVNC/utils/novnc_proxy --vnc 0.0.0.0:5901 --listen 6901 --web /opt/noVNC/ +user=root +autostart=true +autorestart=true +stopsignal=QUIT +redirect_stderr=true +stopasgroup=true +stdout_logfile=/var/log/novnc.log +stderr_logfile=/var/log/novnc.err + +[program:xfce4-session] +startretries=3 +command=dbus-launch /usr/bin/xfce4-session --display=:1 +user=root +autorestart=true +priority=200 +stdout_logfile=/var/log/xfce4_session.log +stderr_logfile=/var/log/xfce4_session.err +redirect_stderr=true + +[program:xrdp-sesman] +command=/usr/sbin/xrdp-sesman --nodaemon +process_name = xrdp-sesman +stdout_logfile=/var/log/xrdp_sesman.log +stderr_logfile=/var/log/xrdp_sesman.err + +[program:xrdp] +command=/usr/sbin/xrdp -nodaemon +process_name = xrdp +stdout_logfile=/var/log/xrdp.log +stderr_logfile=/var/log/xrdp.err + +;[program:x11vnc] +;startretries=3 +;command=/usr/bin/x11vnc -repeat -xkb -noxrecord -noxfixes -noxdamage -display :1 -nopw -wait 5 +;user=root +;autorestart=true +;priority=200 +;stdout_logfile=/var/log/x11vnc.log +;redirect_stderr=true + +;[program:x11vnc] +;priority=10 +;directory=/ +;command=x11vnc -display :1 -xkb +;command=x11vnc -display :1 -listen localhost -xkb +;user=root +;autostart=true +;autorestart=true +;stopsignal=QUIT +;stdout_logfile=/var/log/x11vnc.log +;stderr_logfile=/var/log/x11vnc.err + +;[program:xvfb] +;priority=10 +;directory=/ +;command=/usr/bin/Xvfb :1 -screen 0 1024x768x16 +;user=root +;autostart=true +;autorestart=true +;stopsignal=QUIT +;stdout_logfile=/var/log/xvfb.log +;stderr_logfile=/var/log/xvfb.err + +;[program:startxfce4] +;priority=10 +;directory=/root +;command=/usr/bin/startxfce4 +;user=root +;autostart=true +;autorestart=true +;stopsignal=QUIT +;environment=DISPLAY=":1",HOME="/root" +;stdout_logfile=/var/log/xfce4.log +;stderr_logfile=/var/log/xfce4.err + +;[program:xvfb] +;startretries=10 +;command=/usr/bin/Xvfb :1 -screen 0 1920x1080x24 +;autorestart=true +;user=root +;priority=100 + +;example +;[program:boxs] +;directory = path/to/app ; 程序的启动目录 +;command = gunicorn -w 8 -b 0.0.0.0:17510 wsgi:app ; 启动命令 +;autostart = true ; 在 supervisord 启动的时候也自动启动 +;startsecs = 5 ; 启动 5 秒后没有异常退出,就当作已经正常启动了 +;autorestart = true ; 程序异常退出后自动重启 +;startretries = 3 ; 启动失败自动重试次数,默认是 3 +;user = boxs ; 用哪个用户启动 +;redirect_stderr = true ; 把 stderr 重定向到 stdout,默认 false diff --git a/images/boxs/xfce/conf/zshrc b/images/boxs/xfce/conf/zshrc new file mode 100644 index 00000000..643a4805 --- /dev/null +++ b/images/boxs/xfce/conf/zshrc @@ -0,0 +1,118 @@ +### + # @Author: Cloudflying + # @Date: 2021-10-25 11:08:11 + # @LastEditTime: 2022-07-01 18:05:14 + # @LastEditors: Cloudflying + # @Description: + # @FilePath: /dockenv/images/boxs/xfce/conf/zshrc +### +# If you come from bash you might have to change your $PATH. +export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$HOME/.bin +# export MANPATH="/usr/local/man:$MANPATH" + +# Path to your oh-my-zsh installation. +export ZSH=$HOME/.oh-my-zsh + +# Set name of the theme to load --- if set to "random", it will +# load a random theme each time oh-my-zsh is loaded, in which case, +# to know which specific one was loaded, run: echo $RANDOM_THEME +# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes +ZSH_THEME="strug" + +# Set list of themes to pick from when loading at random +# Setting this variable when ZSH_THEME="strug" +# a theme from this variable instead of looking in $ZSH/themes/ +# If set to an empty array, this variable will have no effect. +# ZSH_THEME="strug" + +# Uncomment the following line to use case-sensitive completion. +# CASE_SENSITIVE="true" + +# Uncomment the following line to use hyphen-insensitive completion. +# Case-sensitive completion must be off. _ and - will be interchangeable. +# HYPHEN_INSENSITIVE="true" + +# Uncomment the following line to disable bi-weekly auto-update checks. +# DISABLE_AUTO_UPDATE="true" + +# Uncomment the following line to automatically update without prompting. +# DISABLE_UPDATE_PROMPT="true" + +# Uncomment the following line to change how often to auto-update (in days). +# export UPDATE_ZSH_DAYS=13 + +# Uncomment the following line if pasting URLs and other text is messed up. +# DISABLE_MAGIC_FUNCTIONS="true" + +# Uncomment the following line to disable colors in ls. +# DISABLE_LS_COLORS="true" + +# Uncomment the following line to disable auto-setting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment the following line to enable command auto-correction. +# ENABLE_CORRECTION="true" + +# Uncomment the following line to display red dots whilst waiting for completion. +# Caution: this setting can cause issues with multiline prompts (zsh 5.7.1 and newer seem to work) +# See https://github.com/ohmyzsh/ohmyzsh/issues/5765 +# COMPLETION_WAITING_DOTS="true" + +# Uncomment the following line if you want to disable marking untracked files +# under VCS as dirty. This makes repository status check for large repositories +# much, much faster. +# DISABLE_UNTRACKED_FILES_DIRTY="true" + +# Uncomment the following line if you want to change the command execution time +# stamp shown in the history command output. +# You can set one of the optional three formats: +# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# or set a custom format using the strftime function format specifications, +# see 'man strftime' for details. +# HIST_STAMPS="mm/dd/yyyy" + +# Would you like to use another custom folder than $ZSH/custom? +# ZSH_CUSTOM=/path/to/new-custom-folder + +# Which plugins would you like to load? +# Standard plugins can be found in $ZSH/plugins/ +# Custom plugins may be added to $ZSH_CUSTOM/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +# Add wisely, as too many plugins slow down shell startup. +plugins=(git) + +source $ZSH/oh-my-zsh.sh + +# User configuration + +# You may need to manually set your language environment +export LANG=en_US.UTF-8 +export LANGUAGE=en_US.UTF-8 +export LC_ALL=en_US.UTF-8 + +if [[ -z "${SHELL}" ]]; then + SHELL=$(command -v zsh) +fi + +# Set Default Editor +if [[ ! -z $(command -v nvim) ]]; then + export EDITOR='nvim' + export VISUAL='nvim' +elif [[ ! -z $(command -v vim) ]]; then + export EDITOR='vim' + export VISUAL='vim' +fi + +alias vi=$(which ${EDITOR}) +alias vim=$(which ${EDITOR}) + +alias ssh="ssh -o ServerAliveInterval=60" +alias ping='ping -c 5' + +# Compilation flags +# export ARCHFLAGS="-arch x86_64" + +# Set personal aliases, overriding those provided by oh-my-zsh libs, +# plugins, and themes. Aliases can be placed here, though oh-my-zsh +# users are encouraged to define aliases within the ZSH_CUSTOM folder. +# For a full list of active aliases, run `alias`. diff --git a/images/buildbot/Dockerfile b/images/buildbot/Dockerfile deleted file mode 100644 index f8fdfc05..00000000 --- a/images/buildbot/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM imxieke/archlinux:latest -LABEL MAINTAINER="Cloudflying" \ - MAIL="" - -ADD run.sh / -RUN chmod +x /*.sh - -ENV AUTHORIZED_KEYS **None** - -RUN pacman --noconfirm --force -Syyu \ - && pacman -S --noconfirm --force sed shadow openssh sudo \ - && pacman -Scc --noconfirm \ - && rm -fr /var/cache/pacman/pkg/* \ - && rm -fr /var/lib/pacman/* \ - && mkdir -p /var/run/sshd \ - && sed -i "s/UsePrivilegeSeparation.*/UsePrivilegeSeparation no/g" /etc/ssh/sshd_config \ - && sed -i "s/UsePAM.*/UsePAM no/g" /etc/ssh/sshd_config \ - && sed -i "s/PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config \ - && ssh-keygen -A - -EXPOSE 22 80 - -CMD /run.sh \ No newline at end of file diff --git a/images/buildbot/init.sh b/images/buildbot/init.sh deleted file mode 100644 index 9159e41f..00000000 --- a/images/buildbot/init.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -pacman -Syy --noconfirm -pacman -S --noconfirm git vim grep \ No newline at end of file diff --git a/images/buildbot/run.sh b/images/buildbot/run.sh deleted file mode 100644 index c67e437d..00000000 --- a/images/buildbot/run.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -USER="buildbot" -PASS="buildbot" -useradd -d /home/$USER -m $USER -s /bin/bash -echo "$USER:$PASS" |chpasswd -echo "root:$PASS" | chpasswd -echo "$USER ALL=NOPASSWD: ALL" >>/etc/sudoers -echo "======================================================================" -echo "You can now connect to this container via SSH using: " -echo " ssh $USER@HOST -p port " -echo "Enter the $USER password '$PASS' when prompted " -echo "Please remember to change the above password as soon as possible! " -echo "======================================================================" -echo " Archlinux Build Bot is Running " -echo "======================================================================" - -exec /usr/sbin/sshd -D -e \ No newline at end of file diff --git a/images/busybox/glibc/Dockerfile b/images/busybox/glibc/Dockerfile new file mode 100644 index 00000000..b21191ac --- /dev/null +++ b/images/busybox/glibc/Dockerfile @@ -0,0 +1,3 @@ +FROM busybox:glibc + +CMD [ "bash" ] diff --git a/images/busybox/latest/Dockerfile b/images/busybox/latest/Dockerfile new file mode 100644 index 00000000..9617ac20 --- /dev/null +++ b/images/busybox/latest/Dockerfile @@ -0,0 +1,3 @@ +FROM busybox:latest + +CMD [ "bash" ] diff --git a/images/busybox/musl/Dockerfile b/images/busybox/musl/Dockerfile new file mode 100644 index 00000000..a7eb840c --- /dev/null +++ b/images/busybox/musl/Dockerfile @@ -0,0 +1,3 @@ +FROM busybox:musl + +CMD [ "bash" ] diff --git a/images/c9ide/Dockerfile b/images/c9ide/Dockerfile deleted file mode 100644 index 38aa5ef3..00000000 --- a/images/c9ide/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -FROM imxieke/archlinux:latest -LABEL MAINTAINER="Cloudflying" \ - MAIL="" - -ENV AUTHORIZED_KEYS **None** - -RUN pacman --noconfirm --force -Syyu \ - && pacman -S --noconfirm --force sed shadow openssh sudo \ - && pacman -Scc --noconfirm \ - && rm -fr /var/cache/pacman/pkg/* \ - && rm -fr /var/lib/pacman/* \ - && mkdir -p /var/run/sshd \ - && sed -i "s/UsePrivilegeSeparation.*/UsePrivilegeSeparation no/g" /etc/ssh/sshd_config \ - && sed -i "s/UsePAM.*/UsePAM no/g" /etc/ssh/sshd_config \ - && sed -i "s/PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config \ - && ssh-keygen -A - -EXPOSE 22 80 - -CMD /run.sh \ No newline at end of file diff --git a/images/caddy/latest/Dockerfile b/images/caddy/latest/Dockerfile new file mode 100644 index 00000000..72408393 --- /dev/null +++ b/images/caddy/latest/Dockerfile @@ -0,0 +1,7 @@ +FROM caddy:latest + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +CMD ["/usr/bin/caddy"] diff --git a/images/centos/7.0/Dockerfile b/images/centos/7.0/Dockerfile new file mode 100644 index 00000000..9151f704 --- /dev/null +++ b/images/centos/7.0/Dockerfile @@ -0,0 +1,6 @@ +FROM centos:7.0.1406 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +CMD [ "bash" ] diff --git a/images/centos/7.1/Dockerfile b/images/centos/7.1/Dockerfile new file mode 100644 index 00000000..f85b1e3e --- /dev/null +++ b/images/centos/7.1/Dockerfile @@ -0,0 +1,6 @@ +FROM centos:7.1.1503 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +CMD [ "bash" ] diff --git a/images/centos/7.2/Dockerfile b/images/centos/7.2/Dockerfile new file mode 100644 index 00000000..6ccc9f41 --- /dev/null +++ b/images/centos/7.2/Dockerfile @@ -0,0 +1,6 @@ +FROM centos:7.2.1511 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +CMD [ "bash" ] diff --git a/images/centos/7.3/Dockerfile b/images/centos/7.3/Dockerfile new file mode 100644 index 00000000..1c74c5ee --- /dev/null +++ b/images/centos/7.3/Dockerfile @@ -0,0 +1,6 @@ +FROM centos:7.3.1611 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +CMD [ "bash" ] diff --git a/images/centos/7.4/Dockerfile b/images/centos/7.4/Dockerfile new file mode 100644 index 00000000..05e252f7 --- /dev/null +++ b/images/centos/7.4/Dockerfile @@ -0,0 +1,6 @@ +FROM centos:7.4.1708 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +CMD [ "bash" ] diff --git a/images/centos/7.5/Dockerfile b/images/centos/7.5/Dockerfile new file mode 100644 index 00000000..e193f9a0 --- /dev/null +++ b/images/centos/7.5/Dockerfile @@ -0,0 +1,6 @@ +FROM centos:7.5.1804 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +CMD [ "bash" ] diff --git a/images/centos/7.6/Dockerfile b/images/centos/7.6/Dockerfile new file mode 100644 index 00000000..cb88cebb --- /dev/null +++ b/images/centos/7.6/Dockerfile @@ -0,0 +1,6 @@ +FROM centos:7.6.1810 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +CMD [ "bash" ] diff --git a/images/centos/7.7/Dockerfile b/images/centos/7.7/Dockerfile new file mode 100644 index 00000000..a71afeeb --- /dev/null +++ b/images/centos/7.7/Dockerfile @@ -0,0 +1,6 @@ +FROM centos:7.7.1908 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +CMD [ "bash" ] diff --git a/images/centos/7.8/Dockerfile b/images/centos/7.8/Dockerfile new file mode 100644 index 00000000..2b316cb1 --- /dev/null +++ b/images/centos/7.8/Dockerfile @@ -0,0 +1,6 @@ +FROM centos:7.8.2003 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +CMD [ "bash" ] diff --git a/images/centos/7.9/Dockerfile b/images/centos/7.9/Dockerfile new file mode 100644 index 00000000..44a300d7 --- /dev/null +++ b/images/centos/7.9/Dockerfile @@ -0,0 +1,6 @@ +FROM centos:7.9.2009 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +CMD [ "bash" ] diff --git a/images/centos/8.1/Dockerfile b/images/centos/8.1/Dockerfile new file mode 100644 index 00000000..cc77248a --- /dev/null +++ b/images/centos/8.1/Dockerfile @@ -0,0 +1,6 @@ +FROM centos:8.1.1911 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +CMD [ "bash" ] diff --git a/images/centos/8.2/Dockerfile b/images/centos/8.2/Dockerfile new file mode 100644 index 00000000..a650b3e6 --- /dev/null +++ b/images/centos/8.2/Dockerfile @@ -0,0 +1,6 @@ +FROM centos:8.2.2004 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +CMD [ "bash" ] diff --git a/images/centos/8.3/Dockerfile b/images/centos/8.3/Dockerfile new file mode 100644 index 00000000..ce8bcf1d --- /dev/null +++ b/images/centos/8.3/Dockerfile @@ -0,0 +1,6 @@ +FROM centos:8.3.2011 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +CMD [ "bash" ] diff --git a/images/centos/8.4/Dockerfile b/images/centos/8.4/Dockerfile new file mode 100644 index 00000000..5ae340c8 --- /dev/null +++ b/images/centos/8.4/Dockerfile @@ -0,0 +1,6 @@ +FROM centos:8.4.2105 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +CMD [ "bash" ] diff --git a/images/centos/stream/Dockerfile b/images/centos/stream/Dockerfile new file mode 100644 index 00000000..8732890d --- /dev/null +++ b/images/centos/stream/Dockerfile @@ -0,0 +1,6 @@ +FROM quay.io/centos/centos:stream + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +CMD [ "bash" ] diff --git a/images/centos/stream8/Dockerfile b/images/centos/stream8/Dockerfile new file mode 100644 index 00000000..10cc36d1 --- /dev/null +++ b/images/centos/stream8/Dockerfile @@ -0,0 +1,6 @@ +FROM quay.io/centos/centos:stream8 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +CMD [ "bash" ] diff --git a/images/centos/stream9-dev/Dockerfile b/images/centos/stream9-dev/Dockerfile new file mode 100644 index 00000000..851e2cd9 --- /dev/null +++ b/images/centos/stream9-dev/Dockerfile @@ -0,0 +1,6 @@ +FROM quay.io/centos/centos:stream9-development + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +CMD [ "bash" ] diff --git a/images/centos/stream9/Dockerfile b/images/centos/stream9/Dockerfile new file mode 100644 index 00000000..56e1a196 --- /dev/null +++ b/images/centos/stream9/Dockerfile @@ -0,0 +1,6 @@ +FROM quay.io/centos/centos:stream9 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +CMD [ "bash" ] diff --git a/images/chromedriver/latest/Dockerfile b/images/chromedriver/latest/Dockerfile new file mode 100644 index 00000000..a62abe43 --- /dev/null +++ b/images/chromedriver/latest/Dockerfile @@ -0,0 +1,30 @@ +FROM ghcr.io/dockenv/debian:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +RUN apt update -y --fix-missing \ + && apt-get install -y --no-install-recommends --no-install-suggests \ + wget \ + curl \ + unzip \ + ca-certificates \ + && wget -cq --no-check-certificate https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -O /tmp/chrome.deb \ + && apt-get install -y --no-install-recommends --no-install-suggests /tmp/chrome.deb \ + # Taobao Chromedriver mirror + # curl -sL https://npm.taobao.org/mirrors/chromedriver/ | grep -v 'LATEST' | grep -v 'icons' | grep -v 'index.html' | grep mirrors | awk -F '>' '{print $2}' | awk -F '\/<' '{print $1}' | sort -h --reverse | head -n 1 + && VERSION=$(curl -sL https://chromedriver.storage.googleapis.com/LATEST_RELEASE) \ + && wget -cq --no-check-certificate "https://chromedriver.storage.googleapis.com/${VERSION}/chromedriver_linux64.zip" -O /tmp/chromedriver.zip \ + && unzip /tmp/chromedriver.zip \ + && mv chromedriver /usr/bin/chromedriver \ + && chmod +x /usr/bin/chromedriver \ + && rm -fr /tmp/* \ + && apt purge curl -y \ + && apt autoremove -y \ + && apt-get clean -y \ + && apt-get autoclean -y \ + && rm -fr /var/lib/apt/lists/* + +EXPOSE 4444 4445 + +CMD /usr/bin/chromedriver --port=4444 --adb-port=4445 --allowed-origins=* --allowed-ips= diff --git a/images/cirros/0.5/Dockerfile b/images/cirros/0.5/Dockerfile new file mode 100644 index 00000000..933e78d1 --- /dev/null +++ b/images/cirros/0.5/Dockerfile @@ -0,0 +1,5 @@ +FROM oraclelinux:8-slim +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +CMD [ "/bash" ] diff --git a/images/cirros/0/Dockerfile b/images/cirros/0/Dockerfile new file mode 100644 index 00000000..0e3bc6bb --- /dev/null +++ b/images/cirros/0/Dockerfile @@ -0,0 +1,5 @@ +FROM cirros:0 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +CMD [ "/bash" ] diff --git a/images/cirros/latest/Dockerfile b/images/cirros/latest/Dockerfile new file mode 100644 index 00000000..fe20b6e6 --- /dev/null +++ b/images/cirros/latest/Dockerfile @@ -0,0 +1,5 @@ +FROM cirros:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +CMD [ "/bash" ] diff --git a/images/clearlinux/base/Dockerfile b/images/clearlinux/base/Dockerfile new file mode 100644 index 00000000..4c8bb88c --- /dev/null +++ b/images/clearlinux/base/Dockerfile @@ -0,0 +1,5 @@ +FROM clearlinux:base +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +CMD [ "/bash" ] diff --git a/images/clearlinux/latest/Dockerfile b/images/clearlinux/latest/Dockerfile new file mode 100644 index 00000000..22265655 --- /dev/null +++ b/images/clearlinux/latest/Dockerfile @@ -0,0 +1,5 @@ +FROM clearlinux:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +CMD [ "/bash" ] diff --git a/images/cmdide/Dockerfile b/images/cmdide/Dockerfile deleted file mode 100644 index 787af75b..00000000 --- a/images/cmdide/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -FROM imxieke/php:multiple -LABEL MAINTAINER="Cloudflying" \ - MAIL="oss@live.hk" - -ADD script/build.sh /bin/build.sh -ADD script/cmdide.sh /bin/cmdide -ADD script/run.sh /bin/run.sh - -ENV RUN_MODE="local" -ENV USER "cmdide" -ENV PASSWD "cmdide" -ENV AUTHORIZED_KEYS **None** -ENV HOME_DIR=/home/$USER - -RUN chmod +x /build.sh \ - && chmod +x /bin/cmdide \ - && chmod +x /bin/run.sh \ - && bash /build.sh - -USER ${USER} -WORKDIR ${HOME_DIR} - -VOLUME ['/var/www'] -VOLUME ['/etc/nginx/conf.d/'] -EXPOSE 22 80 443 - -CMD /bin/run.sh \ No newline at end of file diff --git a/images/cmdide/Dockerfile.alpine b/images/cmdide/Dockerfile.alpine deleted file mode 100644 index 787af75b..00000000 --- a/images/cmdide/Dockerfile.alpine +++ /dev/null @@ -1,27 +0,0 @@ -FROM imxieke/php:multiple -LABEL MAINTAINER="Cloudflying" \ - MAIL="oss@live.hk" - -ADD script/build.sh /bin/build.sh -ADD script/cmdide.sh /bin/cmdide -ADD script/run.sh /bin/run.sh - -ENV RUN_MODE="local" -ENV USER "cmdide" -ENV PASSWD "cmdide" -ENV AUTHORIZED_KEYS **None** -ENV HOME_DIR=/home/$USER - -RUN chmod +x /build.sh \ - && chmod +x /bin/cmdide \ - && chmod +x /bin/run.sh \ - && bash /build.sh - -USER ${USER} -WORKDIR ${HOME_DIR} - -VOLUME ['/var/www'] -VOLUME ['/etc/nginx/conf.d/'] -EXPOSE 22 80 443 - -CMD /bin/run.sh \ No newline at end of file diff --git a/images/cmdide/Dockerfile.debian9 b/images/cmdide/Dockerfile.debian9 deleted file mode 100644 index c5ae36f0..00000000 --- a/images/cmdide/Dockerfile.debian9 +++ /dev/null @@ -1,11 +0,0 @@ -FROM registry.cn-hongkong.aliyuncs.com/imxieke/debian:9.9 -LABEL MAINTAINER="Cloudflying" \ - MAIL="oss@live.hk" - -RUN apt update -y && \ - apt install -y build-essential git curl wget jq make gcc g++ perl libperl-dev libtool - -USER ${USER} -WORKDIR ${HOME} -EXPOSE 80 -CMD ["/bin/sh"] diff --git a/images/cmdide/Dockerfile.php b/images/cmdide/Dockerfile.php deleted file mode 100644 index 23e666a8..00000000 --- a/images/cmdide/Dockerfile.php +++ /dev/null @@ -1,19 +0,0 @@ -FROM registry.cn-hongkong.aliyuncs.com/imxieke/alpine:latest -LABEL MAINTAINER="Cloudflying" \ - MAIL="oss@live.hk" - -ENV USER=laravel \ - PASSWD=laravel -ENV HOME=/home/${USER} -ADD script/laravel-alpine.sh /tmp/build.sh -ADD script/alpine-runenv.sh /bin/runenv - -RUN chmod +x /tmp/build.sh \ - && chmod +x /bin/runenv \ - && sh /tmp/build.sh \ - && rm -fr /tmp/* - -USER ${USER} -WORKDIR ${HOME} -EXPOSE 80 -CMD ["/bin/sh"] diff --git a/images/cmdide/Dockerfile.php-ext b/images/cmdide/Dockerfile.php-ext deleted file mode 100644 index 1d0ed07a..00000000 --- a/images/cmdide/Dockerfile.php-ext +++ /dev/null @@ -1,38 +0,0 @@ -FROM imxieke/debian:latest - -LABEL MAINTAINER="Sky" \ - MAIL="Sky@gfw.party" - -WORKDIR /var/wwww -ENV HOME_DIR=/home/dev/ -RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \ - && apt update \ - && apt install -y --no-install-recommends nginx php-fpm php-dev php-gd php-zip php-bz2 php-cli php-console-commandline php-curl php-dompdf php-geoip php-gnupg php-imagick php-imap php-intl php-json php-libsodium php-mail php-mbstring php-mcrypt php-memcache php-memcached php-mongodb php-mysql php-odbc php-pclzip php-pear php-pgsql php-radius php-redis php-readline php-sqlite3 neovim git composer zsh make g++ wget sudo \ - && rm -fr /etc/nginx/nginx.conf \ - && mkdir - p /run/nginx/ \ - && rm -fr /etc/nginx/conf.d/* \ - && chmod 777 -R /var/www \ - && rm -fr /etc/php7/php.ini \ - && pecl install swoole \ - && pecl install rar \ - && rm -fr /tmp/pear/* \ - && wget https://github.com/imxieke/ext-storage/raw/master/modules/ioncube_loader_lin_7.0.so -O /usr/lib/php/20151012/ioncube.so \ - && echo "extension=rar.so" > /etc/php/7.0/cli/conf.d/rar.ini \ - && echo "extension=swoole.so" > /etc/php/7.0/cli/conf.d/swoole.ini \ - && git clone --depth=1 https://github.com/robbyrussell/oh-my-zsh.git ${HOME_DIR}/.oh-my-zsh \ - && cp ${HOME_DIR}/.oh-my-zsh/templates/zshrc.zsh-template ${HOME_DIR}/.zshrc \ - && chsh -s /bin/zsh \ - && useradd -d /home/dev -m -s /bin/zsh dev \ - && echo "dev:123456" | chpasswd \ - && echo "dev ALL=(ALL:ALL) ALL " >> /etc/sudoers \ - && apt autoremove -y \ - && apt-get clean all \ - && rm -fr /var/lib/apt/lists/* - -ADD conf.d/nginx.conf /etc/nginx/ -ADD conf.d/default.conf /etc/nginx/conf.d/ -ADD conf.d/php.ini /etc/php7/ -ADD conf.d/index.php /var/www -USER dev -EXPOSE 80 -CMD service nginx start && service php7.0-fpm start \ No newline at end of file diff --git a/images/cmdide/Dockerfile.tomcat7 b/images/cmdide/Dockerfile.tomcat7 deleted file mode 100644 index dc023707..00000000 --- a/images/cmdide/Dockerfile.tomcat7 +++ /dev/null @@ -1,33 +0,0 @@ -# Ubuntu 14.04 -# Java 7 and Tomcat 7 -FROM imxieke/ubuntu:trusty -LABEL MAINTAINER="Cloudflying" \ - MAIL="oss@live.hk" - -# Default to UTF-8 file.encoding -ENV LANG C.UTF-8 - -RUN apt update -y \ - && apt-get install -y --no-install-recommends \ - bzip2 \ - unzip \ - xz-utils \ - openssh-server \ - pwgen \ - openjdk-7-jdk \ - tomcat7 \ - && echo "########## Config sshd #################" \ - && mkdir -p /var/run/sshd \ - && sed -i "s/UsePrivilegeSeparation.*/UsePrivilegeSeparation no/g" /etc/ssh/sshd_config \ - && sed -i "s/UsePAM.*/UsePAM no/g" /etc/ssh/sshd_config \ - && sed -i "s/PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config \ - && echo "#########Clearn Environment###########" \ - && apt-get autoremove -y --purge \ - && rm -rf /var/lib/apt/lists/* - -ADD script/run.sh /run.sh -RUN chmod +x /*.sh -ENV AUTHORIZED_KEYS **None** - -EXPOSE 22 80 81 8080 8888 -CMD ["/run.sh"] \ No newline at end of file diff --git a/images/cmdide/alpine/nginx.conf b/images/cmdide/alpine/nginx.conf deleted file mode 100644 index 0e528a71..00000000 --- a/images/cmdide/alpine/nginx.conf +++ /dev/null @@ -1,118 +0,0 @@ -user nginx; - -# Set number of worker processes automatically based on number of CPU cores. -worker_processes auto; - -# Configures default error logger. -error_log /var/log/nginx/error.log crit; -# pid /www/server/nginx/logs/nginx.pid; -worker_rlimit_nofile 51200; - -# Includes files with directives to load dynamic modules. -include /etc/nginx/modules/*.conf; - -# Enables the use of JIT for regular expressions to speed-up their processing. -pcre_jit on; - -events - { - # The maximum number of simultaneous connections that can be opened by - # a worker process. - use epoll; - worker_connections 51200; - multi_accept on; - } - -http - { - # Includes mapping of file name extensions to MIME types of responses - # and defines the default type. - include mime.types; - - # include luawaf.conf; - # include proxy.conf; - - default_type application/octet-stream; - - # Name servers used to resolve names of upstream servers into addresses. - # It's also needed when using tcpsocket and udpsocket in Lua modules. - #resolver 208.67.222.222 208.67.220.220; - - server_names_hash_bucket_size 512; - client_header_buffer_size 32k; - large_client_header_buffers 4 32k; - - # Specifies the maximum accepted body size of a client request, as - # indicated by the request header Content-Length. If the stated content - # length is greater than this size, then the client receives the HTTP - # error code 413. Set to 0 to disable. - client_max_body_size 16m; - - # Sendfile copies data between one FD and other from within the kernel, - # which is more efficient than read() + write(). - sendfile on; - - # Causes nginx to attempt to send its HTTP response head in one packet, - # instead of using partial frames. - tcp_nopush on; - - # Timeout for keep-alive connections. Server will close connections after this time. - keepalive_timeout 60; - - # Don't buffer data-sends (disable Nagle algorithm). - # Good for sending frequent small bursts of data in real time. - tcp_nodelay on; - - fastcgi_connect_timeout 300; - fastcgi_send_timeout 300; - fastcgi_read_timeout 300; - fastcgi_buffer_size 64k; - fastcgi_buffers 4 64k; - fastcgi_busy_buffers_size 128k; - fastcgi_temp_file_write_size 256k; - fastcgi_intercept_errors on; - - # Path of the file with Diffie-Hellman parameters for EDH ciphers. - #ssl_dhparam /etc/ssl/nginx/dh2048.pem; - - # Specifies that our cipher suits should be preferred over client ciphers. - ssl_prefer_server_ciphers on; - - # Enables a shared SSL cache with size that can hold around 8000 sessions. - ssl_session_cache shared:SSL:2m; - - # Enable gzipping of responses. - gzip on; - gzip_min_length 1k; - gzip_buffers 4 16k; - gzip_http_version 1.1; - gzip_comp_level 2; - gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml; - # Set the Vary HTTP header as defined in the RFC 2616. - gzip_vary on; - - # Enable checking the existence of precompressed files. - #gzip_static on; - - gzip_proxied expired no-cache no-store private auth; - gzip_disable "MSIE [1-6]\."; - - limit_conn_zone $binary_remote_addr zone=perip:10m; - limit_conn_zone $server_name zone=perserver:10m; - - # Don't tell nginx version to clients. - server_tokens off; - - # Specifies the main log format. - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"'; - - # Sets the path, format, and configuration for a buffered log write. - access_log /var/log/nginx/access.log main; - # access_log off; - - # Includes virtual hosts configs. - include /etc/nginx/conf.d/*.conf; -} - diff --git a/images/cmdide/conf.d/default.conf b/images/cmdide/conf.d/default.conf deleted file mode 100644 index 9b4d49fe..00000000 --- a/images/cmdide/conf.d/default.conf +++ /dev/null @@ -1,55 +0,0 @@ -server - { - listen 80; - server_name _; - index index.html index.htm index.php; - root /var/www; - - location / { - if (!-e $request_filename){ - rewrite ^(.*)$ /index.php?s=$1 last; break; - } - } - - #error_page 404 /404.html; - location ~ [^/]\.php(/|$) - { - try_files $uri =404; - #fastcgi_pass unix:/tmp/php-cgi-70.sock; - fastcgi_pass 127.0.0.1:9000; - fastcgi_index index.php; - include fastcgi.conf; - set $real_script_name $fastcgi_script_name; - if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { - set $real_script_name $1; - set $path_info $2; - } - fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; - fastcgi_param SCRIPT_NAME $real_script_name; - fastcgi_param PATH_INFO $path_info; - } - - location /nginx_status { - stub_status on; - access_log off; - # allow 127.0.0.1; - deny all; - } - - location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ - { - expires 30d; - } - - location ~ .*\.(js|css)?$ - { - expires 12h; - } - - location ~ /\. - { - deny all; - } - - access_log /var/log/nginx/access.log; - } \ No newline at end of file diff --git a/images/cmdide/conf.d/index.php b/images/cmdide/conf.d/index.php deleted file mode 100644 index 558541c9..00000000 --- a/images/cmdide/conf.d/index.php +++ /dev/null @@ -1,1485 +0,0 @@ -=0; $l--) - { - $allsize1[$l]=floor($size/pow(1024,$l)); - $allsize[$l]=$allsize1[$l]-$allsize1[$l+1]*1024; - } - - $len=count($allsize); - - for($j = $len-1; $j >=0; $j--) - { - $fsize=$fsize.$allsize[$j].$danwei[$j]; - } - return $fsize; -} - -function valid_email($str) -{ - return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE; -} - -//检测PHP设置参数 -function show($varName) -{ - switch($result = get_cfg_var($varName)) - { - case 0: - return '×'; - break; - - case 1: - return ''; - break; - - default: - return $result; - break; - } -} - -//保留服务器性能测试结果 -$valInt = isset($_POST['pInt']) ? $_POST['pInt'] : "No Test"; -$valFloat = isset($_POST['pFloat']) ? $_POST['pFloat'] : "No Test"; -$valIo = isset($_POST['pIo']) ? $_POST['pIo'] : "No Test"; - -if ($_GET['act'] == "phpinfo") -{ - phpinfo(); - exit(); -} -elseif($_POST['act'] == "Int Test") -{ - $valInt = test_int(); -} -elseif($_POST['act'] == "Float Test") -{ - $valFloat = test_float(); -} -elseif($_POST['act'] == "IO Test") -{ - $valIo = test_io(); -} -//网速测试-开始 -elseif($_POST['act']=="Start Test") -{ -?> - - "; - } - ?> - -"; - Echo "This shows all the functions supported by the system, and custom functions\n"; - print_r($arr); - echo ""; - exit(); -}elseif($_GET['act'] == "disable_functions") -{ - $disFuns=get_cfg_var("disable_functions"); - if(empty($disFuns)) - { - $arr = '×'; - } - else - { - $arr = $disFuns; - } - Function php() - { - } - echo "
";
-	Echo "This shows all the functions disable by the system\n";
-	print_r($arr);
-	echo "
"; - exit(); -} - -//MySQL检测 -if ($_POST['act'] == 'MySQL Test') -{ - $host = isset($_POST['host']) ? trim($_POST['host']) : ''; - $port = isset($_POST['port']) ? (int) $_POST['port'] : ''; - $login = isset($_POST['login']) ? trim($_POST['login']) : ''; - $password = isset($_POST['password']) ? trim($_POST['password']) : ''; - $host = preg_match('~[^a-z0-9\-\.]+~i', $host) ? '' : $host; - $port = intval($port) ? intval($port) : ''; - $login = preg_match('~[^a-z0-9\_\-]+~i', $login) ? '' : htmlspecialchars($login); - $password = is_string($password) ? htmlspecialchars($password) : ''; -} -elseif ($_POST['act'] == 'Function Test') -{ - $funRe = "Function".$_POST['funName']."Test results support the position: ".isfun1($_POST['funName']); -} -elseif ($_POST['act'] == 'Mail Test') -{ - $mailRe = "Mail test results: send"; - if($_SERVER['SERVER_PORT']==80){$mailContent = "http://".$_SERVER['SERVER_NAME'].($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']);} - else{$mailContent = "http://".$_SERVER['SERVER_NAME'].":".$_SERVER['SERVER_PORT'].($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']);} - $mailRe .= (false !== @mail($_POST["mailAdd"], $mailContent, "This is a test mail!")) ? "Complete":"Failure"; -} - -//网络速度测试 -if(isset($_POST['speed'])) -{ - $speed=round(100/($_POST['speed']/1000),2); -} -elseif($_GET['speed']=="0") -{ - $speed=6666.67; -} -elseif(isset($_GET['speed']) and $_GET['speed']>0) -{ - $speed=round(100/($_GET['speed']/1000),2); //下载速度: $speed kb/s -} -else -{ - $speed=" No Test "; -} - - -// 检测函数支持 -function isfun($funName = '') -{ - if (!$funName || trim($funName) == '' || preg_match('~[^a-z0-9\_]+~i', $funName, $tmp)) return '错误'; - return (false !== function_exists($funName)) ? '' : '×'; -} -function isfun1($funName = '') -{ - if (!$funName || trim($funName) == '' || preg_match('~[^a-z0-9\_]+~i', $funName, $tmp)) return '错误'; - return (false !== function_exists($funName)) ? '√' : '×'; -} - -//整数运算能力测试 -function test_int() -{ - $timeStart = gettimeofday(); - for($i = 0; $i < 3000000; $i++) - { - $t = 1+1; - } - $timeEnd = gettimeofday(); - $time = ($timeEnd["usec"]-$timeStart["usec"])/1000000+$timeEnd["sec"]-$timeStart["sec"]; - $time = round($time, 3)." Second"; - return $time; -} - -//浮点运算能力测试 -function test_float() -{ - //得到圆周率值 - $t = pi(); - $timeStart = gettimeofday(); - - for($i = 0; $i < 3000000; $i++) - { - //开平方 - sqrt($t); - } - - $timeEnd = gettimeofday(); - $time = ($timeEnd["usec"]-$timeStart["usec"])/1000000+$timeEnd["sec"]-$timeStart["sec"]; - $time = round($time, 3)."Second"; - return $time; -} - -//IO能力测试 -function test_io() -{ - $fp = @fopen(PHPSELF, "r"); - $timeStart = gettimeofday(); - for($i = 0; $i < 10000; $i++) - { - @fread($fp, 10240); - @rewind($fp); - } - $timeEnd = gettimeofday(); - @fclose($fp); - $time = ($timeEnd["usec"]-$timeStart["usec"])/1000000+$timeEnd["sec"]-$timeStart["sec"]; - $time = round($time, 3)."Second"; - return($time); -} - -function GetCoreInformation() {$data = file('/proc/stat');$cores = array();foreach( $data as $line ) {if( preg_match('/^cpu[0-9]/', $line) ){$info = explode(' ', $line);$cores[]=array('user'=>$info[1],'nice'=>$info[2],'sys' => $info[3],'idle'=>$info[4],'iowait'=>$info[5],'irq' => $info[6],'softirq' => $info[7]);}}return $cores;} -function GetCpuPercentages($stat1, $stat2) {if(count($stat1)!==count($stat2)){return;}$cpus=array();for( $i = 0, $l = count($stat1); $i < $l; $i++) { $dif = array(); $dif['user'] = $stat2[$i]['user'] - $stat1[$i]['user'];$dif['nice'] = $stat2[$i]['nice'] - $stat1[$i]['nice']; $dif['sys'] = $stat2[$i]['sys'] - $stat1[$i]['sys'];$dif['idle'] = $stat2[$i]['idle'] - $stat1[$i]['idle'];$dif['iowait'] = $stat2[$i]['iowait'] - $stat1[$i]['iowait'];$dif['irq'] = $stat2[$i]['irq'] - $stat1[$i]['irq'];$dif['softirq'] = $stat2[$i]['softirq'] - $stat1[$i]['softirq'];$total = array_sum($dif);$cpu = array();foreach($dif as $x=>$y) $cpu[$x] = round($y / $total * 100, 2);$cpus['cpu' . $i] = $cpu;}return $cpus;} -$stat1 = GetCoreInformation();sleep(1);$stat2 = GetCoreInformation();$data = GetCpuPercentages($stat1, $stat2); -$cpu_show = $data['cpu0']['user']."%us, ".$data['cpu0']['sys']."%sy, ".$data['cpu0']['nice']."%ni, ".$data['cpu0']['idle']."%id, ".$data['cpu0']['iowait']."%wa, ".$data['cpu0']['irq']."%irq, ".$data['cpu0']['softirq']."%softirq"; -function makeImageUrl($title, $data) {$api='http://api.yahei.net/tz/cpu_show.php?id=';$url.=$data['user'].',';$url.=$data['nice'].',';$url.=$data['sys'].',';$url.=$data['idle'].',';$url.=$data['iowait'];$url.='&chdl=User|Nice|Sys|Idle|Iowait&chdlp=b&chl=';$url.=$data['user'].'%25|';$url.=$data['nice'].'%25|';$url.=$data['sys'].'%25|';$url.=$data['idle'].'%25|';$url.=$data['iowait'].'%25';$url.='&chtt=Core+'.$title;return $api.base64_encode($url);} -if($_GET['act'] == "cpu_percentage"){echo "
Slow image loading, please be patient!

";foreach( $data as $k => $v ) {echo '';}echo "
";exit();} - -// 根据不同系统取得CPU相关信息 -switch(PHP_OS) -{ - case "Linux": - $sysReShow = (false !== ($sysInfo = sys_linux()))?"show":"none"; - break; - - case "FreeBSD": - $sysReShow = (false !== ($sysInfo = sys_freebsd()))?"show":"none"; - break; - -/* - case "WINNT": - $sysReShow = (false !== ($sysInfo = sys_windows()))?"show":"none"; - break; -*/ - - default: - break; -} - -//linux系统探测 -function sys_linux() -{ - // CPU - if (false === ($str = @file("/proc/cpuinfo"))) return false; - $str = implode("", $str); - @preg_match_all("/model\s+name\s{0,}\:+\s{0,}([\w\s\)\(\@.-]+)([\r\n]+)/s", $str, $model); - @preg_match_all("/cpu\s+MHz\s{0,}\:+\s{0,}([\d\.]+)[\r\n]+/", $str, $mhz); - @preg_match_all("/cache\s+size\s{0,}\:+\s{0,}([\d\.]+\s{0,}[A-Z]+[\r\n]+)/", $str, $cache); - @preg_match_all("/bogomips\s{0,}\:+\s{0,}([\d\.]+)[\r\n]+/", $str, $bogomips); - if (false !== is_array($model[1])) - { - $res['cpu']['num'] = sizeof($model[1]); - /* - for($i = 0; $i < $res['cpu']['num']; $i++) - { - $res['cpu']['model'][] = $model[1][$i].' ('.$mhz[1][$i].')'; - $res['cpu']['mhz'][] = $mhz[1][$i]; - $res['cpu']['cache'][] = $cache[1][$i]; - $res['cpu']['bogomips'][] = $bogomips[1][$i]; - }*/ - if($res['cpu']['num']==1) - $x1 = ''; - else - $x1 = ' ×'.$res['cpu']['num']; - $mhz[1][0] = ' | Frequency:'.$mhz[1][0]; - $cache[1][0] = ' | Secondary cache:'.$cache[1][0]; - $bogomips[1][0] = ' | Bogomips:'.$bogomips[1][0]; - $res['cpu']['model'][] = $model[1][0].$mhz[1][0].$cache[1][0].$bogomips[1][0].$x1; - if (false !== is_array($res['cpu']['model'])) $res['cpu']['model'] = implode("
", $res['cpu']['model']); - if (false !== is_array($res['cpu']['mhz'])) $res['cpu']['mhz'] = implode("
", $res['cpu']['mhz']); - if (false !== is_array($res['cpu']['cache'])) $res['cpu']['cache'] = implode("
", $res['cpu']['cache']); - if (false !== is_array($res['cpu']['bogomips'])) $res['cpu']['bogomips'] = implode("
", $res['cpu']['bogomips']); - } - - // NETWORK - - // UPTIME - if (false === ($str = @file("/proc/uptime"))) return false; - $str = explode(" ", implode("", $str)); - $str = trim($str[0]); - $min = $str / 60; - $hours = $min / 60; - $days = floor($hours / 24); - $hours = floor($hours - ($days * 24)); - $min = floor($min - ($days * 60 * 24) - ($hours * 60)); - if ($days !== 0) $res['uptime'] = $days."Day"; - if ($hours !== 0) $res['uptime'] .= $hours."Hour"; - $res['uptime'] .= $min."Minute"; - - // MEMORY - if (false === ($str = @file("/proc/meminfo"))) return false; - $str = implode("", $str); - preg_match_all("/MemTotal\s{0,}\:+\s{0,}([\d\.]+).+?MemFree\s{0,}\:+\s{0,}([\d\.]+).+?Cached\s{0,}\:+\s{0,}([\d\.]+).+?SwapTotal\s{0,}\:+\s{0,}([\d\.]+).+?SwapFree\s{0,}\:+\s{0,}([\d\.]+)/s", $str, $buf); - preg_match_all("/Buffers\s{0,}\:+\s{0,}([\d\.]+)/s", $str, $buffers); - - $res['memTotal'] = round($buf[1][0]/1024, 2); - $res['memFree'] = round($buf[2][0]/1024, 2); - $res['memBuffers'] = round($buffers[1][0]/1024, 2); - $res['memCached'] = round($buf[3][0]/1024, 2); - $res['memUsed'] = $res['memTotal']-$res['memFree']; - $res['memPercent'] = (floatval($res['memTotal'])!=0)?round($res['memUsed']/$res['memTotal']*100,2):0; - - $res['memRealUsed'] = $res['memTotal'] - $res['memFree'] - $res['memCached'] - $res['memBuffers']; //真实内存使用 - $res['memRealFree'] = $res['memTotal'] - $res['memRealUsed']; //真实空闲 - $res['memRealPercent'] = (floatval($res['memTotal'])!=0)?round($res['memRealUsed']/$res['memTotal']*100,2):0; //真实内存使用率 - - $res['memCachedPercent'] = (floatval($res['memCached'])!=0)?round($res['memCached']/$res['memTotal']*100,2):0; //Cached内存使用率 - - $res['swapTotal'] = round($buf[4][0]/1024, 2); - $res['swapFree'] = round($buf[5][0]/1024, 2); - $res['swapUsed'] = round($res['swapTotal']-$res['swapFree'], 2); - $res['swapPercent'] = (floatval($res['swapTotal'])!=0)?round($res['swapUsed']/$res['swapTotal']*100,2):0; - - // LOAD AVG - if (false === ($str = @file("/proc/loadavg"))) return false; - $str = explode(" ", implode("", $str)); - $str = array_chunk($str, 4); - $res['loadAvg'] = implode(" ", $str[0]); - - return $res; -} - -//FreeBSD系统探测 -function sys_freebsd() -{ - //CPU - if (false === ($res['cpu']['num'] = get_key("hw.ncpu"))) return false; - $res['cpu']['model'] = get_key("hw.model"); - //LOAD AVG - if (false === ($res['loadAvg'] = get_key("vm.loadavg"))) return false; - //UPTIME - if (false === ($buf = get_key("kern.boottime"))) return false; - $buf = explode(' ', $buf); - $sys_ticks = time() - intval($buf[3]); - $min = $sys_ticks / 60; - $hours = $min / 60; - $days = floor($hours / 24); - $hours = floor($hours - ($days * 24)); - $min = floor($min - ($days * 60 * 24) - ($hours * 60)); - if ($days !== 0) $res['uptime'] = $days."Day"; - if ($hours !== 0) $res['uptime'] .= $hours."Hour"; - $res['uptime'] .= $min."Minute"; - //MEMORY - if (false === ($buf = get_key("hw.physmem"))) return false; - $res['memTotal'] = round($buf/1024/1024, 2); - - $str = get_key("vm.vmtotal"); - preg_match_all("/\nVirtual Memory[\:\s]*\(Total[\:\s]*([\d]+)K[\,\s]*Active[\:\s]*([\d]+)K\)\n/i", $str, $buff, PREG_SET_ORDER); - preg_match_all("/\nReal Memory[\:\s]*\(Total[\:\s]*([\d]+)K[\,\s]*Active[\:\s]*([\d]+)K\)\n/i", $str, $buf, PREG_SET_ORDER); - - $res['memRealUsed'] = round($buf[0][2]/1024, 2); - $res['memCached'] = round($buff[0][2]/1024, 2); - $res['memUsed'] = round($buf[0][1]/1024, 2) + $res['memCached']; - $res['memFree'] = $res['memTotal'] - $res['memUsed']; - $res['memPercent'] = (floatval($res['memTotal'])!=0)?round($res['memUsed']/$res['memTotal']*100,2):0; - - $res['memRealPercent'] = (floatval($res['memTotal'])!=0)?round($res['memRealUsed']/$res['memTotal']*100,2):0; - - return $res; -} - -//取得参数值 FreeBSD -function get_key($keyName) -{ - return do_command('sysctl', "-n $keyName"); -} - -//确定执行文件位置 FreeBSD -function find_command($commandName) -{ - $path = array('/bin', '/sbin', '/usr/bin', '/usr/sbin', '/usr/local/bin', '/usr/local/sbin'); - foreach($path as $p) - { - if (@is_executable("$p/$commandName")) return "$p/$commandName"; - } - return false; -} - -//执行系统命令 FreeBSD -function do_command($commandName, $args) -{ - $buffer = ""; - if (false === ($command = find_command($commandName))) return false; - if ($fp = @popen("$command $args", 'r')) - { - while (!@feof($fp)) - { - $buffer .= @fgets($fp, 4096); - } - return trim($buffer); - } - return false; -} - -//windows系统探测 -function sys_windows() -{ - if (PHP_VERSION >= 5) - { - $objLocator = new COM("WbemScripting.SWbemLocator"); - $wmi = $objLocator->ConnectServer(); - $prop = $wmi->get("Win32_PnPEntity"); - } - else - { - return false; - } - - //CPU - $cpuinfo = GetWMI($wmi,"Win32_Processor", array("Name","L2CacheSize","NumberOfCores")); - $res['cpu']['num'] = $cpuinfo[0]['NumberOfCores']; - if (null == $res['cpu']['num']) - { - $res['cpu']['num'] = 1; - }/* - for ($i=0;$i<$res['cpu']['num'];$i++) - { - $res['cpu']['model'] .= $cpuinfo[0]['Name']."
"; - $res['cpu']['cache'] .= $cpuinfo[0]['L2CacheSize']."
"; - }*/ - $cpuinfo[0]['L2CacheSize'] = ' ('.$cpuinfo[0]['L2CacheSize'].')'; - if($res['cpu']['num']==1) - $x1 = ''; - else - $x1 = ' ×'.$res['cpu']['num']; - $res['cpu']['model'] = $cpuinfo[0]['Name'].$cpuinfo[0]['L2CacheSize'].$x1; - // SYSINFO - $sysinfo = GetWMI($wmi,"Win32_OperatingSystem", array('LastBootUpTime','TotalVisibleMemorySize','FreePhysicalMemory','Caption','CSDVersion','SerialNumber','InstallDate')); - $sysinfo[0]['Caption']=iconv('GBK', 'UTF-8',$sysinfo[0]['Caption']); - $sysinfo[0]['CSDVersion']=iconv('GBK', 'UTF-8',$sysinfo[0]['CSDVersion']); - $res['win_n'] = $sysinfo[0]['Caption']." ".$sysinfo[0]['CSDVersion']." 序列号:{$sysinfo[0]['SerialNumber']} 于".date('Y年m月d日H:i:s',strtotime(substr($sysinfo[0]['InstallDate'],0,14)))."安装"; - //UPTIME - $res['uptime'] = $sysinfo[0]['LastBootUpTime']; - - $sys_ticks = 3600*8 + time() - strtotime(substr($res['uptime'],0,14)); - $min = $sys_ticks / 60; - $hours = $min / 60; - $days = floor($hours / 24); - $hours = floor($hours - ($days * 24)); - $min = floor($min - ($days * 60 * 24) - ($hours * 60)); - if ($days !== 0) $res['uptime'] = $days."Day"; - if ($hours !== 0) $res['uptime'] .= $hours."Hour"; - $res['uptime'] .= $min."Minute"; - - //MEMORY - $res['memTotal'] = round($sysinfo[0]['TotalVisibleMemorySize']/1024,2); - $res['memFree'] = round($sysinfo[0]['FreePhysicalMemory']/1024,2); - $res['memUsed'] = $res['memTotal']-$res['memFree']; //上面两行已经除以1024,这行不用再除了 - $res['memPercent'] = round($res['memUsed'] / $res['memTotal']*100,2); - - $swapinfo = GetWMI($wmi,"Win32_PageFileUsage", array('AllocatedBaseSize','CurrentUsage')); - - // LoadPercentage - $loadinfo = GetWMI($wmi,"Win32_Processor", array("LoadPercentage")); - $res['loadAvg'] = $loadinfo[0]['LoadPercentage']; - - return $res; -} - -function GetWMI($wmi,$strClass, $strValue = array()) -{ - $arrData = array(); - - $objWEBM = $wmi->Get($strClass); - $arrProp = $objWEBM->Properties_; - $arrWEBMCol = $objWEBM->Instances_(); - foreach($arrWEBMCol as $objItem) - { - @reset($arrProp); - $arrInstance = array(); - foreach($arrProp as $propItem) - { - eval("\$value = \$objItem->" . $propItem->Name . ";"); - if (empty($strValue)) - { - $arrInstance[$propItem->Name] = trim($value); - } - else - { - if (in_array($propItem->Name, $strValue)) - { - $arrInstance[$propItem->Name] = trim($value); - } - } - } - $arrData[] = $arrInstance; - } - return $arrData; -} - -//比例条 -function bar($percent) -{ -?> -
 
-"$du",'freeSpace'=>"$df",'hdPercent'=>"$hdPercent",'barhdPercent'=>"$hdPercent%",'TotalMemory'=>"$mt",'UsedMemory'=>"$mu",'FreeMemory'=>"$mf",'CachedMemory'=>"$mc",'Buffers'=>"$mb",'TotalSwap'=>"$st",'swapUsed'=>"$su",'swapFree'=>"$sf",'loadAvg'=>"$load",'uptime'=>"$uptime",'freetime'=>"$freetime",'bjtime'=>"$bjtime",'stime'=>"$stime",'memRealPercent'=>"$memRealPercent",'memRealUsed'=>"$memRealUsed",'memRealFree'=>"$memRealFree",'memPercent'=>"$memPercent%",'memCachedPercent'=>"$memCachedPercent",'barmemCachedPercent'=>"$memCachedPercent%",'swapPercent'=>"$swapPercent",'barmemRealPercent'=>"$memRealPercent%",'barswapPercent'=>"$swapPercent%",'NetOut2'=>"$NetOut[2]",'NetOut3'=>"$NetOut[3]",'NetOut4'=>"$NetOut[4]",'NetOut5'=>"$NetOut[5]",'NetOut6'=>"$NetOut[6]",'NetOut7'=>"$NetOut[7]",'NetOut8'=>"$NetOut[8]",'NetOut9'=>"$NetOut[9]",'NetOut10'=>"$NetOut[10]",'NetInput2'=>"$NetInput[2]",'NetInput3'=>"$NetInput[3]",'NetInput4'=>"$NetInput[4]",'NetInput5'=>"$NetInput[5]",'NetInput6'=>"$NetInput[6]",'NetInput7'=>"$NetInput[7]",'NetInput8'=>"$NetInput[8]",'NetInput9'=>"$NetInput[9]",'NetInput10'=>"$NetInput[10]",'NetOutSpeed2'=>"$NetOutSpeed[2]",'NetOutSpeed3'=>"$NetOutSpeed[3]",'NetOutSpeed4'=>"$NetOutSpeed[4]",'NetOutSpeed5'=>"$NetOutSpeed[5]",'NetInputSpeed2'=>"$NetInputSpeed[2]",'NetInputSpeed3'=>"$NetInputSpeed[3]",'NetInputSpeed4'=>"$NetInputSpeed[4]",'NetInputSpeed5'=>"$NetInputSpeed[5]"); - $jarr=json_encode($arr); - $_GET['callback'] = htmlspecialchars($_GET['callback']); - echo $_GET['callback'],'(',$jarr,')'; - exit; -} -?> - - - - -<?php echo $title.$version; ?> - - - - - - - - - - -
- - - - - - - - - - - - - - - -
PHPModuleOtherDatabasePerformanceSpeedMySQLFunctionMailDownload
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Server Parameters
Server Domain/IP - ()  Your IP address is:
Server identifies the
Server OS  Kernel version: Web Server
Server LanguageServer Port
Server HostNameAbsolute Path
Administrator MailProber Path
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Real-time Data Server
Current Server TimeServer Uptime
CPU Model [Core]
CPU usageView Chart";}else{echo "Only supports the Linux system";}?> -
Space usage - Total Space  G, - Used  G, - Free  G, - Rate % -
 
-
Memory usage - - Total Memory: - - , Used - - , Free - - , Rate - -
 
-0) -{ -?> - Cache Memory - , Rate - - % | Buffers -
 
- - Real Memory Used - - , Real Memory Free - - , Rate - - % -
 
-0) -{ -?> - SWAP: - - , Used - - , Free - - , Rate - - % -
 
- - -
Average System Load
- - - - - - - - - - - - - - - -
NetWork
: In : Real time: 0B/sOut : Real time: 0B/s
- - - - - - - - - -
PHP has been compiled module testing
-$value) { - if ($key!=0 && $key%13==0) { - echo '
'; - } - echo "$value  "; -} -?>
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PHP Parameters
PHP Info: - - ×' :"PHPINFO";?> - PHP Version:
Run PHP: Memory Limit:
PHP Safe Mode: Post Max Size:
Upload Max Filesize: Floating-point data of significant digits:
Max Execution Time: SecondSocket TimeOut: Second
PHP Doc Root: User Dir:
Enable Dl: Include Path:
Display Errors: Register Globals:
Magic Quotes Gpc: "<?...?>"Short Open Tag:
"<% %>"ASP Tags: Ignore Repeated Errors:
Ignore Repeated Source: Report Memleaks:
Magic Quotes Gpc: Magic Quotes Runtime:
Allow URL Fopen: Register Argc Argv:
Cookie:√' : '×';?>Spell check(ASpell Library):
High-precision math(BCMath):PREL(PCRE):
PDF:SNMP:
VMailMgr:Curl:
SMTP:√' : '×';?>SMTP:×';?>
Enable Functions: Click here to view more!
Disable Functions: -×'; -} -else -{ - //echo $disFuns; - $disFuns_array = explode(',',$disFuns); - foreach ($disFuns_array as $key=>$value) - { - if ($key!=0 && $key%5==0) { - echo '
'; - } - echo "$value  "; -} -} - -?> -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Components
FTP: XML:
Session: Socket:
Calendar - Allow Url Fopen:
GD Library: - ×';} - ?>Zlib:
IMAP: JDToGregorian:
Preg Match: WDDX:
Iconv: mbstring:
BCADD: LDAP:
MCrypt: Mhash Count:
- - - - - - - - - - - - - - - - - - - - - - - -
Other Components
Zend Version×';}else{echo $zend_version;}?> - 2) -{ - echo "ZendGuardLoader[On]"; -} -else -{ - echo "Zend Optimizer"; -} -?> - 2){echo (get_cfg_var("zend_loader.enable"))?'':'×';} else{if(function_exists('zend_optimizer_version')){ echo zend_optimizer_version();}else{ echo (get_cfg_var("zend_optimizer.optimization_level")||get_cfg_var("zend_extension_manager.optimizer_ts")||get_cfg_var("zend.ze1_compatibility_mode")||get_cfg_var("zend_extension_ts"))?'':'×';}}?>
eAccelerator×";} ?>ioncube×";}?>
XCache×";} ?>APC×";} ?>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Database
MySQL: - - ODBC:
Oracle: SQL Server:
dBASE: mSQL:
SQLite: √ ';echo "SQLite3 Ver ";echo $sqliteVer[versionString];}else {echo isfun("sqlite_close");if(isfun("sqlite_close") == '') {echo " : ".@sqlite_libversion();}}?>Hyperwave:
Postgre SQL: Informix:
DBA database: DBM database:
FilePro database:SyBase database:
- - -
" method="post"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Server Performance Test
Reference ObjectInt Test
(1+1 Count 3 Million)
Float Test
(Pi times the square root of 3 million)
I/O Test
(10K file read 10,000 times)
CPU Info
LinodeVPS0.357 Second0.802 Second0.023 Second4 x Xeon L5520 @ 2.27GHz
PhotonVPS.com0.431 Second1.024 Second0.034 Second8 x Xeon E5520 @ 2.27GHz
SpaceRich.com0.421 Second1.003 Second0.038 Second4 x Core i7 920 @ 2.67GHz
RiZie.com0.521 Second1.559 Second0.054 Second2 x Pentium4 3.00GHz
CitynetHost.com0.343 Second0.761 Second0.023 Second2 x Core2Duo E4600 @ 2.40GHz
IXwebhosting.com0.535 Second1.607 Second0.058 Second4 x Xeon E5530 @ 2.40GHz
This Server


- - - - - - - - - - - - -
Network Speed Test
-
- 1000k bytes sent to the client data -
- - - - - - - - - - - - - - - - - - -
Bandwidth1M2M3M4M5M6M7M8M9M10M
- - - - -
">">
-
- ".$_GET['speed']." Millisecond, Download Speed: "."".$speed.""." kb/s":" No Test " ?> - -
- - - - - - - - - - -
MySQL Database connection detection
- Host: - Port: - Username: - Password: - - -
- alert('Connect to the MySql database to normal')"; - } else { - echo ""; - } - } else { - echo ""; - } - } - ?> - - - - - - - - - - - alert('$funRe')"; - } - ?> -
Function Test
- Enter the function you want to test: - - - -
- - - - - - - - - - - alert('$mailRe')"; - } - ?> -
Mail Send Test
- Please enter your email address to test: - - - -
-
- - - - - - - -
Processed in seconds. memory usage.TOP
- - -
- - diff --git a/images/cmdide/conf.d/letsencrypt-renew b/images/cmdide/conf.d/letsencrypt-renew deleted file mode 100644 index 13dd85e1..00000000 --- a/images/cmdide/conf.d/letsencrypt-renew +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# Lets Encrypt -if [ -z "$DOMAIN" ]; then - echo "You need to have \$DOMAIN set" -else - if [ -f /etc/letsencrypt/live/${DOMAIN}/fullchain.pem ]; then - certbot renew - supervisorctl restart nginx - else - echo "There is no cert to renew" - fi -fi diff --git a/images/cmdide/conf.d/letsencrypt-setup b/images/cmdide/conf.d/letsencrypt-setup deleted file mode 100644 index 45f560be..00000000 --- a/images/cmdide/conf.d/letsencrypt-setup +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -# Lets Encrypt -if [ -z "$WEBROOT" ] || [ -z "$GIT_EMAIL" ] || [ -z "$DOMAIN" ]; then - echo "You need the \$WEBROOT, \$GIT_EMAIL and the \$DOMAIN Variables" -else - certbot certonly --webroot -w $WEBROOT -d $DOMAIN --email $GIT_EMAIL --agree-tos --quiet - ln -s /etc/nginx/sites-available/default-ssl.conf /etc/nginx/sites-enabled/ - - # change nginx for webroot and domain name - sed -i "s/##DOMAIN##/${DOMAIN}/g" /etc/nginx/sites-enabled/default-ssl.conf - sed -i "s#root /var/www/html;#root ${WEBROOT};#g" /etc/nginx/sites-available/default-ssl.conf - if [ ! -z "$WEBROOT" ]; then - webroot=$WEBROOT - sed -i "s#root /var/www/html;#root ${webroot};#g" /etc/nginx/sites-available/default-ssl.conf - fi - - supervisorctl restart nginx - -fi diff --git a/images/cmdide/conf.d/nginx.conf b/images/cmdide/conf.d/nginx.conf deleted file mode 100644 index 0c426183..00000000 --- a/images/cmdide/conf.d/nginx.conf +++ /dev/null @@ -1,62 +0,0 @@ -worker_processes auto; -error_log /var/log/nginx/error.log crit; -pid /run/nginx/nginx.pid; -worker_rlimit_nofile 51200; - -events - { - use epoll; - multi_accept on; - worker_connections 51200; - } - -http - { - include /etc/nginx/mime.types; - #include proxy.conf; - #include luawaf.conf; - - default_type application/octet-stream; - - server_names_hash_bucket_size 128; - client_header_buffer_size 32k; - large_client_header_buffers 4 32k; - client_max_body_size 50m; - - sendfile on; - tcp_nopush on; - - keepalive_timeout 60; - - tcp_nodelay on; - - fastcgi_connect_timeout 300; - fastcgi_send_timeout 300; - fastcgi_read_timeout 300; - fastcgi_buffer_size 64k; - fastcgi_buffers 4 64k; - fastcgi_busy_buffers_size 128k; - fastcgi_temp_file_write_size 256k; - fastcgi_intercept_errors on; - - gzip on; - gzip_min_length 1k; - gzip_buffers 4 16k; - gzip_http_version 1.1; - gzip_comp_level 2; - gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml; - gzip_vary on; - gzip_proxied expired no-cache no-store private auth; - gzip_disable "MSIE [1-6]\."; - - limit_conn_zone $binary_remote_addr zone=perip:10m; - limit_conn_zone $server_name zone=perserver:10m; - - server_tokens off; - access_log off; - - include /etc/nginx/conf.d/*.conf; - include /etc/nginx/vhost.d/*.conf; - include /etc/nginx/modules/*.conf; -} - diff --git a/images/cmdide/conf.d/php.ini b/images/cmdide/conf.d/php.ini deleted file mode 100644 index e72b7df1..00000000 --- a/images/cmdide/conf.d/php.ini +++ /dev/null @@ -1,1934 +0,0 @@ -[PHP] - -;;;;;;;;;;;;;;;;;;; -; About php.ini ; -;;;;;;;;;;;;;;;;;;; -; PHP's initialization file, generally called php.ini, is responsible for -; configuring many of the aspects of PHP's behavior. - -; PHP attempts to find and load this configuration from a number of locations. -; The following is a summary of its search order: -; 1. SAPI module specific location. -; 2. The PHPRC environment variable. (As of PHP 5.2.0) -; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0) -; 4. Current working directory (except CLI) -; 5. The web server's directory (for SAPI modules), or directory of PHP -; (otherwise in Windows) -; 6. The directory from the --with-config-file-path compile time option, or the -; Windows directory (C:\windows or C:\winnt) -; See the PHP docs for more specific information. -; http://php.net/configuration.file - -; The syntax of the file is extremely simple. Whitespace and lines -; beginning with a semicolon are silently ignored (as you probably guessed). -; Section headers (e.g. [Foo]) are also silently ignored, even though -; they might mean something in the future. - -; Directives following the section heading [PATH=/www/mysite] only -; apply to PHP files in the /www/mysite directory. Directives -; following the section heading [HOST=www.example.com] only apply to -; PHP files served from www.example.com. Directives set in these -; special sections cannot be overridden by user-defined INI files or -; at runtime. Currently, [PATH=] and [HOST=] sections only work under -; CGI/FastCGI. -; http://php.net/ini.sections - -; Directives are specified using the following syntax: -; directive = value -; Directive names are *case sensitive* - foo=bar is different from FOO=bar. -; Directives are variables used to configure PHP or PHP extensions. -; There is no name validation. If PHP can't find an expected -; directive because it is not set or is mistyped, a default value will be used. - -; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one -; of the INI constants (On, Off, True, False, Yes, No and None) or an expression -; (e.g. E_ALL & ~E_NOTICE), a quoted string ("bar"), or a reference to a -; previously set variable or directive (e.g. ${foo}) - -; Expressions in the INI file are limited to bitwise operators and parentheses: -; | bitwise OR -; ^ bitwise XOR -; & bitwise AND -; ~ bitwise NOT -; ! boolean NOT - -; Boolean flags can be turned on using the values 1, On, True or Yes. -; They can be turned off using the values 0, Off, False or No. - -; An empty string can be denoted by simply not writing anything after the equal -; sign, or by using the None keyword: - -; foo = ; sets foo to an empty string -; foo = None ; sets foo to an empty string -; foo = "None" ; sets foo to the string 'None' - -; If you use constants in your value, and these constants belong to a -; dynamically loaded extension (either a PHP extension or a Zend extension), -; you may only use these constants *after* the line that loads the extension. - -;;;;;;;;;;;;;;;;;;; -; About this file ; -;;;;;;;;;;;;;;;;;;; -; PHP comes packaged with two INI files. One that is recommended to be used -; in production environments and one that is recommended to be used in -; development environments. - -; php.ini-production contains settings which hold security, performance and -; best practices at its core. But please be aware, these settings may break -; compatibility with older or less security conscience applications. We -; recommending using the production ini in production and testing environments. - -; php.ini-development is very similar to its production variant, except it is -; much more verbose when it comes to errors. We recommend using the -; development version only in development environments, as errors shown to -; application users can inadvertently leak otherwise secure information. - -; This is php.ini-production INI file. - -;;;;;;;;;;;;;;;;;;; -; Quick Reference ; -;;;;;;;;;;;;;;;;;;; -; The following are all the settings which are different in either the production -; or development versions of the INIs with respect to PHP's default behavior. -; Please see the actual settings later in the document for more details as to why -; we recommend these changes in PHP's behavior. - -; display_errors -; Default Value: On -; Development Value: On -; Production Value: Off - -; display_startup_errors -; Default Value: Off -; Development Value: On -; Production Value: Off - -; error_reporting -; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED -; Development Value: E_ALL -; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT - -; html_errors -; Default Value: On -; Development Value: On -; Production value: On - -; log_errors -; Default Value: Off -; Development Value: On -; Production Value: On - -; max_input_time -; Default Value: -1 (Unlimited) -; Development Value: 60 (60 seconds) -; Production Value: 60 (60 seconds) - -; output_buffering -; Default Value: Off -; Development Value: 4096 -; Production Value: 4096 - -; register_argc_argv -; Default Value: On -; Development Value: Off -; Production Value: Off - -; request_order -; Default Value: None -; Development Value: "GP" -; Production Value: "GP" - -; session.gc_divisor -; Default Value: 100 -; Development Value: 1000 -; Production Value: 1000 - -; session.sid_bits_per_character -; Default Value: 4 -; Development Value: 5 -; Production Value: 5 - -; short_open_tag -; Default Value: On -; Development Value: Off -; Production Value: Off - -; track_errors -; Default Value: Off -; Development Value: On -; Production Value: Off - -; variables_order -; Default Value: "EGPCS" -; Development Value: "GPCS" -; Production Value: "GPCS" - -;;;;;;;;;;;;;;;;;;;; -; php.ini Options ; -;;;;;;;;;;;;;;;;;;;; -; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini" -;user_ini.filename = ".user.ini" - -; To disable this feature set this option to empty value -;user_ini.filename = - -; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes) -;user_ini.cache_ttl = 300 - -;;;;;;;;;;;;;;;;;;;; -; Language Options ; -;;;;;;;;;;;;;;;;;;;; - -; Enable the PHP scripting language engine under Apache. -; http://php.net/engine -engine = On - -; This directive determines whether or not PHP will recognize code between -; tags as PHP source which should be processed as such. It is -; generally recommended that should be used and that this feature -; should be disabled, as enabling it may result in issues when generating XML -; documents, however this remains supported for backward compatibility reasons. -; Note that this directive does not control the would work. -; http://php.net/syntax-highlighting -;highlight.string = #DD0000 -;highlight.comment = #FF9900 -;highlight.keyword = #007700 -;highlight.default = #0000BB -;highlight.html = #000000 - -; If enabled, the request will be allowed to complete even if the user aborts -; the request. Consider enabling it if executing long requests, which may end up -; being interrupted by the user or a browser timing out. PHP's default behavior -; is to disable this feature. -; http://php.net/ignore-user-abort -;ignore_user_abort = On - -; Determines the size of the realpath cache to be used by PHP. This value should -; be increased on systems where PHP opens many files to reflect the quantity of -; the file operations performed. -; http://php.net/realpath-cache-size -;realpath_cache_size = 4096k - -; Duration of time, in seconds for which to cache realpath information for a given -; file or directory. For systems with rarely changing files, consider increasing this -; value. -; http://php.net/realpath-cache-ttl -;realpath_cache_ttl = 120 - -; Enables or disables the circular reference collector. -; http://php.net/zend.enable-gc -zend.enable_gc = On - -; If enabled, scripts may be written in encodings that are incompatible with -; the scanner. CP936, Big5, CP949 and Shift_JIS are the examples of such -; encodings. To use this feature, mbstring extension must be enabled. -; Default: Off -;zend.multibyte = Off - -; Allows to set the default encoding for the scripts. This value will be used -; unless "declare(encoding=...)" directive appears at the top of the script. -; Only affects if zend.multibyte is set. -; Default: "" -;zend.script_encoding = - -;;;;;;;;;;;;;;;;; -; Miscellaneous ; -;;;;;;;;;;;;;;;;; - -; Decides whether PHP may expose the fact that it is installed on the server -; (e.g. by adding its signature to the Web server header). It is no security -; threat in any way, but it makes it possible to determine whether you use PHP -; on your server or not. -; http://php.net/expose-php -expose_php = Off - -;;;;;;;;;;;;;;;;;;; -; Resource Limits ; -;;;;;;;;;;;;;;;;;;; - -; Maximum execution time of each script, in seconds -; http://php.net/max-execution-time -; Note: This directive is hardcoded to 0 for the CLI SAPI -max_execution_time = 30 - -; Maximum amount of time each script may spend parsing request data. It's a good -; idea to limit this time on productions servers in order to eliminate unexpectedly -; long running scripts. -; Note: This directive is hardcoded to -1 for the CLI SAPI -; Default Value: -1 (Unlimited) -; Development Value: 60 (60 seconds) -; Production Value: 60 (60 seconds) -; http://php.net/max-input-time -max_input_time = 60 - -; Maximum input variable nesting level -; http://php.net/max-input-nesting-level -;max_input_nesting_level = 64 - -; How many GET/POST/COOKIE input variables may be accepted -; max_input_vars = 1000 - -; Maximum amount of memory a script may consume (128MB) -; http://php.net/memory-limit -memory_limit = 64M - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Error handling and logging ; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -; This directive informs PHP of which errors, warnings and notices you would like -; it to take action for. The recommended way of setting values for this -; directive is through the use of the error level constants and bitwise -; operators. The error level constants are below here for convenience as well as -; some common settings and their meanings. -; By default, PHP is set to take action on all errors, notices and warnings EXCEPT -; those related to E_NOTICE and E_STRICT, which together cover best practices and -; recommended coding standards in PHP. For performance reasons, this is the -; recommend error reporting setting. Your production server shouldn't be wasting -; resources complaining about best practices and coding standards. That's what -; development servers and development settings are for. -; Note: The php.ini-development file has this setting as E_ALL. This -; means it pretty much reports everything which is exactly what you want during -; development and early testing. -; -; Error Level Constants: -; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0) -; E_ERROR - fatal run-time errors -; E_RECOVERABLE_ERROR - almost fatal run-time errors -; E_WARNING - run-time warnings (non-fatal errors) -; E_PARSE - compile-time parse errors -; E_NOTICE - run-time notices (these are warnings which often result -; from a bug in your code, but it's possible that it was -; intentional (e.g., using an uninitialized variable and -; relying on the fact it is automatically initialized to an -; empty string) -; E_STRICT - run-time notices, enable to have PHP suggest changes -; to your code which will ensure the best interoperability -; and forward compatibility of your code -; E_CORE_ERROR - fatal errors that occur during PHP's initial startup -; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's -; initial startup -; E_COMPILE_ERROR - fatal compile-time errors -; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) -; E_USER_ERROR - user-generated error message -; E_USER_WARNING - user-generated warning message -; E_USER_NOTICE - user-generated notice message -; E_DEPRECATED - warn about code that will not work in future versions -; of PHP -; E_USER_DEPRECATED - user-generated deprecation warnings -; -; Common Values: -; E_ALL (Show all errors, warnings and notices including coding standards.) -; E_ALL & ~E_NOTICE (Show all errors, except for notices) -; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.) -; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors) -; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED -; Development Value: E_ALL -; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT -; http://php.net/error-reporting -error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT - -; This directive controls whether or not and where PHP will output errors, -; notices and warnings too. Error output is very useful during development, but -; it could be very dangerous in production environments. Depending on the code -; which is triggering the error, sensitive information could potentially leak -; out of your application such as database usernames and passwords or worse. -; For production environments, we recommend logging errors rather than -; sending them to STDOUT. -; Possible Values: -; Off = Do not display any errors -; stderr = Display errors to STDERR (affects only CGI/CLI binaries!) -; On or stdout = Display errors to STDOUT -; Default Value: On -; Development Value: On -; Production Value: Off -; http://php.net/display-errors -display_errors = Off - -; The display of errors which occur during PHP's startup sequence are handled -; separately from display_errors. PHP's default behavior is to suppress those -; errors from clients. Turning the display of startup errors on can be useful in -; debugging configuration problems. We strongly recommend you -; set this to 'off' for production servers. -; Default Value: Off -; Development Value: On -; Production Value: Off -; http://php.net/display-startup-errors -display_startup_errors = Off - -; Besides displaying errors, PHP can also log errors to locations such as a -; server-specific log, STDERR, or a location specified by the error_log -; directive found below. While errors should not be displayed on productions -; servers they should still be monitored and logging is a great way to do that. -; Default Value: Off -; Development Value: On -; Production Value: On -; http://php.net/log-errors -log_errors = On - -; Set maximum length of log_errors. In error_log information about the source is -; added. The default is 1024 and 0 allows to not apply any maximum length at all. -; http://php.net/log-errors-max-len -log_errors_max_len = 1024 - -; Do not log repeated messages. Repeated errors must occur in same file on same -; line unless ignore_repeated_source is set true. -; http://php.net/ignore-repeated-errors -ignore_repeated_errors = Off - -; Ignore source of message when ignoring repeated messages. When this setting -; is On you will not log errors with repeated messages from different files or -; source lines. -; http://php.net/ignore-repeated-source -ignore_repeated_source = Off - -; If this parameter is set to Off, then memory leaks will not be shown (on -; stdout or in the log). This has only effect in a debug compile, and if -; error reporting includes E_WARNING in the allowed list -; http://php.net/report-memleaks -report_memleaks = On - -; This setting is on by default. -;report_zend_debug = 0 - -; Store the last error/warning message in $php_errormsg (boolean). Setting this value -; to On can assist in debugging and is appropriate for development servers. It should -; however be disabled on production servers. -; Default Value: Off -; Development Value: On -; Production Value: Off -; http://php.net/track-errors -track_errors = Off - -; Turn off normal error reporting and emit XML-RPC error XML -; http://php.net/xmlrpc-errors -;xmlrpc_errors = 0 - -; An XML-RPC faultCode -;xmlrpc_error_number = 0 - -; When PHP displays or logs an error, it has the capability of formatting the -; error message as HTML for easier reading. This directive controls whether -; the error message is formatted as HTML or not. -; Note: This directive is hardcoded to Off for the CLI SAPI -; Default Value: On -; Development Value: On -; Production value: On -; http://php.net/html-errors -html_errors = On - -; If html_errors is set to On *and* docref_root is not empty, then PHP -; produces clickable error messages that direct to a page describing the error -; or function causing the error in detail. -; You can download a copy of the PHP manual from http://php.net/docs -; and change docref_root to the base URL of your local copy including the -; leading '/'. You must also specify the file extension being used including -; the dot. PHP's default behavior is to leave these settings empty, in which -; case no links to documentation are generated. -; Note: Never use this feature for production boxes. -; http://php.net/docref-root -; Examples -;docref_root = "/phpmanual/" - -; http://php.net/docref-ext -;docref_ext = .html - -; String to output before an error message. PHP's default behavior is to leave -; this setting blank. -; http://php.net/error-prepend-string -; Example: -;error_prepend_string = "" - -; String to output after an error message. PHP's default behavior is to leave -; this setting blank. -; http://php.net/error-append-string -; Example: -;error_append_string = "" - -; Log errors to specified file. PHP's default behavior is to leave this value -; empty. -; http://php.net/error-log -; Example: -;error_log = php_errors.log -; Log errors to syslog (Event Log on Windows). -;error_log = syslog - -;windows.show_crt_warning -; Default value: 0 -; Development value: 0 -; Production value: 0 - -;;;;;;;;;;;;;;;;; -; Data Handling ; -;;;;;;;;;;;;;;;;; - -; The separator used in PHP generated URLs to separate arguments. -; PHP's default setting is "&". -; http://php.net/arg-separator.output -; Example: -;arg_separator.output = "&" - -; List of separator(s) used by PHP to parse input URLs into variables. -; PHP's default setting is "&". -; NOTE: Every character in this directive is considered as separator! -; http://php.net/arg-separator.input -; Example: -;arg_separator.input = ";&" - -; This directive determines which super global arrays are registered when PHP -; starts up. G,P,C,E & S are abbreviations for the following respective super -; globals: GET, POST, COOKIE, ENV and SERVER. There is a performance penalty -; paid for the registration of these arrays and because ENV is not as commonly -; used as the others, ENV is not recommended on productions servers. You -; can still get access to the environment variables through getenv() should you -; need to. -; Default Value: "EGPCS" -; Development Value: "GPCS" -; Production Value: "GPCS"; -; http://php.net/variables-order -variables_order = "GPCS" - -; This directive determines which super global data (G,P & C) should be -; registered into the super global array REQUEST. If so, it also determines -; the order in which that data is registered. The values for this directive -; are specified in the same manner as the variables_order directive, -; EXCEPT one. Leaving this value empty will cause PHP to use the value set -; in the variables_order directive. It does not mean it will leave the super -; globals array REQUEST empty. -; Default Value: None -; Development Value: "GP" -; Production Value: "GP" -; http://php.net/request-order -request_order = "GP" - -; This directive determines whether PHP registers $argv & $argc each time it -; runs. $argv contains an array of all the arguments passed to PHP when a script -; is invoked. $argc contains an integer representing the number of arguments -; that were passed when the script was invoked. These arrays are extremely -; useful when running scripts from the command line. When this directive is -; enabled, registering these variables consumes CPU cycles and memory each time -; a script is executed. For performance reasons, this feature should be disabled -; on production servers. -; Note: This directive is hardcoded to On for the CLI SAPI -; Default Value: On -; Development Value: Off -; Production Value: Off -; http://php.net/register-argc-argv -register_argc_argv = Off - -; When enabled, the ENV, REQUEST and SERVER variables are created when they're -; first used (Just In Time) instead of when the script starts. If these -; variables are not used within a script, having this directive on will result -; in a performance gain. The PHP directive register_argc_argv must be disabled -; for this directive to have any affect. -; http://php.net/auto-globals-jit -auto_globals_jit = On - -; Whether PHP will read the POST data. -; This option is enabled by default. -; Most likely, you won't want to disable this option globally. It causes $_POST -; and $_FILES to always be empty; the only way you will be able to read the -; POST data will be through the php://input stream wrapper. This can be useful -; to proxy requests or to process the POST data in a memory efficient fashion. -; http://php.net/enable-post-data-reading -;enable_post_data_reading = Off - -; Maximum size of POST data that PHP will accept. -; Its value may be 0 to disable the limit. It is ignored if POST data reading -; is disabled through enable_post_data_reading. -; http://php.net/post-max-size -post_max_size = 5120M - -; Automatically add files before PHP document. -; http://php.net/auto-prepend-file -auto_prepend_file = - -; Automatically add files after PHP document. -; http://php.net/auto-append-file -auto_append_file = - -; By default, PHP will output a media type using the Content-Type header. To -; disable this, simply set it to be empty. -; -; PHP's built-in default media type is set to text/html. -; http://php.net/default-mimetype -default_mimetype = "text/html" - -; PHP's default character set is set to UTF-8. -; http://php.net/default-charset -default_charset = "UTF-8" - -; PHP internal character encoding is set to empty. -; If empty, default_charset is used. -; http://php.net/internal-encoding -;internal_encoding = - -; PHP input character encoding is set to empty. -; If empty, default_charset is used. -; http://php.net/input-encoding -;input_encoding = - -; PHP output character encoding is set to empty. -; If empty, default_charset is used. -; See also output_buffer. -; http://php.net/output-encoding -;output_encoding = - -;;;;;;;;;;;;;;;;;;;;;;;;; -; Paths and Directories ; -;;;;;;;;;;;;;;;;;;;;;;;;; - -; UNIX: "/path1:/path2" -;include_path = ".:/php/includes" -; -; Windows: "\path1;\path2" -;include_path = ".;c:\php\includes" -; -; PHP's default setting for include_path is ".;/path/to/php/pear" -; http://php.net/include-path - -; The root of the PHP pages, used only if nonempty. -; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root -; if you are running php as a CGI under any web server (other than IIS) -; see documentation for security issues. The alternate is to use the -; cgi.force_redirect configuration below -; http://php.net/doc-root -doc_root = - -; The directory under which PHP opens the script using /~username used only -; if nonempty. -; http://php.net/user-dir -user_dir = - -; Directory in which the loadable extensions (modules) reside. -; http://php.net/extension-dir -; extension_dir = "./" -; On windows: -; extension_dir = "ext" - -; Directory where the temporary files should be placed. -; Defaults to the system default (see sys_get_temp_dir) -; sys_temp_dir = "/tmp" - -; Whether or not to enable the dl() function. The dl() function does NOT work -; properly in multithreaded servers, such as IIS or Zeus, and is automatically -; disabled on them. -; http://php.net/enable-dl -enable_dl = Off - -; cgi.force_redirect is necessary to provide security running PHP as a CGI under -; most web servers. Left undefined, PHP turns this on by default. You can -; turn it off here AT YOUR OWN RISK -; **You CAN safely turn this off for IIS, in fact, you MUST.** -; http://php.net/cgi.force-redirect -;cgi.force_redirect = 1 - -; if cgi.nph is enabled it will force cgi to always sent Status: 200 with -; every request. PHP's default behavior is to disable this feature. -;cgi.nph = 1 - -; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape -; (iPlanet) web servers, you MAY need to set an environment variable name that PHP -; will look for to know it is OK to continue execution. Setting this variable MAY -; cause security issues, KNOW WHAT YOU ARE DOING FIRST. -; http://php.net/cgi.redirect-status-env -;cgi.redirect_status_env = - -; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's -; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok -; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting -; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting -; of zero causes PHP to behave as before. Default is 1. You should fix your scripts -; to use SCRIPT_FILENAME rather than PATH_TRANSLATED. -; http://php.net/cgi.fix-pathinfo -;cgi.fix_pathinfo=1 - -; if cgi.discard_path is enabled, the PHP CGI binary can safely be placed outside -; of the web tree and people will not be able to circumvent .htaccess security. -; http://php.net/cgi.dicard-path -;cgi.discard_path=1 - -; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate -; security tokens of the calling client. This allows IIS to define the -; security context that the request runs under. mod_fastcgi under Apache -; does not currently support this feature (03/17/2002) -; Set to 1 if running under IIS. Default is zero. -; http://php.net/fastcgi.impersonate -;fastcgi.impersonate = 1 - -; Disable logging through FastCGI connection. PHP's default behavior is to enable -; this feature. -;fastcgi.logging = 0 - -; cgi.rfc2616_headers configuration option tells PHP what type of headers to -; use when sending HTTP response code. If set to 0, PHP sends Status: header that -; is supported by Apache. When this option is set to 1, PHP will send -; RFC2616 compliant header. -; Default is zero. -; http://php.net/cgi.rfc2616-headers -;cgi.rfc2616_headers = 0 - -; cgi.check_shebang_line controls whether CGI PHP checks for line starting with #! -; (shebang) at the top of the running script. This line might be needed if the -; script support running both as stand-alone script and via PHP CGI<. PHP in CGI -; mode skips this line and ignores its content if this directive is turned on. -; http://php.net/cgi.check-shebang-line -;cgi.check_shebang_line=1 - -;;;;;;;;;;;;;;;; -; File Uploads ; -;;;;;;;;;;;;;;;; - -; Whether to allow HTTP file uploads. -; http://php.net/file-uploads -file_uploads = On - -; Temporary directory for HTTP uploaded files (will use system default if not -; specified). -; http://php.net/upload-tmp-dir -;upload_tmp_dir = - -; Maximum allowed size for uploaded files. -; http://php.net/upload-max-filesize -upload_max_filesize = 5120M - -; Maximum number of files that can be uploaded via a single request -max_file_uploads = 40960 - -;;;;;;;;;;;;;;;;;; -; Fopen wrappers ; -;;;;;;;;;;;;;;;;;; - -; Whether to allow the treatment of URLs (like http:// or ftp://) as files. -; http://php.net/allow-url-fopen -allow_url_fopen = On - -; Whether to allow include/require to open URLs (like http:// or ftp://) as files. -; http://php.net/allow-url-include -allow_url_include = Off - -; Define the anonymous ftp password (your email address). PHP's default setting -; for this is empty. -; http://php.net/from -;from="john@doe.com" - -; Define the User-Agent string. PHP's default setting for this is empty. -; http://php.net/user-agent -;user_agent="PHP" - -; Default timeout for socket based streams (seconds) -; http://php.net/default-socket-timeout -default_socket_timeout = 60 - -; If your scripts have to deal with files from Macintosh systems, -; or you are running on a Mac and need to deal with files from -; unix or win32 systems, setting this flag will cause PHP to -; automatically detect the EOL character in those files so that -; fgets() and file() will work regardless of the source of the file. -; http://php.net/auto-detect-line-endings -;auto_detect_line_endings = Off - -;;;;;;;;;;;;;;;;;;;;;; -; Dynamic Extensions ; -;;;;;;;;;;;;;;;;;;;;;; - -; If you wish to have an extension loaded automatically, use the following -; syntax: -; -; extension=modulename.extension -; -; For example, on Windows: -; -; extension=msql.dll -; -; ... or under UNIX: -; -; extension=msql.so -; -; ... or with a path: -; -; extension=/path/to/extension/msql.so -; -; If you only provide the name of the extension, PHP will look for it in its -; default extension directory. -; -; Windows Extensions -; Note that ODBC support is built in, so no dll is needed for it. -; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5+) -; extension folders as well as the separate PECL DLL download (PHP 5+). -; Be sure to appropriately set the extension_dir directive. -; -;extension=php_bz2.dll -;extension=php_curl.dll -;extension=php_fileinfo.dll -;extension=php_ftp.dll -;extension=php_gd2.dll -;extension=php_gettext.dll -;extension=php_gmp.dll -;extension=php_intl.dll -;extension=php_imap.dll -;extension=php_interbase.dll -;extension=php_ldap.dll -;extension=php_mbstring.dll -;extension=php_exif.dll ; Must be after mbstring as it depends on it -;extension=php_mysqli.dll -;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client -;extension=php_openssl.dll -;extension=php_pdo_firebird.dll -;extension=php_pdo_mysql.dll -;extension=php_pdo_oci.dll -;extension=php_pdo_odbc.dll -;extension=php_pdo_pgsql.dll -;extension=php_pdo_sqlite.dll -;extension=php_pgsql.dll -;extension=php_shmop.dll - -; The MIBS data available in the PHP distribution must be installed. -; See http://www.php.net/manual/en/snmp.installation.php -;extension=php_snmp.dll - -;extension=php_soap.dll -;extension=php_sockets.dll -;extension=php_sqlite3.dll -;extension=php_tidy.dll -;extension=php_xmlrpc.dll -;extension=php_xsl.dll - -;;;;;;;;;;;;;;;;;;; -; Module Settings ; -;;;;;;;;;;;;;;;;;;; - -[CLI Server] -; Whether the CLI web server uses ANSI color coding in its terminal output. -cli_server.color = On - -[Date] -; Defines the default timezone used by the date functions -; http://php.net/date.timezone -date.timezone = Asia/Shanghai - -; http://php.net/date.default-latitude -;date.default_latitude = 31.7667 - -; http://php.net/date.default-longitude -;date.default_longitude = 35.2333 - -; http://php.net/date.sunrise-zenith -;date.sunrise_zenith = 90.583333 - -; http://php.net/date.sunset-zenith -;date.sunset_zenith = 90.583333 - -[filter] -; http://php.net/filter.default -;filter.default = unsafe_raw - -; http://php.net/filter.default-flags -;filter.default_flags = - -[iconv] -; Use of this INI entry is deprecated, use global input_encoding instead. -; If empty, default_charset or input_encoding or iconv.input_encoding is used. -; The precedence is: default_charset < intput_encoding < iconv.input_encoding -;iconv.input_encoding = - -; Use of this INI entry is deprecated, use global internal_encoding instead. -; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. -; The precedence is: default_charset < internal_encoding < iconv.internal_encoding -;iconv.internal_encoding = - -; Use of this INI entry is deprecated, use global output_encoding instead. -; If empty, default_charset or output_encoding or iconv.output_encoding is used. -; The precedence is: default_charset < output_encoding < iconv.output_encoding -; To use an output encoding conversion, iconv's output handler must be set -; otherwise output encoding conversion cannot be performed. -;iconv.output_encoding = - -[intl] -;intl.default_locale = -; This directive allows you to produce PHP errors when some error -; happens within intl functions. The value is the level of the error produced. -; Default is 0, which does not produce any errors. -;intl.error_level = E_WARNING -;intl.use_exceptions = 0 - -[sqlite3] -;sqlite3.extension_dir = - -[Pcre] -;PCRE library backtracking limit. -; http://php.net/pcre.backtrack-limit -;pcre.backtrack_limit=100000 - -;PCRE library recursion limit. -;Please note that if you set this value to a high number you may consume all -;the available process stack and eventually crash PHP (due to reaching the -;stack size limit imposed by the Operating System). -; http://php.net/pcre.recursion-limit -;pcre.recursion_limit=100000 - -;Enables or disables JIT compilation of patterns. This requires the PCRE -;library to be compiled with JIT support. -;pcre.jit=1 - -[Pdo] -; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off" -; http://php.net/pdo-odbc.connection-pooling -;pdo_odbc.connection_pooling=strict - -;pdo_odbc.db2_instance_name - -[Pdo_mysql] -; If mysqlnd is used: Number of cache slots for the internal result set cache -; http://php.net/pdo_mysql.cache_size -pdo_mysql.cache_size = 2000 - -; Default socket name for local MySQL connects. If empty, uses the built-in -; MySQL defaults. -; http://php.net/pdo_mysql.default-socket -pdo_mysql.default_socket= - -[Phar] -; http://php.net/phar.readonly -;phar.readonly = On - -; http://php.net/phar.require-hash -;phar.require_hash = On - -;phar.cache_list = - -[mail function] -; For Win32 only. -; http://php.net/smtp -SMTP = localhost -; http://php.net/smtp-port -smtp_port = 25 - -; For Win32 only. -; http://php.net/sendmail-from -;sendmail_from = me@example.com - -; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). -; http://php.net/sendmail-path -;sendmail_path = - -; Force the addition of the specified parameters to be passed as extra parameters -; to the sendmail binary. These parameters will always replace the value of -; the 5th parameter to mail(). -;mail.force_extra_parameters = - -; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename -mail.add_x_header = On - -; The path to a log file that will log all mail() calls. Log entries include -; the full path of the script, line number, To address and headers. -;mail.log = -; Log mail to syslog (Event Log on Windows). -;mail.log = syslog - -[SQL] -; http://php.net/sql.safe-mode -sql.safe_mode = Off - -[ODBC] -; http://php.net/odbc.default-db -;odbc.default_db = Not yet implemented - -; http://php.net/odbc.default-user -;odbc.default_user = Not yet implemented - -; http://php.net/odbc.default-pw -;odbc.default_pw = Not yet implemented - -; Controls the ODBC cursor model. -; Default: SQL_CURSOR_STATIC (default). -;odbc.default_cursortype - -; Allow or prevent persistent links. -; http://php.net/odbc.allow-persistent -odbc.allow_persistent = On - -; Check that a connection is still valid before reuse. -; http://php.net/odbc.check-persistent -odbc.check_persistent = On - -; Maximum number of persistent links. -1 means no limit. -; http://php.net/odbc.max-persistent -odbc.max_persistent = -1 - -; Maximum number of links (persistent + non-persistent). -1 means no limit. -; http://php.net/odbc.max-links -odbc.max_links = -1 - -; Handling of LONG fields. Returns number of bytes to variables. 0 means -; passthru. -; http://php.net/odbc.defaultlrl -odbc.defaultlrl = 4096 - -; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. -; See the documentation on odbc_binmode and odbc_longreadlen for an explanation -; of odbc.defaultlrl and odbc.defaultbinmode -; http://php.net/odbc.defaultbinmode -odbc.defaultbinmode = 1 - -;birdstep.max_links = -1 - -[Interbase] -; Allow or prevent persistent links. -ibase.allow_persistent = 1 - -; Maximum number of persistent links. -1 means no limit. -ibase.max_persistent = -1 - -; Maximum number of links (persistent + non-persistent). -1 means no limit. -ibase.max_links = -1 - -; Default database name for ibase_connect(). -;ibase.default_db = - -; Default username for ibase_connect(). -;ibase.default_user = - -; Default password for ibase_connect(). -;ibase.default_password = - -; Default charset for ibase_connect(). -;ibase.default_charset = - -; Default timestamp format. -ibase.timestampformat = "%Y-%m-%d %H:%M:%S" - -; Default date format. -ibase.dateformat = "%Y-%m-%d" - -; Default time format. -ibase.timeformat = "%H:%M:%S" - -[MySQLi] - -; Maximum number of persistent links. -1 means no limit. -; http://php.net/mysqli.max-persistent -mysqli.max_persistent = -1 - -; Allow accessing, from PHP's perspective, local files with LOAD DATA statements -; http://php.net/mysqli.allow_local_infile -;mysqli.allow_local_infile = On - -; Allow or prevent persistent links. -; http://php.net/mysqli.allow-persistent -mysqli.allow_persistent = On - -; Maximum number of links. -1 means no limit. -; http://php.net/mysqli.max-links -mysqli.max_links = -1 - -; If mysqlnd is used: Number of cache slots for the internal result set cache -; http://php.net/mysqli.cache_size -mysqli.cache_size = 2000 - -; Default port number for mysqli_connect(). If unset, mysqli_connect() will use -; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the -; compile-time value defined MYSQL_PORT (in that order). Win32 will only look -; at MYSQL_PORT. -; http://php.net/mysqli.default-port -mysqli.default_port = 3306 - -; Default socket name for local MySQL connects. If empty, uses the built-in -; MySQL defaults. -; http://php.net/mysqli.default-socket -mysqli.default_socket = - -; Default host for mysql_connect() (doesn't apply in safe mode). -; http://php.net/mysqli.default-host -mysqli.default_host = - -; Default user for mysql_connect() (doesn't apply in safe mode). -; http://php.net/mysqli.default-user -mysqli.default_user = - -; Default password for mysqli_connect() (doesn't apply in safe mode). -; Note that this is generally a *bad* idea to store passwords in this file. -; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw") -; and reveal this password! And of course, any users with read access to this -; file will be able to reveal the password as well. -; http://php.net/mysqli.default-pw -mysqli.default_pw = - -; Allow or prevent reconnect -mysqli.reconnect = Off - -[mysqlnd] -; Enable / Disable collection of general statistics by mysqlnd which can be -; used to tune and monitor MySQL operations. -; http://php.net/mysqlnd.collect_statistics -mysqlnd.collect_statistics = On - -; Enable / Disable collection of memory usage statistics by mysqlnd which can be -; used to tune and monitor MySQL operations. -; http://php.net/mysqlnd.collect_memory_statistics -mysqlnd.collect_memory_statistics = Off - -; Records communication from all extensions using mysqlnd to the specified log -; file. -; http://php.net/mysqlnd.debug -;mysqlnd.debug = - -; Defines which queries will be logged. -; http://php.net/mysqlnd.log_mask -;mysqlnd.log_mask = 0 - -; Default size of the mysqlnd memory pool, which is used by result sets. -; http://php.net/mysqlnd.mempool_default_size -;mysqlnd.mempool_default_size = 16000 - -; Size of a pre-allocated buffer used when sending commands to MySQL in bytes. -; http://php.net/mysqlnd.net_cmd_buffer_size -;mysqlnd.net_cmd_buffer_size = 2048 - -; Size of a pre-allocated buffer used for reading data sent by the server in -; bytes. -; http://php.net/mysqlnd.net_read_buffer_size -;mysqlnd.net_read_buffer_size = 32768 - -; Timeout for network requests in seconds. -; http://php.net/mysqlnd.net_read_timeout -;mysqlnd.net_read_timeout = 31536000 - -; SHA-256 Authentication Plugin related. File with the MySQL server public RSA -; key. -; http://php.net/mysqlnd.sha256_server_public_key -;mysqlnd.sha256_server_public_key = - -[OCI8] - -; Connection: Enables privileged connections using external -; credentials (OCI_SYSOPER, OCI_SYSDBA) -; http://php.net/oci8.privileged-connect -;oci8.privileged_connect = Off - -; Connection: The maximum number of persistent OCI8 connections per -; process. Using -1 means no limit. -; http://php.net/oci8.max-persistent -;oci8.max_persistent = -1 - -; Connection: The maximum number of seconds a process is allowed to -; maintain an idle persistent connection. Using -1 means idle -; persistent connections will be maintained forever. -; http://php.net/oci8.persistent-timeout -;oci8.persistent_timeout = -1 - -; Connection: The number of seconds that must pass before issuing a -; ping during oci_pconnect() to check the connection validity. When -; set to 0, each oci_pconnect() will cause a ping. Using -1 disables -; pings completely. -; http://php.net/oci8.ping-interval -;oci8.ping_interval = 60 - -; Connection: Set this to a user chosen connection class to be used -; for all pooled server requests with Oracle 11g Database Resident -; Connection Pooling (DRCP). To use DRCP, this value should be set to -; the same string for all web servers running the same application, -; the database pool must be configured, and the connection string must -; specify to use a pooled server. -;oci8.connection_class = - -; High Availability: Using On lets PHP receive Fast Application -; Notification (FAN) events generated when a database node fails. The -; database must also be configured to post FAN events. -;oci8.events = Off - -; Tuning: This option enables statement caching, and specifies how -; many statements to cache. Using 0 disables statement caching. -; http://php.net/oci8.statement-cache-size -;oci8.statement_cache_size = 20 - -; Tuning: Enables statement prefetching and sets the default number of -; rows that will be fetched automatically after statement execution. -; http://php.net/oci8.default-prefetch -;oci8.default_prefetch = 100 - -; Compatibility. Using On means oci_close() will not close -; oci_connect() and oci_new_connect() connections. -; http://php.net/oci8.old-oci-close-semantics -;oci8.old_oci_close_semantics = Off - -[PostgreSQL] -; Allow or prevent persistent links. -; http://php.net/pgsql.allow-persistent -pgsql.allow_persistent = On - -; Detect broken persistent links always with pg_pconnect(). -; Auto reset feature requires a little overheads. -; http://php.net/pgsql.auto-reset-persistent -pgsql.auto_reset_persistent = Off - -; Maximum number of persistent links. -1 means no limit. -; http://php.net/pgsql.max-persistent -pgsql.max_persistent = -1 - -; Maximum number of links (persistent+non persistent). -1 means no limit. -; http://php.net/pgsql.max-links -pgsql.max_links = -1 - -; Ignore PostgreSQL backends Notice message or not. -; Notice message logging require a little overheads. -; http://php.net/pgsql.ignore-notice -pgsql.ignore_notice = 0 - -; Log PostgreSQL backends Notice message or not. -; Unless pgsql.ignore_notice=0, module cannot log notice message. -; http://php.net/pgsql.log-notice -pgsql.log_notice = 0 - -[bcmath] -; Number of decimal digits for all bcmath functions. -; http://php.net/bcmath.scale -bcmath.scale = 0 - -[browscap] -; http://php.net/browscap -;browscap = extra/browscap.ini - -[Session] -; Handler used to store/retrieve data. -; http://php.net/session.save-handler -session.save_handler = files - -; Argument passed to save_handler. In the case of files, this is the path -; where data files are stored. Note: Windows users have to change this -; variable in order to use PHP's session functions. -; -; The path can be defined as: -; -; session.save_path = "N;/path" -; -; where N is an integer. Instead of storing all the session files in -; /path, what this will do is use subdirectories N-levels deep, and -; store the session data in those directories. This is useful if -; your OS has problems with many files in one directory, and is -; a more efficient layout for servers that handle many sessions. -; -; NOTE 1: PHP will not create this directory structure automatically. -; You can use the script in the ext/session dir for that purpose. -; NOTE 2: See the section on garbage collection below if you choose to -; use subdirectories for session storage -; -; The file storage module creates files using mode 600 by default. -; You can change that by using -; -; session.save_path = "N;MODE;/path" -; -; where MODE is the octal representation of the mode. Note that this -; does not overwrite the process's umask. -; http://php.net/session.save-path -;session.save_path = "/tmp" - -; Whether to use strict session mode. -; Strict session mode does not accept uninitialized session ID and regenerate -; session ID if browser sends uninitialized session ID. Strict mode protects -; applications from session fixation via session adoption vulnerability. It is -; disabled by default for maximum compatibility, but enabling it is encouraged. -; https://wiki.php.net/rfc/strict_sessions -session.use_strict_mode = 0 - -; Whether to use cookies. -; http://php.net/session.use-cookies -session.use_cookies = 1 - -; http://php.net/session.cookie-secure -;session.cookie_secure = - -; This option forces PHP to fetch and use a cookie for storing and maintaining -; the session id. We encourage this operation as it's very helpful in combating -; session hijacking when not specifying and managing your own session id. It is -; not the be-all and end-all of session hijacking defense, but it's a good start. -; http://php.net/session.use-only-cookies -session.use_only_cookies = 1 - -; Name of the session (used as cookie name). -; http://php.net/session.name -session.name = PHPSESSID - -; Initialize session on request startup. -; http://php.net/session.auto-start -session.auto_start = 0 - -; Lifetime in seconds of cookie or, if 0, until browser is restarted. -; http://php.net/session.cookie-lifetime -session.cookie_lifetime = 0 - -; The path for which the cookie is valid. -; http://php.net/session.cookie-path -session.cookie_path = / - -; The domain for which the cookie is valid. -; http://php.net/session.cookie-domain -session.cookie_domain = - -; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript. -; http://php.net/session.cookie-httponly -session.cookie_httponly = - -; Handler used to serialize data. php is the standard serializer of PHP. -; http://php.net/session.serialize-handler -session.serialize_handler = php - -; Defines the probability that the 'garbage collection' process is started -; on every session initialization. The probability is calculated by using -; gc_probability/gc_divisor. Where session.gc_probability is the numerator -; and gc_divisor is the denominator in the equation. Setting this value to 1 -; when the session.gc_divisor value is 100 will give you approximately a 1% chance -; the gc will run on any give request. -; Default Value: 1 -; Development Value: 1 -; Production Value: 1 -; http://php.net/session.gc-probability -session.gc_probability = 1 - -; Defines the probability that the 'garbage collection' process is started on every -; session initialization. The probability is calculated by using the following equation: -; gc_probability/gc_divisor. Where session.gc_probability is the numerator and -; session.gc_divisor is the denominator in the equation. Setting this value to 1 -; when the session.gc_divisor value is 100 will give you approximately a 1% chance -; the gc will run on any give request. Increasing this value to 1000 will give you -; a 0.1% chance the gc will run on any give request. For high volume production servers, -; this is a more efficient approach. -; Default Value: 100 -; Development Value: 1000 -; Production Value: 1000 -; http://php.net/session.gc-divisor -session.gc_divisor = 1000 - -; After this number of seconds, stored data will be seen as 'garbage' and -; cleaned up by the garbage collection process. -; http://php.net/session.gc-maxlifetime -session.gc_maxlifetime = 1440 - -; NOTE: If you are using the subdirectory option for storing session files -; (see session.save_path above), then garbage collection does *not* -; happen automatically. You will need to do your own garbage -; collection through a shell script, cron entry, or some other method. -; For example, the following script would is the equivalent of -; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): -; find /path/to/sessions -cmin +24 -type f | xargs rm - -; Check HTTP Referer to invalidate externally stored URLs containing ids. -; HTTP_REFERER has to contain this substring for the session to be -; considered as valid. -; http://php.net/session.referer-check -session.referer_check = - -; Set to {nocache,private,public,} to determine HTTP caching aspects -; or leave this empty to avoid sending anti-caching headers. -; http://php.net/session.cache-limiter -session.cache_limiter = nocache - -; Document expires after n minutes. -; http://php.net/session.cache-expire -session.cache_expire = 180 - -; trans sid support is disabled by default. -; Use of trans sid may risk your users' security. -; Use this option with caution. -; - User may send URL contains active session ID -; to other person via. email/irc/etc. -; - URL that contains active session ID may be stored -; in publicly accessible computer. -; - User may access your site with the same session ID -; always using URL stored in browser's history or bookmarks. -; http://php.net/session.use-trans-sid -session.use_trans_sid = 0 - -; Set session ID character length. This value could be between 22 to 256. -; Shorter length than default is supported only for compatibility reason. -; Users should use 32 or more chars. -; http://php.net/session.sid-length -; Default Value: 32 -; Development Value: 26 -; Production Value: 26 -session.sid_length = 26 - -; The URL rewriter will look for URLs in a defined set of HTML tags. -;
is special; if you include them here, the rewriter will -; add a hidden field with the info which is otherwise appended -; to URLs. tag's action attribute URL will not be modified -; unless it is specified. -; Note that all valid entries require a "=", even if no value follows. -; Default Value: "a=href,area=href,frame=src,form=" -; Development Value: "a=href,area=href,frame=src,form=" -; Production Value: "a=href,area=href,frame=src,form=" -; http://php.net/url-rewriter.tags -session.trans_sid_tags = "a=href,area=href,frame=src,form=" - -; URL rewriter does not rewrite absolute URLs by default. -; To enable rewrites for absolute pathes, target hosts must be specified -; at RUNTIME. i.e. use ini_set() -; tags is special. PHP will check action attribute's URL regardless -; of session.trans_sid_tags setting. -; If no host is defined, HTTP_HOST will be used for allowed host. -; Example value: php.net,www.php.net,wiki.php.net -; Use "," for multiple hosts. No spaces are allowed. -; Default Value: "" -; Development Value: "" -; Production Value: "" -;session.trans_sid_hosts="" - -; Define how many bits are stored in each character when converting -; the binary hash data to something readable. -; Possible values: -; 4 (4 bits: 0-9, a-f) -; 5 (5 bits: 0-9, a-v) -; 6 (6 bits: 0-9, a-z, A-Z, "-", ",") -; Default Value: 4 -; Development Value: 5 -; Production Value: 5 -; http://php.net/session.hash-bits-per-character -session.sid_bits_per_character = 5 - -; Enable upload progress tracking in $_SESSION -; Default Value: On -; Development Value: On -; Production Value: On -; http://php.net/session.upload-progress.enabled -;session.upload_progress.enabled = On - -; Cleanup the progress information as soon as all POST data has been read -; (i.e. upload completed). -; Default Value: On -; Development Value: On -; Production Value: On -; http://php.net/session.upload-progress.cleanup -;session.upload_progress.cleanup = On - -; A prefix used for the upload progress key in $_SESSION -; Default Value: "upload_progress_" -; Development Value: "upload_progress_" -; Production Value: "upload_progress_" -; http://php.net/session.upload-progress.prefix -;session.upload_progress.prefix = "upload_progress_" - -; The index name (concatenated with the prefix) in $_SESSION -; containing the upload progress information -; Default Value: "PHP_SESSION_UPLOAD_PROGRESS" -; Development Value: "PHP_SESSION_UPLOAD_PROGRESS" -; Production Value: "PHP_SESSION_UPLOAD_PROGRESS" -; http://php.net/session.upload-progress.name -;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS" - -; How frequently the upload progress should be updated. -; Given either in percentages (per-file), or in bytes -; Default Value: "1%" -; Development Value: "1%" -; Production Value: "1%" -; http://php.net/session.upload-progress.freq -;session.upload_progress.freq = "1%" - -; The minimum delay between updates, in seconds -; Default Value: 1 -; Development Value: 1 -; Production Value: 1 -; http://php.net/session.upload-progress.min-freq -;session.upload_progress.min_freq = "1" - -; Only write session data when session data is changed. Enabled by default. -; http://php.net/session.lazy-write -;session.lazy_write = On - -[Assertion] -; Switch whether to compile assertions at all (to have no overhead at run-time) -; -1: Do not compile at all -; 0: Jump over assertion at run-time -; 1: Execute assertions -; Changing from or to a negative value is only possible in php.ini! (For turning assertions on and off at run-time, see assert.active, when zend.assertions = 1) -; Default Value: 1 -; Development Value: 1 -; Production Value: -1 -; http://php.net/zend.assertions -zend.assertions = -1 - -; Assert(expr); active by default. -; http://php.net/assert.active -;assert.active = On - -; Throw an AssertationException on failed assertions -; http://php.net/assert.exception -;assert.exception = On - -; Issue a PHP warning for each failed assertion. (Overridden by assert.exception if active) -; http://php.net/assert.warning -;assert.warning = On - -; Don't bail out by default. -; http://php.net/assert.bail -;assert.bail = Off - -; User-function to be called if an assertion fails. -; http://php.net/assert.callback -;assert.callback = 0 - -; Eval the expression with current error_reporting(). Set to true if you want -; error_reporting(0) around the eval(). -; http://php.net/assert.quiet-eval -;assert.quiet_eval = 0 - -[COM] -; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs -; http://php.net/com.typelib-file -;com.typelib_file = - -; allow Distributed-COM calls -; http://php.net/com.allow-dcom -;com.allow_dcom = true - -; autoregister constants of a components typlib on com_load() -; http://php.net/com.autoregister-typelib -;com.autoregister_typelib = true - -; register constants casesensitive -; http://php.net/com.autoregister-casesensitive -;com.autoregister_casesensitive = false - -; show warnings on duplicate constant registrations -; http://php.net/com.autoregister-verbose -;com.autoregister_verbose = true - -; The default character set code-page to use when passing strings to and from COM objects. -; Default: system ANSI code page -;com.code_page= - -[mbstring] -; language for internal character representation. -; This affects mb_send_mail() and mbstring.detect_order. -; http://php.net/mbstring.language -;mbstring.language = Japanese - -; Use of this INI entry is deprecated, use global internal_encoding instead. -; internal/script encoding. -; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*) -; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. -; The precedence is: default_charset < internal_encoding < iconv.internal_encoding -;mbstring.internal_encoding = - -; Use of this INI entry is deprecated, use global input_encoding instead. -; http input encoding. -; mbstring.encoding_traslation = On is needed to use this setting. -; If empty, default_charset or input_encoding or mbstring.input is used. -; The precedence is: default_charset < intput_encoding < mbsting.http_input -; http://php.net/mbstring.http-input -;mbstring.http_input = - -; Use of this INI entry is deprecated, use global output_encoding instead. -; http output encoding. -; mb_output_handler must be registered as output buffer to function. -; If empty, default_charset or output_encoding or mbstring.http_output is used. -; The precedence is: default_charset < output_encoding < mbstring.http_output -; To use an output encoding conversion, mbstring's output handler must be set -; otherwise output encoding conversion cannot be performed. -; http://php.net/mbstring.http-output -;mbstring.http_output = - -; enable automatic encoding translation according to -; mbstring.internal_encoding setting. Input chars are -; converted to internal encoding by setting this to On. -; Note: Do _not_ use automatic encoding translation for -; portable libs/applications. -; http://php.net/mbstring.encoding-translation -;mbstring.encoding_translation = Off - -; automatic encoding detection order. -; "auto" detect order is changed according to mbstring.language -; http://php.net/mbstring.detect-order -;mbstring.detect_order = auto - -; substitute_character used when character cannot be converted -; one from another -; http://php.net/mbstring.substitute-character -;mbstring.substitute_character = none - -; overload(replace) single byte functions by mbstring functions. -; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(), -; etc. Possible values are 0,1,2,4 or combination of them. -; For example, 7 for overload everything. -; 0: No overload -; 1: Overload mail() function -; 2: Overload str*() functions -; 4: Overload ereg*() functions -; http://php.net/mbstring.func-overload -;mbstring.func_overload = 0 - -; enable strict encoding detection. -; Default: Off -;mbstring.strict_detection = On - -; This directive specifies the regex pattern of content types for which mb_output_handler() -; is activated. -; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml) -;mbstring.http_output_conv_mimetype= - -[gd] -; Tell the jpeg decode to ignore warnings and try to create -; a gd image. The warning will then be displayed as notices -; disabled by default -; http://php.net/gd.jpeg-ignore-warning -;gd.jpeg_ignore_warning = 1 - -[exif] -; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS. -; With mbstring support this will automatically be converted into the encoding -; given by corresponding encode setting. When empty mbstring.internal_encoding -; is used. For the decode settings you can distinguish between motorola and -; intel byte order. A decode setting cannot be empty. -; http://php.net/exif.encode-unicode -;exif.encode_unicode = ISO-8859-15 - -; http://php.net/exif.decode-unicode-motorola -;exif.decode_unicode_motorola = UCS-2BE - -; http://php.net/exif.decode-unicode-intel -;exif.decode_unicode_intel = UCS-2LE - -; http://php.net/exif.encode-jis -;exif.encode_jis = - -; http://php.net/exif.decode-jis-motorola -;exif.decode_jis_motorola = JIS - -; http://php.net/exif.decode-jis-intel -;exif.decode_jis_intel = JIS - -[Tidy] -; The path to a default tidy configuration file to use when using tidy -; http://php.net/tidy.default-config -;tidy.default_config = /usr/local/lib/php/default.tcfg - -; Should tidy clean and repair output automatically? -; WARNING: Do not use this option if you are generating non-html content -; such as dynamic images -; http://php.net/tidy.clean-output -tidy.clean_output = Off - -[soap] -; Enables or disables WSDL caching feature. -; http://php.net/soap.wsdl-cache-enabled -soap.wsdl_cache_enabled=1 - -; Sets the directory name where SOAP extension will put cache files. -; http://php.net/soap.wsdl-cache-dir -soap.wsdl_cache_dir="/tmp" - -; (time to live) Sets the number of second while cached file will be used -; instead of original one. -; http://php.net/soap.wsdl-cache-ttl -soap.wsdl_cache_ttl=86400 - -; Sets the size of the cache limit. (Max. number of WSDL files to cache) -soap.wsdl_cache_limit = 5 - -[sysvshm] -; A default size of the shared memory segment -;sysvshm.init_mem = 10000 - -[ldap] -; Sets the maximum number of open links or -1 for unlimited. -ldap.max_links = -1 - -[mcrypt] -; For more information about mcrypt settings see http://php.net/mcrypt-module-open - -; Directory where to load mcrypt algorithms -; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt) -;mcrypt.algorithms_dir= - -; Directory where to load mcrypt modes -; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt) -;mcrypt.modes_dir= - -[dba] -;dba.default_handler= - -[opcache] -; Determines if Zend OPCache is enabled -;opcache.enable=1 - -; Determines if Zend OPCache is enabled for the CLI version of PHP -;opcache.enable_cli=0 - -; The OPcache shared memory storage size. -;opcache.memory_consumption=128 - -; The amount of memory for interned strings in Mbytes. -;opcache.interned_strings_buffer=8 - -; The maximum number of keys (scripts) in the OPcache hash table. -; Only numbers between 200 and 1000000 are allowed. -;opcache.max_accelerated_files=10000 - -; The maximum percentage of "wasted" memory until a restart is scheduled. -;opcache.max_wasted_percentage=5 - -; When this directive is enabled, the OPcache appends the current working -; directory to the script key, thus eliminating possible collisions between -; files with the same name (basename). Disabling the directive improves -; performance, but may break existing applications. -;opcache.use_cwd=1 - -; When disabled, you must reset the OPcache manually or restart the -; webserver for changes to the filesystem to take effect. -;opcache.validate_timestamps=1 - -; How often (in seconds) to check file timestamps for changes to the shared -; memory storage allocation. ("1" means validate once per second, but only -; once per request. "0" means always validate) -;opcache.revalidate_freq=2 - -; Enables or disables file search in include_path optimization -;opcache.revalidate_path=0 - -; If disabled, all PHPDoc comments are dropped from the code to reduce the -; size of the optimized code. -;opcache.save_comments=1 - -; If enabled, a fast shutdown sequence is used for the accelerated code -; Depending on the used Memory Manager this may cause some incompatibilities. -;opcache.fast_shutdown=0 - -; Allow file existence override (file_exists, etc.) performance feature. -;opcache.enable_file_override=0 - -; A bitmask, where each bit enables or disables the appropriate OPcache -; passes -;opcache.optimization_level=0xffffffff - -;opcache.inherited_hack=1 -;opcache.dups_fix=0 - -; The location of the OPcache blacklist file (wildcards allowed). -; Each OPcache blacklist file is a text file that holds the names of files -; that should not be accelerated. The file format is to add each filename -; to a new line. The filename may be a full path or just a file prefix -; (i.e., /var/www/x blacklists all the files and directories in /var/www -; that start with 'x'). Line starting with a ; are ignored (comments). -;opcache.blacklist_filename= - -; Allows exclusion of large files from being cached. By default all files -; are cached. -;opcache.max_file_size=0 - -; Check the cache checksum each N requests. -; The default value of "0" means that the checks are disabled. -;opcache.consistency_checks=0 - -; How long to wait (in seconds) for a scheduled restart to begin if the cache -; is not being accessed. -;opcache.force_restart_timeout=180 - -; OPcache error_log file name. Empty string assumes "stderr". -;opcache.error_log= - -; All OPcache errors go to the Web server log. -; By default, only fatal errors (level 0) or errors (level 1) are logged. -; You can also enable warnings (level 2), info messages (level 3) or -; debug messages (level 4). -;opcache.log_verbosity_level=1 - -; Preferred Shared Memory back-end. Leave empty and let the system decide. -;opcache.preferred_memory_model= - -; Protect the shared memory from unexpected writing during script execution. -; Useful for internal debugging only. -;opcache.protect_memory=0 - -; Allows calling OPcache API functions only from PHP scripts which path is -; started from specified string. The default "" means no restriction -;opcache.restrict_api= - -; Mapping base of shared memory segments (for Windows only). All the PHP -; processes have to map shared memory into the same address space. This -; directive allows to manually fix the "Unable to reattach to base address" -; errors. -;opcache.mmap_base= - -; Enables and sets the second level cache directory. -; It should improve performance when SHM memory is full, at server restart or -; SHM reset. The default "" disables file based caching. -;opcache.file_cache= - -; Enables or disables opcode caching in shared memory. -;opcache.file_cache_only=0 - -; Enables or disables checksum validation when script loaded from file cache. -;opcache.file_cache_consistency_checks=1 - -; Implies opcache.file_cache_only=1 for a certain process that failed to -; reattach to the shared memory (for Windows only). Explicitly enabled file -; cache is required. -;opcache.file_cache_fallback=1 - -; Enables or disables copying of PHP code (text segment) into HUGE PAGES. -; This should improve performance, but requires appropriate OS configuration. -;opcache.huge_code_pages=1 - -; Validate cached file permissions. -;opcache.validate_permission=0 - -; Prevent name collisions in chroot'ed environment. -;opcache.validate_root=0 - -[curl] -; A default value for the CURLOPT_CAINFO option. This is required to be an -; absolute path. -;curl.cainfo = - -[openssl] -; The location of a Certificate Authority (CA) file on the local filesystem -; to use when verifying the identity of SSL/TLS peers. Most users should -; not specify a value for this directive as PHP will attempt to use the -; OS-managed cert stores in its absence. If specified, this value may still -; be overridden on a per-stream basis via the "cafile" SSL stream context -; option. -;openssl.cafile= - -; If openssl.cafile is not specified or if the CA file is not found, the -; directory pointed to by openssl.capath is searched for a suitable -; certificate. This value must be a correctly hashed certificate directory. -; Most users should not specify a value for this directive as PHP will -; attempt to use the OS-managed cert stores in its absence. If specified, -; this value may still be overridden on a per-stream basis via the "capath" -; SSL stream context option. -;openssl.capath= - -; Local Variables: -; tab-width: 4 -; End: -zend_extension = ioncube.so \ No newline at end of file diff --git a/images/cmdide/docker-compose.yml b/images/cmdide/docker-compose.yml deleted file mode 100644 index c978bfdb..00000000 --- a/images/cmdide/docker-compose.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: '2' -services: - build: - build: . - - web: - images: ubuntu - links: - - mysql - ports: - - "8000:80" - environment: - DB_HOST: mysql:3306 - DB_PASSWD: root - - mysql: - images: mysql - environment: - - DB_PASSWD=root - expose: #only for container without host - - "3306" - volumes: - - /var/lib/mysql - - cache/:/tmp/cache - - ~/configs:/etc/configs/:ro - dns: - - 8.8.8.8 - - 9.9.9.9 \ No newline at end of file diff --git a/images/cmdide/script/alpine-runenv.sh b/images/cmdide/script/alpine-runenv.sh deleted file mode 100644 index bdcf18bc..00000000 --- a/images/cmdide/script/alpine-runenv.sh +++ /dev/null @@ -1,159 +0,0 @@ -#!/usr/bin/env sh -set -e -description="Cmdide Run env Script" -ngx_cmd="/usr/sbin/nginx" -php_cmd="/usr/sbin/php-fpm7" -ngx_pid=$(ps -a | grep nginx | grep master | awk '{print $1}') -php_pid=$(ps -a | grep php | grep master | awk '{print $1}') - -if [ $(id -u) -ne '0' ]; then - echo " * Require Root User To Execute, Please" - exit 1 -fi - -if [[ ! -z "$2" ]]; then - if [ "$2" != "nginx" ] && [ "$2" != "php" ] ; then - echo "Service $2 not found" - exit - fi -fi - -nginx_status() -{ - if [ ! -z $ngx_pid ]; then - echo "* Status: Nginx is Running " - else - echo "* Status: Nginx Stopped" - fi -} - -nginx_start() -{ - if [[ -f "/sbin/start-stop-daemon" ]]; then - /sbin/start-stop-daemon -x ${ngx_cmd} - echo "* Status: Nginx is Running" - else - exec ${ngx_cmd} - echo "* Status: Nginx is Running" - fi -} - -nginx_stop() -{ - if [ -z $ngx_pid ]; then - echo "* Status: Nginx has Stopped" - else - kill $ngx_pid - echo "* Status: Nginx Stopped Success" - fi -} - -nginx_reload() -{ - if [ -z $ngx_pid ]; then - echo "* Status: Nginx has Stopped, Enable it to reload" - else - nginx -s reload - echo "* Status: Nginx reload Success" - fi -} - -nginx_restart() -{ - if [ -z $ngx_pid ]; then - echo "* Status: Nginx has Stopped, Enable it to reload" - else - kill $ngx_pid - nginx_start - echo "* Status: Nginx restart Success" - fi -} - -php_status() -{ - if [ ! -z $php_pid ]; then - echo "* Status: PHP-FPM is Running " - else - echo "* Status: PHP-FPM Stopped" - fi -} - -php_start() -{ - if [[ -f "/sbin/start-stop-daemon" ]]; then - /sbin/start-stop-daemon -x ${php_cmd} - echo "* Status: Nginx is Running" - else - exec ${php_cmd} - echo "* Status: Nginx is Running" - fi -} - -php_stop() -{ - if [ -z $php_pid ]; then - echo "* Status: Nginx has Stopped" - else - kill $php_pid - echo "* Status: Nginx Stopped Success" - fi -} - -php_reload() -{ - if [ -z $php_pid ]; then - echo "* Status: Nginx has Stopped, Enable it to reload" - else - nginx -s reload - echo "* Status: Nginx reload Success" - fi -} - -php_restart() -{ - if [ -z $php_pid ]; then - echo "* Status: Nginx has Stopped, Enable it to reload" - else - kill $php_pid - nginx_start - echo "* Status: Nginx restart Success" - fi -} - -help() -{ - echo "Usage: [options] status | stop | start | restart | reload - -Options: - -s, status --status set xtrace when running the script - -k, start --start show what would be done - -x, stop --stop only run commands when started - -r, restart --restart only run commands when stopped - -l, reload --reload ignore dependencies - -h, help --help Display this help output -" -} - -case $1 in - status | -s | --status ) - ${2}_status - ;; - start | -k | --start ) - ${2}_start - ;; - stop | -x | --stop ) - ${2}_stop - ;; - restart | -r | --restart ) - ${2}_restart - ;; - reload | -l | --reload ) - ${2}_reload - ;; - help | -h | --help ) - help - ;; - * ) - echo "* $1 Command error - type help or -h to View help" -esac diff --git a/images/cmdide/script/build.sh b/images/cmdide/script/build.sh deleted file mode 100644 index c5e17766..00000000 --- a/images/cmdide/script/build.sh +++ /dev/null @@ -1,151 +0,0 @@ -#!/usr/bin/env bash - -if [[ ${USER} == "" ]]; then - USER="cmdide" -fi - -if [[ ${PASSWD} = "" ]]; then - PASSWD="cmdide" -fi - -build(){ - apt update -y --fix-missing - apt install -y --no-install-recommends openssh-server openssh-sftp-server pwgen supervisor sudo git zsh neovim wget curl unzip whois \ - golang nodejs npm python python3 python-pip python3-pip mariadb-client mongodb-clients redis-server memcached sqlite3 libsqlite3-dev \ - beanstalkd net-tools apt-transport-https make cmake g++ software-properties-common -} - -# Set $USER and root user Password -user(){ - USER=$1 - PASSWD=$2 - useradd -d /home/${USER} -m -s /bin/zsh ${USER} - echo "${USER}:${PASSWD}" | chpasswd - echo "root:${PASSWD}" | chpasswd - echo "${USER} ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers - chmod -R 755 $HOME_DIR - chown -R ${USER}:${USER} $HOME_DIR -} - -# Permision for remote connect Container via ssh -sshd(){ - HOME_DIR=$1 - echo "########## Config sshd #################" - mkdir -p /var/run/sshd - sed -i "s/UsePrivilegeSeparation.*/UsePrivilegeSeparation no/g" /etc/ssh/sshd_config - sed -i "s/UsePAM.*/UsePAM no/g" /etc/ssh/sshd_config - sed -i "s/PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config - ssh-keygen -A - echo "#########Config End###########" - mkdir -p /root/.ssh/ - mkdir -p $HOME_DIR/.ssh/ - touch /root/.ssh/authorized_keys - chmod 600 /root/.ssh/authorized_keys - touch $HOME_DIR/.ssh/authorized_keys - chmod 600 $HOME_DIR/.ssh/authorized_keys -} - -ohmyzsh(){ - HOME_DIR=$1 - echo "Cloning ohmyzsh to $HOME_DIR" - #sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" - git clone --depth=1 https://github.com/robbyrussell/oh-my-zsh.git ${HOME_DIR}/.oh-my-zsh - cp ${HOME_DIR}/.oh-my-zsh/templates/zshrc.zsh-template ${HOME_DIR}/.zshrc -} - -#golang env -golang(){ - echo "Setting Golang Environment" - mkdir -p $HOME_DIR/.go/bin - mkdir -p $HOME_DIR/.go/src - mkdir -p $HOME_DIR/.go/pkg - echo "export GOBIN="$HOME_DIR/.go/bin"" >> $HOME_DIR/.zshrc - echo "export GOPATH="$HOME_DIR/.go/"" >> $HOME_DIR/.zshrc -} - -set_node(){ - echo "Set Node Environment" - # sudo -Hu ${USER} npm config set registry https://registry.npm.taobao.org - echo "registry=https://registry.npm.taobao.org" > ${HOME_DIR}/.npmrc - # echo "Install yarn" - # npm install -g yarn - # npm install -g webpack - # npm install -g bower - # npm install -g gulp-cli - # npm install -g grunt-cli -} - -set_php(){ - USER=$1 - # Set Some PHP CLI Settings - sudo sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.2/cli/php.ini - sudo sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.2/cli/php.ini - sudo sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.2/cli/php.ini - wget https://coding.net/u/imxieke/p/attachment/git/raw/master/pkgs/zray-standalone-php72.tar.gz -O - | sudo tar -xzf - -C /opt - chown -R ${USER}:${USER} /opt/zray - ln -sf /opt/zray/zray.ini /etc/php/7.2/cli/conf.d/zray.ini - ln -sf /opt/zray/zray.ini /etc/php/7.2/fpm/conf.d/zray.ini - ln -sf /opt/zray/lib/zray.so /usr/lib/php/20170718/zray.so - - # Current is 1.6.5 version - wget https://coding.net/u/imxieke/p/attachment/git/raw/master/pkgs/composer.phar -O /bin/composer - chmod +x /bin/composer - sudo -Hu ${USER} composer config -g repo.packagist composer https://packagist.laravel-china.org - - # WordPress Cli - wget https://coding.net/u/imxieke/p/attachment/git/raw/master/pkgs/wp-cli.phar -O /bin/wp-cli - chmod +x /bin/composer - - #Adminer php mysql manager - mkdir -p /var/www/tools - wget https://coding.net/u/imxieke/p/attachment/git/raw/master/code/adminer-4.6.3.php -O /var/www/tools/adminer.php - #vim /etc/nginx/sites-available/homestead.app - #insert new location below location /: - #location /ZendServer { - # try_files $uri $uri/ /ZendServer/index.php?$args; - #} -} - -mailhog(){ - wget --quiet -O /usr/local/bin/mailhog https://coding.net/u/imxieke/p/attachment/git/raw/master/pkgs/MailHog_linux_amd64_V1.0.0 - chmod +x /usr/local/bin/mailhog -} - -webeditor(){ - NAME="kodexplorer" - VER="4.35" - mkdir -p /var/www/ide - cd /var/www/ide - wget https://mirrors.cs.edu.rs/PHP/${NAME}${VER}.zip - unzip ${NAME}${VER}.zip - rm -fr ${NAME}${VER}.zip - chmod 755 -R /var/www - chown www-data:www-data -R /var/www -} - -clean_env(){ - USER=$1 - HOME_DIR=$2 - apt autoremove -y - apt-get clean all - rm -fr /var/lib/apt/lists/* - chown -R ${USER}:${USER} ${HOME_DIR} -} - -install_ext(){ - USER=$1 - PASSWD=$2 - HOME_DIR=$3 - build - user ${USER} ${PASSWD} - sshd ${HOME_DIR} - ohmyzsh ${HOME_DIR} - golang ${HOME_DIR} - set_node ${HOME_DIR} - set_php ${USER} - mailhog - webeditor - clean_env ${USER} ${HOME_DIR} -} - -install_ext ${USER} ${PASSWD} ${HOME_DIR} \ No newline at end of file diff --git a/images/cmdide/script/cmdide.sh b/images/cmdide/script/cmdide.sh deleted file mode 100644 index 145fe9b3..00000000 --- a/images/cmdide/script/cmdide.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/us/bin/env bash -FILE="/tmp/cmdide.status" -DAEMON=/bin/nginx -NAME=cmdide -DESC=cmdide - -function is_root(){ - if [[ `id -u ` != 0 ]]; then - echo \ -"\$:~ $0: Error Tips: - Permission Denied, Please Using Root User or 'sudo' - Current User: `whoami` " -exit - fi -} - -is_root - -case $1 in - status ) - cat ${FILE} - ;; - - start ) - service nginx start - service php7.3-fpm start - service php7.2-fpm start - service php7.1-fpm start - service php7.0-fpm start - echo "Cmdide is Running" > ${FILE} - ;; - - stop ) - service nginx stop - service php7.3-fpm stop - service php7.2-fpm stop - service php7.1-fpm stop - service php7.0-fpm stop - echo "Cmdide is Stop" > ${FILE} - ;; - - reload ) - service nginx reload - service php7.3-fpm reload - service php7.2-fpm reload - service php7.1-fpm reload - service php7.0-fpm reload - echo "Cmdide is Running" > ${FILE} - ;; - - reload ) - service nginx restart - service php7.3-fpm restart - service php7.2-fpm restart - service php7.1-fpm restart - service php7.0-fpm restart - echo "Cmdide is Running" > ${FILE} - ;; - - * ) - echo "Usage: $NAME {start|stop|restart|reload|force-reload|status|configtest|rotate|upgrade}" - ;; -esac \ No newline at end of file diff --git a/images/cmdide/script/laravel-alpine.sh b/images/cmdide/script/laravel-alpine.sh deleted file mode 100644 index 0a8d8eb4..00000000 --- a/images/cmdide/script/laravel-alpine.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env sh - -echo "=> Insatll Depends and tools " -apk add --no-cache shadow sudo neovim git zsh wget curl jq openssl - -echo "=> Insatll Nginx Web Server " -apk add --no-cache nginx nginx-mod-rtmp nginx-mod-http-cache-purge - -echo "=> Insatll PHP Run Environment " -apk add --no-cache php7-fpm php7-openssl \ - php7-mysqli php7-intl php7-openssl php7-dba php7-pear php7-tokenizer \ - php7-gmp php7-pdo_mysql php7-xsl php7-pecl-event php7-embed php7-ftp \ - php7-mysqlnd php7-enchant php7-pspell php7-snmp php7-pcntl \ - php7-fileinfo php7-mbstring php7-dev php7-xmlrpc php7-xmlreader php7-apcu \ - php7-pdo_sqlite php7-exif php7-recode php7-opcache php7-ldap php7-posix \ - php7-session php7-gd php7-gettext php7-mailparse php7-json php7-xml php7-iconv \ - php7-sysvshm php7-curl php7-shmop php7-odbc php7-phar php7-pdo_pgsql php7-imap \ - php7-pdo_dblib php7-pgsql php7-pdo_odbc php7-zip php7-ctype php7-sqlite3 \ - php7-mcrypt php7-bcmath php7-calendar php7-tidy php7-dom php7-sockets php7-zmq \ - php7-memcached php7-soap php7-sysvmsg php7-zlib php7-pdo php7-bz2 \ - php7-simplexml php7-xmlwriter php7-pecl-redis \ - php7-pecl-yaml php7-pecl-mongodb php7-pecl-mcrypt php7-pecl-memcached composer - -# echo "=> Clean Cache And Package" -# rm -fr /var/cache/apk/* - -# Config Nginx -mkdir -p /run/nginx -mkdir -p /var/log/nginx -mkdir -p /var/lib/nginx/logs/ - -# Create Volume Mount Point -mkdir -p /code - -# Create nginx vhost Config directory -mkdir -p /etc/nginx/vhost.d -Remove Default Vhost config -# -rm -fr /etc/nginx/conf.d/default.conf - -touch /run/nginx/nginx.pid -touch /var/lib/nginx/logs/access.log -touch /var/lib/nginx/logs/error.log - -chown -R nginx:nginx /run/nginx -chown -R nginx:nginx /var/log/nginx -chown -R nginx:nginx /var/lib/nginx -echo "=> Create User ${USER} And Change Password" -useradd -d /home/${USER} -m -s /bin/sh ${USER} -echo "${USER}:${PASSWD}" | chpasswd -echo "${USER} ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers -echo '=> Config oh my zsh' -echo "=> Cloning oh my zsh to $HOME" -git clone --depth=1 https://git.dev.tencent.com/imxieke/ohmyzsh.git ${HOME}/.oh-my-zsh -cp ${HOME}/.oh-my-zsh/templates/zshrc.zsh-template ${HOME}/.zshrc -chown -R ${USER}:${USER} ${HOME} -sed -i "s/${USER}:\/bin\/sh/${USER}:\/bin\/zsh/g" /etc/passwd -sed -i "s/robbyrussell/strug/g" ${HOME}/.zshrc - -echo "=> Set Composer Registry" -sudo -Hu ${USER} composer config -g repo.packagist composer https://packagist.laravel-china.org diff --git a/images/cmdide/script/run.sh b/images/cmdide/script/run.sh deleted file mode 100644 index 07c2725e..00000000 --- a/images/cmdide/script/run.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -#RUN_MODE local remote - -if [[ ${USER} == "" ]]; then - USER="cmdide" -fi - -if [[ ${PASSWD} = "" ]]; then - PASSWD="cmdide" -fi - -if [[ ${USER} != "cmdide" ]]; then - useradd -d /home/${USER} -m -s /bin/zsh ${USER} - echo "${USER}:${PASSWD}" | chpasswd - echo "${USER} ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers - chmod -R 755 $HOME_DIR - chown -R ${USER}:${USER} $HOME_DIR -fi - -if [[ ${RUN_MODE} == "" || ${RUN_MODE} == "local" ]]; then - exit 0 -fi - -if [[ ${RUN_MODE} == "remote" ]]; then - echo "======================================================================" - echo "You can now connect to this container via SSH using: " - echo " ssh ${USER}@HOST -p port " - echo "Enter the ${USER} password => '${PASSWD}' when prompted " - echo "Please remember to change the above password as soon as possible! " - echo "======================================================================" - echo " Cmdide is Running " - echo "======================================================================" - exec sudo /usr/sbin/sshd -D -e -fi diff --git a/images/cmdide/script/tomcat-run.sh b/images/cmdide/script/tomcat-run.sh deleted file mode 100644 index a5ced5f6..00000000 --- a/images/cmdide/script/tomcat-run.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -USER="devenv" -PASS="devenv" -useradd -d /home/$USER -m $USER -s /bin/bash -echo "$USER:$PASS" |chpasswd -echo "root:$PASS" | chpasswd -echo "$USER ALL=NOPASSWD: ALL" >>/etc/sudoers -echo "======================================================================" -echo "You can now connect to this container via SSH using: " -echo " ssh $USER@HOST -p port " -echo "Enter the $USER password '$PASS' when prompted " -echo "Please remember to change the above password as soon as possible! " -echo "======================================================================" -echo " Devenv is Running " -echo "======================================================================" - -exec /usr/sbin/sshd -D -e \ No newline at end of file diff --git a/images/debian/Dockerfile b/images/debian/Dockerfile deleted file mode 100644 index 2d490f4e..00000000 --- a/images/debian/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM debian:latest -LABEL MAINTAINER="Cloudflying" \ - MAIL="oss@live.hk" - -ENV DEBIAN_FRONTEND noninteractive \ - PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" - -RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list \ - && sed -i 's/security.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list - -CMD ['/bin/bash'] diff --git a/images/debian/Dockerfile.8.11 b/images/debian/Dockerfile.8.11 deleted file mode 100644 index c795a9b9..00000000 --- a/images/debian/Dockerfile.8.11 +++ /dev/null @@ -1,12 +0,0 @@ -# Debian Jessie (8) -FROM debian:8.11 -LABEL MAINTAINER="Cloudflying" \ - MAIL="oss@live.hk" - -ENV DEBIAN_FRONTEND noninteractive \ - PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" - -RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list \ - && sed -i 's/security.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list - -CMD ['/bin/bash'] diff --git a/images/debian/Dockerfile.9.9 b/images/debian/Dockerfile.9.9 deleted file mode 100644 index cd8a99db..00000000 --- a/images/debian/Dockerfile.9.9 +++ /dev/null @@ -1,12 +0,0 @@ -# Debian Jessie (8) -FROM debian:9.9 -LABEL MAINTAINER="Cloudflying" \ - MAIL="oss@live.hk" - -ENV DEBIAN_FRONTEND noninteractive \ - PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" - -RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \ - && sed -i 's/security.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list - -CMD ['/bin/bash'] diff --git a/images/debian/Dockerfile.buster b/images/debian/Dockerfile.buster deleted file mode 100644 index cbb7f2a6..00000000 --- a/images/debian/Dockerfile.buster +++ /dev/null @@ -1,12 +0,0 @@ -# Debian Buster (10) -FROM debian:buster -LABEL MAINTAINER="Cloudflying" \ - MAIL="oss@live.hk" - -ENV DEBIAN_FRONTEND noninteractive \ - PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" - -RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list \ - && sed -i 's/security.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list - -CMD ['/bin/bash'] diff --git a/images/debian/Dockerfile.dev b/images/debian/Dockerfile.dev deleted file mode 100644 index ec58410a..00000000 --- a/images/debian/Dockerfile.dev +++ /dev/null @@ -1,17 +0,0 @@ -FROM debian:buster -LABEL MAINTAINER=Sky \ - MAIL= - -ENV DEBIAN_FRONTEND noninteractive \ - PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" - -RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list \ - && sed -i 's/deb\ http:\/\/security/#deb\ http:\/\/security/g' /etc/apt/sources.list \ - && apt update \ - && apt upgrade -y \ - && apt install -y gcc git neovim make cmake autoconf automake python python3 python-pip python3-pip \ - && apt autoremove -y \ - && apt-get clean all \ - && rm -fr /var/lib/apt/lists/* - -CMD ['/bin/bash'] diff --git a/images/debian/Dockerfile.jessie b/images/debian/Dockerfile.jessie deleted file mode 100644 index dc731496..00000000 --- a/images/debian/Dockerfile.jessie +++ /dev/null @@ -1,12 +0,0 @@ -# Debian Jessie (8) -FROM debian:jessie -LABEL MAINTAINER="Cloudflying" \ - MAIL="oss@live.hk" - -ENV DEBIAN_FRONTEND noninteractive \ - PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" - -RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list \ - && sed -i 's/security.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list - -CMD ['/bin/bash'] diff --git a/images/debian/Dockerfile.stretch b/images/debian/Dockerfile.stretch deleted file mode 100644 index 6944d30a..00000000 --- a/images/debian/Dockerfile.stretch +++ /dev/null @@ -1,12 +0,0 @@ -# Debian stretch (9) -FROM debian:stretch -LABEL MAINTAINER="Cloudflying" \ - MAIL="oss@live.hk" - -ENV DEBIAN_FRONTEND noninteractive \ - PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" - -RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list \ - && sed -i 's/security.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list - -CMD ['/bin/bash'] diff --git a/images/debian/Dockerfile.wheezy b/images/debian/Dockerfile.wheezy deleted file mode 100644 index 79748253..00000000 --- a/images/debian/Dockerfile.wheezy +++ /dev/null @@ -1,12 +0,0 @@ -# Debian Wheezy (7) -FROM debian:wheezy -LABEL MAINTAINER="Cloudflying" \ - MAIL="oss@live.hk" - -ENV DEBIAN_FRONTEND noninteractive \ - PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" - -RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list \ - && sed -i 's/security.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list - -CMD ['/bin/bash'] diff --git a/images/debian/base/Dockerfile b/images/debian/base/Dockerfile new file mode 100644 index 00000000..12a4c7e9 --- /dev/null +++ b/images/debian/base/Dockerfile @@ -0,0 +1,30 @@ +# Debian Bullseye (11) +FROM ghcr.io/dockenv/debian:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +ENV DEBIAN_FRONTEND=noninteractive \ + PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" + +RUN apt update -y --fix-missing \ + && apt install -y --no-install-recommends \ + bzip2 \ + ca-certificates \ + curl \ + file \ + git \ + zsh \ + procps \ + net-tools \ + procps \ + htop \ + sudo \ + neovim \ + unzip \ + wget \ + xz-utils \ + && apt autoremove -y \ + && apt-get clean -y \ + && apt-get autoclean -y \ + && rm -fr /var/lib/apt/lists/* \ diff --git a/images/debian/bullseye/Dockerfile b/images/debian/bullseye/Dockerfile new file mode 100644 index 00000000..6c5d72ba --- /dev/null +++ b/images/debian/bullseye/Dockerfile @@ -0,0 +1,19 @@ +# Debian Bullseye (11) +FROM debian:bullseye +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +ENV DEBIAN_FRONTEND=noninteractive +ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" +ENV VERSION_CODENAME=bullseye + +RUN . /etc/os-release \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} main" > /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} contrib" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} non-free" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID}-security bullseye-security main" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID}-security bullseye-security contrib" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID}-security bullseye-security non-free" >> /etc/apt/sources.list + +CMD ["/bin/bash"] diff --git a/images/debian/buster/Dockerfile b/images/debian/buster/Dockerfile new file mode 100644 index 00000000..dac4d23c --- /dev/null +++ b/images/debian/buster/Dockerfile @@ -0,0 +1,19 @@ +# Debian Buster (10) +FROM debian:buster +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +ENV DEBIAN_FRONTEND noninteractive +ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" +ENV VERSION_CODENAME=buster + +RUN . /etc/os-release \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} main" > /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} contrib" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} non-free" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID}-security ${VERSION_CODENAME}/updates main" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID}-security ${VERSION_CODENAME}/updates contrib" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID}-security ${VERSION_CODENAME}/updates non-free" >> /etc/apt/sources.list + +CMD ["/bin/bash"] diff --git a/images/debian/jessie/Dockerfile b/images/debian/jessie/Dockerfile new file mode 100644 index 00000000..d2dc64c2 --- /dev/null +++ b/images/debian/jessie/Dockerfile @@ -0,0 +1,19 @@ +# Debian Jessie (8) +FROM debian:jessie +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +ENV DEBIAN_FRONTEND noninteractive +ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" +ENV VERSION_CODENAME=jessie + +RUN . /etc/os-release \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} main" > /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} contrib" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} non-free" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID}-security ${VERSION_CODENAME}/updates main" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID}-security ${VERSION_CODENAME}/updates contrib" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID}-security ${VERSION_CODENAME}/updates non-free" >> /etc/apt/sources.list + +CMD ["/bin/bash"] diff --git a/images/debian/latest/Dockerfile b/images/debian/latest/Dockerfile new file mode 100644 index 00000000..dcaad8a6 --- /dev/null +++ b/images/debian/latest/Dockerfile @@ -0,0 +1,17 @@ +FROM debian:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +ENV DEBIAN_FRONTEND noninteractive +ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" + +RUN . /etc/os-release \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} main" > /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} contrib" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} non-free" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID}-security bullseye-security main" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID}-security bullseye-security contrib" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID}-security bullseye-security non-free" >> /etc/apt/sources.list + +CMD ["/bin/bash"] diff --git a/images/debian/sid/Dockerfile b/images/debian/sid/Dockerfile new file mode 100644 index 00000000..f650ee60 --- /dev/null +++ b/images/debian/sid/Dockerfile @@ -0,0 +1,16 @@ +# Debian Sid +FROM debian:sid +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +ENV DEBIAN_FRONTEND=noninteractive +ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" +ENV VERSION_CODENAME=sid + +RUN . /etc/os-release \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} main" > /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} contrib" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} non-free" >> /etc/apt/sources.list + +CMD ["/bin/bash"] diff --git a/images/debian/stretch/Dockerfile b/images/debian/stretch/Dockerfile new file mode 100644 index 00000000..cc65c8d5 --- /dev/null +++ b/images/debian/stretch/Dockerfile @@ -0,0 +1,18 @@ +# Debian stretch (9) +FROM debian:stretch +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +ENV DEBIAN_FRONTEND=noninteractive +ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" + +RUN . /etc/os-release \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} main" > /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} contrib" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} non-free" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID}-security ${VERSION_CODENAME}/updates main" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID}-security ${VERSION_CODENAME}/updates contrib" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID}-security ${VERSION_CODENAME}/updates non-free" >> /etc/apt/sources.list + +CMD ["/bin/bash"] diff --git a/images/debian/testing/Dockerfile b/images/debian/testing/Dockerfile new file mode 100644 index 00000000..db5efbff --- /dev/null +++ b/images/debian/testing/Dockerfile @@ -0,0 +1,19 @@ +# Debian Testing +FROM debian:testing +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +ENV DEBIAN_FRONTEND=noninteractive +ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" +ENV VERSION_CODENAME=testing + +RUN . /etc/os-release \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} main" > /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} contrib" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} non-free" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID}-security ${VERSION_CODENAME}-security main" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID}-security ${VERSION_CODENAME}-security contrib" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID}-security ${VERSION_CODENAME}-security non-free" >> /etc/apt/sources.list + +CMD ["/bin/bash"] diff --git a/images/debian/wheezy/Dockerfile b/images/debian/wheezy/Dockerfile new file mode 100644 index 00000000..56e2647b --- /dev/null +++ b/images/debian/wheezy/Dockerfile @@ -0,0 +1,16 @@ +# Debian Wheezy (7) +FROM debian:wheezy +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +ENV DEBIAN_FRONTEND=noninteractive +ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" +ENV VERSION_CODENAME=wheezy + +RUN . /etc/os-release \ + && echo "deb http://archive.debian.org/debian-archive/${ID} ${VERSION_CODENAME} main" > /etc/apt/sources.list \ + && echo "deb http://archive.debian.org/debian-archive/${ID} ${VERSION_CODENAME} contrib" >> /etc/apt/sources.list \ + && echo "deb http://archive.debian.org/debian-archive/${ID} ${VERSION_CODENAME} non-free" >> /etc/apt/sources.list + +CMD ["/bin/bash"] diff --git a/images/dotnet/2/Dockerfile b/images/dotnet/2/Dockerfile new file mode 100644 index 00000000..6bfae775 --- /dev/null +++ b/images/dotnet/2/Dockerfile @@ -0,0 +1,17 @@ +FROM ghcr.io/dockenv/ubuntu:20.04 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +RUN apt update -y \ + && apt install -y --no-install-recommends wget ca-certificates openssl \ + && wget --no-check-certificate https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O dotnet.deb \ + && dpkg -i dotnet.deb \ + && rm -fr dotnet.deb \ + && apt update -y \ + && apt install -y --no-install-recommends dotnet-sdk-2.1 \ + && apt purge -y wget \ + && apt autoremove -y \ + && apt-get clean all \ + && rm -fr /var/lib/apt/lists/* diff --git a/images/dotnet/3/Dockerfile b/images/dotnet/3/Dockerfile new file mode 100644 index 00000000..50627019 --- /dev/null +++ b/images/dotnet/3/Dockerfile @@ -0,0 +1,17 @@ +FROM ghcr.io/dockenv/ubuntu:20.04 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +RUN apt update -y \ + && apt install -y --no-install-recommends wget ca-certificates openssl \ + && wget --no-check-certificate https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O dotnet.deb \ + && dpkg -i dotnet.deb \ + && rm -fr dotnet.deb \ + && apt update -y \ + && apt install -y --no-install-recommends dotnet-sdk-3.1 \ + && apt purge -y wget \ + && apt autoremove -y \ + && apt-get clean all \ + && rm -fr /var/lib/apt/lists/* diff --git a/images/dotnet/5/Dockerfile b/images/dotnet/5/Dockerfile new file mode 100644 index 00000000..a4310792 --- /dev/null +++ b/images/dotnet/5/Dockerfile @@ -0,0 +1,17 @@ +FROM ghcr.io/dockenv/ubuntu:20.04 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +RUN apt update -y \ + && apt install -y --no-install-recommends wget ca-certificates openssl \ + && wget --no-check-certificate https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O dotnet.deb \ + && dpkg -i dotnet.deb \ + && rm -fr dotnet.deb \ + && apt update -y \ + && apt install -y --no-install-recommends dotnet-sdk-5.0 \ + && apt purge -y wget \ + && apt autoremove -y \ + && apt-get clean all \ + && rm -fr /var/lib/apt/lists/* diff --git a/images/dotnet/6/Dockerfile b/images/dotnet/6/Dockerfile new file mode 100644 index 00000000..1776d2af --- /dev/null +++ b/images/dotnet/6/Dockerfile @@ -0,0 +1,17 @@ +FROM ghcr.io/dockenv/ubuntu:20.04 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +RUN apt update -y \ + && apt install -y --no-install-recommends wget ca-certificates openssl \ + && wget --no-check-certificate https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O dotnet.deb \ + && dpkg -i dotnet.deb \ + && rm -fr dotnet.deb \ + && apt update -y \ + && apt install -y --no-install-recommends dotnet-sdk-6.0 \ + && apt purge -y wget \ + && apt autoremove -y \ + && apt-get clean all \ + && rm -fr /var/lib/apt/lists/* diff --git a/images/elastic/6/Dockerfile b/images/elastic/6/Dockerfile new file mode 100644 index 00000000..110416d4 --- /dev/null +++ b/images/elastic/6/Dockerfile @@ -0,0 +1,9 @@ +FROM elasticsearch:6.8.23 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +EXPOSE 9200 9300 +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] +CMD ["eswrapper"] diff --git a/images/elastic/7/Dockerfile b/images/elastic/7/Dockerfile new file mode 100644 index 00000000..c5125315 --- /dev/null +++ b/images/elastic/7/Dockerfile @@ -0,0 +1,9 @@ +FROM elasticsearch:7.17.5 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +EXPOSE 9200 9300 +ENTRYPOINT ["/bin/tini", "--", "/usr/local/bin/docker-entrypoint.sh"] +CMD ["eswrapper"] diff --git a/images/elastic/8/Dockerfile b/images/elastic/8/Dockerfile new file mode 100644 index 00000000..52d225de --- /dev/null +++ b/images/elastic/8/Dockerfile @@ -0,0 +1,9 @@ +FROM elasticsearch:8.3.2 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +EXPOSE 9200 9300 +ENTRYPOINT ["/bin/tini", "--", "/usr/local/bin/docker-entrypoint.sh"] +CMD ["eswrapper"] diff --git a/images/elastic/Dockerfile b/images/elastic/Dockerfile deleted file mode 100644 index 7908c2db..00000000 --- a/images/elastic/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -FROM imxieke/java:latest - -LABEL MAINTAINER="Sky" \ - MAIL="Sky@gfw.party" - -ENV ELASTIC_VERSION 5.6.2 - -RUN apk update \ - && apk add --no-cache bash openrc elasticsearch nodejs nodejs-npm \ - && mkdir -p /opt && cd /tmp \ - && wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ELASTIC_VERSION}.tar.gz \ - && wget https://artifacts.elastic.co/downloads/kibana/kibana-${ELASTIC_VERSION}-linux-x86_64.tar.gz \ - && tar -xvf elasticsearch-${ELASTIC_VERSION}.tar.gz -C /opt/ \ - && tar -xvf kibana-${ELASTIC_VERSION}-linux-x86_64.tar.gz -C /opt/ \ - && ln -s /opt/elasticsearch-{ELASTIC_VERSION}/bin/* /bin \ - && ln -s /opt/kibana-${ELASTIC_VERSION}-linux-x86_64/bin/* /bin \ - && rm -fr /var/cache/apk/* \ - && rm -fr *.tar.gz \ - && rm -fr /opt//opt/elasticsearch-{ELASTIC_VERSION}/bin/*.exe \ - && rm -fr /opt//opt/elasticsearch-{ELASTIC_VERSION}/bin/*.bat - -EXPOSE 9200 9300 - -CMD [ "/bin/sh" ] \ No newline at end of file diff --git a/images/elastic/latest/Dockerfile b/images/elastic/latest/Dockerfile new file mode 100644 index 00000000..52d225de --- /dev/null +++ b/images/elastic/latest/Dockerfile @@ -0,0 +1,9 @@ +FROM elasticsearch:8.3.2 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +EXPOSE 9200 9300 +ENTRYPOINT ["/bin/tini", "--", "/usr/local/bin/docker-entrypoint.sh"] +CMD ["eswrapper"] diff --git a/images/fedora/33/Dockerfile b/images/fedora/33/Dockerfile new file mode 100644 index 00000000..2942ce55 --- /dev/null +++ b/images/fedora/33/Dockerfile @@ -0,0 +1,3 @@ +FROM fedora:33 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" diff --git a/images/fedora/34/Dockerfile b/images/fedora/34/Dockerfile new file mode 100644 index 00000000..355a47a8 --- /dev/null +++ b/images/fedora/34/Dockerfile @@ -0,0 +1,3 @@ +FROM fedora:34 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" diff --git a/images/fedora/35/Dockerfile b/images/fedora/35/Dockerfile new file mode 100644 index 00000000..ac390d43 --- /dev/null +++ b/images/fedora/35/Dockerfile @@ -0,0 +1,3 @@ +FROM fedora:35 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" diff --git a/images/fedora/36/Dockerfile b/images/fedora/36/Dockerfile new file mode 100644 index 00000000..5c09b710 --- /dev/null +++ b/images/fedora/36/Dockerfile @@ -0,0 +1,3 @@ +FROM fedora:36 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" diff --git a/images/fedora/latest/Dockerfile b/images/fedora/latest/Dockerfile new file mode 100644 index 00000000..ad3ec923 --- /dev/null +++ b/images/fedora/latest/Dockerfile @@ -0,0 +1,3 @@ +FROM fedora:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="" diff --git a/images/geckodriver/latest/Dockerfile b/images/geckodriver/latest/Dockerfile new file mode 100644 index 00000000..923b5289 --- /dev/null +++ b/images/geckodriver/latest/Dockerfile @@ -0,0 +1,25 @@ +FROM ghcr.io/dockenv/debian:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +RUN apt update -y --fix-missing \ + && apt-get install -y --no-install-recommends --no-install-suggests \ + wget \ + curl \ + ca-certificates \ + && VERSION=$(curl -sX GET "https://api.github.com/repos/mozilla/geckodriver/releases/latest" | awk '/tag_name/{print $4;exit}' FS='[""]') \ + && wget -cq --no-check-certificate "https://github.com/mozilla/geckodriver/releases/download/${VERSION}/geckodriver-${VERSION}-linux64.tar.gz" -O /tmp/geckodriver.tar.gz \ + && tar -xvf /tmp/geckodriver.tar.gz -C /tmp \ + && mv /tmp/geckodriver /usr/bin/geckodriver \ + && chmod +x /usr/bin/geckodriver \ + && rm -fr /tmp/* \ + && apt purge wget curl ca-certificates -y \ + && apt autoremove -y \ + && apt-get clean -y \ + && apt-get autoclean -y \ + && rm -fr /var/lib/apt/lists/* + +EXPOSE 4444 + +CMD /usr/bin/geckodriver --log debug --host 127.0.0.1 --port 4444 diff --git a/images/gentoo/latest/Dockerfile b/images/gentoo/latest/Dockerfile new file mode 100644 index 00000000..e5632d1c --- /dev/null +++ b/images/gentoo/latest/Dockerfile @@ -0,0 +1,5 @@ +FROM gentoo/stage3:latest + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv diff --git a/images/gitea/latest/Dockerfile b/images/gitea/latest/Dockerfile new file mode 100644 index 00000000..e5f71b6e --- /dev/null +++ b/images/gitea/latest/Dockerfile @@ -0,0 +1,11 @@ +FROM gitea/gitea:dev +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +VOLUME ["/data"] + +EXPOSE 22 3000 + +ENTRYPOINT ["/usr/bin/entrypoint"] +CMD ["/bin/s6-svscan", "/etc/s6"] diff --git a/images/go/1.15/Dockerfile b/images/go/1.15/Dockerfile new file mode 100644 index 00000000..688c3ccb --- /dev/null +++ b/images/go/1.15/Dockerfile @@ -0,0 +1,9 @@ +FROM golang:1.15-alpine +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +ENV GOPATH /go +ENV GOBIN ${GOPATH}/bin +ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$GOBIN + +CMD [ "/bin/sh" ] diff --git a/images/go/1.16/Dockerfile b/images/go/1.16/Dockerfile new file mode 100644 index 00000000..5e0573f7 --- /dev/null +++ b/images/go/1.16/Dockerfile @@ -0,0 +1,10 @@ +FROM golang:1.16-alpine + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +ENV GOPATH /go +ENV GOBIN ${GOPATH}/bin +ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$GOBIN + +CMD [ "/bin/sh" ] diff --git a/images/go/1.17/Dockerfile b/images/go/1.17/Dockerfile new file mode 100644 index 00000000..594acff7 --- /dev/null +++ b/images/go/1.17/Dockerfile @@ -0,0 +1,10 @@ +FROM golang:1.17-alpine + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +ENV GOPATH /go +ENV GOBIN ${GOPATH}/bin +ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$GOBIN + +CMD [ "/bin/sh" ] diff --git a/images/go/latest/Dockerfile b/images/go/latest/Dockerfile new file mode 100644 index 00000000..594acff7 --- /dev/null +++ b/images/go/latest/Dockerfile @@ -0,0 +1,10 @@ +FROM golang:1.17-alpine + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +ENV GOPATH /go +ENV GOBIN ${GOPATH}/bin +ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$GOBIN + +CMD [ "/bin/sh" ] diff --git a/images/golang/Dockerfile b/images/golang/Dockerfile deleted file mode 100644 index fc036479..00000000 --- a/images/golang/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM daocloud.io/xiekers/alpine:latest - -LABEL MAINTAINER="Sky" \ - MAIL="Sky@gfw.party" - -ENV GOPATH /go -ENV GOBIN ${GOPATH}/bin -ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$GOBIN - -RUN apk update && \ - apk add --no-cache go && \ - rm -fr /var/cache/apk/* && \ - mkdir -p "$GOPATH/src" "$GOPATH/bin" "${GOPATH}}/pkg" \ - && chmod -R 777 "$GOPATH" \ - && rm -fr /var/cache/apk/* \ - && rm -fr /tmp/* - -WORKDIR $GOPATH -CMD [ "/bin/sh" ] \ No newline at end of file diff --git a/images/haproxy/latest/Dockerfile b/images/haproxy/latest/Dockerfile new file mode 100644 index 00000000..ca6a05e1 --- /dev/null +++ b/images/haproxy/latest/Dockerfile @@ -0,0 +1,6 @@ +FROM haproxy:latest + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +EXPOSE 80 diff --git a/images/hhvm/3/Dockerfile b/images/hhvm/3/Dockerfile new file mode 100644 index 00000000..5f61fbad --- /dev/null +++ b/images/hhvm/3/Dockerfile @@ -0,0 +1,15 @@ +FROM ghcr.io/dockenv/ubuntu:16.04 +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +RUN apt update -y \ + && apt-get install -y --no-install-recommends curl \ + && curl -sL http://dl.hhvm.com/conf/hhvm.gpg.key | apt-key add - \ + && echo "deb http://dl.hhvm.com/ubuntu xenial-lts-3.30 main" > /etc/apt/sources.list.d/hhvm.list \ + && apt-get update -y \ + && apt-get install -y --no-install-recommends hhvm \ + && apt purge -y curl \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +CMD ['/bin/bash'] diff --git a/images/hhvm/4/Dockerfile b/images/hhvm/4/Dockerfile new file mode 100644 index 00000000..cd4fa025 --- /dev/null +++ b/images/hhvm/4/Dockerfile @@ -0,0 +1,15 @@ +FROM ghcr.io/dockenv/ubuntu:20.04 +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +RUN apt update -y \ + && echo "deb http://dl.hhvm.com/ubuntu focal main" > /etc/apt/sources.list.d/hhvm.list \ + && apt-get install -y --no-install-recommends curl gnupg \ + && curl -sL http://dl.hhvm.com/conf/hhvm.gpg.key | apt-key add - \ + && apt-get update -y \ + && apt-get install -y --no-install-recommends hhvm \ + && apt purge -y curl \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +CMD ['/bin/bash'] diff --git a/images/hhvm/latest/Dockerfile b/images/hhvm/latest/Dockerfile new file mode 100644 index 00000000..cd4fa025 --- /dev/null +++ b/images/hhvm/latest/Dockerfile @@ -0,0 +1,15 @@ +FROM ghcr.io/dockenv/ubuntu:20.04 +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +RUN apt update -y \ + && echo "deb http://dl.hhvm.com/ubuntu focal main" > /etc/apt/sources.list.d/hhvm.list \ + && apt-get install -y --no-install-recommends curl gnupg \ + && curl -sL http://dl.hhvm.com/conf/hhvm.gpg.key | apt-key add - \ + && apt-get update -y \ + && apt-get install -y --no-install-recommends hhvm \ + && apt purge -y curl \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +CMD ['/bin/bash'] diff --git a/images/hubot/Dockerfile b/images/hubot/Dockerfile new file mode 100644 index 00000000..f792e360 --- /dev/null +++ b/images/hubot/Dockerfile @@ -0,0 +1,15 @@ +FROM daocloud.io/library/centos:7.2.1511 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +RUN yum install -y epel-release &&\ + rpm -ivh https://kojipkgs.fedoraproject.org/packages/http-parser/2.7.1/3.el7/x86_64/http-parser-2.7.1-3.el7.x86_64.rpm &&\ + yum -y install nodejs openssl &&\ + npm set registry https://registry.npm.taobao.org &&\ + npm set disturl https://npm.taobao.org/dist &&\ + npm cache clean &&\ + yum clean all + +RUN npm install -g yo generator-hubot &&\ + mkdir hubot && cd hubot diff --git a/images/java/Dockerfile b/images/java/Dockerfile deleted file mode 100644 index 34f2e919..00000000 --- a/images/java/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM registry.cn-hongkong.aliyuncs.com/imxieke/alpine:latest - -LABEL MAINTAINER="Sky" \ - MAIL="Sky@gfw.party" - -RUN apk add --no-cache openjdk8-jre - -CMD [ "/bin/sh" ] \ No newline at end of file diff --git a/images/java/Dockerfile.7 b/images/java/Dockerfile.7 deleted file mode 100644 index d38b3f58..00000000 --- a/images/java/Dockerfile.7 +++ /dev/null @@ -1,8 +0,0 @@ -FROM registry.cn-hongkong.aliyuncs.com/imxieke/alpine:latest - -LABEL MAINTAINER="Sky" \ - MAIL="Sky@gfw.party" - -RUN apk add --no-cache openjdk7-jre - -CMD [ "/bin/sh" ] \ No newline at end of file diff --git a/images/java/Dockerfile.8 b/images/java/Dockerfile.8 deleted file mode 100644 index 34f2e919..00000000 --- a/images/java/Dockerfile.8 +++ /dev/null @@ -1,8 +0,0 @@ -FROM registry.cn-hongkong.aliyuncs.com/imxieke/alpine:latest - -LABEL MAINTAINER="Sky" \ - MAIL="Sky@gfw.party" - -RUN apk add --no-cache openjdk8-jre - -CMD [ "/bin/sh" ] \ No newline at end of file diff --git a/images/java/README.md b/images/java/README.md deleted file mode 100644 index 7eb8b1fa..00000000 --- a/images/java/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Java - -> java jre 7 and 8 \ No newline at end of file diff --git a/images/kali/latest/Dockerfile b/images/kali/latest/Dockerfile new file mode 100644 index 00000000..79b135ac --- /dev/null +++ b/images/kali/latest/Dockerfile @@ -0,0 +1,6 @@ +FROM kalilinux/kali-rolling:latest + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +CMD [ "bash" ] diff --git a/images/kibana/6/Dockerfile b/images/kibana/6/Dockerfile new file mode 100644 index 00000000..7418fa07 --- /dev/null +++ b/images/kibana/6/Dockerfile @@ -0,0 +1,8 @@ +FROM kibana:6.8.23 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +EXPOSE 5601 +CMD ["/usr/local/bin/kibana-docker"] diff --git a/images/kibana/7/Dockerfile b/images/kibana/7/Dockerfile new file mode 100644 index 00000000..b21ce72c --- /dev/null +++ b/images/kibana/7/Dockerfile @@ -0,0 +1,8 @@ +FROM kibana:7.17.5 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +EXPOSE 5601 +CMD ["/usr/local/bin/kibana-docker"] diff --git a/images/kibana/8/Dockerfile b/images/kibana/8/Dockerfile new file mode 100644 index 00000000..a667f5d3 --- /dev/null +++ b/images/kibana/8/Dockerfile @@ -0,0 +1,8 @@ +FROM kibana:8.3.2 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +EXPOSE 5601 +CMD ["/usr/local/bin/kibana-docker"] diff --git a/images/kibana/latest/Dockerfile b/images/kibana/latest/Dockerfile new file mode 100644 index 00000000..a667f5d3 --- /dev/null +++ b/images/kibana/latest/Dockerfile @@ -0,0 +1,8 @@ +FROM kibana:8.3.2 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +EXPOSE 5601 +CMD ["/usr/local/bin/kibana-docker"] diff --git a/images/laravel-echo-server/Dockerfile b/images/laravel-echo-server/Dockerfile new file mode 100644 index 00000000..4178e2ef --- /dev/null +++ b/images/laravel-echo-server/Dockerfile @@ -0,0 +1,30 @@ +FROM node:alpine + +# Create app directory +RUN mkdir -p /usr/src/app +WORKDIR /usr/src/app + +# Install app dependencies +COPY package.json /usr/src/app/ + +# If you're in China, or you need to change sources, will be set CHANGE_SOURCE to true in .env. + +ARG CHANGE_SOURCE=false +RUN if [ ${CHANGE_SOURCE} = true ]; then \ + # Change application source from dl-cdn.alpinelinux.org to aliyun source + sed -i 's/dl-cdn.alpinelinux.org/repo.huaweicloud.com/' /etc/apk/repositories \ +;fi + +RUN apk add --update \ + python \ + python-dev \ + py-pip \ + build-base + +RUN npm install + +# Bundle app source +COPY laravel-echo-server.json /usr/src/app/laravel-echo-server.json + +EXPOSE 3000 +CMD [ "npm", "start", "--force" ] diff --git a/images/laravel-echo-server/laravel-echo-server.json b/images/laravel-echo-server/laravel-echo-server.json new file mode 100644 index 00000000..0a98ef90 --- /dev/null +++ b/images/laravel-echo-server/laravel-echo-server.json @@ -0,0 +1,19 @@ +{ + "authHost": "localhost", + "authEndpoint": "/broadcasting/auth", + "clients": [], + "database": "redis", + "databaseConfig": { + "redis": { + "port": "6379", + "host": "redis" + } + }, + "devMode": true, + "host": null, + "port": "6001", + "protocol": "http", + "socketio": {}, + "sslCertPath": "", + "sslKeyPath": "" +} \ No newline at end of file diff --git a/images/laravel-echo-server/package.json b/images/laravel-echo-server/package.json new file mode 100644 index 00000000..4e8d6c1f --- /dev/null +++ b/images/laravel-echo-server/package.json @@ -0,0 +1,12 @@ +{ + "name": "laravel-echo-server-docker", + "description": "Docker container for running laravel-echo-server", + "version": "0.0.1", + "license": "MIT", + "dependencies": { + "laravel-echo-server": "^1.5.0" + }, + "scripts": { + "start": "laravel-echo-server start" + } +} diff --git a/images/laravel-horizon/Dockerfile b/images/laravel-horizon/Dockerfile new file mode 100644 index 00000000..a38b3349 --- /dev/null +++ b/images/laravel-horizon/Dockerfile @@ -0,0 +1,268 @@ +# +#-------------------------------------------------------------------------- +# Image Setup +#-------------------------------------------------------------------------- +# + +ARG LARADOCK_PHP_VERSION +FROM php:${LARADOCK_PHP_VERSION}-alpine + +LABEL maintainer="Mahmoud Zalt " + +ARG LARADOCK_PHP_VERSION + +# If you're in China, or you need to change sources, will be set CHANGE_SOURCE to true in .env. + +ARG CHANGE_SOURCE=false +RUN if [ ${CHANGE_SOURCE} = true ]; then \ + # Change application source from dl-cdn.alpinelinux.org to aliyun source + sed -i 's/dl-cdn.alpinelinux.org/repo.huaweicloud.com/' /etc/apk/repositories \ +;fi + +RUN apk --update add wget \ + curl \ + git \ + build-base \ + libmemcached-dev \ + libmcrypt-dev \ + libxml2-dev \ + zlib-dev \ + autoconf \ + cyrus-sasl-dev \ + libgsasl-dev \ + supervisor \ + oniguruma-dev \ + procps + +RUN docker-php-ext-install mysqli mbstring pdo pdo_mysql tokenizer xml pcntl +RUN pecl channel-update pecl.php.net && pecl install memcached mcrypt-1.0.1 mongodb && docker-php-ext-enable memcached mongodb + +# Add a non-root user to help install ffmpeg: +ARG PUID=1000 +ENV PUID ${PUID} +ARG PGID=1000 +ENV PGID ${PGID} + +RUN addgroup -g ${PGID} laradock && \ + adduser -D -G laradock -u ${PUID} laradock + +#Install BZ2: +ARG INSTALL_BZ2=false +RUN if [ ${INSTALL_BZ2} = true ]; then \ + apk --update add bzip2-dev; \ + docker-php-ext-install bz2 \ +;fi + +#Install GD package: +ARG INSTALL_GD=false +RUN if [ ${INSTALL_GD} = true ]; then \ + apk add --update --no-cache freetype-dev libjpeg-turbo-dev jpeg-dev libpng-dev; \ + docker-php-ext-configure gd --with-freetype-dir=/usr/lib/ --with-jpeg-dir=/usr/lib/ --with-png-dir=/usr/lib/ && \ + docker-php-ext-install gd \ +;fi + +#Install GMP package: +ARG INSTALL_GMP=false +RUN if [ ${INSTALL_GMP} = true ]; then \ + apk add --update --no-cache gmp gmp-dev; \ + docker-php-ext-install gmp \ +;fi + +#Install ImageMagick package: +ARG INSTALL_IMAGEMAGICK=false +RUN set -eux; \ + if [ ${INSTALL_IMAGEMAGICK} = true ]; then \ + apk add --update --no-cache imagemagick-dev; \ + pecl install imagick; \ + docker-php-ext-enable imagick; \ + php -m | grep -q 'imagick'; \ + fi + +#Install BCMath package: +ARG INSTALL_BCMATH=false +RUN if [ ${INSTALL_BCMATH} = true ]; then \ + docker-php-ext-install bcmath \ + ;fi + +#Install Sockets package: +ARG INSTALL_SOCKETS=false +RUN if [ ${INSTALL_SOCKETS} = true ]; then \ + docker-php-ext-install sockets \ + ;fi + +# Install PostgreSQL drivers: +ARG INSTALL_PGSQL=false +RUN if [ ${INSTALL_PGSQL} = true ]; then \ + apk --update add postgresql-dev \ + && docker-php-ext-install pdo_pgsql \ + ;fi + +# Install ZipArchive: +ARG INSTALL_ZIP_ARCHIVE=false +RUN set -eux; \ + if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \ + apk --update add libzip-dev && \ + if [ ${LARADOCK_PHP_VERSION} = "7.3" ] || [ ${LARADOCK_PHP_VERSION} = "7.4" ]; then \ + docker-php-ext-configure zip; \ + else \ + docker-php-ext-configure zip --with-libzip; \ + fi && \ + # Install the zip extension + docker-php-ext-install zip \ +;fi + +# Install PhpRedis package: +ARG INSTALL_PHPREDIS=false +RUN if [ ${INSTALL_PHPREDIS} = true ]; then \ + # Install Php Redis Extension + printf "\n" | pecl install -o -f redis \ + && rm -rf /tmp/pear \ + && docker-php-ext-enable redis \ +;fi + +ARG INSTALL_FFMPEG=false +RUN if [ ${INSTALL_FFMPEG} = true ]; then \ + # Add ffmpeg to horizon + apk add ffmpeg \ +;fi + +# Install BBC Audio Waveform Image Generator: +ARG INSTALL_AUDIOWAVEFORM=false +RUN if [ ${INSTALL_AUDIOWAVEFORM} = true ]; then \ + apk add git make cmake gcc g++ libmad-dev libid3tag-dev libsndfile-dev gd-dev boost-dev libgd libpng-dev zlib-dev \ + && apk add autoconf automake libtool gettext \ + && wget https://github.com/xiph/flac/archive/1.3.3.tar.gz \ + && tar xzf 1.3.3.tar.gz \ + && cd flac-1.3.3 \ + && ./autogen.sh \ + && ./configure --enable-shared=no \ + && make \ + && make install \ + && cd .. \ + && git clone https://github.com/bbc/audiowaveform.git \ + && cd audiowaveform \ + && wget https://github.com/google/googletest/archive/release-1.10.0.tar.gz \ + && tar xzf release-1.10.0.tar.gz \ + && ln -s googletest-release-1.10.0/googletest googletest \ + && ln -s googletest-release-1.10.0/googlemock googlemock \ + && mkdir build \ + && cd build \ + && cmake .. \ + && make \ + && make install \ +;fi + + +# Install Cassandra drivers: +ARG INSTALL_CASSANDRA=false +RUN if [ ${INSTALL_CASSANDRA} = true ]; then \ + apk --update add cassandra-cpp-driver \ + ;fi + +WORKDIR /usr/src +RUN if [ ${INSTALL_CASSANDRA} = true ]; then \ + git clone https://github.com/datastax/php-driver.git \ + && cd php-driver/ext \ + && phpize \ + && mkdir -p /usr/src/php-driver/build \ + && cd /usr/src/php-driver/build \ + && ../ext/configure > /dev/null \ + && make clean >/dev/null \ + && make >/dev/null 2>&1 \ + && make install \ + && docker-php-ext-enable cassandra \ +;fi + +# Install MongoDB drivers: +ARG INSTALL_MONGO=false +RUN if [ ${INSTALL_MONGO} = true ]; then \ + pecl install mongodb \ + && docker-php-ext-enable mongodb \ + ;fi + +########################################################################### +# YAML: extension +########################################################################### + +ARG INSTALL_YAML=false + +RUN if [ ${INSTALL_YAML} = true ]; then \ + apk --update add -U --no-cache --virtual temp yaml-dev \ + && apk add --no-cache yaml \ + && docker-php-source extract \ + && pecl channel-update pecl.php.net \ + && pecl install yaml \ + && docker-php-ext-enable yaml \ + && pecl clear-cache \ + && docker-php-source delete \ + && apk del temp \ +;fi + + +########################################################################### +# PHP Memcached: +########################################################################### + +ARG INSTALL_MEMCACHED=false + +RUN if [ ${INSTALL_MEMCACHED} = true ]; then \ + # Install the php memcached extension + if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ + curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-memcached/archive/2.2.0.tar.gz"; \ + else \ + curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-memcached/archive/v3.1.3.tar.gz"; \ + fi \ + && mkdir -p memcached \ + && tar -C memcached -zxvf /tmp/memcached.tar.gz --strip 1 \ + && ( \ + cd memcached \ + && phpize \ + && ./configure \ + && make -j$(nproc) \ + && make install \ + ) \ + && rm -r memcached \ + && rm /tmp/memcached.tar.gz \ + && docker-php-ext-enable memcached \ + ;fi + +RUN rm /var/cache/apk/* \ + && mkdir -p /var/www + +# +#-------------------------------------------------------------------------- +# Optional Supervisord Configuration +#-------------------------------------------------------------------------- +# +# Modify the ./supervisor.conf file to match your App's requirements. +# Make sure you rebuild your container with every change. +# + +COPY supervisord.conf /etc/supervisord.conf + +ENTRYPOINT ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisord.conf"] + +# +#-------------------------------------------------------------------------- +# Optional Software's Installation +#-------------------------------------------------------------------------- +# +# If you need to modify this image, feel free to do it right here. +# +# -- Your awesome modifications go here -- # + +# +#-------------------------------------------------------------------------- +# Check PHP version +#-------------------------------------------------------------------------- +# + +RUN php -v | head -n 1 | grep -q "PHP ${PHP_VERSION}." + +# +#-------------------------------------------------------------------------- +# Final Touch +#-------------------------------------------------------------------------- +# + +WORKDIR /etc/supervisor/conf.d/ diff --git a/images/laravel-horizon/supervisord.conf b/images/laravel-horizon/supervisord.conf new file mode 100644 index 00000000..203f0148 --- /dev/null +++ b/images/laravel-horizon/supervisord.conf @@ -0,0 +1,10 @@ +[supervisord] +nodaemon=true +[supervisorctl] +[inet_http_server] +port = 127.0.0.1:9001 +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +[include] +files = supervisord.d/*.conf \ No newline at end of file diff --git a/images/laravel-horizon/supervisord.d/.gitignore b/images/laravel-horizon/supervisord.d/.gitignore new file mode 100644 index 00000000..fee92170 --- /dev/null +++ b/images/laravel-horizon/supervisord.d/.gitignore @@ -0,0 +1 @@ +*.conf diff --git a/images/laravel-horizon/supervisord.d/laravel-horizon.conf.example b/images/laravel-horizon/supervisord.d/laravel-horizon.conf.example new file mode 100644 index 00000000..f664320a --- /dev/null +++ b/images/laravel-horizon/supervisord.d/laravel-horizon.conf.example @@ -0,0 +1,7 @@ +[program:laravel-horizon] +process_name=%(program_name)s_%(process_num)02d +user=laradock +command=php /var/www/artisan horizon +autostart=true +autorestart=true +redirect_stderr=true diff --git a/images/logstash/6/Dockerfile b/images/logstash/6/Dockerfile new file mode 100644 index 00000000..1544a599 --- /dev/null +++ b/images/logstash/6/Dockerfile @@ -0,0 +1,8 @@ +FROM logstash:6.8.23 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +EXPOSE 9600 5044 +ENTRYPOINT ["/usr/local/bin/docker-entrypoint"] diff --git a/images/logstash/7/Dockerfile b/images/logstash/7/Dockerfile new file mode 100644 index 00000000..0cd2b8bc --- /dev/null +++ b/images/logstash/7/Dockerfile @@ -0,0 +1,8 @@ +FROM logstash:7.17.5 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +EXPOSE 9600 5044 +ENTRYPOINT ["/usr/local/bin/docker-entrypoint"] diff --git a/images/logstash/8/Dockerfile b/images/logstash/8/Dockerfile new file mode 100644 index 00000000..7837df83 --- /dev/null +++ b/images/logstash/8/Dockerfile @@ -0,0 +1,8 @@ +FROM logstash:8.3.2 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +EXPOSE 9600 5044 +ENTRYPOINT ["/usr/local/bin/docker-entrypoint"] diff --git a/images/logstash/latest/Dockerfile b/images/logstash/latest/Dockerfile new file mode 100644 index 00000000..7837df83 --- /dev/null +++ b/images/logstash/latest/Dockerfile @@ -0,0 +1,8 @@ +FROM logstash:8.3.2 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +EXPOSE 9600 5044 +ENTRYPOINT ["/usr/local/bin/docker-entrypoint"] diff --git a/images/manjaro/latest/Dockerfile b/images/manjaro/latest/Dockerfile new file mode 100644 index 00000000..3ce6e9ed --- /dev/null +++ b/images/manjaro/latest/Dockerfile @@ -0,0 +1,19 @@ +FROM manjarolinux/base:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" \ + LANG='en_US.UTF-8' \ + LANGUAGE='en_US:en' \ + LC_TIME='en_US.UTF-8' \ + LC_PAPER='en_US.UTF-8' \ + LC_MEASUREMENT='en_US.UTF-8' \ + TZ='Asia/Shanghai' + +RUN echo "Server = https://repo.huaweicloud.com/manjaro/stable/\$repo/\$arch" > /etc/pacman.d/mirrorlist \ + && rm -fr /etc/localtime \ + && ln --symbolic "/usr/share/zoneinfo/${TZ}" /etc/localtime \ + && echo "Asia/Shanghai" > /etc/timezone + +CMD /bin/bash diff --git a/images/mariadb/10.2/Dockerfile b/images/mariadb/10.2/Dockerfile new file mode 100644 index 00000000..28aa286d --- /dev/null +++ b/images/mariadb/10.2/Dockerfile @@ -0,0 +1,11 @@ +FROM mariadb:10.2 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv \ + org.opencontainers.image.description='Mariadb 10.2' + +VOLUME /var/lib/mysql +ENTRYPOINT ["docker-entrypoint.sh"] +EXPOSE 3306 +CMD ["mariadbd"] diff --git a/images/mariadb/10.3/Dockerfile b/images/mariadb/10.3/Dockerfile new file mode 100644 index 00000000..659fee37 --- /dev/null +++ b/images/mariadb/10.3/Dockerfile @@ -0,0 +1,11 @@ +FROM mariadb:10.3 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv \ + org.opencontainers.image.description='Mariadb 10.3' + +VOLUME /var/lib/mysql +ENTRYPOINT ["docker-entrypoint.sh"] +EXPOSE 3306 +CMD ["mariadbd"] diff --git a/images/mariadb/10.4/Dockerfile b/images/mariadb/10.4/Dockerfile new file mode 100644 index 00000000..cea81be1 --- /dev/null +++ b/images/mariadb/10.4/Dockerfile @@ -0,0 +1,11 @@ +FROM mariadb:10.4 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv \ + org.opencontainers.image.description='Mariadb 10.4' + +VOLUME /var/lib/mysql +ENTRYPOINT ["docker-entrypoint.sh"] +EXPOSE 3306 +CMD ["mariadbd"] diff --git a/images/mariadb/10.5/Dockerfile b/images/mariadb/10.5/Dockerfile new file mode 100644 index 00000000..7a69d9c1 --- /dev/null +++ b/images/mariadb/10.5/Dockerfile @@ -0,0 +1,11 @@ +FROM mariadb:10.5 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv \ + org.opencontainers.image.description='Mariadb 10.5' + +VOLUME /var/lib/mysql +ENTRYPOINT ["docker-entrypoint.sh"] +EXPOSE 3306 +CMD ["mariadbd"] diff --git a/images/mariadb/10.6/Dockerfile b/images/mariadb/10.6/Dockerfile new file mode 100644 index 00000000..165fa39c --- /dev/null +++ b/images/mariadb/10.6/Dockerfile @@ -0,0 +1,11 @@ +FROM mariadb:10.6 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv \ + org.opencontainers.image.description='Mariadb 10.6' + +VOLUME /var/lib/mysql +ENTRYPOINT ["docker-entrypoint.sh"] +EXPOSE 3306 +CMD ["mariadbd"] diff --git a/images/mariadb/10.7/Dockerfile b/images/mariadb/10.7/Dockerfile new file mode 100644 index 00000000..35737296 --- /dev/null +++ b/images/mariadb/10.7/Dockerfile @@ -0,0 +1,11 @@ +FROM mariadb:10.7 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv \ + org.opencontainers.image.description='Mariadb 10.7' + +VOLUME /var/lib/mysql +ENTRYPOINT ["docker-entrypoint.sh"] +EXPOSE 3306 +CMD ["mariadbd"] diff --git a/images/mariadb/10.8/Dockerfile b/images/mariadb/10.8/Dockerfile new file mode 100644 index 00000000..3b0c39d9 --- /dev/null +++ b/images/mariadb/10.8/Dockerfile @@ -0,0 +1,11 @@ +FROM mariadb:10.8 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv \ + org.opencontainers.image.description='Mariadb 10.7' + +VOLUME /var/lib/mysql +ENTRYPOINT ["docker-entrypoint.sh"] +EXPOSE 3306 +CMD ["mariadbd"] diff --git a/images/mariadb/10.9/Dockerfile b/images/mariadb/10.9/Dockerfile new file mode 100644 index 00000000..df47bb77 --- /dev/null +++ b/images/mariadb/10.9/Dockerfile @@ -0,0 +1,11 @@ +FROM mariadb:10.9-rc + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv \ + org.opencontainers.image.description='Mariadb 10.7' + +VOLUME /var/lib/mysql +ENTRYPOINT ["docker-entrypoint.sh"] +EXPOSE 3306 +CMD ["mariadbd"] diff --git a/images/mariadb/Dockerfile b/images/mariadb/Dockerfile deleted file mode 100644 index e5cbea72..00000000 --- a/images/mariadb/Dockerfile +++ /dev/null @@ -1,55 +0,0 @@ -# vim:set ft=dockerfile: -FROM registry.cn-hongkong.aliyuncs.com/imxieke/ubuntu:bionic - -# for MariaDB 10+ -ENV GPG_KEYS \ - 177F4010FE56CA3336300305F1656F24C74CD1D8 \ - 430BDF5C56E7C94E848EE60C1C4CBDCDCD2EFD2A \ - 4D1BB29D63D98E422B2113B19334A25F8507EFA5 - -# bashbrew-architectures: amd64 arm64v8 ppc64le -ENV MARIADB_MAJOR 10.4 -ENV MARIADB_VERSION 1:10.4.0+maria~bionic -COPY script/startup.sh /bin/entrypoint.sh - -# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added -RUN set -ex \ - && groupadd -r mysql \ - && useradd -r -g mysql mysql \ - && apt-get update \ - && apt-get install -y --no-install-recommends gnupg dirmngr \ - && export GNUPGHOME="$(mktemp -d)"; \ - for key in $GPG_KEYS; do \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ - done; \ - gpg --batch --export $GPG_KEYS > /etc/apt/trusted.gpg.d/mariadb.gpg; \ - command -v gpgconf > /dev/null && gpgconf --kill all || :; \ - rm -r "$GNUPGHOME"; \ - echo "deb http://mirrors.ustc.edu.cn/mariadb/repo/$MARIADB_MAJOR/ubuntu bionic main" > /etc/apt/sources.list.d/mariadb.list \ - && apt-get update \ - && apt-get install -y mariadb-server="$MARIADB_VERSION" \ - # sed -ri 's/^user\s/#&/' /etc/mysql/my.cnf /etc/mysql/conf.d/*; \ - # don't reverse lookup hostnames, they are usually another container - # echo '[mysqld]\nskip-host-cache\nskip-name-resolve' > /etc/mysql/conf.d/docker.cnf \ - && rm -fr /etc/mysql/my.cnf \ - && rm -fr /var/lib/mysql \ - # purge and re-create /var/lib/mysql with appropriate ownership - && mkdir -p /var/lib/mysql \ - && mkdir -p /var/run/mysqld \ - && chown -R mysql:mysql /var/lib/mysql /var/run/mysqld \ - # ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime - && chmod 777 /var/run/mysqld \ - # comment out a few problematic configuration values - && find /etc/mysql/ -name '*.cnf' -print0 | xargs -0 grep -lZE '^(bind-address|log)' | xargs -rt -0 sed -Ei 's/^(bind-address|log)/#&/' \ - && chmod +x /bin/entrypoint.sh \ - # && apt-get purge -y --auto-remove ca-certificates gnupg dirmngr \ - && apt autoremove -y \ - && apt-get clean all \ - && rm -fr /var/lib/apt/lists/* - -COPY conf/my.cnf-10.4 /etc/mysql/my.cnf -VOLUME /var/lib/mysql -ENTRYPOINT ["/bin/entrypoint.sh"] - -EXPOSE 3306 -CMD ["mysqld"] \ No newline at end of file diff --git a/images/mariadb/Dockerfile.10.1 b/images/mariadb/Dockerfile.10.1 deleted file mode 100644 index 486f15e3..00000000 --- a/images/mariadb/Dockerfile.10.1 +++ /dev/null @@ -1,55 +0,0 @@ -# vim:set ft=dockerfile: -FROM registry.cn-hongkong.aliyuncs.com/imxieke/ubuntu:bionic - -# for MariaDB 10+ -ENV GPG_KEYS \ - 177F4010FE56CA3336300305F1656F24C74CD1D8 \ - 430BDF5C56E7C94E848EE60C1C4CBDCDCD2EFD2A \ - 4D1BB29D63D98E422B2113B19334A25F8507EFA5 - -# bashbrew-architectures: amd64 arm64v8 ppc64le -ENV MARIADB_MAJOR 10.1 -ENV MARIADB_VERSION 1:10.1.37+maria-1~bionic -COPY script/startup.sh /bin/entrypoint.sh - -# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added -RUN set -ex \ - && groupadd -r mysql \ - && useradd -r -g mysql mysql \ - && apt-get update \ - && apt-get install -y --no-install-recommends gnupg dirmngr \ - && export GNUPGHOME="$(mktemp -d)"; \ - for key in $GPG_KEYS; do \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ - done; \ - gpg --batch --export $GPG_KEYS > /etc/apt/trusted.gpg.d/mariadb.gpg; \ - command -v gpgconf > /dev/null && gpgconf --kill all || :; \ - rm -r "$GNUPGHOME"; \ - echo "deb http://mirrors.ustc.edu.cn/mariadb/repo/$MARIADB_MAJOR/ubuntu bionic main" > /etc/apt/sources.list.d/mariadb.list \ - && apt-get update \ - && apt-get install -y mariadb-server="$MARIADB_VERSION" \ - # sed -ri 's/^user\s/#&/' /etc/mysql/my.cnf /etc/mysql/conf.d/*; \ - # don't reverse lookup hostnames, they are usually another container - # echo '[mysqld]\nskip-host-cache\nskip-name-resolve' > /etc/mysql/conf.d/docker.cnf \ - && rm -fr /etc/mysql/my.cnf \ - && rm -fr /var/lib/mysql \ - # purge and re-create /var/lib/mysql with appropriate ownership - && mkdir -p /var/lib/mysql \ - && mkdir -p /var/run/mysqld \ - && chown -R mysql:mysql /var/lib/mysql /var/run/mysqld \ - # ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime - && chmod 777 /var/run/mysqld \ - # comment out a few problematic configuration values - && find /etc/mysql/ -name '*.cnf' -print0 | xargs -0 grep -lZE '^(bind-address|log)' | xargs -rt -0 sed -Ei 's/^(bind-address|log)/#&/' \ - && chmod +x /bin/entrypoint.sh \ - # && apt-get purge -y --auto-remove ca-certificates gnupg dirmngr \ - && apt autoremove -y \ - && apt-get clean all \ - && rm -fr /var/lib/apt/lists/* - -COPY conf/my.cnf-10.4 /etc/mysql/my.cnf -VOLUME /var/lib/mysql -ENTRYPOINT ["/bin/entrypoint.sh"] - -EXPOSE 3306 -CMD ["mysqld"] \ No newline at end of file diff --git a/images/mariadb/Dockerfile.10.2 b/images/mariadb/Dockerfile.10.2 deleted file mode 100644 index fc4c73f5..00000000 --- a/images/mariadb/Dockerfile.10.2 +++ /dev/null @@ -1,55 +0,0 @@ -# vim:set ft=dockerfile: -FROM registry.cn-hongkong.aliyuncs.com/imxieke/ubuntu:bionic - -# for MariaDB 10+ -ENV GPG_KEYS \ - 177F4010FE56CA3336300305F1656F24C74CD1D8 \ - 430BDF5C56E7C94E848EE60C1C4CBDCDCD2EFD2A \ - 4D1BB29D63D98E422B2113B19334A25F8507EFA5 - -# bashbrew-architectures: amd64 arm64v8 ppc64le -ENV MARIADB_MAJOR 10.2 -ENV MARIADB_VERSION 1:10.2.19+maria~bionic -COPY script/startup.sh /bin/entrypoint.sh - -# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added -RUN set -ex \ - && groupadd -r mysql \ - && useradd -r -g mysql mysql \ - && apt-get update \ - && apt-get install -y --no-install-recommends gnupg dirmngr \ - && export GNUPGHOME="$(mktemp -d)"; \ - for key in $GPG_KEYS; do \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ - done; \ - gpg --batch --export $GPG_KEYS > /etc/apt/trusted.gpg.d/mariadb.gpg; \ - command -v gpgconf > /dev/null && gpgconf --kill all || :; \ - rm -r "$GNUPGHOME"; \ - echo "deb http://mirrors.ustc.edu.cn/mariadb/repo/$MARIADB_MAJOR/ubuntu bionic main" > /etc/apt/sources.list.d/mariadb.list \ - && apt-get update \ - && apt-get install -y mariadb-server="$MARIADB_VERSION" \ - # sed -ri 's/^user\s/#&/' /etc/mysql/my.cnf /etc/mysql/conf.d/*; \ - # don't reverse lookup hostnames, they are usually another container - # echo '[mysqld]\nskip-host-cache\nskip-name-resolve' > /etc/mysql/conf.d/docker.cnf \ - && rm -fr /etc/mysql/my.cnf \ - && rm -fr /var/lib/mysql \ - # purge and re-create /var/lib/mysql with appropriate ownership - && mkdir -p /var/lib/mysql \ - && mkdir -p /var/run/mysqld \ - && chown -R mysql:mysql /var/lib/mysql /var/run/mysqld \ - # ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime - && chmod 777 /var/run/mysqld \ - # comment out a few problematic configuration values - && find /etc/mysql/ -name '*.cnf' -print0 | xargs -0 grep -lZE '^(bind-address|log)' | xargs -rt -0 sed -Ei 's/^(bind-address|log)/#&/' \ - && chmod +x /bin/entrypoint.sh \ - # && apt-get purge -y --auto-remove ca-certificates gnupg dirmngr \ - && apt autoremove -y \ - && apt-get clean all \ - && rm -fr /var/lib/apt/lists/* - -COPY conf/my.cnf-10.4 /etc/mysql/my.cnf -VOLUME /var/lib/mysql -ENTRYPOINT ["/bin/entrypoint.sh"] - -EXPOSE 3306 -CMD ["mysqld"] \ No newline at end of file diff --git a/images/mariadb/Dockerfile.10.3 b/images/mariadb/Dockerfile.10.3 deleted file mode 100644 index 8753370d..00000000 --- a/images/mariadb/Dockerfile.10.3 +++ /dev/null @@ -1,55 +0,0 @@ -# vim:set ft=dockerfile: -FROM registry.cn-hongkong.aliyuncs.com/imxieke/ubuntu:bionic - -# for MariaDB 10+ -ENV GPG_KEYS \ - 177F4010FE56CA3336300305F1656F24C74CD1D8 \ - 430BDF5C56E7C94E848EE60C1C4CBDCDCD2EFD2A \ - 4D1BB29D63D98E422B2113B19334A25F8507EFA5 - -# bashbrew-architectures: amd64 arm64v8 ppc64le -ENV MARIADB_MAJOR 10.3 -ENV MARIADB_VERSION 1:10.3.11+maria~bionic -COPY script/startup.sh /bin/entrypoint.sh - -# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added -RUN set -ex \ - && groupadd -r mysql \ - && useradd -r -g mysql mysql \ - && apt-get update \ - && apt-get install -y --no-install-recommends gnupg dirmngr \ - && export GNUPGHOME="$(mktemp -d)"; \ - for key in $GPG_KEYS; do \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ - done; \ - gpg --batch --export $GPG_KEYS > /etc/apt/trusted.gpg.d/mariadb.gpg; \ - command -v gpgconf > /dev/null && gpgconf --kill all || :; \ - rm -r "$GNUPGHOME"; \ - echo "deb http://mirrors.ustc.edu.cn/mariadb/repo/$MARIADB_MAJOR/ubuntu bionic main" > /etc/apt/sources.list.d/mariadb.list \ - && apt-get update \ - && apt-get install -y mariadb-server="$MARIADB_VERSION" \ - # sed -ri 's/^user\s/#&/' /etc/mysql/my.cnf /etc/mysql/conf.d/*; \ - # don't reverse lookup hostnames, they are usually another container - # echo '[mysqld]\nskip-host-cache\nskip-name-resolve' > /etc/mysql/conf.d/docker.cnf \ - && rm -fr /etc/mysql/my.cnf \ - && rm -fr /var/lib/mysql \ - # purge and re-create /var/lib/mysql with appropriate ownership - && mkdir -p /var/lib/mysql \ - && mkdir -p /var/run/mysqld \ - && chown -R mysql:mysql /var/lib/mysql /var/run/mysqld \ - # ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime - && chmod 777 /var/run/mysqld \ - # comment out a few problematic configuration values - && find /etc/mysql/ -name '*.cnf' -print0 | xargs -0 grep -lZE '^(bind-address|log)' | xargs -rt -0 sed -Ei 's/^(bind-address|log)/#&/' \ - && chmod +x /bin/entrypoint.sh \ - # && apt-get purge -y --auto-remove ca-certificates gnupg dirmngr \ - && apt autoremove -y \ - && apt-get clean all \ - && rm -fr /var/lib/apt/lists/* - -COPY conf/my.cnf-10.4 /etc/mysql/my.cnf -VOLUME /var/lib/mysql -ENTRYPOINT ["/bin/entrypoint.sh"] - -EXPOSE 3306 -CMD ["mysqld"] \ No newline at end of file diff --git a/images/mariadb/Dockerfile.10.4 b/images/mariadb/Dockerfile.10.4 deleted file mode 100644 index e5cbea72..00000000 --- a/images/mariadb/Dockerfile.10.4 +++ /dev/null @@ -1,55 +0,0 @@ -# vim:set ft=dockerfile: -FROM registry.cn-hongkong.aliyuncs.com/imxieke/ubuntu:bionic - -# for MariaDB 10+ -ENV GPG_KEYS \ - 177F4010FE56CA3336300305F1656F24C74CD1D8 \ - 430BDF5C56E7C94E848EE60C1C4CBDCDCD2EFD2A \ - 4D1BB29D63D98E422B2113B19334A25F8507EFA5 - -# bashbrew-architectures: amd64 arm64v8 ppc64le -ENV MARIADB_MAJOR 10.4 -ENV MARIADB_VERSION 1:10.4.0+maria~bionic -COPY script/startup.sh /bin/entrypoint.sh - -# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added -RUN set -ex \ - && groupadd -r mysql \ - && useradd -r -g mysql mysql \ - && apt-get update \ - && apt-get install -y --no-install-recommends gnupg dirmngr \ - && export GNUPGHOME="$(mktemp -d)"; \ - for key in $GPG_KEYS; do \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ - done; \ - gpg --batch --export $GPG_KEYS > /etc/apt/trusted.gpg.d/mariadb.gpg; \ - command -v gpgconf > /dev/null && gpgconf --kill all || :; \ - rm -r "$GNUPGHOME"; \ - echo "deb http://mirrors.ustc.edu.cn/mariadb/repo/$MARIADB_MAJOR/ubuntu bionic main" > /etc/apt/sources.list.d/mariadb.list \ - && apt-get update \ - && apt-get install -y mariadb-server="$MARIADB_VERSION" \ - # sed -ri 's/^user\s/#&/' /etc/mysql/my.cnf /etc/mysql/conf.d/*; \ - # don't reverse lookup hostnames, they are usually another container - # echo '[mysqld]\nskip-host-cache\nskip-name-resolve' > /etc/mysql/conf.d/docker.cnf \ - && rm -fr /etc/mysql/my.cnf \ - && rm -fr /var/lib/mysql \ - # purge and re-create /var/lib/mysql with appropriate ownership - && mkdir -p /var/lib/mysql \ - && mkdir -p /var/run/mysqld \ - && chown -R mysql:mysql /var/lib/mysql /var/run/mysqld \ - # ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime - && chmod 777 /var/run/mysqld \ - # comment out a few problematic configuration values - && find /etc/mysql/ -name '*.cnf' -print0 | xargs -0 grep -lZE '^(bind-address|log)' | xargs -rt -0 sed -Ei 's/^(bind-address|log)/#&/' \ - && chmod +x /bin/entrypoint.sh \ - # && apt-get purge -y --auto-remove ca-certificates gnupg dirmngr \ - && apt autoremove -y \ - && apt-get clean all \ - && rm -fr /var/lib/apt/lists/* - -COPY conf/my.cnf-10.4 /etc/mysql/my.cnf -VOLUME /var/lib/mysql -ENTRYPOINT ["/bin/entrypoint.sh"] - -EXPOSE 3306 -CMD ["mysqld"] \ No newline at end of file diff --git a/images/mariadb/conf/my.cnf-10.4 b/images/mariadb/conf/my.cnf-10.4 deleted file mode 100644 index 4157bb07..00000000 --- a/images/mariadb/conf/my.cnf-10.4 +++ /dev/null @@ -1,191 +0,0 @@ -# MariaDB database server configuration file. -# -# You can copy this file to one of: -# - "/etc/mysql/my.cnf" to set global options, -# - "~/.my.cnf" to set user-specific options. -# -# One can use all long options that the program supports. -# Run program with --help to get a list of available options and with -# --print-defaults to see which it would actually understand and use. -# -# For explanations see -# http://dev.mysql.com/doc/mysql/en/server-system-variables.html - -# This will be passed to all mysql clients -# It has been reported that passwords should be enclosed with ticks/quotes -# escpecially if they contain "#" chars... -# Remember to edit /etc/mysql/debian.cnf when changing the socket location. -[client] -port = 3306 -socket = /var/run/mysqld/mysqld.sock -default-character-set = utf8mb4 -# character-set-client = utf8mb4 -# Here is entries for some specific programs -# The following values assume you have at least 32M ram - -# This was formally known as [safe_mysqld]. Both versions are currently parsed. -[mysqld_safe] -socket = /var/run/mysqld/mysqld.sock -nice = 0 - -[mysqld] -user = mysql -pid-file = /var/run/mysqld/mysqld.pid -socket = /var/run/mysqld/mysqld.sock -port = 3306 -basedir = /usr -datadir = /var/lib/mysql -tmpdir = /tmp -lc_messages_dir = /usr/share/mysql -lc_messages = en_US -character-set-server = utf8mb4 -skip-external-locking -# Instead of skip-networking the default is now to listen only on -# localhost which is more compatible and is not less secure. -#bind-address = 127.0.0.1 -# * Fine Tuning -max_connections = 240 -connect_timeout = 5 -wait_timeout = 60 -max_allowed_packet = 1024M -thread_cache_size = 128 -sort_buffer_size = 32M -bulk_insert_buffer_size = 16M -tmp_table_size = 32M -max_heap_table_size = 32M - -# * MyISAM -# This replaces the startup script and checks MyISAM tables if needed -# the first time they are touched. On error, make copy and try a repair. -myisam_recover_options = BACKUP -myisam_sort_buffer_size = 512M -key_buffer_size = 128M -open_files_limit = 2000 -table_open_cache = 400 -concurrent_insert = 2 -read_buffer_size = 16M -read_rnd_buffer_size = 1M -# -# * Query Cache Configuration -# -# Cache only tiny result sets, so we can fit more in the query cache. -query_cache_limit = 128K -query_cache_size = 64M -# for more write intensive setups, set to DEMAND or OFF -#query_cache_type = DEMAND -# -# * Logging and Replication -# -# Both location gets rotated by the cronjob. -# Be aware that this log type is a performance killer. -# As of 5.1 you can enable the log at runtime! -#general_log_file = /var/log/mysql/mysql.log -#general_log = 1 -# -# Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf. -# -# we do want to know about network errors and such -#log_warnings = 2 -# -# Enable the slow query log to see queries with especially long duration -#slow_query_log[={0|1}] -slow_query_log_file = /var/log/mysql/mariadb-slow.log -long_query_time = 10 -#log_slow_rate_limit = 1000 -#log_slow_verbosity = query_plan - -#log-queries-not-using-indexes -#log_slow_admin_statements -# -# The following can be used as easy to replay backup logs or for replication. -# note: if you are setting up a replication slave, see README.Debian about -# other settings you may need to change. -#server-id = 1 -#report_host = master1 -#auto_increment_increment = 2 -#auto_increment_offset = 1 -#log_bin = /var/log/mysql/mariadb-bin -#log_bin_index = /var/log/mysql/mariadb-bin.index -# not fab for performance, but safer -#sync_binlog = 1 -expire_logs_days = 10 -max_binlog_size = 100M -# slaves -#relay_log = /var/log/mysql/relay-bin -#relay_log_index = /var/log/mysql/relay-bin.index -#relay_log_info_file = /var/log/mysql/relay-bin.info -#log_slave_updates -#read_only -# -# If applications support it, this stricter sql_mode prevents some -# mistakes like inserting invalid dates etc. -#sql_mode = NO_ENGINE_SUBSTITUTION,TRADITIONAL -# -# * InnoDB -# -# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. -# Read the manual for more InnoDB related options. There are many! -default_storage_engine = InnoDB -# you can't just change log file size, requires special procedure -innodb_log_file_size = 50M -innodb_log_buffer_size = 8M -innodb_buffer_pool_size = 256M -innodb_file_per_table = 1 -innodb_open_files = 400 -innodb_io_capacity = 400 -innodb_flush_method = O_DIRECT -innodb_read_io_threads = 4 -innodb_write_io_threads = 4 -# innodb_flush_log_at_trx_commit = 1 -# innodb_lock_wait_timeout = 120 -# innodb_max_dirty_pages_pct = 90 - - -# -# * Security Features -# -# Read the manual, too, if you want chroot! -# chroot = /var/lib/mysql/ -# -# For generating SSL certificates I recommend the OpenSSL GUI "tinyca". -# -# ssl-ca=/etc/mysql/cacert.pem -# ssl-cert=/etc/mysql/server-cert.pem -# ssl-key=/etc/mysql/server-key.pem - -# -# * Galera-related settings -# -[galera] -# Mandatory settings -#wsrep_on=ON -#wsrep_provider= -#wsrep_cluster_address= -#binlog_format=row -#default_storage_engine=InnoDB -#innodb_autoinc_lock_mode=2 -# -# Allow server to accept connections on all interfaces. -# -#bind-address=0.0.0.0 -# -# Optional setting -#wsrep_slave_threads=1 - -[mysqldump] -quick -quote-names -max_allowed_packet = 1024M - -[mysql] -#no-auto-rehash # faster start of mysql but no tab completion - -[isamchk] -key_buffer = 16M - -# -# * IMPORTANT: Additional settings that can override those from this file! -# The files must end with '.cnf', otherwise they'll be ignored. -# -!include /etc/mysql/mariadb.cnf -!includedir /etc/mysql/conf.d/ \ No newline at end of file diff --git a/images/mariadb/docker-compose.yml b/images/mariadb/docker-compose.yml deleted file mode 100644 index 51538b26..00000000 --- a/images/mariadb/docker-compose.yml +++ /dev/null @@ -1,14 +0,0 @@ -version: '2' -services: - database: - image: mariadb:10.3.8 - ports: - - "3306:3306" - expose: - - "3306" - environment: - - MYSQL_ROOT_PASSWORD=19960318 - # - MYSQL_DATABASE=web - # - MYSQL_USER=root - volumes: - - /Volumes/MacData/Code/Devenv/Volumes/mariadb:/var/lib/mysql \ No newline at end of file diff --git a/images/mariadb/latest/Dockerfile b/images/mariadb/latest/Dockerfile new file mode 100644 index 00000000..ec90b34a --- /dev/null +++ b/images/mariadb/latest/Dockerfile @@ -0,0 +1,11 @@ +FROM mariadb:latest + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv \ + org.opencontainers.image.description='Mariadb 10.7' + +VOLUME /var/lib/mysql +ENTRYPOINT ["docker-entrypoint.sh"] +EXPOSE 3306 +CMD ["mariadbd"] diff --git a/images/mariadb/script/startup.sh b/images/mariadb/script/startup.sh deleted file mode 100644 index 92ffa6a6..00000000 --- a/images/mariadb/script/startup.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env bash - -if [[ -z ${MYSQL_ROOT_PASSWORD} ]]; then - MYSQL_ROOT_PASSWORD="root" -fi -# ch_sql_passwd -gen_chpasswd_sql() -{ - touch /tmp/chpasswd.sql - cat > /tmp/chpasswd.sql <Initializing database" - mysql_install_db --user=mysql --basedir=/usr/ --datadir=/var/lib/mysql/ --rpm - echo "=>Database initialized" - - echo "=>Set MYSQL Database Permission" - chown -R mysql:mysql /var/lib/mysql - chmod -R 755 /var/lib/mysql - - # echo "=>Start Mariadb Safe Mode" - # mysqld_safe --skip-grant-tables & - - echo "=>Start mysql service" - /etc/init.d/mysql start - - echo "Change MYSQL Password for root" - cat /tmp/chpasswd.sql | mysql -uroot mysql - # /usr/bin/mysqladmin -u root password "${MYSQL_ROOT_PASSWORD}" - # echo "=>Excute SQL" - # mysql -uroot mysql < /tmp/chpasswd.sql - # echo "=>MYSQL root Password ${MYSQL_ROOT_PASSWORD}" - - # service mysql stop - # echo "=>Stop mysql service" - # /etc/init.d/mysql stop > /dev/null - echo " - => MYSQL root Password ${MYSQL_ROOT_PASSWORD} - " > /tmp/db.log -} - -if [[ ! -d '/var/lib/mysql/mysql' ]]; then - gen_chpasswd_sql - do_chpasswd -else - echo "=> Database Data Exist, Can't Set New Password" -fi - -tail -f /tmp/db.log \ No newline at end of file diff --git a/images/megaia/7/Dockerfile b/images/megaia/7/Dockerfile new file mode 100644 index 00000000..0c1bfb5d --- /dev/null +++ b/images/megaia/7/Dockerfile @@ -0,0 +1,5 @@ +FROM mageia:7 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +CMD [ "/bash" ] diff --git a/images/megaia/8/Dockerfile b/images/megaia/8/Dockerfile new file mode 100644 index 00000000..7e18c845 --- /dev/null +++ b/images/megaia/8/Dockerfile @@ -0,0 +1,5 @@ +FROM mageia:8 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +CMD [ "/bash" ] diff --git a/images/megaia/latest/Dockerfile b/images/megaia/latest/Dockerfile new file mode 100644 index 00000000..d5da1718 --- /dev/null +++ b/images/megaia/latest/Dockerfile @@ -0,0 +1,5 @@ +FROM mageia:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +CMD [ "/bash" ] diff --git a/images/memcached/Dockerfile b/images/memcached/Dockerfile deleted file mode 100644 index 4683ab15..00000000 --- a/images/memcached/Dockerfile +++ /dev/null @@ -1,57 +0,0 @@ -FROM registry.cn-hongkong.aliyuncs.com/imxieke/alpine:latest -LABEL MAINTAINER="Cloudflying" \ - MAIL="" - -ENV MEMCACHED_VERSION 1.5.12 -ENV MEMCACHED_SHA1 f67096ba64b0c47668bcad5b680010c4f8987d4c - -# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added -RUN set -x ; \ - addgroup -g 11211 memcache && adduser -D -u 11211 -G memcache memcache ; \ - apk add --no-cache --virtual .build-deps \ - ca-certificates \ - coreutils \ - cyrus-sasl-dev \ - dpkg-dev dpkg \ - gcc \ - libc-dev \ - libevent-dev \ - libressl \ - linux-headers \ - make \ - perl \ - perl-utils \ - tar \ - wget \ - \ - && wget -O memcached.tar.gz "https://qcloud.coding.net/u/imxieke/p/Collect/git/blob/master/src/memcached-$MEMCACHED_VERSION.tar.gz" \ - && echo "$MEMCACHED_SHA1 memcached.tar.gz" | sha1sum -c - \ - && mkdir -p /usr/src/memcached \ - && tar -xzf memcached.tar.gz -C /usr/src/memcached --strip-components=1 \ - && rm memcached.tar.gz \ - && cd /usr/src/memcached \ - && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ - && ./configure \ - --build="$gnuArch" \ - --enable-sasl \ - $enableExtstore \ - && make -j "$(nproc)" \ -# TODO https://github.com/memcached/memcached/issues/382 "t/chunked-extstore.t is flaky on arm32v6" - && make test \ - && make install \ - \ - && cd / && rm -rf /usr/src/memcached \ - \ - && runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )" \ - && apk add --virtual .memcached-rundeps $runDeps \ - && apk del .build-deps \ - && rm -fr /var/cache/apk/* - -USER memcache -EXPOSE 11211 -CMD ["memcached"] \ No newline at end of file diff --git a/images/memcached/README.md b/images/memcached/README.md deleted file mode 100644 index 9931520a..00000000 --- a/images/memcached/README.md +++ /dev/null @@ -1,2 +0,0 @@ -## Memcached ->Free & open source, high-performance, distributed memory object caching system \ No newline at end of file diff --git a/images/memcached/latest/Dockerfile b/images/memcached/latest/Dockerfile new file mode 100644 index 00000000..2cf3824f --- /dev/null +++ b/images/memcached/latest/Dockerfile @@ -0,0 +1,7 @@ +FROM memcached:alpine +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +USER memcache +EXPOSE 11211 +CMD ["memcached", "-m", "128"] diff --git a/images/mongo/4.4/Dockerfile b/images/mongo/4.4/Dockerfile new file mode 100644 index 00000000..414e7b8c --- /dev/null +++ b/images/mongo/4.4/Dockerfile @@ -0,0 +1,9 @@ +FROM mongo:4.4 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +VOLUME /data/db /data/configdb +ENTRYPOINT ["docker-entrypoint.sh"] + +EXPOSE 27017 +CMD ["mongod"] diff --git a/images/mongo/5.0/Dockerfile b/images/mongo/5.0/Dockerfile new file mode 100644 index 00000000..90a12308 --- /dev/null +++ b/images/mongo/5.0/Dockerfile @@ -0,0 +1,9 @@ +FROM mongo:5.0 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +VOLUME /data/db /data/configdb +ENTRYPOINT ["docker-entrypoint.sh"] + +EXPOSE 27017 +CMD ["mongod"] diff --git a/images/mongodb/README.md b/images/mongo/README.md similarity index 100% rename from images/mongodb/README.md rename to images/mongo/README.md diff --git a/images/mongo/latest/Dockerfile b/images/mongo/latest/Dockerfile new file mode 100644 index 00000000..d649909e --- /dev/null +++ b/images/mongo/latest/Dockerfile @@ -0,0 +1,9 @@ +FROM mongo:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +VOLUME /data/db /data/configdb +ENTRYPOINT ["docker-entrypoint.sh"] + +EXPOSE 27017 +CMD ["mongod"] diff --git a/images/mongodb/Dockerfile b/images/mongodb/Dockerfile deleted file mode 100644 index 469d4aae..00000000 --- a/images/mongodb/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -FROM registry.cn-hongkong.aliyuncs.com/imxieke/alpine:latest -LABEL MAINTAINER="Cloudflying" \ - MAIL="" - -# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added -RUN apk add --no-cache mongodb \ - && mkdir -p /data/db /data/configdb \ - && chown -R mongodb:mongodb /data/db /data/configdb - -USER mongodb - -VOLUME /data/db /data/configdb - -# 28017 Monitor Page -EXPOSE 27017 28017 - -CMD [ "mongod", "--bind_ip", "0.0.0.0" ] \ No newline at end of file diff --git a/images/mssql/2017/Dockerfile b/images/mssql/2017/Dockerfile new file mode 100644 index 00000000..13474fd7 --- /dev/null +++ b/images/mssql/2017/Dockerfile @@ -0,0 +1,12 @@ +FROM mcr.microsoft.com/mssql/server:2017-latest + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv \ + org.opencontainers.image.description='MSSQL' + +ENV ACCEPT_EULA=Y +VOLUME /var/opt/mssql + +EXPOSE 1433 +CMD /opt/mssql/bin/sqlservr diff --git a/images/mssql/2019/Dockerfile b/images/mssql/2019/Dockerfile new file mode 100644 index 00000000..bdee2dcb --- /dev/null +++ b/images/mssql/2019/Dockerfile @@ -0,0 +1,12 @@ +FROM mcr.microsoft.com/mssql/server:2019-latest + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv \ + org.opencontainers.image.description='MSSQL' + +ENV ACCEPT_EULA=Y +VOLUME /var/opt/mssql + +EXPOSE 1433 +CMD /opt/mssql/bin/sqlservr diff --git a/images/mssql/2022/Dockerfile b/images/mssql/2022/Dockerfile new file mode 100644 index 00000000..a1b42169 --- /dev/null +++ b/images/mssql/2022/Dockerfile @@ -0,0 +1,12 @@ +FROM mcr.microsoft.com/mssql/server:2022-latest + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv \ + org.opencontainers.image.description='MSSQL' + +ENV ACCEPT_EULA=Y +VOLUME /var/opt/mssql + +EXPOSE 1433 +CMD /opt/mssql/bin/sqlservr diff --git a/images/mssql/README.md b/images/mssql/README.md new file mode 100644 index 00000000..47bb9d76 --- /dev/null +++ b/images/mssql/README.md @@ -0,0 +1,44 @@ + + +## MSSQL + +### How to use this Image +``` +docker run -d \ + -e "ACCEPT_EULA=Y" \ + -e "SA_PASSWORD=yourStrong(!)Password" \ + -p 1433:1433 \ + mcr.microsoft.com/mssql/server:latest +``` + +### Connect to Microsoft SQL Server: +``` +docker exec \ + -it \ + /opt/mssql-tools/bin/sqlcmd \ + -S localhost \ + -U sa \ + -P +``` + +## SQL Server Tag lists +- latest +- 2022-latest +- 2019-latest +- 2017-latest + +## Requirements +- This image requires Docker Engine 1.8+ +- At least 2GB of RAM (3.25 GB prior to 2017-CU2). Make sure to assign enough memory to the Docker VM if you're running on Docker for Mac or Windows. +- Requires the following environment flags + - `ACCEPT_EULA=Y` + - `SA_PASSWORD=` + - `MSSQL_PID= (default: Developer)` +- A strong system administrator (SA) password: At least 8 characters including uppercase, lowercase letters, base-10 digits and/or non-alphanumeric symbols. diff --git a/images/mssql/latest/Dockerfile b/images/mssql/latest/Dockerfile new file mode 100644 index 00000000..da4e5f62 --- /dev/null +++ b/images/mssql/latest/Dockerfile @@ -0,0 +1,12 @@ +FROM mcr.microsoft.com/mssql/server:latest + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv \ + org.opencontainers.image.description='MSSQL' + +ENV ACCEPT_EULA=Y +VOLUME /var/opt/mssql + +EXPOSE 1433 +CMD /opt/mssql/bin/sqlservr diff --git a/images/mysql/5.6/Dockerfile b/images/mysql/5.6/Dockerfile new file mode 100644 index 00000000..73b8c80d --- /dev/null +++ b/images/mysql/5.6/Dockerfile @@ -0,0 +1,13 @@ +FROM mysql:5.6 +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv \ + org.opencontainers.image.description='MYSQL 5.6' + +VOLUME /var/lib/mysql + +ENTRYPOINT ["docker-entrypoint.sh"] + +EXPOSE 3306 33060 + +CMD ["mysqld"] diff --git a/images/mysql/5.7/Dockerfile b/images/mysql/5.7/Dockerfile new file mode 100644 index 00000000..37af1f8f --- /dev/null +++ b/images/mysql/5.7/Dockerfile @@ -0,0 +1,13 @@ +FROM mysql:5.7 +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv \ + org.opencontainers.image.description='MYSQL 5.7' + +VOLUME /var/lib/mysql + +ENTRYPOINT ["docker-entrypoint.sh"] + +EXPOSE 3306 33060 + +CMD ["mysqld"] diff --git a/images/mysql/8.0/Dockerfile b/images/mysql/8.0/Dockerfile new file mode 100644 index 00000000..b8435236 --- /dev/null +++ b/images/mysql/8.0/Dockerfile @@ -0,0 +1,13 @@ +FROM mysql:8 +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv \ + org.opencontainers.image.description='MYSQL Latest' + +VOLUME /var/lib/mysql + +ENTRYPOINT ["docker-entrypoint.sh"] + +EXPOSE 3306 33060 + +CMD ["mysqld"] diff --git a/images/mysql/Dockerfile b/images/mysql/Dockerfile deleted file mode 100644 index bddb01dc..00000000 --- a/images/mysql/Dockerfile +++ /dev/null @@ -1,53 +0,0 @@ -FROM registry.cn-hongkong.aliyuncs.com/imxieke/debian:stretch - -ENV GOSU_VERSION 1.7 -ENV MYSQL_MAJOR 5.7 -ENV MYSQL_VERSION 5.7.26-1debian9 - -ADD https://mirrors.xieke.org/Packages/Linux/gosu-amd64 /usr/local/bin/gosu -COPY conf.d/mysql.gpg /etc/apt/trusted.gpg.d/mysql.gpg -# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added -RUN set -x \ - && groupadd -r mysql && useradd -r -g mysql mysql \ - && chmod +x /usr/local/bin/gosu \ - && gosu nobody true \ - && echo "deb http://mirrors.ustc.edu.cn/mysql-repo/apt/debian/ stretch mysql-${MYSQL_MAJOR}" > /etc/apt/sources.list.d/mysql.list \ - # the "/var/lib/mysql" stuff here is because the mysql-server postinst doesn't have an explicit way to disable the mysql_install_db codepath besides having a database already "configured" (ie, stuff in /var/lib/mysql/mysql) - # also, we set debconf keys to make APT a little quieter - && { \ - echo mysql-community-server mysql-community-server/data-dir select ''; \ - echo mysql-community-server mysql-community-server/root-pass password ''; \ - echo mysql-community-server mysql-community-server/re-root-pass password ''; \ - echo mysql-community-server mysql-community-server/remove-test-db select false; \ - } | debconf-set-selections \ - && apt update && apt-get install -y --no-install-recommends openssl mysql-server="${MYSQL_VERSION}" \ - && rm -rf /var/lib/mysql \ - && mkdir -p /var/lib/mysql /var/run/mysqld /docker-entrypoint-initdb.d \ - && chown -R mysql:mysql /var/lib/mysql /var/run/mysqld \ - # ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime - && chmod 755 /var/run/mysqld \ - # comment out a few problematic configuration values - && find /etc/mysql/ -name '*.cnf' -print0 \ - | xargs -0 grep -lZE '^(bind-address|log)' \ - | xargs -rt -0 sed -Ei 's/^(bind-address|log)/#&/' \ - # don't reverse lookup hostnames, they are usually another container - && echo '[mysqld]\nskip-host-cache\nskip-name-resolve' > /etc/mysql/conf.d/docker.cnf \ - && rm -rf /var/lib/apt/lists/* \ - && rm -rf ${HOME}/.gnupg \ - && apt autoremove -y \ - && rm -fr /etc/mysql/my.cnf \ - && rm -fr /etc/mysql/conf.d/mysql.cnf \ - && rm -fr /etc/mysql/conf.d/mysqldump.cnf - -VOLUME /var/lib/mysql - -COPY conf.d/5.7.cnf /etc/mysql/my.cnf -COPY scripts/5.7.sh /usr/local/bin/docker-entrypoint.sh -RUN ln -s /usr/local/bin/docker-entrypoint.sh /entrypoint.sh \ - && chmod 777 /usr/local/bin/docker-entrypoint.sh \ - && chmod 644 /etc/mysql/my.cnf \ - && chmod +x /usr/local/bin/docker-entrypoint.sh -ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] - -EXPOSE 3306 33060 -CMD ["mysqld"] diff --git a/images/mysql/Dockerfile.5.7.26 b/images/mysql/Dockerfile.5.7.26 deleted file mode 100644 index bddb01dc..00000000 --- a/images/mysql/Dockerfile.5.7.26 +++ /dev/null @@ -1,53 +0,0 @@ -FROM registry.cn-hongkong.aliyuncs.com/imxieke/debian:stretch - -ENV GOSU_VERSION 1.7 -ENV MYSQL_MAJOR 5.7 -ENV MYSQL_VERSION 5.7.26-1debian9 - -ADD https://mirrors.xieke.org/Packages/Linux/gosu-amd64 /usr/local/bin/gosu -COPY conf.d/mysql.gpg /etc/apt/trusted.gpg.d/mysql.gpg -# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added -RUN set -x \ - && groupadd -r mysql && useradd -r -g mysql mysql \ - && chmod +x /usr/local/bin/gosu \ - && gosu nobody true \ - && echo "deb http://mirrors.ustc.edu.cn/mysql-repo/apt/debian/ stretch mysql-${MYSQL_MAJOR}" > /etc/apt/sources.list.d/mysql.list \ - # the "/var/lib/mysql" stuff here is because the mysql-server postinst doesn't have an explicit way to disable the mysql_install_db codepath besides having a database already "configured" (ie, stuff in /var/lib/mysql/mysql) - # also, we set debconf keys to make APT a little quieter - && { \ - echo mysql-community-server mysql-community-server/data-dir select ''; \ - echo mysql-community-server mysql-community-server/root-pass password ''; \ - echo mysql-community-server mysql-community-server/re-root-pass password ''; \ - echo mysql-community-server mysql-community-server/remove-test-db select false; \ - } | debconf-set-selections \ - && apt update && apt-get install -y --no-install-recommends openssl mysql-server="${MYSQL_VERSION}" \ - && rm -rf /var/lib/mysql \ - && mkdir -p /var/lib/mysql /var/run/mysqld /docker-entrypoint-initdb.d \ - && chown -R mysql:mysql /var/lib/mysql /var/run/mysqld \ - # ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime - && chmod 755 /var/run/mysqld \ - # comment out a few problematic configuration values - && find /etc/mysql/ -name '*.cnf' -print0 \ - | xargs -0 grep -lZE '^(bind-address|log)' \ - | xargs -rt -0 sed -Ei 's/^(bind-address|log)/#&/' \ - # don't reverse lookup hostnames, they are usually another container - && echo '[mysqld]\nskip-host-cache\nskip-name-resolve' > /etc/mysql/conf.d/docker.cnf \ - && rm -rf /var/lib/apt/lists/* \ - && rm -rf ${HOME}/.gnupg \ - && apt autoremove -y \ - && rm -fr /etc/mysql/my.cnf \ - && rm -fr /etc/mysql/conf.d/mysql.cnf \ - && rm -fr /etc/mysql/conf.d/mysqldump.cnf - -VOLUME /var/lib/mysql - -COPY conf.d/5.7.cnf /etc/mysql/my.cnf -COPY scripts/5.7.sh /usr/local/bin/docker-entrypoint.sh -RUN ln -s /usr/local/bin/docker-entrypoint.sh /entrypoint.sh \ - && chmod 777 /usr/local/bin/docker-entrypoint.sh \ - && chmod 644 /etc/mysql/my.cnf \ - && chmod +x /usr/local/bin/docker-entrypoint.sh -ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] - -EXPOSE 3306 33060 -CMD ["mysqld"] diff --git a/images/mysql/README.md b/images/mysql/README.md deleted file mode 100644 index 8fa5c6aa..00000000 --- a/images/mysql/README.md +++ /dev/null @@ -1,2 +0,0 @@ -## -docker run --name mysql \ No newline at end of file diff --git a/images/mysql/conf.d/mysql.gpg b/images/mysql/conf.d/mysql.gpg deleted file mode 100644 index 6f7c628f..00000000 Binary files a/images/mysql/conf.d/mysql.gpg and /dev/null differ diff --git a/images/mysql/docker-compose.yml b/images/mysql/docker-compose.yml deleted file mode 100644 index a0fe75e3..00000000 --- a/images/mysql/docker-compose.yml +++ /dev/null @@ -1,17 +0,0 @@ -version: '3.1' - -services: - - mysql: - image: mysql:5.7.29 - ports: - - "3306:3306" - command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci - restart: always - environment: - MYSQL_ROOT_PASSWORD: '19960318' - MYSQL_USER: 'apiset' - MYSQL_PASS: '19960318' - volumes: - - "/Users/imxieke/Code/Storage/mysql:/var/lib/mysql" - - "./conf.d/5.7.cnf:/etc/my.cnf" \ No newline at end of file diff --git a/images/mysql/latest b/images/mysql/latest new file mode 120000 index 00000000..b293f64d --- /dev/null +++ b/images/mysql/latest @@ -0,0 +1 @@ +8.0 \ No newline at end of file diff --git a/images/mysql/scripts/5.7.sh b/images/mysql/scripts/5.7.sh deleted file mode 100644 index b38c1128..00000000 --- a/images/mysql/scripts/5.7.sh +++ /dev/null @@ -1,215 +0,0 @@ -#!/bin/bash -set -eo pipefail -shopt -s nullglob - -# if command starts with an option, prepend mysqld -if [ "${1:0:1}" = '-' ]; then - set -- mysqld "$@" -fi - -# skip setup if they want an option that stops mysqld -wantHelp= -for arg; do - case "$arg" in - -'?'|--help|--print-defaults|-V|--version) - wantHelp=1 - break - ;; - esac -done - -# usage: file_env VAR [DEFAULT] -# ie: file_env 'XYZ_DB_PASSWORD' 'example' -# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of -# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature) -file_env() { - local var="$1" - local fileVar="${var}_FILE" - local def="${2:-}" - if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then - echo >&2 "error: both $var and $fileVar are set (but are exclusive)" - exit 1 - fi - local val="$def" - if [ "${!var:-}" ]; then - val="${!var}" - elif [ "${!fileVar:-}" ]; then - val="$(< "${!fileVar}")" - fi - export "$var"="$val" - unset "$fileVar" -} - -# usage: process_init_file FILENAME MYSQLCOMMAND... -# ie: process_init_file foo.sh mysql -uroot -# (process a single initializer file, based on its extension. we define this -# function here, so that initializer scripts (*.sh) can use the same logic, -# potentially recursively, or override the logic used in subsequent calls) -process_init_file() { - local f="$1"; shift - local mysql=( "$@" ) - - case "$f" in - *.sh) echo "$0: running $f"; . "$f" ;; - *.sql) echo "$0: running $f"; "${mysql[@]}" < "$f"; echo ;; - *.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${mysql[@]}"; echo ;; - *) echo "$0: ignoring $f" ;; - esac - echo -} - -_check_config() { - toRun=( "$@" --verbose --help ) - if ! errors="$("${toRun[@]}" 2>&1 >/dev/null)"; then - cat >&2 <<-EOM - - ERROR: mysqld failed while attempting to check config - command was: "${toRun[*]}" - - $errors - EOM - exit 1 - fi -} - -# Fetch value from server config -# We use mysqld --verbose --help instead of my_print_defaults because the -# latter only show values present in config files, and not server defaults -_get_config() { - local conf="$1"; shift - "$@" --verbose --help --log-bin-index="$(mktemp -u)" 2>/dev/null | awk '$1 == "'"$conf"'" { print $2; exit }' -} - -# allow the container to be started with `--user` -if [ "$1" = 'mysqld' -a -z "$wantHelp" -a "$(id -u)" = '0' ]; then - _check_config "$@" - DATADIR="$(_get_config 'datadir' "$@")" - mkdir -p "$DATADIR" - chown -R mysql:mysql "$DATADIR" - exec gosu mysql "$BASH_SOURCE" "$@" -fi - -if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then - # still need to check config, container may have started with --user - _check_config "$@" - # Get config - DATADIR="$(_get_config 'datadir' "$@")" - - if [ ! -d "$DATADIR/mysql" ]; then - file_env 'MYSQL_ROOT_PASSWORD' - if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - echo >&2 'error: database is uninitialized and password option is not specified ' - echo >&2 ' You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD' - exit 1 - fi - - mkdir -p "$DATADIR" - - echo 'Initializing database' - "$@" --initialize-insecure - echo 'Database initialized' - - if command -v mysql_ssl_rsa_setup > /dev/null && [ ! -e "$DATADIR/server-key.pem" ]; then - # https://github.com/mysql/mysql-server/blob/23032807537d8dd8ee4ec1c4d40f0633cd4e12f9/packaging/deb-in/extra/mysql-systemd-start#L81-L84 - echo 'Initializing certificates' - mysql_ssl_rsa_setup --datadir="$DATADIR" - echo 'Certificates initialized' - fi - - SOCKET="$(_get_config 'socket' "$@")" - "$@" --skip-networking --socket="${SOCKET}" & - pid="$!" - - mysql=( mysql --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" ) - - for i in {30..0}; do - if echo 'SELECT 1' | "${mysql[@]}" &> /dev/null; then - break - fi - echo 'MySQL init process in progress...' - sleep 1 - done - if [ "$i" = 0 ]; then - echo >&2 'MySQL init process failed.' - exit 1 - fi - - if [ -z "$MYSQL_INITDB_SKIP_TZINFO" ]; then - # sed is for https://bugs.mysql.com/bug.php?id=20545 - mysql_tzinfo_to_sql /usr/share/zoneinfo | sed 's/Local time zone must be set--see zic manual page/FCTY/' | "${mysql[@]}" mysql - fi - - if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - export MYSQL_ROOT_PASSWORD="$(pwgen -1 32)" - echo "GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD" - fi - - rootCreate= - # default root to listen for connections from anywhere - file_env 'MYSQL_ROOT_HOST' '%' - if [ ! -z "$MYSQL_ROOT_HOST" -a "$MYSQL_ROOT_HOST" != 'localhost' ]; then - # no, we don't care if read finds a terminating character in this heredoc - # https://unix.stackexchange.com/questions/265149/why-is-set-o-errexit-breaking-this-read-heredoc-expression/265151#265151 - read -r -d '' rootCreate <<-EOSQL || true - CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ; - GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; - EOSQL - fi - - "${mysql[@]}" <<-EOSQL - -- What's done in this file shouldn't be replicated - -- or products like mysql-fabric won't work - SET @@SESSION.SQL_LOG_BIN=0; - - SET PASSWORD FOR 'root'@'localhost'=PASSWORD('${MYSQL_ROOT_PASSWORD}') ; - GRANT ALL ON *.* TO 'root'@'localhost' WITH GRANT OPTION ; - ${rootCreate} - DROP DATABASE IF EXISTS test ; - FLUSH PRIVILEGES ; - EOSQL - - if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then - mysql+=( -p"${MYSQL_ROOT_PASSWORD}" ) - fi - - file_env 'MYSQL_DATABASE' - if [ "$MYSQL_DATABASE" ]; then - echo "CREATE DATABASE IF NOT EXISTS \`$MYSQL_DATABASE\` ;" | "${mysql[@]}" - mysql+=( "$MYSQL_DATABASE" ) - fi - - file_env 'MYSQL_USER' - file_env 'MYSQL_PASSWORD' - if [ "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then - echo "CREATE USER '$MYSQL_USER'@'%' IDENTIFIED BY '$MYSQL_PASSWORD' ;" | "${mysql[@]}" - - if [ "$MYSQL_DATABASE" ]; then - echo "GRANT ALL ON \`$MYSQL_DATABASE\`.* TO '$MYSQL_USER'@'%' ;" | "${mysql[@]}" - fi - - echo 'FLUSH PRIVILEGES ;' | "${mysql[@]}" - fi - - echo - ls /docker-entrypoint-initdb.d/ > /dev/null - for f in /docker-entrypoint-initdb.d/*; do - process_init_file "$f" "${mysql[@]}" - done - - if [ ! -z "$MYSQL_ONETIME_PASSWORD" ]; then - "${mysql[@]}" <<-EOSQL - ALTER USER 'root'@'%' PASSWORD EXPIRE; - EOSQL - fi - if ! kill -s TERM "$pid" || ! wait "$pid"; then - echo >&2 'MySQL init process failed.' - exit 1 - fi - - echo - echo 'MySQL init process done. Ready for start up.' - echo - fi -fi - -exec "$@" diff --git a/images/nextcloud/Dockerfile b/images/nextcloud/Dockerfile deleted file mode 100644 index 9d56a7f6..00000000 --- a/images/nextcloud/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -#latest ownCloud in Docker! -FROM imxieke/php:latest -LABEL MAINTAINER="Cloudflying" \ - MAIL="oss@live.hk" - -ENV NAME nextcloud -RUN echo "==> Download NextCloud" \ - && apt update -y \ - && apt install -y wget unzip \ - && cd /tmp \ - && mkdir -p /tmp/${NAME} \ - && wget https://download.${NAME}.com/server/releases/latest.zip -O /tmp/${NAME}.zip \ - && rm -fr /var/www/* \ - && unzip /tmp/${NAME}.zip -d /tmp/${NAME}/ \ - && mv /tmp/${NAME}/* /var/www/ \ - && rm -fr /tmp/* \ - && chmod 755 -R /var/www/ \ - && chown www-data:www-data -R /var/www \ - && apt purge -y wget unzip \ - && apt autoremove -y \ - && apt-get clean all \ - && rm -fr /var/lib/apt/lists/* - -EXPOSE 80 -CMD /bin/start.sh \ No newline at end of file diff --git a/images/nextcloud/README.md b/images/nextcloud/README.md deleted file mode 100644 index e0c68f06..00000000 --- a/images/nextcloud/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# NextCloud -https://nextcloud.com diff --git a/images/nginx/1.18/Dockerfile b/images/nginx/1.18/Dockerfile new file mode 100644 index 00000000..4f712a8f --- /dev/null +++ b/images/nginx/1.18/Dockerfile @@ -0,0 +1,18 @@ +FROM nginx:1.18.0-alpine-perl +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +# 更改权限 +RUN mkdir /var/www \ + && chown -R www-data.www-data /var/www/ /var/log/nginx/ + +# 设置时区 && 同步时间 +ENV TZ=Asia/Shanghai +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +# mount nginx log +VOLUME /var/log/nginx + +WORKDIR /usr/share/nginx/html +EXPOSE 80 443 8080 8888 9090 +CMD ["nginx", "-g", "daemon off;"] diff --git a/images/nginx/1.19/Dockerfile b/images/nginx/1.19/Dockerfile new file mode 100644 index 00000000..e2bcdbea --- /dev/null +++ b/images/nginx/1.19/Dockerfile @@ -0,0 +1,18 @@ +FROM nginx:1.19.6-alpine-perl +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +# 更改权限 +RUN mkdir /var/www \ + && chown -R www-data.www-data /var/www/ /var/log/nginx/ + +# 设置时区 && 同步时间 +ENV TZ=Asia/Shanghai +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +# mount nginx log +VOLUME /var/log/nginx + +WORKDIR /usr/share/nginx/html +EXPOSE 80 443 8080 8888 9090 +CMD ["nginx", "-g", "daemon off;"] diff --git a/images/nginx/1.20/Dockerfile b/images/nginx/1.20/Dockerfile new file mode 100644 index 00000000..dff72a4a --- /dev/null +++ b/images/nginx/1.20/Dockerfile @@ -0,0 +1,12 @@ +FROM ghcr.io/dockenv/alpine:3.14 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +RUN apk add --no-cache nginx nginx-mod-http-brotli nginx-mod-http-dav-ext nginx-mod-stream nginx-mod-http-geoip \ + nginx-mod-http-geoip2 nginx-mod-http-headers-more nginx-mod-http-js nginx-mod-http-naxsi nginx-mod-http-nchan \ + nginx-mod-http-xslt-filter nginx-mod-mail nginx-mod-http-upstream-fair nginx-mod-http-image-filter nginx-mod-stream-geoip \ + nginx-mod-stream-geoip2 nginx-mod-stream-js + +EXPOSE 80 443 +CMD ["nginx", "-g", "daemon off;"] diff --git a/images/nginx/1.20/build.sh b/images/nginx/1.20/build.sh new file mode 100644 index 00000000..b071803f --- /dev/null +++ b/images/nginx/1.20/build.sh @@ -0,0 +1,221 @@ +#!/usr/bin/env sh +### + # @Author: Cloudflying + # @Date: 2021-11-19 13:20:23 + # @LastEditTime: 2021-11-19 22:56:48 + # @LastEditors: Cloudflying + # @Description: + # @FilePath: /dockenv/images/nginx/1.20.2/build.sh +### +NGINX_VERSION='1.20.2' +# NGINX_VERSION='1.21.4' +# Deps +apk add --virtual .deps make gcc g++ autoconf automake git wget findutils +apk add sregex-dev --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing +# libxml2-dev +# ./configure: no supported file AIO was found +apk add linux-headers +# libaio-dev +apk add libxslt-dev zlib-dev gd-dev geoip-dev +# 文件较大 +apk add czmq-dev libmaxminddb-dev flex bison zstd-dev libressl-dev +fix_conf() +{ + # 使 Nginx 可以直接使用本地已安装 openssl + sed -i 's/\.openssl\///g' auto/lib/openssl/conf + sed -i 's/libssl\.a/x86_64-linux-gnu\/libssl\.a/g' auto/lib/openssl/conf + sed -i 's/libcrypto\.a/x86_64-linux-gnu\/libcrypto\.a/g' auto/lib/openssl/conf +} + +mkdir -p /tmp/build/ngx_mod +cd /tmp/build +if [[ ! -f "/tmp/build/nginx-${NGINX_VERSION}" ]]; then + if [[ ! -f "/tmp/build/nginx-${NGINX_VERSION}.tar.gz" ]]; then + URL="https://hk.mirrors.xieke.org/Src/nginx/nginx-${NGINX_VERSION}.tar.gz" + wget -c ${URL} + fi + tar -xvf nginx-${NGINX_VERSION}.tar.gz > /dev/null 2>&1 + cd nginx-${NGINX_VERSION} && fix_conf +fi + +cd /tmp/build/ngx_mod + +# Cache +# git clone --depth 1 https://github.com/nginx-modules/ngx_cache_purge +# git clone --depth 1 https://github.com/openresty/srcache-nginx-module +# git clone --depth 1 https://github.com/wandenberg/nginx-selective-cache-purge-module + +# git clone --depth 1 https://github.com/google/nginx-sxg-module +# git clone --depth 1 https://github.com/openresty/lua-nginx-module +# git clone --depth 1 https://github.com/openresty/stream-lua-nginx-module +# git clone --depth 1 https://github.com/openresty/lua-upstream-nginx-module +# git clone --depth 1 https://github.com/openresty/echo-nginx-module +# git clone --depth 1 https://github.com/openresty/stream-echo-nginx-module +# git clone --depth 1 https://github.com/openresty/set-misc-nginx-module +# git clone --depth 1 https://github.com/openresty/headers-more-nginx-module +# git clone --depth 1 https://github.com/openresty/memc-nginx-module +# git clone --depth 1 https://github.com/openresty/array-var-nginx-module +# git clone --depth 1 https://github.com/openresty/encrypted-session-nginx-module + +# git clone --depth 1 https://github.com/vision5/ngx_devel_kit +# git clone --depth 1 https://github.com/vision5/ngx_http_set_lang +# git clone --depth 1 https://github.com/vision5/ngx_http_set_hash +# git clone --depth 1 https://github.com/apache/incubator-pagespeed-ngx +# git clone --depth 1 https://github.com/Refinitiv/nginx-sticky-module-ng +# git clone --depth 1 https://github.com/arut/nginx-dav-ext-module +# 流媒体 包含 rtmp 所有功能 +# git clone --depth 1 https://github.com/winshining/nginx-http-flv-module +# git clone --depth 1 https://github.com/arut/nginx-rtmp-module +# git clone --depth 1 https://github.com/kaltura/nginx-vod-module +# git clone --depth 1 https://github.com/arut/nginx-live-module +# MPEG-TS Live +# git clone --depth 1 https://github.com/arut/nginx-ts-module + +# Compress +git clone --depth 1 https://github.com/google/ngx_brotli +git clone --depth 1 https://github.com/tokers/zstd-nginx-module +# file unzip +# git clone --depth 1 https://github.com/ajax16384/ngx_http_untar_module +# git clone --depth 1 https://github.com/evanmiller/mod_zip + +# git clone --depth 1 https://github.com/kaltura/nginx-json-var-module +# git clone --depth 1 https://github.com/nicholaschiasson/ngx_upstream_jdomain +# git clone --depth 1 https://github.com/itoffshore/nginx-upstream-fair +# git clone --depth 1 https://github.com/masterzen/nginx-upload-progress-module +# git clone --depth 1 https://github.com/slact/nchan +# git clone --depth 1 https://github.com/Lax/traffic-accounting-nginx-module +# git clone --depth 1 https://github.com/aperezdc/ngx-fancyindex +# git clone --depth 1 https://github.com/nginx-shib/nginx-http-shibboleth +# git clone --depth 1 https://github.com/AirisX/nginx_cookie_flag_module +# git clone --depth 1 https://github.com/AlticeLabsProjects/nginx-log-zmq +git clone --depth 1 https://github.com/nbs-system/naxsi +# unknow error +# git clone --depth 1 https://github.com/nginx/njs +# git clone --depth 1 https://github.com/kaltura/nginx-secure-token-module +# git clone --depth 1 https://github.com/kaltura/nginx-aggr-module + +# function +# git clone --depth 1 https://github.com/kaltura/nginx-parallel-module +git clone --depth 1 https://github.com/nginx-modules/ngx_http_hmac_secure_link_module + +# Limit +# git clone --depth 1 https://github.com/nginx-modules/ngx_http_limit_traffic_ratefilter_module + +# git clone --depth 1 https://github.com/dvershinin/ngx_dynamic_etag +# IP +git clone --depth 1 https://github.com/ip2location/ip2proxy-nginx +git clone --depth 1 https://github.com/ip2location/ip2location-nginx +git clone --depth 1 https://github.com/leev/ngx_http_geoip2_module + +# embed language +# git clone --depth 1 https://github.com/decentfox/nginxpy +# git clone --depth 1 https://github.com/arut/nginx-python-module +# git clone --depth 1 https://github.com/rryqszq4/ngx_php7 + +# git clone --depth 1 https://github.com/limithit/ngx_dynamic_limit_req_module +# git clone --depth 1 https://github.com/zhouchangxun/ngx_healthcheck_module +# git clone --depth 1 https://github.com/tarantool/nginx_upstream_module + +# Security +# Application FireWall +# git clone --depth 1 https://github.com/SpiderLabs/ModSecurity-nginx +# git clone --depth 1 https://github.com/aufi/anddos +# git clone --depth 1 https://github.com/openresty/xss-nginx-module +# git clone --depth 1 https://github.com/ADD-SP/ngx_waf + +# server traffic status +# git clone --depth 1 https://github.com/vozlt/nginx-module-sts +# git clone --depth 1 https://github.com/vozlt/nginx-module-stream-sts.git # depen by sts +# git clone --depth 1 https://github.com/zhouchangxun/ngx_stream_upstream_check_module +# git clone --depth 1 https://github.com/psychobilly/ngx_http_json_status_module + +# Filter +git clone --depth 1 https://github.com/cuber/ngx_http_google_filter_module +git clone --depth 1 https://github.com/openresty/replace-filter-nginx-module +git clone --depth 1 https://github.com/yaoweibin/ngx_http_substitutions_filter_module + +# Other +# git clone --depth 1 https://github.com/wandenberg/nginx-push-stream-module +git clone --depth 1 https://github.com/TeslaGov/ngx-http-auth-jwt-module +# git clone --depth 1 https://github.com/openresty/redis2-nginx-module +# git clone --depth 1 https://github.com/openresty/rds-csv-nginx-module +# git clone --depth 1 https://github.com/openresty/rds-json-nginx-module + +if [[ -d '/tmp/build/ngx_mod/ngx_waf' ]]; then + cd /tmp/build/ngx_mod/ngx_waf && make + git clone --depth 1 https://github.com/libinjection/libinjection inc/libinjection +fi + +if [[ ! -f "/usr/lib/x86_64-linux-gnu/libssl.a" ]]; then + mkdir -p /usr/lib/x86_64-linux-gnu + ln -s /usr/lib/libssl.a /usr/lib/x86_64-linux-gnu/libssl.a + ln -s /usr/lib/libcrypto.a /usr/lib/x86_64-linux-gnu/libcrypto.a +fi + +cd /tmp/build/nginx-${NGINX_VERSION} +# fast to get module +# 不想编译的扩展删除扩展目录并注释 git 命令即可 +# mod_ops=$(ls ../ngx_mod/ | tr ' ' '\n' | awk '{print "--add-dynamic-module=../"$1" \\"}' | sed 's#njs#njs\/nginx#g' | sed 's#naxsi#naxsi/naxsi_src#g') +# mod_ops=$(ls ../ngx_mod/ | tr ' ' '\n' | grep -v 'ngx_devel_kit' | grep -v 'ngx_healthcheck_module' | awk '{print "--add-dynamic-module=../ngx_mod/"$1}' | sed 's#njs#njs\/nginx#g' | sed 's#naxsi#naxsi/naxsi_src#g') +mod_ops=$(ls ../ngx_mod/ | tr ' ' '\n' | grep -v 'ngx_devel_kit' | grep -v 'ngx_healthcheck_module' | awk '{print "--add-dynamic-module=../ngx_mod/"$1}' | sed 's#naxsi#naxsi/naxsi_src#g') +# LUAJIT_INC=$(find /usr/include/ -maxdepth 1 -name 'luajit*') +# echo $mod_ops;exit +# echo $LUAJIT_INC;exit +# LUAJIT_INC=${LUAJIT_INC} +./configure \ + --prefix=/var/lib/nginx \ + --sbin-path=/usr/sbin/nginx \ + --modules-path=/usr/lib/nginx/modules \ + --conf-path=/etc/nginx/nginx.conf \ + --pid-path=/run/nginx/nginx.pid \ + --lock-path=/run/nginx/nginx.lock \ + --http-client-body-temp-path=/var/lib/nginx/tmp/client_body \ + --http-log-path=/var/log/nginx.log \ + --http-proxy-temp-path=/var/lib/nginx/tmp/proxy \ + --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi \ + --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi \ + --http-scgi-temp-path=/var/lib/nginx/tmp/scgi \ + --user=nginx \ + --group=nginx \ + --with-threads \ + --with-file-aio \ + --with-http_addition_module \ + --with-http_auth_request_module \ + --with-http_dav_module \ + --with-http_degradation_module \ + --with-http_image_filter_module=dynamic \ + --with-http_flv_module \ + --with-http_geoip_module=dynamic \ + --with-http_gunzip_module \ + --with-http_gzip_static_module \ + --with-http_mp4_module \ + --with-http_random_index_module \ + --with-http_realip_module \ + --with-http_secure_link_module \ + --with-http_ssl_module \ + --with-http_sub_module \ + --with-http_slice_module \ + --with-http_stub_status_module \ + --with-http_v2_module \ + --with-http_xslt_module=dynamic \ + --with-mail=dynamic \ + --with-mail_ssl_module \ + --with-stream=dynamic \ + --with-stream_geoip_module=dynamic \ + --with-stream_realip_module \ + --with-stream_ssl_module \ + --with-stream_ssl_preread_module \ + --with-compat \ + --with-pcre \ + --with-poll_module \ + --with-pcre-jit \ + --with-select_module \ + --with-openssl=/usr + # --with-perl_modules_path=/usr/lib/perl5/vendor_perl \ + # --with-http_perl_module=dynamic \ + # --with-zlib=/usr + # ${mod_ops} + # --add-dynamic-module=../ngx_mod/ngx_devel_kit \ + # --add-module=../ngx_mod/ngx_healthcheck_module \ + # ${mod_ops%?} + make -j8 diff --git a/images/nginx/1.21/Dockerfile b/images/nginx/1.21/Dockerfile new file mode 100644 index 00000000..e69de29b diff --git a/images/nginx/Dockerfile b/images/nginx/Dockerfile deleted file mode 100644 index d5485863..00000000 --- a/images/nginx/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM registry.cn-hongkong.aliyuncs.com/imxieke/alpine:latest -LABEL MAINTAINER="Cloudflying" \ - MAIL="" - -RUN apk add --no-cache nginx - -EXPOSE 80 443 -CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/images/nginx/README.md b/images/nginx/README.md new file mode 100644 index 00000000..18a54b2d --- /dev/null +++ b/images/nginx/README.md @@ -0,0 +1,142 @@ + - Nginx Waf + - https://github.com/gsdu8g9/waf-nginx-module + - https://github.com/oneinstack/ngx_lua_waf + - https://github.com/taihedeveloper/ngx_lua_waf + - https://github.com/loveshell/ngx_lua_waf + + +- https://github.com/happyfish100/fastdfs-nginx-module +- https://github.com/qieangel2013/ngx-fastdfs + + +## Mirrors vhost + +- 缓存 +- 内容替换 + +- bower registry +- https://dn-dao-github-mirror.daocloud.io +- ajax.googleapis.com +- github.com +- raw.githubusercontent.com +- objects.githubusercontent.com +- github.githubassets.com +- customer-stories-feed.github.com +- Github Download +- GitHub Archive +- https://registry.npmjs.org/ +- https://registry.yarnpkg.com + +- Docker Registry + - https://hub-mirror.c.163.com + - https://ustc-edu-cn.mirror.aliyuncs.com + - https://22bvsrc3.mirror.aliyuncs.com + - ghcr.io + - Third Rgistry + - gcr.io/ubuntu xxx + - quay.io + +- https://cn.gravatar.com/avatar +- https://www.gravatar.com/avatar +- https://secure.gravatar.com/avatar +- https://cn.gravatar.com +- https://cdn.v2ex.com/gravatar/ +- https://sdn.geekzu.org/avatar/ +- https://gravatar.loli.net/avatar +- https://ajax.googleapis.com/ +- http://fonts.googleapis.com +- https://fonts.gstatic.com +- https://themes.googleusercontent.com +- https://cdnjs.cloudflare.com +- https://cdn.jsdelivr.net +- https://oss.maxcdn.com +- https://unpkg.com/docsify-count/dist/countable.min.js +- Ubuntu Mirrors + - http://security.ubuntu.com/ubuntu/ + - http://archive.canonical.com/ +- Search Engine + - Google + - Duckduckgo + + +# Mirrors +Need To Proxy: +https://registry.npmjs.org/ +https://repo.maven.apache.org/ + +### Docker hub mirror: +https://registry-1.docker.io/ //Offcial +https://docker.mirrors.ustc.edu.cn //USTC -> 302 下面 +https://ustc-edu-cn.mirror.aliyuncs.com + +### Open Sources Mirrors Plan + +Open Sources Downloads Sites: +redis.io +http://nginx.org/download/ +https://www.mongodb.org/downloads //very fast of speed + +### Npm Mirrors: +WebSites: +https://www.npmjs.com/ //Offcial +https://npm.taobao.org/ +https://cnpmjs.org/ + +https://registry.npmjs.org/ +https://registry.enpmjs.com //Canada +https://registry.npm.taobao.org + +### RubyGems Mirrors: +http://rubygems.org/ +https://ruby.taobao.org/ +https://gems.ruby-china.org/ + +### Ruby Mirrors: +https://cache.ruby-lang.org/ +https://cache.ruby-china.org/ +https://ruby.taobao.org/mirrors/ruby/ + +### Rubygems Mirros: +http://rubygems.global.ssl.fastly.net/latest_specs.4.8.gz +https://rubygems.global.ssl.fastly.net/gems/A_123-1.2.0.gem +http://gems.ruby-china.org/latest_specs.4.8.gz + +### Pypi Mirrors: +https://pypi.python.org/ +https://pypi.tuna.tsinghua.edu.cn/ +http://pypi.mirrors.ustc.edu.cn/ +https://pypi.doubanio.com/ +http://pypi.zenlogic.net/ + +https://archive.apache.org/dist/ + + +https://archive.apache.org/ +https://www.apache.org/dist/ +http://mirrors.noc.im/ +appche 88.198.26.2/eu 140.211.11.105/us 2a01:4f8:130:2192::2 + +### Source Forge +http://iweb.dl.sourceforge.net/project/wine/ +http://jaist.dl.sourceforge.net/project/wine/ +http://vorboss.dl.sourceforge.net/project/wine/ + +### Maven Repo +http://209.132.182.97/ have a few diffrent +http://209.132.182.97/nexus/content/groups/public/ +http://maven.tmatesoft.com/content/groups/public/ +http://maven.antelink.com/ +http://uk.maven.org +http://uk.maven.org/maven2/loom/loom/1.0-rc3/loom-1.0-rc3-bin.zip +http://repo2.maven.org/ +http://repo1.maven.org/ +https://repo.maven.apache.org/ + +https://gems.ruby-china.org/ +https://ruby.taobao.org/ + +http://ruby.sdutlinux.org/ + +- https://avedex.me +- https://avedex.org +- https://avedex.cc diff --git a/images/nginx/conf/components/block-search-engine.conf b/images/nginx/conf/components/block-search-engine.conf new file mode 100644 index 00000000..55a73118 --- /dev/null +++ b/images/nginx/conf/components/block-search-engine.conf @@ -0,0 +1,5 @@ +# Block search engine +if ($http_user_agent ~* "qihoobot|Baiduspider|Bingbot|Googlebot|Googlebot-Mobile|Googlebot-Image|Mediapartners-Google|Adsbot-Google|Feedfetcher-Google|Yahoo! Slurp|Yahoo! Slurp China|YoudaoBot|Sosospider|Sogou spider|Sogou web spider|MSNBot|ia_archiver|Tomato Bot") +{ + return 403; +} diff --git a/images/nginx/conf/components/cache.conf b/images/nginx/conf/components/cache.conf new file mode 100644 index 00000000..1d53a3e2 --- /dev/null +++ b/images/nginx/conf/components/cache.conf @@ -0,0 +1,87 @@ +# binary +location ~ \.(exe|dmg|class|pkg|app)$ { + # expires 1m; + expires 31536000s; + access_log off; + log_not_found off; + # add_header Vary Accept-Encoding; + add_header Pragma public; + add_header Cache-Control "max-age=31536000, public"; +} + +# Mutimedia Music Video +location ~ \.(avi|mp3|mp4|m4a|m4v|wav|wma|mov|mpe|ogg|mpg|divx|wmv|wmx|wri|wax|mid|midi|swf|ra|ram|ogv|qt|flv)$ { + # expires 1m; + expires 31536000s; + access_log off; + log_not_found off; + # add_header Vary Accept-Encoding; + add_header Pragma public; + add_header Cache-Control "max-age=31536000, public"; +} + +# compress +location ~ \.(gz|bz2|gzip|tar|tgz|zip|rar|zstd|lzma)$ { + # expires 1m; + expires 31536000s; + access_log off; + log_not_found off; + # add_header Vary Accept-Encoding; + add_header Pragma public; + add_header Cache-Control "max-age=31536000, public"; +} + +# Picture +location ~ \.(gif|ico|jpg|jpeg|png|bmp|jpe|mpeg|webm|tif|tiff)$ { + # 3 days + expires 259200; + access_log off; + log_not_found off; + # add_header Vary Accept-Encoding; + add_header Pragma public; + add_header Cache-Control "max-age=259200, public"; +} + +# Documents or Text +location ~ \.(txt|csv|xml|json|doc|docx|xsl|pdf|epub|pps|ppt|pptx|xla|xlsx|xlt|pot|xla|xlt|xlw|odb|odc|odf|odg|odp|ods|odt|mpp|asx)$ { + # 3 days + expires 259200; + access_log off; + log_not_found off; + # add_header Vary Accept-Encoding; + add_header Pragma public; + add_header Cache-Control "max-age=259200, public"; +} + +# other +location ~ \.(swf|asf)$ { + expires 31536000s; + access_log off; + log_not_found off; + add_header Content-Encoding gzip; + add_header Pragma public; + add_header Cache-Control "max-age=31536000, public"; +} + +# Fonts +location ~ \.(eot|ttf|otf|woff|woff2)$ { + expires 31536000s; + access_log off; + log_not_found off; + add_header Content-Encoding gzip; + add_header Pragma public; + add_header Cache-Control "max-age=31536000, public"; +} + +# Rewrite for versioned CSS+JS via filemtime +# if use reverse proxy comment this +# Front-End +location ~* ^.+\.(js|css|less|sass|svg|svgz)(\?[0-9]+)?$ { + # rewrite ^(.+)\.(\d+)\.(js|css|less|sass|svg|svgz)$ $1.$3 last; + expires 31536000s; + access_log off; + log_not_found off; + add_header Content-Encoding gzip; + add_header Pragma public; + add_header Cache-Control "max-age=31536000, public"; +} diff --git a/images/nginx/conf/components/cross-domain-insecure.conf b/images/nginx/conf/components/cross-domain-insecure.conf new file mode 100644 index 00000000..301886d4 --- /dev/null +++ b/images/nginx/conf/components/cross-domain-insecure.conf @@ -0,0 +1,15 @@ +# Cross domain AJAX requests + +# **Security Warning** +# Do not use this without understanding the consequences. +# This will permit access from any other website. +# +add_header "Access-Control-Allow-Origin" "*"; + +# Instead of using this file, consider using a specific rule such as: +# +# Allow access based on [sub]domain: +# add_header "Access-Control-Allow-Origin" "subdomain.example.com"; +# OR +# add_header "Access-Control-Allow-Origin" "*.example.com"; + diff --git a/images/nginx/conf/components/expires.conf b/images/nginx/conf/components/expires.conf new file mode 100644 index 00000000..6b6a37d7 --- /dev/null +++ b/images/nginx/conf/components/expires.conf @@ -0,0 +1,43 @@ +# Expire rules for static content + +# No default expire rule. This config mirrors that of apache as outlined in the +# html5-boilerplate .htaccess file. However, nginx applies rules by location, +# the apache rules are defined by type. A consequence of this difference is that +# if you use no file extension in the url and serve html, with apache you get an +# expire time of 0s, with nginx you'd get an expire header of one month in the +# future (if the default expire rule is 1 month). Therefore, do not use a +# default expire rule with nginx unless your site is completely static + +# cache.appcache, your document html and data +location ~* \.(?:manifest|appcache|html?|xml|json)$ { + expires -1; + access_log /var/log/nginx/static.log; +} + +# Feed +location ~* \.(?:rss|atom)$ { + expires 1h; + add_header Cache-Control "public"; +} + +# Media: images, icons, video, audio, HTC +location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ { + expires 1M; + access_log off; + add_header Cache-Control "public"; +} + +# CSS and Javascript +location ~* \.(?:css|js)$ { + expires 1y; + access_log off; + add_header Cache-Control "public"; +} + +# WebFonts +# If you are NOT using cross-domain-fonts.conf, uncomment the following directive +# location ~* \.(?:ttf|ttc|otf|eot|woff|woff2)$ { +# expires 1M; +# access_log off; +# add_header Cache-Control "public"; +# } diff --git a/images/nginx/conf/components/extra-security.conf b/images/nginx/conf/components/extra-security.conf new file mode 100644 index 00000000..dcc5fbaf --- /dev/null +++ b/images/nginx/conf/components/extra-security.conf @@ -0,0 +1,17 @@ +# The X-Frame-Options header indicates whether a browser should be allowed +# to render a page within a frame or iframe. +add_header X-Frame-Options SAMEORIGIN; + +# MIME type sniffing security protection +# There are very few edge cases where you wouldn't want this enabled. +add_header X-Content-Type-Options nosniff; + +# The X-XSS-Protection header is used by Internet Explorer version 8+ +# The header instructs IE to enable its inbuilt anti-cross-site scripting filter. +add_header X-XSS-Protection "1; mode=block"; + +# with Content Security Policy (CSP) enabled (and a browser that supports it (http://caniuse.com/#feat=contentsecuritypolicy), +# you can tell the browser that it can only download content from the domains you explicitly allow +# CSP can be quite difficult to configure, and cause real issues if you get it wrong +# There is website that helps you generate a policy here http://cspisawesome.com/ +# add_header Content-Security-Policy "default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' https://www.google-analytics.com;"; diff --git a/images/nginx/conf/components/header.conf b/images/nginx/conf/components/header.conf new file mode 100644 index 00000000..5231e9db --- /dev/null +++ b/images/nginx/conf/components/header.conf @@ -0,0 +1,25 @@ +# Enable IE Edge mode +add_header "X-UA-Compatible" "IE=Edge,chrome=1"; + +# Prevent mobile network providers from modifying your site +# +# (!) If you are using `ngx_pagespeed`, please note that setting +# the `Cache-Control: no-transform` response header will prevent +# `PageSpeed` from rewriting `HTML` files, and, if +# `pagespeed DisableRewriteOnNoTransform off` is not used, also +# from rewriting other resources. +# +# https://developers.google.com/speed/pagespeed/module/configuration#notransform + +add_header "Cache-Control" "no-transform"; + +add_header Strict-Transport-Security max-age=15768000; +# 添加几条有关安全的响应头,与 Google+ 的配置类似 +add_header X-Frame-Options "SAMEORIGIN"; +add_header X-XSS-Protection "1; mode=block"; +add_header X-Content-Type-Options "nosniff"; +add_header X-Robots-Tag none; +add_header X-Download-Options noopen; +add_header X-Permitted-Cross-Domain-Policies none; +# anti floc +add_header Permissions-Policy interest-cohort=(); diff --git a/images/nginx/conf/components/nginx-status.conf b/images/nginx/conf/components/nginx-status.conf new file mode 100644 index 00000000..bf95c05d --- /dev/null +++ b/images/nginx/conf/components/nginx-status.conf @@ -0,0 +1,7 @@ +location /nginx_status { + stub_status on; + access_log off; + # allow 127.0.0.1; + allow all; + # deny all; +} diff --git a/images/nginx/conf/components/protect-system-files.conf b/images/nginx/conf/components/protect-system-files.conf new file mode 100644 index 00000000..30c60807 --- /dev/null +++ b/images/nginx/conf/components/protect-system-files.conf @@ -0,0 +1,34 @@ +# Prevent clients from accessing hidden files (starting with a dot) +# This is particularly important if you store .htpasswd files in the site hierarchy +# location ~* (?:^|/)\. { +# deny all; +# } + +# this prevents file leftovers to be seen, such as vim temp files. +location ~ ~$ { + access_log off; + log_not_found off; + deny all; +} + +# Prevent clients from accessing to backup/config/source files +location ~* (?:\.(?:bak|config|sql|mdb|fla|psd|ini|log|sh|inc|swp|dist)|~|DS_Store)$ { + deny all; +} + +location ~ /node_modules/ { + deny all; +} + +# deny access to .htaccess files, if Apache's document root concurs with nginx's one +location ~ /\.(ht|git|svn|hg) { + deny all; +} + +location ~ ^/(htpasswd|ftpquota|environments|vendor|console|common|console|tests|requirements\.php|composer\.lock|composer\.json|yii|init)/ { + deny all; +} + +location ~ ^/(\.user.ini|\.htaccess|\.git|\.project|LICENSE|README.md|env) { + return 404; +} diff --git a/images/nginx/conf/components/proxy.conf b/images/nginx/conf/components/proxy.conf new file mode 100644 index 00000000..f761f7d8 --- /dev/null +++ b/images/nginx/conf/components/proxy.conf @@ -0,0 +1,31 @@ +sub_filter_once off; +proxy_redirect off; +## Proxy caching +proxy_cache_bypass $http_upgrade; +proxy_max_temp_file_size 2048m; +proxy_temp_file_write_size 32k; +proxy_http_version 1.1; +proxy_connect_timeout 300s; + +proxy_send_timeout 900; +proxy_read_timeout 900; + +proxy_buffering on; +proxy_buffers 4 32k; +proxy_buffer_size 32k; + +proxy_busy_buffers_size 64k; + +proxy_set_header Host $http_host; +proxy_set_header Referer $http_referer; +proxy_set_header Cookie $http_cookie; +proxy_set_header Connection "upgrade"; +proxy_set_header X-Real-IP $remote_addr; +proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +proxy_set_header X-Forwarded-Host $host; +proxy_set_header X-Forwarded-Port $server_port; +proxy_set_header X-Forwarded-Proto $scheme; +proxy_set_header Upgrade $http_upgrade; +# 也可以直接使用 url +proxy_set_header Referer $http_referer; +proxy_set_header User-Agent $http_user_agent; diff --git a/images/nginx/conf/components/spdy.conf b/images/nginx/conf/components/spdy.conf new file mode 100644 index 00000000..f65912be --- /dev/null +++ b/images/nginx/conf/components/spdy.conf @@ -0,0 +1,11 @@ +# Nginx's spdy module is compiled by default from 1.6 +# SPDY only works on HTTPS connections + +# Inform browser of SPDY availability +add_header Alternate-Protocol 443:npn-spdy/3; + +# Adjust connection keepalive for SPDY clients: +spdy_keepalive_timeout 300; # up from 180 secs default + +# enable SPDY header compression +spdy_headers_comp 6; diff --git a/images/nginx/conf/components/ssl.conf b/images/nginx/conf/components/ssl.conf new file mode 100644 index 00000000..ed322167 --- /dev/null +++ b/images/nginx/conf/components/ssl.conf @@ -0,0 +1,66 @@ +# Enable TLS versions (TLSv1.3 is required for QUIC). +ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3 SSLv2 SSLv3; +# Ciphers set to best allow protection from Beast, while providing forwarding secrecy +# as defined by Mozilla (Intermediate Set) - https://wiki.mozilla.org/Security/Server_Side_TLS#Nginx +ssl_ciphers "!ADH:!DSS:!EXPORT56:!MD5:!NULL:!RC4:!aNULL:+EXP:+HIGH:+LOW:+MEDIUM:+SSLv2:AES:AES128-GCM-SHA256:AES128-SHA:AES128-SHA256:AES256-GCM-SHA384:AES256-SHA:AES256-SHA256:ALL:DES-CBC3-SHA:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA256:ECDH:ECDHE:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:EECDH+3DES:EECDH+AES128:EECDH+AES256:EECDH+CHACHA20:EECDH+CHACHA20-draft:HIGH:RC4+RSA:RSA+3DES:RSA+AES128:RSA+AES256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS1ssl_ciphers TLS13-AES-256-GCM-SHA384" +# 由服务器协商最佳的加密算法 +ssl_prefer_server_ciphers on; +ssl_early_data on; + +# Enable TLSv1.3's 0-RTT. Use $ssl_early_data when reverse proxying to prevent replay attacks. +# +# @see: http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_early_data +# Add Alt-Svc header to negotiate HTTP/3. +add_header alt-svc 'h3-29=":443"; ma=86400'; +# Debug 0-RTT. +add_header X-Early-Data $tls1_3_early_data; + +ssl_session_timeout 10m; +# Session Cache,将Session缓存到服务器,这可能会占用更多的服务器资源 +ssl_session_cache builtin:1000 shared:SSL:10m; +ssl_session_tickets off; +ssl_buffer_size 1400; + +# Optimize SSL by caching session parameters for 10 minutes. This cuts down on the number of expensive SSL handshakes. +# The handshake is the most CPU-intensive operation, and by default it is re-negotiated on every new/parallel connection. +# By enabling a cache (of type "shared between all Nginx workers"), we tell the client to re-use the already negotiated state. +# Further optimization can be achieved by raising keepalive_timeout, but that shouldn't be done unless you serve primarily HTTPS. +ssl_session_cache shared:SSL:10m; # a 1mb cache can hold about 4000 sessions, so we can hold 40000 sessions +ssl_session_timeout 24h; + +# SSL buffer size was added in 1.5.9 +#ssl_buffer_size 1400; # 1400 bytes to fit in one MTU + +# Session tickets appeared in version 1.5.9 +# +# nginx does not auto-rotate session ticket keys: only a HUP / restart will do so and +# when a restart is performed the previous key is lost, which resets all previous +# sessions. The fix for this is to setup a manual rotation mechanism: +# http://trac.nginx.org/nginx/changeset/1356a3b9692441e163b4e78be4e9f5a46c7479e9/nginx +# +# Note that you'll have to define and rotate the keys securely by yourself. In absence +# of such infrastructure, consider turning off session tickets: +#ssl_session_tickets off; + +# Use a higher keepalive timeout to reduce the need for repeated handshakes +keepalive_timeout 300; # up from 75 secs default + +# HSTS (HTTP Strict Transport Security) +# This header tells browsers to cache the certificate for a year and to connect exclusively via HTTPS. +#add_header Strict-Transport-Security "max-age=31536000;"; +# This version tells browsers to treat all subdomains the same as this site and to load exclusively over HTTPS +#add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;"; + +# Consider using OCSP Stapling as shown in ssl-stapling.conf + +# Consider using OCSP Stapling as shown in ssl-stapling.conf + +# OCSP Stapling开启,OCSP是用于在线查询证书吊销情况的服务,使用OCSP Stapling能将证书有效状态的信息缓存到服务器,提高TLS握手速度 +ssl_stapling on; +# OCSP Stapling 验证开启 +ssl_stapling_verify on; +# Diffie-Hellman 公共密钥过弱 有以下两种生成方式 有以下两种生成方式 +# Run following command & set permission before configuring +# curl https://ssl-config.mozilla.org/ffdhe2048.txt > /etc/nginx/dhparam.pem +# openssl dhparam -out /etc/nginx/dhparam.pem 2048 +ssl_dhparam /etc/nginx/dhparam.pem; diff --git a/images/nginx/conf/conf.d.example/examples.conf b/images/nginx/conf/conf.d.example/examples.conf new file mode 100644 index 00000000..e482ceb0 --- /dev/null +++ b/images/nginx/conf/conf.d.example/examples.conf @@ -0,0 +1,73 @@ +server { + listen [::]:80; + server_name example.com www.example.com; + return 301 https://example.com$request_uri; +} + +server { + # listen [::]:443; + # Enable QUIC and HTTP/3. + listen 443 quic reuseport; + http2_push_preload on; + # For https + # listen 443 ssl; + # listen [::]:443 ssl ipv6only=on; + # ssl_certificate /etc/nginx/ssl/default.crt; + # ssl_certificate_key /etc/nginx/ssl/default.key; + + server_name app.test; + root /var/www/app; + # autoindex off; + index index.php index.html index.htm; + # 可选 utf-8 gbk gb2312 + charset $charset; + + # 使用 301 强制 HTTPS + if ($scheme != "https") { + return 301 https://$host$request_uri; + } + + location ~* \.php$ { + include fastcgi_params; + try_files $uri =404; + try_files $fastcgi_script_name =404; + # cgi mode + # fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; + # fpm mode + fastcgi_pass 127.0.0.1:9000; + fastcgi_buffer_size 32k; + fastcgi_buffers 16 16k; + fastcgi_read_timeout 600; + fastcgi_index index.php; + fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param TIDEWAYS_SAMPLERATE "25"; + fastcgi_param SCRIPT_NAME $fastcgi_script_name; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + # fastcgi_param PHP_VALUE open_basedir=$document_root:/tmp/:/proc/; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + # fastcgi_split_path_info ^(.+?\.php)(/.*)$; + } + + # 匹配到 url 则跳转 如 github 下载 + location ~ ^/[^/]+/[^/]+/releases/download/ { + return 301 https://download.fastgit.org$request_uri; + } + + # Disable .htaccess and other hidden files + # location ~ /\. { + # exclude .well-known + location ~ /\.(?!well-known).* { + deny all; + access_log off; + log_not_found off; + } + + # Anti Agent Bot DDoS + # If behind CDN, use folloing commented code + # if ($http_x_forwarded_for != $remote_addr) { + # return 503; + # } + if ($proxy_add_x_forwarded_for != $remote_addr) { + return 503; + } +} diff --git a/images/nginx/conf/conf.d.example/mirrors.conf b/images/nginx/conf/conf.d.example/mirrors.conf new file mode 100644 index 00000000..9e80d997 --- /dev/null +++ b/images/nginx/conf/conf.d.example/mirrors.conf @@ -0,0 +1,2478 @@ +server { + listen 80; + server_name pods.xie.ke; + index index.php index.html index.htm default.php default.htm default.html; + root /mnt/storage/sites/pods.xie.ke; + + #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则 + #error_page 404/404.html; + #SSL-END + + #ERROR-PAGE-START 错误页配置,可以注释、删除或修改 + #error_page 404 /404.html; + #error_page 502 /502.html; + #ERROR-PAGE-END + #PHP-INFO-START PHP引用配置,可以注释或修改 + include enable-php-00.conf; + #PHP-INFO-END + + #REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效 + include /www/server/panel/vhost/rewrite/pods.xie.ke.conf; + #REWRITE-END + + location /adobe-fonts/ { + proxy_pass https://mirror.iscas.ac.cn/adobe-fonts/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /almalinux/ { + proxy_pass http://mirror.siena.edu/almalinux/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /anthon/ { + proxy_pass https://mirror.xtom.ee/anthon/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /archstrike/ { + proxy_pass https://mirror.umd.edu/archstrike/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /armbian/ { + proxy_pass https://mirrors.fossho.st/armbian/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /armbian-releases/ { + proxy_pass https://mirror.iscas.ac.cn/armbian-releases/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /apache/ { + # proxy_pass https://mirrors.ocf.berkeley.edu/apache/; + # proxy_pass https://downloads.apache.org/; + # proxy_pass http://mirrors.ibiblio.org/apache/; + proxy_pass https://mirror.hackingand.coffee/apache/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /apache-old/ { + proxy_pass https://archive.apache.org/dist/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /archlinuxcn/ { + proxy_pass https://mirror.xtom.com.hk/archlinuxcn/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /arch4edu/ { + proxy_pass https://mirror.iscas.ac.cn/arch4edu/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /archlinux/ { + proxy_pass http://mirror.siena.edu/archlinux/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /archlinuxarm/ { + proxy_pass https://mirror.iscas.ac.cn/archlinuxarm/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /archlinuxcn { + proxy_pass https://mirror.xtom.ee/archlinuxcn/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /alpine { + proxy_pass https://mirrors.edge.kernel.org/alpine/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /bioarchlinux { + proxy_pass https://mirror.xtom.ee/bioarchlinux/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /blackarch { + proxy_pass https://mirrors.ocf.berkeley.edu/blackarch/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /centos { + proxy_pass https://mirrors.edge.kernel.org/centos/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /centos-altarch/ { + sub_filter_once off; + sub_filter "/mirrors/pub/centos-altarch/" "/centos-altarch/"; + proxy_pass https://quantum-mirror.hu/mirrors/pub/centos-altarch/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /centos-stream { + proxy_pass http://mirror.siena.edu/centos-stream/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + # Comprehensive Perl Archive Network + location /cpan { + proxy_pass https://mirrors.edge.kernel.org/CPAN/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /cocoapods/ { + # 疑似 对象站点使用了 Cloudflare 造成 ssl 握手错误 502 非 502 错误请勿使用 + proxy_ssl_server_name on; + proxy_pass https://cdn.cocoapods.org/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /cran/ { + proxy_pass http://mirrors.ibiblio.org/CRAN/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /ctan/ { + proxy_pass https://mirrors.mit.edu/CTAN/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + # A Linux-like environment for Windows + location /cygwin/ { + proxy_pass https://mirrors.mit.edu/cygwin/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /debian { + proxy_pass https://mirrors.edge.kernel.org/debian/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /debiancn { + proxy_pass https://mirror.xtom.ee/debiancn/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /debian-archive { + # proxy_pass http://archive.debian.org/debian-archive/; + proxy_pass https://plug-mirror.rcac.purdue.edu/debian-archive/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /debian-backports { + proxy_pass https://mirrors.mit.edu/debian-backports/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /debian-cd { + proxy_pass https://mirrors.edge.kernel.org/debian-cd/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /debian-cd-archive { + proxy_pass https://plug-mirror.rcac.purdue.edu/debian-cd-archive/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /debian-cloud-images/ { + proxy_pass https://cloud.debian.org/images/cloud/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /debian-multimedia { + # proxy_pass http://mirrors.psu.ac.th/debian-multimedia/; + proxy_pass https://debian-mirrors.sdinet.de/debian-multimedia/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /debian-ports { + proxy_pass http://cdn-fastly.deb.debian.org/debian-ports/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /debian-security { + proxy_pass http://cdn-fastly.deb.debian.org/debian-security/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /deepin { + proxy_pass https://mirrors.edge.kernel.org/deepin/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /deepin-cd { + proxy_pass https://mirrors.edge.kernel.org/deepin-cd/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /devuan { + proxy_pass https://mirror.umd.edu/devuan/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /devuan-cd/ { + sub_filter_once off; + sub_filter "/mirrors/pub/devuan-cd/" "/devuan-cd/"; + proxy_pass https://quantum-mirror.hu/mirrors/pub/devuan-cd/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /dragonflybsd-dports/ { + proxy_pass https://avalon.dragonflybsd.org/dports/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /dragonflybsd-snapshots/ { + proxy_pass https://avalon.dragonflybsd.org/snapshots/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /dragonflybsd-images/ { + proxy_pass https://avalon.dragonflybsd.org/iso-images/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /dragonflybsd-older-images/ { + proxy_pass https://avalon.dragonflybsd.org/older/iso-images/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /eclipse { + proxy_pass https://mirror.umd.edu/eclipse/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /elasticstack/ { + proxy_pass https://mirror.iscas.ac.cn/elasticstack/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /elrepo { + proxy_pass https://mirrors.maine.edu/elrepo/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /erlang-solutions/ { + proxy_pass https://mirror.iscas.ac.cn/erlang-solutions/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /exim { + proxy_pass http://mirrors.syringanetworks.net/exim/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /fedora { + proxy_pass https://mirrors.edge.kernel.org/fedora/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /fedora-epel/ { + proxy_pass https://mirrors.edge.kernel.org/fedora-epel/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /fedora-secondary/ { + proxy_pass http://mirror.fcix.net/fedora-secondary/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /fedora-altarch/ { + # http://mirror.fcix.net/fedora-alt/ + proxy_pass https://mirror.xtom.ee/fedora-altarch/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /fdroid { + proxy_pass https://mirror.kumi.systems/fdroid/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /finnix { + proxy_pass https://mirrors.mit.edu/finnix/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /flutter/ { + proxy_pass https://mirror.iscas.ac.cn/flutter/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /freebsd/ { + proxy_pass https://mirror.xtom.ee/freebsd/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /freebsd-pkg/ { + proxy_pass https://mirror.xtom.ee/freebsd-pkg/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /freebsd-ports/ { + proxy_pass https://mirror.xtom.ee/freebsd-ports/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + # https://mirror.umd.edu/gentoo-portage/ + location /gentoo { + proxy_pass https://mirrors.edge.kernel.org/gentoo/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /gentoo-distfiles { + proxy_pass https://mirrors.ocf.berkeley.edu/gentoo-distfiles/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /gentoo-portage { + proxy_pass https://mirrors.edge.kernel.org/gentoo-portage/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + # GIMP GNU Image Manipulation Program + location /gimp { + proxy_pass http://mirrors.xmission.com/gimp/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /gnome { + proxy_pass http://ykf.ca.distfiles.macports.org/gnome/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /gutenberg { + proxy_pass http://mirrors.syringanetworks.net/gutenberg/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + # 502 + # location /hhvm { + # proxy_pass https://dl.hhvm.com/; + # proxy_set_header X-Real-IP $remote_addr; + # proxy_set_header X-Forwarded-Host $host; + # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Server $host; + # proxy_set_header Upgrade $http_upgrade; + # proxy_set_header Connection "Upgrade"; + # } + + location /hackage/ { + proxy_pass https://mirror.iscas.ac.cn/hackage/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /harmonyos/ { + proxy_pass https://mirror.iscas.ac.cn/harmonyos/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /ius { + proxy_pass http://mirrors.ibiblio.org/IUS/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /kali { + # proxy_pass https://mirrors.ocf.berkeley.edu/kali/; + proxy_pass https://repo.ialab.dsu.edu/kali/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /kali-cdimage { + # proxy_pass https://mirrors.ocf.berkeley.edu/kali-cdimage/; + proxy_pass https://repo.ialab.dsu.edu/kali-images/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /kaos/ { + # https://mirrors.fossho.st/kaos/ + proxy_pass https://mirror.alpix.eu/kaos/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + # https://cdn.kernel.org/pub/ + # The primary site for the Linux kernel source + location /kernel/ { + proxy_pass https://mirrors.mit.edu/kernel/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /kodi { + proxy_pass https://mirrors.mit.edu/kodi/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /kde { + proxy_pass https://mirrors.mit.edu/kde/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /kde-application { + proxy_pass https://mirrors.ocf.berkeley.edu/kde-applicationdata/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + # url/full see file lists + location /lineageos { + proxy_pass https://mirror.kumi.systems/lineageos/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /libreboot { + proxy_pass https://mirrors.mit.edu/libreboot/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /libreoffice { + sub_filter_once off; + sub_filter "Index of /tdf/libreoffice/" "Index of /libreoffice/"; + # proxy_pass http://mirrors.ibiblio.org/libreoffice/; + proxy_pass http://mirrors.syringanetworks.net/tdf/libreoffice/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /macports { + proxy_pass http://ykf.ca.distfiles.macports.org/MacPorts/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /manjaro { + proxy_pass http://mirror.fcix.net/manjaro/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + # Database server with drop-in replacement functionality for MySQL + location /mariadb { + proxy_pass https://mirror.kumi.systems/mariadb/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /mariadb-archive/ { + sub_filter_once off; + sub_filter "mariadbarchive" "mariadb-archive"; + proxy_pass https://mirror.kumi.systems/mariadbarchive/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /mariadb-repo { + proxy_pass https://mirror.us-midwest-1.nexcess.net/mariadb/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /microsoft { + proxy_pass https://packages.microsoft.com/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /mozdev { + proxy_pass http://mirrors.ibiblio.org/mozdev.org/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /mozilla/ { + proxy_pass https://releases.mozilla.com/pub/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /mxlinux { + proxy_pass https://mirror.umd.edu/mxlinux/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /mxlinux-iso { + proxy_pass https://mirror.umd.edu/mxlinux-iso/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /mysql/ { + proxy_pass http://ykf.ca.distfiles.macports.org/mysql/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /netbsd/ { + sub_filter_once off; + sub_filter "Index of /pub/NetBSD/" "Index of /pub/netbsd/"; + proxy_pass https://mirrors.mit.edu/NetBSD/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /netbsd-pkgsrc/ { + proxy_pass http://nycdn.netbsd.org/pub/pkgsrc/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /nginx/ { + proxy_ssl_server_name on; + proxy_pass http://nginx.org/download/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /nginx-packages/ { + proxy_ssl_server_name on; + sub_filter_once off; + sub_filter "Index of /packages/" "Index of /nginx-packages/"; + proxy_pass http://nginx.org/packages/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /nginx-unit { + proxy_ssl_server_name on; + proxy_pass https://packages.nginx.org/unit/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /nodejs/ { + sub_filter_once off; + sub_filter "dist" "nodejs"; + proxy_pass https://nodejs.org/dist/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /nongnu { + proxy_pass https://mirror.kumi.systems/nongnu/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /nuget/ { + proxy_pass https://api.nuget.org/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /openbsd { + sub_filter_once off; + sub_filter "Index of /pub/OpenBSD/" "Index of /openbsd/"; + proxy_pass https://mirrors.mit.edu/pub/OpenBSD/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + + location /openssh { + sub_filter_once off; + sub_filter "Index of /pub/OpenBSD/OpenSSH/" "Index of /openssh/"; + proxy_pass https://mirrors.mit.edu/pub/OpenBSD/OpenSSH/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /openssl { + proxy_pass http://mirrors.ibiblio.org/openssl/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + # downloads.openwrt.org + location /openwrt { + proxy_pass https://mirror.kumi.systems/openwrt/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /osmc/ { + proxy_pass https://mirrors.mit.edu/osmc/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + # https://zh.osdn.net + location /osdn/ { + # no lists + # https://pods.xie.ke/osdn/propedit/59609/jp.gr.java_conf.ussiy.app.propedit.nl_6.0.0.zip + # proxy_pass https://mirrors.ocf.berkeley.edu/osdn/; + proxy_pass https://ftp.sunet.se/mirror/osdn.net/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /ovirt/ { + proxy_pass http://mirrors.ibiblio.org/ovirt/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /putty { + proxy_pass http://mirrors.syringanetworks.net/putty/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /qt { + proxy_pass https://mirrors.ocf.berkeley.edu/qt/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /raspbian/ { + # https://repo.ialab.dsu.edu/raspbian/ + proxy_pass https://mirror.umd.edu/raspbian/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /raspbian-images/ { + proxy_pass https://plug-mirror.rcac.purdue.edu/raspbian-images/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /rfcs { + proxy_pass http://mirrors.syringanetworks.net/rfcs/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /rocky { + # https://repo.ialab.dsu.edu/rocky-linux/ + # proxy_pass https://mirrors.ocf.berkeley.edu/rocky/; + proxy_pass https://mirror.lshiy.com/rocky/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /ros { + proxy_pass https://mirror.umd.edu/ros/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /roswiki { + proxy_pass https://mirror.umd.edu/roswiki/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /rpmfusion { + proxy_pass https://mirrors.ocf.berkeley.edu/rpmfusion/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /sabayonlinux { + proxy_pass https://mirror.umd.edu/sabayonlinux/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + # http://sagemath.org + location /sage/ { + proxy_pass https://mirrors.mit.edu/sage/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + # https://sugarlabs.org + location /sugarlabs/ { + proxy_pass https://mirrors.mit.edu/sugarlabs/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /tor { + sub_filter_once off; + sub_filter "/torproject/dist/" "/tor/"; + proxy_pass https://mirrors.mit.edu/torproject/dist/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /turnkeylinux { + proxy_pass https://mirror.umd.edu/turnkeylinux/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /ubuntu/ { + proxy_pass https://mirrors.edge.kernel.org/ubuntu/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /ubuntudde/ { + proxy_pass https://mirrors.fossho.st/ubuntudde/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /ubuntu-cdimage { + proxy_pass https://mirrors.mit.edu/ubuntu-cdimage/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /ubuntu-ports { + proxy_pass http://ykf.ca.distfiles.macports.org/ubuntu-ports/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /ubuntu-ports-releases { + proxy_pass http://ykf.ca.distfiles.macports.org/ubuntu-ports-releases/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /ubuntu-releases/ { + proxy_ssl_server_name on; + sub_filter_once off; + sub_filter "/linux/ubuntu-releases/" "/ubuntu-releases/"; + proxy_pass http://mirror.ancl.hawaii.edu/linux/ubuntu-releases/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + # Free Software Foundation archive + location /gnu { + proxy_pass https://mirrors.edge.kernel.org/gnu/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /linuxmint { + proxy_pass https://mirrors.edge.kernel.org/linuxmint/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /linuxmint-images { + # proxy_pass http://mirrors.psu.ac.th/linuxmint-iso/; + proxy_pass http://mirror.fcix.net/linuxmint-images/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /linuxmint-packages { + proxy_pass https://mirrors.edge.kernel.org/linuxmint-packages/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /mageia/ { + proxy_pass https://mirrors.edge.kernel.org/mageia/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /openeuler/ { + proxy_pass https://mirror.iscas.ac.cn/openeuler/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /opensuse/ { + proxy_pass https://mirrors.edge.kernel.org/opensuse/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /oracle { + proxy_pass https://mirrors.edge.kernel.org/oracle/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /python/ { + proxy_pass https://www.python.org/ftp/python/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /qubes { + proxy_pass https://mirrors.edge.kernel.org/qubes/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /sourceware { + proxy_pass https://mirrors.edge.kernel.org/sourceware/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /tails { + proxy_pass https://mirrors.edge.kernel.org/tails/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /slackware { + proxy_pass https://mirrors.edge.kernel.org/slackware/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /slackware-iso { + proxy_pass https://mirrors.edge.kernel.org/slackware/slackware-iso/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /yocto { + proxy_pass https://mirrors.edge.kernel.org/yocto/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /hackage { + proxy_pass https://rsync.osuosl.org/pub/hackage/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /lfs { + proxy_pass https://rsync.osuosl.org/pub/lfs/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /lfs-livecd { + proxy_pass https://rsync.osuosl.org/pub/lfs-livecd/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /msys2 { + proxy_pass https://mirror.umd.edu/msys2/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /openvz { + proxy_pass http://mirrors.syringanetworks.net/OpenVZ/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /qemu { + proxy_pass https://rsync.osuosl.org/pub/qemu/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /rpm { + proxy_pass https://rsync.osuosl.org/pub/rpm/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /vlc { + proxy_pass https://plug-mirror.rcac.purdue.edu/vlc/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /termux { + proxy_pass https://plug-mirror.rcac.purdue.edu/termux/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /tinycorelinux/ { + proxy_pass http://mirrors.dotsrc.org/tinycorelinux/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /videolan { + proxy_pass https://mirror.kumi.systems/videolan/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /virtualbox { + sub_filter_once off; + sub_filter "download.virtualbox.org" "pods.xie.ke"; + proxy_pass https://download.virtualbox.org/virtualbox/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /wikimedia-dumps { + sub_filter_once off; + sub_filter "/dumps.css" "dumps.css"; + sub_filter "Wikimedia" "Boxs Media"; + proxy_pass https://dumps.wikimedia.org/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /zorin-images { + proxy_pass https://mirror.umd.edu/zorin/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /vim { + proxy_pass http://mirrors.psu.ac.th/vim/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /gnualpha { + proxy_pass https://mirror.kumi.systems/gnualpha/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /lede { + proxy_pass https://mirror.kumi.systems/lede/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /kdeftp { + proxy_pass https://mirror.kumi.systems/kdeftp/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /ubuntukylin { + proxy_pass https://mirror.kumi.systems/ubuntukylin/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /ubuntukylin-cdimage { + proxy_pass https://mirror.kumi.systems/ubuntukylin-cdimage/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /ruby { + proxy_ssl_server_name on; + sub_filter_once off; + sub_filter "/pub/" ""; + proxy_pass https://cache.ruby-lang.org/pub/ruby/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /redis { + proxy_ssl_server_name on; + sub_filter_once off; + sub_filter "/releases/" ""; + proxy_pass https://download.redis.io/releases/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /rubygems { + proxy_pass https://rubygems.org/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /npm { + proxy_pass https://registry.npmjs.org/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /tldp { + proxy_pass https://tldp.org/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /ppa/ { + proxy_pass https://ppa.launchpad.net/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /HardenedBSD/ { + sub_filter_once off; + sub_filter "/mirrors/pub/HardenedBSD/" "/HardenedBSD/"; + proxy_pass https://quantum-mirror.hu/mirrors/pub/HardenedBSD/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /voidlinux/ { + # sub_filter_once off; + # sub_filter "/mirrors/pub/voidlinux/" "/voidlinux/"; + # proxy_pass https://quantum-mirror.hu/mirrors/pub/voidlinux/; + proxy_pass https://repo.ialab.dsu.edu/voidlinux/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /tdf/ { + sub_filter_once off; + sub_filter "/mirrors/pub/tdf/" "/tdf/"; + proxy_pass https://quantum-mirror.hu/mirrors/pub/tdf/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /runtu/ { + sub_filter_once off; + sub_filter "/mirrors/pub/runtu/" "/runtu/"; + proxy_pass https://quantum-mirror.hu/mirrors/pub/runtu/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /opnsense/ { + # sub_filter_once off; + # sub_filter "/mirrors/pub/opnsense/" "/opnsense/"; + # proxy_pass https://quantum-mirror.hu/mirrors/pub/opnsense/; + proxy_pass https://repo.ialab.dsu.edu/opnsense/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /pfsense/ { + proxy_pass https://repo.ialab.dsu.edu/pfsense/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /linuxlite/ { + sub_filter_once off; + sub_filter "/mirrors/pub/linuxlite/" "/linuxlite/"; + proxy_pass https://quantum-mirror.hu/mirrors/pub/linuxlite/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /ipfire/ { + sub_filter_once off; + sub_filter "/mirrors/pub/ipfire/" "/ipfire/"; + proxy_pass https://quantum-mirror.hu/mirrors/pub/ipfire/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /artix-linux/ { + sub_filter_once off; + sub_filter "/mirrors/pub/artix-linux/" "/artix-linux/"; + proxy_pass https://quantum-mirror.hu/mirrors/pub/artix-linux/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /antergos/ { + sub_filter_once off; + sub_filter "/mirrors/pub/antergos/" "/antergos/"; + proxy_pass https://quantum-mirror.hu/mirrors/pub/antergos/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /x.org/ { + sub_filter_once off; + proxy_pass http://ykf.ca.distfiles.macports.org/x.org/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /xubuntu-releases/ { + sub_filter_once off; + proxy_pass http://ykf.ca.distfiles.macports.org/xubuntu-releases/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + # An open source wiki written in PHP originally for use on Wikipedia + location /mediawiki/ { + sub_filter_once off; + proxy_pass http://mirrors.xmission.com/mediawiki/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + # An extendable open source continuous integration server + location /jenkins/ { + sub_filter_once off; + proxy_pass http://mirrors.xmission.com/jenkins/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /salix/ { + sub_filter_once off; + proxy_pass http://mirrors.xmission.com/salix/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + # Over 42,000 public domain eBooks, including many literary classics + location /gutenberg/ { + sub_filter_once off; + proxy_pass http://mirrors.xmission.com/gutenberg/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /solusvm-templates/ { + sub_filter_once off; + sub_filter "Index of /" "Index of /solusvm-templates/"; + proxy_pass https://templates.solusvm.com/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /qemu-linux/ { + proxy_pass https://download.qemu.org/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /qemu-windows/ { + proxy_pass https://qemu.weilnetz.de/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + # 内容替换不成功 + location /opera/ { + sub_filter_once off; + sub_filter "Index of /pub/" "Index of /pub/opera/"; + proxy_pass https://get.opera.com/pub/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /nodesource/ { + proxy_pass https://deb.nodesource.com/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /rpmfusion/ { + proxy_pass https://mirrors.lug.mtu.edu/rpmfusion/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + # https://mirror.lshiy.com/homebrew-bottles/ + location /homebrew-bottles/ { + proxy_pass https://mirror.xtom.ee/homebrew-bottles/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /ubuntu-cloud-images/ { + proxy_pass https://mirror.scaleuptech.com/ubuntu-cloud-images/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /wireshark/ { + sub_filter_once off; + sub_filter "/pub/wireshark/" "/wireshark/"; + proxy_pass http://ftp.uni-kl.de/pub/wireshark/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /winehq/ { + proxy_pass https://dl.winehq.org/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /proxmox/ { + sub_filter_once off; + sub_filter "Index of /" "Index of /proxmox/"; + proxy_pass http://download.proxmox.com/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /maven-atlassian/ { + proxy_pass https://packages.atlassian.com/mvn/maven-atlassian-external/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /maven-central/ { + proxy_pass https://repo1.maven.org/maven2/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /maven-jcenter/ { + proxy_pass https://jcenter.bintray.com/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /maven-public/ { + proxy_pass https://repository.apache.org/content/groups/public/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /maven-google/ { + proxy_pass https://maven.google.com/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /maven-gradle-plugins/ { + proxy_pass https://plugins.gradle.org/m2/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /maven-spring/ { + proxy_pass http://repo.spring.io/libs-milestone/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /maven-spring-plugins/ { + proxy_pass http://repo.spring.io/plugins-release/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /maven-apache-snapshots/ { + proxy_pass https://repository.apache.org/snapshots/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /maven-grails-core/ { + proxy_pass https://repo.grails.org/grails/core/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + # https://mirror.iscas.ac.cn/openresty/ + location /openresty/ { + sub_filter_once off; + sub_filter "package" "openresty"; + proxy_pass http://openresty.org/package/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + + location /goproxy/ { + proxy_ssl_server_name on; + proxy_pass https://proxy.golang.org; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + + location /gosum/ { + proxy_ssl_server_name on; + proxy_pass https://sum.golang.org; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + + location /goindex/ { + proxy_ssl_server_name on; + proxy_pass https://index.golang.org; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /gopkg/ { + proxy_ssl_server_name on; + proxy_pass https://gopkg.in/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /postgresql/ { + sub_filter_once off; + sub_filter "Index of /pub/" "Index of /postgresql/"; + proxy_ssl_server_name on; + proxy_pass https://ftp.postgresql.org/pub/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /juliahub/ { + proxy_pass https://us-east.storage.juliahub.com/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + # https://mirror.iscas.ac.cn/lxc-images/ + location /lxc-images/ { + proxy_ssl_server_name on; + sub_filter_once off; + sub_filter "Index of /images" "Index of /lxc-images"; + proxy_pass https://us.lxd.images.canonical.com/images/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /zabbix/ { + proxy_pass https://mirror.iscas.ac.cn/zabbix/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /iina/ { + proxy_pass https://mirror.iscas.ac.cn/iina/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /influxdata/ { + proxy_pass https://mirror.iscas.ac.cn/influxdata/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /julia/ { + proxy_pass https://mirror.iscas.ac.cn/julia/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /julia-releases/ { + proxy_pass https://mirror.iscas.ac.cn/julia-releases/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /kde-neon/ { + proxy_pass https://mirror.iscas.ac.cn/kde-neon/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /kubernetes/ { + proxy_pass https://mirror.iscas.ac.cn/kubernetes/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /kunpeng/ { + proxy_pass https://mirror.iscas.ac.cn/kunpeng/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /loongson/ { + proxy_pass https://mirror.iscas.ac.cn/loongson/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /manjaro-arm/ { + proxy_pass https://mirror.iscas.ac.cn/manjaro-arm/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /postmarketOS/ { + proxy_pass https://mirror.iscas.ac.cn/postmarketOS/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /redhat/ { + proxy_pass https://mirror.iscas.ac.cn/redhat/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /ros/ { + proxy_pass https://mirror.iscas.ac.cn/ros/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /ros2/ { + proxy_pass https://mirror.iscas.ac.cn/ros2/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /rustup/ { + proxy_pass https://mirror.iscas.ac.cn/rustup/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /saltstack/ { + proxy_pass https://mirror.iscas.ac.cn/saltstack/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /percona/ { + proxy_pass https://mirror.iscas.ac.cn/percona/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /packman/ { + proxy_pass https://mirror.iscas.ac.cn/packman/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /openthos/ { + proxy_pass https://mirror.iscas.ac.cn/openthos/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /nixos-images/ { + proxy_pass https://mirror.iscas.ac.cn/nixos-images/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /nix/ { + proxy_pass https://mirror.iscas.ac.cn/nix/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /neurodebian/ { + proxy_pass https://mirror.iscas.ac.cn/neurodebian/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /mongodb/ { + proxy_pass https://mirror.iscas.ac.cn/mongodb/; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + # #禁止访问的文件或目录 + location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md) { + return 404; + } + + access_log /www/wwwlogs/pods.xie.ke.log; + error_log /www/wwwlogs/pods.xie.ke.error.log; +} diff --git a/images/nginx/conf/conf.d.example/reverse-proxy.conf b/images/nginx/conf/conf.d.example/reverse-proxy.conf new file mode 100644 index 00000000..b27dd5dd --- /dev/null +++ b/images/nginx/conf/conf.d.example/reverse-proxy.conf @@ -0,0 +1,29 @@ +server { + listen 80; + listen [::]:443 ssl http2; + server_name cn.mirrors.xieke.org mirrors.gz.xieke.org; + + http2_push_preload on; + + # 如果证书错误 导入根证书 + ssl_trusted_certificate /var/www/cert/fg.pem; + ssl_certificate /home/webs/ssl/mirrors.crt; + ssl_certificate_key /home/webs/ssl/mirrors.key; + include ssl.conf; + include header.conf; + + index index.html; + root /path/to/root; + access_log /var/logs/access.log combined; + error_log /var/logs/error.log error; + + location / { + proxy_pass https://www.examples.com/; + include proxy.conf; + } +} + +map $ssl_early_data $tls1_3_early_data { + "~." $ssl_early_data; + default ""; +} diff --git a/images/nginx/conf/conf.d/php.conf b/images/nginx/conf/conf.d/php.conf new file mode 100644 index 00000000..84f3de6a --- /dev/null +++ b/images/nginx/conf/conf.d/php.conf @@ -0,0 +1,49 @@ +server { + listen 80 default_server; + listen [::]:80 default_server; + server_name _; + root /data/public; + autoindex on; + index index.php index.html index.htm; + charset utf-8; + error_log /var/log/nginx/php.error.log debug; + access_log /var/log/nginx/php.access.log combined; + + include /etc/nginx/rewrite/thinkphp.conf; + + # location ~* \.php$ { + location ~ \.php$ { + # add_header X-Power-By-Server "Boxs/0.0.1"; + add_header Server "Boxs/0.0.1"; + include fastcgi_params; + # try_files $uri =404; + # try_files $fastcgi_script_name =404; + fastcgi_pass php80:9000; + # 该指令集设置缓冲区的数量和大小,用于缓存从 FastCGI Server 接收到的数据。 + # 默认情况下,一个缓冲区的大小相当于一个页面的大小。根据平台的不同设置为4K/8K + fastcgi_buffers 16 128k; + fastcgi_buffer_size 128k; + fastcgi_busy_buffers_size 256k; + fastcgi_temp_file_write_size 256k; + client_body_buffer_size 1024k; + fastcgi_send_timeout 180; + fastcgi_read_timeout 180; + fastcgi_index index.php; + fastcgi_param TIDEWAYS_SAMPLERATE "25"; + fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param SCRIPT_NAME $fastcgi_script_name; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param QUERY_STRING $query_string; + fastcgi_param REQUEST_METHOD $request_method; + fastcgi_param CONTENT_TYPE $content_type; + fastcgi_param CONTENT_LENGTH $content_length; + # fastcgi_param PHP_VALUE open_basedir=$document_root:/tmp/:/proc/; + # fastcgi_split_path_info ^(.+\.php)(/.+)$; + # fastcgi_split_path_info ^(.+?\.php)(/.*)$; + } + + # You may need this to prevent return 404 recursion. + location = /404.html { + internal; + } +} diff --git a/images/nginx/conf/dhparam.pem b/images/nginx/conf/dhparam.pem new file mode 100644 index 00000000..289909d0 --- /dev/null +++ b/images/nginx/conf/dhparam.pem @@ -0,0 +1,8 @@ +-----BEGIN DH PARAMETERS----- +MIIBCAKCAQEAhzV5kG71g5FxDN+x3g9P4Dt/0cZny1CWi5k6oUBLQnFbdOlZGDh0 +HFeK/I5p3LzMh40/vJf/01h0mDEsm95QuKqPmeQglSKH6awBGsCpZijUTiAoBBWC +GEzjp6zeT1blx/mXdp5lucicEXUuTo1TnGNdHMQvjoF+BZSYn8BvhoMzUBgg4HBu +YCnTZaqCVaLWManGhk1GtF2QNWNf2T4Vq1HJmxBfh12atEn1JoATGzODq1ocykiX +D/eUKzjc9wxfqSnoLSA2AlGE21TBJXM6YopJF/R63mGyGuY5aZkBQYclfsigQm/2 +xz4c7+OwSk1RIgCFV5Hj+OMkRfN0eFL9SwIBAg== +-----END DH PARAMETERS----- diff --git a/images/nginx/conf/fastcgi_params b/images/nginx/conf/fastcgi_params new file mode 100644 index 00000000..a4fdcb54 --- /dev/null +++ b/images/nginx/conf/fastcgi_params @@ -0,0 +1,27 @@ +fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; +fastcgi_param QUERY_STRING $query_string; +fastcgi_param REQUEST_METHOD $request_method; +fastcgi_param CONTENT_TYPE $content_type; +fastcgi_param CONTENT_LENGTH $content_length; + +fastcgi_param SCRIPT_NAME $fastcgi_script_name; +fastcgi_param REQUEST_URI $request_uri; +fastcgi_param DOCUMENT_URI $document_uri; +fastcgi_param DOCUMENT_ROOT $document_root; +fastcgi_param SERVER_PROTOCOL $server_protocol; +fastcgi_param REQUEST_SCHEME $scheme; +fastcgi_param HTTPS $https if_not_empty; + +fastcgi_param GATEWAY_INTERFACE CGI/1.1; +fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; + +fastcgi_param REMOTE_ADDR $remote_addr; +fastcgi_param REMOTE_PORT $remote_port; +fastcgi_param SERVER_ADDR $server_addr; +fastcgi_param SERVER_PORT $server_port; +fastcgi_param SERVER_NAME $server_name; + +fastcgi_param HTTPS $https if_not_empty; + +# PHP only, required if PHP was built with --enable-force-cgi-redirect +fastcgi_param REDIRECT_STATUS 200; diff --git a/images/nginx/conf/logrotate.conf b/images/nginx/conf/logrotate.conf new file mode 100644 index 00000000..7ba133f9 --- /dev/null +++ b/images/nginx/conf/logrotate.conf @@ -0,0 +1,14 @@ +/var/log/nginx/*.log { + daily + missingok + rotate 32 + compress + delaycompress + nodateext + notifempty + create 644 www-data root + sharedscripts + postrotate + [ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid` + endscript +} diff --git a/images/nginx/conf/mime.types b/images/nginx/conf/mime.types new file mode 100644 index 00000000..29612569 --- /dev/null +++ b/images/nginx/conf/mime.types @@ -0,0 +1,97 @@ + +types { + text/html html htm shtml; + text/css css; + text/xml xml; + image/gif gif; + image/jpeg jpeg jpg; + application/javascript js; + application/atom+xml atom; + application/rss+xml rss; + + text/mathml mml; + text/plain txt; + text/vnd.sun.j2me.app-descriptor jad; + text/vnd.wap.wml wml; + text/x-component htc; + + image/png png; + image/svg+xml svg svgz; + image/tiff tif tiff; + image/vnd.wap.wbmp wbmp; + image/webp webp; + image/x-icon ico; + image/x-jng jng; + image/x-ms-bmp bmp; + + font/woff woff; + font/woff2 woff2; + + application/java-archive jar war ear; + application/json json; + application/mac-binhex40 hqx; + application/msword doc; + application/pdf pdf; + application/postscript ps eps ai; + application/rtf rtf; + application/vnd.apple.mpegurl m3u8; + application/vnd.google-earth.kml+xml kml; + application/vnd.google-earth.kmz kmz; + application/vnd.ms-excel xls; + application/vnd.ms-fontobject eot; + application/vnd.ms-powerpoint ppt; + application/vnd.oasis.opendocument.graphics odg; + application/vnd.oasis.opendocument.presentation odp; + application/vnd.oasis.opendocument.spreadsheet ods; + application/vnd.oasis.opendocument.text odt; + application/vnd.openxmlformats-officedocument.presentationml.presentation + pptx; + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + xlsx; + application/vnd.openxmlformats-officedocument.wordprocessingml.document + docx; + application/vnd.wap.wmlc wmlc; + application/x-7z-compressed 7z; + application/x-cocoa cco; + application/x-java-archive-diff jardiff; + application/x-java-jnlp-file jnlp; + application/x-makeself run; + application/x-perl pl pm; + application/x-pilot prc pdb; + application/x-rar-compressed rar; + application/x-redhat-package-manager rpm; + application/x-sea sea; + application/x-shockwave-flash swf; + application/x-stuffit sit; + application/x-tcl tcl tk; + application/x-x509-ca-cert der pem crt; + application/x-xpinstall xpi; + application/xhtml+xml xhtml; + application/xspf+xml xspf; + application/zip zip; + + application/octet-stream bin exe dll; + application/octet-stream deb; + application/octet-stream dmg; + application/octet-stream iso img; + application/octet-stream msi msp msm; + + audio/midi mid midi kar; + audio/mpeg mp3; + audio/ogg ogg; + audio/x-m4a m4a; + audio/x-realaudio ra; + + video/3gpp 3gpp 3gp; + video/mp2t ts; + video/mp4 mp4; + video/mpeg mpeg mpg; + video/quicktime mov; + video/webm webm; + video/x-flv flv; + video/x-m4v m4v; + video/x-mng mng; + video/x-ms-asf asx asf; + video/x-ms-wmv wmv; + video/x-msvideo avi; +} diff --git a/images/nginx/conf/nginx.conf b/images/nginx/conf/nginx.conf new file mode 100644 index 00000000..f629594f --- /dev/null +++ b/images/nginx/conf/nginx.conf @@ -0,0 +1,197 @@ +user nginx; +# daemon off; +# 一般设置为 cpu * 2 +# Set number of worker processes automatically based on number of CPU cores. +worker_processes auto; +worker_cpu_affinity auto; +# worker_cpu_affinity 01 10 01 10; +pid /run/nginx/nginx.pid; +worker_rlimit_nofile 51200; + +# Enables the use of JIT for regular expressions to speed-up their processing. +pcre_jit on; + +# Includes files with directives to load dynamic modules. +include /etc/nginx/modules/*.conf; +include /etc/nginx/modules-enabled/*.conf; + +events { + use epoll; + multi_accept on; + # The maximum number of simultaneous connections that can be opened by + # a worker process. + worker_connections 51200; +} + +http { + charset utf-8; + # Includes mapping of file name extensions to MIME types of responses and defines the default type. + include /etc/nginx/mime.types; + #include proxy.conf; + #include luawaf.conf; + + # Name servers used to resolve names of upstream servers into addresses. + # It's also needed when using tcpsocket and udpsocket in Lua modules. + #resolver 1.1.1.1 1.0.0.1 2606:4700:4700::1111 2606:4700:4700::1001; + + default_type application/octet-stream; + + port_in_redirect off; + output_buffers 4 32k; + expires 0; + connection_pool_size 256; + reset_timedout_connection on; + request_pool_size 32k; + + # Name servers used to resolve names of upstream servers into addresses. + # It's also needed when using tcpsocket and udpsocket in Lua modules. + #resolver 208.67.222.222 208.67.220.220; + + server_name_in_redirect off; + server_names_hash_max_size 2048; + server_names_hash_bucket_size 128; + large_client_header_buffers 4 32k; + + # Specifies the maximum accepted body size of a client request, as + # indicated by the request header Content-Length. If the stated content + # length is greater than this size, then the client receives the HTTP + # error code 413. Set to 0 to disable. + client_max_body_size 128m; + client_header_buffer_size 32k; + client_body_timeout 10; + client_body_buffer_size 10m; + client_header_timeout 10; + + # Sendfile copies data between one FD and other from within the kernel, + # which is more efficient than read() + write(). + sendfile on; + send_timeout 5; + types_hash_max_size 2048; + + # Causes nginx to attempt to send its HTTP response head in one packet, + # instead of using partial frames. Default is 'off'. + tcp_nopush on; + + # Timeout for keep-alive connections. Server will close connections after this time. + keepalive_timeout 60; + + # Don't buffer data-sends (disable Nagle algorithm). + # Good for sending frequent small bursts of data in real time. + tcp_nodelay on; + + # FastCGI + fastcgi_connect_timeout 5; + fastcgi_send_timeout 120s; + fastcgi_read_timeout 120s; + + # 创建 8 个大小为 4K 的缓冲区 + fastcgi_buffers 64 128k; + fastcgi_buffer_size 128k; + fastcgi_busy_buffers_size 128k; + fastcgi_temp_file_write_size 256k; + fastcgi_intercept_errors on; + fastcgi_hide_header X-Powered-By; + + # SSL Settings + # Dropping SSLv3, ref: POODLE + # Enables the specified protocols. Default is TLSv1 TLSv1.1 TLSv1.2. + # TIP: If you're not obligated to support ancient clients, remove TLSv1.1. + ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; + + # Path of the file with Diffie-Hellman parameters for EDH ciphers. + # TIP: Generate with: `openssl dhparam -out /etc/ssl/nginx/dh2048.pem 2048` + #ssl_dhparam /etc/ssl/nginx/dh2048.pem; + + # Specifies that our cipher suits should be preferred over client ciphers. + ssl_prefer_server_ciphers on; + + # Enables a shared SSL cache with size that can hold around 8000 sessions. + ssl_session_cache shared:SSL:2m; + + # Specifies a time during which a client may reuse the session parameters. + # Default is '5m'. + ssl_session_timeout 1h; + + # Disable TLS session tickets (they are insecure). Default is 'on'. + ssl_session_tickets off; + + ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS'; + + # Serve brotli compressed CSS, JS, HTML, SVG, ICS and JSON files if they exist + # and if the client accepts br encoding. + # brotli-compressed resources. + # https://github.com/eustas/ngx_brotli/#brotli_static + # brotli_static on; + # brotli on; + # brotli_types text/plain text/css application/json application/javascript application/x-javascript text/javascript; + # brotli_comp_level 4; + + # Enable gzipping of responses. + gzip on; + gzip_min_length 1k; + gzip_buffers 16 8k; + # 压缩响应所需的请求的最低 HTTP 版本 + gzip_http_version 1.1; + # 响应的 gzip 压缩level。可接受的值在 1 到 9 的范围内。 + gzip_comp_level 6; + gzip_types text/vnd.wap.wml text/javascript text/xml text/plain text/css application/json application/javascript application/x-javascript application/xml application/xml+rss application/xhtml+xml; + + # Set the Vary HTTP header as defined in the RFC 2616. + # Default is 'off'. + gzip_vary on; + # gzip_proxied any; + gzip_proxied expired no-cache no-store private auth; + # gzip_disable "MSIE [1-6]\."; + gzip_disable "MSIE [1-6]\.(?!.*SV1)"; + + # Enable checking the existence of precompressed files. + # gzip_static on; + + limit_conn_zone $binary_remote_addr zone=perip:10m; + limit_conn_zone $server_name zone=perserver:10m; + + # Don't tell nginx version to clients. Default is 'on'. + server_tokens off; + # more_set_headers 'Server: My Very Own Server'; + more_clear_headers 'Server: My Very Own Server'; + + # Disabled for issue https://github.com/laradock/laradock/issues/619 + # open_file_cache off; + open_file_cache max=10000 inactive=20s; + open_file_cache_valid 30s; + open_file_cache_min_uses 2; + open_file_cache_errors on; + + # Specifies the main log format. + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + # 'Accept: "$http_accept" ' 'Authorization: "$http_authorization" '; + + # Helper variable for proxying websockets. + map $http_upgrade $connection_upgrade { + default upgrade; + '' close; + } + + # Sets the path, format, and configuration for a buffered log write. + # access_log /var/log/nginx/access.log main; + access_log /var/log/nginx/access.log combined; + + # Configures default error logger. + # options debug error warn crit (error) main access (access_log) or output to /dev/stderr /dev/stdout + # warn crit + error_log /var/log/nginx/error.log debug; + + # Includes files with directives to load dynamic modules. + include /etc/nginx/vhost.d/*.conf; + + # Includes virtual hosts configs. + # Alpinelinux default config + # include /etc/nginx/http.d/*.conf; + include /etc/nginx/conf.d/*.conf; +} + +# TIP: Uncomment if you use stream module. +#include /etc/nginx/stream.conf; diff --git a/images/nginx/conf/rewrite/DEDECMS.conf b/images/nginx/conf/rewrite/DEDECMS.conf new file mode 100644 index 00000000..c17330ed --- /dev/null +++ b/images/nginx/conf/rewrite/DEDECMS.conf @@ -0,0 +1,10 @@ +location / { + rewrite "^/index.html$" /index.php last; + rewrite "^/list-([0-9]+)\.html$" /plus/list.php?tid=$1 last; + rewrite "^/list-([0-9]+)-([0-9]+)-([0-9]+)\.html$" /plus/list.php?tid=$1&totalresult=$2&PageNo=$3 last; + rewrite "^/view-([0-9]+)-1\.html$" /plus/view.php?arcID=$1 last; + rewrite "^/view-([0-9]+)-([0-9]+)\.html$" /plus/view.php?aid=$1&pageno=$2 last; + rewrite "^/tags.html$" /tags.php last; + rewrite "^/tag-([0-9]+)-([0-9]+)\.html$" /tags.php?/$1/$2/ last; + break; +} \ No newline at end of file diff --git a/images/nginx/conf/rewrite/Discuz_7.conf b/images/nginx/conf/rewrite/Discuz_7.conf new file mode 100644 index 00000000..65ba7c90 --- /dev/null +++ b/images/nginx/conf/rewrite/Discuz_7.conf @@ -0,0 +1,5 @@ +rewrite ^/archiver/((fid|tid)-[\w\-]+\.html)$ /archiver/index.php?$1 last; +rewrite ^/forum-([0-9]+)-([0-9]+)\.html$ /forumdisplay.php?fid=$1&page=$2 last; +rewrite ^/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ /viewthread.php?tid=$1&extra=page\%3D$3&page=$2 last; +rewrite ^/space-(username|uid)-(.+)\.html$ /space.php?$1=$2 last; +rewrite ^/tag-(.+)\.html$ /tag.php?name=$1 last; \ No newline at end of file diff --git a/images/nginx/conf/rewrite/Discuz_X.conf b/images/nginx/conf/rewrite/Discuz_X.conf new file mode 100644 index 00000000..c4593234 --- /dev/null +++ b/images/nginx/conf/rewrite/Discuz_X.conf @@ -0,0 +1,12 @@ +location / { +rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last; +rewrite ^([^\.]*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3 last; +rewrite ^([^\.]*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last; +rewrite ^([^\.]*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last; +rewrite ^([^\.]*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3 last; +rewrite ^([^\.]*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3 last; +rewrite ^([^\.]*)/([a-z]+)-(.+)\.html$ $1/$2.php?rewrite=$3 last; +if (!-e $request_filename) { +return 404; +} +} \ No newline at end of file diff --git a/images/nginx/conf/rewrite/PHPWind.conf b/images/nginx/conf/rewrite/PHPWind.conf new file mode 100644 index 00000000..388af90d --- /dev/null +++ b/images/nginx/conf/rewrite/PHPWind.conf @@ -0,0 +1,4 @@ +location / { + rewrite ^(.*)-htm-(.*)$ $1.php?$2 last; + rewrite ^(.*)/simple/([a-z0-9\_]+\.html)$ $1/simple/index.php?$2 last; + } \ No newline at end of file diff --git a/images/nginx/conf/rewrite/codeigniter.conf b/images/nginx/conf/rewrite/codeigniter.conf new file mode 100644 index 00000000..2ef62301 --- /dev/null +++ b/images/nginx/conf/rewrite/codeigniter.conf @@ -0,0 +1,3 @@ +location / { + try_files $uri $uri/ /index.php$is_args$args; +} diff --git a/images/nginx/conf/rewrite/dabr.conf b/images/nginx/conf/rewrite/dabr.conf new file mode 100644 index 00000000..5ac08629 --- /dev/null +++ b/images/nginx/conf/rewrite/dabr.conf @@ -0,0 +1,5 @@ +location / { + if (!-e $request_filename) { + rewrite ^/(.*)$ /index.php?q=$1 last; + } +} \ No newline at end of file diff --git a/images/nginx/conf/rewrite/discuz.conf b/images/nginx/conf/rewrite/discuz.conf new file mode 100644 index 00000000..b82109b4 --- /dev/null +++ b/images/nginx/conf/rewrite/discuz.conf @@ -0,0 +1,7 @@ +location / { + rewrite ^/archiver/((fid|tid)-[\w\-]+\.html)$ /archiver/index.php?$1 last; + rewrite ^/forum-([0-9]+)-([0-9]+)\.html$ /forumdisplay.php?fid=$1&page=$2 last; + rewrite ^/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ /viewthread.php?tid=$1&extra=page%3D$3&page=$2 last; + rewrite ^/space-(username|uid)-(.+)\.html$ /space.php?$1=$2 last; + rewrite ^/tag-(.+)\.html$ /tag.php?name=$1 last; +} \ No newline at end of file diff --git a/images/nginx/conf/rewrite/discuzx.conf b/images/nginx/conf/rewrite/discuzx.conf new file mode 100644 index 00000000..c1ebd8b4 --- /dev/null +++ b/images/nginx/conf/rewrite/discuzx.conf @@ -0,0 +1,12 @@ +rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last; +rewrite ^([^\.]*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3 last; +rewrite ^([^\.]*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last; +rewrite ^([^\.]*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last; +rewrite ^([^\.]*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3 last; +rewrite ^([^\.]*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3 last; +rewrite ^([^\.]*)/blog-([0-9]+)-([0-9]+)\.html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3 last; +rewrite ^([^\.]*)/(fid|tid)-([0-9]+)\.html$ $1/index.php?action=$2&value=$3 last; +rewrite ^([^\.]*)/([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ $1/plugin.php?id=$2:$3 last; +if (!-e $request_filename) { + return 404; +} \ No newline at end of file diff --git a/images/nginx/conf/rewrite/discuzx2.conf b/images/nginx/conf/rewrite/discuzx2.conf new file mode 100644 index 00000000..61059e21 --- /dev/null +++ b/images/nginx/conf/rewrite/discuzx2.conf @@ -0,0 +1,14 @@ +location /bbs/ { + rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last; + rewrite ^([^\.]*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3 last; + rewrite ^([^\.]*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last; + rewrite ^([^\.]*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last; + rewrite ^([^\.]*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3 last; + rewrite ^([^\.]*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3 last; + rewrite ^([^\.]*)/blog-([0-9]+)-([0-9]+)\.html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3 last; + rewrite ^([^\.]*)/(fid|tid)-([0-9]+)\.html$ $1/index.php?action=$2&value=$3 last; + rewrite ^([^\.]*)/([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ $1/plugin.php?id=$2:$3 last; + if (!-e $request_filename) { + return 404; + } +} \ No newline at end of file diff --git a/images/nginx/conf/rewrite/drupal.conf b/images/nginx/conf/rewrite/drupal.conf new file mode 100644 index 00000000..f1c70487 --- /dev/null +++ b/images/nginx/conf/rewrite/drupal.conf @@ -0,0 +1,3 @@ +if (!-e $request_filename) { + rewrite ^/(.*)$ /index.php?q=$1 last; +} \ No newline at end of file diff --git a/images/nginx/conf/rewrite/ecshop.conf b/images/nginx/conf/rewrite/ecshop.conf new file mode 100644 index 00000000..3574daa7 --- /dev/null +++ b/images/nginx/conf/rewrite/ecshop.conf @@ -0,0 +1,32 @@ +if (!-e $request_filename) +{ +rewrite "^/index\.html" /index.php last; +rewrite "^/category$" /index.php last; +rewrite "^/feed-c([0-9]+)\.xml$" /feed.php?cat=$1 last; +rewrite "^/feed-b([0-9]+)\.xml$" /feed.php?brand=$1 last; +rewrite "^/feed\.xml$" /feed.php last; +rewrite "^/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /category.php?id=$1&brand=$2&price_min=$3&price_max=$4&filter_attr=$5&page=$6&sort=$7&order=$8 last; +rewrite "^/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)(.*)\.html$" /category.php?id=$1&brand=$2&price_min=$3&price_max=$4&filter_attr=$5 last; +rewrite "^/category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /category.php?id=$1&brand=$2&page=$3&sort=$4&order=$5 last; +rewrite "^/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html$" /category.php?id=$1&brand=$2&page=$3 last; +rewrite "^/category-([0-9]+)-b([0-9]+)(.*)\.html$" /category.php?id=$1&brand=$2 last; +rewrite "^/category-([0-9]+)(.*)\.html$" /category.php?id=$1 last; +rewrite "^/goods-([0-9]+)(.*)\.html" /goods.php?id=$1 last; +rewrite "^/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /article_cat.php?id=$1&page=$2&sort=$3&order=$4 last; +rewrite "^/article_cat-([0-9]+)-([0-9]+)(.*)\.html$" /article_cat.php?id=$1&page=$2 last; +rewrite "^/article_cat-([0-9]+)(.*)\.html$" /article_cat.php?id=$1 last; +rewrite "^/article-([0-9]+)(.*)\.html$" /article.php?id=$1 last; +rewrite "^/brand-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)\.html" /brand.php?id=$1&cat=$2&page=$3&sort=$4&order=$5 last; +rewrite "^/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.html" /brand.php?id=$1&cat=$2&page=$3 last; +rewrite "^/brand-([0-9]+)-c([0-9]+)(.*)\.html" /brand.php?id=$1&cat=$2 last; +rewrite "^/brand-([0-9]+)(.*)\.html" /brand.php?id=$1 last; +rewrite "^/tag-(.*)\.html" /search.php?keywords=$1 last; +rewrite "^/snatch-([0-9]+)\.html$" /snatch.php?id=$1 last; +rewrite "^/group_buy-([0-9]+)\.html$" /group_buy.php?act=view&id=$1 last; +rewrite "^/auction-([0-9]+)\.html$" /auction.php?act=view&id=$1 last; +rewrite "^/exchange-id([0-9]+)(.*)\.html$" /exchange.php?id=$1&act=view last; +rewrite "^/exchange-([0-9]+)-min([0-9]+)-max([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /exchange.php?cat_id=$1&integral_min=$2&integral_max=$3&page=$4&sort=$5&order=$6 last; +rewrite ^/exchange-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /exchange.php?cat_id=$1&page=$2&sort=$3&order=$4 last; +rewrite "^/exchange-([0-9]+)-([0-9]+)(.*)\.html$" /exchange.php?cat_id=$1&page=$2 last; +rewrite "^/exchange-([0-9]+)(.*)\.html$" /exchange.php?cat_id=$1 last; +} \ No newline at end of file diff --git a/images/nginx/conf/rewrite/joomla.conf b/images/nginx/conf/rewrite/joomla.conf new file mode 100644 index 00000000..29ab571d --- /dev/null +++ b/images/nginx/conf/rewrite/joomla.conf @@ -0,0 +1,3 @@ +location / { + try_files $uri $uri/ /index.php?$args; +} \ No newline at end of file diff --git a/images/nginx/conf/rewrite/laravel.conf b/images/nginx/conf/rewrite/laravel.conf new file mode 100644 index 00000000..da4c6747 --- /dev/null +++ b/images/nginx/conf/rewrite/laravel.conf @@ -0,0 +1,3 @@ +location / { + try_files $uri $uri/ /index.php?$query_string; +} \ No newline at end of file diff --git a/images/nginx/conf/rewrite/none.conf b/images/nginx/conf/rewrite/none.conf new file mode 100644 index 00000000..e69de29b diff --git a/images/nginx/conf/rewrite/phpcms.conf b/images/nginx/conf/rewrite/phpcms.conf new file mode 100644 index 00000000..83a34446 --- /dev/null +++ b/images/nginx/conf/rewrite/phpcms.conf @@ -0,0 +1,8 @@ +location / { +rewrite ^/caipu-([0-9]+)-([0-9]+)-([0-9]+).html /index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3 last; +rewrite ^/content-([0-9]+)-([0-9]+)-([0-9]+).html /index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3 last; +rewrite ^/list-([0-9]+)-([0-9]+).html /index.php?m=content&c=index&a=lists&catid=$1&page=$2 last; +rewrite ^/tag-([^\.]*)-([0-9]+)-([0-9]+).html /index.php?m=content&c=tag&catid=$2&tag=$1&page=$3 last; +rewrite ^/comment-([0-9]+)-([0-9]+)-([0-9]+).html /index.php?m=comment&c=index&a=init&commentid=content_$1-$2-$3 last; +rewrite ^/([^\.]*).html /index.php?m=member&c=index&a=$1 last; +} \ No newline at end of file diff --git a/images/nginx/conf/rewrite/sablog.conf b/images/nginx/conf/rewrite/sablog.conf new file mode 100644 index 00000000..251861a9 --- /dev/null +++ b/images/nginx/conf/rewrite/sablog.conf @@ -0,0 +1,14 @@ +location / { + rewrite ^/date/([0-9]{6})/?([0-9]+)?/?$ /index.php?action=article&setdate=$1&page=$2 last; + rewrite ^/page/([0-9]+)?/?$ /index.php?action=article&page=$1 last; + rewrite ^/category/([0-9]+)/?([0-9]+)?/?$ /index.php?action=article&cid=$1&page=$2 last; + rewrite ^/category/([^/]+)/?([0-9]+)?/?$ /index.php?action=article&curl=$1&page=$2 last; + rewrite ^/(archives|search|article|links)/?$ /index.php?action=$1 last; + rewrite ^/(comments|tagslist|trackbacks|article)/?([0-9]+)?/?$ /index.php?action=$1&page=$2 last; + rewrite ^/tag/([^/]+)/?([0-9]+)?/?$ /index.php?action=article&item=$1&page=$2 last; + rewrite ^/archives/([0-9]+)/?([0-9]+)?/?$ /index.php?action=show&id=$1&page=$2 last; + rewrite ^/rss/([^/]+)/?$ /rss.php?url=$1 last; + rewrite ^/user/([^/]+)/?([0-9]+)?/?$ /index.php?action=article&user=$1&page=$2 last; + rewrite sitemap.xml sitemap.php last; + rewrite ^(.*)/([0-9a-zA-Z\-\_]+)/?([0-9]+)?/?$ $1/index.php?action=show&alias=$2&page=$3 last; + } \ No newline at end of file diff --git a/images/nginx/conf/rewrite/shopex.conf b/images/nginx/conf/rewrite/shopex.conf new file mode 100644 index 00000000..f57463c1 --- /dev/null +++ b/images/nginx/conf/rewrite/shopex.conf @@ -0,0 +1,5 @@ +location / { +if (!-e $request_filename) { +rewrite ^/(.+\.(html|xml|json|htm|php|jsp|asp|shtml))$ /index.php?$1 last; +} +} \ No newline at end of file diff --git a/images/nginx/conf/rewrite/thinkphp.conf b/images/nginx/conf/rewrite/thinkphp.conf new file mode 100644 index 00000000..f72172e8 --- /dev/null +++ b/images/nginx/conf/rewrite/thinkphp.conf @@ -0,0 +1,6 @@ +location / { + if (!-e $request_filename) { + rewrite ^(.*)$ /index.php?s=/$1 last; + break; + } +} \ No newline at end of file diff --git a/images/nginx/conf/rewrite/typecho.conf b/images/nginx/conf/rewrite/typecho.conf new file mode 100644 index 00000000..b108535a --- /dev/null +++ b/images/nginx/conf/rewrite/typecho.conf @@ -0,0 +1,3 @@ +if (!-e $request_filename) { + rewrite ^(.*)$ /index.php$1 last; +} diff --git a/images/nginx/conf/rewrite/typecho2.conf b/images/nginx/conf/rewrite/typecho2.conf new file mode 100644 index 00000000..22397d84 --- /dev/null +++ b/images/nginx/conf/rewrite/typecho2.conf @@ -0,0 +1,5 @@ +location /typecho/ { + if (!-e $request_filename) { + rewrite ^(.*)$ /typecho/index.php$1 last; + } +} diff --git a/images/nginx/conf/rewrite/wordpress.conf b/images/nginx/conf/rewrite/wordpress.conf new file mode 100644 index 00000000..4b4f1ed5 --- /dev/null +++ b/images/nginx/conf/rewrite/wordpress.conf @@ -0,0 +1,6 @@ +location / { + try_files $uri $uri/ /index.php?$args; +} + +# Add trailing slash to */wp-admin requests. +rewrite /wp-admin$ $scheme://$host$uri/ permanent; \ No newline at end of file diff --git a/images/nginx/conf/rewrite/wp2.conf b/images/nginx/conf/rewrite/wp2.conf new file mode 100644 index 00000000..9d26706b --- /dev/null +++ b/images/nginx/conf/rewrite/wp2.conf @@ -0,0 +1,6 @@ +location /wp/ { + try_files $uri $uri/ /wp/index.php?$args; +} + +# Add trailing slash to */wp-admin requests. +rewrite /wp-admin$ $scheme://$host$uri/ permanent; \ No newline at end of file diff --git a/images/nginx/conf/rewrite/yii2.conf b/images/nginx/conf/rewrite/yii2.conf new file mode 100644 index 00000000..39c937eb --- /dev/null +++ b/images/nginx/conf/rewrite/yii2.conf @@ -0,0 +1,4 @@ +location / { + # Redirect everything that isn't a real file to index.php + try_files $uri $uri/ /index.php$is_args$args; +} \ No newline at end of file diff --git a/images/nginx/conf/scgi_params b/images/nginx/conf/scgi_params new file mode 100644 index 00000000..df545cdb --- /dev/null +++ b/images/nginx/conf/scgi_params @@ -0,0 +1,16 @@ +scgi_param REQUEST_METHOD $request_method; +scgi_param REQUEST_URI $request_uri; +scgi_param QUERY_STRING $query_string; +scgi_param CONTENT_TYPE $content_type; + +scgi_param DOCUMENT_URI $document_uri; +scgi_param DOCUMENT_ROOT $document_root; +scgi_param SCGI 1; +scgi_param SERVER_PROTOCOL $server_protocol; +scgi_param REQUEST_SCHEME $scheme; +scgi_param HTTPS $https if_not_empty; + +scgi_param REMOTE_ADDR $remote_addr; +scgi_param REMOTE_PORT $remote_port; +scgi_param SERVER_PORT $server_port; +scgi_param SERVER_NAME $server_name; \ No newline at end of file diff --git a/images/nginx/conf/uwsgi_params b/images/nginx/conf/uwsgi_params new file mode 100644 index 00000000..d26f2ff2 --- /dev/null +++ b/images/nginx/conf/uwsgi_params @@ -0,0 +1,16 @@ +uwsgi_param QUERY_STRING $query_string; +uwsgi_param REQUEST_METHOD $request_method; +uwsgi_param CONTENT_TYPE $content_type; +uwsgi_param CONTENT_LENGTH $content_length; + +uwsgi_param REQUEST_URI $request_uri; +uwsgi_param PATH_INFO $document_uri; +uwsgi_param DOCUMENT_ROOT $document_root; +uwsgi_param SERVER_PROTOCOL $server_protocol; +uwsgi_param REQUEST_SCHEME $scheme; +uwsgi_param HTTPS $https if_not_empty; + +uwsgi_param REMOTE_ADDR $remote_addr; +uwsgi_param REMOTE_PORT $remote_port; +uwsgi_param SERVER_PORT $server_port; +uwsgi_param SERVER_NAME $server_name; \ No newline at end of file diff --git a/images/nginx/latest/Dockerfile b/images/nginx/latest/Dockerfile new file mode 100644 index 00000000..2182cc98 --- /dev/null +++ b/images/nginx/latest/Dockerfile @@ -0,0 +1,10 @@ +FROM ghcr.io/dockenv/alpine:edge +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" +ENV HOME_DIR=/home/$USER + +RUN apk add --no-cache nginx nginx-mod-http-brotli nginx-mod-http-cache-purge nginx-mod-http-dav-ext nginx-mod-http-geoip nginx-mod-http-geoip2 nginx-mod-http-js + +EXPOSE 80 + +CMD /usr/sbin/nginx && /usr/bin/tail -f /var/log/nginx/*.log diff --git a/images/node/12/Dockerfile b/images/node/12/Dockerfile new file mode 100644 index 00000000..2f8be34b --- /dev/null +++ b/images/node/12/Dockerfile @@ -0,0 +1,9 @@ +FROM ghcr.io/dockenv/alpine:3.12 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv \ + org.opencontainers.image.description='Node 12' + +RUN apk add --no-cache nodejs npm yarn + +CMD [ "node" ] diff --git a/images/node/14/Dockerfile b/images/node/14/Dockerfile new file mode 100644 index 00000000..2b03989e --- /dev/null +++ b/images/node/14/Dockerfile @@ -0,0 +1,9 @@ +FROM ghcr.io/dockenv/alpine:3.14 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv \ + org.opencontainers.image.description='Node 14' + +RUN apk add --no-cache nodejs npm yarn + +CMD [ "node" ] diff --git a/images/node/16/Dockerfile b/images/node/16/Dockerfile new file mode 100644 index 00000000..ed82ecc9 --- /dev/null +++ b/images/node/16/Dockerfile @@ -0,0 +1,9 @@ +FROM ghcr.io/dockenv/alpine:3.16 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv \ + org.opencontainers.image.description='Node 16' + +RUN apk add --no-cache nodejs npm yarn + +CMD [ "node" ] diff --git a/images/node/18/Dockerfile b/images/node/18/Dockerfile new file mode 100644 index 00000000..448b98be --- /dev/null +++ b/images/node/18/Dockerfile @@ -0,0 +1,9 @@ +FROM ghcr.io/dockenv/alpine:3.16 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv \ + org.opencontainers.image.description='Node 18' + +RUN apk add --no-cache nodejs-current npm yarn + +CMD [ "node" ] diff --git a/images/node/README.md b/images/node/README.md new file mode 100644 index 00000000..c1bfb6c8 --- /dev/null +++ b/images/node/README.md @@ -0,0 +1,21 @@ +## Node Js Run in Docker + +## Node 18 +- Node 18.2.0 +- npm 8.10.0 +- yarn 1.22.19 + +## Node 16 +- node 16.15 +- npm 8.10 +- yarn 1.22.19 + +## Node 14 +- Node 14.19.0 +- npm 7.17.0 +- yarn 1.22.10 + +## Node 12 +- node 12.22.12 +- npm 6.14.16 +- yarn 1.22.4 diff --git a/images/node/latest b/images/node/latest new file mode 120000 index 00000000..19c7bdba --- /dev/null +++ b/images/node/latest @@ -0,0 +1 @@ +16 \ No newline at end of file diff --git a/images/openeuler/20.09/Dockerfile b/images/openeuler/20.09/Dockerfile new file mode 100644 index 00000000..92933802 --- /dev/null +++ b/images/openeuler/20.09/Dockerfile @@ -0,0 +1,6 @@ +FROM openeuler/openeuler:20.09 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +CMD [ "bash" ] diff --git a/images/openeuler/21.09/Dockerfile b/images/openeuler/21.09/Dockerfile new file mode 100644 index 00000000..8dfca43e --- /dev/null +++ b/images/openeuler/21.09/Dockerfile @@ -0,0 +1,6 @@ +FROM openeuler/openeuler:21.09 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +CMD [ "bash" ] diff --git a/images/openeuler/22.03/Dockerfile b/images/openeuler/22.03/Dockerfile new file mode 100644 index 00000000..b1957706 --- /dev/null +++ b/images/openeuler/22.03/Dockerfile @@ -0,0 +1,6 @@ +FROM openeuler/openeuler:22.03 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +CMD [ "bash" ] diff --git a/images/openeuler/latest/Dockerfile b/images/openeuler/latest/Dockerfile new file mode 100644 index 00000000..b125be98 --- /dev/null +++ b/images/openeuler/latest/Dockerfile @@ -0,0 +1,6 @@ +FROM openeuler/openeuler:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +CMD [ "bash" ] diff --git a/images/openresty/latest/Dockerfile b/images/openresty/latest/Dockerfile new file mode 100644 index 00000000..cae96019 --- /dev/null +++ b/images/openresty/latest/Dockerfile @@ -0,0 +1,7 @@ +FROM openresty/openresty:alpine +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +STOPSIGNAL SIGQUIT +CMD ["/usr/local/openresty/bin/openresty", "-g", "daemon off;"] diff --git a/images/opensuse/Dockerfile b/images/opensuse/Dockerfile deleted file mode 100644 index 61a81173..00000000 --- a/images/opensuse/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM opensuse:latest - -CMD ["/bin/sh"] \ No newline at end of file diff --git a/images/opensuse/Dockerfile.leap b/images/opensuse/Dockerfile.leap deleted file mode 100644 index 2b55e2fd..00000000 --- a/images/opensuse/Dockerfile.leap +++ /dev/null @@ -1,3 +0,0 @@ -FROM opensuse:leap - -CMD ["/bin/sh"] \ No newline at end of file diff --git a/images/opensuse/Dockerfile.tumbleweed b/images/opensuse/Dockerfile.tumbleweed deleted file mode 100644 index bd57a169..00000000 --- a/images/opensuse/Dockerfile.tumbleweed +++ /dev/null @@ -1,3 +0,0 @@ -FROM opensuse:tumbleweed - -CMD ["/bin/sh"] \ No newline at end of file diff --git a/images/opensuse/leap/Dockerfile b/images/opensuse/leap/Dockerfile new file mode 100644 index 00000000..4d076452 --- /dev/null +++ b/images/opensuse/leap/Dockerfile @@ -0,0 +1,5 @@ +FROM opensuse/leap:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +CMD ['/bin/bash'] diff --git a/images/opensuse/tumbleweed/Dockerfile b/images/opensuse/tumbleweed/Dockerfile new file mode 100644 index 00000000..647f2e6c --- /dev/null +++ b/images/opensuse/tumbleweed/Dockerfile @@ -0,0 +1,5 @@ +FROM opensuse/tumbleweed:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +CMD ['/bin/bash'] diff --git a/images/oraclelinux/7-slim/Dockerfile b/images/oraclelinux/7-slim/Dockerfile new file mode 100644 index 00000000..0228634e --- /dev/null +++ b/images/oraclelinux/7-slim/Dockerfile @@ -0,0 +1,5 @@ +FROM oraclelinux:7-slim +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +CMD [ "/bash" ] diff --git a/images/oraclelinux/7/Dockerfile b/images/oraclelinux/7/Dockerfile new file mode 100644 index 00000000..67d2b3ef --- /dev/null +++ b/images/oraclelinux/7/Dockerfile @@ -0,0 +1,5 @@ +FROM oraclelinux:7 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +CMD [ "/bash" ] diff --git a/images/oraclelinux/8-slim/Dockerfile b/images/oraclelinux/8-slim/Dockerfile new file mode 100644 index 00000000..933e78d1 --- /dev/null +++ b/images/oraclelinux/8-slim/Dockerfile @@ -0,0 +1,5 @@ +FROM oraclelinux:8-slim +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +CMD [ "/bash" ] diff --git a/images/oraclelinux/8/Dockerfile b/images/oraclelinux/8/Dockerfile new file mode 100644 index 00000000..06cff682 --- /dev/null +++ b/images/oraclelinux/8/Dockerfile @@ -0,0 +1,5 @@ +FROM oraclelinux:8 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +CMD [ "/bash" ] diff --git a/images/oraclelinux/latest/Dockerfile b/images/oraclelinux/latest/Dockerfile new file mode 100644 index 00000000..06cff682 --- /dev/null +++ b/images/oraclelinux/latest/Dockerfile @@ -0,0 +1,5 @@ +FROM oraclelinux:8 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +CMD [ "/bash" ] diff --git a/images/owncloud/Dockerfile b/images/owncloud/Dockerfile deleted file mode 100644 index 567ae125..00000000 --- a/images/owncloud/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -#latest ownCloud in Docker! -FROM imxieke/php:latest -LABEL MAINTAINER="Sky" \ - MAIL="Sky@gfw.party" - -ENV NAME owncloud -RUN echo "==> Download NextCloud" \ - && apt update -y \ - && apt install -y wget unzip \ - && cd /tmp \ - && mkdir -p /tmp/${NAME} \ - && wget https://download.${NAME}.org/download/community/${NAME}-latest.zip -O /tmp/${NAME}.zip \ - && rm -fr /var/www/* \ - && unzip /tmp/${NAME}.zip -d /tmp/${NAME}/ \ - && mv /tmp/${NAME}/* /var/www/ \ - && rm -fr /tmp/* \ - && chmod 755 -R /var/www/ \ - && chown www-data:www-data -R /var/www \ - && apt purge -y wget unzip \ - && apt autoremove -y \ - && apt-get clean all \ - && rm -fr /var/lib/apt/lists/* - -EXPOSE 80 -CMD /bin/start.sh diff --git a/images/panel/Dockerfile.bt b/images/panel/Dockerfile.bt deleted file mode 100644 index a62d3bb9..00000000 --- a/images/panel/Dockerfile.bt +++ /dev/null @@ -1,13 +0,0 @@ -FROM registry.cn-hongkong.aliyuncs.com/imxieke/ubuntu:bionic -LABEL MAINTAINER="Cloudflying" \ - MAIL="oss@live.hk" - -ENV HOME=/home/${USER} -ADD scripts/install-bt.sh /tmp/build.sh - -RUN chmod +x /tmp/build.sh \ - && bash /tmp/build.sh \ - && rm -fr /tmp/* - -EXPOSE 8888 -CMD ["/bin/bash"] \ No newline at end of file diff --git a/images/panel/Dockerfile.bt6 b/images/panel/Dockerfile.bt6 deleted file mode 100644 index 2631dc4c..00000000 --- a/images/panel/Dockerfile.bt6 +++ /dev/null @@ -1,12 +0,0 @@ -FROM registry.cn-hongkong.aliyuncs.com/imxieke/debian:9.9 -LABEL MAINTAINER="Cloudflying" \ - MAIL="oss@live.hk" - -ADD scripts/bt6.sh /tmp/build.sh - -RUN chmod +x /tmp/build.sh \ - && bash /tmp/build.sh \ - && rm -fr /tmp/* - -EXPOSE 8888 -CMD ["/bin/bash"] diff --git a/images/panel/scripts/bt6.sh b/images/panel/scripts/bt6.sh deleted file mode 100644 index bd918e85..00000000 --- a/images/panel/scripts/bt6.sh +++ /dev/null @@ -1,458 +0,0 @@ -#!/bin/bash -PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin -export PATH -LANG=en_US.UTF-8 - -startTime=`date +%s` - -is64bit=`getconf LONG_BIT` - -echo " -+---------------------------------------------------------------------- -| Bt-WebPanel 6.x FOR Ubuntu/Debian -+---------------------------------------------------------------------- -| Copyright © 2015-2099 BT-SOFT(http://www.bt.cn) All rights reserved. -+---------------------------------------------------------------------- -| The WebPanel URL will be http://SERVER_IP:8888 when installed. -+---------------------------------------------------------------------- -" -# ln -sf bash /bin/sh - -DEPENDS="ruby lsb-release curl wget procps python python-pip python-dev python-imaging zip unzip openssl libssl-dev gcc libxml2 libxml2-dev libxslt zlib1g zlib1g-dev libjpeg-dev libpng-dev lsof libpcre3 libpcre3-dev cron" - -function depends() -{ - echo "=> Start Upgrade Software Source:" - apt update -y - for depend in ${DEPENDS}; do - apt install -y ${depend} # --force-yes - done -} -depends - -deepinSys=`cat /etc/issue` - -if [ `whoami` != "root" ];then - echo -e "\033[31mError: Please run the script with root privileges on Ubuntu, for example: sudo bash install.sh\033[0m"; - exit -fi - -#自动选择下载节点 -get_node_url(){ - nodes=(http://125.88.182.172:5880 http://103.224.251.67 http://128.1.164.196 http://download.bt.cn); - i=1; - if [ ! -f /bin/curl ];then - if [ -f /usr/local/curl/bin/curl ];then - ln -sf /usr/local/curl/bin/curl /bin/curl - fi - fi - for node in ${nodes[@]}; - do - start=`date +%s.%N` - result=`curl -sS --connect-timeout 3 -m 60 $node/check.txt` - if [ $result = 'True' ];then - end=`date +%s.%N` - start_s=`echo $start | cut -d '.' -f 1` - start_ns=`echo $start | cut -d '.' -f 2` - end_s=`echo $end | cut -d '.' -f 1` - end_ns=`echo $end | cut -d '.' -f 2` - time_micro=$(( (10#$end_s-10#$start_s)*1000000 + (10#$end_ns/1000 - 10#$start_ns/1000) )) - time_ms=$(($time_micro/1000)) - values[$i]=$time_ms; - urls[$time_ms]=$node - i=$(($i+1)) - fi - done - j=5000 - for n in ${values[@]}; - do - if [ $j -gt $n ];then - j=$n - fi - done - if [ $j = 5000 ];then - NODE_URL='http://download.bt.cn'; - else - NODE_URL=${urls[$j]} - fi - -} - -echo '---------------------------------------------'; -echo "Selected download node..."; -get_node_url -download_Url=$NODE_URL -echo "Download node: $download_Url"; -echo '---------------------------------------------'; -setup_path=/www -port='8888' -if [ -f $setup_path/server/panel/data/port.pl ];then - port=`cat $setup_path/server/panel/data/port.pl` -fi - -#apt-get install ntp ntpdate -y -#/etc/init.d/ntp stop -#update-rc.d ntp remove -#cat >>~/.profile<&1|awk '{print $2}') -pVersion=${tmp:0:3} - -function config_pip() -{ - mkdir -p ~/.pip && touch ~/.pip/pip.conf - echo "[global] -index-url = https://pypi.tuna.tsinghua.edu.cn/simple -[install] -trusted-host = https://pypi.tuna.tsinghua.edu.cn" > ~/.pip/pip.conf -} - -config_pip - -Install_pip() -{ - ispip=$(pip -V|grep python) - if [ "$ispip" == '' ];then - wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py - python get-pip.py - rm -f get-pip.py - ispip=$(pip -V|grep python) - if [ "$ispip" == '' ];then - apt install python-pip -y - fi - fi -} - -# pip install setuptools -Install_setuptools() -{ - if [ ! -f "/usr/bin/easy_install" ];then - wget -O setuptools-33.1.1.zip $download_Url/install/src/setuptools-33.1.1.zip -T 10 - unzip setuptools-33.1.1.zip - rm -f setuptools-33.1.1.zip - cd setuptools-33.1.1 - python setup.py install - cd .. - rm -rf setuptools-33.1.1 - fi - - if [ ! -f "/usr/bin/easy_install" ];then - echo '================================================='; - echo -e "\033[31msetuptools installation failed. \033[0m"; - exit; - fi -} - -Install_Pillow() -{ - isSetup=`python -m PIL 2>&1|grep package` - if [ "$isSetup" = "" ];then - wget -O Pillow-3.2.0.zip $download_Url/install/src/Pillow-3.2.0.zip -T 10 - unzip Pillow-3.2.0.zip - rm -f Pillow-3.2.0.zip - cd Pillow-3.2.0 - python setup.py install - cd .. - rm -rf Pillow-3.2.0 - fi - isSetup=`python -m PIL 2>&1|grep package` - if [ "$isSetup" = "" ];then - echo '================================================='; - echo -e "\033[31mPillow installation failed. \033[0m"; - exit; - fi -} - -Install_psutil() -{ - isSetup=`python -m psutil 2>&1|grep package` - if [ "$isSetup" = "" ];then - wget -O psutil-5.2.2.tar.gz $download_Url/install/src/psutil-5.2.2.tar.gz -T 10 - tar xvf psutil-5.2.2.tar.gz - rm -f psutil-5.2.2.tar.gz - cd psutil-5.2.2 - python setup.py install - cd .. - rm -rf psutil-5.2.2 - fi - isSetup=`python -m psutil 2>&1|grep package` - if [ "$isSetup" = "" ];then - echo '================================================='; - echo -e "\033[31mpsutil installation failed. \033[0m"; - exit; - fi -} - -Install_mysqldb() -{ - isSetup=`python -m MySQLdb 2>&1|grep package` - if [ "$isSetup" = "" ];then - wget -O MySQL-python-1.2.5.zip $download_Url/install/src/MySQL-python-1.2.5.zip -T 10 - unzip MySQL-python-1.2.5.zip - rm -f MySQL-python-1.2.5.zip - cd MySQL-python-1.2.5 - python setup.py install - cd .. - rm -rf MySQL-python-1.2.5 - fi - -} - -Install_chardet() -{ - isSetup=`python -m chardet 2>&1|grep package` - if [ "$isSetup" = "" ];then - wget -O chardet-2.3.0.tar.gz $download_Url/install/src/chardet-2.3.0.tar.gz -T 10 - tar xvf chardet-2.3.0.tar.gz - rm -f chardet-2.3.0.tar.gz - cd chardet-2.3.0 - python setup.py install - cd .. - rm -rf chardet-2.3.0 - fi - isSetup=`python -m chardet 2>&1|grep package` - if [ "$isSetup" = "" ];then - echo '================================================='; - echo -e "\033[31mchardet installation failed. \033[0m"; - exit; - fi -} - -Install_webpy() -{ - isSetup=`python -m web 2>&1|grep package` - if [ "$isSetup" = "" ];then - wget -O web.py-0.38.tar.gz $download_Url/install/src/web.py-0.38.tar.gz -T 10 - tar xvf web.py-0.38.tar.gz - rm -f web.py-0.38.tar.gz - cd web.py-0.38 - python setup.py install - cd .. - rm -rf web.py-0.38 - fi - - isSetup=`python -m web 2>&1|grep package` - if [ "$isSetup" = "" ];then - echo '================================================='; - echo -e "\033[31mweb.py installation failed. \033[0m"; - exit; - fi -} - -pipArg='' -apt install libffi-dev -y -Install_pip - -curl -Ss --connect-timeout 3 -m 60 http://download.bt.cn/install/pip_select.sh|bash -pip install --upgrade setuptools -pip install itsdangerous==0.24 -pip install paramiko==2.0.2 -pip install flask-socketio==3.0.2 -pip install python-socketio==2.1.2 -pip install Werkzeug==0.15.1 -for p_name in psutil chardet virtualenv Flask Flask-Session Flask-SocketIO flask-sqlalchemy Pillow gunicorn gevent-websocket requests; -do - pip install ${p_name} -done - -is_gevent=$(pip list|grep gevent) - -if [ "$is_gevent" = "" ];then - if [ -f /usr/bin/yum ];then - yum install python-gevent -y - else - apt install python-gevent -y - fi -fi - -pip install psutil chardet virtualenv Flask Flask-Session Flask-SocketIO flask-sqlalchemy Pillow gunicorn gevent-websocket paramiko -Install_Pillow -Install_psutil - -pip install gunicorn -if [ -f /www/server/mysql/bin/mysql ]; then - pip install mysql-python - Install_mysqldb -fi -Install_chardet - -mkdir -p $setup_path/server/panel/logs -mkdir -p $setup_path/server/panel/vhost/apache -mkdir -p $setup_path/server/panel/vhost/nginx -mkdir -p $setup_path/server/panel/vhost/rewrite -wget -O $setup_path/server/panel/certbot-auto $download_Url/install/certbot-auto.init -T 5 -chmod +x $setup_path/server/panel/certbot-auto - - -if [ -f '/etc/init.d/bt' ];then - /etc/init.d/bt stop -fi - -mkdir -p /www/server -mkdir -p /www/wwwroot -mkdir -p /www/wwwlogs -mkdir -p /www/backup/database -mkdir -p /www/backup/site - -wget -O panel.zip $download_Url/install/src/panel6.zip -T 10 -wget -O /etc/init.d/bt $download_Url/install/src/bt6.init -T 10 -if [ -f "$setup_path/server/panel/data/default.db" ];then - if [ -d "/$setup_path/server/panel/old_data" ];then - rm -rf $setup_path/server/panel/old_data - fi - mkdir -p $setup_path/server/panel/old_data - mv -f $setup_path/server/panel/data/default.db $setup_path/server/panel/old_data/default.db - mv -f $setup_path/server/panel/data/system.db $setup_path/server/panel/old_data/system.db - mv -f $setup_path/server/panel/data/aliossAs.conf $setup_path/server/panel/old_data/aliossAs.conf - mv -f $setup_path/server/panel/data/qiniuAs.conf $setup_path/server/panel/old_data/qiniuAs.conf - mv -f $setup_path/server/panel/data/iplist.txt $setup_path/server/panel/old_data/iplist.txt - mv -f $setup_path/server/panel/data/port.pl $setup_path/server/panel/old_data/port.pl - mv -f $setup_path/server/panel/data/admin_path.pl $setup_path/server/panel/old_data/admin_path.pl -fi - -unzip -o panel.zip -d $setup_path/server/ > /dev/null - -if [ -d "$setup_path/server/panel/old_data" ];then - mv -f $setup_path/server/panel/old_data/default.db $setup_path/server/panel/data/default.db - mv -f $setup_path/server/panel/old_data/system.db $setup_path/server/panel/data/system.db - mv -f $setup_path/server/panel/old_data/aliossAs.conf $setup_path/server/panel/data/aliossAs.conf - mv -f $setup_path/server/panel/old_data/qiniuAs.conf $setup_path/server/panel/data/qiniuAs.conf - mv -f $setup_path/server/panel/old_data/iplist.txt $setup_path/server/panel/data/iplist.txt - mv -f $setup_path/server/panel/old_data/port.pl $setup_path/server/panel/data/port.pl - mv -f $setup_path/server/panel/old_data/admin_path.pl $setup_path/server/panel/data/admin_path.pl - - if [ -d "/$setup_path/server/panel/old_data" ];then - rm -rf $setup_path/server/panel/old_data - fi -fi - -rm -f panel.zip - -if [ ! -f $setup_path/server/panel/tools.py ];then - echo -e "\033[31mERROR: Failed to download, please try again!\033[0m"; - echo '============================================' - exit; -fi - -rm -f $setup_path/server/panel/class/*.pyc -rm -f $setup_path/server/panel/*.pyc -python -m compileall $setup_path/server/panel -#rm -f $setup_path/server/panel/class/*.py -#rm -f $setup_path/server/panel/*.py - -chmod 777 /tmp -chmod +x /etc/init.d/bt -ln -sf /etc/init.d/bt /usr/bin/bt -update-rc.d bt defaults -chmod -R 600 $setup_path/server/panel -chmod +x $setup_path/server/panel/certbot-auto -chmod -R +x $setup_path/server/panel/script -echo "$port" > $setup_path/server/panel/data/port.pl -/etc/init.d/bt start -password=`cat /dev/urandom | head -n 16 | md5sum | head -c 8` -sleep 1 -admin_auth='/www/server/panel/data/admin_path.pl' -if [ ! -f $admin_auth ];then - auth_path=`cat /dev/urandom | head -n 16 | md5sum | head -c 8` - echo "/$auth_path" > $admin_auth -fi -auth_path=`cat $admin_auth` -cd $setup_path/server/panel/ -python -m py_compile tools.py -python tools.py username -username=`python tools.pyc panel $password` -cd ~ -echo "$password" > $setup_path/server/panel/default.pl -chmod 600 $setup_path/server/panel/default.pl -/etc/init.d/bt restart -sleep 1 -isStart=`ps aux |grep 'gunicorn'|grep -v grep|awk '{print $2}'` -if [ "$isStart" == '' ];then - echo -e "\033[31mERROR: The BT-Panel service startup failed.\033[0m"; - echo '============================================' - exit; -fi - -if [ ! -f "/usr/bin/ufw" ];then - apt-get install -y ufw -fi - -if [ -f "/usr/sbin/ufw" ];then - ufw allow 888,20,21,22,80,$port/tcp - ufw allow 39000:40000/tcp - ufw_status=`ufw status` - echo y|ufw enable - ufw default deny - ufw reload -fi - -pip install psutil chardet psutil virtualenv $pipArg -if [ ! -d '/etc/letsencrypt' ];then - mkdir -p /etc/letsencrypt - mkdir -p /var/spool/cron - if [ ! -f '/var/spool/cron/crontabs/root' ];then - echo '' > /var/spool/cron/crontabs/root - chmod 600 /var/spool/cron/crontabs/root - fi -fi - -wget -O acme_install.sh $download_Url/install/acme_install.sh -nohup bash acme_install.sh &> /dev/null & -sleep 1 -rm -f acme_install.sh - -if [[ "${deepinSys}" =~ eepin ]]; then - address="localhost" -else - address=`curl -sS --connect-timeout 10 -m 60 https://www.bt.cn/Api/getIpAddress` - - if [ "$address" == '0.0.0.0' ] || [ "$address" == '' ];then - isHosts=`cat /etc/hosts|grep 'www.bt.cn'` - if [ "$isHosts" == '' ];then - echo "" >> /etc/hosts - echo "125.88.182.170 www.bt.cn" >> /etc/hosts - address=`curl -sS --connect-timeout 10 -m 60 https://www.bt.cn/Api/getIpAddress` - if [ "$address" == '' ];then - sed -i "/bt.cn/d" /etc/hosts - fi - fi - fi - - ipCheck=`python -c "import re; print(re.match('^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$','$address'))"` - if [ "$address" == "None" ];then - address="SERVER_IP" - fi - if [ "$address" != "SERVER_IP" ];then - echo "$address" > $setup_path/server/panel/data/iplist.txt - fi -fi - -curl -sS --connect-timeout 10 -m 60 https://www.bt.cn/Api/SetupCount?type=Linux\&o=$1 > /dev/null 2>&1 -if [ "$1" != "" ];then - echo $1 > /www/server/panel/data/o.pl - cd /www/server/panel - python tools.py o -fi - -echo -e "==================================================================" -echo -e "\033[32mCongratulations! Install succeeded!\033[0m" -echo -e "==================================================================" -echo -e "Bt-Panel: http://$address:$port$auth_path" -echo -e "username: $username" -echo -e "password: $password" -echo -e "\033[33mWarning:\033[0m" -echo -e "\033[33mIf you cannot access the panel, \033[0m" -echo -e "\033[33mrelease the following port (8888|888|80|443|20|21) in the security group\033[0m" -echo -e "==================================================================" -rm -fr /www/server/panel/data/admin_path.pl - -endTime=`date +%s` -((outTime=($endTime-$startTime)/60)) -echo -e "Time consumed:\033[32m $outTime \033[0mMinute!" diff --git a/images/panel/scripts/install-bt.sh b/images/panel/scripts/install-bt.sh deleted file mode 100644 index b9d67393..00000000 --- a/images/panel/scripts/install-bt.sh +++ /dev/null @@ -1,431 +0,0 @@ -#!/bin/bash -PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin -export PATH -LANG=en_US.UTF-8 -is64bit=`getconf LONG_BIT` - -if [ "$is64bit" != '64' ];then - echo "=====================================" - echo "抱歉, 6.0不支持32位系统, 请使用64位系统或安装宝塔5.9!"; - exit 0; -fi - -echo " -+---------------------------------------------------------------------- -| Bt-WebPanel 6.x FOR Ubuntu/Debian -+---------------------------------------------------------------------- -| Copyright © 2015-2018 BT-SOFT(http://www.bt.cn) All rights reserved. -+---------------------------------------------------------------------- -| The WebPanel URL will be http://SERVER_IP:8888 when installed. -+---------------------------------------------------------------------- -" - -if [ `whoami` != "root" ];then - echo -e "\033[31mError: Please run the script with root privileges on Ubuntu, for example: sudo bash install.sh\033[0m"; - exit; -fi - -apt update -apt install -y --no-recoomends-install curl wget - -#自动选择下载节点 -get_node_url(){ - nodes=(http://125.88.182.172:5880 http://103.224.251.67 http://128.1.164.196 http://download.bt.cn); - i=1; - if [ ! -f /bin/curl ];then - if [ -f /usr/local/curl/bin/curl ];then - ln -sf /usr/local/curl/bin/curl /bin/curl - else - apt install curl -y - fi - fi - for node in ${nodes[@]}; - do - start=`date +%s.%N` - result=`curl -sS --connect-timeout 3 -m 60 $node/check.txt` - if [ $result = 'True' ];then - end=`date +%s.%N` - start_s=`echo $start | cut -d '.' -f 1` - start_ns=`echo $start | cut -d '.' -f 2` - end_s=`echo $end | cut -d '.' -f 1` - end_ns=`echo $end | cut -d '.' -f 2` - time_micro=$(( (10#$end_s-10#$start_s)*1000000 + (10#$end_ns/1000 - 10#$start_ns/1000) )) - time_ms=$(($time_micro/1000)) - values[$i]=$time_ms; - urls[$time_ms]=$node - i=$(($i+1)) - fi - done - j=5000 - for n in ${values[@]}; - do - if [ $j -gt $n ];then - j=$n - fi - done - if [ $j = 5000 ];then - NODE_URL='http://download.bt.cn'; - else - NODE_URL=${urls[$j]} - fi -} - -echo '---------------------------------------------'; -echo "Selected download node..."; -get_node_url -download_Url=$NODE_URL -echo "Download node: $download_Url"; -echo '---------------------------------------------'; -setup_path=/www -port='8888' -if [ -f $setup_path/server/panel/data/port.pl ];then - port=`cat $setup_path/server/panel/data/port.pl` -fi - -# while [ "$go" != 'y' ] && [ "$go" != 'n' ] -# do -# read -p "Do you want to directory now?(y/n): " go; -# done - -# if [ "$go" = 'n' ];then -# exit; -# fi - -echo "Bt-Panel Will be install to: $setup_path" - -startTime=`date +%s` - -ln -sf bash /bin/sh -apt-get install ruby -y -apt-get update -y -apt-get install lsb-release -y -#apt-get install ntp ntpdate -y -#/etc/init.d/ntp stop -#update-rc.d ntp remove -#cat >>~/.profile<&1|awk '{print $2}') -pVersion=${tmp:0:3} - -Install_setuptools() -{ - if [ ! -f "/usr/bin/easy_install" ];then - wget -O setuptools-33.1.1.zip $download_Url/install/src/setuptools-33.1.1.zip -T 10 - unzip setuptools-33.1.1.zip - rm -f setuptools-33.1.1.zip - cd setuptools-33.1.1 - python setup.py install - cd .. - rm -rf setuptools-33.1.1 - fi - - if [ ! -f "/usr/bin/easy_install" ];then - echo '================================================='; - echo -e "\033[31msetuptools installation failed. \033[0m"; - exit; - fi -} -Install_Pillow() -{ - isSetup=`python -m PIL 2>&1|grep package` - if [ "$isSetup" = "" ];then - wget -O Pillow-3.2.0.zip $download_Url/install/src/Pillow-3.2.0.zip -T 10 - unzip Pillow-3.2.0.zip - rm -f Pillow-3.2.0.zip - cd Pillow-3.2.0 - python setup.py install - cd .. - rm -rf Pillow-3.2.0 - fi - isSetup=`python -m PIL 2>&1|grep package` - if [ "$isSetup" = "" ];then - echo '================================================='; - echo -e "\033[31mPillow installation failed. \033[0m"; - exit; - fi -} - -Install_psutil() -{ - isSetup=`python -m psutil 2>&1|grep package` - if [ "$isSetup" = "" ];then - wget -O psutil-5.2.2.tar.gz $download_Url/install/src/psutil-5.2.2.tar.gz -T 10 - tar xvf psutil-5.2.2.tar.gz - rm -f psutil-5.2.2.tar.gz - cd psutil-5.2.2 - python setup.py install - cd .. - rm -rf psutil-5.2.2 - fi - isSetup=`python -m psutil 2>&1|grep package` - if [ "$isSetup" = "" ];then - echo '================================================='; - echo -e "\033[31mpsutil installation failed. \033[0m"; - exit; - fi -} - -Install_mysqldb() -{ - isSetup=`python -m MySQLdb 2>&1|grep package` - if [ "$isSetup" = "" ];then - wget -O MySQL-python-1.2.5.zip $download_Url/install/src/MySQL-python-1.2.5.zip -T 10 - unzip MySQL-python-1.2.5.zip - rm -f MySQL-python-1.2.5.zip - cd MySQL-python-1.2.5 - python setup.py install - cd .. - rm -rf MySQL-python-1.2.5 - fi - -} - -Install_chardet() -{ - isSetup=`python -m chardet 2>&1|grep package` - if [ "$isSetup" = "" ];then - wget -O chardet-2.3.0.tar.gz $download_Url/install/src/chardet-2.3.0.tar.gz -T 10 - tar xvf chardet-2.3.0.tar.gz - rm -f chardet-2.3.0.tar.gz - cd chardet-2.3.0 - python setup.py install - cd .. - rm -rf chardet-2.3.0 - fi - isSetup=`python -m chardet 2>&1|grep package` - if [ "$isSetup" = "" ];then - echo '================================================='; - echo -e "\033[31mchardet installation failed. \033[0m"; - exit; - fi -} - -Install_webpy() -{ - isSetup=`python -m web 2>&1|grep package` - if [ "$isSetup" = "" ];then - wget -O web.py-0.38.tar.gz $download_Url/install/src/web.py-0.38.tar.gz -T 10 - tar xvf web.py-0.38.tar.gz - rm -f web.py-0.38.tar.gz - cd web.py-0.38 - python setup.py install - cd .. - rm -rf web.py-0.38 - fi - - isSetup=`python -m web 2>&1|grep package` - if [ "$isSetup" = "" ];then - echo '================================================='; - echo -e "\033[31mweb.py installation failed. \033[0m"; - exit; - fi -} -pipArg='' -apt install libffi-dev -y -pip install --upgrade setuptools -pip install itsdangerous==0.24 -pip install paramiko==1.9 -for p_name in psutil chardet virtualenv Flask Flask-Session Flask-SocketIO flask-sqlalchemy Pillow gunicorn gevent-websocket; -do - pip install ${p_name} -done - -pip install psutil chardet virtualenv Flask Flask-Session Flask-SocketIO flask-sqlalchemy Pillow gunicorn gevent-websocket paramiko -Install_Pillow -Install_psutil - -pip install gunicorn -if [ -f /www/server/mysql/bin/mysql ]; then - pip install mysql-python - Install_mysqldb -fi -Install_chardet - -mkdir -p $setup_path/server/panel/logs -mkdir -p $setup_path/server/panel/vhost/apache -mkdir -p $setup_path/server/panel/vhost/nginx -mkdir -p $setup_path/server/panel/vhost/rewrite -wget -O $setup_path/server/panel/certbot-auto $download_Url/install/certbot-auto.init -T 5 -chmod +x $setup_path/server/panel/certbot-auto - - -if [ -f '/etc/init.d/bt' ];then - /etc/init.d/bt stop -fi - -mkdir -p /www/server -mkdir -p /www/wwwroot -mkdir -p /www/wwwlogs -mkdir -p /www/backup/database -mkdir -p /www/backup/site - -wget -O panel.zip $download_Url/install/src/panel6.zip -T 10 -wget -O /etc/init.d/bt $download_Url/install/src/bt6.init -T 10 -if [ -f "$setup_path/server/panel/data/default.db" ];then - if [ -d "/$setup_path/server/panel/old_data" ];then - rm -rf $setup_path/server/panel/old_data - fi - mkdir -p $setup_path/server/panel/old_data - mv -f $setup_path/server/panel/data/default.db $setup_path/server/panel/old_data/default.db - mv -f $setup_path/server/panel/data/system.db $setup_path/server/panel/old_data/system.db - mv -f $setup_path/server/panel/data/aliossAs.conf $setup_path/server/panel/old_data/aliossAs.conf - mv -f $setup_path/server/panel/data/qiniuAs.conf $setup_path/server/panel/old_data/qiniuAs.conf - mv -f $setup_path/server/panel/data/iplist.txt $setup_path/server/panel/old_data/iplist.txt - mv -f $setup_path/server/panel/data/port.pl $setup_path/server/panel/old_data/port.pl - mv -f $setup_path/server/panel/data/admin_path.pl $setup_path/server/panel/old_data/admin_path.pl -fi - -unzip -o panel.zip -d $setup_path/server/ > /dev/null - -if [ -d "$setup_path/server/panel/old_data" ];then - mv -f $setup_path/server/panel/old_data/default.db $setup_path/server/panel/data/default.db - mv -f $setup_path/server/panel/old_data/system.db $setup_path/server/panel/data/system.db - mv -f $setup_path/server/panel/old_data/aliossAs.conf $setup_path/server/panel/data/aliossAs.conf - mv -f $setup_path/server/panel/old_data/qiniuAs.conf $setup_path/server/panel/data/qiniuAs.conf - mv -f $setup_path/server/panel/old_data/iplist.txt $setup_path/server/panel/data/iplist.txt - mv -f $setup_path/server/panel/old_data/port.pl $setup_path/server/panel/data/port.pl - mv -f $setup_path/server/panel/old_data/admin_path.pl $setup_path/server/panel/data/admin_path.pl - - if [ -d "/$setup_path/server/panel/old_data" ];then - rm -rf $setup_path/server/panel/old_data - fi -fi - -rm -f panel.zip - -if [ ! -f $setup_path/server/panel/tools.py ];then - echo -e "\033[31mERROR: Failed to download, please try again!\033[0m"; - echo '============================================' - exit; -fi - -rm -f $setup_path/server/panel/class/*.pyc -rm -f $setup_path/server/panel/*.pyc -python -m compileall $setup_path/server/panel -#rm -f $setup_path/server/panel/class/*.py -#rm -f $setup_path/server/panel/*.py - -chmod 777 /tmp -chmod +x /etc/init.d/bt -ln -sf /etc/init.d/bt /usr/bin/bt -update-rc.d bt defaults -chmod -R 600 $setup_path/server/panel -chmod +x $setup_path/server/panel/certbot-auto -chmod -R +x $setup_path/server/panel/script -echo "$port" > $setup_path/server/panel/data/port.pl -/etc/init.d/bt start -password=`cat /dev/urandom | head -n 16 | md5sum | head -c 8` -sleep 1 -admin_auth='/www/server/panel/data/admin_path.pl' -if [ ! -f $admin_auth ];then - auth_path=`cat /dev/urandom | head -n 16 | md5sum | head -c 8` - echo "/$auth_path" > $admin_auth -fi -auth_path=`cat $admin_auth` -cd $setup_path/server/panel/ -python -m py_compile tools.py -python tools.py username -username=`python tools.pyc panel $password` -cd ~ -echo "$password" > $setup_path/server/panel/default.pl -chmod 600 $setup_path/server/panel/default.pl -/etc/init.d/bt restart -sleep 1 -isStart=`ps aux |grep 'gunicorn'|grep -v grep|awk '{print $2}'` -if [ "$isStart" == '' ];then - echo -e "\033[31mERROR: The BT-Panel service startup failed.\033[0m"; - echo '============================================' - exit; -fi - -if [ ! -f /root/.ssh/id_rsa.pub ];then - ssh-keygen -q -t rsa -P "" -f /root/.ssh/id_rsa -fi -cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys -chmod 600 /root/.ssh/authorized_keys - -if [ ! -f "/usr/bin/ufw" ];then - apt-get install -y ufw -fi - -if [ -f "/usr/sbin/ufw" ];then - ufw allow 888,20,21,22,80,$port/tcp - ufw allow 39000:40000/tcp - ufw_status=`ufw status` - echo y|ufw enable - ufw default deny - ufw reload -fi - -pip install psutil chardet psutil virtualenv $pipArg -if [ ! -d '/etc/letsencrypt' ];then - mkdir -p /etc/letsencrypt - mkdir -p /var/spool/cron - if [ ! -f '/var/spool/cron/crontabs/root' ];then - echo '' > /var/spool/cron/crontabs/root - chmod 600 /var/spool/cron/crontabs/root - fi -fi - -wget -O acme_install.sh $download_Url/install/acme_install.sh -nohup bash acme_install.sh &> /dev/null & -sleep 1 -rm -f acme_install.sh - -if [[ "${deepinSys}" =~ eepin ]]; then - address="localhost" -else - address=`curl -sS --connect-timeout 10 -m 60 https://www.bt.cn/Api/getIpAddress` - - if [ "$address" == '0.0.0.0' ] || [ "$address" == '' ];then - isHosts=`cat /etc/hosts|grep 'www.bt.cn'` - if [ "$isHosts" == '' ];then - echo "" >> /etc/hosts - echo "125.88.182.170 www.bt.cn" >> /etc/hosts - address=`curl -sS --connect-timeout 10 -m 60 https://www.bt.cn/Api/getIpAddress` - if [ "$address" == '' ];then - sed -i "/bt.cn/d" /etc/hosts - fi - fi - fi - - ipCheck=`python -c "import re; print(re.match('^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$','$address'))"` - if [ "$address" == "None" ];then - address="SERVER_IP" - fi - if [ "$address" != "SERVER_IP" ];then - echo "$address" > $setup_path/server/panel/data/iplist.txt - fi -fi - -curl -sS --connect-timeout 10 -m 60 https://www.bt.cn/Api/SetupCount?type=Linux\&o=$1 > /dev/null 2>&1 -if [ "$1" != "" ];then - echo $1 > /www/server/panel/data/o.pl - cd /www/server/panel - python tools.py o -fi - -echo -e "==================================================================" -echo -e "\033[32mCongratulations! Install succeeded!\033[0m" -echo -e "==================================================================" -echo -e "Bt-Panel: http://$address" -echo -e "username: $username" -echo -e "password: $password" -# echo -e "\033[33mWarning:\033[0m" -# echo -e "\033[33mIf you cannot access the panel, \033[0m" -# echo -e "\033[33mrelease the following port (8888|888|80|443|20|21) in the security group\033[0m" -echo -e "==================================================================" -rm -fr /www/server/panel/data/admin_path.pl -endTime=`date +%s` -((outTime=($endTime-$startTime)/60)) -echo -e "Time consumed:\033[32m $outTime \033[0mMinute!" \ No newline at end of file diff --git a/images/pgadmin4/latest/Dockerfile b/images/pgadmin4/latest/Dockerfile new file mode 100644 index 00000000..2c5cedc7 --- /dev/null +++ b/images/pgadmin4/latest/Dockerfile @@ -0,0 +1,7 @@ +FROM dpage/pgadmin4:latest + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +EXPOSE 80 443 diff --git a/images/photon/1/Dockerfile b/images/photon/1/Dockerfile new file mode 100644 index 00000000..779635b6 --- /dev/null +++ b/images/photon/1/Dockerfile @@ -0,0 +1,5 @@ +FROM photon:1.0 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +CMD [ "/bash" ] diff --git a/images/photon/2/Dockerfile b/images/photon/2/Dockerfile new file mode 100644 index 00000000..356a9189 --- /dev/null +++ b/images/photon/2/Dockerfile @@ -0,0 +1,5 @@ +FROM photon:2.0 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +CMD [ "/bash" ] diff --git a/images/photon/3/Dockerfile b/images/photon/3/Dockerfile new file mode 100644 index 00000000..0f4e70a0 --- /dev/null +++ b/images/photon/3/Dockerfile @@ -0,0 +1,5 @@ +FROM photon:3.0 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +CMD [ "/bash" ] diff --git a/images/photon/4/Dockerfile b/images/photon/4/Dockerfile new file mode 100644 index 00000000..abc1fcbc --- /dev/null +++ b/images/photon/4/Dockerfile @@ -0,0 +1,5 @@ +FROM photon:4.0 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +CMD [ "/bash" ] diff --git a/images/photon/latest/Dockerfile b/images/photon/latest/Dockerfile new file mode 100644 index 00000000..27e51b6f --- /dev/null +++ b/images/photon/latest/Dockerfile @@ -0,0 +1,5 @@ +FROM photon:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +CMD [ "/bash" ] diff --git a/images/php/56/Dockerfile b/images/php/56/Dockerfile new file mode 100644 index 00000000..fb54cd8a --- /dev/null +++ b/images/php/56/Dockerfile @@ -0,0 +1,28 @@ +FROM ghcr.io/dockenv/alpine:3.8 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv \ + org.opencontainers.image.description='PHP 5.6.40' + +ENV PHP_VER=5 + +RUN apk add --no-cache php5-apcu php5-cli php5-ctype php5-curl php5-dba php5-fpm php5-bcmath php5-bz2 php5-calendar php5-dom php5-embed php5-enchant php5-exif php5-ftp php5-gd php5-gettext php5-gmp php5-iconv php5-imap php5-intl php5-json php5-ldap php5-mcrypt php5-mssql php5-mysql php5-mysqli php5-odbc php5-opcache php5-openssl php5-pcntl php5-pdo php5-pdo_dblib php5-pdo_mysql php5-pdo_odbc php5-pdo_pgsql php5-pdo_sqlite php5-pgsql php5-phar php5-posix php5-pspell php5-shmop php5-snmp php5-soap php5-sockets php5-sqlite3 php5-suhosin php5-sysvmsg php5-sysvsem php5-sysvshm php5-wddx php5-xml php5-xmlreader php5-xmlrpc php5-xsl php5-zip \ + && mv /usr/bin/php${PHP_VER} /usr/bin/php \ + && mv /usr/bin/php-fpm${PHP_VER} /usr/bin/php-fpm \ + && mv /usr/bin/phpize${PHP_VER} /usr/bin/phpize \ + && sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/display_errors = .*/display_errors = On/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/memory_limit = .*/memory_limit = 256M/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/date.timezone.*/date.timezone = 'Asia\/Shanghai'/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/upload_max_filesize = .*/upload_max_filesize = 512M/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/post_max_size = .*/post_max_size = 512M/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/max_file_uploads =.*/max_file_uploads = 256/g" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/display_startup_errors =.*/display_startup_errors = On/g" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/log_errors =.*/log_errors = On/g" /etc/php${PHP_VER}/php.ini \ + && sed -i 's/default_charset =.*/default_charset = "UTF-8"/g' /etc/php${PHP_VER}/php.ini \ + && sed -i 's/max_execution_time =.*/max_execution_time = 300/g' /etc/php${PHP_VER}/php.ini \ + && sed -i "s#^pm.max_children.*#pm.max_children = 32#" /etc/php${PHP_VER}/php-fpm.conf + +EXPOSE 9000 +CMD ["php-fpm","--nodaemonize"] diff --git a/images/php/74/Dockerfile b/images/php/74/Dockerfile new file mode 100644 index 00000000..02dd97e8 --- /dev/null +++ b/images/php/74/Dockerfile @@ -0,0 +1,29 @@ +FROM ghcr.io/dockenv/alpine:edge + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv \ + org.opencontainers.image.description='PHP 7.4' + +ENV PHP_VER=7 + +RUN echo "https://repo.huaweicloud.com/alpine/edge/testing" >> /etc/apk/repositories \ + && apk add --no-cache php7 php7-bcmath php7-brotli php7-bz2 php7-calendar php7-cgi php7-common php7-ctype php7-curl php7-dba php7-dev php7-dom php7-embed php7-enchant php7-exif php7-ffi php7-fileinfo php7-fpm php7-ftp php7-gd php7-gettext php7-gmp php7-iconv php7-imap php7-intl php7-json php7-ldap php7-mbstring php7-mysqli php7-mysqlnd php7-odbc php7-opcache php7-openssl php7-pcntl php7-pdo php7-pdo_dblib php7-pdo_mysql php7-pdo_odbc php7-pdo_pgsql php7-pdo_sqlite php7-pear php7-pecl-amqp php7-pecl-apcu php7-pecl-ast php7-pecl-event php7-pecl-grpc php7-pecl-igbinary php7-pecl-imagick php7-pecl-imagick-dev php7-pecl-inotify php7-pecl-lzf php7-pecl-mailparse php7-pecl-maxminddb php7-pecl-mcrypt php7-pecl-memcache php7-pecl-memcached php7-pecl-mongodb php7-pecl-msgpack php7-pecl-mustache php7-pecl-oauth php7-pecl-pcov php7-pecl-protobuf php7-pecl-psr php7-pecl-rdkafka php7-pecl-redis php7-pecl-solr php7-pecl-ssh2 php7-pecl-swoole php7-pecl-timezonedb php7-pecl-uploadprogress php7-pecl-uuid php7-pecl-vips php7-pecl-xdebug php7-pecl-xhprof php7-pecl-xhprof-assets php7-pecl-xlswriter php7-pecl-yaml php7-pecl-zmq php7-pecl-zstd php7-pgsql php7-phalcon php7-phar php7-posix php7-pspell php7-session php7-shmop php7-simplexml php7-snmp php7-soap php7-sockets php7-sodium php7-sqlite3 php7-sysvmsg php7-sysvsem php7-sysvshm php7-tidy php7-tokenizer php7-xml php7-xmlreader php7-xmlrpc php7-xmlwriter php7-xsl php7-zip \ + && mv /usr/bin/php${PHP_VER} /usr/bin/php \ + && mv /usr/sbin/php-fpm${PHP_VER} /usr/bin/php-fpm \ + && sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/display_errors = .*/display_errors = On/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/memory_limit = .*/memory_limit = 256M/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/date.timezone.*/date.timezone = 'Asia\/Shanghai'/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/upload_max_filesize = .*/upload_max_filesize = 512M/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/post_max_size = .*/post_max_size = 512M/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/max_file_uploads =.*/max_file_uploads = 256/g" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/display_startup_errors =.*/display_startup_errors = On/g" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/log_errors =.*/log_errors = On/g" /etc/php${PHP_VER}/php.ini \ + && sed -i 's/default_charset =.*/default_charset = "UTF-8"/g' /etc/php${PHP_VER}/php.ini \ + && sed -i 's/max_execution_time =.*/max_execution_time = 300/g' /etc/php${PHP_VER}/php.ini \ + && sed -i "s#^pm.max_children.*#pm.max_children = 32#" /etc/php${PHP_VER}/php-fpm.d/*.conf \ + && sed -i "s#^listen =.*#listen = 0.0.0.0:9000#" /etc/php${PHP_VER}/php-fpm.d/*.conf + +EXPOSE 9000 +CMD ["php-fpm","--nodaemonize"] diff --git a/images/php/74/build.sh b/images/php/74/build.sh new file mode 100644 index 00000000..fe47e1a8 --- /dev/null +++ b/images/php/74/build.sh @@ -0,0 +1,184 @@ +#!/usr/bin/env sh +### + # @Author: Cloudflying + # @Date: 2021-11-13 19:13:52 + # @LastEditTime: 2022-06-28 00:01:32 + # @LastEditors: Cloudflying + # @Description: + # @FilePath: /dockenv/images/php/74/build.sh +### + +CORES=$(grep -c '^processor' /proc/cpuinfo) +ARCH=$(uname -m) + +ext_url='https://hk.mirrors.xieke.org/Src/php-exts' + +PHP_EXT_AMQP_VER=1.11.0RC1 +PHP_EXT_EV_VER=1.1.5 +PHP_EXT_CRYPTO_VER=0.3.2 +PHP_EXT_EVENT_VER=3.0.7RC1 +PHP_EXT_GEOIP_VER=1.1.1 +PHP_EXT_GMAGICK_VER=2.0.6RC1 +PHP_EXT_GNUPG_VER=1.5.0 +PHP_EXT_GRPC_VER=1.42.0RC1 +PHP_EXT_HPROSE_VER=1.8.0 +PHP_EXT_IGBINARY_VER=3.2.6 +PHP_EXT_IMAGICK_VER=3.6.0RC1 +PHP_EXT_LEVELDB_VER=0.3.0 +PHP_EXT_LIBSODIUM_VER=2.0.23 +PHP_EXT_MCRYPT_VER=1.0.4 +PHP_EXT_MEMCACHE_VER=8.0 +PHP_EXT_MEMCACHED_VER=3.1.5 +PHP_EXT_MONGODB_VER=1.11.1 +PHP_EXT_MSGPACK_VER=2.2.0RC1 +PHP_EXT_PDO_SQLSRV_VER=5.10.0beta1 +PHP_EXT_PHALCON_VER=5.0.0alpha6 +PHP_EXT_PKCS11_VER=1.0 +PHP_EXT_PROTOBUF_VER=3.19.1 +PHP_EXT_RAR_VER=4.2.0 +PHP_EXT_REDIS_VER=5.3.4 +PHP_EXT_RDKAFKA_VER=5.0.0 +PHP_EXT_TENSOR_VER=3.0.00 +PHP_EXT_SCRYPT_VER=1.4.2 +PHP_EXT_STOMP_VER=2.0.2 +PHP_EXT_SIMPLE_KAFKA_CLIENT_VER=0.1.4 +PHP_EXT_SMBCLIENT_VER=1.0.6 +PHP_EXT_SQLSRV_VER=5.10.0beta1 +PHP_EXT_SSH2_VER=1.3.1 +PHP_EXT_SWOOLE_VER=4.8.1 +PHP_EXT_YAC_VER=2.3.0 +PHP_EXT_YAF_VER=3.3.3 +PHP_EXT_YACONF_VER=1.1.0 +PHP_EXT_XHPROF_VER=2.3.5 +PHP_EXT_XDEBUG_VER=3.1.1 +PHP_EXT_YAML_VER=2.2.2 +PHP_EXT_ZIP_VER=1.20.0 +PHP_EXT_ZOOKEEPER_VER=1.0.0 +PHP_EXT_ZSTD_VER=0.11.0 + +if [[ -z "$(command -v make)" ]]; then + apk add --no-cache --virtual .deps wget curl autoconf make gcc g++ file #> /dev/null +fi + +# php7-dbg php7-phpdbg +if [[ -z "$(command -v composer)" ]]; then + +fi + +# composer config -g repos.packagist composer https://mirrors.cloud.tencent.com/composer +# gpgme-dev +# libevent-dev dep python3 +# alpine included: rabbitmq-c-dev libevent-dev imagemagick-dev yaml-dev libmemcached-dev libssh2-dev +if [[ ! -f "/usr/include/amqp.h" ]]; then + apk add --no-cache zlib-dev librdkafka-dev linux-headers leveldb-dev #> /dev/null +fi + +# 重命名可执行文件 方便操作而不用多余的加版本号 +if [[ -f /usr/bin/phar.phar ]]; then + cd /usr/bin + rm -fr phar phar7 phar.phar phar.phar7 php php-cgi php-config phpdbg phpize + mv phar7.phar phar + mv php7 php + mv php-cgi7 php-cgi + mv php-config7 php-config + mv phpdbg7 phpdbg + mv phpize7 phpize + mv /usr/sbin/php-fpm7 /usr/sbin/php-fpm +fi + +# 安装最新版本 Composer +if [[ -z "$(command -v composer)" ]]; then + wget -c --no-check-certificate https://mirrors.aliyun.com/composer/composer.phar -O /usr/bin/composer + chmod +x /usr/bin/composer +fi + +ext_dir=$(php-config --extension-dir) +ini_dir=$(php-config --ini-dir) +ini_file=$(php --ini | grep '^Loaded Configuration File' | awk -F ' ' '{print $4}') +# gnupg gpgme-dev depency qtbase fuck +# alpine included: amqp xdebug yaml xhprof igbinary imagick event protobuf msgpack redis memcache memcached mongodb ssh2 +exts="ev hprose rar rdkafka scrypt stomp yac yaf swoole zstd leveldb" + +mkdir -p /tmp/.build/exts && cd /tmp/.build +for ext in ${exts} +do + uext=$(echo $ext | tr 'a-z' 'A-Z') + ext_ver=$(eval echo \$"PHP_EXT_${uext}_VER") + file_url="${ext_url}/${ext}/${ext}-${ext_ver}.tgz" + if [ ! -f "${ext_dir}/${ext}.so" ]; then + if [[ ! -f "/tmp/.build/exts/${ext}-${ext_ver}.tgz" ]]; then + cd /tmp/.build/exts/ && wget -cq $file_url + rm -fr ${ext}-${ext_ver} + tar -xvf ${ext}-${ext_ver}.tgz > /dev/null 2>&1 + fi + + if [[ "${ext}" == 'xhprof' ]]; then + cd "/tmp/.build/exts/${ext}-${ext_ver}/extension" + else + cd "/tmp/.build/exts/${ext}-${ext_ver}" + fi + phpize && ./configure && make -j${CORES} && make install + + if [[ ! -f "${ext_dir}/${ext}.so" ]]; then + echo "$ext install fail" + exit 1 + else + if [[ "$ext" == 'opcache' ]] || [[ "$ext" == 'xdebug' ]]; then + echo "zend_extension=${ext}.so" > ${ini_dir}/${ext}.ini + else + if [[ "$ext" == 'ev' ]]; then + echo "extension=${ext}.so" > ${ini_dir}/zz-${ext}.ini + else + echo "extension=${ext}.so" > ${ini_dir}/${ext}.ini + fi + fi + fi + else + echo "$ext has compiled" + fi +done + +php_two_bit_ver=$(php-config --version | awk -F '.' '{print $1"."$2}') +ioncube_path="/tmp/.build/exts/ioncube" +ioncube_file="ioncube_loader_lin_${php_two_bit_ver}.so" + +if [[ ! -f "${ext_dir}/ioncube.so" ]]; then + echo '==>ioncube installing' + cd /tmp/.build/exts + if [[ ! -d "$ioncube_path" ]]; then + wget -cq "${ext_url}/ioncube/ioncube_loaders_lin_x86-64.tar.gz" + tar -xvf ioncube_loaders_lin_x86-64.tar.gz > /dev/null + fi + + if [[ -f "${ioncube_path}/$ioncube_file" ]]; then + cp "${ioncube_path}/$ioncube_file" "${ext_dir}/ioncube.so" + # echo "zend_extension=ioncube.so" > ${ini_dir}/ioncube.ini + echo "zend_extension=ioncube.so" >> ${ini_file} + else + echo "php version ${ver} is not supported" + fi +else + echo 'ioncube already installed' +fi + +if [[ ! -f "${ext_dir}/sourceguardian.so" ]]; then + echo '==>SourceGuardian 12 installing' + cd /tmp/.build/exts + if [[ ! -d "/tmp/.build/exts/sourceguardian" ]]; then + mkdir -p /tmp/.build/exts/sourceguardian + wget -cq "${ext_url}/sourceguardian/loaders.linux-x86_64.tar.gz" + cd /tmp/.build/exts/sourceguardian + tar -xvf ../loaders.linux-x86_64.tar.gz > /dev/null + fi + + if [[ -f "/tmp/.build/exts/sourceguardian/ixed.${php_two_bit_ver}.lin" ]]; then + cp "/tmp/.build/exts/sourceguardian/ixed.${php_two_bit_ver}.lin" "${ext_dir}/sourceguardian.so" + echo "extension=sourceguardian.so" >> ${ini_file} + else + echo "php version ${ver} is not supported" + fi +else + echo 'sourceguardian already installed' +fi + +apk del .deps > /dev/null diff --git a/images/php/80/Dockerfile b/images/php/80/Dockerfile new file mode 100644 index 00000000..5c53a35a --- /dev/null +++ b/images/php/80/Dockerfile @@ -0,0 +1,29 @@ +FROM ghcr.io/dockenv/alpine:3.16 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv \ + org.opencontainers.image.description='PHP 8.0' + +ENV PHP_VER=8 + +# php8-pecl-couchbase: dynamic library not found, but it exist +RUN apk add --no-cache php8 php8-bcmath php8-brotli php8-bz2 php8-calendar php8-ctype php8-curl php8-dba php8-dev php8-dom php8-embed php8-enchant php8-exif php8-fileinfo php8-fpm php8-ftp php8-gd php8-gettext php8-gmp php8-iconv php8-imap php8-intl php8-ldap php8-mbstring php8-mysqli php8-mysqlnd php8-odbc php8-openssl php8-pcntl php8-pdo php8-pdo_dblib php8-pdo_mysql php8-pdo_odbc php8-pdo_pgsql php8-pdo_sqlite php8-pear php8-pecl-event php8-pecl-imagick php8-pecl-imagick-dev php8-pecl-maxminddb php8-pecl-mcrypt php8-pecl-memcache php8-pecl-memcached php8-pecl-mongodb php8-pecl-msgpack php8-pecl-redis php8-pecl-yaml php8-pgsql php8-phar php8-posix php8-pspell php8-session php8-shmop php8-simplexml php8-snmp php8-soap php8-sockets php8-sodium php8-sqlite3 php8-sysvmsg php8-sysvsem php8-sysvshm php8-tidy php8-tokenizer php8-xml php8-xmlreader php8-xmlwriter php8-xsl php8-zip php8-cgi php8-ffi php8-opcache php8-pecl-apcu php8-pecl-lzf php8-pecl-protobuf php8-pecl-ssh2 php8-pecl-vips php8-pecl-xdebug php8-pecl-xhprof php8-pecl-amqp php8-pecl-ast php8-pecl-mailparse php8-pecl-oauth php8-pecl-psr php8-pecl-rdkafka php8-pecl-swoole php8-pecl-timezonedb php8-pecl-uploadprogress php8-pecl-uuid php8-pecl-xhprof-assets php8-pecl-zstd php8-tideways_xhprof \ + && mv /usr/bin/php${PHP_VER} /usr/bin/php \ + && mv /usr/sbin/php-fpm${PHP_VER} /usr/bin/php-fpm \ + && sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/display_errors = .*/display_errors = On/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/memory_limit = .*/memory_limit = 256M/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/date.timezone.*/date.timezone = 'Asia\/Shanghai'/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/upload_max_filesize = .*/upload_max_filesize = 512M/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/post_max_size = .*/post_max_size = 512M/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/max_file_uploads =.*/max_file_uploads = 256/g" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/display_startup_errors =.*/display_startup_errors = On/g" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/log_errors =.*/log_errors = On/g" /etc/php${PHP_VER}/php.ini \ + && sed -i 's/default_charset =.*/default_charset = "UTF-8"/g' /etc/php${PHP_VER}/php.ini \ + && sed -i 's/max_execution_time =.*/max_execution_time = 300/g' /etc/php${PHP_VER}/php.ini \ + && sed -i "s#^pm.max_children.*#pm.max_children = 32#" /etc/php${PHP_VER}/php-fpm.d/*.conf \ + && sed -i "s#^listen =.*#listen = 0.0.0.0:9000#" /etc/php${PHP_VER}/php-fpm.d/*.conf + +EXPOSE 9000 +CMD ["php-fpm","--nodaemonize"] diff --git a/images/php/80/build.sh b/images/php/80/build.sh new file mode 100644 index 00000000..4cbb9d63 --- /dev/null +++ b/images/php/80/build.sh @@ -0,0 +1,188 @@ +#!/usr/bin/env bash +### + # @Author: Cloudflying + # @Date: 2021-11-13 20:44:45 + # @LastEditTime: 2022-06-27 23:45:11 + # @LastEditors: Cloudflying + # @Description: + # @FilePath: /dockenv/images/php/80/build.sh +### + +CORES=$(grep -c '^processor' /proc/cpuinfo) +ARCH=$(uname -m) + +ext_url='https://hk.mirrors.xieke.org/Src/php-exts' + +PHP_EXT_AMQP_VER=1.11.0RC1 +PHP_EXT_EV_VER=1.1.5 +PHP_EXT_CRYPTO_VER=0.3.2 +PHP_EXT_EVENT_VER=3.0.7RC1 +PHP_EXT_GEOIP_VER=1.1.1 +PHP_EXT_GMAGICK_VER=2.0.6RC1 +PHP_EXT_GNUPG_VER=1.5.0 +PHP_EXT_GRPC_VER=1.42.0RC1 +PHP_EXT_HPROSE_VER=1.8.0 +PHP_EXT_IGBINARY_VER=3.2.6 +PHP_EXT_IMAGICK_VER=3.6.0RC1 +PHP_EXT_LEVELDB_VER=0.3.0 +PHP_EXT_LIBSODIUM_VER=2.0.23 +PHP_EXT_MCRYPT_VER=1.0.4 +PHP_EXT_MEMCACHE_VER=8.0 +PHP_EXT_MEMCACHED_VER=3.1.5 +PHP_EXT_MONGODB_VER=1.11.1 +PHP_EXT_MSGPACK_VER=2.2.0RC1 +PHP_EXT_PDO_SQLSRV_VER=5.10.0beta1 +PHP_EXT_PHALCON_VER=5.0.0alpha6 +PHP_EXT_PKCS11_VER=1.0 +PHP_EXT_PROTOBUF_VER=3.19.1 +PHP_EXT_RAR_VER=4.2.0 +PHP_EXT_REDIS_VER=5.3.4 +PHP_EXT_RDKAFKA_VER=5.0.0 +PHP_EXT_TENSOR_VER=3.0.00 +PHP_EXT_SCRYPT_VER=1.4.2 +PHP_EXT_STOMP_VER=2.0.2 +PHP_EXT_SIMPLE_KAFKA_CLIENT_VER=0.1.4 +PHP_EXT_SMBCLIENT_VER=1.0.6 +PHP_EXT_SQLSRV_VER=5.10.0beta1 +PHP_EXT_SSH2_VER=1.3.1 +PHP_EXT_SWOOLE_VER=4.8.1 +PHP_EXT_YAC_VER=2.3.0 +PHP_EXT_YAF_VER=3.3.3 +PHP_EXT_YACONF_VER=1.1.0 +PHP_EXT_XHPROF_VER=2.3.5 +PHP_EXT_XDEBUG_VER=3.1.1 +PHP_EXT_YAML_VER=2.2.2 +PHP_EXT_ZIP_VER=1.20.0 +PHP_EXT_ZOOKEEPER_VER=1.0.0 +PHP_EXT_ZSTD_VER=0.11.0 + +if [[ -z "$(command -v make)" ]]; then + apk add --no-cache --virtual .deps wget curl autoconf make gcc g++ file #> /dev/null +fi + +# php-dbg php-phpdbg +if [[ -z "$(command -v composer)" ]]; then + apk add --no-cache php8 php8-bcmath php8-brotli php8-bz2 php8-calendar php8-ctype php8-curl php8-dba php8-dev php8-dom php8-embed php8-enchant php8-exif php8-fileinfo php8-fpm php8-ftp php8-gd php8-gettext php8-gmp php8-iconv php8-imap php8-intl php8-ldap php8-mbstring php8-mysqli php8-mysqlnd php8-odbc php8-openssl php8-pcntl php8-pdo php8-pdo_dblib php8-pdo_mysql php8-pdo_odbc php8-pdo_pgsql php8-pdo_sqlite php8-pear php8-pecl-event php8-pecl-imagick php8-pecl-imagick-dev php8-pecl-maxminddb php8-pecl-mcrypt php8-pecl-memcache php8-pecl-memcached php8-pecl-mongodb php8-pecl-msgpack php8-pecl-redis php8-pecl-yaml php8-pgsql php8-phar php8-posix php8-pspell php8-session php8-shmop php8-simplexml php8-snmp php8-soap php8-sockets php8-sodium php8-sqlite3 php8-sysvmsg php8-sysvsem php8-sysvshm php8-tidy php8-tokenizer php8-xml php8-xmlreader php8-xmlwriter php8-xsl php8-zip php8-cgi php8-ffi php8-opcache php8-pecl-apcu php8-pecl-lzf php8-pecl-protobuf php8-pecl-ssh2 php8-pecl-vips php8-pecl-xdebug php8-pecl-xhprof +fi + +# composer config -g repos.packagist composer https://mirrors.cloud.tencent.com/composer +# gpgme-dev +# libevent-dev dep python3 +# alpine included: imagemagick-dev rabbitmq-c-dev libevent-dev yaml-dev libssh2-dev libmemcached-dev +if [[ ! -f "/usr/include/amqp.h" ]]; then + apk add --no-cache rabbitmq-c-dev zlib-dev librdkafka-dev linux-headers leveldb-dev #> /dev/null +fi + +# 重命名可执行文件 方便操作而不用多余的加版本号 +if [[ -f /usr/bin/phar8 ]]; then + cd /usr/bin + rm -fr phar8 + mv phar.phar8 phar + mv php8 php + mv php-cgi8 php-cgi + mv php-config8 php-config + # mv phpdbg8 phpdbg + mv phpize8 phpize + mv /usr/sbin/php-fpm8 /usr/sbin/php-fpm +fi + +ls -lha /usr/bin | grep php + +# 安装最新版本 Composer +if [[ -z "$(command -v composer)" ]]; then + wget -cq --no-check-certificate https://mirrors.aliyun.com/composer/composer.phar -O /usr/bin/composer + chmod +x /usr/bin/composer +fi + +ext_dir=$(php-config --extension-dir) +ini_dir=$(php-config --ini-dir) +ini_file=$(php --ini | grep '^Loaded Configuration File' | awk -F ' ' '{print $4}') +# gnupg gpgme-dev depency qtbase fuck + +# alpine included: event xhprof xdebug ssh2 protobuf imagick igbinary msgpack memcache memcached mongodb redis yaml +# 不兼容 8 scrypt stomp hprose +exts="amqp ev rar rdkafka yac yaf swoole zstd leveldb" + +mkdir -p /tmp/.build/exts && cd /tmp/.build +for ext in ${exts} +do + uext=$(echo $ext | tr 'a-z' 'A-Z') + ext_ver=$(eval echo \$"PHP_EXT_${uext}_VER") + file_url="${ext_url}/${ext}/${ext}-${ext_ver}.tgz" + if [ ! -f "${ext_dir}/${ext}.so" ]; then + if [[ ! -f "/tmp/.build/exts/${ext}-${ext_ver}.tgz" ]]; then + cd /tmp/.build/exts/ && wget -cq $file_url + rm -fr ${ext}-${ext_ver} + tar -xvf ${ext}-${ext_ver}.tgz > /dev/null 2>&1 + fi + + if [[ "${ext}" == 'xhprof' ]]; then + cd "/tmp/.build/exts/${ext}-${ext_ver}/extension" + else + cd "/tmp/.build/exts/${ext}-${ext_ver}" + fi + phpize && ./configure && make -j${CORES} && make install + + if [[ ! -f "${ext_dir}/${ext}.so" ]]; then + echo "$ext install fail" + exit 1 + else + if [[ "$ext" == 'opcache' ]] || [[ "$ext" == 'xdebug' ]]; then + echo "zend_extension=${ext}.so" > ${ini_dir}/${ext}.ini + else + if [[ "$ext" == 'ev' ]]; then + echo "extension=${ext}.so" > ${ini_dir}/zz-${ext}.ini + else + echo "extension=${ext}.so" > ${ini_dir}/${ext}.ini + fi + fi + fi + else + echo "$ext has compiled" + fi +done + +php_two_bit_ver=$(php-config --version | awk -F '.' '{print $1"."$2}') +ioncube_path="/tmp/.build/exts/ioncube" +ioncube_file="ioncube_loader_lin_${php_two_bit_ver}.so" + +if [[ ! -f "${ext_dir}/ioncube.so" ]]; then + echo '==>ioncube installing' + cd /tmp/.build/exts + if [[ ! -d "$ioncube_path" ]]; then + wget -cq "${ext_url}/ioncube/ioncube_loaders_lin_x86-64.tar.gz" + tar -xvf ioncube_loaders_lin_x86-64.tar.gz > /dev/null + fi + + if [[ -f "${ioncube_path}/$ioncube_file" ]]; then + cp "${ioncube_path}/$ioncube_file" "${ext_dir}/ioncube.so" + # echo "zend_extension=ioncube.so" > ${ini_dir}/ioncube.ini + echo "zend_extension=ioncube.so" >> ${ini_file} + else + echo "php version ${ver} is not supported" + fi +else + echo 'ioncube already installed' +fi + +if [[ ! -f "${ext_dir}/sourceguardian.so" ]]; then + echo '==>SourceGuardian 12 installing' + cd /tmp/.build/exts + if [[ ! -d "/tmp/.build/exts/sourceguardian" ]]; then + mkdir -p /tmp/.build/exts/sourceguardian + wget -cq "${ext_url}/sourceguardian/loaders.linux-x86_64.tar.gz" + cd /tmp/.build/exts/sourceguardian + tar -xvf ../loaders.linux-x86_64.tar.gz > /dev/null + fi + + if [[ -f "/tmp/.build/exts/sourceguardian/ixed.${php_two_bit_ver}.lin" ]]; then + cp "/tmp/.build/exts/sourceguardian/ixed.${php_two_bit_ver}.lin" "${ext_dir}/sourceguardian.so" + echo "extension=sourceguardian.so" >> ${ini_file} + else + echo "php version ${ver} is not supported" + fi +else + echo 'sourceguardian already installed' +fi + +apk del .deps > /dev/null diff --git a/images/php/81/Dockerfile b/images/php/81/Dockerfile new file mode 100644 index 00000000..42f884d5 --- /dev/null +++ b/images/php/81/Dockerfile @@ -0,0 +1,29 @@ +FROM ghcr.io/dockenv/alpine:3.16 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv \ + org.opencontainers.image.description='PHP 8.1' + +ENV PHP_VER=81 + +# php81-pecl-couchbase: dynamic library not found, but it exist +RUN apk add --no-cache php81-bcmath php81-brotli php81-bz2 php81-calendar php81-ctype php81-curl php81-dba php81-dom php81-embed php81-enchant php81-exif php81-ffi php81-fileinfo php81-fpm php81-ftp php81-gd php81-gettext php81-gmp php81-iconv php81-imap php81-intl php81-ldap php81-mbstring php81-mysqli php81-mysqlnd php81-odbc php81-opcache php81-openssl php81-pcntl php81-pdo php81-pdo_dblib php81-pdo_mysql php81-pdo_odbc php81-pdo_pgsql php81-pdo_sqlite php81-pecl-amqp php81-pecl-apcu php81-pecl-ast php81-pecl-event php81-pecl-igbinary php81-pecl-imagick php81-pecl-imagick-dev php81-pecl-lzf php81-pecl-mailparse php81-pecl-maxminddb php81-pecl-memcache php81-pecl-memcached php81-pecl-mongodb php81-pecl-msgpack php81-pecl-protobuf php81-pecl-psr php81-pecl-rdkafka php81-pecl-redis php81-pecl-ssh2 php81-pecl-swoole php81-pecl-swoole-dev php81-pecl-uploadprogress php81-pecl-uuid php81-pecl-vips php81-pecl-xdebug php81-pecl-xhprof php81-pecl-xhprof-assets php81-pecl-yaml php81-pecl-zstd php81-pgsql php81-phar php81-posix php81-pspell php81-session php81-shmop php81-simplexml php81-snmp php81-soap php81-sockets php81-sodium php81-sqlite3 php81-sysvmsg php81-sysvsem php81-sysvshm php81-tidy php81-tokenizer php81-xml php81-xmlreader php81-xmlwriter php81-xsl php81-zip \ + && mv /usr/bin/php${PHP_VER} /usr/bin/php \ + && mv /usr/sbin/php-fpm${PHP_VER} /usr/bin/php-fpm \ + && sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/display_errors = .*/display_errors = On/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/memory_limit = .*/memory_limit = 256M/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/date.timezone.*/date.timezone = 'Asia\/Shanghai'/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/upload_max_filesize = .*/upload_max_filesize = 512M/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/post_max_size = .*/post_max_size = 512M/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/max_file_uploads =.*/max_file_uploads = 256/g" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/display_startup_errors =.*/display_startup_errors = On/g" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/log_errors =.*/log_errors = On/g" /etc/php${PHP_VER}/php.ini \ + && sed -i 's/default_charset =.*/default_charset = "UTF-8"/g' /etc/php${PHP_VER}/php.ini \ + && sed -i 's/max_execution_time =.*/max_execution_time = 300/g' /etc/php${PHP_VER}/php.ini \ + && sed -i "s#^pm.max_children.*#pm.max_children = 32#" /etc/php${PHP_VER}/php-fpm.d/*.conf \ + && sed -i "s#^listen =.*#listen = 0.0.0.0:9000#" /etc/php${PHP_VER}/php-fpm.d/*.conf + +EXPOSE 9000 +CMD ["php-fpm","--nodaemonize"] diff --git a/images/php/81/build.sh b/images/php/81/build.sh new file mode 100644 index 00000000..fea55cc4 --- /dev/null +++ b/images/php/81/build.sh @@ -0,0 +1,139 @@ +#!/usr/bin/env bash +### + # @Author: Cloudflying + # @Date: 2021-11-13 20:44:45 + # @LastEditTime: 2022-06-12 18:40:18 + # @LastEditors: Cloudflying + # @Description: + # @FilePath: /dockenv/images/php/81/build.sh +### + +CORES=$(grep -c '^processor' /proc/cpuinfo) +ARCH=$(uname -m) + +ext_url='https://mirrors.xieke.org/Src/php-exts' + +# apk search php81 | grep -v -E 'dbg|dev|apache|embed|couchbase|cgi' | grep -v '\-doc\-' | sort | awk -F '\-[0-9]\.[0-9]' '{print $1}' | tr "\n" ' ' +# ext couchbase: file libcouchbase_php_core.so exist but can't find +if [[ -z "$(command -v composer)" ]]; then + apk add --no-cache php81 php81-bcmath php81-brotli php81-bz2 php81-calendar php81-common php81-ctype php81-curl php81-dba php81-dom php81-enchant php81-exif php81-ffi php81-fileinfo php81-fpm php81-ftp php81-gd php81-gettext php81-gmp php81-iconv php81-imap php81-intl php81-ldap php81-litespeed php81-mbstring php81-mysqli php81-mysqlnd php81-odbc php81-opcache php81-openssl php81-pcntl php81-pdo php81-pdo_dblib php81-pdo_mysql php81-pdo_odbc php81-pdo_pgsql php81-pdo_sqlite php81-pecl-amqp php81-pecl-apcu php81-pecl-ast php81-pecl-event php81-pecl-igbinary php81-pecl-imagick php81-pecl-lzf php81-pecl-mailparse php81-pecl-maxminddb php81-pecl-memcache php81-pecl-memcached php81-pecl-mongodb php81-pecl-msgpack php81-pecl-protobuf php81-pecl-psr php81-pecl-rdkafka php81-pecl-redis php81-pecl-ssh2 php81-pecl-swoole php81-pecl-uploadprogress php81-pecl-uuid php81-pecl-vips php81-pecl-xdebug php81-pecl-xhprof php81-pecl-xhprof-assets php81-pecl-yaml php81-pecl-zstd php81-pgsql php81-phar php81-posix php81-pspell php81-session php81-shmop php81-simplexml php81-snmp php81-soap php81-sockets php81-sodium php81-sqlite3 php81-sysvmsg php81-sysvsem php81-sysvshm php81-tidy php81-tokenizer php81-xml php81-xmlreader php81-xmlwriter php81-xsl php81-zip +fi + +# composer config -g repos.packagist composer https://mirrors.cloud.tencent.com/composer + +# 重命名可执行文件 方便操作而不用多余的加版本号 +if [[ -f /usr/bin/php81 ]]; then + cd /usr/bin + rm -fr phar81 + mv phar.phar81 phar + mv php81 php + # mv php-cgi81 php-cgi + # mv pear81 pear + # mv pecl81 pecl + # php-dev + # mv php-config81 php-config + # mv phpdbg81 phpdbg + # mv phpize81 phpize + mv /usr/sbin/php-fpm81 /usr/sbin/php-fpm +fi + +# 安装最新版本 Composer +if [[ -z "$(command -v composer)" ]]; then + wget -cq --no-check-certificate https://mirrors.aliyun.com/composer/composer.phar -O /usr/bin/composer + chmod +x /usr/bin/composer +fi + +ext_dir=$(php-config --extension-dir) +ini_dir=$(php-config --ini-dir) +ini_file=$(php --ini | grep '^Loaded Configuration File' | awk -F ' ' '{print $4}') +# gnupg gpgme-dev depency qtbase fuck + +# alpine included: event xhprof xdebug ssh2 protobuf imagick igbinary msgpack memcache memcached mongodb redis yaml +# 不兼容 8 scrypt stomp hprose +# amqp rdkafka swoole zstd +# leveldb not maintained +# exts="ev rar yac yaf" + +mkdir -p /tmp/.build/exts && cd /tmp/.build +# for ext in ${exts} +# do +# uext=$(echo $ext | tr 'a-z' 'A-Z') +# ext_ver=$(eval echo \$"PHP_EXT_${uext}_VER") +# file_url="${ext_url}/${ext}/${ext}-${ext_ver}.tgz" +# if [ ! -f "${ext_dir}/${ext}.so" ]; then +# if [[ ! -f "/tmp/.build/exts/${ext}-${ext_ver}.tgz" ]]; then +# cd /tmp/.build/exts/ && wget -cq $file_url +# rm -fr ${ext}-${ext_ver} +# tar -xvf ${ext}-${ext_ver}.tgz > /dev/null 2>&1 +# fi + +# if [[ "${ext}" == 'xhprof' ]]; then +# cd "/tmp/.build/exts/${ext}-${ext_ver}/extension" +# else +# cd "/tmp/.build/exts/${ext}-${ext_ver}" +# fi +# phpize && ./configure && make -j${CORES} && make install + +# if [[ ! -f "${ext_dir}/${ext}.so" ]]; then +# echo "$ext install fail" +# exit 1 +# else +# if [[ "$ext" == 'opcache' ]] || [[ "$ext" == 'xdebug' ]]; then +# echo "zend_extension=${ext}.so" > ${ini_dir}/${ext}.ini +# else +# if [[ "$ext" == 'ev' ]]; then +# echo "extension=${ext}.so" > ${ini_dir}/zz-${ext}.ini +# else +# echo "extension=${ext}.so" > ${ini_dir}/${ext}.ini +# fi +# fi +# fi +# else +# echo "$ext has compiled" +# fi +# done + +# php_two_bit_ver=$(php-config --version | awk -F '.' '{print $1"."$2}') +php_two_bit_ver=$(php -v | head -n 1 | awk -F ' ' '{print $2}' | awk -F '.' '{print $1"."$2}') +ioncube_path="/tmp/.build/exts/ioncube" +ioncube_file="ioncube_loader_lin_${php_two_bit_ver}.so" + +if [[ ! -f "${ext_dir}/ioncube.so" ]]; then + echo '==>ioncube installing' + cd /tmp/.build/exts + if [[ ! -d "$ioncube_path" ]]; then + wget -cq "${ext_url}/ioncube/ioncube_loaders_lin_x86-64.tar.gz" + tar -xvf ioncube_loaders_lin_x86-64.tar.gz > /dev/null + fi + + if [[ -f "${ioncube_path}/$ioncube_file" ]]; then + cp "${ioncube_path}/$ioncube_file" "${ext_dir}/ioncube.so" + # echo "zend_extension=ioncube.so" > ${ini_dir}/ioncube.ini + echo "zend_extension=ioncube.so" >> ${ini_file} + else + echo "php version ${ver} is not supported" + fi +else + echo 'ioncube already installed' +fi + +# if [[ ! -f "${ext_dir}/sourceguardian.so" ]]; then +# echo '==>SourceGuardian 12 installing' +# cd /tmp/.build/exts +# if [[ ! -d "/tmp/.build/exts/sourceguardian" ]]; then +# mkdir -p /tmp/.build/exts/sourceguardian +# wget -cq "${ext_url}/sourceguardian/loaders.linux-x86_64.tar.gz" +# cd /tmp/.build/exts/sourceguardian +# tar -xvf ../loaders.linux-x86_64.tar.gz > /dev/null +# fi + +# if [[ -f "/tmp/.build/exts/sourceguardian/ixed.${php_two_bit_ver}.lin" ]]; then +# cp "/tmp/.build/exts/sourceguardian/ixed.${php_two_bit_ver}.lin" "${ext_dir}/sourceguardian.so" +# echo "extension=sourceguardian.so" >> ${ini_file} +# else +# echo "php version ${ver} is not supported" +# fi +# else +# echo 'sourceguardian already installed' +# fi +rm -fr /tmp/.build diff --git a/images/php/82/Dockerfile b/images/php/82/Dockerfile new file mode 100644 index 00000000..6a3f24c2 --- /dev/null +++ b/images/php/82/Dockerfile @@ -0,0 +1,29 @@ +FROM ghcr.io/dockenv/alpine:edge + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv \ + org.opencontainers.image.description='PHP 8.2.0' + +ENV PHP_VER=82 + +RUN echo "https://repo.huaweicloud.com/alpine/edge/testing" >> /etc/apk/repositories \ + && apk add --no-cache php82-bcmath php82-bz2 php82-calendar php82-ctype php82-curl php82-dba php82-dom php82-embed php82-enchant php82-exif php82-ffi php82-fileinfo php82-fpm php82-ftp php82-gd php82-gettext php82-gmp php82-iconv php82-imap php82-intl php82-ldap php82-mbstring php82-mysqli php82-mysqlnd php82-odbc php82-opcache php82-openssl php82-pcntl php82-pdo php82-pdo_dblib php82-pdo_mysql php82-pdo_odbc php82-pdo_pgsql php82-pdo_sqlite php82-pecl-apcu php82-pecl-igbinary php82-pecl-redis php82-pecl-uploadprogress php82-pecl-xdebug php82-pecl-xhprof php82-pecl-xhprof-assets php82-pecl-yaml php82-pgsql php82-phar php82-posix php82-pspell php82-session php82-shmop php82-simplexml php82-snmp php82-soap php82-sockets php82-sodium php82-sqlite3 php82-sysvmsg php82-sysvsem php82-sysvshm php82-tidy php82-tokenizer php82-xml php82-xmlreader php82-xmlwriter php82-xsl php82-zip \ + && mv /usr/bin/php${PHP_VER} /usr/bin/php \ + && mv /usr/sbin/php-fpm${PHP_VER} /usr/bin/php-fpm \ + && sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/display_errors = .*/display_errors = On/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/memory_limit = .*/memory_limit = 256M/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/date.timezone.*/date.timezone = 'Asia\/Shanghai'/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/upload_max_filesize = .*/upload_max_filesize = 512M/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/post_max_size = .*/post_max_size = 512M/" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/max_file_uploads =.*/max_file_uploads = 256/g" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/display_startup_errors =.*/display_startup_errors = On/g" /etc/php${PHP_VER}/php.ini \ + && sed -i "s/log_errors =.*/log_errors = On/g" /etc/php${PHP_VER}/php.ini \ + && sed -i 's/default_charset =.*/default_charset = "UTF-8"/g' /etc/php${PHP_VER}/php.ini \ + && sed -i 's/max_execution_time =.*/max_execution_time = 300/g' /etc/php${PHP_VER}/php.ini \ + && sed -i "s#^pm.max_children.*#pm.max_children = 32#" /etc/php${PHP_VER}/php-fpm.d/*.conf \ + && sed -i "s#^listen =.*#listen = 0.0.0.0:9000#" /etc/php${PHP_VER}/php-fpm.d/*.conf + +EXPOSE 9000 +CMD ["php-fpm","--nodaemonize"] diff --git a/images/php/Dockerfile b/images/php/Dockerfile deleted file mode 100644 index 65d2f0dd..00000000 --- a/images/php/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -FROM registry.cn-hongkong.aliyuncs.com/imxieke/ubuntu:bionic - -LABEL DEBIAN_FRONTEND noninteractive\ - MAINTAINER="Cloudflying" \ - MAIL="oss@live.hk" - -ADD script/build.sh /tmp/build.sh -ADD script/tz.php /var/www/index.php -ADD conf/nginx.conf /etc/nginx/ -ADD conf/default.conf /etc/nginx/conf.d/ - -RUN sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \ - && chmod +x /tmp/build.sh \ - && bash /tmp/build.sh - -EXPOSE 80 443 -CMD /bin/phpenv \ No newline at end of file diff --git a/images/php/Dockerfile.alpine b/images/php/Dockerfile.alpine deleted file mode 100644 index 80d60288..00000000 --- a/images/php/Dockerfile.alpine +++ /dev/null @@ -1,40 +0,0 @@ -# FROM registry.cn-hongkong.aliyuncs.com/imxieke/alpine:latest -FROM alpine:edge - -LABEL MAINTAINER="Cloudflying" \ - MAIL="im@xie.ke" - -ADD alpine/scripts/alpine.sh /bin/build -ADD alpine/scripts/start /bin/start -RUN apk update && \ - mkdir -p /run/openrc /run/nginx && touch /run/openrc/softlevel && \ - apk add --no-cache libc-dev imagemagick-dev openrc && \ - apk add --no-cache nginx php7 php7-bcmath php7-bz2 php7-calendar php7-common php7-ctype php7-curl php7-dba \ - php7-dev php7-dom php7-embed php7-enchant php7-exif php7-fileinfo php7-fpm php7-ftp php7-gd \ - php7-gettext php7-gmp php7-iconv php7-imap php7-intl php7-json php7-ldap php7-litespeed php7-mbstring php7-mysqli \ - php7-mysqlnd php7-odbc php7-opcache php7-openssl php7-pcntl php7-pdo php7-pdo_dblib php7-pdo_mysql php7-pdo_odbc \ - php7-pdo_pgsql php7-pdo_sqlite php7-pear php7-pecl-amqp php7-pecl-apcu php7-pecl-event \ - php7-pecl-igbinary php7-pecl-imagick php7-pecl-imagick-dev php7-pecl-lzf php7-pecl-mcrypt php7-pecl-memcached \ - php7-pecl-msgpack php7-pecl-oauth php7-pecl-protobuf php7-pecl-redis php7-pecl-ssh2 php7-pecl-vips \ - php7-pecl-xdebug php7-pecl-xhprof php7-pecl-yaml php7-pecl-zmq php7-pgsql php7-phalcon php7-phar php7-phpdbg \ - php7-posix php7-pspell php7-recode php7-session php7-shmop php7-simplexml php7-snmp php7-soap php7-sockets \ - php7-sodium php7-sqlite3 php7-static php7-sysvmsg php7-sysvsem php7-sysvshm php7-tidy php7-tokenizer \ - php7-wddx php7-xml php7-xmlreader php7-xmlrpc php7-xmlwriter php7-xsl php7-zip php7-pecl-mailparse \ - && rm -fr /etc/nginx/nginx.conf \ - && rm -fr /etc/nginx/conf.d/* \ - && touch /run/nginx/nginx.pid \ - && chmod 777 -R /var/www \ - && rm -fr /etc/php7/php.ini \ - && chmod +x /bin/build \ - && chmod +x /bin/start \ - && rm -fr /var/cache/apk/* - # apk add --no-cache gcc g++ make automake autoconf libc-dev imagemagick-dev openrc && \ - # && /bin/build \ - # && apk del gcc g++ make automake autoconf libc-dev \ - -ADD alpine/conf.d/nginx.conf /etc/nginx/ -ADD alpine/conf.d/default.conf /etc/nginx/conf.d/ -# ADD alpine/conf.d/php.ini /etc/php7/ -ADD alpine/conf.d/index.php /var/www - -CMD /bin/start \ No newline at end of file diff --git a/images/php/Dockerfile.alpine-cli b/images/php/Dockerfile.alpine-cli deleted file mode 100644 index 14ebc03d..00000000 --- a/images/php/Dockerfile.alpine-cli +++ /dev/null @@ -1,28 +0,0 @@ -FROM registry.cn-hongkong.aliyuncs.com/imxieke/alpine:latest - -LABEL MAINTAINER="Sky" \ - MAIL="Sky@gfw.party" - -ADD scripts/build.sh /bin/build -ADD scripts/start /bin/start -RUN apk update \ - && apk add --no-cache gcc g++ make automake autoconf libc-dev imagemagick-dev \ - && apk add --no-cache nginx php7 php7-common php7-intl php7-openssl php7-dba php7-sqlite3 php7-pear php7-tokenizer php7-phpdbg php7-litespeed php7-gmp php7-pdo_mysql php7-oauth php7-xsl php7-fpm php7-mysqlnd php7-enchant php7-pspell php7-redis php7-snmp php7-pcntl php7-doc php7-fileinfo php7-mbstring php7-dev php7-xmlrpc php7-xmlreader php7-pdo_sqlite php7-exif php7-recode php7-opcache php7-ldap php7-posix php7-session php7-gd php7-gettext php7-mailparse php7-json php7-xml php7-iconv php7-sysvshm php7-curl php7-shmop php7-odbc php7-phar php7-pdo_pgsql php7-imap php7-pdo_dblib php7-pgsql php7-pdo_odbc php7-xdebug php7-zip php7-ctype php7-amqp php7-mcrypt php7-bcmath php7-calendar php7-tidy php7-dom php7-sockets php7-zmq php7-memcached php7-soap php7-apcu php7-sysvmsg php7-zlib php7-imagick-dev php7-embed php7-ftp php7-pdo php7-bz2 php7-mysqli php7-simplexml php7-xmlwriter \ - && rm -fr /etc/nginx/nginx.conf \ - && mkdir - p /run/nginx/ \ - && rm -fr /etc/nginx/conf.d/* \ - && touch /run/nginx/nginx.pid \ - && chmod 777 -R /var/www \ - && rm -fr /etc/php7/php.ini \ - && chmod +x /bin/build \ - && chmod +x /bin/start \ - && /bin/build \ - && apk del gcc g++ make automake autoconf libc-dev \ - && rm -fr /var/cache/apk/* - -ADD conf.d/nginx.conf /etc/nginx/ -ADD conf.d/default.conf /etc/nginx/conf.d/ -ADD conf.d/php.ini /etc/php7/ -ADD conf.d/index.php /var/www - -CMD /bin/start \ No newline at end of file diff --git a/images/php/Dockerfile.multiple b/images/php/Dockerfile.multiple deleted file mode 100644 index 472515a7..00000000 --- a/images/php/Dockerfile.multiple +++ /dev/null @@ -1,16 +0,0 @@ -FROM imxieke/ubuntu:bionic - -LABEL MAINTAINER="Cloudflying" \ - MAIL="oss@live.hk" - -ADD script/env.sh /bin/env.sh -ADD script/start.sh /bin/start.sh -ADD conf.d/index.php /var/www/ -RUN sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \ - && chmod +x /bin/env.sh \ - && chmod +x /bin/start.sh \ - && bash /bin/env.sh - -ADD conf.d/*.example /etc/nginx/conf.d/ -EXPOSE 80 443 -CMD /bin/start.sh \ No newline at end of file diff --git a/images/php/README.md b/images/php/README.md index 598349e1..eb5c51be 100644 --- a/images/php/README.md +++ b/images/php/README.md @@ -1,44 +1,43 @@ # Docker PHP Images -Alpine: Nginx + PHP7 - -Ubuntu: - - PHP7.2 - - nginx - - MemCache - - Redis - - Mongo - - Yaf - - yar - - Yaml - - Swoole - - Iooncube - - And More PHP Base Extension, View Via : php --ini - - # PHP 7.2 - -#feature - -* swoole -* redis -* mongodb -* memcache -* memcached -* igbinary 序列化和反序列化 Igbinary is a drop in replacement for the standard php serializer. -* lzf LZF compression -* protobuf Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data. -* vips image processing library -* mcrypt 加密扩展库 自带的22种加密解密算法 -* sysvsem 消息队列 -* sysvshm 内存共享方案 -* tokenizer 提供内嵌在Zend引擎的 PHP tokenizer 的调用接口 可以写出你自己的PHP源码分析或者修改工具,而无需处理词法分析级别上的语言规范 -* wddx Web分布式数据交换 -* xml XML 解析器 -* xmlreader XML Pull 解析器 -* xmlrpc -* xmlwriter libxml xmlWriter API 提供非缓存 只能转发的方式来生成包含XML数据的流或文件 -* xsl 扩展样式表语言 -* zip -* gmagick 图像处理 - -PS: zlib 合并到 php7-common 中了 \ No newline at end of file +## Version Infomation +- php + - 5.6.40 3.8 + - 7.0.33 3.5 + - 7.1.33 3.5 + - 7.2.33 3.5 + - 7.3.33 3.5 + - 7.4.30 edge testing + - 8.0.20 3.16 + - 8.1.7 3.16 + - 8.2.0 edge testing + +## Filter php and components +`apk list | grep '^php81' | sort | grep -Ev 'installed|dbg|apache|cgi|doc|pear|litespeed|dev'| awk -F '-[0-9]' '{print $1}' | tr '\n' ' '` + +## php and extension version + +| PHP | php | Nginx | Redis | Memcached | Swoole | ioncube | +| ------ | ------------------- | --------- | --------- | --------- | --- | --- | +| 5.6.40 | 5.6.38,7.0.33 | 1.10.3-r1 | 3.2.12-r0 | 1.4.33-r2 | todo |√| +| 7.0.33 | 5.6.40,7.1.17 | 1.12.2-r2 | 3.2.12-r0 | 1.4.36-r2 | todo |√| +| 7.1.33 | 5.6.40,7.1.33 | 1.12.2-r4 | 4.0.14-r0 | 1.5.6-r0 | todo |√| +| 7.2.33 | 5.6.40,7.2.26 | 1.14.2-r2 | 4.0.14-r0 | 1.5.8-r0 | todo |√| +| 7.3.33 | 7.2.33 | 1.14.2-r5 | 4.0.14-r0 | 1.5.12-r0 | todo |√| +| 7.4.30 | 7.3.14 | 1.16.1 | 5.0.11-r0 | 1.5.16-r0 | 4.8.10 |√| +| 8.0.12 | 7.3.2 | 1.16.1 | 5.0.14-r0 | 1.5.20-r0 | 4.8.10 |x| +| 8.1.7 | 7.3.33 | 1.18.0 | 5.0.14-r0 | 1.6.6-r0 | 4.8.10 |x| +| 8.2.0 | 7.4.24,8.0.12 | 1.18.0 | 6.0.16-r0 | 1.6.9-r0 | x |x| + +>PS: `x` is Unsupported + +## extensions +- php 5.6 + - installed: apc apcu bcmath bz2 calendar Core ctype curl date dba dom enchant ereg exif fileinfo filter ftp gd gettext gmp hash iconv imap intl json ldap libxml mbstring mcrypt mssql mysql mysqli mysqlnd odbc openssl pcntl pcre PDO pdo_dblib pdo_mysql PDO_ODBC pdo_pgsql pdo_sqlite pgsql Phar posix pspell readline Reflection session shmop SimpleXML snmp soap sockets SPL sqlite3 standard suhosin sysvmsg sysvsem sysvshm tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl Zend OPcache zip zlib + - todo: redis mongo memcached swoole ionCube phalcon ImageMagick GMagick Source Guardian, Xdebug Zend Optimizer, MSSql +- 8.2 + - todo: ImageMagick, ionCube ,OPcache JIT ,Phalcon,Source Guardian,Xdebug,Swoole,Memcache,Memcached + + +## DEPRECATED +- wddx removed in 7.4.0 diff --git a/images/php/alpine/README.md b/images/php/alpine/README.md deleted file mode 100644 index 1d955cb9..00000000 --- a/images/php/alpine/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# PHP 7 Image - -Nginx PHP-fpm 7.1.2 - -Extensions: -``` - Redis - Swoole - Rar - Imagick - Mysql - Sqlite3 - Socket - Pgsql - ``` diff --git a/images/php/alpine/conf.d/default.conf b/images/php/alpine/conf.d/default.conf deleted file mode 100644 index d96b73ca..00000000 --- a/images/php/alpine/conf.d/default.conf +++ /dev/null @@ -1,50 +0,0 @@ -server - { - listen 80; - server_name _; - index index.html index.htm index.php; - root /var/www; - - #error_page 404 /404.html; - location ~ [^/]\.php(/|$) - { - try_files $uri =404; - #fastcgi_pass unix:/tmp/php-cgi-70.sock; - fastcgi_pass 127.0.0.1:9000; - fastcgi_index index.php; - include fastcgi.conf; - set $real_script_name $fastcgi_script_name; - if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { - set $real_script_name $1; - set $path_info $2; - } - fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; - fastcgi_param SCRIPT_NAME $real_script_name; - fastcgi_param PATH_INFO $path_info; - } - - location /nginx_status - { - stub_status on; - access_log off; - allow 127.0.0.1; - deny all; - } - - location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ - { - expires 30d; - } - - location ~ .*\.(js|css)?$ - { - expires 12h; - } - - location ~ /\. - { - deny all; - } - - access_log /var/log/nginx/access.log; - } \ No newline at end of file diff --git a/images/php/alpine/conf.d/index.php b/images/php/alpine/conf.d/index.php deleted file mode 100644 index 1b83fa37..00000000 --- a/images/php/alpine/conf.d/index.php +++ /dev/null @@ -1,1472 +0,0 @@ -=0; $l--) - { - $allsize1[$l]=floor($size/pow(1024,$l)); - $allsize[$l]=$allsize1[$l]-$allsize1[$l+1]*1024; - } - - $len=count($allsize); - - for($j = $len-1; $j >=0; $j--) - { - $fsize=$fsize.$allsize[$j].$danwei[$j]; - } - return $fsize; -} - -function valid_email($str) -{ - return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE; -} - -//检测PHP设置参数 -function show($varName) -{ - switch($result = get_cfg_var($varName)) - { - case 0: - return '×'; - break; - - case 1: - return ''; - break; - - default: - return $result; - break; - } -} - -//保留服务器性能测试结果 -$valInt = isset($_POST['pInt']) ? $_POST['pInt'] : "No Test"; -$valFloat = isset($_POST['pFloat']) ? $_POST['pFloat'] : "No Test"; -$valIo = isset($_POST['pIo']) ? $_POST['pIo'] : "No Test"; - -if ($_GET['act'] == "phpinfo") -{ - phpinfo(); - exit(); -} -elseif($_POST['act'] == "Int Test") -{ - $valInt = test_int(); -} -elseif($_POST['act'] == "Float Test") -{ - $valFloat = test_float(); -} -elseif($_POST['act'] == "IO Test") -{ - $valIo = test_io(); -} -//网速测试-开始 -elseif($_POST['act']=="Start Test") -{ -?> - - "; - } - ?> - -"; - Echo "This shows all the functions supported by the system, and custom functions\n"; - print_r($arr); - echo ""; - exit(); -}elseif($_GET['act'] == "disable_functions") -{ - $disFuns=get_cfg_var("disable_functions"); - if(empty($disFuns)) - { - $arr = '×'; - } - else - { - $arr = $disFuns; - } - Function php() - { - } - echo "
";
-	Echo "This shows all the functions disable by the system\n";
-	print_r($arr);
-	echo "
"; - exit(); -} - -//MySQL检测 -if ($_POST['act'] == 'MySQL Test') -{ - $host = isset($_POST['host']) ? trim($_POST['host']) : ''; - $port = isset($_POST['port']) ? (int) $_POST['port'] : ''; - $login = isset($_POST['login']) ? trim($_POST['login']) : ''; - $password = isset($_POST['password']) ? trim($_POST['password']) : ''; - $host = preg_match('~[^a-z0-9\-\.]+~i', $host) ? '' : $host; - $port = intval($port) ? intval($port) : ''; - $login = preg_match('~[^a-z0-9\_\-]+~i', $login) ? '' : htmlspecialchars($login); - $password = is_string($password) ? htmlspecialchars($password) : ''; -} -elseif ($_POST['act'] == 'Function Test') -{ - $funRe = "Function".$_POST['funName']."Test results support the position: ".isfun1($_POST['funName']); -} -elseif ($_POST['act'] == 'Mail Test') -{ - $mailRe = "Mail test results: send"; - if($_SERVER['SERVER_PORT']==80){$mailContent = "http://".$_SERVER['SERVER_NAME'].($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']);} - else{$mailContent = "http://".$_SERVER['SERVER_NAME'].":".$_SERVER['SERVER_PORT'].($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']);} - $mailRe .= (false !== @mail($_POST["mailAdd"], $mailContent, "This is a test mail!")) ? "Complete":"Failure"; -} - -//网络速度测试 -if(isset($_POST['speed'])) -{ - $speed=round(100/($_POST['speed']/1000),2); -} -elseif($_GET['speed']=="0") -{ - $speed=6666.67; -} -elseif(isset($_GET['speed']) and $_GET['speed']>0) -{ - $speed=round(100/($_GET['speed']/1000),2); //下载速度: $speed kb/s -} -else -{ - $speed=" No Test "; -} - - -// 检测函数支持 -function isfun($funName = '') -{ - if (!$funName || trim($funName) == '' || preg_match('~[^a-z0-9\_]+~i', $funName, $tmp)) return '错误'; - return (false !== function_exists($funName)) ? '' : '×'; -} -function isfun1($funName = '') -{ - if (!$funName || trim($funName) == '' || preg_match('~[^a-z0-9\_]+~i', $funName, $tmp)) return '错误'; - return (false !== function_exists($funName)) ? '√' : '×'; -} - -//整数运算能力测试 -function test_int() -{ - $timeStart = gettimeofday(); - for($i = 0; $i < 3000000; $i++) - { - $t = 1+1; - } - $timeEnd = gettimeofday(); - $time = ($timeEnd["usec"]-$timeStart["usec"])/1000000+$timeEnd["sec"]-$timeStart["sec"]; - $time = round($time, 3)." Second"; - return $time; -} - -//浮点运算能力测试 -function test_float() -{ - //得到圆周率值 - $t = pi(); - $timeStart = gettimeofday(); - - for($i = 0; $i < 3000000; $i++) - { - //开平方 - sqrt($t); - } - - $timeEnd = gettimeofday(); - $time = ($timeEnd["usec"]-$timeStart["usec"])/1000000+$timeEnd["sec"]-$timeStart["sec"]; - $time = round($time, 3)."Second"; - return $time; -} - -//IO能力测试 -function test_io() -{ - $fp = @fopen(PHPSELF, "r"); - $timeStart = gettimeofday(); - for($i = 0; $i < 10000; $i++) - { - @fread($fp, 10240); - @rewind($fp); - } - $timeEnd = gettimeofday(); - @fclose($fp); - $time = ($timeEnd["usec"]-$timeStart["usec"])/1000000+$timeEnd["sec"]-$timeStart["sec"]; - $time = round($time, 3)."Second"; - return($time); -} - -function GetCoreInformation() {$data = file('/proc/stat');$cores = array();foreach( $data as $line ) {if( preg_match('/^cpu[0-9]/', $line) ){$info = explode(' ', $line);$cores[]=array('user'=>$info[1],'nice'=>$info[2],'sys' => $info[3],'idle'=>$info[4],'iowait'=>$info[5],'irq' => $info[6],'softirq' => $info[7]);}}return $cores;} -function GetCpuPercentages($stat1, $stat2) {if(count($stat1)!==count($stat2)){return;}$cpus=array();for( $i = 0, $l = count($stat1); $i < $l; $i++) { $dif = array(); $dif['user'] = $stat2[$i]['user'] - $stat1[$i]['user'];$dif['nice'] = $stat2[$i]['nice'] - $stat1[$i]['nice']; $dif['sys'] = $stat2[$i]['sys'] - $stat1[$i]['sys'];$dif['idle'] = $stat2[$i]['idle'] - $stat1[$i]['idle'];$dif['iowait'] = $stat2[$i]['iowait'] - $stat1[$i]['iowait'];$dif['irq'] = $stat2[$i]['irq'] - $stat1[$i]['irq'];$dif['softirq'] = $stat2[$i]['softirq'] - $stat1[$i]['softirq'];$total = array_sum($dif);$cpu = array();foreach($dif as $x=>$y) $cpu[$x] = round($y / $total * 100, 2);$cpus['cpu' . $i] = $cpu;}return $cpus;} -$stat1 = GetCoreInformation();sleep(1);$stat2 = GetCoreInformation();$data = GetCpuPercentages($stat1, $stat2); -$cpu_show = $data['cpu0']['user']."%us, ".$data['cpu0']['sys']."%sy, ".$data['cpu0']['nice']."%ni, ".$data['cpu0']['idle']."%id, ".$data['cpu0']['iowait']."%wa, ".$data['cpu0']['irq']."%irq, ".$data['cpu0']['softirq']."%softirq"; -function makeImageUrl($title, $data) {$api='http://api.yahei.net/tz/cpu_show.php?id=';$url.=$data['user'].',';$url.=$data['nice'].',';$url.=$data['sys'].',';$url.=$data['idle'].',';$url.=$data['iowait'];$url.='&chdl=User|Nice|Sys|Idle|Iowait&chdlp=b&chl=';$url.=$data['user'].'%25|';$url.=$data['nice'].'%25|';$url.=$data['sys'].'%25|';$url.=$data['idle'].'%25|';$url.=$data['iowait'].'%25';$url.='&chtt=Core+'.$title;return $api.base64_encode($url);} -if($_GET['act'] == "cpu_percentage"){echo "
Slow image loading, please be patient!

";foreach( $data as $k => $v ) {echo '';}echo "
";exit();} - -// 根据不同系统取得CPU相关信息 -switch(PHP_OS) -{ - case "Linux": - $sysReShow = (false !== ($sysInfo = sys_linux()))?"show":"none"; - break; - - case "FreeBSD": - $sysReShow = (false !== ($sysInfo = sys_freebsd()))?"show":"none"; - break; - -/* - case "WINNT": - $sysReShow = (false !== ($sysInfo = sys_windows()))?"show":"none"; - break; -*/ - - default: - break; -} - -//linux系统探测 -function sys_linux() -{ - // CPU - if (false === ($str = @file("/proc/cpuinfo"))) return false; - $str = implode("", $str); - @preg_match_all("/model\s+name\s{0,}\:+\s{0,}([\w\s\)\(\@.-]+)([\r\n]+)/s", $str, $model); - @preg_match_all("/cpu\s+MHz\s{0,}\:+\s{0,}([\d\.]+)[\r\n]+/", $str, $mhz); - @preg_match_all("/cache\s+size\s{0,}\:+\s{0,}([\d\.]+\s{0,}[A-Z]+[\r\n]+)/", $str, $cache); - @preg_match_all("/bogomips\s{0,}\:+\s{0,}([\d\.]+)[\r\n]+/", $str, $bogomips); - if (false !== is_array($model[1])) - { - $res['cpu']['num'] = sizeof($model[1]); - /* - for($i = 0; $i < $res['cpu']['num']; $i++) - { - $res['cpu']['model'][] = $model[1][$i].' ('.$mhz[1][$i].')'; - $res['cpu']['mhz'][] = $mhz[1][$i]; - $res['cpu']['cache'][] = $cache[1][$i]; - $res['cpu']['bogomips'][] = $bogomips[1][$i]; - }*/ - if($res['cpu']['num']==1) - $x1 = ''; - else - $x1 = ' ×'.$res['cpu']['num']; - $mhz[1][0] = ' | Frequency:'.$mhz[1][0]; - $cache[1][0] = ' | Secondary cache:'.$cache[1][0]; - $bogomips[1][0] = ' | Bogomips:'.$bogomips[1][0]; - $res['cpu']['model'][] = $model[1][0].$mhz[1][0].$cache[1][0].$bogomips[1][0].$x1; - if (false !== is_array($res['cpu']['model'])) $res['cpu']['model'] = implode("
", $res['cpu']['model']); - if (false !== is_array($res['cpu']['mhz'])) $res['cpu']['mhz'] = implode("
", $res['cpu']['mhz']); - if (false !== is_array($res['cpu']['cache'])) $res['cpu']['cache'] = implode("
", $res['cpu']['cache']); - if (false !== is_array($res['cpu']['bogomips'])) $res['cpu']['bogomips'] = implode("
", $res['cpu']['bogomips']); - } - - // NETWORK - - // UPTIME - if (false === ($str = @file("/proc/uptime"))) return false; - $str = explode(" ", implode("", $str)); - $str = trim($str[0]); - $min = $str / 60; - $hours = $min / 60; - $days = floor($hours / 24); - $hours = floor($hours - ($days * 24)); - $min = floor($min - ($days * 60 * 24) - ($hours * 60)); - if ($days !== 0) $res['uptime'] = $days."Day"; - if ($hours !== 0) $res['uptime'] .= $hours."Hour"; - $res['uptime'] .= $min."Minute"; - - // MEMORY - if (false === ($str = @file("/proc/meminfo"))) return false; - $str = implode("", $str); - preg_match_all("/MemTotal\s{0,}\:+\s{0,}([\d\.]+).+?MemFree\s{0,}\:+\s{0,}([\d\.]+).+?Cached\s{0,}\:+\s{0,}([\d\.]+).+?SwapTotal\s{0,}\:+\s{0,}([\d\.]+).+?SwapFree\s{0,}\:+\s{0,}([\d\.]+)/s", $str, $buf); - preg_match_all("/Buffers\s{0,}\:+\s{0,}([\d\.]+)/s", $str, $buffers); - - $res['memTotal'] = round($buf[1][0]/1024, 2); - $res['memFree'] = round($buf[2][0]/1024, 2); - $res['memBuffers'] = round($buffers[1][0]/1024, 2); - $res['memCached'] = round($buf[3][0]/1024, 2); - $res['memUsed'] = $res['memTotal']-$res['memFree']; - $res['memPercent'] = (floatval($res['memTotal'])!=0)?round($res['memUsed']/$res['memTotal']*100,2):0; - - $res['memRealUsed'] = $res['memTotal'] - $res['memFree'] - $res['memCached'] - $res['memBuffers']; //真实内存使用 - $res['memRealFree'] = $res['memTotal'] - $res['memRealUsed']; //真实空闲 - $res['memRealPercent'] = (floatval($res['memTotal'])!=0)?round($res['memRealUsed']/$res['memTotal']*100,2):0; //真实内存使用率 - - $res['memCachedPercent'] = (floatval($res['memCached'])!=0)?round($res['memCached']/$res['memTotal']*100,2):0; //Cached内存使用率 - - $res['swapTotal'] = round($buf[4][0]/1024, 2); - $res['swapFree'] = round($buf[5][0]/1024, 2); - $res['swapUsed'] = round($res['swapTotal']-$res['swapFree'], 2); - $res['swapPercent'] = (floatval($res['swapTotal'])!=0)?round($res['swapUsed']/$res['swapTotal']*100,2):0; - - // LOAD AVG - if (false === ($str = @file("/proc/loadavg"))) return false; - $str = explode(" ", implode("", $str)); - $str = array_chunk($str, 4); - $res['loadAvg'] = implode(" ", $str[0]); - - return $res; -} - -//FreeBSD系统探测 -function sys_freebsd() -{ - //CPU - if (false === ($res['cpu']['num'] = get_key("hw.ncpu"))) return false; - $res['cpu']['model'] = get_key("hw.model"); - //LOAD AVG - if (false === ($res['loadAvg'] = get_key("vm.loadavg"))) return false; - //UPTIME - if (false === ($buf = get_key("kern.boottime"))) return false; - $buf = explode(' ', $buf); - $sys_ticks = time() - intval($buf[3]); - $min = $sys_ticks / 60; - $hours = $min / 60; - $days = floor($hours / 24); - $hours = floor($hours - ($days * 24)); - $min = floor($min - ($days * 60 * 24) - ($hours * 60)); - if ($days !== 0) $res['uptime'] = $days."Day"; - if ($hours !== 0) $res['uptime'] .= $hours."Hour"; - $res['uptime'] .= $min."Minute"; - //MEMORY - if (false === ($buf = get_key("hw.physmem"))) return false; - $res['memTotal'] = round($buf/1024/1024, 2); - - $str = get_key("vm.vmtotal"); - preg_match_all("/\nVirtual Memory[\:\s]*\(Total[\:\s]*([\d]+)K[\,\s]*Active[\:\s]*([\d]+)K\)\n/i", $str, $buff, PREG_SET_ORDER); - preg_match_all("/\nReal Memory[\:\s]*\(Total[\:\s]*([\d]+)K[\,\s]*Active[\:\s]*([\d]+)K\)\n/i", $str, $buf, PREG_SET_ORDER); - - $res['memRealUsed'] = round($buf[0][2]/1024, 2); - $res['memCached'] = round($buff[0][2]/1024, 2); - $res['memUsed'] = round($buf[0][1]/1024, 2) + $res['memCached']; - $res['memFree'] = $res['memTotal'] - $res['memUsed']; - $res['memPercent'] = (floatval($res['memTotal'])!=0)?round($res['memUsed']/$res['memTotal']*100,2):0; - - $res['memRealPercent'] = (floatval($res['memTotal'])!=0)?round($res['memRealUsed']/$res['memTotal']*100,2):0; - - return $res; -} - -//取得参数值 FreeBSD -function get_key($keyName) -{ - return do_command('sysctl', "-n $keyName"); -} - -//确定执行文件位置 FreeBSD -function find_command($commandName) -{ - $path = array('/bin', '/sbin', '/usr/bin', '/usr/sbin', '/usr/local/bin', '/usr/local/sbin'); - foreach($path as $p) - { - if (@is_executable("$p/$commandName")) return "$p/$commandName"; - } - return false; -} - -//执行系统命令 FreeBSD -function do_command($commandName, $args) -{ - $buffer = ""; - if (false === ($command = find_command($commandName))) return false; - if ($fp = @popen("$command $args", 'r')) - { - while (!@feof($fp)) - { - $buffer .= @fgets($fp, 4096); - } - return trim($buffer); - } - return false; -} - -//windows系统探测 -function sys_windows() -{ - if (PHP_VERSION >= 5) - { - $objLocator = new COM("WbemScripting.SWbemLocator"); - $wmi = $objLocator->ConnectServer(); - $prop = $wmi->get("Win32_PnPEntity"); - } - else - { - return false; - } - - //CPU - $cpuinfo = GetWMI($wmi,"Win32_Processor", array("Name","L2CacheSize","NumberOfCores")); - $res['cpu']['num'] = $cpuinfo[0]['NumberOfCores']; - if (null == $res['cpu']['num']) - { - $res['cpu']['num'] = 1; - }/* - for ($i=0;$i<$res['cpu']['num'];$i++) - { - $res['cpu']['model'] .= $cpuinfo[0]['Name']."
"; - $res['cpu']['cache'] .= $cpuinfo[0]['L2CacheSize']."
"; - }*/ - $cpuinfo[0]['L2CacheSize'] = ' ('.$cpuinfo[0]['L2CacheSize'].')'; - if($res['cpu']['num']==1) - $x1 = ''; - else - $x1 = ' ×'.$res['cpu']['num']; - $res['cpu']['model'] = $cpuinfo[0]['Name'].$cpuinfo[0]['L2CacheSize'].$x1; - // SYSINFO - $sysinfo = GetWMI($wmi,"Win32_OperatingSystem", array('LastBootUpTime','TotalVisibleMemorySize','FreePhysicalMemory','Caption','CSDVersion','SerialNumber','InstallDate')); - $sysinfo[0]['Caption']=iconv('GBK', 'UTF-8',$sysinfo[0]['Caption']); - $sysinfo[0]['CSDVersion']=iconv('GBK', 'UTF-8',$sysinfo[0]['CSDVersion']); - $res['win_n'] = $sysinfo[0]['Caption']." ".$sysinfo[0]['CSDVersion']." 序列号:{$sysinfo[0]['SerialNumber']} 于".date('Y年m月d日H:i:s',strtotime(substr($sysinfo[0]['InstallDate'],0,14)))."安装"; - //UPTIME - $res['uptime'] = $sysinfo[0]['LastBootUpTime']; - - $sys_ticks = 3600*8 + time() - strtotime(substr($res['uptime'],0,14)); - $min = $sys_ticks / 60; - $hours = $min / 60; - $days = floor($hours / 24); - $hours = floor($hours - ($days * 24)); - $min = floor($min - ($days * 60 * 24) - ($hours * 60)); - if ($days !== 0) $res['uptime'] = $days."Day"; - if ($hours !== 0) $res['uptime'] .= $hours."Hour"; - $res['uptime'] .= $min."Minute"; - - //MEMORY - $res['memTotal'] = round($sysinfo[0]['TotalVisibleMemorySize']/1024,2); - $res['memFree'] = round($sysinfo[0]['FreePhysicalMemory']/1024,2); - $res['memUsed'] = $res['memTotal']-$res['memFree']; //上面两行已经除以1024,这行不用再除了 - $res['memPercent'] = round($res['memUsed'] / $res['memTotal']*100,2); - - $swapinfo = GetWMI($wmi,"Win32_PageFileUsage", array('AllocatedBaseSize','CurrentUsage')); - - // LoadPercentage - $loadinfo = GetWMI($wmi,"Win32_Processor", array("LoadPercentage")); - $res['loadAvg'] = $loadinfo[0]['LoadPercentage']; - - return $res; -} - -function GetWMI($wmi,$strClass, $strValue = array()) -{ - $arrData = array(); - - $objWEBM = $wmi->Get($strClass); - $arrProp = $objWEBM->Properties_; - $arrWEBMCol = $objWEBM->Instances_(); - foreach($arrWEBMCol as $objItem) - { - @reset($arrProp); - $arrInstance = array(); - foreach($arrProp as $propItem) - { - eval("\$value = \$objItem->" . $propItem->Name . ";"); - if (empty($strValue)) - { - $arrInstance[$propItem->Name] = trim($value); - } - else - { - if (in_array($propItem->Name, $strValue)) - { - $arrInstance[$propItem->Name] = trim($value); - } - } - } - $arrData[] = $arrInstance; - } - return $arrData; -} - -//比例条 -function bar($percent) -{ -?> -
 
-"$du",'freeSpace'=>"$df",'hdPercent'=>"$hdPercent",'barhdPercent'=>"$hdPercent%",'TotalMemory'=>"$mt",'UsedMemory'=>"$mu",'FreeMemory'=>"$mf",'CachedMemory'=>"$mc",'Buffers'=>"$mb",'TotalSwap'=>"$st",'swapUsed'=>"$su",'swapFree'=>"$sf",'loadAvg'=>"$load",'uptime'=>"$uptime",'freetime'=>"$freetime",'bjtime'=>"$bjtime",'stime'=>"$stime",'memRealPercent'=>"$memRealPercent",'memRealUsed'=>"$memRealUsed",'memRealFree'=>"$memRealFree",'memPercent'=>"$memPercent%",'memCachedPercent'=>"$memCachedPercent",'barmemCachedPercent'=>"$memCachedPercent%",'swapPercent'=>"$swapPercent",'barmemRealPercent'=>"$memRealPercent%",'barswapPercent'=>"$swapPercent%",'NetOut2'=>"$NetOut[2]",'NetOut3'=>"$NetOut[3]",'NetOut4'=>"$NetOut[4]",'NetOut5'=>"$NetOut[5]",'NetOut6'=>"$NetOut[6]",'NetOut7'=>"$NetOut[7]",'NetOut8'=>"$NetOut[8]",'NetOut9'=>"$NetOut[9]",'NetOut10'=>"$NetOut[10]",'NetInput2'=>"$NetInput[2]",'NetInput3'=>"$NetInput[3]",'NetInput4'=>"$NetInput[4]",'NetInput5'=>"$NetInput[5]",'NetInput6'=>"$NetInput[6]",'NetInput7'=>"$NetInput[7]",'NetInput8'=>"$NetInput[8]",'NetInput9'=>"$NetInput[9]",'NetInput10'=>"$NetInput[10]",'NetOutSpeed2'=>"$NetOutSpeed[2]",'NetOutSpeed3'=>"$NetOutSpeed[3]",'NetOutSpeed4'=>"$NetOutSpeed[4]",'NetOutSpeed5'=>"$NetOutSpeed[5]",'NetInputSpeed2'=>"$NetInputSpeed[2]",'NetInputSpeed3'=>"$NetInputSpeed[3]",'NetInputSpeed4'=>"$NetInputSpeed[4]",'NetInputSpeed5'=>"$NetInputSpeed[5]"); - $jarr=json_encode($arr); - $_GET['callback'] = htmlspecialchars($_GET['callback']); - echo $_GET['callback'],'(',$jarr,')'; - exit; -} -?> - - - - -<?php echo $title.$version; ?> - - - - - - - - - - -
- - - - - - - - - - - - - - - -
PHPModuleOtherDatabasePerformanceSpeedMySQLFunctionMailDownload
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Server Parameters
Server Domain/IP - ()  Your IP address is:
Server identifies the
Server OS  Kernel version: Web Server
Server LanguageServer Port
Server HostNameAbsolute Path
Administrator MailProber Path
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Real-time Data Server
Current Server TimeServer Uptime
CPU Model [Core]
CPU usageView Chart";}else{echo "Only supports the Linux system";}?> -
Space usage - Total Space  G, - Used  G, - Free  G, - Rate % -
 
-
Memory usage - - Total Memory: - - , Used - - , Free - - , Rate - -
 
-0) -{ -?> - Cache Memory - , Rate - - % | Buffers -
 
- - Real Memory Used - - , Real Memory Free - - , Rate - - % -
 
-0) -{ -?> - SWAP: - - , Used - - , Free - - , Rate - - % -
 
- - -
Average System Load
- - - - - - - - - - - - - - - -
NetWork
: In : Real time: 0B/sOut : Real time: 0B/s
- - - - - - - - - -
PHP has been compiled module testing
-$value) { - if ($key!=0 && $key%13==0) { - echo '
'; - } - echo "$value  "; -} -?>
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PHP Parameters
PHP Info: - - ×' :"PHPINFO";?> - PHP Version:
Run PHP: Memory Limit:
PHP Safe Mode: Post Max Size:
Upload Max Filesize: Floating-point data of significant digits:
Max Execution Time: SecondSocket TimeOut: Second
PHP Doc Root: User Dir:
Enable Dl: Include Path:
Display Errors: Register Globals:
Magic Quotes Gpc: "<?...?>"Short Open Tag:
"<% %>"ASP Tags: Ignore Repeated Errors:
Ignore Repeated Source: Report Memleaks:
Magic Quotes Gpc: Magic Quotes Runtime:
Allow URL Fopen: Register Argc Argv:
Cookie:√' : '×';?>Spell check(ASpell Library):
High-precision math(BCMath):PREL(PCRE):
PDF:SNMP:
VMailMgr:Curl:
SMTP:√' : '×';?>SMTP:×';?>
Enable Functions: Click here to view more!
Disable Functions: -×'; -} -else -{ - //echo $disFuns; - $disFuns_array = explode(',',$disFuns); - foreach ($disFuns_array as $key=>$value) - { - if ($key!=0 && $key%5==0) { - echo '
'; - } - echo "$value  "; -} -} - -?> -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Components
FTP: XML:
Session: Socket:
Calendar - Allow Url Fopen:
GD Library: - ×';} - ?>Zlib:
IMAP: JDToGregorian:
Preg Match: WDDX:
Iconv: mbstring:
BCADD: LDAP:
MCrypt: Mhash Count:
- - - - - - - - - - - - - - - - - - - - - - - -
Other Components
Zend Version×';}else{echo $zend_version;}?> - 2) -{ - echo "ZendGuardLoader[On]"; -} -else -{ - echo "Zend Optimizer"; -} -?> - 2){echo (get_cfg_var("zend_loader.enable"))?'':'×';} else{if(function_exists('zend_optimizer_version')){ echo zend_optimizer_version();}else{ echo (get_cfg_var("zend_optimizer.optimization_level")||get_cfg_var("zend_extension_manager.optimizer_ts")||get_cfg_var("zend.ze1_compatibility_mode")||get_cfg_var("zend_extension_ts"))?'':'×';}}?>
eAccelerator×";} ?>ioncube×";}?>
XCache×";} ?>APC×";} ?>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Database
MySQL: - - ODBC:
Oracle: SQL Server:
dBASE: mSQL:
SQLite: √ ';echo "SQLite3 Ver ";echo $sqliteVer[versionString];}else {echo isfun("sqlite_close");if(isfun("sqlite_close") == '') {echo " : ".@sqlite_libversion();}}?>Hyperwave:
Postgre SQL: Informix:
DBA database: DBM database:
FilePro database:SyBase database:
- - -" method="post"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Server Performance Test
Reference ObjectInt Test
(1+1 Count 3 Million)
Float Test
(Pi times the square root of 3 million)
I/O Test
(10K file read 10,000 times)
CPU Info
LinodeVPS0.357 Second0.802 Second0.023 Second4 x Xeon L5520 @ 2.27GHz
PhotonVPS.com0.431 Second1.024 Second0.034 Second8 x Xeon E5520 @ 2.27GHz
SpaceRich.com0.421 Second1.003 Second0.038 Second4 x Core i7 920 @ 2.67GHz
RiZie.com0.521 Second1.559 Second0.054 Second2 x Pentium4 3.00GHz
CitynetHost.com0.343 Second0.761 Second0.023 Second2 x Core2Duo E4600 @ 2.40GHz
IXwebhosting.com0.535 Second1.607 Second0.058 Second4 x Xeon E5530 @ 2.40GHz
This Server


- - - - - - - - - - - - -
Network Speed Test
-
- 1000k bytes sent to the client data -
- - - - - - - - - - - - - - - - - - -
Bandwidth1M2M3M4M5M6M7M8M9M10M
- - - - -
">">
-
- ".$_GET['speed']." Millisecond, Download Speed: "."".$speed.""." kb/s":" No Test " ?> - -
- - - - - - - - - - -
MySQL Database connection detection
- Host: - Port: - Username: - Password: - - -
- alert('Connect to the MySql database to normal')"; - } else { - echo ""; - } - } else { - echo ""; - } - } - ?> - - - - - - - - - - - alert('$funRe')"; - } - ?> -
Function Test
- Enter the function you want to test: - - - -
- - - - - - - - - - - alert('$mailRe')"; - } - ?> -
Mail Send Test
- Please enter your email address to test: - - - -
- - - - - - - - -
Processed in seconds. memory usage.TOP
- - -
- - diff --git a/images/php/alpine/conf.d/letsencrypt-renew b/images/php/alpine/conf.d/letsencrypt-renew deleted file mode 100644 index 13dd85e1..00000000 --- a/images/php/alpine/conf.d/letsencrypt-renew +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# Lets Encrypt -if [ -z "$DOMAIN" ]; then - echo "You need to have \$DOMAIN set" -else - if [ -f /etc/letsencrypt/live/${DOMAIN}/fullchain.pem ]; then - certbot renew - supervisorctl restart nginx - else - echo "There is no cert to renew" - fi -fi diff --git a/images/php/alpine/conf.d/letsencrypt-setup b/images/php/alpine/conf.d/letsencrypt-setup deleted file mode 100644 index 45f560be..00000000 --- a/images/php/alpine/conf.d/letsencrypt-setup +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -# Lets Encrypt -if [ -z "$WEBROOT" ] || [ -z "$GIT_EMAIL" ] || [ -z "$DOMAIN" ]; then - echo "You need the \$WEBROOT, \$GIT_EMAIL and the \$DOMAIN Variables" -else - certbot certonly --webroot -w $WEBROOT -d $DOMAIN --email $GIT_EMAIL --agree-tos --quiet - ln -s /etc/nginx/sites-available/default-ssl.conf /etc/nginx/sites-enabled/ - - # change nginx for webroot and domain name - sed -i "s/##DOMAIN##/${DOMAIN}/g" /etc/nginx/sites-enabled/default-ssl.conf - sed -i "s#root /var/www/html;#root ${WEBROOT};#g" /etc/nginx/sites-available/default-ssl.conf - if [ ! -z "$WEBROOT" ]; then - webroot=$WEBROOT - sed -i "s#root /var/www/html;#root ${webroot};#g" /etc/nginx/sites-available/default-ssl.conf - fi - - supervisorctl restart nginx - -fi diff --git a/images/php/alpine/conf.d/nginx.conf b/images/php/alpine/conf.d/nginx.conf deleted file mode 100644 index 33df36c2..00000000 --- a/images/php/alpine/conf.d/nginx.conf +++ /dev/null @@ -1,112 +0,0 @@ -user nginx; - -# Set number of worker processes automatically based on number of CPU cores. -worker_processes auto; -error_log /var/log/nginx/error.log crit; -pid /run/nginx/nginx.pid; -worker_rlimit_nofile 51200; - -# Enables the use of JIT for regular expressions to speed-up their processing. -pcre_jit on; - -# Configures default error logger. -error_log /var/log/nginx/error.log warn; - -# Includes files with directives to load dynamic modules. -include /etc/nginx/modules/*.conf; - -events{ - use epoll; - multi_accept on; - worker_connections 1024; -} - -http{ - # Includes mapping of file name extensions to MIME types of responses and defines the default type. - include /etc/nginx/mime.types; - #include proxy.conf; - #include luawaf.conf; - - default_type application/octet-stream; - - # Name servers used to resolve names of upstream servers into addresses. - # It's also needed when using tcpsocket and udpsocket in Lua modules. - #resolver 208.67.222.222 208.67.220.220; - - server_names_hash_bucket_size 128; - client_header_buffer_size 32k; - large_client_header_buffers 4 32k; - - # Specifies the maximum accepted body size of a client request, as - # indicated by the request header Content-Length. If the stated content - # length is greater than this size, then the client receives the HTTP - # error code 413. Set to 0 to disable. - client_max_body_size 8m; - - # Sendfile copies data between one FD and other from within the kernel, - # which is more efficient than read() + write(). - sendfile on; - - # Causes nginx to attempt to send its HTTP response head in one packet, - # instead of using partial frames. - tcp_nopush on; - - # Timeout for keep-alive connections. Server will close connections after this time. - keepalive_timeout 60; - - # Don't buffer data-sends (disable Nagle algorithm). - # Good for sending frequent small bursts of data in real time. - tcp_nodelay on; - - fastcgi_connect_timeout 300; - fastcgi_send_timeout 300; - fastcgi_read_timeout 300; - fastcgi_buffer_size 64k; - fastcgi_buffers 4 64k; - fastcgi_busy_buffers_size 128k; - fastcgi_temp_file_write_size 256k; - fastcgi_intercept_errors on; - - # Path of the file with Diffie-Hellman parameters for EDH ciphers. - #ssl_dhparam /etc/ssl/nginx/dh2048.pem; - - # Specifies that our cipher suits should be preferred over client ciphers. - ssl_prefer_server_ciphers on; - - # Enables a shared SSL cache with size that can hold around 8000 sessions. - ssl_session_cache shared:SSL:2m; - - # Enable gzipping of responses. - gzip on; - gzip_min_length 1k; - gzip_buffers 4 16k; - gzip_http_version 1.1; - gzip_comp_level 2; - gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml; - - # Set the Vary HTTP header as defined in the RFC 2616. - gzip_vary on; - gzip_proxied expired no-cache no-store private auth; - gzip_disable "MSIE [1-6]\."; - - # Enable checking the existence of precompressed files. - # gzip_static on; - - limit_conn_zone $binary_remote_addr zone=perip:10m; - limit_conn_zone $server_name zone=perserver:10m; - - # Don't tell nginx version to clients. - server_tokens on; - - # Specifies the main log format. - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"'; - - # Sets the path, format, and configuration for a buffered log write. - access_log /var/log/nginx/access.log main; - - # Includes virtual hosts configs. - include /etc/nginx/conf.d/*.conf; -} - diff --git a/images/php/alpine/conf.d/php.ini b/images/php/alpine/conf.d/php.ini deleted file mode 100644 index e72b7df1..00000000 --- a/images/php/alpine/conf.d/php.ini +++ /dev/null @@ -1,1934 +0,0 @@ -[PHP] - -;;;;;;;;;;;;;;;;;;; -; About php.ini ; -;;;;;;;;;;;;;;;;;;; -; PHP's initialization file, generally called php.ini, is responsible for -; configuring many of the aspects of PHP's behavior. - -; PHP attempts to find and load this configuration from a number of locations. -; The following is a summary of its search order: -; 1. SAPI module specific location. -; 2. The PHPRC environment variable. (As of PHP 5.2.0) -; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0) -; 4. Current working directory (except CLI) -; 5. The web server's directory (for SAPI modules), or directory of PHP -; (otherwise in Windows) -; 6. The directory from the --with-config-file-path compile time option, or the -; Windows directory (C:\windows or C:\winnt) -; See the PHP docs for more specific information. -; http://php.net/configuration.file - -; The syntax of the file is extremely simple. Whitespace and lines -; beginning with a semicolon are silently ignored (as you probably guessed). -; Section headers (e.g. [Foo]) are also silently ignored, even though -; they might mean something in the future. - -; Directives following the section heading [PATH=/www/mysite] only -; apply to PHP files in the /www/mysite directory. Directives -; following the section heading [HOST=www.example.com] only apply to -; PHP files served from www.example.com. Directives set in these -; special sections cannot be overridden by user-defined INI files or -; at runtime. Currently, [PATH=] and [HOST=] sections only work under -; CGI/FastCGI. -; http://php.net/ini.sections - -; Directives are specified using the following syntax: -; directive = value -; Directive names are *case sensitive* - foo=bar is different from FOO=bar. -; Directives are variables used to configure PHP or PHP extensions. -; There is no name validation. If PHP can't find an expected -; directive because it is not set or is mistyped, a default value will be used. - -; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one -; of the INI constants (On, Off, True, False, Yes, No and None) or an expression -; (e.g. E_ALL & ~E_NOTICE), a quoted string ("bar"), or a reference to a -; previously set variable or directive (e.g. ${foo}) - -; Expressions in the INI file are limited to bitwise operators and parentheses: -; | bitwise OR -; ^ bitwise XOR -; & bitwise AND -; ~ bitwise NOT -; ! boolean NOT - -; Boolean flags can be turned on using the values 1, On, True or Yes. -; They can be turned off using the values 0, Off, False or No. - -; An empty string can be denoted by simply not writing anything after the equal -; sign, or by using the None keyword: - -; foo = ; sets foo to an empty string -; foo = None ; sets foo to an empty string -; foo = "None" ; sets foo to the string 'None' - -; If you use constants in your value, and these constants belong to a -; dynamically loaded extension (either a PHP extension or a Zend extension), -; you may only use these constants *after* the line that loads the extension. - -;;;;;;;;;;;;;;;;;;; -; About this file ; -;;;;;;;;;;;;;;;;;;; -; PHP comes packaged with two INI files. One that is recommended to be used -; in production environments and one that is recommended to be used in -; development environments. - -; php.ini-production contains settings which hold security, performance and -; best practices at its core. But please be aware, these settings may break -; compatibility with older or less security conscience applications. We -; recommending using the production ini in production and testing environments. - -; php.ini-development is very similar to its production variant, except it is -; much more verbose when it comes to errors. We recommend using the -; development version only in development environments, as errors shown to -; application users can inadvertently leak otherwise secure information. - -; This is php.ini-production INI file. - -;;;;;;;;;;;;;;;;;;; -; Quick Reference ; -;;;;;;;;;;;;;;;;;;; -; The following are all the settings which are different in either the production -; or development versions of the INIs with respect to PHP's default behavior. -; Please see the actual settings later in the document for more details as to why -; we recommend these changes in PHP's behavior. - -; display_errors -; Default Value: On -; Development Value: On -; Production Value: Off - -; display_startup_errors -; Default Value: Off -; Development Value: On -; Production Value: Off - -; error_reporting -; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED -; Development Value: E_ALL -; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT - -; html_errors -; Default Value: On -; Development Value: On -; Production value: On - -; log_errors -; Default Value: Off -; Development Value: On -; Production Value: On - -; max_input_time -; Default Value: -1 (Unlimited) -; Development Value: 60 (60 seconds) -; Production Value: 60 (60 seconds) - -; output_buffering -; Default Value: Off -; Development Value: 4096 -; Production Value: 4096 - -; register_argc_argv -; Default Value: On -; Development Value: Off -; Production Value: Off - -; request_order -; Default Value: None -; Development Value: "GP" -; Production Value: "GP" - -; session.gc_divisor -; Default Value: 100 -; Development Value: 1000 -; Production Value: 1000 - -; session.sid_bits_per_character -; Default Value: 4 -; Development Value: 5 -; Production Value: 5 - -; short_open_tag -; Default Value: On -; Development Value: Off -; Production Value: Off - -; track_errors -; Default Value: Off -; Development Value: On -; Production Value: Off - -; variables_order -; Default Value: "EGPCS" -; Development Value: "GPCS" -; Production Value: "GPCS" - -;;;;;;;;;;;;;;;;;;;; -; php.ini Options ; -;;;;;;;;;;;;;;;;;;;; -; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini" -;user_ini.filename = ".user.ini" - -; To disable this feature set this option to empty value -;user_ini.filename = - -; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes) -;user_ini.cache_ttl = 300 - -;;;;;;;;;;;;;;;;;;;; -; Language Options ; -;;;;;;;;;;;;;;;;;;;; - -; Enable the PHP scripting language engine under Apache. -; http://php.net/engine -engine = On - -; This directive determines whether or not PHP will recognize code between -; tags as PHP source which should be processed as such. It is -; generally recommended that should be used and that this feature -; should be disabled, as enabling it may result in issues when generating XML -; documents, however this remains supported for backward compatibility reasons. -; Note that this directive does not control the would work. -; http://php.net/syntax-highlighting -;highlight.string = #DD0000 -;highlight.comment = #FF9900 -;highlight.keyword = #007700 -;highlight.default = #0000BB -;highlight.html = #000000 - -; If enabled, the request will be allowed to complete even if the user aborts -; the request. Consider enabling it if executing long requests, which may end up -; being interrupted by the user or a browser timing out. PHP's default behavior -; is to disable this feature. -; http://php.net/ignore-user-abort -;ignore_user_abort = On - -; Determines the size of the realpath cache to be used by PHP. This value should -; be increased on systems where PHP opens many files to reflect the quantity of -; the file operations performed. -; http://php.net/realpath-cache-size -;realpath_cache_size = 4096k - -; Duration of time, in seconds for which to cache realpath information for a given -; file or directory. For systems with rarely changing files, consider increasing this -; value. -; http://php.net/realpath-cache-ttl -;realpath_cache_ttl = 120 - -; Enables or disables the circular reference collector. -; http://php.net/zend.enable-gc -zend.enable_gc = On - -; If enabled, scripts may be written in encodings that are incompatible with -; the scanner. CP936, Big5, CP949 and Shift_JIS are the examples of such -; encodings. To use this feature, mbstring extension must be enabled. -; Default: Off -;zend.multibyte = Off - -; Allows to set the default encoding for the scripts. This value will be used -; unless "declare(encoding=...)" directive appears at the top of the script. -; Only affects if zend.multibyte is set. -; Default: "" -;zend.script_encoding = - -;;;;;;;;;;;;;;;;; -; Miscellaneous ; -;;;;;;;;;;;;;;;;; - -; Decides whether PHP may expose the fact that it is installed on the server -; (e.g. by adding its signature to the Web server header). It is no security -; threat in any way, but it makes it possible to determine whether you use PHP -; on your server or not. -; http://php.net/expose-php -expose_php = Off - -;;;;;;;;;;;;;;;;;;; -; Resource Limits ; -;;;;;;;;;;;;;;;;;;; - -; Maximum execution time of each script, in seconds -; http://php.net/max-execution-time -; Note: This directive is hardcoded to 0 for the CLI SAPI -max_execution_time = 30 - -; Maximum amount of time each script may spend parsing request data. It's a good -; idea to limit this time on productions servers in order to eliminate unexpectedly -; long running scripts. -; Note: This directive is hardcoded to -1 for the CLI SAPI -; Default Value: -1 (Unlimited) -; Development Value: 60 (60 seconds) -; Production Value: 60 (60 seconds) -; http://php.net/max-input-time -max_input_time = 60 - -; Maximum input variable nesting level -; http://php.net/max-input-nesting-level -;max_input_nesting_level = 64 - -; How many GET/POST/COOKIE input variables may be accepted -; max_input_vars = 1000 - -; Maximum amount of memory a script may consume (128MB) -; http://php.net/memory-limit -memory_limit = 64M - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Error handling and logging ; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -; This directive informs PHP of which errors, warnings and notices you would like -; it to take action for. The recommended way of setting values for this -; directive is through the use of the error level constants and bitwise -; operators. The error level constants are below here for convenience as well as -; some common settings and their meanings. -; By default, PHP is set to take action on all errors, notices and warnings EXCEPT -; those related to E_NOTICE and E_STRICT, which together cover best practices and -; recommended coding standards in PHP. For performance reasons, this is the -; recommend error reporting setting. Your production server shouldn't be wasting -; resources complaining about best practices and coding standards. That's what -; development servers and development settings are for. -; Note: The php.ini-development file has this setting as E_ALL. This -; means it pretty much reports everything which is exactly what you want during -; development and early testing. -; -; Error Level Constants: -; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0) -; E_ERROR - fatal run-time errors -; E_RECOVERABLE_ERROR - almost fatal run-time errors -; E_WARNING - run-time warnings (non-fatal errors) -; E_PARSE - compile-time parse errors -; E_NOTICE - run-time notices (these are warnings which often result -; from a bug in your code, but it's possible that it was -; intentional (e.g., using an uninitialized variable and -; relying on the fact it is automatically initialized to an -; empty string) -; E_STRICT - run-time notices, enable to have PHP suggest changes -; to your code which will ensure the best interoperability -; and forward compatibility of your code -; E_CORE_ERROR - fatal errors that occur during PHP's initial startup -; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's -; initial startup -; E_COMPILE_ERROR - fatal compile-time errors -; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) -; E_USER_ERROR - user-generated error message -; E_USER_WARNING - user-generated warning message -; E_USER_NOTICE - user-generated notice message -; E_DEPRECATED - warn about code that will not work in future versions -; of PHP -; E_USER_DEPRECATED - user-generated deprecation warnings -; -; Common Values: -; E_ALL (Show all errors, warnings and notices including coding standards.) -; E_ALL & ~E_NOTICE (Show all errors, except for notices) -; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.) -; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors) -; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED -; Development Value: E_ALL -; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT -; http://php.net/error-reporting -error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT - -; This directive controls whether or not and where PHP will output errors, -; notices and warnings too. Error output is very useful during development, but -; it could be very dangerous in production environments. Depending on the code -; which is triggering the error, sensitive information could potentially leak -; out of your application such as database usernames and passwords or worse. -; For production environments, we recommend logging errors rather than -; sending them to STDOUT. -; Possible Values: -; Off = Do not display any errors -; stderr = Display errors to STDERR (affects only CGI/CLI binaries!) -; On or stdout = Display errors to STDOUT -; Default Value: On -; Development Value: On -; Production Value: Off -; http://php.net/display-errors -display_errors = Off - -; The display of errors which occur during PHP's startup sequence are handled -; separately from display_errors. PHP's default behavior is to suppress those -; errors from clients. Turning the display of startup errors on can be useful in -; debugging configuration problems. We strongly recommend you -; set this to 'off' for production servers. -; Default Value: Off -; Development Value: On -; Production Value: Off -; http://php.net/display-startup-errors -display_startup_errors = Off - -; Besides displaying errors, PHP can also log errors to locations such as a -; server-specific log, STDERR, or a location specified by the error_log -; directive found below. While errors should not be displayed on productions -; servers they should still be monitored and logging is a great way to do that. -; Default Value: Off -; Development Value: On -; Production Value: On -; http://php.net/log-errors -log_errors = On - -; Set maximum length of log_errors. In error_log information about the source is -; added. The default is 1024 and 0 allows to not apply any maximum length at all. -; http://php.net/log-errors-max-len -log_errors_max_len = 1024 - -; Do not log repeated messages. Repeated errors must occur in same file on same -; line unless ignore_repeated_source is set true. -; http://php.net/ignore-repeated-errors -ignore_repeated_errors = Off - -; Ignore source of message when ignoring repeated messages. When this setting -; is On you will not log errors with repeated messages from different files or -; source lines. -; http://php.net/ignore-repeated-source -ignore_repeated_source = Off - -; If this parameter is set to Off, then memory leaks will not be shown (on -; stdout or in the log). This has only effect in a debug compile, and if -; error reporting includes E_WARNING in the allowed list -; http://php.net/report-memleaks -report_memleaks = On - -; This setting is on by default. -;report_zend_debug = 0 - -; Store the last error/warning message in $php_errormsg (boolean). Setting this value -; to On can assist in debugging and is appropriate for development servers. It should -; however be disabled on production servers. -; Default Value: Off -; Development Value: On -; Production Value: Off -; http://php.net/track-errors -track_errors = Off - -; Turn off normal error reporting and emit XML-RPC error XML -; http://php.net/xmlrpc-errors -;xmlrpc_errors = 0 - -; An XML-RPC faultCode -;xmlrpc_error_number = 0 - -; When PHP displays or logs an error, it has the capability of formatting the -; error message as HTML for easier reading. This directive controls whether -; the error message is formatted as HTML or not. -; Note: This directive is hardcoded to Off for the CLI SAPI -; Default Value: On -; Development Value: On -; Production value: On -; http://php.net/html-errors -html_errors = On - -; If html_errors is set to On *and* docref_root is not empty, then PHP -; produces clickable error messages that direct to a page describing the error -; or function causing the error in detail. -; You can download a copy of the PHP manual from http://php.net/docs -; and change docref_root to the base URL of your local copy including the -; leading '/'. You must also specify the file extension being used including -; the dot. PHP's default behavior is to leave these settings empty, in which -; case no links to documentation are generated. -; Note: Never use this feature for production boxes. -; http://php.net/docref-root -; Examples -;docref_root = "/phpmanual/" - -; http://php.net/docref-ext -;docref_ext = .html - -; String to output before an error message. PHP's default behavior is to leave -; this setting blank. -; http://php.net/error-prepend-string -; Example: -;error_prepend_string = "" - -; String to output after an error message. PHP's default behavior is to leave -; this setting blank. -; http://php.net/error-append-string -; Example: -;error_append_string = "" - -; Log errors to specified file. PHP's default behavior is to leave this value -; empty. -; http://php.net/error-log -; Example: -;error_log = php_errors.log -; Log errors to syslog (Event Log on Windows). -;error_log = syslog - -;windows.show_crt_warning -; Default value: 0 -; Development value: 0 -; Production value: 0 - -;;;;;;;;;;;;;;;;; -; Data Handling ; -;;;;;;;;;;;;;;;;; - -; The separator used in PHP generated URLs to separate arguments. -; PHP's default setting is "&". -; http://php.net/arg-separator.output -; Example: -;arg_separator.output = "&" - -; List of separator(s) used by PHP to parse input URLs into variables. -; PHP's default setting is "&". -; NOTE: Every character in this directive is considered as separator! -; http://php.net/arg-separator.input -; Example: -;arg_separator.input = ";&" - -; This directive determines which super global arrays are registered when PHP -; starts up. G,P,C,E & S are abbreviations for the following respective super -; globals: GET, POST, COOKIE, ENV and SERVER. There is a performance penalty -; paid for the registration of these arrays and because ENV is not as commonly -; used as the others, ENV is not recommended on productions servers. You -; can still get access to the environment variables through getenv() should you -; need to. -; Default Value: "EGPCS" -; Development Value: "GPCS" -; Production Value: "GPCS"; -; http://php.net/variables-order -variables_order = "GPCS" - -; This directive determines which super global data (G,P & C) should be -; registered into the super global array REQUEST. If so, it also determines -; the order in which that data is registered. The values for this directive -; are specified in the same manner as the variables_order directive, -; EXCEPT one. Leaving this value empty will cause PHP to use the value set -; in the variables_order directive. It does not mean it will leave the super -; globals array REQUEST empty. -; Default Value: None -; Development Value: "GP" -; Production Value: "GP" -; http://php.net/request-order -request_order = "GP" - -; This directive determines whether PHP registers $argv & $argc each time it -; runs. $argv contains an array of all the arguments passed to PHP when a script -; is invoked. $argc contains an integer representing the number of arguments -; that were passed when the script was invoked. These arrays are extremely -; useful when running scripts from the command line. When this directive is -; enabled, registering these variables consumes CPU cycles and memory each time -; a script is executed. For performance reasons, this feature should be disabled -; on production servers. -; Note: This directive is hardcoded to On for the CLI SAPI -; Default Value: On -; Development Value: Off -; Production Value: Off -; http://php.net/register-argc-argv -register_argc_argv = Off - -; When enabled, the ENV, REQUEST and SERVER variables are created when they're -; first used (Just In Time) instead of when the script starts. If these -; variables are not used within a script, having this directive on will result -; in a performance gain. The PHP directive register_argc_argv must be disabled -; for this directive to have any affect. -; http://php.net/auto-globals-jit -auto_globals_jit = On - -; Whether PHP will read the POST data. -; This option is enabled by default. -; Most likely, you won't want to disable this option globally. It causes $_POST -; and $_FILES to always be empty; the only way you will be able to read the -; POST data will be through the php://input stream wrapper. This can be useful -; to proxy requests or to process the POST data in a memory efficient fashion. -; http://php.net/enable-post-data-reading -;enable_post_data_reading = Off - -; Maximum size of POST data that PHP will accept. -; Its value may be 0 to disable the limit. It is ignored if POST data reading -; is disabled through enable_post_data_reading. -; http://php.net/post-max-size -post_max_size = 5120M - -; Automatically add files before PHP document. -; http://php.net/auto-prepend-file -auto_prepend_file = - -; Automatically add files after PHP document. -; http://php.net/auto-append-file -auto_append_file = - -; By default, PHP will output a media type using the Content-Type header. To -; disable this, simply set it to be empty. -; -; PHP's built-in default media type is set to text/html. -; http://php.net/default-mimetype -default_mimetype = "text/html" - -; PHP's default character set is set to UTF-8. -; http://php.net/default-charset -default_charset = "UTF-8" - -; PHP internal character encoding is set to empty. -; If empty, default_charset is used. -; http://php.net/internal-encoding -;internal_encoding = - -; PHP input character encoding is set to empty. -; If empty, default_charset is used. -; http://php.net/input-encoding -;input_encoding = - -; PHP output character encoding is set to empty. -; If empty, default_charset is used. -; See also output_buffer. -; http://php.net/output-encoding -;output_encoding = - -;;;;;;;;;;;;;;;;;;;;;;;;; -; Paths and Directories ; -;;;;;;;;;;;;;;;;;;;;;;;;; - -; UNIX: "/path1:/path2" -;include_path = ".:/php/includes" -; -; Windows: "\path1;\path2" -;include_path = ".;c:\php\includes" -; -; PHP's default setting for include_path is ".;/path/to/php/pear" -; http://php.net/include-path - -; The root of the PHP pages, used only if nonempty. -; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root -; if you are running php as a CGI under any web server (other than IIS) -; see documentation for security issues. The alternate is to use the -; cgi.force_redirect configuration below -; http://php.net/doc-root -doc_root = - -; The directory under which PHP opens the script using /~username used only -; if nonempty. -; http://php.net/user-dir -user_dir = - -; Directory in which the loadable extensions (modules) reside. -; http://php.net/extension-dir -; extension_dir = "./" -; On windows: -; extension_dir = "ext" - -; Directory where the temporary files should be placed. -; Defaults to the system default (see sys_get_temp_dir) -; sys_temp_dir = "/tmp" - -; Whether or not to enable the dl() function. The dl() function does NOT work -; properly in multithreaded servers, such as IIS or Zeus, and is automatically -; disabled on them. -; http://php.net/enable-dl -enable_dl = Off - -; cgi.force_redirect is necessary to provide security running PHP as a CGI under -; most web servers. Left undefined, PHP turns this on by default. You can -; turn it off here AT YOUR OWN RISK -; **You CAN safely turn this off for IIS, in fact, you MUST.** -; http://php.net/cgi.force-redirect -;cgi.force_redirect = 1 - -; if cgi.nph is enabled it will force cgi to always sent Status: 200 with -; every request. PHP's default behavior is to disable this feature. -;cgi.nph = 1 - -; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape -; (iPlanet) web servers, you MAY need to set an environment variable name that PHP -; will look for to know it is OK to continue execution. Setting this variable MAY -; cause security issues, KNOW WHAT YOU ARE DOING FIRST. -; http://php.net/cgi.redirect-status-env -;cgi.redirect_status_env = - -; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's -; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok -; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting -; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting -; of zero causes PHP to behave as before. Default is 1. You should fix your scripts -; to use SCRIPT_FILENAME rather than PATH_TRANSLATED. -; http://php.net/cgi.fix-pathinfo -;cgi.fix_pathinfo=1 - -; if cgi.discard_path is enabled, the PHP CGI binary can safely be placed outside -; of the web tree and people will not be able to circumvent .htaccess security. -; http://php.net/cgi.dicard-path -;cgi.discard_path=1 - -; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate -; security tokens of the calling client. This allows IIS to define the -; security context that the request runs under. mod_fastcgi under Apache -; does not currently support this feature (03/17/2002) -; Set to 1 if running under IIS. Default is zero. -; http://php.net/fastcgi.impersonate -;fastcgi.impersonate = 1 - -; Disable logging through FastCGI connection. PHP's default behavior is to enable -; this feature. -;fastcgi.logging = 0 - -; cgi.rfc2616_headers configuration option tells PHP what type of headers to -; use when sending HTTP response code. If set to 0, PHP sends Status: header that -; is supported by Apache. When this option is set to 1, PHP will send -; RFC2616 compliant header. -; Default is zero. -; http://php.net/cgi.rfc2616-headers -;cgi.rfc2616_headers = 0 - -; cgi.check_shebang_line controls whether CGI PHP checks for line starting with #! -; (shebang) at the top of the running script. This line might be needed if the -; script support running both as stand-alone script and via PHP CGI<. PHP in CGI -; mode skips this line and ignores its content if this directive is turned on. -; http://php.net/cgi.check-shebang-line -;cgi.check_shebang_line=1 - -;;;;;;;;;;;;;;;; -; File Uploads ; -;;;;;;;;;;;;;;;; - -; Whether to allow HTTP file uploads. -; http://php.net/file-uploads -file_uploads = On - -; Temporary directory for HTTP uploaded files (will use system default if not -; specified). -; http://php.net/upload-tmp-dir -;upload_tmp_dir = - -; Maximum allowed size for uploaded files. -; http://php.net/upload-max-filesize -upload_max_filesize = 5120M - -; Maximum number of files that can be uploaded via a single request -max_file_uploads = 40960 - -;;;;;;;;;;;;;;;;;; -; Fopen wrappers ; -;;;;;;;;;;;;;;;;;; - -; Whether to allow the treatment of URLs (like http:// or ftp://) as files. -; http://php.net/allow-url-fopen -allow_url_fopen = On - -; Whether to allow include/require to open URLs (like http:// or ftp://) as files. -; http://php.net/allow-url-include -allow_url_include = Off - -; Define the anonymous ftp password (your email address). PHP's default setting -; for this is empty. -; http://php.net/from -;from="john@doe.com" - -; Define the User-Agent string. PHP's default setting for this is empty. -; http://php.net/user-agent -;user_agent="PHP" - -; Default timeout for socket based streams (seconds) -; http://php.net/default-socket-timeout -default_socket_timeout = 60 - -; If your scripts have to deal with files from Macintosh systems, -; or you are running on a Mac and need to deal with files from -; unix or win32 systems, setting this flag will cause PHP to -; automatically detect the EOL character in those files so that -; fgets() and file() will work regardless of the source of the file. -; http://php.net/auto-detect-line-endings -;auto_detect_line_endings = Off - -;;;;;;;;;;;;;;;;;;;;;; -; Dynamic Extensions ; -;;;;;;;;;;;;;;;;;;;;;; - -; If you wish to have an extension loaded automatically, use the following -; syntax: -; -; extension=modulename.extension -; -; For example, on Windows: -; -; extension=msql.dll -; -; ... or under UNIX: -; -; extension=msql.so -; -; ... or with a path: -; -; extension=/path/to/extension/msql.so -; -; If you only provide the name of the extension, PHP will look for it in its -; default extension directory. -; -; Windows Extensions -; Note that ODBC support is built in, so no dll is needed for it. -; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5+) -; extension folders as well as the separate PECL DLL download (PHP 5+). -; Be sure to appropriately set the extension_dir directive. -; -;extension=php_bz2.dll -;extension=php_curl.dll -;extension=php_fileinfo.dll -;extension=php_ftp.dll -;extension=php_gd2.dll -;extension=php_gettext.dll -;extension=php_gmp.dll -;extension=php_intl.dll -;extension=php_imap.dll -;extension=php_interbase.dll -;extension=php_ldap.dll -;extension=php_mbstring.dll -;extension=php_exif.dll ; Must be after mbstring as it depends on it -;extension=php_mysqli.dll -;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client -;extension=php_openssl.dll -;extension=php_pdo_firebird.dll -;extension=php_pdo_mysql.dll -;extension=php_pdo_oci.dll -;extension=php_pdo_odbc.dll -;extension=php_pdo_pgsql.dll -;extension=php_pdo_sqlite.dll -;extension=php_pgsql.dll -;extension=php_shmop.dll - -; The MIBS data available in the PHP distribution must be installed. -; See http://www.php.net/manual/en/snmp.installation.php -;extension=php_snmp.dll - -;extension=php_soap.dll -;extension=php_sockets.dll -;extension=php_sqlite3.dll -;extension=php_tidy.dll -;extension=php_xmlrpc.dll -;extension=php_xsl.dll - -;;;;;;;;;;;;;;;;;;; -; Module Settings ; -;;;;;;;;;;;;;;;;;;; - -[CLI Server] -; Whether the CLI web server uses ANSI color coding in its terminal output. -cli_server.color = On - -[Date] -; Defines the default timezone used by the date functions -; http://php.net/date.timezone -date.timezone = Asia/Shanghai - -; http://php.net/date.default-latitude -;date.default_latitude = 31.7667 - -; http://php.net/date.default-longitude -;date.default_longitude = 35.2333 - -; http://php.net/date.sunrise-zenith -;date.sunrise_zenith = 90.583333 - -; http://php.net/date.sunset-zenith -;date.sunset_zenith = 90.583333 - -[filter] -; http://php.net/filter.default -;filter.default = unsafe_raw - -; http://php.net/filter.default-flags -;filter.default_flags = - -[iconv] -; Use of this INI entry is deprecated, use global input_encoding instead. -; If empty, default_charset or input_encoding or iconv.input_encoding is used. -; The precedence is: default_charset < intput_encoding < iconv.input_encoding -;iconv.input_encoding = - -; Use of this INI entry is deprecated, use global internal_encoding instead. -; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. -; The precedence is: default_charset < internal_encoding < iconv.internal_encoding -;iconv.internal_encoding = - -; Use of this INI entry is deprecated, use global output_encoding instead. -; If empty, default_charset or output_encoding or iconv.output_encoding is used. -; The precedence is: default_charset < output_encoding < iconv.output_encoding -; To use an output encoding conversion, iconv's output handler must be set -; otherwise output encoding conversion cannot be performed. -;iconv.output_encoding = - -[intl] -;intl.default_locale = -; This directive allows you to produce PHP errors when some error -; happens within intl functions. The value is the level of the error produced. -; Default is 0, which does not produce any errors. -;intl.error_level = E_WARNING -;intl.use_exceptions = 0 - -[sqlite3] -;sqlite3.extension_dir = - -[Pcre] -;PCRE library backtracking limit. -; http://php.net/pcre.backtrack-limit -;pcre.backtrack_limit=100000 - -;PCRE library recursion limit. -;Please note that if you set this value to a high number you may consume all -;the available process stack and eventually crash PHP (due to reaching the -;stack size limit imposed by the Operating System). -; http://php.net/pcre.recursion-limit -;pcre.recursion_limit=100000 - -;Enables or disables JIT compilation of patterns. This requires the PCRE -;library to be compiled with JIT support. -;pcre.jit=1 - -[Pdo] -; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off" -; http://php.net/pdo-odbc.connection-pooling -;pdo_odbc.connection_pooling=strict - -;pdo_odbc.db2_instance_name - -[Pdo_mysql] -; If mysqlnd is used: Number of cache slots for the internal result set cache -; http://php.net/pdo_mysql.cache_size -pdo_mysql.cache_size = 2000 - -; Default socket name for local MySQL connects. If empty, uses the built-in -; MySQL defaults. -; http://php.net/pdo_mysql.default-socket -pdo_mysql.default_socket= - -[Phar] -; http://php.net/phar.readonly -;phar.readonly = On - -; http://php.net/phar.require-hash -;phar.require_hash = On - -;phar.cache_list = - -[mail function] -; For Win32 only. -; http://php.net/smtp -SMTP = localhost -; http://php.net/smtp-port -smtp_port = 25 - -; For Win32 only. -; http://php.net/sendmail-from -;sendmail_from = me@example.com - -; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). -; http://php.net/sendmail-path -;sendmail_path = - -; Force the addition of the specified parameters to be passed as extra parameters -; to the sendmail binary. These parameters will always replace the value of -; the 5th parameter to mail(). -;mail.force_extra_parameters = - -; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename -mail.add_x_header = On - -; The path to a log file that will log all mail() calls. Log entries include -; the full path of the script, line number, To address and headers. -;mail.log = -; Log mail to syslog (Event Log on Windows). -;mail.log = syslog - -[SQL] -; http://php.net/sql.safe-mode -sql.safe_mode = Off - -[ODBC] -; http://php.net/odbc.default-db -;odbc.default_db = Not yet implemented - -; http://php.net/odbc.default-user -;odbc.default_user = Not yet implemented - -; http://php.net/odbc.default-pw -;odbc.default_pw = Not yet implemented - -; Controls the ODBC cursor model. -; Default: SQL_CURSOR_STATIC (default). -;odbc.default_cursortype - -; Allow or prevent persistent links. -; http://php.net/odbc.allow-persistent -odbc.allow_persistent = On - -; Check that a connection is still valid before reuse. -; http://php.net/odbc.check-persistent -odbc.check_persistent = On - -; Maximum number of persistent links. -1 means no limit. -; http://php.net/odbc.max-persistent -odbc.max_persistent = -1 - -; Maximum number of links (persistent + non-persistent). -1 means no limit. -; http://php.net/odbc.max-links -odbc.max_links = -1 - -; Handling of LONG fields. Returns number of bytes to variables. 0 means -; passthru. -; http://php.net/odbc.defaultlrl -odbc.defaultlrl = 4096 - -; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. -; See the documentation on odbc_binmode and odbc_longreadlen for an explanation -; of odbc.defaultlrl and odbc.defaultbinmode -; http://php.net/odbc.defaultbinmode -odbc.defaultbinmode = 1 - -;birdstep.max_links = -1 - -[Interbase] -; Allow or prevent persistent links. -ibase.allow_persistent = 1 - -; Maximum number of persistent links. -1 means no limit. -ibase.max_persistent = -1 - -; Maximum number of links (persistent + non-persistent). -1 means no limit. -ibase.max_links = -1 - -; Default database name for ibase_connect(). -;ibase.default_db = - -; Default username for ibase_connect(). -;ibase.default_user = - -; Default password for ibase_connect(). -;ibase.default_password = - -; Default charset for ibase_connect(). -;ibase.default_charset = - -; Default timestamp format. -ibase.timestampformat = "%Y-%m-%d %H:%M:%S" - -; Default date format. -ibase.dateformat = "%Y-%m-%d" - -; Default time format. -ibase.timeformat = "%H:%M:%S" - -[MySQLi] - -; Maximum number of persistent links. -1 means no limit. -; http://php.net/mysqli.max-persistent -mysqli.max_persistent = -1 - -; Allow accessing, from PHP's perspective, local files with LOAD DATA statements -; http://php.net/mysqli.allow_local_infile -;mysqli.allow_local_infile = On - -; Allow or prevent persistent links. -; http://php.net/mysqli.allow-persistent -mysqli.allow_persistent = On - -; Maximum number of links. -1 means no limit. -; http://php.net/mysqli.max-links -mysqli.max_links = -1 - -; If mysqlnd is used: Number of cache slots for the internal result set cache -; http://php.net/mysqli.cache_size -mysqli.cache_size = 2000 - -; Default port number for mysqli_connect(). If unset, mysqli_connect() will use -; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the -; compile-time value defined MYSQL_PORT (in that order). Win32 will only look -; at MYSQL_PORT. -; http://php.net/mysqli.default-port -mysqli.default_port = 3306 - -; Default socket name for local MySQL connects. If empty, uses the built-in -; MySQL defaults. -; http://php.net/mysqli.default-socket -mysqli.default_socket = - -; Default host for mysql_connect() (doesn't apply in safe mode). -; http://php.net/mysqli.default-host -mysqli.default_host = - -; Default user for mysql_connect() (doesn't apply in safe mode). -; http://php.net/mysqli.default-user -mysqli.default_user = - -; Default password for mysqli_connect() (doesn't apply in safe mode). -; Note that this is generally a *bad* idea to store passwords in this file. -; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw") -; and reveal this password! And of course, any users with read access to this -; file will be able to reveal the password as well. -; http://php.net/mysqli.default-pw -mysqli.default_pw = - -; Allow or prevent reconnect -mysqli.reconnect = Off - -[mysqlnd] -; Enable / Disable collection of general statistics by mysqlnd which can be -; used to tune and monitor MySQL operations. -; http://php.net/mysqlnd.collect_statistics -mysqlnd.collect_statistics = On - -; Enable / Disable collection of memory usage statistics by mysqlnd which can be -; used to tune and monitor MySQL operations. -; http://php.net/mysqlnd.collect_memory_statistics -mysqlnd.collect_memory_statistics = Off - -; Records communication from all extensions using mysqlnd to the specified log -; file. -; http://php.net/mysqlnd.debug -;mysqlnd.debug = - -; Defines which queries will be logged. -; http://php.net/mysqlnd.log_mask -;mysqlnd.log_mask = 0 - -; Default size of the mysqlnd memory pool, which is used by result sets. -; http://php.net/mysqlnd.mempool_default_size -;mysqlnd.mempool_default_size = 16000 - -; Size of a pre-allocated buffer used when sending commands to MySQL in bytes. -; http://php.net/mysqlnd.net_cmd_buffer_size -;mysqlnd.net_cmd_buffer_size = 2048 - -; Size of a pre-allocated buffer used for reading data sent by the server in -; bytes. -; http://php.net/mysqlnd.net_read_buffer_size -;mysqlnd.net_read_buffer_size = 32768 - -; Timeout for network requests in seconds. -; http://php.net/mysqlnd.net_read_timeout -;mysqlnd.net_read_timeout = 31536000 - -; SHA-256 Authentication Plugin related. File with the MySQL server public RSA -; key. -; http://php.net/mysqlnd.sha256_server_public_key -;mysqlnd.sha256_server_public_key = - -[OCI8] - -; Connection: Enables privileged connections using external -; credentials (OCI_SYSOPER, OCI_SYSDBA) -; http://php.net/oci8.privileged-connect -;oci8.privileged_connect = Off - -; Connection: The maximum number of persistent OCI8 connections per -; process. Using -1 means no limit. -; http://php.net/oci8.max-persistent -;oci8.max_persistent = -1 - -; Connection: The maximum number of seconds a process is allowed to -; maintain an idle persistent connection. Using -1 means idle -; persistent connections will be maintained forever. -; http://php.net/oci8.persistent-timeout -;oci8.persistent_timeout = -1 - -; Connection: The number of seconds that must pass before issuing a -; ping during oci_pconnect() to check the connection validity. When -; set to 0, each oci_pconnect() will cause a ping. Using -1 disables -; pings completely. -; http://php.net/oci8.ping-interval -;oci8.ping_interval = 60 - -; Connection: Set this to a user chosen connection class to be used -; for all pooled server requests with Oracle 11g Database Resident -; Connection Pooling (DRCP). To use DRCP, this value should be set to -; the same string for all web servers running the same application, -; the database pool must be configured, and the connection string must -; specify to use a pooled server. -;oci8.connection_class = - -; High Availability: Using On lets PHP receive Fast Application -; Notification (FAN) events generated when a database node fails. The -; database must also be configured to post FAN events. -;oci8.events = Off - -; Tuning: This option enables statement caching, and specifies how -; many statements to cache. Using 0 disables statement caching. -; http://php.net/oci8.statement-cache-size -;oci8.statement_cache_size = 20 - -; Tuning: Enables statement prefetching and sets the default number of -; rows that will be fetched automatically after statement execution. -; http://php.net/oci8.default-prefetch -;oci8.default_prefetch = 100 - -; Compatibility. Using On means oci_close() will not close -; oci_connect() and oci_new_connect() connections. -; http://php.net/oci8.old-oci-close-semantics -;oci8.old_oci_close_semantics = Off - -[PostgreSQL] -; Allow or prevent persistent links. -; http://php.net/pgsql.allow-persistent -pgsql.allow_persistent = On - -; Detect broken persistent links always with pg_pconnect(). -; Auto reset feature requires a little overheads. -; http://php.net/pgsql.auto-reset-persistent -pgsql.auto_reset_persistent = Off - -; Maximum number of persistent links. -1 means no limit. -; http://php.net/pgsql.max-persistent -pgsql.max_persistent = -1 - -; Maximum number of links (persistent+non persistent). -1 means no limit. -; http://php.net/pgsql.max-links -pgsql.max_links = -1 - -; Ignore PostgreSQL backends Notice message or not. -; Notice message logging require a little overheads. -; http://php.net/pgsql.ignore-notice -pgsql.ignore_notice = 0 - -; Log PostgreSQL backends Notice message or not. -; Unless pgsql.ignore_notice=0, module cannot log notice message. -; http://php.net/pgsql.log-notice -pgsql.log_notice = 0 - -[bcmath] -; Number of decimal digits for all bcmath functions. -; http://php.net/bcmath.scale -bcmath.scale = 0 - -[browscap] -; http://php.net/browscap -;browscap = extra/browscap.ini - -[Session] -; Handler used to store/retrieve data. -; http://php.net/session.save-handler -session.save_handler = files - -; Argument passed to save_handler. In the case of files, this is the path -; where data files are stored. Note: Windows users have to change this -; variable in order to use PHP's session functions. -; -; The path can be defined as: -; -; session.save_path = "N;/path" -; -; where N is an integer. Instead of storing all the session files in -; /path, what this will do is use subdirectories N-levels deep, and -; store the session data in those directories. This is useful if -; your OS has problems with many files in one directory, and is -; a more efficient layout for servers that handle many sessions. -; -; NOTE 1: PHP will not create this directory structure automatically. -; You can use the script in the ext/session dir for that purpose. -; NOTE 2: See the section on garbage collection below if you choose to -; use subdirectories for session storage -; -; The file storage module creates files using mode 600 by default. -; You can change that by using -; -; session.save_path = "N;MODE;/path" -; -; where MODE is the octal representation of the mode. Note that this -; does not overwrite the process's umask. -; http://php.net/session.save-path -;session.save_path = "/tmp" - -; Whether to use strict session mode. -; Strict session mode does not accept uninitialized session ID and regenerate -; session ID if browser sends uninitialized session ID. Strict mode protects -; applications from session fixation via session adoption vulnerability. It is -; disabled by default for maximum compatibility, but enabling it is encouraged. -; https://wiki.php.net/rfc/strict_sessions -session.use_strict_mode = 0 - -; Whether to use cookies. -; http://php.net/session.use-cookies -session.use_cookies = 1 - -; http://php.net/session.cookie-secure -;session.cookie_secure = - -; This option forces PHP to fetch and use a cookie for storing and maintaining -; the session id. We encourage this operation as it's very helpful in combating -; session hijacking when not specifying and managing your own session id. It is -; not the be-all and end-all of session hijacking defense, but it's a good start. -; http://php.net/session.use-only-cookies -session.use_only_cookies = 1 - -; Name of the session (used as cookie name). -; http://php.net/session.name -session.name = PHPSESSID - -; Initialize session on request startup. -; http://php.net/session.auto-start -session.auto_start = 0 - -; Lifetime in seconds of cookie or, if 0, until browser is restarted. -; http://php.net/session.cookie-lifetime -session.cookie_lifetime = 0 - -; The path for which the cookie is valid. -; http://php.net/session.cookie-path -session.cookie_path = / - -; The domain for which the cookie is valid. -; http://php.net/session.cookie-domain -session.cookie_domain = - -; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript. -; http://php.net/session.cookie-httponly -session.cookie_httponly = - -; Handler used to serialize data. php is the standard serializer of PHP. -; http://php.net/session.serialize-handler -session.serialize_handler = php - -; Defines the probability that the 'garbage collection' process is started -; on every session initialization. The probability is calculated by using -; gc_probability/gc_divisor. Where session.gc_probability is the numerator -; and gc_divisor is the denominator in the equation. Setting this value to 1 -; when the session.gc_divisor value is 100 will give you approximately a 1% chance -; the gc will run on any give request. -; Default Value: 1 -; Development Value: 1 -; Production Value: 1 -; http://php.net/session.gc-probability -session.gc_probability = 1 - -; Defines the probability that the 'garbage collection' process is started on every -; session initialization. The probability is calculated by using the following equation: -; gc_probability/gc_divisor. Where session.gc_probability is the numerator and -; session.gc_divisor is the denominator in the equation. Setting this value to 1 -; when the session.gc_divisor value is 100 will give you approximately a 1% chance -; the gc will run on any give request. Increasing this value to 1000 will give you -; a 0.1% chance the gc will run on any give request. For high volume production servers, -; this is a more efficient approach. -; Default Value: 100 -; Development Value: 1000 -; Production Value: 1000 -; http://php.net/session.gc-divisor -session.gc_divisor = 1000 - -; After this number of seconds, stored data will be seen as 'garbage' and -; cleaned up by the garbage collection process. -; http://php.net/session.gc-maxlifetime -session.gc_maxlifetime = 1440 - -; NOTE: If you are using the subdirectory option for storing session files -; (see session.save_path above), then garbage collection does *not* -; happen automatically. You will need to do your own garbage -; collection through a shell script, cron entry, or some other method. -; For example, the following script would is the equivalent of -; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): -; find /path/to/sessions -cmin +24 -type f | xargs rm - -; Check HTTP Referer to invalidate externally stored URLs containing ids. -; HTTP_REFERER has to contain this substring for the session to be -; considered as valid. -; http://php.net/session.referer-check -session.referer_check = - -; Set to {nocache,private,public,} to determine HTTP caching aspects -; or leave this empty to avoid sending anti-caching headers. -; http://php.net/session.cache-limiter -session.cache_limiter = nocache - -; Document expires after n minutes. -; http://php.net/session.cache-expire -session.cache_expire = 180 - -; trans sid support is disabled by default. -; Use of trans sid may risk your users' security. -; Use this option with caution. -; - User may send URL contains active session ID -; to other person via. email/irc/etc. -; - URL that contains active session ID may be stored -; in publicly accessible computer. -; - User may access your site with the same session ID -; always using URL stored in browser's history or bookmarks. -; http://php.net/session.use-trans-sid -session.use_trans_sid = 0 - -; Set session ID character length. This value could be between 22 to 256. -; Shorter length than default is supported only for compatibility reason. -; Users should use 32 or more chars. -; http://php.net/session.sid-length -; Default Value: 32 -; Development Value: 26 -; Production Value: 26 -session.sid_length = 26 - -; The URL rewriter will look for URLs in a defined set of HTML tags. -;
is special; if you include them here, the rewriter will -; add a hidden field with the info which is otherwise appended -; to URLs. tag's action attribute URL will not be modified -; unless it is specified. -; Note that all valid entries require a "=", even if no value follows. -; Default Value: "a=href,area=href,frame=src,form=" -; Development Value: "a=href,area=href,frame=src,form=" -; Production Value: "a=href,area=href,frame=src,form=" -; http://php.net/url-rewriter.tags -session.trans_sid_tags = "a=href,area=href,frame=src,form=" - -; URL rewriter does not rewrite absolute URLs by default. -; To enable rewrites for absolute pathes, target hosts must be specified -; at RUNTIME. i.e. use ini_set() -; tags is special. PHP will check action attribute's URL regardless -; of session.trans_sid_tags setting. -; If no host is defined, HTTP_HOST will be used for allowed host. -; Example value: php.net,www.php.net,wiki.php.net -; Use "," for multiple hosts. No spaces are allowed. -; Default Value: "" -; Development Value: "" -; Production Value: "" -;session.trans_sid_hosts="" - -; Define how many bits are stored in each character when converting -; the binary hash data to something readable. -; Possible values: -; 4 (4 bits: 0-9, a-f) -; 5 (5 bits: 0-9, a-v) -; 6 (6 bits: 0-9, a-z, A-Z, "-", ",") -; Default Value: 4 -; Development Value: 5 -; Production Value: 5 -; http://php.net/session.hash-bits-per-character -session.sid_bits_per_character = 5 - -; Enable upload progress tracking in $_SESSION -; Default Value: On -; Development Value: On -; Production Value: On -; http://php.net/session.upload-progress.enabled -;session.upload_progress.enabled = On - -; Cleanup the progress information as soon as all POST data has been read -; (i.e. upload completed). -; Default Value: On -; Development Value: On -; Production Value: On -; http://php.net/session.upload-progress.cleanup -;session.upload_progress.cleanup = On - -; A prefix used for the upload progress key in $_SESSION -; Default Value: "upload_progress_" -; Development Value: "upload_progress_" -; Production Value: "upload_progress_" -; http://php.net/session.upload-progress.prefix -;session.upload_progress.prefix = "upload_progress_" - -; The index name (concatenated with the prefix) in $_SESSION -; containing the upload progress information -; Default Value: "PHP_SESSION_UPLOAD_PROGRESS" -; Development Value: "PHP_SESSION_UPLOAD_PROGRESS" -; Production Value: "PHP_SESSION_UPLOAD_PROGRESS" -; http://php.net/session.upload-progress.name -;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS" - -; How frequently the upload progress should be updated. -; Given either in percentages (per-file), or in bytes -; Default Value: "1%" -; Development Value: "1%" -; Production Value: "1%" -; http://php.net/session.upload-progress.freq -;session.upload_progress.freq = "1%" - -; The minimum delay between updates, in seconds -; Default Value: 1 -; Development Value: 1 -; Production Value: 1 -; http://php.net/session.upload-progress.min-freq -;session.upload_progress.min_freq = "1" - -; Only write session data when session data is changed. Enabled by default. -; http://php.net/session.lazy-write -;session.lazy_write = On - -[Assertion] -; Switch whether to compile assertions at all (to have no overhead at run-time) -; -1: Do not compile at all -; 0: Jump over assertion at run-time -; 1: Execute assertions -; Changing from or to a negative value is only possible in php.ini! (For turning assertions on and off at run-time, see assert.active, when zend.assertions = 1) -; Default Value: 1 -; Development Value: 1 -; Production Value: -1 -; http://php.net/zend.assertions -zend.assertions = -1 - -; Assert(expr); active by default. -; http://php.net/assert.active -;assert.active = On - -; Throw an AssertationException on failed assertions -; http://php.net/assert.exception -;assert.exception = On - -; Issue a PHP warning for each failed assertion. (Overridden by assert.exception if active) -; http://php.net/assert.warning -;assert.warning = On - -; Don't bail out by default. -; http://php.net/assert.bail -;assert.bail = Off - -; User-function to be called if an assertion fails. -; http://php.net/assert.callback -;assert.callback = 0 - -; Eval the expression with current error_reporting(). Set to true if you want -; error_reporting(0) around the eval(). -; http://php.net/assert.quiet-eval -;assert.quiet_eval = 0 - -[COM] -; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs -; http://php.net/com.typelib-file -;com.typelib_file = - -; allow Distributed-COM calls -; http://php.net/com.allow-dcom -;com.allow_dcom = true - -; autoregister constants of a components typlib on com_load() -; http://php.net/com.autoregister-typelib -;com.autoregister_typelib = true - -; register constants casesensitive -; http://php.net/com.autoregister-casesensitive -;com.autoregister_casesensitive = false - -; show warnings on duplicate constant registrations -; http://php.net/com.autoregister-verbose -;com.autoregister_verbose = true - -; The default character set code-page to use when passing strings to and from COM objects. -; Default: system ANSI code page -;com.code_page= - -[mbstring] -; language for internal character representation. -; This affects mb_send_mail() and mbstring.detect_order. -; http://php.net/mbstring.language -;mbstring.language = Japanese - -; Use of this INI entry is deprecated, use global internal_encoding instead. -; internal/script encoding. -; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*) -; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. -; The precedence is: default_charset < internal_encoding < iconv.internal_encoding -;mbstring.internal_encoding = - -; Use of this INI entry is deprecated, use global input_encoding instead. -; http input encoding. -; mbstring.encoding_traslation = On is needed to use this setting. -; If empty, default_charset or input_encoding or mbstring.input is used. -; The precedence is: default_charset < intput_encoding < mbsting.http_input -; http://php.net/mbstring.http-input -;mbstring.http_input = - -; Use of this INI entry is deprecated, use global output_encoding instead. -; http output encoding. -; mb_output_handler must be registered as output buffer to function. -; If empty, default_charset or output_encoding or mbstring.http_output is used. -; The precedence is: default_charset < output_encoding < mbstring.http_output -; To use an output encoding conversion, mbstring's output handler must be set -; otherwise output encoding conversion cannot be performed. -; http://php.net/mbstring.http-output -;mbstring.http_output = - -; enable automatic encoding translation according to -; mbstring.internal_encoding setting. Input chars are -; converted to internal encoding by setting this to On. -; Note: Do _not_ use automatic encoding translation for -; portable libs/applications. -; http://php.net/mbstring.encoding-translation -;mbstring.encoding_translation = Off - -; automatic encoding detection order. -; "auto" detect order is changed according to mbstring.language -; http://php.net/mbstring.detect-order -;mbstring.detect_order = auto - -; substitute_character used when character cannot be converted -; one from another -; http://php.net/mbstring.substitute-character -;mbstring.substitute_character = none - -; overload(replace) single byte functions by mbstring functions. -; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(), -; etc. Possible values are 0,1,2,4 or combination of them. -; For example, 7 for overload everything. -; 0: No overload -; 1: Overload mail() function -; 2: Overload str*() functions -; 4: Overload ereg*() functions -; http://php.net/mbstring.func-overload -;mbstring.func_overload = 0 - -; enable strict encoding detection. -; Default: Off -;mbstring.strict_detection = On - -; This directive specifies the regex pattern of content types for which mb_output_handler() -; is activated. -; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml) -;mbstring.http_output_conv_mimetype= - -[gd] -; Tell the jpeg decode to ignore warnings and try to create -; a gd image. The warning will then be displayed as notices -; disabled by default -; http://php.net/gd.jpeg-ignore-warning -;gd.jpeg_ignore_warning = 1 - -[exif] -; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS. -; With mbstring support this will automatically be converted into the encoding -; given by corresponding encode setting. When empty mbstring.internal_encoding -; is used. For the decode settings you can distinguish between motorola and -; intel byte order. A decode setting cannot be empty. -; http://php.net/exif.encode-unicode -;exif.encode_unicode = ISO-8859-15 - -; http://php.net/exif.decode-unicode-motorola -;exif.decode_unicode_motorola = UCS-2BE - -; http://php.net/exif.decode-unicode-intel -;exif.decode_unicode_intel = UCS-2LE - -; http://php.net/exif.encode-jis -;exif.encode_jis = - -; http://php.net/exif.decode-jis-motorola -;exif.decode_jis_motorola = JIS - -; http://php.net/exif.decode-jis-intel -;exif.decode_jis_intel = JIS - -[Tidy] -; The path to a default tidy configuration file to use when using tidy -; http://php.net/tidy.default-config -;tidy.default_config = /usr/local/lib/php/default.tcfg - -; Should tidy clean and repair output automatically? -; WARNING: Do not use this option if you are generating non-html content -; such as dynamic images -; http://php.net/tidy.clean-output -tidy.clean_output = Off - -[soap] -; Enables or disables WSDL caching feature. -; http://php.net/soap.wsdl-cache-enabled -soap.wsdl_cache_enabled=1 - -; Sets the directory name where SOAP extension will put cache files. -; http://php.net/soap.wsdl-cache-dir -soap.wsdl_cache_dir="/tmp" - -; (time to live) Sets the number of second while cached file will be used -; instead of original one. -; http://php.net/soap.wsdl-cache-ttl -soap.wsdl_cache_ttl=86400 - -; Sets the size of the cache limit. (Max. number of WSDL files to cache) -soap.wsdl_cache_limit = 5 - -[sysvshm] -; A default size of the shared memory segment -;sysvshm.init_mem = 10000 - -[ldap] -; Sets the maximum number of open links or -1 for unlimited. -ldap.max_links = -1 - -[mcrypt] -; For more information about mcrypt settings see http://php.net/mcrypt-module-open - -; Directory where to load mcrypt algorithms -; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt) -;mcrypt.algorithms_dir= - -; Directory where to load mcrypt modes -; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt) -;mcrypt.modes_dir= - -[dba] -;dba.default_handler= - -[opcache] -; Determines if Zend OPCache is enabled -;opcache.enable=1 - -; Determines if Zend OPCache is enabled for the CLI version of PHP -;opcache.enable_cli=0 - -; The OPcache shared memory storage size. -;opcache.memory_consumption=128 - -; The amount of memory for interned strings in Mbytes. -;opcache.interned_strings_buffer=8 - -; The maximum number of keys (scripts) in the OPcache hash table. -; Only numbers between 200 and 1000000 are allowed. -;opcache.max_accelerated_files=10000 - -; The maximum percentage of "wasted" memory until a restart is scheduled. -;opcache.max_wasted_percentage=5 - -; When this directive is enabled, the OPcache appends the current working -; directory to the script key, thus eliminating possible collisions between -; files with the same name (basename). Disabling the directive improves -; performance, but may break existing applications. -;opcache.use_cwd=1 - -; When disabled, you must reset the OPcache manually or restart the -; webserver for changes to the filesystem to take effect. -;opcache.validate_timestamps=1 - -; How often (in seconds) to check file timestamps for changes to the shared -; memory storage allocation. ("1" means validate once per second, but only -; once per request. "0" means always validate) -;opcache.revalidate_freq=2 - -; Enables or disables file search in include_path optimization -;opcache.revalidate_path=0 - -; If disabled, all PHPDoc comments are dropped from the code to reduce the -; size of the optimized code. -;opcache.save_comments=1 - -; If enabled, a fast shutdown sequence is used for the accelerated code -; Depending on the used Memory Manager this may cause some incompatibilities. -;opcache.fast_shutdown=0 - -; Allow file existence override (file_exists, etc.) performance feature. -;opcache.enable_file_override=0 - -; A bitmask, where each bit enables or disables the appropriate OPcache -; passes -;opcache.optimization_level=0xffffffff - -;opcache.inherited_hack=1 -;opcache.dups_fix=0 - -; The location of the OPcache blacklist file (wildcards allowed). -; Each OPcache blacklist file is a text file that holds the names of files -; that should not be accelerated. The file format is to add each filename -; to a new line. The filename may be a full path or just a file prefix -; (i.e., /var/www/x blacklists all the files and directories in /var/www -; that start with 'x'). Line starting with a ; are ignored (comments). -;opcache.blacklist_filename= - -; Allows exclusion of large files from being cached. By default all files -; are cached. -;opcache.max_file_size=0 - -; Check the cache checksum each N requests. -; The default value of "0" means that the checks are disabled. -;opcache.consistency_checks=0 - -; How long to wait (in seconds) for a scheduled restart to begin if the cache -; is not being accessed. -;opcache.force_restart_timeout=180 - -; OPcache error_log file name. Empty string assumes "stderr". -;opcache.error_log= - -; All OPcache errors go to the Web server log. -; By default, only fatal errors (level 0) or errors (level 1) are logged. -; You can also enable warnings (level 2), info messages (level 3) or -; debug messages (level 4). -;opcache.log_verbosity_level=1 - -; Preferred Shared Memory back-end. Leave empty and let the system decide. -;opcache.preferred_memory_model= - -; Protect the shared memory from unexpected writing during script execution. -; Useful for internal debugging only. -;opcache.protect_memory=0 - -; Allows calling OPcache API functions only from PHP scripts which path is -; started from specified string. The default "" means no restriction -;opcache.restrict_api= - -; Mapping base of shared memory segments (for Windows only). All the PHP -; processes have to map shared memory into the same address space. This -; directive allows to manually fix the "Unable to reattach to base address" -; errors. -;opcache.mmap_base= - -; Enables and sets the second level cache directory. -; It should improve performance when SHM memory is full, at server restart or -; SHM reset. The default "" disables file based caching. -;opcache.file_cache= - -; Enables or disables opcode caching in shared memory. -;opcache.file_cache_only=0 - -; Enables or disables checksum validation when script loaded from file cache. -;opcache.file_cache_consistency_checks=1 - -; Implies opcache.file_cache_only=1 for a certain process that failed to -; reattach to the shared memory (for Windows only). Explicitly enabled file -; cache is required. -;opcache.file_cache_fallback=1 - -; Enables or disables copying of PHP code (text segment) into HUGE PAGES. -; This should improve performance, but requires appropriate OS configuration. -;opcache.huge_code_pages=1 - -; Validate cached file permissions. -;opcache.validate_permission=0 - -; Prevent name collisions in chroot'ed environment. -;opcache.validate_root=0 - -[curl] -; A default value for the CURLOPT_CAINFO option. This is required to be an -; absolute path. -;curl.cainfo = - -[openssl] -; The location of a Certificate Authority (CA) file on the local filesystem -; to use when verifying the identity of SSL/TLS peers. Most users should -; not specify a value for this directive as PHP will attempt to use the -; OS-managed cert stores in its absence. If specified, this value may still -; be overridden on a per-stream basis via the "cafile" SSL stream context -; option. -;openssl.cafile= - -; If openssl.cafile is not specified or if the CA file is not found, the -; directory pointed to by openssl.capath is searched for a suitable -; certificate. This value must be a correctly hashed certificate directory. -; Most users should not specify a value for this directive as PHP will -; attempt to use the OS-managed cert stores in its absence. If specified, -; this value may still be overridden on a per-stream basis via the "capath" -; SSL stream context option. -;openssl.capath= - -; Local Variables: -; tab-width: 4 -; End: -zend_extension = ioncube.so \ No newline at end of file diff --git a/images/php/alpine/docker-compose.yml b/images/php/alpine/docker-compose.yml deleted file mode 100644 index c978bfdb..00000000 --- a/images/php/alpine/docker-compose.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: '2' -services: - build: - build: . - - web: - images: ubuntu - links: - - mysql - ports: - - "8000:80" - environment: - DB_HOST: mysql:3306 - DB_PASSWD: root - - mysql: - images: mysql - environment: - - DB_PASSWD=root - expose: #only for container without host - - "3306" - volumes: - - /var/lib/mysql - - cache/:/tmp/cache - - ~/configs:/etc/configs/:ro - dns: - - 8.8.8.8 - - 9.9.9.9 \ No newline at end of file diff --git a/images/php/alpine/scripts/alpine.sh b/images/php/alpine/scripts/alpine.sh deleted file mode 100644 index abe731eb..00000000 --- a/images/php/alpine/scripts/alpine.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/sh -# Description: Build php extensions. -# time : 27 Dec 2017 - -SWOOLE_VER="4.3.2" -RAR_VER="4.0.0" -REDIS_VER="3.1.5" -IONCUBE_VER="10.3.4" -IMAGICK_VER="3.4.3" -cur_dir="/tmp" - -# PHP_VER=$(apk info php | grep descr | awk -F '-' '{print $2}') - -PHP_FULLVER=$(php -v | head -n 1 | awk -F ' ' '{print $2}') -PHP_VER=${PHP_FULLVER:0:3} - -build() -{ - phpize && ./configure && make -j8 && make install -} - -imagick() -{ - name="imagick" - cd ${cur_dir} - wget https://pecl.php.net/get/${name}-${IMAGICK_VER}.tgz && tar -xvf ${name}-${IMAGICK_VER}.tgz - cd ${name}-${IMAGICK_VER} && build - echo "extension=${name}.so" > /etc/php7/conf.d/${name}.ini -} - -swoole() -{ - name="swoole" - cd ${cur_dir} - wget https://dev.tencent.com/u/imxieke/p/attachment/git/raw/master/src/${name}-${SWOOLE_VER}.tgz && tar -xvf ${name}-${SWOOLE_VER}.tgz - cd ${name}-${SWOOLE_VER} - # have unknow error - #if [ `cat /etc/os-release | grep Alpine\ Linux` ]; then - echo "Linux Aio Not Avaiable in Alpine Linux" - sed -i 's/#define\ HAVE_LINUX_AIO/\/\/#define\ HAVE_LINUX_AIO/g' swoole_config.h - #fi - # build - phpize - ./configure --with-php-config=/usr/bin/php-config7 --enable-sockets=yes --enable-openssl=yes --enable-http2=yes --enable-mysqlnd=yes - make -j8 && make install - echo "extension=${name}.so" > /etc/php7/conf.d/${name}.ini -} - -rar(){ - name="rar" - cd ${cur_dir} - wget https://pecl.php.net/get/${name}-${RAR_VER}.tgz && tar -xvf ${name}-${RAR_VER}.tgz - cd ${name}-${RAR_VER} && build - echo "extension=${name}.so" > /etc/php7/conf.d/${name}.ini -} - -redis() -{ - name="redis" - cd ${cur_dir} - wget https://pecl.php.net/get/${name}-${REDIS_VER}.tgz && tar -xvf ${name}-${REDIS_VER}.tgz - cd ${name}-${REDIS_VER} && build - echo "extension=${name}.so" > /etc/php7/conf.d/${name}.ini -} - -ioncube() -{ - name="ioncube" - cd ${cur_dir} - wget https://dev.tencent.com/u/imxieke/p/attachment/git/raw/master/src/ioncube_loaders_lin_x86-64.zip -O ${name}.zip && unzip ${name}.zip - mv ${name}/ioncube_loader_lin_${PHP_VER}.so /usr/lib/php7/modules/${name}.so - # echo "extension=${name}.so" > /etc/php7/conf.d/${name}.ini -} - -start() -{ - # imagick - swoole - rar - # redis - ioncube - cd ${cur_dir} - rm -fr *.tgz* *.zip* /tmp/* -} - -start \ No newline at end of file diff --git a/images/php/alpine/scripts/start b/images/php/alpine/scripts/start deleted file mode 100644 index 96f0cb83..00000000 --- a/images/php/alpine/scripts/start +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -nginx && /usr/sbin/php-fpm7 --nodaemonize --fpm-config /etc/php7/php-fpm.d/www.conf diff --git a/images/php/conf/default.conf b/images/php/conf/default.conf deleted file mode 100644 index 34f30fbf..00000000 --- a/images/php/conf/default.conf +++ /dev/null @@ -1,49 +0,0 @@ -server - { - listen 80; - server_name _; - index index.html index.htm index.php; - root /var/www; - - #error_page 404 /404.html; - location ~ [^/]\.php(/|$) - { - try_files $uri =404; - fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; - # fastcgi_pass 127.0.0.1:9000; - fastcgi_index index.php; - include fastcgi.conf; - set $real_script_name $fastcgi_script_name; - if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { - set $real_script_name $1; - set $path_info $2; - } - fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; - fastcgi_param SCRIPT_NAME $real_script_name; - fastcgi_param PATH_INFO $path_info; - } - - location /nginx_status { - stub_status on; - access_log off; - allow 127.0.0.1; - deny all; - } - - location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ - { - expires 30d; - } - - location ~ .*\.(js|css)?$ - { - expires 12h; - } - - location ~ /\. - { - deny all; - } - - access_log /var/log/nginx/access.log; - } \ No newline at end of file diff --git a/images/php/conf/nginx.conf b/images/php/conf/nginx.conf deleted file mode 100644 index 9311781b..00000000 --- a/images/php/conf/nginx.conf +++ /dev/null @@ -1,61 +0,0 @@ -user www-data; -worker_processes auto; -error_log /var/log/nginx/error.log crit; -pid /var/run/nginx.pid; -worker_rlimit_nofile 51200; - -events -{ - use epoll; - multi_accept on; - worker_connections 51200; -} - -http - { - include /etc/nginx/mime.types; - #include proxy.conf; - #include luawaf.conf; - - default_type application/octet-stream; - - server_names_hash_bucket_size 128; - client_header_buffer_size 32k; - large_client_header_buffers 4 32k; - client_max_body_size 50m; - - sendfile on; - tcp_nopush on; - - keepalive_timeout 60; - - tcp_nodelay on; - - fastcgi_connect_timeout 300; - fastcgi_send_timeout 300; - fastcgi_read_timeout 300; - fastcgi_buffer_size 64k; - fastcgi_buffers 4 64k; - fastcgi_busy_buffers_size 128k; - fastcgi_temp_file_write_size 256k; - fastcgi_intercept_errors on; - - gzip on; - gzip_min_length 1k; - gzip_buffers 4 16k; - gzip_http_version 1.1; - gzip_comp_level 2; - gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml; - gzip_vary on; - gzip_proxied expired no-cache no-store private auth; - gzip_disable "MSIE [1-6]\."; - - limit_conn_zone $binary_remote_addr zone=perip:10m; - limit_conn_zone $server_name zone=perserver:10m; - - server_tokens off; - access_log off; - - include /etc/nginx/conf.d/*.conf; -} - diff --git a/images/php/conf/php.ini b/images/php/conf/php.ini deleted file mode 100644 index e72b7df1..00000000 --- a/images/php/conf/php.ini +++ /dev/null @@ -1,1934 +0,0 @@ -[PHP] - -;;;;;;;;;;;;;;;;;;; -; About php.ini ; -;;;;;;;;;;;;;;;;;;; -; PHP's initialization file, generally called php.ini, is responsible for -; configuring many of the aspects of PHP's behavior. - -; PHP attempts to find and load this configuration from a number of locations. -; The following is a summary of its search order: -; 1. SAPI module specific location. -; 2. The PHPRC environment variable. (As of PHP 5.2.0) -; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0) -; 4. Current working directory (except CLI) -; 5. The web server's directory (for SAPI modules), or directory of PHP -; (otherwise in Windows) -; 6. The directory from the --with-config-file-path compile time option, or the -; Windows directory (C:\windows or C:\winnt) -; See the PHP docs for more specific information. -; http://php.net/configuration.file - -; The syntax of the file is extremely simple. Whitespace and lines -; beginning with a semicolon are silently ignored (as you probably guessed). -; Section headers (e.g. [Foo]) are also silently ignored, even though -; they might mean something in the future. - -; Directives following the section heading [PATH=/www/mysite] only -; apply to PHP files in the /www/mysite directory. Directives -; following the section heading [HOST=www.example.com] only apply to -; PHP files served from www.example.com. Directives set in these -; special sections cannot be overridden by user-defined INI files or -; at runtime. Currently, [PATH=] and [HOST=] sections only work under -; CGI/FastCGI. -; http://php.net/ini.sections - -; Directives are specified using the following syntax: -; directive = value -; Directive names are *case sensitive* - foo=bar is different from FOO=bar. -; Directives are variables used to configure PHP or PHP extensions. -; There is no name validation. If PHP can't find an expected -; directive because it is not set or is mistyped, a default value will be used. - -; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one -; of the INI constants (On, Off, True, False, Yes, No and None) or an expression -; (e.g. E_ALL & ~E_NOTICE), a quoted string ("bar"), or a reference to a -; previously set variable or directive (e.g. ${foo}) - -; Expressions in the INI file are limited to bitwise operators and parentheses: -; | bitwise OR -; ^ bitwise XOR -; & bitwise AND -; ~ bitwise NOT -; ! boolean NOT - -; Boolean flags can be turned on using the values 1, On, True or Yes. -; They can be turned off using the values 0, Off, False or No. - -; An empty string can be denoted by simply not writing anything after the equal -; sign, or by using the None keyword: - -; foo = ; sets foo to an empty string -; foo = None ; sets foo to an empty string -; foo = "None" ; sets foo to the string 'None' - -; If you use constants in your value, and these constants belong to a -; dynamically loaded extension (either a PHP extension or a Zend extension), -; you may only use these constants *after* the line that loads the extension. - -;;;;;;;;;;;;;;;;;;; -; About this file ; -;;;;;;;;;;;;;;;;;;; -; PHP comes packaged with two INI files. One that is recommended to be used -; in production environments and one that is recommended to be used in -; development environments. - -; php.ini-production contains settings which hold security, performance and -; best practices at its core. But please be aware, these settings may break -; compatibility with older or less security conscience applications. We -; recommending using the production ini in production and testing environments. - -; php.ini-development is very similar to its production variant, except it is -; much more verbose when it comes to errors. We recommend using the -; development version only in development environments, as errors shown to -; application users can inadvertently leak otherwise secure information. - -; This is php.ini-production INI file. - -;;;;;;;;;;;;;;;;;;; -; Quick Reference ; -;;;;;;;;;;;;;;;;;;; -; The following are all the settings which are different in either the production -; or development versions of the INIs with respect to PHP's default behavior. -; Please see the actual settings later in the document for more details as to why -; we recommend these changes in PHP's behavior. - -; display_errors -; Default Value: On -; Development Value: On -; Production Value: Off - -; display_startup_errors -; Default Value: Off -; Development Value: On -; Production Value: Off - -; error_reporting -; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED -; Development Value: E_ALL -; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT - -; html_errors -; Default Value: On -; Development Value: On -; Production value: On - -; log_errors -; Default Value: Off -; Development Value: On -; Production Value: On - -; max_input_time -; Default Value: -1 (Unlimited) -; Development Value: 60 (60 seconds) -; Production Value: 60 (60 seconds) - -; output_buffering -; Default Value: Off -; Development Value: 4096 -; Production Value: 4096 - -; register_argc_argv -; Default Value: On -; Development Value: Off -; Production Value: Off - -; request_order -; Default Value: None -; Development Value: "GP" -; Production Value: "GP" - -; session.gc_divisor -; Default Value: 100 -; Development Value: 1000 -; Production Value: 1000 - -; session.sid_bits_per_character -; Default Value: 4 -; Development Value: 5 -; Production Value: 5 - -; short_open_tag -; Default Value: On -; Development Value: Off -; Production Value: Off - -; track_errors -; Default Value: Off -; Development Value: On -; Production Value: Off - -; variables_order -; Default Value: "EGPCS" -; Development Value: "GPCS" -; Production Value: "GPCS" - -;;;;;;;;;;;;;;;;;;;; -; php.ini Options ; -;;;;;;;;;;;;;;;;;;;; -; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini" -;user_ini.filename = ".user.ini" - -; To disable this feature set this option to empty value -;user_ini.filename = - -; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes) -;user_ini.cache_ttl = 300 - -;;;;;;;;;;;;;;;;;;;; -; Language Options ; -;;;;;;;;;;;;;;;;;;;; - -; Enable the PHP scripting language engine under Apache. -; http://php.net/engine -engine = On - -; This directive determines whether or not PHP will recognize code between -; tags as PHP source which should be processed as such. It is -; generally recommended that should be used and that this feature -; should be disabled, as enabling it may result in issues when generating XML -; documents, however this remains supported for backward compatibility reasons. -; Note that this directive does not control the would work. -; http://php.net/syntax-highlighting -;highlight.string = #DD0000 -;highlight.comment = #FF9900 -;highlight.keyword = #007700 -;highlight.default = #0000BB -;highlight.html = #000000 - -; If enabled, the request will be allowed to complete even if the user aborts -; the request. Consider enabling it if executing long requests, which may end up -; being interrupted by the user or a browser timing out. PHP's default behavior -; is to disable this feature. -; http://php.net/ignore-user-abort -;ignore_user_abort = On - -; Determines the size of the realpath cache to be used by PHP. This value should -; be increased on systems where PHP opens many files to reflect the quantity of -; the file operations performed. -; http://php.net/realpath-cache-size -;realpath_cache_size = 4096k - -; Duration of time, in seconds for which to cache realpath information for a given -; file or directory. For systems with rarely changing files, consider increasing this -; value. -; http://php.net/realpath-cache-ttl -;realpath_cache_ttl = 120 - -; Enables or disables the circular reference collector. -; http://php.net/zend.enable-gc -zend.enable_gc = On - -; If enabled, scripts may be written in encodings that are incompatible with -; the scanner. CP936, Big5, CP949 and Shift_JIS are the examples of such -; encodings. To use this feature, mbstring extension must be enabled. -; Default: Off -;zend.multibyte = Off - -; Allows to set the default encoding for the scripts. This value will be used -; unless "declare(encoding=...)" directive appears at the top of the script. -; Only affects if zend.multibyte is set. -; Default: "" -;zend.script_encoding = - -;;;;;;;;;;;;;;;;; -; Miscellaneous ; -;;;;;;;;;;;;;;;;; - -; Decides whether PHP may expose the fact that it is installed on the server -; (e.g. by adding its signature to the Web server header). It is no security -; threat in any way, but it makes it possible to determine whether you use PHP -; on your server or not. -; http://php.net/expose-php -expose_php = Off - -;;;;;;;;;;;;;;;;;;; -; Resource Limits ; -;;;;;;;;;;;;;;;;;;; - -; Maximum execution time of each script, in seconds -; http://php.net/max-execution-time -; Note: This directive is hardcoded to 0 for the CLI SAPI -max_execution_time = 30 - -; Maximum amount of time each script may spend parsing request data. It's a good -; idea to limit this time on productions servers in order to eliminate unexpectedly -; long running scripts. -; Note: This directive is hardcoded to -1 for the CLI SAPI -; Default Value: -1 (Unlimited) -; Development Value: 60 (60 seconds) -; Production Value: 60 (60 seconds) -; http://php.net/max-input-time -max_input_time = 60 - -; Maximum input variable nesting level -; http://php.net/max-input-nesting-level -;max_input_nesting_level = 64 - -; How many GET/POST/COOKIE input variables may be accepted -; max_input_vars = 1000 - -; Maximum amount of memory a script may consume (128MB) -; http://php.net/memory-limit -memory_limit = 64M - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Error handling and logging ; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -; This directive informs PHP of which errors, warnings and notices you would like -; it to take action for. The recommended way of setting values for this -; directive is through the use of the error level constants and bitwise -; operators. The error level constants are below here for convenience as well as -; some common settings and their meanings. -; By default, PHP is set to take action on all errors, notices and warnings EXCEPT -; those related to E_NOTICE and E_STRICT, which together cover best practices and -; recommended coding standards in PHP. For performance reasons, this is the -; recommend error reporting setting. Your production server shouldn't be wasting -; resources complaining about best practices and coding standards. That's what -; development servers and development settings are for. -; Note: The php.ini-development file has this setting as E_ALL. This -; means it pretty much reports everything which is exactly what you want during -; development and early testing. -; -; Error Level Constants: -; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0) -; E_ERROR - fatal run-time errors -; E_RECOVERABLE_ERROR - almost fatal run-time errors -; E_WARNING - run-time warnings (non-fatal errors) -; E_PARSE - compile-time parse errors -; E_NOTICE - run-time notices (these are warnings which often result -; from a bug in your code, but it's possible that it was -; intentional (e.g., using an uninitialized variable and -; relying on the fact it is automatically initialized to an -; empty string) -; E_STRICT - run-time notices, enable to have PHP suggest changes -; to your code which will ensure the best interoperability -; and forward compatibility of your code -; E_CORE_ERROR - fatal errors that occur during PHP's initial startup -; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's -; initial startup -; E_COMPILE_ERROR - fatal compile-time errors -; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) -; E_USER_ERROR - user-generated error message -; E_USER_WARNING - user-generated warning message -; E_USER_NOTICE - user-generated notice message -; E_DEPRECATED - warn about code that will not work in future versions -; of PHP -; E_USER_DEPRECATED - user-generated deprecation warnings -; -; Common Values: -; E_ALL (Show all errors, warnings and notices including coding standards.) -; E_ALL & ~E_NOTICE (Show all errors, except for notices) -; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.) -; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors) -; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED -; Development Value: E_ALL -; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT -; http://php.net/error-reporting -error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT - -; This directive controls whether or not and where PHP will output errors, -; notices and warnings too. Error output is very useful during development, but -; it could be very dangerous in production environments. Depending on the code -; which is triggering the error, sensitive information could potentially leak -; out of your application such as database usernames and passwords or worse. -; For production environments, we recommend logging errors rather than -; sending them to STDOUT. -; Possible Values: -; Off = Do not display any errors -; stderr = Display errors to STDERR (affects only CGI/CLI binaries!) -; On or stdout = Display errors to STDOUT -; Default Value: On -; Development Value: On -; Production Value: Off -; http://php.net/display-errors -display_errors = Off - -; The display of errors which occur during PHP's startup sequence are handled -; separately from display_errors. PHP's default behavior is to suppress those -; errors from clients. Turning the display of startup errors on can be useful in -; debugging configuration problems. We strongly recommend you -; set this to 'off' for production servers. -; Default Value: Off -; Development Value: On -; Production Value: Off -; http://php.net/display-startup-errors -display_startup_errors = Off - -; Besides displaying errors, PHP can also log errors to locations such as a -; server-specific log, STDERR, or a location specified by the error_log -; directive found below. While errors should not be displayed on productions -; servers they should still be monitored and logging is a great way to do that. -; Default Value: Off -; Development Value: On -; Production Value: On -; http://php.net/log-errors -log_errors = On - -; Set maximum length of log_errors. In error_log information about the source is -; added. The default is 1024 and 0 allows to not apply any maximum length at all. -; http://php.net/log-errors-max-len -log_errors_max_len = 1024 - -; Do not log repeated messages. Repeated errors must occur in same file on same -; line unless ignore_repeated_source is set true. -; http://php.net/ignore-repeated-errors -ignore_repeated_errors = Off - -; Ignore source of message when ignoring repeated messages. When this setting -; is On you will not log errors with repeated messages from different files or -; source lines. -; http://php.net/ignore-repeated-source -ignore_repeated_source = Off - -; If this parameter is set to Off, then memory leaks will not be shown (on -; stdout or in the log). This has only effect in a debug compile, and if -; error reporting includes E_WARNING in the allowed list -; http://php.net/report-memleaks -report_memleaks = On - -; This setting is on by default. -;report_zend_debug = 0 - -; Store the last error/warning message in $php_errormsg (boolean). Setting this value -; to On can assist in debugging and is appropriate for development servers. It should -; however be disabled on production servers. -; Default Value: Off -; Development Value: On -; Production Value: Off -; http://php.net/track-errors -track_errors = Off - -; Turn off normal error reporting and emit XML-RPC error XML -; http://php.net/xmlrpc-errors -;xmlrpc_errors = 0 - -; An XML-RPC faultCode -;xmlrpc_error_number = 0 - -; When PHP displays or logs an error, it has the capability of formatting the -; error message as HTML for easier reading. This directive controls whether -; the error message is formatted as HTML or not. -; Note: This directive is hardcoded to Off for the CLI SAPI -; Default Value: On -; Development Value: On -; Production value: On -; http://php.net/html-errors -html_errors = On - -; If html_errors is set to On *and* docref_root is not empty, then PHP -; produces clickable error messages that direct to a page describing the error -; or function causing the error in detail. -; You can download a copy of the PHP manual from http://php.net/docs -; and change docref_root to the base URL of your local copy including the -; leading '/'. You must also specify the file extension being used including -; the dot. PHP's default behavior is to leave these settings empty, in which -; case no links to documentation are generated. -; Note: Never use this feature for production boxes. -; http://php.net/docref-root -; Examples -;docref_root = "/phpmanual/" - -; http://php.net/docref-ext -;docref_ext = .html - -; String to output before an error message. PHP's default behavior is to leave -; this setting blank. -; http://php.net/error-prepend-string -; Example: -;error_prepend_string = "" - -; String to output after an error message. PHP's default behavior is to leave -; this setting blank. -; http://php.net/error-append-string -; Example: -;error_append_string = "" - -; Log errors to specified file. PHP's default behavior is to leave this value -; empty. -; http://php.net/error-log -; Example: -;error_log = php_errors.log -; Log errors to syslog (Event Log on Windows). -;error_log = syslog - -;windows.show_crt_warning -; Default value: 0 -; Development value: 0 -; Production value: 0 - -;;;;;;;;;;;;;;;;; -; Data Handling ; -;;;;;;;;;;;;;;;;; - -; The separator used in PHP generated URLs to separate arguments. -; PHP's default setting is "&". -; http://php.net/arg-separator.output -; Example: -;arg_separator.output = "&" - -; List of separator(s) used by PHP to parse input URLs into variables. -; PHP's default setting is "&". -; NOTE: Every character in this directive is considered as separator! -; http://php.net/arg-separator.input -; Example: -;arg_separator.input = ";&" - -; This directive determines which super global arrays are registered when PHP -; starts up. G,P,C,E & S are abbreviations for the following respective super -; globals: GET, POST, COOKIE, ENV and SERVER. There is a performance penalty -; paid for the registration of these arrays and because ENV is not as commonly -; used as the others, ENV is not recommended on productions servers. You -; can still get access to the environment variables through getenv() should you -; need to. -; Default Value: "EGPCS" -; Development Value: "GPCS" -; Production Value: "GPCS"; -; http://php.net/variables-order -variables_order = "GPCS" - -; This directive determines which super global data (G,P & C) should be -; registered into the super global array REQUEST. If so, it also determines -; the order in which that data is registered. The values for this directive -; are specified in the same manner as the variables_order directive, -; EXCEPT one. Leaving this value empty will cause PHP to use the value set -; in the variables_order directive. It does not mean it will leave the super -; globals array REQUEST empty. -; Default Value: None -; Development Value: "GP" -; Production Value: "GP" -; http://php.net/request-order -request_order = "GP" - -; This directive determines whether PHP registers $argv & $argc each time it -; runs. $argv contains an array of all the arguments passed to PHP when a script -; is invoked. $argc contains an integer representing the number of arguments -; that were passed when the script was invoked. These arrays are extremely -; useful when running scripts from the command line. When this directive is -; enabled, registering these variables consumes CPU cycles and memory each time -; a script is executed. For performance reasons, this feature should be disabled -; on production servers. -; Note: This directive is hardcoded to On for the CLI SAPI -; Default Value: On -; Development Value: Off -; Production Value: Off -; http://php.net/register-argc-argv -register_argc_argv = Off - -; When enabled, the ENV, REQUEST and SERVER variables are created when they're -; first used (Just In Time) instead of when the script starts. If these -; variables are not used within a script, having this directive on will result -; in a performance gain. The PHP directive register_argc_argv must be disabled -; for this directive to have any affect. -; http://php.net/auto-globals-jit -auto_globals_jit = On - -; Whether PHP will read the POST data. -; This option is enabled by default. -; Most likely, you won't want to disable this option globally. It causes $_POST -; and $_FILES to always be empty; the only way you will be able to read the -; POST data will be through the php://input stream wrapper. This can be useful -; to proxy requests or to process the POST data in a memory efficient fashion. -; http://php.net/enable-post-data-reading -;enable_post_data_reading = Off - -; Maximum size of POST data that PHP will accept. -; Its value may be 0 to disable the limit. It is ignored if POST data reading -; is disabled through enable_post_data_reading. -; http://php.net/post-max-size -post_max_size = 5120M - -; Automatically add files before PHP document. -; http://php.net/auto-prepend-file -auto_prepend_file = - -; Automatically add files after PHP document. -; http://php.net/auto-append-file -auto_append_file = - -; By default, PHP will output a media type using the Content-Type header. To -; disable this, simply set it to be empty. -; -; PHP's built-in default media type is set to text/html. -; http://php.net/default-mimetype -default_mimetype = "text/html" - -; PHP's default character set is set to UTF-8. -; http://php.net/default-charset -default_charset = "UTF-8" - -; PHP internal character encoding is set to empty. -; If empty, default_charset is used. -; http://php.net/internal-encoding -;internal_encoding = - -; PHP input character encoding is set to empty. -; If empty, default_charset is used. -; http://php.net/input-encoding -;input_encoding = - -; PHP output character encoding is set to empty. -; If empty, default_charset is used. -; See also output_buffer. -; http://php.net/output-encoding -;output_encoding = - -;;;;;;;;;;;;;;;;;;;;;;;;; -; Paths and Directories ; -;;;;;;;;;;;;;;;;;;;;;;;;; - -; UNIX: "/path1:/path2" -;include_path = ".:/php/includes" -; -; Windows: "\path1;\path2" -;include_path = ".;c:\php\includes" -; -; PHP's default setting for include_path is ".;/path/to/php/pear" -; http://php.net/include-path - -; The root of the PHP pages, used only if nonempty. -; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root -; if you are running php as a CGI under any web server (other than IIS) -; see documentation for security issues. The alternate is to use the -; cgi.force_redirect configuration below -; http://php.net/doc-root -doc_root = - -; The directory under which PHP opens the script using /~username used only -; if nonempty. -; http://php.net/user-dir -user_dir = - -; Directory in which the loadable extensions (modules) reside. -; http://php.net/extension-dir -; extension_dir = "./" -; On windows: -; extension_dir = "ext" - -; Directory where the temporary files should be placed. -; Defaults to the system default (see sys_get_temp_dir) -; sys_temp_dir = "/tmp" - -; Whether or not to enable the dl() function. The dl() function does NOT work -; properly in multithreaded servers, such as IIS or Zeus, and is automatically -; disabled on them. -; http://php.net/enable-dl -enable_dl = Off - -; cgi.force_redirect is necessary to provide security running PHP as a CGI under -; most web servers. Left undefined, PHP turns this on by default. You can -; turn it off here AT YOUR OWN RISK -; **You CAN safely turn this off for IIS, in fact, you MUST.** -; http://php.net/cgi.force-redirect -;cgi.force_redirect = 1 - -; if cgi.nph is enabled it will force cgi to always sent Status: 200 with -; every request. PHP's default behavior is to disable this feature. -;cgi.nph = 1 - -; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape -; (iPlanet) web servers, you MAY need to set an environment variable name that PHP -; will look for to know it is OK to continue execution. Setting this variable MAY -; cause security issues, KNOW WHAT YOU ARE DOING FIRST. -; http://php.net/cgi.redirect-status-env -;cgi.redirect_status_env = - -; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's -; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok -; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting -; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting -; of zero causes PHP to behave as before. Default is 1. You should fix your scripts -; to use SCRIPT_FILENAME rather than PATH_TRANSLATED. -; http://php.net/cgi.fix-pathinfo -;cgi.fix_pathinfo=1 - -; if cgi.discard_path is enabled, the PHP CGI binary can safely be placed outside -; of the web tree and people will not be able to circumvent .htaccess security. -; http://php.net/cgi.dicard-path -;cgi.discard_path=1 - -; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate -; security tokens of the calling client. This allows IIS to define the -; security context that the request runs under. mod_fastcgi under Apache -; does not currently support this feature (03/17/2002) -; Set to 1 if running under IIS. Default is zero. -; http://php.net/fastcgi.impersonate -;fastcgi.impersonate = 1 - -; Disable logging through FastCGI connection. PHP's default behavior is to enable -; this feature. -;fastcgi.logging = 0 - -; cgi.rfc2616_headers configuration option tells PHP what type of headers to -; use when sending HTTP response code. If set to 0, PHP sends Status: header that -; is supported by Apache. When this option is set to 1, PHP will send -; RFC2616 compliant header. -; Default is zero. -; http://php.net/cgi.rfc2616-headers -;cgi.rfc2616_headers = 0 - -; cgi.check_shebang_line controls whether CGI PHP checks for line starting with #! -; (shebang) at the top of the running script. This line might be needed if the -; script support running both as stand-alone script and via PHP CGI<. PHP in CGI -; mode skips this line and ignores its content if this directive is turned on. -; http://php.net/cgi.check-shebang-line -;cgi.check_shebang_line=1 - -;;;;;;;;;;;;;;;; -; File Uploads ; -;;;;;;;;;;;;;;;; - -; Whether to allow HTTP file uploads. -; http://php.net/file-uploads -file_uploads = On - -; Temporary directory for HTTP uploaded files (will use system default if not -; specified). -; http://php.net/upload-tmp-dir -;upload_tmp_dir = - -; Maximum allowed size for uploaded files. -; http://php.net/upload-max-filesize -upload_max_filesize = 5120M - -; Maximum number of files that can be uploaded via a single request -max_file_uploads = 40960 - -;;;;;;;;;;;;;;;;;; -; Fopen wrappers ; -;;;;;;;;;;;;;;;;;; - -; Whether to allow the treatment of URLs (like http:// or ftp://) as files. -; http://php.net/allow-url-fopen -allow_url_fopen = On - -; Whether to allow include/require to open URLs (like http:// or ftp://) as files. -; http://php.net/allow-url-include -allow_url_include = Off - -; Define the anonymous ftp password (your email address). PHP's default setting -; for this is empty. -; http://php.net/from -;from="john@doe.com" - -; Define the User-Agent string. PHP's default setting for this is empty. -; http://php.net/user-agent -;user_agent="PHP" - -; Default timeout for socket based streams (seconds) -; http://php.net/default-socket-timeout -default_socket_timeout = 60 - -; If your scripts have to deal with files from Macintosh systems, -; or you are running on a Mac and need to deal with files from -; unix or win32 systems, setting this flag will cause PHP to -; automatically detect the EOL character in those files so that -; fgets() and file() will work regardless of the source of the file. -; http://php.net/auto-detect-line-endings -;auto_detect_line_endings = Off - -;;;;;;;;;;;;;;;;;;;;;; -; Dynamic Extensions ; -;;;;;;;;;;;;;;;;;;;;;; - -; If you wish to have an extension loaded automatically, use the following -; syntax: -; -; extension=modulename.extension -; -; For example, on Windows: -; -; extension=msql.dll -; -; ... or under UNIX: -; -; extension=msql.so -; -; ... or with a path: -; -; extension=/path/to/extension/msql.so -; -; If you only provide the name of the extension, PHP will look for it in its -; default extension directory. -; -; Windows Extensions -; Note that ODBC support is built in, so no dll is needed for it. -; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5+) -; extension folders as well as the separate PECL DLL download (PHP 5+). -; Be sure to appropriately set the extension_dir directive. -; -;extension=php_bz2.dll -;extension=php_curl.dll -;extension=php_fileinfo.dll -;extension=php_ftp.dll -;extension=php_gd2.dll -;extension=php_gettext.dll -;extension=php_gmp.dll -;extension=php_intl.dll -;extension=php_imap.dll -;extension=php_interbase.dll -;extension=php_ldap.dll -;extension=php_mbstring.dll -;extension=php_exif.dll ; Must be after mbstring as it depends on it -;extension=php_mysqli.dll -;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client -;extension=php_openssl.dll -;extension=php_pdo_firebird.dll -;extension=php_pdo_mysql.dll -;extension=php_pdo_oci.dll -;extension=php_pdo_odbc.dll -;extension=php_pdo_pgsql.dll -;extension=php_pdo_sqlite.dll -;extension=php_pgsql.dll -;extension=php_shmop.dll - -; The MIBS data available in the PHP distribution must be installed. -; See http://www.php.net/manual/en/snmp.installation.php -;extension=php_snmp.dll - -;extension=php_soap.dll -;extension=php_sockets.dll -;extension=php_sqlite3.dll -;extension=php_tidy.dll -;extension=php_xmlrpc.dll -;extension=php_xsl.dll - -;;;;;;;;;;;;;;;;;;; -; Module Settings ; -;;;;;;;;;;;;;;;;;;; - -[CLI Server] -; Whether the CLI web server uses ANSI color coding in its terminal output. -cli_server.color = On - -[Date] -; Defines the default timezone used by the date functions -; http://php.net/date.timezone -date.timezone = Asia/Shanghai - -; http://php.net/date.default-latitude -;date.default_latitude = 31.7667 - -; http://php.net/date.default-longitude -;date.default_longitude = 35.2333 - -; http://php.net/date.sunrise-zenith -;date.sunrise_zenith = 90.583333 - -; http://php.net/date.sunset-zenith -;date.sunset_zenith = 90.583333 - -[filter] -; http://php.net/filter.default -;filter.default = unsafe_raw - -; http://php.net/filter.default-flags -;filter.default_flags = - -[iconv] -; Use of this INI entry is deprecated, use global input_encoding instead. -; If empty, default_charset or input_encoding or iconv.input_encoding is used. -; The precedence is: default_charset < intput_encoding < iconv.input_encoding -;iconv.input_encoding = - -; Use of this INI entry is deprecated, use global internal_encoding instead. -; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. -; The precedence is: default_charset < internal_encoding < iconv.internal_encoding -;iconv.internal_encoding = - -; Use of this INI entry is deprecated, use global output_encoding instead. -; If empty, default_charset or output_encoding or iconv.output_encoding is used. -; The precedence is: default_charset < output_encoding < iconv.output_encoding -; To use an output encoding conversion, iconv's output handler must be set -; otherwise output encoding conversion cannot be performed. -;iconv.output_encoding = - -[intl] -;intl.default_locale = -; This directive allows you to produce PHP errors when some error -; happens within intl functions. The value is the level of the error produced. -; Default is 0, which does not produce any errors. -;intl.error_level = E_WARNING -;intl.use_exceptions = 0 - -[sqlite3] -;sqlite3.extension_dir = - -[Pcre] -;PCRE library backtracking limit. -; http://php.net/pcre.backtrack-limit -;pcre.backtrack_limit=100000 - -;PCRE library recursion limit. -;Please note that if you set this value to a high number you may consume all -;the available process stack and eventually crash PHP (due to reaching the -;stack size limit imposed by the Operating System). -; http://php.net/pcre.recursion-limit -;pcre.recursion_limit=100000 - -;Enables or disables JIT compilation of patterns. This requires the PCRE -;library to be compiled with JIT support. -;pcre.jit=1 - -[Pdo] -; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off" -; http://php.net/pdo-odbc.connection-pooling -;pdo_odbc.connection_pooling=strict - -;pdo_odbc.db2_instance_name - -[Pdo_mysql] -; If mysqlnd is used: Number of cache slots for the internal result set cache -; http://php.net/pdo_mysql.cache_size -pdo_mysql.cache_size = 2000 - -; Default socket name for local MySQL connects. If empty, uses the built-in -; MySQL defaults. -; http://php.net/pdo_mysql.default-socket -pdo_mysql.default_socket= - -[Phar] -; http://php.net/phar.readonly -;phar.readonly = On - -; http://php.net/phar.require-hash -;phar.require_hash = On - -;phar.cache_list = - -[mail function] -; For Win32 only. -; http://php.net/smtp -SMTP = localhost -; http://php.net/smtp-port -smtp_port = 25 - -; For Win32 only. -; http://php.net/sendmail-from -;sendmail_from = me@example.com - -; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). -; http://php.net/sendmail-path -;sendmail_path = - -; Force the addition of the specified parameters to be passed as extra parameters -; to the sendmail binary. These parameters will always replace the value of -; the 5th parameter to mail(). -;mail.force_extra_parameters = - -; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename -mail.add_x_header = On - -; The path to a log file that will log all mail() calls. Log entries include -; the full path of the script, line number, To address and headers. -;mail.log = -; Log mail to syslog (Event Log on Windows). -;mail.log = syslog - -[SQL] -; http://php.net/sql.safe-mode -sql.safe_mode = Off - -[ODBC] -; http://php.net/odbc.default-db -;odbc.default_db = Not yet implemented - -; http://php.net/odbc.default-user -;odbc.default_user = Not yet implemented - -; http://php.net/odbc.default-pw -;odbc.default_pw = Not yet implemented - -; Controls the ODBC cursor model. -; Default: SQL_CURSOR_STATIC (default). -;odbc.default_cursortype - -; Allow or prevent persistent links. -; http://php.net/odbc.allow-persistent -odbc.allow_persistent = On - -; Check that a connection is still valid before reuse. -; http://php.net/odbc.check-persistent -odbc.check_persistent = On - -; Maximum number of persistent links. -1 means no limit. -; http://php.net/odbc.max-persistent -odbc.max_persistent = -1 - -; Maximum number of links (persistent + non-persistent). -1 means no limit. -; http://php.net/odbc.max-links -odbc.max_links = -1 - -; Handling of LONG fields. Returns number of bytes to variables. 0 means -; passthru. -; http://php.net/odbc.defaultlrl -odbc.defaultlrl = 4096 - -; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. -; See the documentation on odbc_binmode and odbc_longreadlen for an explanation -; of odbc.defaultlrl and odbc.defaultbinmode -; http://php.net/odbc.defaultbinmode -odbc.defaultbinmode = 1 - -;birdstep.max_links = -1 - -[Interbase] -; Allow or prevent persistent links. -ibase.allow_persistent = 1 - -; Maximum number of persistent links. -1 means no limit. -ibase.max_persistent = -1 - -; Maximum number of links (persistent + non-persistent). -1 means no limit. -ibase.max_links = -1 - -; Default database name for ibase_connect(). -;ibase.default_db = - -; Default username for ibase_connect(). -;ibase.default_user = - -; Default password for ibase_connect(). -;ibase.default_password = - -; Default charset for ibase_connect(). -;ibase.default_charset = - -; Default timestamp format. -ibase.timestampformat = "%Y-%m-%d %H:%M:%S" - -; Default date format. -ibase.dateformat = "%Y-%m-%d" - -; Default time format. -ibase.timeformat = "%H:%M:%S" - -[MySQLi] - -; Maximum number of persistent links. -1 means no limit. -; http://php.net/mysqli.max-persistent -mysqli.max_persistent = -1 - -; Allow accessing, from PHP's perspective, local files with LOAD DATA statements -; http://php.net/mysqli.allow_local_infile -;mysqli.allow_local_infile = On - -; Allow or prevent persistent links. -; http://php.net/mysqli.allow-persistent -mysqli.allow_persistent = On - -; Maximum number of links. -1 means no limit. -; http://php.net/mysqli.max-links -mysqli.max_links = -1 - -; If mysqlnd is used: Number of cache slots for the internal result set cache -; http://php.net/mysqli.cache_size -mysqli.cache_size = 2000 - -; Default port number for mysqli_connect(). If unset, mysqli_connect() will use -; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the -; compile-time value defined MYSQL_PORT (in that order). Win32 will only look -; at MYSQL_PORT. -; http://php.net/mysqli.default-port -mysqli.default_port = 3306 - -; Default socket name for local MySQL connects. If empty, uses the built-in -; MySQL defaults. -; http://php.net/mysqli.default-socket -mysqli.default_socket = - -; Default host for mysql_connect() (doesn't apply in safe mode). -; http://php.net/mysqli.default-host -mysqli.default_host = - -; Default user for mysql_connect() (doesn't apply in safe mode). -; http://php.net/mysqli.default-user -mysqli.default_user = - -; Default password for mysqli_connect() (doesn't apply in safe mode). -; Note that this is generally a *bad* idea to store passwords in this file. -; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw") -; and reveal this password! And of course, any users with read access to this -; file will be able to reveal the password as well. -; http://php.net/mysqli.default-pw -mysqli.default_pw = - -; Allow or prevent reconnect -mysqli.reconnect = Off - -[mysqlnd] -; Enable / Disable collection of general statistics by mysqlnd which can be -; used to tune and monitor MySQL operations. -; http://php.net/mysqlnd.collect_statistics -mysqlnd.collect_statistics = On - -; Enable / Disable collection of memory usage statistics by mysqlnd which can be -; used to tune and monitor MySQL operations. -; http://php.net/mysqlnd.collect_memory_statistics -mysqlnd.collect_memory_statistics = Off - -; Records communication from all extensions using mysqlnd to the specified log -; file. -; http://php.net/mysqlnd.debug -;mysqlnd.debug = - -; Defines which queries will be logged. -; http://php.net/mysqlnd.log_mask -;mysqlnd.log_mask = 0 - -; Default size of the mysqlnd memory pool, which is used by result sets. -; http://php.net/mysqlnd.mempool_default_size -;mysqlnd.mempool_default_size = 16000 - -; Size of a pre-allocated buffer used when sending commands to MySQL in bytes. -; http://php.net/mysqlnd.net_cmd_buffer_size -;mysqlnd.net_cmd_buffer_size = 2048 - -; Size of a pre-allocated buffer used for reading data sent by the server in -; bytes. -; http://php.net/mysqlnd.net_read_buffer_size -;mysqlnd.net_read_buffer_size = 32768 - -; Timeout for network requests in seconds. -; http://php.net/mysqlnd.net_read_timeout -;mysqlnd.net_read_timeout = 31536000 - -; SHA-256 Authentication Plugin related. File with the MySQL server public RSA -; key. -; http://php.net/mysqlnd.sha256_server_public_key -;mysqlnd.sha256_server_public_key = - -[OCI8] - -; Connection: Enables privileged connections using external -; credentials (OCI_SYSOPER, OCI_SYSDBA) -; http://php.net/oci8.privileged-connect -;oci8.privileged_connect = Off - -; Connection: The maximum number of persistent OCI8 connections per -; process. Using -1 means no limit. -; http://php.net/oci8.max-persistent -;oci8.max_persistent = -1 - -; Connection: The maximum number of seconds a process is allowed to -; maintain an idle persistent connection. Using -1 means idle -; persistent connections will be maintained forever. -; http://php.net/oci8.persistent-timeout -;oci8.persistent_timeout = -1 - -; Connection: The number of seconds that must pass before issuing a -; ping during oci_pconnect() to check the connection validity. When -; set to 0, each oci_pconnect() will cause a ping. Using -1 disables -; pings completely. -; http://php.net/oci8.ping-interval -;oci8.ping_interval = 60 - -; Connection: Set this to a user chosen connection class to be used -; for all pooled server requests with Oracle 11g Database Resident -; Connection Pooling (DRCP). To use DRCP, this value should be set to -; the same string for all web servers running the same application, -; the database pool must be configured, and the connection string must -; specify to use a pooled server. -;oci8.connection_class = - -; High Availability: Using On lets PHP receive Fast Application -; Notification (FAN) events generated when a database node fails. The -; database must also be configured to post FAN events. -;oci8.events = Off - -; Tuning: This option enables statement caching, and specifies how -; many statements to cache. Using 0 disables statement caching. -; http://php.net/oci8.statement-cache-size -;oci8.statement_cache_size = 20 - -; Tuning: Enables statement prefetching and sets the default number of -; rows that will be fetched automatically after statement execution. -; http://php.net/oci8.default-prefetch -;oci8.default_prefetch = 100 - -; Compatibility. Using On means oci_close() will not close -; oci_connect() and oci_new_connect() connections. -; http://php.net/oci8.old-oci-close-semantics -;oci8.old_oci_close_semantics = Off - -[PostgreSQL] -; Allow or prevent persistent links. -; http://php.net/pgsql.allow-persistent -pgsql.allow_persistent = On - -; Detect broken persistent links always with pg_pconnect(). -; Auto reset feature requires a little overheads. -; http://php.net/pgsql.auto-reset-persistent -pgsql.auto_reset_persistent = Off - -; Maximum number of persistent links. -1 means no limit. -; http://php.net/pgsql.max-persistent -pgsql.max_persistent = -1 - -; Maximum number of links (persistent+non persistent). -1 means no limit. -; http://php.net/pgsql.max-links -pgsql.max_links = -1 - -; Ignore PostgreSQL backends Notice message or not. -; Notice message logging require a little overheads. -; http://php.net/pgsql.ignore-notice -pgsql.ignore_notice = 0 - -; Log PostgreSQL backends Notice message or not. -; Unless pgsql.ignore_notice=0, module cannot log notice message. -; http://php.net/pgsql.log-notice -pgsql.log_notice = 0 - -[bcmath] -; Number of decimal digits for all bcmath functions. -; http://php.net/bcmath.scale -bcmath.scale = 0 - -[browscap] -; http://php.net/browscap -;browscap = extra/browscap.ini - -[Session] -; Handler used to store/retrieve data. -; http://php.net/session.save-handler -session.save_handler = files - -; Argument passed to save_handler. In the case of files, this is the path -; where data files are stored. Note: Windows users have to change this -; variable in order to use PHP's session functions. -; -; The path can be defined as: -; -; session.save_path = "N;/path" -; -; where N is an integer. Instead of storing all the session files in -; /path, what this will do is use subdirectories N-levels deep, and -; store the session data in those directories. This is useful if -; your OS has problems with many files in one directory, and is -; a more efficient layout for servers that handle many sessions. -; -; NOTE 1: PHP will not create this directory structure automatically. -; You can use the script in the ext/session dir for that purpose. -; NOTE 2: See the section on garbage collection below if you choose to -; use subdirectories for session storage -; -; The file storage module creates files using mode 600 by default. -; You can change that by using -; -; session.save_path = "N;MODE;/path" -; -; where MODE is the octal representation of the mode. Note that this -; does not overwrite the process's umask. -; http://php.net/session.save-path -;session.save_path = "/tmp" - -; Whether to use strict session mode. -; Strict session mode does not accept uninitialized session ID and regenerate -; session ID if browser sends uninitialized session ID. Strict mode protects -; applications from session fixation via session adoption vulnerability. It is -; disabled by default for maximum compatibility, but enabling it is encouraged. -; https://wiki.php.net/rfc/strict_sessions -session.use_strict_mode = 0 - -; Whether to use cookies. -; http://php.net/session.use-cookies -session.use_cookies = 1 - -; http://php.net/session.cookie-secure -;session.cookie_secure = - -; This option forces PHP to fetch and use a cookie for storing and maintaining -; the session id. We encourage this operation as it's very helpful in combating -; session hijacking when not specifying and managing your own session id. It is -; not the be-all and end-all of session hijacking defense, but it's a good start. -; http://php.net/session.use-only-cookies -session.use_only_cookies = 1 - -; Name of the session (used as cookie name). -; http://php.net/session.name -session.name = PHPSESSID - -; Initialize session on request startup. -; http://php.net/session.auto-start -session.auto_start = 0 - -; Lifetime in seconds of cookie or, if 0, until browser is restarted. -; http://php.net/session.cookie-lifetime -session.cookie_lifetime = 0 - -; The path for which the cookie is valid. -; http://php.net/session.cookie-path -session.cookie_path = / - -; The domain for which the cookie is valid. -; http://php.net/session.cookie-domain -session.cookie_domain = - -; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript. -; http://php.net/session.cookie-httponly -session.cookie_httponly = - -; Handler used to serialize data. php is the standard serializer of PHP. -; http://php.net/session.serialize-handler -session.serialize_handler = php - -; Defines the probability that the 'garbage collection' process is started -; on every session initialization. The probability is calculated by using -; gc_probability/gc_divisor. Where session.gc_probability is the numerator -; and gc_divisor is the denominator in the equation. Setting this value to 1 -; when the session.gc_divisor value is 100 will give you approximately a 1% chance -; the gc will run on any give request. -; Default Value: 1 -; Development Value: 1 -; Production Value: 1 -; http://php.net/session.gc-probability -session.gc_probability = 1 - -; Defines the probability that the 'garbage collection' process is started on every -; session initialization. The probability is calculated by using the following equation: -; gc_probability/gc_divisor. Where session.gc_probability is the numerator and -; session.gc_divisor is the denominator in the equation. Setting this value to 1 -; when the session.gc_divisor value is 100 will give you approximately a 1% chance -; the gc will run on any give request. Increasing this value to 1000 will give you -; a 0.1% chance the gc will run on any give request. For high volume production servers, -; this is a more efficient approach. -; Default Value: 100 -; Development Value: 1000 -; Production Value: 1000 -; http://php.net/session.gc-divisor -session.gc_divisor = 1000 - -; After this number of seconds, stored data will be seen as 'garbage' and -; cleaned up by the garbage collection process. -; http://php.net/session.gc-maxlifetime -session.gc_maxlifetime = 1440 - -; NOTE: If you are using the subdirectory option for storing session files -; (see session.save_path above), then garbage collection does *not* -; happen automatically. You will need to do your own garbage -; collection through a shell script, cron entry, or some other method. -; For example, the following script would is the equivalent of -; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): -; find /path/to/sessions -cmin +24 -type f | xargs rm - -; Check HTTP Referer to invalidate externally stored URLs containing ids. -; HTTP_REFERER has to contain this substring for the session to be -; considered as valid. -; http://php.net/session.referer-check -session.referer_check = - -; Set to {nocache,private,public,} to determine HTTP caching aspects -; or leave this empty to avoid sending anti-caching headers. -; http://php.net/session.cache-limiter -session.cache_limiter = nocache - -; Document expires after n minutes. -; http://php.net/session.cache-expire -session.cache_expire = 180 - -; trans sid support is disabled by default. -; Use of trans sid may risk your users' security. -; Use this option with caution. -; - User may send URL contains active session ID -; to other person via. email/irc/etc. -; - URL that contains active session ID may be stored -; in publicly accessible computer. -; - User may access your site with the same session ID -; always using URL stored in browser's history or bookmarks. -; http://php.net/session.use-trans-sid -session.use_trans_sid = 0 - -; Set session ID character length. This value could be between 22 to 256. -; Shorter length than default is supported only for compatibility reason. -; Users should use 32 or more chars. -; http://php.net/session.sid-length -; Default Value: 32 -; Development Value: 26 -; Production Value: 26 -session.sid_length = 26 - -; The URL rewriter will look for URLs in a defined set of HTML tags. -; is special; if you include them here, the rewriter will -; add a hidden field with the info which is otherwise appended -; to URLs. tag's action attribute URL will not be modified -; unless it is specified. -; Note that all valid entries require a "=", even if no value follows. -; Default Value: "a=href,area=href,frame=src,form=" -; Development Value: "a=href,area=href,frame=src,form=" -; Production Value: "a=href,area=href,frame=src,form=" -; http://php.net/url-rewriter.tags -session.trans_sid_tags = "a=href,area=href,frame=src,form=" - -; URL rewriter does not rewrite absolute URLs by default. -; To enable rewrites for absolute pathes, target hosts must be specified -; at RUNTIME. i.e. use ini_set() -; tags is special. PHP will check action attribute's URL regardless -; of session.trans_sid_tags setting. -; If no host is defined, HTTP_HOST will be used for allowed host. -; Example value: php.net,www.php.net,wiki.php.net -; Use "," for multiple hosts. No spaces are allowed. -; Default Value: "" -; Development Value: "" -; Production Value: "" -;session.trans_sid_hosts="" - -; Define how many bits are stored in each character when converting -; the binary hash data to something readable. -; Possible values: -; 4 (4 bits: 0-9, a-f) -; 5 (5 bits: 0-9, a-v) -; 6 (6 bits: 0-9, a-z, A-Z, "-", ",") -; Default Value: 4 -; Development Value: 5 -; Production Value: 5 -; http://php.net/session.hash-bits-per-character -session.sid_bits_per_character = 5 - -; Enable upload progress tracking in $_SESSION -; Default Value: On -; Development Value: On -; Production Value: On -; http://php.net/session.upload-progress.enabled -;session.upload_progress.enabled = On - -; Cleanup the progress information as soon as all POST data has been read -; (i.e. upload completed). -; Default Value: On -; Development Value: On -; Production Value: On -; http://php.net/session.upload-progress.cleanup -;session.upload_progress.cleanup = On - -; A prefix used for the upload progress key in $_SESSION -; Default Value: "upload_progress_" -; Development Value: "upload_progress_" -; Production Value: "upload_progress_" -; http://php.net/session.upload-progress.prefix -;session.upload_progress.prefix = "upload_progress_" - -; The index name (concatenated with the prefix) in $_SESSION -; containing the upload progress information -; Default Value: "PHP_SESSION_UPLOAD_PROGRESS" -; Development Value: "PHP_SESSION_UPLOAD_PROGRESS" -; Production Value: "PHP_SESSION_UPLOAD_PROGRESS" -; http://php.net/session.upload-progress.name -;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS" - -; How frequently the upload progress should be updated. -; Given either in percentages (per-file), or in bytes -; Default Value: "1%" -; Development Value: "1%" -; Production Value: "1%" -; http://php.net/session.upload-progress.freq -;session.upload_progress.freq = "1%" - -; The minimum delay between updates, in seconds -; Default Value: 1 -; Development Value: 1 -; Production Value: 1 -; http://php.net/session.upload-progress.min-freq -;session.upload_progress.min_freq = "1" - -; Only write session data when session data is changed. Enabled by default. -; http://php.net/session.lazy-write -;session.lazy_write = On - -[Assertion] -; Switch whether to compile assertions at all (to have no overhead at run-time) -; -1: Do not compile at all -; 0: Jump over assertion at run-time -; 1: Execute assertions -; Changing from or to a negative value is only possible in php.ini! (For turning assertions on and off at run-time, see assert.active, when zend.assertions = 1) -; Default Value: 1 -; Development Value: 1 -; Production Value: -1 -; http://php.net/zend.assertions -zend.assertions = -1 - -; Assert(expr); active by default. -; http://php.net/assert.active -;assert.active = On - -; Throw an AssertationException on failed assertions -; http://php.net/assert.exception -;assert.exception = On - -; Issue a PHP warning for each failed assertion. (Overridden by assert.exception if active) -; http://php.net/assert.warning -;assert.warning = On - -; Don't bail out by default. -; http://php.net/assert.bail -;assert.bail = Off - -; User-function to be called if an assertion fails. -; http://php.net/assert.callback -;assert.callback = 0 - -; Eval the expression with current error_reporting(). Set to true if you want -; error_reporting(0) around the eval(). -; http://php.net/assert.quiet-eval -;assert.quiet_eval = 0 - -[COM] -; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs -; http://php.net/com.typelib-file -;com.typelib_file = - -; allow Distributed-COM calls -; http://php.net/com.allow-dcom -;com.allow_dcom = true - -; autoregister constants of a components typlib on com_load() -; http://php.net/com.autoregister-typelib -;com.autoregister_typelib = true - -; register constants casesensitive -; http://php.net/com.autoregister-casesensitive -;com.autoregister_casesensitive = false - -; show warnings on duplicate constant registrations -; http://php.net/com.autoregister-verbose -;com.autoregister_verbose = true - -; The default character set code-page to use when passing strings to and from COM objects. -; Default: system ANSI code page -;com.code_page= - -[mbstring] -; language for internal character representation. -; This affects mb_send_mail() and mbstring.detect_order. -; http://php.net/mbstring.language -;mbstring.language = Japanese - -; Use of this INI entry is deprecated, use global internal_encoding instead. -; internal/script encoding. -; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*) -; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. -; The precedence is: default_charset < internal_encoding < iconv.internal_encoding -;mbstring.internal_encoding = - -; Use of this INI entry is deprecated, use global input_encoding instead. -; http input encoding. -; mbstring.encoding_traslation = On is needed to use this setting. -; If empty, default_charset or input_encoding or mbstring.input is used. -; The precedence is: default_charset < intput_encoding < mbsting.http_input -; http://php.net/mbstring.http-input -;mbstring.http_input = - -; Use of this INI entry is deprecated, use global output_encoding instead. -; http output encoding. -; mb_output_handler must be registered as output buffer to function. -; If empty, default_charset or output_encoding or mbstring.http_output is used. -; The precedence is: default_charset < output_encoding < mbstring.http_output -; To use an output encoding conversion, mbstring's output handler must be set -; otherwise output encoding conversion cannot be performed. -; http://php.net/mbstring.http-output -;mbstring.http_output = - -; enable automatic encoding translation according to -; mbstring.internal_encoding setting. Input chars are -; converted to internal encoding by setting this to On. -; Note: Do _not_ use automatic encoding translation for -; portable libs/applications. -; http://php.net/mbstring.encoding-translation -;mbstring.encoding_translation = Off - -; automatic encoding detection order. -; "auto" detect order is changed according to mbstring.language -; http://php.net/mbstring.detect-order -;mbstring.detect_order = auto - -; substitute_character used when character cannot be converted -; one from another -; http://php.net/mbstring.substitute-character -;mbstring.substitute_character = none - -; overload(replace) single byte functions by mbstring functions. -; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(), -; etc. Possible values are 0,1,2,4 or combination of them. -; For example, 7 for overload everything. -; 0: No overload -; 1: Overload mail() function -; 2: Overload str*() functions -; 4: Overload ereg*() functions -; http://php.net/mbstring.func-overload -;mbstring.func_overload = 0 - -; enable strict encoding detection. -; Default: Off -;mbstring.strict_detection = On - -; This directive specifies the regex pattern of content types for which mb_output_handler() -; is activated. -; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml) -;mbstring.http_output_conv_mimetype= - -[gd] -; Tell the jpeg decode to ignore warnings and try to create -; a gd image. The warning will then be displayed as notices -; disabled by default -; http://php.net/gd.jpeg-ignore-warning -;gd.jpeg_ignore_warning = 1 - -[exif] -; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS. -; With mbstring support this will automatically be converted into the encoding -; given by corresponding encode setting. When empty mbstring.internal_encoding -; is used. For the decode settings you can distinguish between motorola and -; intel byte order. A decode setting cannot be empty. -; http://php.net/exif.encode-unicode -;exif.encode_unicode = ISO-8859-15 - -; http://php.net/exif.decode-unicode-motorola -;exif.decode_unicode_motorola = UCS-2BE - -; http://php.net/exif.decode-unicode-intel -;exif.decode_unicode_intel = UCS-2LE - -; http://php.net/exif.encode-jis -;exif.encode_jis = - -; http://php.net/exif.decode-jis-motorola -;exif.decode_jis_motorola = JIS - -; http://php.net/exif.decode-jis-intel -;exif.decode_jis_intel = JIS - -[Tidy] -; The path to a default tidy configuration file to use when using tidy -; http://php.net/tidy.default-config -;tidy.default_config = /usr/local/lib/php/default.tcfg - -; Should tidy clean and repair output automatically? -; WARNING: Do not use this option if you are generating non-html content -; such as dynamic images -; http://php.net/tidy.clean-output -tidy.clean_output = Off - -[soap] -; Enables or disables WSDL caching feature. -; http://php.net/soap.wsdl-cache-enabled -soap.wsdl_cache_enabled=1 - -; Sets the directory name where SOAP extension will put cache files. -; http://php.net/soap.wsdl-cache-dir -soap.wsdl_cache_dir="/tmp" - -; (time to live) Sets the number of second while cached file will be used -; instead of original one. -; http://php.net/soap.wsdl-cache-ttl -soap.wsdl_cache_ttl=86400 - -; Sets the size of the cache limit. (Max. number of WSDL files to cache) -soap.wsdl_cache_limit = 5 - -[sysvshm] -; A default size of the shared memory segment -;sysvshm.init_mem = 10000 - -[ldap] -; Sets the maximum number of open links or -1 for unlimited. -ldap.max_links = -1 - -[mcrypt] -; For more information about mcrypt settings see http://php.net/mcrypt-module-open - -; Directory where to load mcrypt algorithms -; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt) -;mcrypt.algorithms_dir= - -; Directory where to load mcrypt modes -; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt) -;mcrypt.modes_dir= - -[dba] -;dba.default_handler= - -[opcache] -; Determines if Zend OPCache is enabled -;opcache.enable=1 - -; Determines if Zend OPCache is enabled for the CLI version of PHP -;opcache.enable_cli=0 - -; The OPcache shared memory storage size. -;opcache.memory_consumption=128 - -; The amount of memory for interned strings in Mbytes. -;opcache.interned_strings_buffer=8 - -; The maximum number of keys (scripts) in the OPcache hash table. -; Only numbers between 200 and 1000000 are allowed. -;opcache.max_accelerated_files=10000 - -; The maximum percentage of "wasted" memory until a restart is scheduled. -;opcache.max_wasted_percentage=5 - -; When this directive is enabled, the OPcache appends the current working -; directory to the script key, thus eliminating possible collisions between -; files with the same name (basename). Disabling the directive improves -; performance, but may break existing applications. -;opcache.use_cwd=1 - -; When disabled, you must reset the OPcache manually or restart the -; webserver for changes to the filesystem to take effect. -;opcache.validate_timestamps=1 - -; How often (in seconds) to check file timestamps for changes to the shared -; memory storage allocation. ("1" means validate once per second, but only -; once per request. "0" means always validate) -;opcache.revalidate_freq=2 - -; Enables or disables file search in include_path optimization -;opcache.revalidate_path=0 - -; If disabled, all PHPDoc comments are dropped from the code to reduce the -; size of the optimized code. -;opcache.save_comments=1 - -; If enabled, a fast shutdown sequence is used for the accelerated code -; Depending on the used Memory Manager this may cause some incompatibilities. -;opcache.fast_shutdown=0 - -; Allow file existence override (file_exists, etc.) performance feature. -;opcache.enable_file_override=0 - -; A bitmask, where each bit enables or disables the appropriate OPcache -; passes -;opcache.optimization_level=0xffffffff - -;opcache.inherited_hack=1 -;opcache.dups_fix=0 - -; The location of the OPcache blacklist file (wildcards allowed). -; Each OPcache blacklist file is a text file that holds the names of files -; that should not be accelerated. The file format is to add each filename -; to a new line. The filename may be a full path or just a file prefix -; (i.e., /var/www/x blacklists all the files and directories in /var/www -; that start with 'x'). Line starting with a ; are ignored (comments). -;opcache.blacklist_filename= - -; Allows exclusion of large files from being cached. By default all files -; are cached. -;opcache.max_file_size=0 - -; Check the cache checksum each N requests. -; The default value of "0" means that the checks are disabled. -;opcache.consistency_checks=0 - -; How long to wait (in seconds) for a scheduled restart to begin if the cache -; is not being accessed. -;opcache.force_restart_timeout=180 - -; OPcache error_log file name. Empty string assumes "stderr". -;opcache.error_log= - -; All OPcache errors go to the Web server log. -; By default, only fatal errors (level 0) or errors (level 1) are logged. -; You can also enable warnings (level 2), info messages (level 3) or -; debug messages (level 4). -;opcache.log_verbosity_level=1 - -; Preferred Shared Memory back-end. Leave empty and let the system decide. -;opcache.preferred_memory_model= - -; Protect the shared memory from unexpected writing during script execution. -; Useful for internal debugging only. -;opcache.protect_memory=0 - -; Allows calling OPcache API functions only from PHP scripts which path is -; started from specified string. The default "" means no restriction -;opcache.restrict_api= - -; Mapping base of shared memory segments (for Windows only). All the PHP -; processes have to map shared memory into the same address space. This -; directive allows to manually fix the "Unable to reattach to base address" -; errors. -;opcache.mmap_base= - -; Enables and sets the second level cache directory. -; It should improve performance when SHM memory is full, at server restart or -; SHM reset. The default "" disables file based caching. -;opcache.file_cache= - -; Enables or disables opcode caching in shared memory. -;opcache.file_cache_only=0 - -; Enables or disables checksum validation when script loaded from file cache. -;opcache.file_cache_consistency_checks=1 - -; Implies opcache.file_cache_only=1 for a certain process that failed to -; reattach to the shared memory (for Windows only). Explicitly enabled file -; cache is required. -;opcache.file_cache_fallback=1 - -; Enables or disables copying of PHP code (text segment) into HUGE PAGES. -; This should improve performance, but requires appropriate OS configuration. -;opcache.huge_code_pages=1 - -; Validate cached file permissions. -;opcache.validate_permission=0 - -; Prevent name collisions in chroot'ed environment. -;opcache.validate_root=0 - -[curl] -; A default value for the CURLOPT_CAINFO option. This is required to be an -; absolute path. -;curl.cainfo = - -[openssl] -; The location of a Certificate Authority (CA) file on the local filesystem -; to use when verifying the identity of SSL/TLS peers. Most users should -; not specify a value for this directive as PHP will attempt to use the -; OS-managed cert stores in its absence. If specified, this value may still -; be overridden on a per-stream basis via the "cafile" SSL stream context -; option. -;openssl.cafile= - -; If openssl.cafile is not specified or if the CA file is not found, the -; directory pointed to by openssl.capath is searched for a suitable -; certificate. This value must be a correctly hashed certificate directory. -; Most users should not specify a value for this directive as PHP will -; attempt to use the OS-managed cert stores in its absence. If specified, -; this value may still be overridden on a per-stream basis via the "capath" -; SSL stream context option. -;openssl.capath= - -; Local Variables: -; tab-width: 4 -; End: -zend_extension = ioncube.so \ No newline at end of file diff --git a/images/php/multiple/README.md b/images/php/multiple/README.md deleted file mode 100644 index 1f4d3589..00000000 --- a/images/php/multiple/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# PHP 5.6, 7.0, 7.1, 7.2, 7.3 - -#feature - -* swoole -* redis -* mongodb -* memcache -* memcached - - -### Note: Multiple PHP Images Need rename `/etc/nginx/conf.d/php-x.x.example` file to Corresponding PHP Version \ No newline at end of file diff --git a/images/php/multiple/conf.d/index.php b/images/php/multiple/conf.d/index.php deleted file mode 100644 index 259d40ff..00000000 --- a/images/php/multiple/conf.d/index.php +++ /dev/null @@ -1,1473 +0,0 @@ -=0; $l--) - { - $allsize1[$l]=floor($size/pow(1024,$l)); - $allsize[$l]=$allsize1[$l]-$allsize1[$l+1]*1024; - } - - $len=count($allsize); - - for($j = $len-1; $j >=0; $j--) - { - $fsize=$fsize.$allsize[$j].$danwei[$j]; - } - return $fsize; -} - -function valid_email($str) -{ - return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE; -} - -//检测PHP设置参数 -function show($varName) -{ - switch($result = get_cfg_var($varName)) - { - case 0: - return '×'; - break; - - case 1: - return ''; - break; - - default: - return $result; - break; - } -} - -//保留服务器性能测试结果 -$valInt = isset($_POST['pInt']) ? $_POST['pInt'] : "No Test"; -$valFloat = isset($_POST['pFloat']) ? $_POST['pFloat'] : "No Test"; -$valIo = isset($_POST['pIo']) ? $_POST['pIo'] : "No Test"; - -if ($_GET['act'] == "phpinfo") -{ - phpinfo(); - exit(); -} -elseif($_POST['act'] == "Int Test") -{ - $valInt = test_int(); -} -elseif($_POST['act'] == "Float Test") -{ - $valFloat = test_float(); -} -elseif($_POST['act'] == "IO Test") -{ - $valIo = test_io(); -} -//网速测试-开始 -elseif($_POST['act']=="Start Test") -{ -?> - - "; - } - ?> - -"; - Echo "This shows all the functions supported by the system, and custom functions\n"; - print_r($arr); - echo ""; - exit(); -}elseif($_GET['act'] == "disable_functions") -{ - $disFuns=get_cfg_var("disable_functions"); - if(empty($disFuns)) - { - $arr = '×'; - } - else - { - $arr = $disFuns; - } - Function php() - { - } - echo "
";
-	Echo "This shows all the functions disable by the system\n";
-	print_r($arr);
-	echo "
"; - exit(); -} - -//MySQL检测 -if ($_POST['act'] == 'MySQL Test') -{ - $host = isset($_POST['host']) ? trim($_POST['host']) : ''; - $port = isset($_POST['port']) ? (int) $_POST['port'] : ''; - $login = isset($_POST['login']) ? trim($_POST['login']) : ''; - $password = isset($_POST['password']) ? trim($_POST['password']) : ''; - $host = preg_match('~[^a-z0-9\-\.]+~i', $host) ? '' : $host; - $port = intval($port) ? intval($port) : ''; - $login = preg_match('~[^a-z0-9\_\-]+~i', $login) ? '' : htmlspecialchars($login); - $password = is_string($password) ? htmlspecialchars($password) : ''; -} -elseif ($_POST['act'] == 'Function Test') -{ - $funRe = "Function".$_POST['funName']."Test results support the position: ".isfun1($_POST['funName']); -} -elseif ($_POST['act'] == 'Mail Test') -{ - $mailRe = "Mail test results: send"; - if($_SERVER['SERVER_PORT']==80){$mailContent = "http://".$_SERVER['SERVER_NAME'].($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']);} - else{$mailContent = "http://".$_SERVER['SERVER_NAME'].":".$_SERVER['SERVER_PORT'].($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']);} - $mailRe .= (false !== @mail($_POST["mailAdd"], $mailContent, "This is a test mail!")) ? "Complete":"Failure"; -} - -//网络速度测试 -if(isset($_POST['speed'])) -{ - $speed=round(100/($_POST['speed']/1000),2); -} -elseif($_GET['speed']=="0") -{ - $speed=6666.67; -} -elseif(isset($_GET['speed']) and $_GET['speed']>0) -{ - $speed=round(100/($_GET['speed']/1000),2); //下载速度: $speed kb/s -} -else -{ - $speed=" No Test "; -} - - -// 检测函数支持 -function isfun($funName = '') -{ - if (!$funName || trim($funName) == '' || preg_match('~[^a-z0-9\_]+~i', $funName, $tmp)) return '错误'; - return (false !== function_exists($funName)) ? '' : '×'; -} -function isfun1($funName = '') -{ - if (!$funName || trim($funName) == '' || preg_match('~[^a-z0-9\_]+~i', $funName, $tmp)) return '错误'; - return (false !== function_exists($funName)) ? '√' : '×'; -} - -//整数运算能力测试 -function test_int() -{ - $timeStart = gettimeofday(); - for($i = 0; $i < 3000000; $i++) - { - $t = 1+1; - } - $timeEnd = gettimeofday(); - $time = ($timeEnd["usec"]-$timeStart["usec"])/1000000+$timeEnd["sec"]-$timeStart["sec"]; - $time = round($time, 3)." Second"; - return $time; -} - -//浮点运算能力测试 -function test_float() -{ - //得到圆周率值 - $t = pi(); - $timeStart = gettimeofday(); - - for($i = 0; $i < 3000000; $i++) - { - //开平方 - sqrt($t); - } - - $timeEnd = gettimeofday(); - $time = ($timeEnd["usec"]-$timeStart["usec"])/1000000+$timeEnd["sec"]-$timeStart["sec"]; - $time = round($time, 3)."Second"; - return $time; -} - -//IO能力测试 -function test_io() -{ - $fp = @fopen(PHPSELF, "r"); - $timeStart = gettimeofday(); - for($i = 0; $i < 10000; $i++) - { - @fread($fp, 10240); - @rewind($fp); - } - $timeEnd = gettimeofday(); - @fclose($fp); - $time = ($timeEnd["usec"]-$timeStart["usec"])/1000000+$timeEnd["sec"]-$timeStart["sec"]; - $time = round($time, 3)."Second"; - return($time); -} - -function GetCoreInformation() {$data = file('/proc/stat');$cores = array();foreach( $data as $line ) {if( preg_match('/^cpu[0-9]/', $line) ){$info = explode(' ', $line);$cores[]=array('user'=>$info[1],'nice'=>$info[2],'sys' => $info[3],'idle'=>$info[4],'iowait'=>$info[5],'irq' => $info[6],'softirq' => $info[7]);}}return $cores;} -function GetCpuPercentages($stat1, $stat2) {if(count($stat1)!==count($stat2)){return;}$cpus=array();for( $i = 0, $l = count($stat1); $i < $l; $i++) { $dif = array(); $dif['user'] = $stat2[$i]['user'] - $stat1[$i]['user'];$dif['nice'] = $stat2[$i]['nice'] - $stat1[$i]['nice']; $dif['sys'] = $stat2[$i]['sys'] - $stat1[$i]['sys'];$dif['idle'] = $stat2[$i]['idle'] - $stat1[$i]['idle'];$dif['iowait'] = $stat2[$i]['iowait'] - $stat1[$i]['iowait'];$dif['irq'] = $stat2[$i]['irq'] - $stat1[$i]['irq'];$dif['softirq'] = $stat2[$i]['softirq'] - $stat1[$i]['softirq'];$total = array_sum($dif);$cpu = array();foreach($dif as $x=>$y) $cpu[$x] = round($y / $total * 100, 2);$cpus['cpu' . $i] = $cpu;}return $cpus;} -$stat1 = GetCoreInformation();sleep(1);$stat2 = GetCoreInformation();$data = GetCpuPercentages($stat1, $stat2); -$cpu_show = $data['cpu0']['user']."%us, ".$data['cpu0']['sys']."%sy, ".$data['cpu0']['nice']."%ni, ".$data['cpu0']['idle']."%id, ".$data['cpu0']['iowait']."%wa, ".$data['cpu0']['irq']."%irq, ".$data['cpu0']['softirq']."%softirq"; -function makeImageUrl($title, $data) {$api='http://api.yahei.net/tz/cpu_show.php?id=';$url.=$data['user'].',';$url.=$data['nice'].',';$url.=$data['sys'].',';$url.=$data['idle'].',';$url.=$data['iowait'];$url.='&chdl=User|Nice|Sys|Idle|Iowait&chdlp=b&chl=';$url.=$data['user'].'%25|';$url.=$data['nice'].'%25|';$url.=$data['sys'].'%25|';$url.=$data['idle'].'%25|';$url.=$data['iowait'].'%25';$url.='&chtt=Core+'.$title;return $api.base64_encode($url);} -if($_GET['act'] == "cpu_percentage"){echo "
Slow image loading, please be patient!

";foreach( $data as $k => $v ) {echo '';}echo "
";exit();} - -// 根据不同系统取得CPU相关信息 -switch(PHP_OS) -{ - case "Linux": - $sysReShow = (false !== ($sysInfo = sys_linux()))?"show":"none"; - break; - - case "FreeBSD": - $sysReShow = (false !== ($sysInfo = sys_freebsd()))?"show":"none"; - break; - -/* - case "WINNT": - $sysReShow = (false !== ($sysInfo = sys_windows()))?"show":"none"; - break; -*/ - - default: - break; -} - -//linux系统探测 -function sys_linux() -{ - // CPU - if (false === ($str = @file("/proc/cpuinfo"))) return false; - $str = implode("", $str); - @preg_match_all("/model\s+name\s{0,}\:+\s{0,}([\w\s\)\(\@.-]+)([\r\n]+)/s", $str, $model); - @preg_match_all("/cpu\s+MHz\s{0,}\:+\s{0,}([\d\.]+)[\r\n]+/", $str, $mhz); - @preg_match_all("/cache\s+size\s{0,}\:+\s{0,}([\d\.]+\s{0,}[A-Z]+[\r\n]+)/", $str, $cache); - @preg_match_all("/bogomips\s{0,}\:+\s{0,}([\d\.]+)[\r\n]+/", $str, $bogomips); - if (false !== is_array($model[1])) - { - $res['cpu']['num'] = sizeof($model[1]); - /* - for($i = 0; $i < $res['cpu']['num']; $i++) - { - $res['cpu']['model'][] = $model[1][$i].' ('.$mhz[1][$i].')'; - $res['cpu']['mhz'][] = $mhz[1][$i]; - $res['cpu']['cache'][] = $cache[1][$i]; - $res['cpu']['bogomips'][] = $bogomips[1][$i]; - }*/ - if($res['cpu']['num']==1) - $x1 = ''; - else - $x1 = ' ×'.$res['cpu']['num']; - $mhz[1][0] = ' | Frequency:'.$mhz[1][0]; - $cache[1][0] = ' | Secondary cache:'.$cache[1][0]; - $bogomips[1][0] = ' | Bogomips:'.$bogomips[1][0]; - $res['cpu']['model'][] = $model[1][0].$mhz[1][0].$cache[1][0].$bogomips[1][0].$x1; - if (false !== is_array($res['cpu']['model'])) $res['cpu']['model'] = implode("
", $res['cpu']['model']); - if (false !== is_array($res['cpu']['mhz'])) $res['cpu']['mhz'] = implode("
", $res['cpu']['mhz']); - if (false !== is_array($res['cpu']['cache'])) $res['cpu']['cache'] = implode("
", $res['cpu']['cache']); - if (false !== is_array($res['cpu']['bogomips'])) $res['cpu']['bogomips'] = implode("
", $res['cpu']['bogomips']); - } - - // NETWORK - - // UPTIME - if (false === ($str = @file("/proc/uptime"))) return false; - $str = explode(" ", implode("", $str)); - $str = trim($str[0]); - $min = $str / 60; - $hours = $min / 60; - $days = floor($hours / 24); - $hours = floor($hours - ($days * 24)); - $min = floor($min - ($days * 60 * 24) - ($hours * 60)); - if ($days !== 0) $res['uptime'] = $days."Day"; - if ($hours !== 0) $res['uptime'] .= $hours."Hour"; - $res['uptime'] .= $min."Minute"; - - // MEMORY - if (false === ($str = @file("/proc/meminfo"))) return false; - $str = implode("", $str); - preg_match_all("/MemTotal\s{0,}\:+\s{0,}([\d\.]+).+?MemFree\s{0,}\:+\s{0,}([\d\.]+).+?Cached\s{0,}\:+\s{0,}([\d\.]+).+?SwapTotal\s{0,}\:+\s{0,}([\d\.]+).+?SwapFree\s{0,}\:+\s{0,}([\d\.]+)/s", $str, $buf); - preg_match_all("/Buffers\s{0,}\:+\s{0,}([\d\.]+)/s", $str, $buffers); - - $res['memTotal'] = round($buf[1][0]/1024, 2); - $res['memFree'] = round($buf[2][0]/1024, 2); - $res['memBuffers'] = round($buffers[1][0]/1024, 2); - $res['memCached'] = round($buf[3][0]/1024, 2); - $res['memUsed'] = $res['memTotal']-$res['memFree']; - $res['memPercent'] = (floatval($res['memTotal'])!=0)?round($res['memUsed']/$res['memTotal']*100,2):0; - - $res['memRealUsed'] = $res['memTotal'] - $res['memFree'] - $res['memCached'] - $res['memBuffers']; //真实内存使用 - $res['memRealFree'] = $res['memTotal'] - $res['memRealUsed']; //真实空闲 - $res['memRealPercent'] = (floatval($res['memTotal'])!=0)?round($res['memRealUsed']/$res['memTotal']*100,2):0; //真实内存使用率 - - $res['memCachedPercent'] = (floatval($res['memCached'])!=0)?round($res['memCached']/$res['memTotal']*100,2):0; //Cached内存使用率 - - $res['swapTotal'] = round($buf[4][0]/1024, 2); - $res['swapFree'] = round($buf[5][0]/1024, 2); - $res['swapUsed'] = round($res['swapTotal']-$res['swapFree'], 2); - $res['swapPercent'] = (floatval($res['swapTotal'])!=0)?round($res['swapUsed']/$res['swapTotal']*100,2):0; - - // LOAD AVG - if (false === ($str = @file("/proc/loadavg"))) return false; - $str = explode(" ", implode("", $str)); - $str = array_chunk($str, 4); - $res['loadAvg'] = implode(" ", $str[0]); - - return $res; -} - -//FreeBSD系统探测 -function sys_freebsd() -{ - //CPU - if (false === ($res['cpu']['num'] = get_key("hw.ncpu"))) return false; - $res['cpu']['model'] = get_key("hw.model"); - //LOAD AVG - if (false === ($res['loadAvg'] = get_key("vm.loadavg"))) return false; - //UPTIME - if (false === ($buf = get_key("kern.boottime"))) return false; - $buf = explode(' ', $buf); - $sys_ticks = time() - intval($buf[3]); - $min = $sys_ticks / 60; - $hours = $min / 60; - $days = floor($hours / 24); - $hours = floor($hours - ($days * 24)); - $min = floor($min - ($days * 60 * 24) - ($hours * 60)); - if ($days !== 0) $res['uptime'] = $days."Day"; - if ($hours !== 0) $res['uptime'] .= $hours."Hour"; - $res['uptime'] .= $min."Minute"; - //MEMORY - if (false === ($buf = get_key("hw.physmem"))) return false; - $res['memTotal'] = round($buf/1024/1024, 2); - - $str = get_key("vm.vmtotal"); - preg_match_all("/\nVirtual Memory[\:\s]*\(Total[\:\s]*([\d]+)K[\,\s]*Active[\:\s]*([\d]+)K\)\n/i", $str, $buff, PREG_SET_ORDER); - preg_match_all("/\nReal Memory[\:\s]*\(Total[\:\s]*([\d]+)K[\,\s]*Active[\:\s]*([\d]+)K\)\n/i", $str, $buf, PREG_SET_ORDER); - - $res['memRealUsed'] = round($buf[0][2]/1024, 2); - $res['memCached'] = round($buff[0][2]/1024, 2); - $res['memUsed'] = round($buf[0][1]/1024, 2) + $res['memCached']; - $res['memFree'] = $res['memTotal'] - $res['memUsed']; - $res['memPercent'] = (floatval($res['memTotal'])!=0)?round($res['memUsed']/$res['memTotal']*100,2):0; - - $res['memRealPercent'] = (floatval($res['memTotal'])!=0)?round($res['memRealUsed']/$res['memTotal']*100,2):0; - - return $res; -} - -//取得参数值 FreeBSD -function get_key($keyName) -{ - return do_command('sysctl', "-n $keyName"); -} - -//确定执行文件位置 FreeBSD -function find_command($commandName) -{ - $path = array('/bin', '/sbin', '/usr/bin', '/usr/sbin', '/usr/local/bin', '/usr/local/sbin'); - foreach($path as $p) - { - if (@is_executable("$p/$commandName")) return "$p/$commandName"; - } - return false; -} - -//执行系统命令 FreeBSD -function do_command($commandName, $args) -{ - $buffer = ""; - if (false === ($command = find_command($commandName))) return false; - if ($fp = @popen("$command $args", 'r')) - { - while (!@feof($fp)) - { - $buffer .= @fgets($fp, 4096); - } - return trim($buffer); - } - return false; -} - -//windows系统探测 -function sys_windows() -{ - if (PHP_VERSION >= 5) - { - $objLocator = new COM("WbemScripting.SWbemLocator"); - $wmi = $objLocator->ConnectServer(); - $prop = $wmi->get("Win32_PnPEntity"); - } - else - { - return false; - } - - //CPU - $cpuinfo = GetWMI($wmi,"Win32_Processor", array("Name","L2CacheSize","NumberOfCores")); - $res['cpu']['num'] = $cpuinfo[0]['NumberOfCores']; - if (null == $res['cpu']['num']) - { - $res['cpu']['num'] = 1; - }/* - for ($i=0;$i<$res['cpu']['num'];$i++) - { - $res['cpu']['model'] .= $cpuinfo[0]['Name']."
"; - $res['cpu']['cache'] .= $cpuinfo[0]['L2CacheSize']."
"; - }*/ - $cpuinfo[0]['L2CacheSize'] = ' ('.$cpuinfo[0]['L2CacheSize'].')'; - if($res['cpu']['num']==1) - $x1 = ''; - else - $x1 = ' ×'.$res['cpu']['num']; - $res['cpu']['model'] = $cpuinfo[0]['Name'].$cpuinfo[0]['L2CacheSize'].$x1; - // SYSINFO - $sysinfo = GetWMI($wmi,"Win32_OperatingSystem", array('LastBootUpTime','TotalVisibleMemorySize','FreePhysicalMemory','Caption','CSDVersion','SerialNumber','InstallDate')); - $sysinfo[0]['Caption']=iconv('GBK', 'UTF-8',$sysinfo[0]['Caption']); - $sysinfo[0]['CSDVersion']=iconv('GBK', 'UTF-8',$sysinfo[0]['CSDVersion']); - $res['win_n'] = $sysinfo[0]['Caption']." ".$sysinfo[0]['CSDVersion']." 序列号:{$sysinfo[0]['SerialNumber']} 于".date('Y年m月d日H:i:s',strtotime(substr($sysinfo[0]['InstallDate'],0,14)))."安装"; - //UPTIME - $res['uptime'] = $sysinfo[0]['LastBootUpTime']; - - $sys_ticks = 3600*8 + time() - strtotime(substr($res['uptime'],0,14)); - $min = $sys_ticks / 60; - $hours = $min / 60; - $days = floor($hours / 24); - $hours = floor($hours - ($days * 24)); - $min = floor($min - ($days * 60 * 24) - ($hours * 60)); - if ($days !== 0) $res['uptime'] = $days."Day"; - if ($hours !== 0) $res['uptime'] .= $hours."Hour"; - $res['uptime'] .= $min."Minute"; - - //MEMORY - $res['memTotal'] = round($sysinfo[0]['TotalVisibleMemorySize']/1024,2); - $res['memFree'] = round($sysinfo[0]['FreePhysicalMemory']/1024,2); - $res['memUsed'] = $res['memTotal']-$res['memFree']; //上面两行已经除以1024,这行不用再除了 - $res['memPercent'] = round($res['memUsed'] / $res['memTotal']*100,2); - - $swapinfo = GetWMI($wmi,"Win32_PageFileUsage", array('AllocatedBaseSize','CurrentUsage')); - - // LoadPercentage - $loadinfo = GetWMI($wmi,"Win32_Processor", array("LoadPercentage")); - $res['loadAvg'] = $loadinfo[0]['LoadPercentage']; - - return $res; -} - -function GetWMI($wmi,$strClass, $strValue = array()) -{ - $arrData = array(); - - $objWEBM = $wmi->Get($strClass); - $arrProp = $objWEBM->Properties_; - $arrWEBMCol = $objWEBM->Instances_(); - foreach($arrWEBMCol as $objItem) - { - @reset($arrProp); - $arrInstance = array(); - foreach($arrProp as $propItem) - { - eval("\$value = \$objItem->" . $propItem->Name . ";"); - if (empty($strValue)) - { - $arrInstance[$propItem->Name] = trim($value); - } - else - { - if (in_array($propItem->Name, $strValue)) - { - $arrInstance[$propItem->Name] = trim($value); - } - } - } - $arrData[] = $arrInstance; - } - return $arrData; -} - -//比例条 -function bar($percent) -{ -?> -
 
-"$du",'freeSpace'=>"$df",'hdPercent'=>"$hdPercent",'barhdPercent'=>"$hdPercent%",'TotalMemory'=>"$mt",'UsedMemory'=>"$mu",'FreeMemory'=>"$mf",'CachedMemory'=>"$mc",'Buffers'=>"$mb",'TotalSwap'=>"$st",'swapUsed'=>"$su",'swapFree'=>"$sf",'loadAvg'=>"$load",'uptime'=>"$uptime",'freetime'=>"$freetime",'bjtime'=>"$bjtime",'stime'=>"$stime",'memRealPercent'=>"$memRealPercent",'memRealUsed'=>"$memRealUsed",'memRealFree'=>"$memRealFree",'memPercent'=>"$memPercent%",'memCachedPercent'=>"$memCachedPercent",'barmemCachedPercent'=>"$memCachedPercent%",'swapPercent'=>"$swapPercent",'barmemRealPercent'=>"$memRealPercent%",'barswapPercent'=>"$swapPercent%",'NetOut2'=>"$NetOut[2]",'NetOut3'=>"$NetOut[3]",'NetOut4'=>"$NetOut[4]",'NetOut5'=>"$NetOut[5]",'NetOut6'=>"$NetOut[6]",'NetOut7'=>"$NetOut[7]",'NetOut8'=>"$NetOut[8]",'NetOut9'=>"$NetOut[9]",'NetOut10'=>"$NetOut[10]",'NetInput2'=>"$NetInput[2]",'NetInput3'=>"$NetInput[3]",'NetInput4'=>"$NetInput[4]",'NetInput5'=>"$NetInput[5]",'NetInput6'=>"$NetInput[6]",'NetInput7'=>"$NetInput[7]",'NetInput8'=>"$NetInput[8]",'NetInput9'=>"$NetInput[9]",'NetInput10'=>"$NetInput[10]",'NetOutSpeed2'=>"$NetOutSpeed[2]",'NetOutSpeed3'=>"$NetOutSpeed[3]",'NetOutSpeed4'=>"$NetOutSpeed[4]",'NetOutSpeed5'=>"$NetOutSpeed[5]",'NetInputSpeed2'=>"$NetInputSpeed[2]",'NetInputSpeed3'=>"$NetInputSpeed[3]",'NetInputSpeed4'=>"$NetInputSpeed[4]",'NetInputSpeed5'=>"$NetInputSpeed[5]"); - $jarr=json_encode($arr); - $_GET['callback'] = htmlspecialchars($_GET['callback']); - echo $_GET['callback'],'(',$jarr,')'; - exit; -} -?> - - - - -<?php echo $title.$version; ?> - - - - - - - - - - -
- - - - - - - - - - - - - - - -
PHPModuleOtherDatabasePerformanceSpeedMySQLFunctionMailDownload
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Server Parameters
Server Domain/IP - ()  Your IP address is:
Server identifies the
Server OS  Kernel version: Web Server
Server LanguageServer Port
Server HostNameAbsolute Path
Administrator MailProber Path
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Real-time Data Server
Current Server TimeServer Uptime
CPU Model [Core]
CPU usageView Chart";}else{echo "Only supports the Linux system";}?> -
Space usage - Total Space  G, - Used  G, - Free  G, - Rate % -
 
-
Memory usage - - Total Memory: - - , Used - - , Free - - , Rate - -
 
-0) -{ -?> - Cache Memory - , Rate - - % | Buffers -
 
- - Real Memory Used - - , Real Memory Free - - , Rate - - % -
 
-0) -{ -?> - SWAP: - - , Used - - , Free - - , Rate - - % -
 
- - -
Average System Load
- - - - - - - - - - - - - - - -
NetWork
: In : Real time: 0B/sOut : Real time: 0B/s
- - - - - - - - - -
PHP has been compiled module testing
-$value) { - if ($key!=0 && $key%13==0) { - echo '
'; - } - echo "$value  "; -} -?>
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PHP Parameters
PHP Info: - - PHPINFO";?> - PHP Version:
Run PHP: Memory Limit:
PHP Safe Mode: Post Max Size:
Upload Max Filesize: Floating-point data of significant digits:
Max Execution Time: SecondSocket TimeOut: Second
PHP Doc Root: User Dir:
Enable Dl: Include Path:
Display Errors: Register Globals:
Magic Quotes Gpc: "<?...?>"Short Open Tag:
"<% %>"ASP Tags: Ignore Repeated Errors:
Ignore Repeated Source: Report Memleaks:
Magic Quotes Gpc: Magic Quotes Runtime:
Allow URL Fopen: Register Argc Argv:
Cookie:√' : '×';?>Spell check(ASpell Library):
High-precision math(BCMath):PREL(PCRE):
PDF:SNMP:
VMailMgr:Curl:
SMTP:√' : '×';?>SMTP:×';?>
Enable Functions: Click here to view more!
Disable Functions: -×'; -} -else -{ - //echo $disFuns; - $disFuns_array = explode(',',$disFuns); - foreach ($disFuns_array as $key=>$value) - { - if ($key!=0 && $key%5==0) { - echo '
'; - } - echo "$value  "; -} -} - -?> -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Components
FTP: XML:
Session: Socket:
Calendar - Allow Url Fopen:
GD Library: - ×';} - ?>Zlib:
IMAP: JDToGregorian:
Preg Match: WDDX:
Iconv: mbstring:
BCADD: LDAP:
MCrypt: Mhash Count:
- - - - - - - - - - - - - - - - - - - - - - - -
Other Components
Zend Version×';}else{echo $zend_version;}?> - 2) -{ - echo "ZendGuardLoader[On]"; -} -else -{ - echo "Zend Optimizer"; -} -?> - 2){echo (get_cfg_var("zend_loader.enable"))?'':'×';} else{if(function_exists('zend_optimizer_version')){ echo zend_optimizer_version();}else{ echo (get_cfg_var("zend_optimizer.optimization_level")||get_cfg_var("zend_extension_manager.optimizer_ts")||get_cfg_var("zend.ze1_compatibility_mode")||get_cfg_var("zend_extension_ts"))?'':'×';}}?>
eAccelerator×";} ?>ioncube×";}?>
XCache×";} ?>APC×";} ?>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Database
MySQL: - - ODBC:
Oracle: SQL Server:
dBASE: mSQL:
SQLite: √ ';echo "SQLite3 Ver ";echo $sqliteVer[versionString];}else {echo isfun("sqlite_close");if(isfun("sqlite_close") == '') {echo " : ".@sqlite_libversion();}}?>Hyperwave:
Postgre SQL: Informix:
DBA database: DBM database:
FilePro database:SyBase database:
- - -" method="post"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Server Performance Test
Reference ObjectInt Test
(1+1 Count 3 Million)
Float Test
(Pi times the square root of 3 million)
I/O Test
(10K file read 10,000 times)
CPU Info
LinodeVPS0.357 Second0.802 Second0.023 Second4 x Xeon L5520 @ 2.27GHz
PhotonVPS.com0.431 Second1.024 Second0.034 Second8 x Xeon E5520 @ 2.27GHz
SpaceRich.com0.421 Second1.003 Second0.038 Second4 x Core i7 920 @ 2.67GHz
RiZie.com0.521 Second1.559 Second0.054 Second2 x Pentium4 3.00GHz
CitynetHost.com0.343 Second0.761 Second0.023 Second2 x Core2Duo E4600 @ 2.40GHz
IXwebhosting.com0.535 Second1.607 Second0.058 Second4 x Xeon E5530 @ 2.40GHz
This Server


- - - - - - - - - - - - -
Network Speed Test
-
- 1000k bytes sent to the client data -
- - - - - - - - - - - - - - - - - - -
Bandwidth1M2M3M4M5M6M7M8M9M10M
- - - - -
">">
-
- ".$_GET['speed']." Millisecond, Download Speed: "."".$speed.""." kb/s":" No Test " ?> - -
- - - - - - - - - - -
MySQL Database connection detection
- Host: - Port: - Username: - Password: - - -
- alert('Connect to the MySql database to normal')"; - } else { - echo ""; - } - } else { - echo ""; - } - } - ?> - - - - - - - - - - - alert('$funRe')"; - } - ?> -
Function Test
- Enter the function you want to test: - - - -
- - - - - - - - - - - alert('$mailRe')"; - } - ?> -
Mail Send Test
- Please enter your email address to test: - - - -
- - - - - - - - -
Processed in seconds. memory usage.TOP
- - -
- - diff --git a/images/php/multiple/conf.d/nginx.conf b/images/php/multiple/conf.d/nginx.conf deleted file mode 100644 index 9311781b..00000000 --- a/images/php/multiple/conf.d/nginx.conf +++ /dev/null @@ -1,61 +0,0 @@ -user www-data; -worker_processes auto; -error_log /var/log/nginx/error.log crit; -pid /var/run/nginx.pid; -worker_rlimit_nofile 51200; - -events -{ - use epoll; - multi_accept on; - worker_connections 51200; -} - -http - { - include /etc/nginx/mime.types; - #include proxy.conf; - #include luawaf.conf; - - default_type application/octet-stream; - - server_names_hash_bucket_size 128; - client_header_buffer_size 32k; - large_client_header_buffers 4 32k; - client_max_body_size 50m; - - sendfile on; - tcp_nopush on; - - keepalive_timeout 60; - - tcp_nodelay on; - - fastcgi_connect_timeout 300; - fastcgi_send_timeout 300; - fastcgi_read_timeout 300; - fastcgi_buffer_size 64k; - fastcgi_buffers 4 64k; - fastcgi_busy_buffers_size 128k; - fastcgi_temp_file_write_size 256k; - fastcgi_intercept_errors on; - - gzip on; - gzip_min_length 1k; - gzip_buffers 4 16k; - gzip_http_version 1.1; - gzip_comp_level 2; - gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml; - gzip_vary on; - gzip_proxied expired no-cache no-store private auth; - gzip_disable "MSIE [1-6]\."; - - limit_conn_zone $binary_remote_addr zone=perip:10m; - limit_conn_zone $server_name zone=perserver:10m; - - server_tokens off; - access_log off; - - include /etc/nginx/conf.d/*.conf; -} - diff --git a/images/php/multiple/conf.d/php.ini b/images/php/multiple/conf.d/php.ini deleted file mode 100644 index e72b7df1..00000000 --- a/images/php/multiple/conf.d/php.ini +++ /dev/null @@ -1,1934 +0,0 @@ -[PHP] - -;;;;;;;;;;;;;;;;;;; -; About php.ini ; -;;;;;;;;;;;;;;;;;;; -; PHP's initialization file, generally called php.ini, is responsible for -; configuring many of the aspects of PHP's behavior. - -; PHP attempts to find and load this configuration from a number of locations. -; The following is a summary of its search order: -; 1. SAPI module specific location. -; 2. The PHPRC environment variable. (As of PHP 5.2.0) -; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0) -; 4. Current working directory (except CLI) -; 5. The web server's directory (for SAPI modules), or directory of PHP -; (otherwise in Windows) -; 6. The directory from the --with-config-file-path compile time option, or the -; Windows directory (C:\windows or C:\winnt) -; See the PHP docs for more specific information. -; http://php.net/configuration.file - -; The syntax of the file is extremely simple. Whitespace and lines -; beginning with a semicolon are silently ignored (as you probably guessed). -; Section headers (e.g. [Foo]) are also silently ignored, even though -; they might mean something in the future. - -; Directives following the section heading [PATH=/www/mysite] only -; apply to PHP files in the /www/mysite directory. Directives -; following the section heading [HOST=www.example.com] only apply to -; PHP files served from www.example.com. Directives set in these -; special sections cannot be overridden by user-defined INI files or -; at runtime. Currently, [PATH=] and [HOST=] sections only work under -; CGI/FastCGI. -; http://php.net/ini.sections - -; Directives are specified using the following syntax: -; directive = value -; Directive names are *case sensitive* - foo=bar is different from FOO=bar. -; Directives are variables used to configure PHP or PHP extensions. -; There is no name validation. If PHP can't find an expected -; directive because it is not set or is mistyped, a default value will be used. - -; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one -; of the INI constants (On, Off, True, False, Yes, No and None) or an expression -; (e.g. E_ALL & ~E_NOTICE), a quoted string ("bar"), or a reference to a -; previously set variable or directive (e.g. ${foo}) - -; Expressions in the INI file are limited to bitwise operators and parentheses: -; | bitwise OR -; ^ bitwise XOR -; & bitwise AND -; ~ bitwise NOT -; ! boolean NOT - -; Boolean flags can be turned on using the values 1, On, True or Yes. -; They can be turned off using the values 0, Off, False or No. - -; An empty string can be denoted by simply not writing anything after the equal -; sign, or by using the None keyword: - -; foo = ; sets foo to an empty string -; foo = None ; sets foo to an empty string -; foo = "None" ; sets foo to the string 'None' - -; If you use constants in your value, and these constants belong to a -; dynamically loaded extension (either a PHP extension or a Zend extension), -; you may only use these constants *after* the line that loads the extension. - -;;;;;;;;;;;;;;;;;;; -; About this file ; -;;;;;;;;;;;;;;;;;;; -; PHP comes packaged with two INI files. One that is recommended to be used -; in production environments and one that is recommended to be used in -; development environments. - -; php.ini-production contains settings which hold security, performance and -; best practices at its core. But please be aware, these settings may break -; compatibility with older or less security conscience applications. We -; recommending using the production ini in production and testing environments. - -; php.ini-development is very similar to its production variant, except it is -; much more verbose when it comes to errors. We recommend using the -; development version only in development environments, as errors shown to -; application users can inadvertently leak otherwise secure information. - -; This is php.ini-production INI file. - -;;;;;;;;;;;;;;;;;;; -; Quick Reference ; -;;;;;;;;;;;;;;;;;;; -; The following are all the settings which are different in either the production -; or development versions of the INIs with respect to PHP's default behavior. -; Please see the actual settings later in the document for more details as to why -; we recommend these changes in PHP's behavior. - -; display_errors -; Default Value: On -; Development Value: On -; Production Value: Off - -; display_startup_errors -; Default Value: Off -; Development Value: On -; Production Value: Off - -; error_reporting -; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED -; Development Value: E_ALL -; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT - -; html_errors -; Default Value: On -; Development Value: On -; Production value: On - -; log_errors -; Default Value: Off -; Development Value: On -; Production Value: On - -; max_input_time -; Default Value: -1 (Unlimited) -; Development Value: 60 (60 seconds) -; Production Value: 60 (60 seconds) - -; output_buffering -; Default Value: Off -; Development Value: 4096 -; Production Value: 4096 - -; register_argc_argv -; Default Value: On -; Development Value: Off -; Production Value: Off - -; request_order -; Default Value: None -; Development Value: "GP" -; Production Value: "GP" - -; session.gc_divisor -; Default Value: 100 -; Development Value: 1000 -; Production Value: 1000 - -; session.sid_bits_per_character -; Default Value: 4 -; Development Value: 5 -; Production Value: 5 - -; short_open_tag -; Default Value: On -; Development Value: Off -; Production Value: Off - -; track_errors -; Default Value: Off -; Development Value: On -; Production Value: Off - -; variables_order -; Default Value: "EGPCS" -; Development Value: "GPCS" -; Production Value: "GPCS" - -;;;;;;;;;;;;;;;;;;;; -; php.ini Options ; -;;;;;;;;;;;;;;;;;;;; -; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini" -;user_ini.filename = ".user.ini" - -; To disable this feature set this option to empty value -;user_ini.filename = - -; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes) -;user_ini.cache_ttl = 300 - -;;;;;;;;;;;;;;;;;;;; -; Language Options ; -;;;;;;;;;;;;;;;;;;;; - -; Enable the PHP scripting language engine under Apache. -; http://php.net/engine -engine = On - -; This directive determines whether or not PHP will recognize code between -; tags as PHP source which should be processed as such. It is -; generally recommended that should be used and that this feature -; should be disabled, as enabling it may result in issues when generating XML -; documents, however this remains supported for backward compatibility reasons. -; Note that this directive does not control the would work. -; http://php.net/syntax-highlighting -;highlight.string = #DD0000 -;highlight.comment = #FF9900 -;highlight.keyword = #007700 -;highlight.default = #0000BB -;highlight.html = #000000 - -; If enabled, the request will be allowed to complete even if the user aborts -; the request. Consider enabling it if executing long requests, which may end up -; being interrupted by the user or a browser timing out. PHP's default behavior -; is to disable this feature. -; http://php.net/ignore-user-abort -;ignore_user_abort = On - -; Determines the size of the realpath cache to be used by PHP. This value should -; be increased on systems where PHP opens many files to reflect the quantity of -; the file operations performed. -; http://php.net/realpath-cache-size -;realpath_cache_size = 4096k - -; Duration of time, in seconds for which to cache realpath information for a given -; file or directory. For systems with rarely changing files, consider increasing this -; value. -; http://php.net/realpath-cache-ttl -;realpath_cache_ttl = 120 - -; Enables or disables the circular reference collector. -; http://php.net/zend.enable-gc -zend.enable_gc = On - -; If enabled, scripts may be written in encodings that are incompatible with -; the scanner. CP936, Big5, CP949 and Shift_JIS are the examples of such -; encodings. To use this feature, mbstring extension must be enabled. -; Default: Off -;zend.multibyte = Off - -; Allows to set the default encoding for the scripts. This value will be used -; unless "declare(encoding=...)" directive appears at the top of the script. -; Only affects if zend.multibyte is set. -; Default: "" -;zend.script_encoding = - -;;;;;;;;;;;;;;;;; -; Miscellaneous ; -;;;;;;;;;;;;;;;;; - -; Decides whether PHP may expose the fact that it is installed on the server -; (e.g. by adding its signature to the Web server header). It is no security -; threat in any way, but it makes it possible to determine whether you use PHP -; on your server or not. -; http://php.net/expose-php -expose_php = Off - -;;;;;;;;;;;;;;;;;;; -; Resource Limits ; -;;;;;;;;;;;;;;;;;;; - -; Maximum execution time of each script, in seconds -; http://php.net/max-execution-time -; Note: This directive is hardcoded to 0 for the CLI SAPI -max_execution_time = 30 - -; Maximum amount of time each script may spend parsing request data. It's a good -; idea to limit this time on productions servers in order to eliminate unexpectedly -; long running scripts. -; Note: This directive is hardcoded to -1 for the CLI SAPI -; Default Value: -1 (Unlimited) -; Development Value: 60 (60 seconds) -; Production Value: 60 (60 seconds) -; http://php.net/max-input-time -max_input_time = 60 - -; Maximum input variable nesting level -; http://php.net/max-input-nesting-level -;max_input_nesting_level = 64 - -; How many GET/POST/COOKIE input variables may be accepted -; max_input_vars = 1000 - -; Maximum amount of memory a script may consume (128MB) -; http://php.net/memory-limit -memory_limit = 64M - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Error handling and logging ; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -; This directive informs PHP of which errors, warnings and notices you would like -; it to take action for. The recommended way of setting values for this -; directive is through the use of the error level constants and bitwise -; operators. The error level constants are below here for convenience as well as -; some common settings and their meanings. -; By default, PHP is set to take action on all errors, notices and warnings EXCEPT -; those related to E_NOTICE and E_STRICT, which together cover best practices and -; recommended coding standards in PHP. For performance reasons, this is the -; recommend error reporting setting. Your production server shouldn't be wasting -; resources complaining about best practices and coding standards. That's what -; development servers and development settings are for. -; Note: The php.ini-development file has this setting as E_ALL. This -; means it pretty much reports everything which is exactly what you want during -; development and early testing. -; -; Error Level Constants: -; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0) -; E_ERROR - fatal run-time errors -; E_RECOVERABLE_ERROR - almost fatal run-time errors -; E_WARNING - run-time warnings (non-fatal errors) -; E_PARSE - compile-time parse errors -; E_NOTICE - run-time notices (these are warnings which often result -; from a bug in your code, but it's possible that it was -; intentional (e.g., using an uninitialized variable and -; relying on the fact it is automatically initialized to an -; empty string) -; E_STRICT - run-time notices, enable to have PHP suggest changes -; to your code which will ensure the best interoperability -; and forward compatibility of your code -; E_CORE_ERROR - fatal errors that occur during PHP's initial startup -; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's -; initial startup -; E_COMPILE_ERROR - fatal compile-time errors -; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) -; E_USER_ERROR - user-generated error message -; E_USER_WARNING - user-generated warning message -; E_USER_NOTICE - user-generated notice message -; E_DEPRECATED - warn about code that will not work in future versions -; of PHP -; E_USER_DEPRECATED - user-generated deprecation warnings -; -; Common Values: -; E_ALL (Show all errors, warnings and notices including coding standards.) -; E_ALL & ~E_NOTICE (Show all errors, except for notices) -; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.) -; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors) -; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED -; Development Value: E_ALL -; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT -; http://php.net/error-reporting -error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT - -; This directive controls whether or not and where PHP will output errors, -; notices and warnings too. Error output is very useful during development, but -; it could be very dangerous in production environments. Depending on the code -; which is triggering the error, sensitive information could potentially leak -; out of your application such as database usernames and passwords or worse. -; For production environments, we recommend logging errors rather than -; sending them to STDOUT. -; Possible Values: -; Off = Do not display any errors -; stderr = Display errors to STDERR (affects only CGI/CLI binaries!) -; On or stdout = Display errors to STDOUT -; Default Value: On -; Development Value: On -; Production Value: Off -; http://php.net/display-errors -display_errors = Off - -; The display of errors which occur during PHP's startup sequence are handled -; separately from display_errors. PHP's default behavior is to suppress those -; errors from clients. Turning the display of startup errors on can be useful in -; debugging configuration problems. We strongly recommend you -; set this to 'off' for production servers. -; Default Value: Off -; Development Value: On -; Production Value: Off -; http://php.net/display-startup-errors -display_startup_errors = Off - -; Besides displaying errors, PHP can also log errors to locations such as a -; server-specific log, STDERR, or a location specified by the error_log -; directive found below. While errors should not be displayed on productions -; servers they should still be monitored and logging is a great way to do that. -; Default Value: Off -; Development Value: On -; Production Value: On -; http://php.net/log-errors -log_errors = On - -; Set maximum length of log_errors. In error_log information about the source is -; added. The default is 1024 and 0 allows to not apply any maximum length at all. -; http://php.net/log-errors-max-len -log_errors_max_len = 1024 - -; Do not log repeated messages. Repeated errors must occur in same file on same -; line unless ignore_repeated_source is set true. -; http://php.net/ignore-repeated-errors -ignore_repeated_errors = Off - -; Ignore source of message when ignoring repeated messages. When this setting -; is On you will not log errors with repeated messages from different files or -; source lines. -; http://php.net/ignore-repeated-source -ignore_repeated_source = Off - -; If this parameter is set to Off, then memory leaks will not be shown (on -; stdout or in the log). This has only effect in a debug compile, and if -; error reporting includes E_WARNING in the allowed list -; http://php.net/report-memleaks -report_memleaks = On - -; This setting is on by default. -;report_zend_debug = 0 - -; Store the last error/warning message in $php_errormsg (boolean). Setting this value -; to On can assist in debugging and is appropriate for development servers. It should -; however be disabled on production servers. -; Default Value: Off -; Development Value: On -; Production Value: Off -; http://php.net/track-errors -track_errors = Off - -; Turn off normal error reporting and emit XML-RPC error XML -; http://php.net/xmlrpc-errors -;xmlrpc_errors = 0 - -; An XML-RPC faultCode -;xmlrpc_error_number = 0 - -; When PHP displays or logs an error, it has the capability of formatting the -; error message as HTML for easier reading. This directive controls whether -; the error message is formatted as HTML or not. -; Note: This directive is hardcoded to Off for the CLI SAPI -; Default Value: On -; Development Value: On -; Production value: On -; http://php.net/html-errors -html_errors = On - -; If html_errors is set to On *and* docref_root is not empty, then PHP -; produces clickable error messages that direct to a page describing the error -; or function causing the error in detail. -; You can download a copy of the PHP manual from http://php.net/docs -; and change docref_root to the base URL of your local copy including the -; leading '/'. You must also specify the file extension being used including -; the dot. PHP's default behavior is to leave these settings empty, in which -; case no links to documentation are generated. -; Note: Never use this feature for production boxes. -; http://php.net/docref-root -; Examples -;docref_root = "/phpmanual/" - -; http://php.net/docref-ext -;docref_ext = .html - -; String to output before an error message. PHP's default behavior is to leave -; this setting blank. -; http://php.net/error-prepend-string -; Example: -;error_prepend_string = "" - -; String to output after an error message. PHP's default behavior is to leave -; this setting blank. -; http://php.net/error-append-string -; Example: -;error_append_string = "" - -; Log errors to specified file. PHP's default behavior is to leave this value -; empty. -; http://php.net/error-log -; Example: -;error_log = php_errors.log -; Log errors to syslog (Event Log on Windows). -;error_log = syslog - -;windows.show_crt_warning -; Default value: 0 -; Development value: 0 -; Production value: 0 - -;;;;;;;;;;;;;;;;; -; Data Handling ; -;;;;;;;;;;;;;;;;; - -; The separator used in PHP generated URLs to separate arguments. -; PHP's default setting is "&". -; http://php.net/arg-separator.output -; Example: -;arg_separator.output = "&" - -; List of separator(s) used by PHP to parse input URLs into variables. -; PHP's default setting is "&". -; NOTE: Every character in this directive is considered as separator! -; http://php.net/arg-separator.input -; Example: -;arg_separator.input = ";&" - -; This directive determines which super global arrays are registered when PHP -; starts up. G,P,C,E & S are abbreviations for the following respective super -; globals: GET, POST, COOKIE, ENV and SERVER. There is a performance penalty -; paid for the registration of these arrays and because ENV is not as commonly -; used as the others, ENV is not recommended on productions servers. You -; can still get access to the environment variables through getenv() should you -; need to. -; Default Value: "EGPCS" -; Development Value: "GPCS" -; Production Value: "GPCS"; -; http://php.net/variables-order -variables_order = "GPCS" - -; This directive determines which super global data (G,P & C) should be -; registered into the super global array REQUEST. If so, it also determines -; the order in which that data is registered. The values for this directive -; are specified in the same manner as the variables_order directive, -; EXCEPT one. Leaving this value empty will cause PHP to use the value set -; in the variables_order directive. It does not mean it will leave the super -; globals array REQUEST empty. -; Default Value: None -; Development Value: "GP" -; Production Value: "GP" -; http://php.net/request-order -request_order = "GP" - -; This directive determines whether PHP registers $argv & $argc each time it -; runs. $argv contains an array of all the arguments passed to PHP when a script -; is invoked. $argc contains an integer representing the number of arguments -; that were passed when the script was invoked. These arrays are extremely -; useful when running scripts from the command line. When this directive is -; enabled, registering these variables consumes CPU cycles and memory each time -; a script is executed. For performance reasons, this feature should be disabled -; on production servers. -; Note: This directive is hardcoded to On for the CLI SAPI -; Default Value: On -; Development Value: Off -; Production Value: Off -; http://php.net/register-argc-argv -register_argc_argv = Off - -; When enabled, the ENV, REQUEST and SERVER variables are created when they're -; first used (Just In Time) instead of when the script starts. If these -; variables are not used within a script, having this directive on will result -; in a performance gain. The PHP directive register_argc_argv must be disabled -; for this directive to have any affect. -; http://php.net/auto-globals-jit -auto_globals_jit = On - -; Whether PHP will read the POST data. -; This option is enabled by default. -; Most likely, you won't want to disable this option globally. It causes $_POST -; and $_FILES to always be empty; the only way you will be able to read the -; POST data will be through the php://input stream wrapper. This can be useful -; to proxy requests or to process the POST data in a memory efficient fashion. -; http://php.net/enable-post-data-reading -;enable_post_data_reading = Off - -; Maximum size of POST data that PHP will accept. -; Its value may be 0 to disable the limit. It is ignored if POST data reading -; is disabled through enable_post_data_reading. -; http://php.net/post-max-size -post_max_size = 5120M - -; Automatically add files before PHP document. -; http://php.net/auto-prepend-file -auto_prepend_file = - -; Automatically add files after PHP document. -; http://php.net/auto-append-file -auto_append_file = - -; By default, PHP will output a media type using the Content-Type header. To -; disable this, simply set it to be empty. -; -; PHP's built-in default media type is set to text/html. -; http://php.net/default-mimetype -default_mimetype = "text/html" - -; PHP's default character set is set to UTF-8. -; http://php.net/default-charset -default_charset = "UTF-8" - -; PHP internal character encoding is set to empty. -; If empty, default_charset is used. -; http://php.net/internal-encoding -;internal_encoding = - -; PHP input character encoding is set to empty. -; If empty, default_charset is used. -; http://php.net/input-encoding -;input_encoding = - -; PHP output character encoding is set to empty. -; If empty, default_charset is used. -; See also output_buffer. -; http://php.net/output-encoding -;output_encoding = - -;;;;;;;;;;;;;;;;;;;;;;;;; -; Paths and Directories ; -;;;;;;;;;;;;;;;;;;;;;;;;; - -; UNIX: "/path1:/path2" -;include_path = ".:/php/includes" -; -; Windows: "\path1;\path2" -;include_path = ".;c:\php\includes" -; -; PHP's default setting for include_path is ".;/path/to/php/pear" -; http://php.net/include-path - -; The root of the PHP pages, used only if nonempty. -; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root -; if you are running php as a CGI under any web server (other than IIS) -; see documentation for security issues. The alternate is to use the -; cgi.force_redirect configuration below -; http://php.net/doc-root -doc_root = - -; The directory under which PHP opens the script using /~username used only -; if nonempty. -; http://php.net/user-dir -user_dir = - -; Directory in which the loadable extensions (modules) reside. -; http://php.net/extension-dir -; extension_dir = "./" -; On windows: -; extension_dir = "ext" - -; Directory where the temporary files should be placed. -; Defaults to the system default (see sys_get_temp_dir) -; sys_temp_dir = "/tmp" - -; Whether or not to enable the dl() function. The dl() function does NOT work -; properly in multithreaded servers, such as IIS or Zeus, and is automatically -; disabled on them. -; http://php.net/enable-dl -enable_dl = Off - -; cgi.force_redirect is necessary to provide security running PHP as a CGI under -; most web servers. Left undefined, PHP turns this on by default. You can -; turn it off here AT YOUR OWN RISK -; **You CAN safely turn this off for IIS, in fact, you MUST.** -; http://php.net/cgi.force-redirect -;cgi.force_redirect = 1 - -; if cgi.nph is enabled it will force cgi to always sent Status: 200 with -; every request. PHP's default behavior is to disable this feature. -;cgi.nph = 1 - -; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape -; (iPlanet) web servers, you MAY need to set an environment variable name that PHP -; will look for to know it is OK to continue execution. Setting this variable MAY -; cause security issues, KNOW WHAT YOU ARE DOING FIRST. -; http://php.net/cgi.redirect-status-env -;cgi.redirect_status_env = - -; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's -; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok -; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting -; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting -; of zero causes PHP to behave as before. Default is 1. You should fix your scripts -; to use SCRIPT_FILENAME rather than PATH_TRANSLATED. -; http://php.net/cgi.fix-pathinfo -;cgi.fix_pathinfo=1 - -; if cgi.discard_path is enabled, the PHP CGI binary can safely be placed outside -; of the web tree and people will not be able to circumvent .htaccess security. -; http://php.net/cgi.dicard-path -;cgi.discard_path=1 - -; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate -; security tokens of the calling client. This allows IIS to define the -; security context that the request runs under. mod_fastcgi under Apache -; does not currently support this feature (03/17/2002) -; Set to 1 if running under IIS. Default is zero. -; http://php.net/fastcgi.impersonate -;fastcgi.impersonate = 1 - -; Disable logging through FastCGI connection. PHP's default behavior is to enable -; this feature. -;fastcgi.logging = 0 - -; cgi.rfc2616_headers configuration option tells PHP what type of headers to -; use when sending HTTP response code. If set to 0, PHP sends Status: header that -; is supported by Apache. When this option is set to 1, PHP will send -; RFC2616 compliant header. -; Default is zero. -; http://php.net/cgi.rfc2616-headers -;cgi.rfc2616_headers = 0 - -; cgi.check_shebang_line controls whether CGI PHP checks for line starting with #! -; (shebang) at the top of the running script. This line might be needed if the -; script support running both as stand-alone script and via PHP CGI<. PHP in CGI -; mode skips this line and ignores its content if this directive is turned on. -; http://php.net/cgi.check-shebang-line -;cgi.check_shebang_line=1 - -;;;;;;;;;;;;;;;; -; File Uploads ; -;;;;;;;;;;;;;;;; - -; Whether to allow HTTP file uploads. -; http://php.net/file-uploads -file_uploads = On - -; Temporary directory for HTTP uploaded files (will use system default if not -; specified). -; http://php.net/upload-tmp-dir -;upload_tmp_dir = - -; Maximum allowed size for uploaded files. -; http://php.net/upload-max-filesize -upload_max_filesize = 5120M - -; Maximum number of files that can be uploaded via a single request -max_file_uploads = 40960 - -;;;;;;;;;;;;;;;;;; -; Fopen wrappers ; -;;;;;;;;;;;;;;;;;; - -; Whether to allow the treatment of URLs (like http:// or ftp://) as files. -; http://php.net/allow-url-fopen -allow_url_fopen = On - -; Whether to allow include/require to open URLs (like http:// or ftp://) as files. -; http://php.net/allow-url-include -allow_url_include = Off - -; Define the anonymous ftp password (your email address). PHP's default setting -; for this is empty. -; http://php.net/from -;from="john@doe.com" - -; Define the User-Agent string. PHP's default setting for this is empty. -; http://php.net/user-agent -;user_agent="PHP" - -; Default timeout for socket based streams (seconds) -; http://php.net/default-socket-timeout -default_socket_timeout = 60 - -; If your scripts have to deal with files from Macintosh systems, -; or you are running on a Mac and need to deal with files from -; unix or win32 systems, setting this flag will cause PHP to -; automatically detect the EOL character in those files so that -; fgets() and file() will work regardless of the source of the file. -; http://php.net/auto-detect-line-endings -;auto_detect_line_endings = Off - -;;;;;;;;;;;;;;;;;;;;;; -; Dynamic Extensions ; -;;;;;;;;;;;;;;;;;;;;;; - -; If you wish to have an extension loaded automatically, use the following -; syntax: -; -; extension=modulename.extension -; -; For example, on Windows: -; -; extension=msql.dll -; -; ... or under UNIX: -; -; extension=msql.so -; -; ... or with a path: -; -; extension=/path/to/extension/msql.so -; -; If you only provide the name of the extension, PHP will look for it in its -; default extension directory. -; -; Windows Extensions -; Note that ODBC support is built in, so no dll is needed for it. -; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5+) -; extension folders as well as the separate PECL DLL download (PHP 5+). -; Be sure to appropriately set the extension_dir directive. -; -;extension=php_bz2.dll -;extension=php_curl.dll -;extension=php_fileinfo.dll -;extension=php_ftp.dll -;extension=php_gd2.dll -;extension=php_gettext.dll -;extension=php_gmp.dll -;extension=php_intl.dll -;extension=php_imap.dll -;extension=php_interbase.dll -;extension=php_ldap.dll -;extension=php_mbstring.dll -;extension=php_exif.dll ; Must be after mbstring as it depends on it -;extension=php_mysqli.dll -;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client -;extension=php_openssl.dll -;extension=php_pdo_firebird.dll -;extension=php_pdo_mysql.dll -;extension=php_pdo_oci.dll -;extension=php_pdo_odbc.dll -;extension=php_pdo_pgsql.dll -;extension=php_pdo_sqlite.dll -;extension=php_pgsql.dll -;extension=php_shmop.dll - -; The MIBS data available in the PHP distribution must be installed. -; See http://www.php.net/manual/en/snmp.installation.php -;extension=php_snmp.dll - -;extension=php_soap.dll -;extension=php_sockets.dll -;extension=php_sqlite3.dll -;extension=php_tidy.dll -;extension=php_xmlrpc.dll -;extension=php_xsl.dll - -;;;;;;;;;;;;;;;;;;; -; Module Settings ; -;;;;;;;;;;;;;;;;;;; - -[CLI Server] -; Whether the CLI web server uses ANSI color coding in its terminal output. -cli_server.color = On - -[Date] -; Defines the default timezone used by the date functions -; http://php.net/date.timezone -date.timezone = Asia/Shanghai - -; http://php.net/date.default-latitude -;date.default_latitude = 31.7667 - -; http://php.net/date.default-longitude -;date.default_longitude = 35.2333 - -; http://php.net/date.sunrise-zenith -;date.sunrise_zenith = 90.583333 - -; http://php.net/date.sunset-zenith -;date.sunset_zenith = 90.583333 - -[filter] -; http://php.net/filter.default -;filter.default = unsafe_raw - -; http://php.net/filter.default-flags -;filter.default_flags = - -[iconv] -; Use of this INI entry is deprecated, use global input_encoding instead. -; If empty, default_charset or input_encoding or iconv.input_encoding is used. -; The precedence is: default_charset < intput_encoding < iconv.input_encoding -;iconv.input_encoding = - -; Use of this INI entry is deprecated, use global internal_encoding instead. -; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. -; The precedence is: default_charset < internal_encoding < iconv.internal_encoding -;iconv.internal_encoding = - -; Use of this INI entry is deprecated, use global output_encoding instead. -; If empty, default_charset or output_encoding or iconv.output_encoding is used. -; The precedence is: default_charset < output_encoding < iconv.output_encoding -; To use an output encoding conversion, iconv's output handler must be set -; otherwise output encoding conversion cannot be performed. -;iconv.output_encoding = - -[intl] -;intl.default_locale = -; This directive allows you to produce PHP errors when some error -; happens within intl functions. The value is the level of the error produced. -; Default is 0, which does not produce any errors. -;intl.error_level = E_WARNING -;intl.use_exceptions = 0 - -[sqlite3] -;sqlite3.extension_dir = - -[Pcre] -;PCRE library backtracking limit. -; http://php.net/pcre.backtrack-limit -;pcre.backtrack_limit=100000 - -;PCRE library recursion limit. -;Please note that if you set this value to a high number you may consume all -;the available process stack and eventually crash PHP (due to reaching the -;stack size limit imposed by the Operating System). -; http://php.net/pcre.recursion-limit -;pcre.recursion_limit=100000 - -;Enables or disables JIT compilation of patterns. This requires the PCRE -;library to be compiled with JIT support. -;pcre.jit=1 - -[Pdo] -; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off" -; http://php.net/pdo-odbc.connection-pooling -;pdo_odbc.connection_pooling=strict - -;pdo_odbc.db2_instance_name - -[Pdo_mysql] -; If mysqlnd is used: Number of cache slots for the internal result set cache -; http://php.net/pdo_mysql.cache_size -pdo_mysql.cache_size = 2000 - -; Default socket name for local MySQL connects. If empty, uses the built-in -; MySQL defaults. -; http://php.net/pdo_mysql.default-socket -pdo_mysql.default_socket= - -[Phar] -; http://php.net/phar.readonly -;phar.readonly = On - -; http://php.net/phar.require-hash -;phar.require_hash = On - -;phar.cache_list = - -[mail function] -; For Win32 only. -; http://php.net/smtp -SMTP = localhost -; http://php.net/smtp-port -smtp_port = 25 - -; For Win32 only. -; http://php.net/sendmail-from -;sendmail_from = me@example.com - -; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). -; http://php.net/sendmail-path -;sendmail_path = - -; Force the addition of the specified parameters to be passed as extra parameters -; to the sendmail binary. These parameters will always replace the value of -; the 5th parameter to mail(). -;mail.force_extra_parameters = - -; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename -mail.add_x_header = On - -; The path to a log file that will log all mail() calls. Log entries include -; the full path of the script, line number, To address and headers. -;mail.log = -; Log mail to syslog (Event Log on Windows). -;mail.log = syslog - -[SQL] -; http://php.net/sql.safe-mode -sql.safe_mode = Off - -[ODBC] -; http://php.net/odbc.default-db -;odbc.default_db = Not yet implemented - -; http://php.net/odbc.default-user -;odbc.default_user = Not yet implemented - -; http://php.net/odbc.default-pw -;odbc.default_pw = Not yet implemented - -; Controls the ODBC cursor model. -; Default: SQL_CURSOR_STATIC (default). -;odbc.default_cursortype - -; Allow or prevent persistent links. -; http://php.net/odbc.allow-persistent -odbc.allow_persistent = On - -; Check that a connection is still valid before reuse. -; http://php.net/odbc.check-persistent -odbc.check_persistent = On - -; Maximum number of persistent links. -1 means no limit. -; http://php.net/odbc.max-persistent -odbc.max_persistent = -1 - -; Maximum number of links (persistent + non-persistent). -1 means no limit. -; http://php.net/odbc.max-links -odbc.max_links = -1 - -; Handling of LONG fields. Returns number of bytes to variables. 0 means -; passthru. -; http://php.net/odbc.defaultlrl -odbc.defaultlrl = 4096 - -; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. -; See the documentation on odbc_binmode and odbc_longreadlen for an explanation -; of odbc.defaultlrl and odbc.defaultbinmode -; http://php.net/odbc.defaultbinmode -odbc.defaultbinmode = 1 - -;birdstep.max_links = -1 - -[Interbase] -; Allow or prevent persistent links. -ibase.allow_persistent = 1 - -; Maximum number of persistent links. -1 means no limit. -ibase.max_persistent = -1 - -; Maximum number of links (persistent + non-persistent). -1 means no limit. -ibase.max_links = -1 - -; Default database name for ibase_connect(). -;ibase.default_db = - -; Default username for ibase_connect(). -;ibase.default_user = - -; Default password for ibase_connect(). -;ibase.default_password = - -; Default charset for ibase_connect(). -;ibase.default_charset = - -; Default timestamp format. -ibase.timestampformat = "%Y-%m-%d %H:%M:%S" - -; Default date format. -ibase.dateformat = "%Y-%m-%d" - -; Default time format. -ibase.timeformat = "%H:%M:%S" - -[MySQLi] - -; Maximum number of persistent links. -1 means no limit. -; http://php.net/mysqli.max-persistent -mysqli.max_persistent = -1 - -; Allow accessing, from PHP's perspective, local files with LOAD DATA statements -; http://php.net/mysqli.allow_local_infile -;mysqli.allow_local_infile = On - -; Allow or prevent persistent links. -; http://php.net/mysqli.allow-persistent -mysqli.allow_persistent = On - -; Maximum number of links. -1 means no limit. -; http://php.net/mysqli.max-links -mysqli.max_links = -1 - -; If mysqlnd is used: Number of cache slots for the internal result set cache -; http://php.net/mysqli.cache_size -mysqli.cache_size = 2000 - -; Default port number for mysqli_connect(). If unset, mysqli_connect() will use -; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the -; compile-time value defined MYSQL_PORT (in that order). Win32 will only look -; at MYSQL_PORT. -; http://php.net/mysqli.default-port -mysqli.default_port = 3306 - -; Default socket name for local MySQL connects. If empty, uses the built-in -; MySQL defaults. -; http://php.net/mysqli.default-socket -mysqli.default_socket = - -; Default host for mysql_connect() (doesn't apply in safe mode). -; http://php.net/mysqli.default-host -mysqli.default_host = - -; Default user for mysql_connect() (doesn't apply in safe mode). -; http://php.net/mysqli.default-user -mysqli.default_user = - -; Default password for mysqli_connect() (doesn't apply in safe mode). -; Note that this is generally a *bad* idea to store passwords in this file. -; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw") -; and reveal this password! And of course, any users with read access to this -; file will be able to reveal the password as well. -; http://php.net/mysqli.default-pw -mysqli.default_pw = - -; Allow or prevent reconnect -mysqli.reconnect = Off - -[mysqlnd] -; Enable / Disable collection of general statistics by mysqlnd which can be -; used to tune and monitor MySQL operations. -; http://php.net/mysqlnd.collect_statistics -mysqlnd.collect_statistics = On - -; Enable / Disable collection of memory usage statistics by mysqlnd which can be -; used to tune and monitor MySQL operations. -; http://php.net/mysqlnd.collect_memory_statistics -mysqlnd.collect_memory_statistics = Off - -; Records communication from all extensions using mysqlnd to the specified log -; file. -; http://php.net/mysqlnd.debug -;mysqlnd.debug = - -; Defines which queries will be logged. -; http://php.net/mysqlnd.log_mask -;mysqlnd.log_mask = 0 - -; Default size of the mysqlnd memory pool, which is used by result sets. -; http://php.net/mysqlnd.mempool_default_size -;mysqlnd.mempool_default_size = 16000 - -; Size of a pre-allocated buffer used when sending commands to MySQL in bytes. -; http://php.net/mysqlnd.net_cmd_buffer_size -;mysqlnd.net_cmd_buffer_size = 2048 - -; Size of a pre-allocated buffer used for reading data sent by the server in -; bytes. -; http://php.net/mysqlnd.net_read_buffer_size -;mysqlnd.net_read_buffer_size = 32768 - -; Timeout for network requests in seconds. -; http://php.net/mysqlnd.net_read_timeout -;mysqlnd.net_read_timeout = 31536000 - -; SHA-256 Authentication Plugin related. File with the MySQL server public RSA -; key. -; http://php.net/mysqlnd.sha256_server_public_key -;mysqlnd.sha256_server_public_key = - -[OCI8] - -; Connection: Enables privileged connections using external -; credentials (OCI_SYSOPER, OCI_SYSDBA) -; http://php.net/oci8.privileged-connect -;oci8.privileged_connect = Off - -; Connection: The maximum number of persistent OCI8 connections per -; process. Using -1 means no limit. -; http://php.net/oci8.max-persistent -;oci8.max_persistent = -1 - -; Connection: The maximum number of seconds a process is allowed to -; maintain an idle persistent connection. Using -1 means idle -; persistent connections will be maintained forever. -; http://php.net/oci8.persistent-timeout -;oci8.persistent_timeout = -1 - -; Connection: The number of seconds that must pass before issuing a -; ping during oci_pconnect() to check the connection validity. When -; set to 0, each oci_pconnect() will cause a ping. Using -1 disables -; pings completely. -; http://php.net/oci8.ping-interval -;oci8.ping_interval = 60 - -; Connection: Set this to a user chosen connection class to be used -; for all pooled server requests with Oracle 11g Database Resident -; Connection Pooling (DRCP). To use DRCP, this value should be set to -; the same string for all web servers running the same application, -; the database pool must be configured, and the connection string must -; specify to use a pooled server. -;oci8.connection_class = - -; High Availability: Using On lets PHP receive Fast Application -; Notification (FAN) events generated when a database node fails. The -; database must also be configured to post FAN events. -;oci8.events = Off - -; Tuning: This option enables statement caching, and specifies how -; many statements to cache. Using 0 disables statement caching. -; http://php.net/oci8.statement-cache-size -;oci8.statement_cache_size = 20 - -; Tuning: Enables statement prefetching and sets the default number of -; rows that will be fetched automatically after statement execution. -; http://php.net/oci8.default-prefetch -;oci8.default_prefetch = 100 - -; Compatibility. Using On means oci_close() will not close -; oci_connect() and oci_new_connect() connections. -; http://php.net/oci8.old-oci-close-semantics -;oci8.old_oci_close_semantics = Off - -[PostgreSQL] -; Allow or prevent persistent links. -; http://php.net/pgsql.allow-persistent -pgsql.allow_persistent = On - -; Detect broken persistent links always with pg_pconnect(). -; Auto reset feature requires a little overheads. -; http://php.net/pgsql.auto-reset-persistent -pgsql.auto_reset_persistent = Off - -; Maximum number of persistent links. -1 means no limit. -; http://php.net/pgsql.max-persistent -pgsql.max_persistent = -1 - -; Maximum number of links (persistent+non persistent). -1 means no limit. -; http://php.net/pgsql.max-links -pgsql.max_links = -1 - -; Ignore PostgreSQL backends Notice message or not. -; Notice message logging require a little overheads. -; http://php.net/pgsql.ignore-notice -pgsql.ignore_notice = 0 - -; Log PostgreSQL backends Notice message or not. -; Unless pgsql.ignore_notice=0, module cannot log notice message. -; http://php.net/pgsql.log-notice -pgsql.log_notice = 0 - -[bcmath] -; Number of decimal digits for all bcmath functions. -; http://php.net/bcmath.scale -bcmath.scale = 0 - -[browscap] -; http://php.net/browscap -;browscap = extra/browscap.ini - -[Session] -; Handler used to store/retrieve data. -; http://php.net/session.save-handler -session.save_handler = files - -; Argument passed to save_handler. In the case of files, this is the path -; where data files are stored. Note: Windows users have to change this -; variable in order to use PHP's session functions. -; -; The path can be defined as: -; -; session.save_path = "N;/path" -; -; where N is an integer. Instead of storing all the session files in -; /path, what this will do is use subdirectories N-levels deep, and -; store the session data in those directories. This is useful if -; your OS has problems with many files in one directory, and is -; a more efficient layout for servers that handle many sessions. -; -; NOTE 1: PHP will not create this directory structure automatically. -; You can use the script in the ext/session dir for that purpose. -; NOTE 2: See the section on garbage collection below if you choose to -; use subdirectories for session storage -; -; The file storage module creates files using mode 600 by default. -; You can change that by using -; -; session.save_path = "N;MODE;/path" -; -; where MODE is the octal representation of the mode. Note that this -; does not overwrite the process's umask. -; http://php.net/session.save-path -;session.save_path = "/tmp" - -; Whether to use strict session mode. -; Strict session mode does not accept uninitialized session ID and regenerate -; session ID if browser sends uninitialized session ID. Strict mode protects -; applications from session fixation via session adoption vulnerability. It is -; disabled by default for maximum compatibility, but enabling it is encouraged. -; https://wiki.php.net/rfc/strict_sessions -session.use_strict_mode = 0 - -; Whether to use cookies. -; http://php.net/session.use-cookies -session.use_cookies = 1 - -; http://php.net/session.cookie-secure -;session.cookie_secure = - -; This option forces PHP to fetch and use a cookie for storing and maintaining -; the session id. We encourage this operation as it's very helpful in combating -; session hijacking when not specifying and managing your own session id. It is -; not the be-all and end-all of session hijacking defense, but it's a good start. -; http://php.net/session.use-only-cookies -session.use_only_cookies = 1 - -; Name of the session (used as cookie name). -; http://php.net/session.name -session.name = PHPSESSID - -; Initialize session on request startup. -; http://php.net/session.auto-start -session.auto_start = 0 - -; Lifetime in seconds of cookie or, if 0, until browser is restarted. -; http://php.net/session.cookie-lifetime -session.cookie_lifetime = 0 - -; The path for which the cookie is valid. -; http://php.net/session.cookie-path -session.cookie_path = / - -; The domain for which the cookie is valid. -; http://php.net/session.cookie-domain -session.cookie_domain = - -; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript. -; http://php.net/session.cookie-httponly -session.cookie_httponly = - -; Handler used to serialize data. php is the standard serializer of PHP. -; http://php.net/session.serialize-handler -session.serialize_handler = php - -; Defines the probability that the 'garbage collection' process is started -; on every session initialization. The probability is calculated by using -; gc_probability/gc_divisor. Where session.gc_probability is the numerator -; and gc_divisor is the denominator in the equation. Setting this value to 1 -; when the session.gc_divisor value is 100 will give you approximately a 1% chance -; the gc will run on any give request. -; Default Value: 1 -; Development Value: 1 -; Production Value: 1 -; http://php.net/session.gc-probability -session.gc_probability = 1 - -; Defines the probability that the 'garbage collection' process is started on every -; session initialization. The probability is calculated by using the following equation: -; gc_probability/gc_divisor. Where session.gc_probability is the numerator and -; session.gc_divisor is the denominator in the equation. Setting this value to 1 -; when the session.gc_divisor value is 100 will give you approximately a 1% chance -; the gc will run on any give request. Increasing this value to 1000 will give you -; a 0.1% chance the gc will run on any give request. For high volume production servers, -; this is a more efficient approach. -; Default Value: 100 -; Development Value: 1000 -; Production Value: 1000 -; http://php.net/session.gc-divisor -session.gc_divisor = 1000 - -; After this number of seconds, stored data will be seen as 'garbage' and -; cleaned up by the garbage collection process. -; http://php.net/session.gc-maxlifetime -session.gc_maxlifetime = 1440 - -; NOTE: If you are using the subdirectory option for storing session files -; (see session.save_path above), then garbage collection does *not* -; happen automatically. You will need to do your own garbage -; collection through a shell script, cron entry, or some other method. -; For example, the following script would is the equivalent of -; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): -; find /path/to/sessions -cmin +24 -type f | xargs rm - -; Check HTTP Referer to invalidate externally stored URLs containing ids. -; HTTP_REFERER has to contain this substring for the session to be -; considered as valid. -; http://php.net/session.referer-check -session.referer_check = - -; Set to {nocache,private,public,} to determine HTTP caching aspects -; or leave this empty to avoid sending anti-caching headers. -; http://php.net/session.cache-limiter -session.cache_limiter = nocache - -; Document expires after n minutes. -; http://php.net/session.cache-expire -session.cache_expire = 180 - -; trans sid support is disabled by default. -; Use of trans sid may risk your users' security. -; Use this option with caution. -; - User may send URL contains active session ID -; to other person via. email/irc/etc. -; - URL that contains active session ID may be stored -; in publicly accessible computer. -; - User may access your site with the same session ID -; always using URL stored in browser's history or bookmarks. -; http://php.net/session.use-trans-sid -session.use_trans_sid = 0 - -; Set session ID character length. This value could be between 22 to 256. -; Shorter length than default is supported only for compatibility reason. -; Users should use 32 or more chars. -; http://php.net/session.sid-length -; Default Value: 32 -; Development Value: 26 -; Production Value: 26 -session.sid_length = 26 - -; The URL rewriter will look for URLs in a defined set of HTML tags. -;
is special; if you include them here, the rewriter will -; add a hidden field with the info which is otherwise appended -; to URLs. tag's action attribute URL will not be modified -; unless it is specified. -; Note that all valid entries require a "=", even if no value follows. -; Default Value: "a=href,area=href,frame=src,form=" -; Development Value: "a=href,area=href,frame=src,form=" -; Production Value: "a=href,area=href,frame=src,form=" -; http://php.net/url-rewriter.tags -session.trans_sid_tags = "a=href,area=href,frame=src,form=" - -; URL rewriter does not rewrite absolute URLs by default. -; To enable rewrites for absolute pathes, target hosts must be specified -; at RUNTIME. i.e. use ini_set() -; tags is special. PHP will check action attribute's URL regardless -; of session.trans_sid_tags setting. -; If no host is defined, HTTP_HOST will be used for allowed host. -; Example value: php.net,www.php.net,wiki.php.net -; Use "," for multiple hosts. No spaces are allowed. -; Default Value: "" -; Development Value: "" -; Production Value: "" -;session.trans_sid_hosts="" - -; Define how many bits are stored in each character when converting -; the binary hash data to something readable. -; Possible values: -; 4 (4 bits: 0-9, a-f) -; 5 (5 bits: 0-9, a-v) -; 6 (6 bits: 0-9, a-z, A-Z, "-", ",") -; Default Value: 4 -; Development Value: 5 -; Production Value: 5 -; http://php.net/session.hash-bits-per-character -session.sid_bits_per_character = 5 - -; Enable upload progress tracking in $_SESSION -; Default Value: On -; Development Value: On -; Production Value: On -; http://php.net/session.upload-progress.enabled -;session.upload_progress.enabled = On - -; Cleanup the progress information as soon as all POST data has been read -; (i.e. upload completed). -; Default Value: On -; Development Value: On -; Production Value: On -; http://php.net/session.upload-progress.cleanup -;session.upload_progress.cleanup = On - -; A prefix used for the upload progress key in $_SESSION -; Default Value: "upload_progress_" -; Development Value: "upload_progress_" -; Production Value: "upload_progress_" -; http://php.net/session.upload-progress.prefix -;session.upload_progress.prefix = "upload_progress_" - -; The index name (concatenated with the prefix) in $_SESSION -; containing the upload progress information -; Default Value: "PHP_SESSION_UPLOAD_PROGRESS" -; Development Value: "PHP_SESSION_UPLOAD_PROGRESS" -; Production Value: "PHP_SESSION_UPLOAD_PROGRESS" -; http://php.net/session.upload-progress.name -;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS" - -; How frequently the upload progress should be updated. -; Given either in percentages (per-file), or in bytes -; Default Value: "1%" -; Development Value: "1%" -; Production Value: "1%" -; http://php.net/session.upload-progress.freq -;session.upload_progress.freq = "1%" - -; The minimum delay between updates, in seconds -; Default Value: 1 -; Development Value: 1 -; Production Value: 1 -; http://php.net/session.upload-progress.min-freq -;session.upload_progress.min_freq = "1" - -; Only write session data when session data is changed. Enabled by default. -; http://php.net/session.lazy-write -;session.lazy_write = On - -[Assertion] -; Switch whether to compile assertions at all (to have no overhead at run-time) -; -1: Do not compile at all -; 0: Jump over assertion at run-time -; 1: Execute assertions -; Changing from or to a negative value is only possible in php.ini! (For turning assertions on and off at run-time, see assert.active, when zend.assertions = 1) -; Default Value: 1 -; Development Value: 1 -; Production Value: -1 -; http://php.net/zend.assertions -zend.assertions = -1 - -; Assert(expr); active by default. -; http://php.net/assert.active -;assert.active = On - -; Throw an AssertationException on failed assertions -; http://php.net/assert.exception -;assert.exception = On - -; Issue a PHP warning for each failed assertion. (Overridden by assert.exception if active) -; http://php.net/assert.warning -;assert.warning = On - -; Don't bail out by default. -; http://php.net/assert.bail -;assert.bail = Off - -; User-function to be called if an assertion fails. -; http://php.net/assert.callback -;assert.callback = 0 - -; Eval the expression with current error_reporting(). Set to true if you want -; error_reporting(0) around the eval(). -; http://php.net/assert.quiet-eval -;assert.quiet_eval = 0 - -[COM] -; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs -; http://php.net/com.typelib-file -;com.typelib_file = - -; allow Distributed-COM calls -; http://php.net/com.allow-dcom -;com.allow_dcom = true - -; autoregister constants of a components typlib on com_load() -; http://php.net/com.autoregister-typelib -;com.autoregister_typelib = true - -; register constants casesensitive -; http://php.net/com.autoregister-casesensitive -;com.autoregister_casesensitive = false - -; show warnings on duplicate constant registrations -; http://php.net/com.autoregister-verbose -;com.autoregister_verbose = true - -; The default character set code-page to use when passing strings to and from COM objects. -; Default: system ANSI code page -;com.code_page= - -[mbstring] -; language for internal character representation. -; This affects mb_send_mail() and mbstring.detect_order. -; http://php.net/mbstring.language -;mbstring.language = Japanese - -; Use of this INI entry is deprecated, use global internal_encoding instead. -; internal/script encoding. -; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*) -; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. -; The precedence is: default_charset < internal_encoding < iconv.internal_encoding -;mbstring.internal_encoding = - -; Use of this INI entry is deprecated, use global input_encoding instead. -; http input encoding. -; mbstring.encoding_traslation = On is needed to use this setting. -; If empty, default_charset or input_encoding or mbstring.input is used. -; The precedence is: default_charset < intput_encoding < mbsting.http_input -; http://php.net/mbstring.http-input -;mbstring.http_input = - -; Use of this INI entry is deprecated, use global output_encoding instead. -; http output encoding. -; mb_output_handler must be registered as output buffer to function. -; If empty, default_charset or output_encoding or mbstring.http_output is used. -; The precedence is: default_charset < output_encoding < mbstring.http_output -; To use an output encoding conversion, mbstring's output handler must be set -; otherwise output encoding conversion cannot be performed. -; http://php.net/mbstring.http-output -;mbstring.http_output = - -; enable automatic encoding translation according to -; mbstring.internal_encoding setting. Input chars are -; converted to internal encoding by setting this to On. -; Note: Do _not_ use automatic encoding translation for -; portable libs/applications. -; http://php.net/mbstring.encoding-translation -;mbstring.encoding_translation = Off - -; automatic encoding detection order. -; "auto" detect order is changed according to mbstring.language -; http://php.net/mbstring.detect-order -;mbstring.detect_order = auto - -; substitute_character used when character cannot be converted -; one from another -; http://php.net/mbstring.substitute-character -;mbstring.substitute_character = none - -; overload(replace) single byte functions by mbstring functions. -; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(), -; etc. Possible values are 0,1,2,4 or combination of them. -; For example, 7 for overload everything. -; 0: No overload -; 1: Overload mail() function -; 2: Overload str*() functions -; 4: Overload ereg*() functions -; http://php.net/mbstring.func-overload -;mbstring.func_overload = 0 - -; enable strict encoding detection. -; Default: Off -;mbstring.strict_detection = On - -; This directive specifies the regex pattern of content types for which mb_output_handler() -; is activated. -; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml) -;mbstring.http_output_conv_mimetype= - -[gd] -; Tell the jpeg decode to ignore warnings and try to create -; a gd image. The warning will then be displayed as notices -; disabled by default -; http://php.net/gd.jpeg-ignore-warning -;gd.jpeg_ignore_warning = 1 - -[exif] -; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS. -; With mbstring support this will automatically be converted into the encoding -; given by corresponding encode setting. When empty mbstring.internal_encoding -; is used. For the decode settings you can distinguish between motorola and -; intel byte order. A decode setting cannot be empty. -; http://php.net/exif.encode-unicode -;exif.encode_unicode = ISO-8859-15 - -; http://php.net/exif.decode-unicode-motorola -;exif.decode_unicode_motorola = UCS-2BE - -; http://php.net/exif.decode-unicode-intel -;exif.decode_unicode_intel = UCS-2LE - -; http://php.net/exif.encode-jis -;exif.encode_jis = - -; http://php.net/exif.decode-jis-motorola -;exif.decode_jis_motorola = JIS - -; http://php.net/exif.decode-jis-intel -;exif.decode_jis_intel = JIS - -[Tidy] -; The path to a default tidy configuration file to use when using tidy -; http://php.net/tidy.default-config -;tidy.default_config = /usr/local/lib/php/default.tcfg - -; Should tidy clean and repair output automatically? -; WARNING: Do not use this option if you are generating non-html content -; such as dynamic images -; http://php.net/tidy.clean-output -tidy.clean_output = Off - -[soap] -; Enables or disables WSDL caching feature. -; http://php.net/soap.wsdl-cache-enabled -soap.wsdl_cache_enabled=1 - -; Sets the directory name where SOAP extension will put cache files. -; http://php.net/soap.wsdl-cache-dir -soap.wsdl_cache_dir="/tmp" - -; (time to live) Sets the number of second while cached file will be used -; instead of original one. -; http://php.net/soap.wsdl-cache-ttl -soap.wsdl_cache_ttl=86400 - -; Sets the size of the cache limit. (Max. number of WSDL files to cache) -soap.wsdl_cache_limit = 5 - -[sysvshm] -; A default size of the shared memory segment -;sysvshm.init_mem = 10000 - -[ldap] -; Sets the maximum number of open links or -1 for unlimited. -ldap.max_links = -1 - -[mcrypt] -; For more information about mcrypt settings see http://php.net/mcrypt-module-open - -; Directory where to load mcrypt algorithms -; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt) -;mcrypt.algorithms_dir= - -; Directory where to load mcrypt modes -; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt) -;mcrypt.modes_dir= - -[dba] -;dba.default_handler= - -[opcache] -; Determines if Zend OPCache is enabled -;opcache.enable=1 - -; Determines if Zend OPCache is enabled for the CLI version of PHP -;opcache.enable_cli=0 - -; The OPcache shared memory storage size. -;opcache.memory_consumption=128 - -; The amount of memory for interned strings in Mbytes. -;opcache.interned_strings_buffer=8 - -; The maximum number of keys (scripts) in the OPcache hash table. -; Only numbers between 200 and 1000000 are allowed. -;opcache.max_accelerated_files=10000 - -; The maximum percentage of "wasted" memory until a restart is scheduled. -;opcache.max_wasted_percentage=5 - -; When this directive is enabled, the OPcache appends the current working -; directory to the script key, thus eliminating possible collisions between -; files with the same name (basename). Disabling the directive improves -; performance, but may break existing applications. -;opcache.use_cwd=1 - -; When disabled, you must reset the OPcache manually or restart the -; webserver for changes to the filesystem to take effect. -;opcache.validate_timestamps=1 - -; How often (in seconds) to check file timestamps for changes to the shared -; memory storage allocation. ("1" means validate once per second, but only -; once per request. "0" means always validate) -;opcache.revalidate_freq=2 - -; Enables or disables file search in include_path optimization -;opcache.revalidate_path=0 - -; If disabled, all PHPDoc comments are dropped from the code to reduce the -; size of the optimized code. -;opcache.save_comments=1 - -; If enabled, a fast shutdown sequence is used for the accelerated code -; Depending on the used Memory Manager this may cause some incompatibilities. -;opcache.fast_shutdown=0 - -; Allow file existence override (file_exists, etc.) performance feature. -;opcache.enable_file_override=0 - -; A bitmask, where each bit enables or disables the appropriate OPcache -; passes -;opcache.optimization_level=0xffffffff - -;opcache.inherited_hack=1 -;opcache.dups_fix=0 - -; The location of the OPcache blacklist file (wildcards allowed). -; Each OPcache blacklist file is a text file that holds the names of files -; that should not be accelerated. The file format is to add each filename -; to a new line. The filename may be a full path or just a file prefix -; (i.e., /var/www/x blacklists all the files and directories in /var/www -; that start with 'x'). Line starting with a ; are ignored (comments). -;opcache.blacklist_filename= - -; Allows exclusion of large files from being cached. By default all files -; are cached. -;opcache.max_file_size=0 - -; Check the cache checksum each N requests. -; The default value of "0" means that the checks are disabled. -;opcache.consistency_checks=0 - -; How long to wait (in seconds) for a scheduled restart to begin if the cache -; is not being accessed. -;opcache.force_restart_timeout=180 - -; OPcache error_log file name. Empty string assumes "stderr". -;opcache.error_log= - -; All OPcache errors go to the Web server log. -; By default, only fatal errors (level 0) or errors (level 1) are logged. -; You can also enable warnings (level 2), info messages (level 3) or -; debug messages (level 4). -;opcache.log_verbosity_level=1 - -; Preferred Shared Memory back-end. Leave empty and let the system decide. -;opcache.preferred_memory_model= - -; Protect the shared memory from unexpected writing during script execution. -; Useful for internal debugging only. -;opcache.protect_memory=0 - -; Allows calling OPcache API functions only from PHP scripts which path is -; started from specified string. The default "" means no restriction -;opcache.restrict_api= - -; Mapping base of shared memory segments (for Windows only). All the PHP -; processes have to map shared memory into the same address space. This -; directive allows to manually fix the "Unable to reattach to base address" -; errors. -;opcache.mmap_base= - -; Enables and sets the second level cache directory. -; It should improve performance when SHM memory is full, at server restart or -; SHM reset. The default "" disables file based caching. -;opcache.file_cache= - -; Enables or disables opcode caching in shared memory. -;opcache.file_cache_only=0 - -; Enables or disables checksum validation when script loaded from file cache. -;opcache.file_cache_consistency_checks=1 - -; Implies opcache.file_cache_only=1 for a certain process that failed to -; reattach to the shared memory (for Windows only). Explicitly enabled file -; cache is required. -;opcache.file_cache_fallback=1 - -; Enables or disables copying of PHP code (text segment) into HUGE PAGES. -; This should improve performance, but requires appropriate OS configuration. -;opcache.huge_code_pages=1 - -; Validate cached file permissions. -;opcache.validate_permission=0 - -; Prevent name collisions in chroot'ed environment. -;opcache.validate_root=0 - -[curl] -; A default value for the CURLOPT_CAINFO option. This is required to be an -; absolute path. -;curl.cainfo = - -[openssl] -; The location of a Certificate Authority (CA) file on the local filesystem -; to use when verifying the identity of SSL/TLS peers. Most users should -; not specify a value for this directive as PHP will attempt to use the -; OS-managed cert stores in its absence. If specified, this value may still -; be overridden on a per-stream basis via the "cafile" SSL stream context -; option. -;openssl.cafile= - -; If openssl.cafile is not specified or if the CA file is not found, the -; directory pointed to by openssl.capath is searched for a suitable -; certificate. This value must be a correctly hashed certificate directory. -; Most users should not specify a value for this directive as PHP will -; attempt to use the OS-managed cert stores in its absence. If specified, -; this value may still be overridden on a per-stream basis via the "capath" -; SSL stream context option. -;openssl.capath= - -; Local Variables: -; tab-width: 4 -; End: -zend_extension = ioncube.so \ No newline at end of file diff --git a/images/php/multiple/conf.d/php5.6.example b/images/php/multiple/conf.d/php5.6.example deleted file mode 100644 index 73e10ba6..00000000 --- a/images/php/multiple/conf.d/php5.6.example +++ /dev/null @@ -1,49 +0,0 @@ -server - { - listen 80; - server_name _; - index index.html index.htm index.php; - root /var/www; - - #error_page 404 /404.html; - location ~ [^/]\.php(/|$) - { - try_files $uri =404; - fastcgi_pass unix:/var/run/php/php5.6-fpm.sock; - # fastcgi_pass 127.0.0.1:9000; - fastcgi_index index.php; - include fastcgi.conf; - set $real_script_name $fastcgi_script_name; - if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { - set $real_script_name $1; - set $path_info $2; - } - fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; - fastcgi_param SCRIPT_NAME $real_script_name; - fastcgi_param PATH_INFO $path_info; - } - - location /nginx_status { - stub_status on; - access_log off; - allow 127.0.0.1; - deny all; - } - - location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ - { - expires 30d; - } - - location ~ .*\.(js|css)?$ - { - expires 12h; - } - - location ~ /\. - { - deny all; - } - - access_log /var/log/nginx/access.log; - } \ No newline at end of file diff --git a/images/php/multiple/conf.d/php7.1.example b/images/php/multiple/conf.d/php7.1.example deleted file mode 100644 index ab92b602..00000000 --- a/images/php/multiple/conf.d/php7.1.example +++ /dev/null @@ -1,49 +0,0 @@ -server - { - listen 80; - server_name _; - index index.html index.htm index.php; - root /var/www; - - #error_page 404 /404.html; - location ~ [^/]\.php(/|$) - { - try_files $uri =404; - fastcgi_pass unix:/var/run/php/php7.1-fpm.sock; - # fastcgi_pass 127.0.0.1:9000; - fastcgi_index index.php; - include fastcgi.conf; - set $real_script_name $fastcgi_script_name; - if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { - set $real_script_name $1; - set $path_info $2; - } - fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; - fastcgi_param SCRIPT_NAME $real_script_name; - fastcgi_param PATH_INFO $path_info; - } - - location /nginx_status { - stub_status on; - access_log off; - allow 127.0.0.1; - deny all; - } - - location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ - { - expires 30d; - } - - location ~ .*\.(js|css)?$ - { - expires 12h; - } - - location ~ /\. - { - deny all; - } - - access_log /var/log/nginx/access.log; - } \ No newline at end of file diff --git a/images/php/multiple/conf.d/php7.2.example b/images/php/multiple/conf.d/php7.2.example deleted file mode 100644 index 8b504d24..00000000 --- a/images/php/multiple/conf.d/php7.2.example +++ /dev/null @@ -1,49 +0,0 @@ -server - { - listen 80; - server_name _; - index index.html index.htm index.php; - root /var/www; - - #error_page 404 /404.html; - location ~ [^/]\.php(/|$) - { - try_files $uri =404; - fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; - # fastcgi_pass 127.0.0.1:9000; - fastcgi_index index.php; - include fastcgi.conf; - set $real_script_name $fastcgi_script_name; - if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { - set $real_script_name $1; - set $path_info $2; - } - fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; - fastcgi_param SCRIPT_NAME $real_script_name; - fastcgi_param PATH_INFO $path_info; - } - - location /nginx_status { - stub_status on; - access_log off; - allow 127.0.0.1; - deny all; - } - - location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ - { - expires 30d; - } - - location ~ .*\.(js|css)?$ - { - expires 12h; - } - - location ~ /\. - { - deny all; - } - - access_log /var/log/nginx/access.log; - } \ No newline at end of file diff --git a/images/php/multiple/conf.d/php7.3.example b/images/php/multiple/conf.d/php7.3.example deleted file mode 100644 index 56dd94a0..00000000 --- a/images/php/multiple/conf.d/php7.3.example +++ /dev/null @@ -1,49 +0,0 @@ -server - { - listen 80; - server_name _; - index index.html index.htm index.php; - root /var/www; - - #error_page 404 /404.html; - location ~ [^/]\.php(/|$) - { - try_files $uri =404; - fastcgi_pass unix:/var/run/php/php7.3-fpm.sock; - # fastcgi_pass 127.0.0.1:9000; - fastcgi_index index.php; - include fastcgi.conf; - set $real_script_name $fastcgi_script_name; - if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { - set $real_script_name $1; - set $path_info $2; - } - fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; - fastcgi_param SCRIPT_NAME $real_script_name; - fastcgi_param PATH_INFO $path_info; - } - - location /nginx_status { - stub_status on; - access_log off; - allow 127.0.0.1; - deny all; - } - - location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ - { - expires 30d; - } - - location ~ .*\.(js|css)?$ - { - expires 12h; - } - - location ~ /\. - { - deny all; - } - - access_log /var/log/nginx/access.log; - } \ No newline at end of file diff --git a/images/php/multiple/script/env.sh b/images/php/multiple/script/env.sh deleted file mode 100644 index 63589a15..00000000 --- a/images/php/multiple/script/env.sh +++ /dev/null @@ -1,382 +0,0 @@ -#!/usr/bin/env bash -export DEBIAN_FRONTEND=noninteractive - -# Update Package && System -apt-get update -y --fix-missing -apt-get -y upgrade -apt-get install -y software-properties-common wget curl locales make gcc g++ gawk libyaml-dev - -# Force Locale -echo "LC_ALL=en_US.UTF-8" >> /etc/default/locale - -# Install Some PPAs -apt-add-repository ppa:nginx/development -y -apt-add-repository ppa:ondrej/php -y - -#Install WebServer -apt-get install -y nginx - -# Install PHP Stuffs -# PHP 7.3 -# apt-get install -y --allow-downgrades --allow-remove-essential --allow-change-held-packages \ -# php7.3-fpm php7.3-cli php7.3-dev php7.3-pgsql php7.3-sqlite3 php7.3-gd php7.3-curl php7.3-imap \ -# php7.3-mysql php7.3-mbstring php7.3-xml php7.3-zip php7.3-bcmath php7.3-soap php7.3-intl php7.3-readline - -# PHP 7.2 -apt-get install -y --allow-downgrades --allow-remove-essential --allow-change-held-packages \ -php7.2-fpm php7.2-cli php7.2-dev php7.2-pgsql php7.2-sqlite3 php7.2-gd php7.2-curl php7.2-memcached php7.2-imap \ -php7.2-mysql php7.2-mbstring php7.2-xml php7.2-zip php7.2-bcmath php7.2-soap php7.2-intl php7.2-readline php7.2-ldap \ -php-xdebug php-pear - -# PHP 7.1 -# apt-get install -y --allow-downgrades --allow-remove-essential --allow-change-held-packages \ -# php7.1-fpm php7.1-cli php7.1-dev php7.1-pgsql php7.1-sqlite3 php7.1-gd php7.1-curl php7.1-memcached php7.1-imap php7.1-mysql \ -# php7.1-mbstring php7.1-xml php7.1-zip php7.1-bcmath php7.1-soap php7.1-intl php7.1-readline - -# PHP 7.0 -# apt-get install -y --allow-downgrades --allow-remove-essential --allow-change-held-packages \ -# php7.0-fpm php7.0-cli php7.0-dev php7.0-pgsql php7.0-sqlite3 php7.0-gd php7.0-curl php7.0-memcached \ -# php7.0-imap php7.0-mysql php7.0-mbstring php7.0-xml php7.0-zip php7.0-bcmath php7.0-soap php7.0-intl php7.0-readline - -# PHP 5.6 -apt-get install -y --allow-downgrades --allow-remove-essential --allow-change-held-packages \ -php5.6-fpm php5.6-cli php5.6-dev php5.6-pgsql php5.6-sqlite3 php5.6-gd php5.6-curl php5.6-memcached \ -php5.6-imap php5.6-mysql php5.6-mbstring php5.6-xml php5.6-zip php5.6-bcmath php5.6-soap php5.6-intl \ -php5.6-readline php5.6-mcrypt - -# Setup Some PHP-FPM Options -# echo "xdebug.remote_enable = 1" >> /etc/php/7.3/mods-available/xdebug.ini -# echo "xdebug.remote_connect_back = 1" >> /etc/php/7.3/mods-available/xdebug.ini -# echo "xdebug.remote_port = 9000" >> /etc/php/7.3/mods-available/xdebug.ini -# echo "xdebug.max_nesting_level = 512" >> /etc/php/7.3/mods-available/xdebug.ini -# echo "opcache.revalidate_freq = 0" >> /etc/php/7.3/mods-available/opcache.ini - -echo "xdebug.remote_enable = 1" >> /etc/php/7.2/mods-available/xdebug.ini -echo "xdebug.remote_connect_back = 1" >> /etc/php/7.2/mods-available/xdebug.ini -echo "xdebug.remote_port = 9000" >> /etc/php/7.2/mods-available/xdebug.ini -echo "xdebug.max_nesting_level = 512" >> /etc/php/7.2/mods-available/xdebug.ini -echo "opcache.revalidate_freq = 0" >> /etc/php/7.2/mods-available/opcache.ini - -# echo "xdebug.remote_enable = 1" >> /etc/php/7.1/mods-available/xdebug.ini -# echo "xdebug.remote_connect_back = 1" >> /etc/php/7.1/mods-available/xdebug.ini -# echo "xdebug.remote_port = 9000" >> /etc/php/7.1/mods-available/xdebug.ini -# echo "xdebug.max_nesting_level = 512" >> /etc/php/7.1/mods-available/xdebug.ini -# echo "opcache.revalidate_freq = 0" >> /etc/php/7.1/mods-available/opcache.ini - -# echo "xdebug.remote_enable = 1" >> /etc/php/7.0/mods-available/xdebug.ini -# echo "xdebug.remote_connect_back = 1" >> /etc/php/7.0/mods-available/xdebug.ini -# echo "xdebug.remote_port = 9000" >> /etc/php/7.0/mods-available/xdebug.ini -# echo "xdebug.max_nesting_level = 512" >> /etc/php/7.0/mods-available/xdebug.ini -# echo "opcache.revalidate_freq = 0" >> /etc/php/7.0/mods-available/opcache.ini - -echo "xdebug.remote_enable = 1" >> /etc/php/5.6/mods-available/xdebug.ini -echo "xdebug.remote_connect_back = 1" >> /etc/php/5.6/mods-available/xdebug.ini -echo "xdebug.remote_port = 9000" >> /etc/php/5.6/mods-available/xdebug.ini -echo "xdebug.max_nesting_level = 512" >> /etc/php/5.6/mods-available/xdebug.ini -echo "opcache.revalidate_freq = 0" >> /etc/php/5.6/mods-available/opcache.ini - -# sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.3/fpm/php.ini -# sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.3/fpm/php.ini -# sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/7.3/fpm/php.ini -# sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.3/fpm/php.ini -# sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/7.3/fpm/php.ini -# sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/7.3/fpm/php.ini -# sed -i "s/max_file_uploads = .*/max_file_uploads = 5120/" /etc/php/7.3/fpm/php.ini -# sed -i "s/;date.timezone.*/date.timezone = RPC/" /etc/php/7.3/fpm/php.ini - -# printf "[openssl]\n" | tee -a /etc/php/7.3/fpm/php.ini -# printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.3/fpm/php.ini - -# printf "[curl]\n" | tee -a /etc/php/7.3/fpm/php.ini -# printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.3/fpm/php.ini - -sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.2/fpm/php.ini -sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.2/fpm/php.ini -sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/7.2/fpm/php.ini -sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.2/fpm/php.ini -sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/7.2/fpm/php.ini -sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/7.2/fpm/php.ini -sed -i "s/max_file_uploads = .*/max_file_uploads = 5120/" /etc/php/7.2/fpm/php.ini -sed -i "s/;date.timezone.*/date.timezone = RPC/" /etc/php/7.2/fpm/php.ini - -printf "[openssl]\n" | tee -a /etc/php/7.2/fpm/php.ini -printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.2/fpm/php.ini - -printf "[curl]\n" | tee -a /etc/php/7.2/fpm/php.ini -printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.2/fpm/php.ini - -# sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.1/fpm/php.ini -# sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.1/fpm/php.ini -# sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/7.1/fpm/php.ini -# sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.1/fpm/php.ini -# sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/7.1/fpm/php.ini -# sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/7.1/fpm/php.ini -# sed -i "s/max_file_uploads = .*/max_file_uploads = 5120/" /etc/php/7.1/fpm/php.ini -# sed -i "s/;date.timezone.*/date.timezone = RPC/" /etc/php/7.1/fpm/php.ini - -# printf "[openssl]\n" | tee -a /etc/php/7.1/fpm/php.ini -# printf "openssl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.1/fpm/php.ini - -# printf "[curl]\n" | tee -a /etc/php/7.1/fpm/php.ini -# printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.1/fpm/php.ini - -# sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.0/fpm/php.ini -# sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.0/fpm/php.ini -# sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/7.0/fpm/php.ini -# sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.0/fpm/php.ini -# sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/7.0/fpm/php.ini -# sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/7.0/fpm/php.ini -# sed -i "s/max_file_uploads = .*/max_file_uploads = 5120/" /etc/php/7.0/fpm/php.ini -# sed -i "s/;date.timezone.*/date.timezone = RPC/" /etc/php/7.0/fpm/php.ini - -# printf "[curl]\n" | tee -a /etc/php/7.0/fpm/php.ini -# printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/7.0/fpm/php.ini - -sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/5.6/fpm/php.ini -sed -i "s/display_errors = .*/display_errors = On/" /etc/php/5.6/fpm/php.ini -sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/5.6/fpm/php.ini -sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/5.6/fpm/php.ini -sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/5.6/fpm/php.ini -sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/5.6/fpm/php.ini -sed -i "s/max_file_uploads = .*/max_file_uploads = 5120/" /etc/php/5.6/fpm/php.ini -sed -i "s/;date.timezone.*/date.timezone = RPC/" /etc/php/5.6/fpm/php.ini - -printf "[curl]\n" | tee -a /etc/php/5.6/fpm/php.ini -printf "curl.cainfo = /etc/ssl/certs/ca-certificates.crt\n" | tee -a /etc/php/5.6/fpm/php.ini - -cat > /etc/nginx/fastcgi_params << EOF -fastcgi_param QUERY_STRING \$query_string; -fastcgi_param REQUEST_METHOD \$request_method; -fastcgi_param CONTENT_TYPE \$content_type; -fastcgi_param CONTENT_LENGTH \$content_length; -fastcgi_param SCRIPT_FILENAME \$request_filename; -fastcgi_param SCRIPT_NAME \$fastcgi_script_name; -fastcgi_param REQUEST_URI \$request_uri; -fastcgi_param DOCUMENT_URI \$document_uri; -fastcgi_param DOCUMENT_ROOT \$document_root; -fastcgi_param SERVER_PROTOCOL \$server_protocol; -fastcgi_param GATEWAY_INTERFACE CGI/1.1; -fastcgi_param SERVER_SOFTWARE nginx/\$nginx_version; -fastcgi_param REMOTE_ADDR \$remote_addr; -fastcgi_param REMOTE_PORT \$remote_port; -fastcgi_param SERVER_ADDR \$server_addr; -fastcgi_param SERVER_PORT \$server_port; -fastcgi_param SERVER_NAME \$server_name; -fastcgi_param HTTPS \$https if_not_empty; -fastcgi_param REDIRECT_STATUS 200; -EOF - -# Custom Config -# rm -fr /etc/nginx/nginx.conf -rm -fr /etc/nginx/sites-enabled -rm -fr /etc/nginx/sites-available - -chmod 755 -R /var/www -chown -R www-data:www-data /var/www - -php56() { - update-alternatives --set php /usr/bin/php5.6 - update-alternatives --set php-config /usr/bin/php-config5.6 - update-alternatives --set phpize /usr/bin/phpize5.6 -} - -# php70() { -# update-alternatives --set php /usr/bin/php7.0 -# update-alternatives --set php-config /usr/bin/php-config7.0 -# update-alternatives --set phpize /usr/bin/phpize7.0 -# } - -# php71() { -# update-alternatives --set php /usr/bin/php7.1 -# update-alternatives --set php-config /usr/bin/php-config7.1 -# update-alternatives --set phpize /usr/bin/phpize7.1 -# } - -php72() { - update-alternatives --set php /usr/bin/php7.2 - update-alternatives --set php-config /usr/bin/php-config7.2 - update-alternatives --set phpize /usr/bin/phpize7.2 -} - -# php73() { -# update-alternatives --set php /usr/bin/php7.3 -# update-alternatives --set php-config /usr/bin/php-config7.3 -# update-alternatives --set phpize /usr/bin/phpize7.3 -# } - -ioncube(){ - wget https://coding.net/u/imxieke/p/attachment/git/raw/master/ioncube/ioncube_loader_lin_7.2.so -O /usr/lib/php/20170718/ioncube.so - # wget https://coding.net/u/imxieke/p/attachment/git/raw/master/ioncube/ioncube_loader_lin_7.1.so -O /usr/lib/php/20160303/ioncube.so - # wget https://coding.net/u/imxieke/p/attachment/git/raw/master/ioncube/ioncube_loader_lin_7.0.so -O /usr/lib/php/20151012/ioncube.so - wget https://coding.net/u/imxieke/p/attachment/git/raw/master/ioncube/ioncube_loader_lin_5.6.so -O /usr/lib/php/20131226/ioncube.so - - echo "zend_extension = ioncube.so" >> /etc/php/7.2/cli/php.ini - echo "zend_extension = ioncube.so" >> /etc/php/7.2/fpm/php.ini - - # echo "zend_extension = ioncube.so" >> /etc/php/7.1/cli/php.ini - # echo "zend_extension = ioncube.so" >> /etc/php/7.1/fpm/php.ini - - # echo "zend_extension = ioncube.so" >> /etc/php/7.0/cli/php.ini - # echo "zend_extension = ioncube.so" >> /etc/php/7.0/fpm/php.ini - - echo "zend_extension = ioncube.so" >> /etc/php/5.6/cli/php.ini - echo "zend_extension = ioncube.so" >> /etc/php/5.6/fpm/php.ini -} - -# Install PHP Extensions -yaml(){ - PHPVER=$1 - cd $BUILD_DIR - PKG_NAME="yaml" - PKG_VER="2.0.2" - wget https://coding.net/u/imxieke/p/attachment/git/raw/master/src/${PKG_NAME}-${PKG_VER}.tgz - tar zxvf ${PKG_NAME}-${PKG_VER}.tgz && cd ${PKG_NAME}-${PKG_VER} - phpize && ./configure && make -j4 && make install - echo "extension=${PKG_NAME}.so" > /etc/php/${PHPVER}/cli/conf.d/${PKG_NAME}.ini - echo "extension=${PKG_NAME}.so" > /etc/php/${PHPVER}/fpm/conf.d/${PKG_NAME}.ini - cd .. && rm -fr ${PKG_NAME}-${PKG_VER} -} - -yaconf(){ - PHPVER=$1 - cd $BUILD_DIR - PKG_NAME="yaconf" - PKG_VER="1.0.7" - wget https://coding.net/u/imxieke/p/attachment/git/raw/master/src/${PKG_NAME}-${PKG_VER}.tgz - tar zxvf ${PKG_NAME}-${PKG_VER}.tgz && cd ${PKG_NAME}-${PKG_VER} - phpize && ./configure && make -j4 && make install - echo "extension=${PKG_NAME}.so" > /etc/php/${PHPVER}/cli/conf.d/${PKG_NAME}.ini - echo "extension=${PKG_NAME}.so" > /etc/php/${PHPVER}/fpm/conf.d/${PKG_NAME}.ini - cd .. && rm -fr ${PKG_NAME}-${PKG_VER} -} - -yaf(){ - PHPVER=$1 - cd $BUILD_DIR - PKG_NAME="yaf" - PKG_VER="3.0.7" - wget https://coding.net/u/imxieke/p/attachment/git/raw/master/src/${PKG_NAME}-${PKG_VER}.tgz - tar zxvf ${PKG_NAME}-${PKG_VER}.tgz && cd ${PKG_NAME}-${PKG_VER} - phpize && ./configure && make -j4 && make install - echo "extension=${PKG_NAME}.so" > /etc/php/${PHPVER}/cli/conf.d/${PKG_NAME}.ini - echo "extension=${PKG_NAME}.so" > /etc/php/${PHPVER}/fpm/conf.d/${PKG_NAME}.ini - cd .. && rm -fr ${PKG_NAME}-${PKG_VER} -} - -mongodb(){ - PHPVER=$1 - cd $BUILD_DIR - PKG_NAME='mongodb' - PKG_VER="1.5.1" - wget https://coding.net/u/imxieke/p/attachment/git/raw/master/src/${PKG_NAME}-${PKG_VER}.tgz - tar zxvf ${PKG_NAME}-${PKG_VER}.tgz && cd ${PKG_NAME}-${PKG_VER} - phpize && ./configure && make -j4 && make install - echo "extension=${PKG_NAME}.so" > /etc/php/${PHPVER}/cli/conf.d/${PKG_NAME}.ini - echo "extension=${PKG_NAME}.so" > /etc/php/${PHPVER}/fpm/conf.d/${PKG_NAME}.ini - cd .. && rm -fr ${PKG_NAME}-${PKG_VER} -} - -redis(){ - PHPVER=$1 - cd $BUILD_DIR - PKG_NAME="redis" - PKG_VER="4.1.0" - wget https://coding.net/u/imxieke/p/attachment/git/raw/master/src/${PKG_NAME}-${PKG_VER}.tgz - tar zxvf ${PKG_NAME}-${PKG_VER}.tgz && cd ${PKG_NAME}-${PKG_VER} - phpize && ./configure && make -j4 && make install - echo "extension=${PKG_NAME}.so" > /etc/php/${PHPVER}/cli/conf.d/${PKG_NAME}.ini - echo "extension=${PKG_NAME}.so" > /etc/php/${PHPVER}/fpm/conf.d/${PKG_NAME}.ini - cd .. && rm -fr ${PKG_NAME}-${PKG_VER} -} - -rar(){ - PHPVER=$1 - cd $BUILD_DIR - PKG_NAME="rar" - PKG_VER="4.0.0" - wget https://coding.net/u/imxieke/p/attachment/git/raw/master/src/${PKG_NAME}-${PKG_VER}.tgz - tar zxvf ${PKG_NAME}-${PKG_VER}.tgz && cd ${PKG_NAME}-${PKG_VER} - phpize && ./configure && make -j4 && make install - echo "extension=${PKG_NAME}.so" > /etc/php/${PHPVER}/cli/conf.d/${PKG_NAME}.ini - echo "extension=${PKG_NAME}.so" > /etc/php/${PHPVER}/fpm/conf.d/${PKG_NAME}.ini - cd .. && rm -fr ${PKG_NAME}-${PKG_VER} -} - -swoole(){ - PHPVER=$1 - cd $BUILD_DIR - PKG_NAME="swoole" - PKG_VER="4.0.1" - wget https://coding.net/u/imxieke/p/attachment/git/raw/master/src/${PKG_NAME}-${PKG_VER}.tgz - tar zxvf ${PKG_NAME}-${PKG_VER}.tgz && cd ${PKG_NAME}-${PKG_VER} - phpize && ./configure && make -j4 && make install - echo "extension=${PKG_NAME}.so" > /etc/php/${PHPVER}/cli/conf.d/${PKG_NAME}.ini - echo "extension=${PKG_NAME}.so" > /etc/php/${PHPVER}/fpm/conf.d/${PKG_NAME}.ini - cd .. && rm -fr ${PKG_NAME}-${PKG_VER} -} - -php56ext(){ - php56 - mongodb 5.6 - redis 5.6 - rar 5.6 -} - -# php70ext(){ -# php70 -# yaml 7.0 -# yaconf 7.0 -# yaf 7.0 -# mongodb 7.0 -# redis 7.0 -# rar 7.0 -# swoole 7.0 -# } - -# php71ext(){ -# php71 -# yaml 7.1 -# yaconf 7.1 -# yaf 7.1 -# mongodb 7.1 -# redis 7.1 -# rar 7.1 -# swoole 7.1 -# } - -php72ext(){ - php72 - yaconf 7.2 - yaf 7.2 - yaml 7.2 - mongodb 7.2 - redis 7.2 - rar 7.2 - swoole 7.2 -} - -# php73ext(){ -# php73 -# mongodb 7.3 -# redis 7.3 -# swoole 7.3 -# } - -install_ext(){ - BUILD_DIR="/tmp/phpbuild" - mkdir -p $BUILD_DIR - cd $BUILD_DIR - ioncube - php56ext - # php70ext - # php71ext - php72ext - # php73ext -} - -install_ext -apt purge -y make gcc g++ gawk wget curl -rm -fr /tmp/* -apt autoremove -y -apt-get clean all -rm -fr /var/lib/apt/lists/* \ No newline at end of file diff --git a/images/php/multiple/script/start.sh b/images/php/multiple/script/start.sh deleted file mode 100644 index 45a17872..00000000 --- a/images/php/multiple/script/start.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -# service php7.3-fpm start -service php7.2-fpm start -# service php7.1-fpm start -# service php7.0-fpm start -service php5.6-fpm start -service nginx start -tail -f /var/log/nginx/access.log \ No newline at end of file diff --git a/images/php/script/build.sh b/images/php/script/build.sh deleted file mode 100644 index 4ae5f27f..00000000 --- a/images/php/script/build.sh +++ /dev/null @@ -1,141 +0,0 @@ -#!/usr/bin/env bash - -msgpack(){ - cd /tmp/phpbuild - PKG_NAME="msgpack" - PKG_VER="2.0.2" - wget https://coding.net/u/imxieke/p/attachment/git/raw/master/src/${PKG_NAME}-${PKG_VER}.tgz - tar zxvf ${PKG_NAME}-${PKG_VER}.tgz && cd ${PKG_NAME}-${PKG_VER} - phpize && ./configure && make -j4 && make install - echo "extension=${PKG_NAME}.so" > /etc/php/7.2/cli/conf.d/${PKG_NAME}.ini - echo "extension=${PKG_NAME}.so" > /etc/php/7.2/fpm/conf.d/${PKG_NAME}.ini -} - -yaml(){ - cd /tmp/phpbuild - PKG_NAME="yaml" - PKG_VER="2.0.2" - wget https://coding.net/u/imxieke/p/attachment/git/raw/master/src/${PKG_NAME}-${PKG_VER}.tgz - tar zxvf ${PKG_NAME}-${PKG_VER}.tgz && cd ${PKG_NAME}-${PKG_VER} - phpize && ./configure && make -j4 && make install - echo "extension=${PKG_NAME}.so" > /etc/php/7.2/cli/conf.d/${PKG_NAME}.ini - echo "extension=${PKG_NAME}.so" > /etc/php/7.2/fpm/conf.d/${PKG_NAME}.ini -} - -yar(){ - cd /tmp/phpbuild - PKG_NAME="yar" - PKG_VER="2.0.4" - wget https://coding.net/u/imxieke/p/attachment/git/raw/master/src/${PKG_NAME}-${PKG_VER}.tgz - tar zxvf ${PKG_NAME}-${PKG_VER}.tgz && cd ${PKG_NAME}-${PKG_VER} - phpize && ./configure --enable-msgpack && make -j4 && make install - echo "extension=${PKG_NAME}.so" > /etc/php/7.2/cli/conf.d/${PKG_NAME}.ini - echo "extension=${PKG_NAME}.so" > /etc/php/7.2/fpm/conf.d/${PKG_NAME}.ini -} - -mongodb(){ - # wget http://pecl.php.net/get/mongodb-1.5.1.tgz - cd /tmp/phpbuild - PKG_NAME='mongodb' - PKG_VER="1.5.1" - wget https://coding.net/u/imxieke/p/attachment/git/raw/master/src/${PKG_NAME}-${PKG_VER}.tgz - tar zxvf ${PKG_NAME}-${PKG_VER}.tgz && cd ${PKG_NAME}-${PKG_VER} - phpize && ./configure && make -j4 && make install - echo "extension=${PKG_NAME}.so" > /etc/php/7.2/cli/conf.d/${PKG_NAME}.ini - echo "extension=${PKG_NAME}.so" > /etc/php/7.2/fpm/conf.d/${PKG_NAME}.ini -} - -redis(){ - cd /tmp/phpbuild - PKG_NAME="redis" - PKG_VER="4.1.0" - wget https://coding.net/u/imxieke/p/attachment/git/raw/master/src/${PKG_NAME}-${PKG_VER}.tgz - tar zxvf ${PKG_NAME}-${PKG_VER}.tgz && cd ${PKG_NAME}-${PKG_VER} - phpize && ./configure && make -j4 && make install - echo "extension=${PKG_NAME}.so" > /etc/php/7.2/cli/conf.d/${PKG_NAME}.ini - echo "extension=${PKG_NAME}.so" > /etc/php/7.2/fpm/conf.d/${PKG_NAME}.ini -} - -rar(){ - cd /tmp/phpbuild - PKG_NAME="rar" - PKG_VER="4.0.0" - wget https://coding.net/u/imxieke/p/attachment/git/raw/master/src/${PKG_NAME}-${PKG_VER}.tgz - tar zxvf ${PKG_NAME}-${PKG_VER}.tgz && cd ${PKG_NAME}-${PKG_VER} - phpize && ./configure && make -j4 && make install - echo "extension=${PKG_NAME}.so" > /etc/php/7.2/cli/conf.d/${PKG_NAME}.ini - echo "extension=${PKG_NAME}.so" > /etc/php/7.2/fpm/conf.d/${PKG_NAME}.ini - # wget https://pecl.php.net/get/rar-4.0.0.tgz -} - -swoole(){ - cd /tmp/phpbuild - PKG_NAME="swoole" - PKG_VER="4.0.1" - wget https://coding.net/u/imxieke/p/attachment/git/raw/master/src/${PKG_NAME}-${PKG_VER}.tgz - tar zxvf ${PKG_NAME}-${PKG_VER}.tgz && cd ${PKG_NAME}-${PKG_VER} - phpize && ./configure && make -j4 && make install - echo "extension=${PKG_NAME}.so" > /etc/php/7.2/cli/conf.d/${PKG_NAME}.ini - echo "extension=${PKG_NAME}.so" > /etc/php/7.2/fpm/conf.d/${PKG_NAME}.ini -} - -mcrypt(){ - cd /tmp/phpbuild - PKG_NAME="mcrypt" - PKG_VER="1.0.1" - # wget https://pecl.php.net/get/mcrypt-1.0.1.tgz - wget https://coding.net/u/imxieke/p/attachment/git/raw/master/src/${PKG_NAME}-${PKG_VER}.tgz - tar zxvf ${PKG_NAME}-${PKG_VER}.tgz && cd ${PKG_NAME}-${PKG_VER} - phpize && ./configure && make -j4 && make install - echo "extension=${PKG_NAME}.so" > /etc/php/7.2/cli/conf.d/${PKG_NAME}.ini - echo "extension=${PKG_NAME}.so" > /etc/php/7.2/fpm/conf.d/${PKG_NAME}.ini -} - -ioncube(){ - wget https://coding.net/u/imxieke/p/attachment/git/raw/master/ioncube/ioncube_loader_lin_7.2.so -O /usr/lib/php/20170718/ioncube.so - echo "zend_extension = ioncube.so" >> /etc/php/7.2/cli/php.ini - echo "zend_extension = ioncube.so" >> /etc/php/7.2/fpm/php.ini -} - -install_ext(){ - - apt update -y --fix-missing - apt install -y apt-utils - apt install -y --no-install-recommends nginx php7.2-fpm php-memcache php-memcached php7.2-dev \ - php7.2-bcmath php7.2-bz2 php7.2-curl php7.2-dba php7.2-enchant php7.2-gd php7.2-gmp php7.2-imap \ - php7.2-intl php7.2-json php7.2-ldap php7.2-zip php7.2-mbstring php7.2-mysql php7.2-odbc php7.2-pgsql \ - php7.2-readline php7.2-recode php7.2-soap php7.2-sqlite3 php7.2-tidy php7.2-xml php7.2-xmlrpc php7.2-xsl \ - php7.2-zip libmcrypt-dev wget make g++ ca-certificates libyaml-dev - rm -fr /etc/nginx/nginx.conf - rm -fr /etc/nginx/conf.d/* - mkdir -p /run/nginx/ - chmod 755 -R /var/www - chown -R www-data:www-data /var/www - chmod +x /bin/phpenv - apt autoremove -y - apt-get clean all - rm -fr /var/lib/apt/lists/* - - mkdir -p /tmp/phpbuild - # msgpack - yaf - yaml - # yar - mongodb - redis - rar - swoole - mcrypt - ioncube - apt purge -y g++ make wget - rm -fr /tmp/* -} - -install_ext -echo " -#!/usr/bin/env bash -service php7.2-fpm start >> /tmp/phpenv.log -service nginx start >> /tmp/phpenv.log -tail -f /var/log/nginx/access.log" > /bin/phpenv - -chmod +x /bin/phpenv diff --git a/images/php/script/tz.php b/images/php/script/tz.php deleted file mode 100644 index 259d40ff..00000000 --- a/images/php/script/tz.php +++ /dev/null @@ -1,1473 +0,0 @@ -=0; $l--) - { - $allsize1[$l]=floor($size/pow(1024,$l)); - $allsize[$l]=$allsize1[$l]-$allsize1[$l+1]*1024; - } - - $len=count($allsize); - - for($j = $len-1; $j >=0; $j--) - { - $fsize=$fsize.$allsize[$j].$danwei[$j]; - } - return $fsize; -} - -function valid_email($str) -{ - return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE; -} - -//检测PHP设置参数 -function show($varName) -{ - switch($result = get_cfg_var($varName)) - { - case 0: - return '×'; - break; - - case 1: - return ''; - break; - - default: - return $result; - break; - } -} - -//保留服务器性能测试结果 -$valInt = isset($_POST['pInt']) ? $_POST['pInt'] : "No Test"; -$valFloat = isset($_POST['pFloat']) ? $_POST['pFloat'] : "No Test"; -$valIo = isset($_POST['pIo']) ? $_POST['pIo'] : "No Test"; - -if ($_GET['act'] == "phpinfo") -{ - phpinfo(); - exit(); -} -elseif($_POST['act'] == "Int Test") -{ - $valInt = test_int(); -} -elseif($_POST['act'] == "Float Test") -{ - $valFloat = test_float(); -} -elseif($_POST['act'] == "IO Test") -{ - $valIo = test_io(); -} -//网速测试-开始 -elseif($_POST['act']=="Start Test") -{ -?> - - "; - } - ?> - -"; - Echo "This shows all the functions supported by the system, and custom functions\n"; - print_r($arr); - echo ""; - exit(); -}elseif($_GET['act'] == "disable_functions") -{ - $disFuns=get_cfg_var("disable_functions"); - if(empty($disFuns)) - { - $arr = '×'; - } - else - { - $arr = $disFuns; - } - Function php() - { - } - echo "
";
-	Echo "This shows all the functions disable by the system\n";
-	print_r($arr);
-	echo "
"; - exit(); -} - -//MySQL检测 -if ($_POST['act'] == 'MySQL Test') -{ - $host = isset($_POST['host']) ? trim($_POST['host']) : ''; - $port = isset($_POST['port']) ? (int) $_POST['port'] : ''; - $login = isset($_POST['login']) ? trim($_POST['login']) : ''; - $password = isset($_POST['password']) ? trim($_POST['password']) : ''; - $host = preg_match('~[^a-z0-9\-\.]+~i', $host) ? '' : $host; - $port = intval($port) ? intval($port) : ''; - $login = preg_match('~[^a-z0-9\_\-]+~i', $login) ? '' : htmlspecialchars($login); - $password = is_string($password) ? htmlspecialchars($password) : ''; -} -elseif ($_POST['act'] == 'Function Test') -{ - $funRe = "Function".$_POST['funName']."Test results support the position: ".isfun1($_POST['funName']); -} -elseif ($_POST['act'] == 'Mail Test') -{ - $mailRe = "Mail test results: send"; - if($_SERVER['SERVER_PORT']==80){$mailContent = "http://".$_SERVER['SERVER_NAME'].($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']);} - else{$mailContent = "http://".$_SERVER['SERVER_NAME'].":".$_SERVER['SERVER_PORT'].($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']);} - $mailRe .= (false !== @mail($_POST["mailAdd"], $mailContent, "This is a test mail!")) ? "Complete":"Failure"; -} - -//网络速度测试 -if(isset($_POST['speed'])) -{ - $speed=round(100/($_POST['speed']/1000),2); -} -elseif($_GET['speed']=="0") -{ - $speed=6666.67; -} -elseif(isset($_GET['speed']) and $_GET['speed']>0) -{ - $speed=round(100/($_GET['speed']/1000),2); //下载速度: $speed kb/s -} -else -{ - $speed=" No Test "; -} - - -// 检测函数支持 -function isfun($funName = '') -{ - if (!$funName || trim($funName) == '' || preg_match('~[^a-z0-9\_]+~i', $funName, $tmp)) return '错误'; - return (false !== function_exists($funName)) ? '' : '×'; -} -function isfun1($funName = '') -{ - if (!$funName || trim($funName) == '' || preg_match('~[^a-z0-9\_]+~i', $funName, $tmp)) return '错误'; - return (false !== function_exists($funName)) ? '√' : '×'; -} - -//整数运算能力测试 -function test_int() -{ - $timeStart = gettimeofday(); - for($i = 0; $i < 3000000; $i++) - { - $t = 1+1; - } - $timeEnd = gettimeofday(); - $time = ($timeEnd["usec"]-$timeStart["usec"])/1000000+$timeEnd["sec"]-$timeStart["sec"]; - $time = round($time, 3)." Second"; - return $time; -} - -//浮点运算能力测试 -function test_float() -{ - //得到圆周率值 - $t = pi(); - $timeStart = gettimeofday(); - - for($i = 0; $i < 3000000; $i++) - { - //开平方 - sqrt($t); - } - - $timeEnd = gettimeofday(); - $time = ($timeEnd["usec"]-$timeStart["usec"])/1000000+$timeEnd["sec"]-$timeStart["sec"]; - $time = round($time, 3)."Second"; - return $time; -} - -//IO能力测试 -function test_io() -{ - $fp = @fopen(PHPSELF, "r"); - $timeStart = gettimeofday(); - for($i = 0; $i < 10000; $i++) - { - @fread($fp, 10240); - @rewind($fp); - } - $timeEnd = gettimeofday(); - @fclose($fp); - $time = ($timeEnd["usec"]-$timeStart["usec"])/1000000+$timeEnd["sec"]-$timeStart["sec"]; - $time = round($time, 3)."Second"; - return($time); -} - -function GetCoreInformation() {$data = file('/proc/stat');$cores = array();foreach( $data as $line ) {if( preg_match('/^cpu[0-9]/', $line) ){$info = explode(' ', $line);$cores[]=array('user'=>$info[1],'nice'=>$info[2],'sys' => $info[3],'idle'=>$info[4],'iowait'=>$info[5],'irq' => $info[6],'softirq' => $info[7]);}}return $cores;} -function GetCpuPercentages($stat1, $stat2) {if(count($stat1)!==count($stat2)){return;}$cpus=array();for( $i = 0, $l = count($stat1); $i < $l; $i++) { $dif = array(); $dif['user'] = $stat2[$i]['user'] - $stat1[$i]['user'];$dif['nice'] = $stat2[$i]['nice'] - $stat1[$i]['nice']; $dif['sys'] = $stat2[$i]['sys'] - $stat1[$i]['sys'];$dif['idle'] = $stat2[$i]['idle'] - $stat1[$i]['idle'];$dif['iowait'] = $stat2[$i]['iowait'] - $stat1[$i]['iowait'];$dif['irq'] = $stat2[$i]['irq'] - $stat1[$i]['irq'];$dif['softirq'] = $stat2[$i]['softirq'] - $stat1[$i]['softirq'];$total = array_sum($dif);$cpu = array();foreach($dif as $x=>$y) $cpu[$x] = round($y / $total * 100, 2);$cpus['cpu' . $i] = $cpu;}return $cpus;} -$stat1 = GetCoreInformation();sleep(1);$stat2 = GetCoreInformation();$data = GetCpuPercentages($stat1, $stat2); -$cpu_show = $data['cpu0']['user']."%us, ".$data['cpu0']['sys']."%sy, ".$data['cpu0']['nice']."%ni, ".$data['cpu0']['idle']."%id, ".$data['cpu0']['iowait']."%wa, ".$data['cpu0']['irq']."%irq, ".$data['cpu0']['softirq']."%softirq"; -function makeImageUrl($title, $data) {$api='http://api.yahei.net/tz/cpu_show.php?id=';$url.=$data['user'].',';$url.=$data['nice'].',';$url.=$data['sys'].',';$url.=$data['idle'].',';$url.=$data['iowait'];$url.='&chdl=User|Nice|Sys|Idle|Iowait&chdlp=b&chl=';$url.=$data['user'].'%25|';$url.=$data['nice'].'%25|';$url.=$data['sys'].'%25|';$url.=$data['idle'].'%25|';$url.=$data['iowait'].'%25';$url.='&chtt=Core+'.$title;return $api.base64_encode($url);} -if($_GET['act'] == "cpu_percentage"){echo "
Slow image loading, please be patient!

";foreach( $data as $k => $v ) {echo '';}echo "
";exit();} - -// 根据不同系统取得CPU相关信息 -switch(PHP_OS) -{ - case "Linux": - $sysReShow = (false !== ($sysInfo = sys_linux()))?"show":"none"; - break; - - case "FreeBSD": - $sysReShow = (false !== ($sysInfo = sys_freebsd()))?"show":"none"; - break; - -/* - case "WINNT": - $sysReShow = (false !== ($sysInfo = sys_windows()))?"show":"none"; - break; -*/ - - default: - break; -} - -//linux系统探测 -function sys_linux() -{ - // CPU - if (false === ($str = @file("/proc/cpuinfo"))) return false; - $str = implode("", $str); - @preg_match_all("/model\s+name\s{0,}\:+\s{0,}([\w\s\)\(\@.-]+)([\r\n]+)/s", $str, $model); - @preg_match_all("/cpu\s+MHz\s{0,}\:+\s{0,}([\d\.]+)[\r\n]+/", $str, $mhz); - @preg_match_all("/cache\s+size\s{0,}\:+\s{0,}([\d\.]+\s{0,}[A-Z]+[\r\n]+)/", $str, $cache); - @preg_match_all("/bogomips\s{0,}\:+\s{0,}([\d\.]+)[\r\n]+/", $str, $bogomips); - if (false !== is_array($model[1])) - { - $res['cpu']['num'] = sizeof($model[1]); - /* - for($i = 0; $i < $res['cpu']['num']; $i++) - { - $res['cpu']['model'][] = $model[1][$i].' ('.$mhz[1][$i].')'; - $res['cpu']['mhz'][] = $mhz[1][$i]; - $res['cpu']['cache'][] = $cache[1][$i]; - $res['cpu']['bogomips'][] = $bogomips[1][$i]; - }*/ - if($res['cpu']['num']==1) - $x1 = ''; - else - $x1 = ' ×'.$res['cpu']['num']; - $mhz[1][0] = ' | Frequency:'.$mhz[1][0]; - $cache[1][0] = ' | Secondary cache:'.$cache[1][0]; - $bogomips[1][0] = ' | Bogomips:'.$bogomips[1][0]; - $res['cpu']['model'][] = $model[1][0].$mhz[1][0].$cache[1][0].$bogomips[1][0].$x1; - if (false !== is_array($res['cpu']['model'])) $res['cpu']['model'] = implode("
", $res['cpu']['model']); - if (false !== is_array($res['cpu']['mhz'])) $res['cpu']['mhz'] = implode("
", $res['cpu']['mhz']); - if (false !== is_array($res['cpu']['cache'])) $res['cpu']['cache'] = implode("
", $res['cpu']['cache']); - if (false !== is_array($res['cpu']['bogomips'])) $res['cpu']['bogomips'] = implode("
", $res['cpu']['bogomips']); - } - - // NETWORK - - // UPTIME - if (false === ($str = @file("/proc/uptime"))) return false; - $str = explode(" ", implode("", $str)); - $str = trim($str[0]); - $min = $str / 60; - $hours = $min / 60; - $days = floor($hours / 24); - $hours = floor($hours - ($days * 24)); - $min = floor($min - ($days * 60 * 24) - ($hours * 60)); - if ($days !== 0) $res['uptime'] = $days."Day"; - if ($hours !== 0) $res['uptime'] .= $hours."Hour"; - $res['uptime'] .= $min."Minute"; - - // MEMORY - if (false === ($str = @file("/proc/meminfo"))) return false; - $str = implode("", $str); - preg_match_all("/MemTotal\s{0,}\:+\s{0,}([\d\.]+).+?MemFree\s{0,}\:+\s{0,}([\d\.]+).+?Cached\s{0,}\:+\s{0,}([\d\.]+).+?SwapTotal\s{0,}\:+\s{0,}([\d\.]+).+?SwapFree\s{0,}\:+\s{0,}([\d\.]+)/s", $str, $buf); - preg_match_all("/Buffers\s{0,}\:+\s{0,}([\d\.]+)/s", $str, $buffers); - - $res['memTotal'] = round($buf[1][0]/1024, 2); - $res['memFree'] = round($buf[2][0]/1024, 2); - $res['memBuffers'] = round($buffers[1][0]/1024, 2); - $res['memCached'] = round($buf[3][0]/1024, 2); - $res['memUsed'] = $res['memTotal']-$res['memFree']; - $res['memPercent'] = (floatval($res['memTotal'])!=0)?round($res['memUsed']/$res['memTotal']*100,2):0; - - $res['memRealUsed'] = $res['memTotal'] - $res['memFree'] - $res['memCached'] - $res['memBuffers']; //真实内存使用 - $res['memRealFree'] = $res['memTotal'] - $res['memRealUsed']; //真实空闲 - $res['memRealPercent'] = (floatval($res['memTotal'])!=0)?round($res['memRealUsed']/$res['memTotal']*100,2):0; //真实内存使用率 - - $res['memCachedPercent'] = (floatval($res['memCached'])!=0)?round($res['memCached']/$res['memTotal']*100,2):0; //Cached内存使用率 - - $res['swapTotal'] = round($buf[4][0]/1024, 2); - $res['swapFree'] = round($buf[5][0]/1024, 2); - $res['swapUsed'] = round($res['swapTotal']-$res['swapFree'], 2); - $res['swapPercent'] = (floatval($res['swapTotal'])!=0)?round($res['swapUsed']/$res['swapTotal']*100,2):0; - - // LOAD AVG - if (false === ($str = @file("/proc/loadavg"))) return false; - $str = explode(" ", implode("", $str)); - $str = array_chunk($str, 4); - $res['loadAvg'] = implode(" ", $str[0]); - - return $res; -} - -//FreeBSD系统探测 -function sys_freebsd() -{ - //CPU - if (false === ($res['cpu']['num'] = get_key("hw.ncpu"))) return false; - $res['cpu']['model'] = get_key("hw.model"); - //LOAD AVG - if (false === ($res['loadAvg'] = get_key("vm.loadavg"))) return false; - //UPTIME - if (false === ($buf = get_key("kern.boottime"))) return false; - $buf = explode(' ', $buf); - $sys_ticks = time() - intval($buf[3]); - $min = $sys_ticks / 60; - $hours = $min / 60; - $days = floor($hours / 24); - $hours = floor($hours - ($days * 24)); - $min = floor($min - ($days * 60 * 24) - ($hours * 60)); - if ($days !== 0) $res['uptime'] = $days."Day"; - if ($hours !== 0) $res['uptime'] .= $hours."Hour"; - $res['uptime'] .= $min."Minute"; - //MEMORY - if (false === ($buf = get_key("hw.physmem"))) return false; - $res['memTotal'] = round($buf/1024/1024, 2); - - $str = get_key("vm.vmtotal"); - preg_match_all("/\nVirtual Memory[\:\s]*\(Total[\:\s]*([\d]+)K[\,\s]*Active[\:\s]*([\d]+)K\)\n/i", $str, $buff, PREG_SET_ORDER); - preg_match_all("/\nReal Memory[\:\s]*\(Total[\:\s]*([\d]+)K[\,\s]*Active[\:\s]*([\d]+)K\)\n/i", $str, $buf, PREG_SET_ORDER); - - $res['memRealUsed'] = round($buf[0][2]/1024, 2); - $res['memCached'] = round($buff[0][2]/1024, 2); - $res['memUsed'] = round($buf[0][1]/1024, 2) + $res['memCached']; - $res['memFree'] = $res['memTotal'] - $res['memUsed']; - $res['memPercent'] = (floatval($res['memTotal'])!=0)?round($res['memUsed']/$res['memTotal']*100,2):0; - - $res['memRealPercent'] = (floatval($res['memTotal'])!=0)?round($res['memRealUsed']/$res['memTotal']*100,2):0; - - return $res; -} - -//取得参数值 FreeBSD -function get_key($keyName) -{ - return do_command('sysctl', "-n $keyName"); -} - -//确定执行文件位置 FreeBSD -function find_command($commandName) -{ - $path = array('/bin', '/sbin', '/usr/bin', '/usr/sbin', '/usr/local/bin', '/usr/local/sbin'); - foreach($path as $p) - { - if (@is_executable("$p/$commandName")) return "$p/$commandName"; - } - return false; -} - -//执行系统命令 FreeBSD -function do_command($commandName, $args) -{ - $buffer = ""; - if (false === ($command = find_command($commandName))) return false; - if ($fp = @popen("$command $args", 'r')) - { - while (!@feof($fp)) - { - $buffer .= @fgets($fp, 4096); - } - return trim($buffer); - } - return false; -} - -//windows系统探测 -function sys_windows() -{ - if (PHP_VERSION >= 5) - { - $objLocator = new COM("WbemScripting.SWbemLocator"); - $wmi = $objLocator->ConnectServer(); - $prop = $wmi->get("Win32_PnPEntity"); - } - else - { - return false; - } - - //CPU - $cpuinfo = GetWMI($wmi,"Win32_Processor", array("Name","L2CacheSize","NumberOfCores")); - $res['cpu']['num'] = $cpuinfo[0]['NumberOfCores']; - if (null == $res['cpu']['num']) - { - $res['cpu']['num'] = 1; - }/* - for ($i=0;$i<$res['cpu']['num'];$i++) - { - $res['cpu']['model'] .= $cpuinfo[0]['Name']."
"; - $res['cpu']['cache'] .= $cpuinfo[0]['L2CacheSize']."
"; - }*/ - $cpuinfo[0]['L2CacheSize'] = ' ('.$cpuinfo[0]['L2CacheSize'].')'; - if($res['cpu']['num']==1) - $x1 = ''; - else - $x1 = ' ×'.$res['cpu']['num']; - $res['cpu']['model'] = $cpuinfo[0]['Name'].$cpuinfo[0]['L2CacheSize'].$x1; - // SYSINFO - $sysinfo = GetWMI($wmi,"Win32_OperatingSystem", array('LastBootUpTime','TotalVisibleMemorySize','FreePhysicalMemory','Caption','CSDVersion','SerialNumber','InstallDate')); - $sysinfo[0]['Caption']=iconv('GBK', 'UTF-8',$sysinfo[0]['Caption']); - $sysinfo[0]['CSDVersion']=iconv('GBK', 'UTF-8',$sysinfo[0]['CSDVersion']); - $res['win_n'] = $sysinfo[0]['Caption']." ".$sysinfo[0]['CSDVersion']." 序列号:{$sysinfo[0]['SerialNumber']} 于".date('Y年m月d日H:i:s',strtotime(substr($sysinfo[0]['InstallDate'],0,14)))."安装"; - //UPTIME - $res['uptime'] = $sysinfo[0]['LastBootUpTime']; - - $sys_ticks = 3600*8 + time() - strtotime(substr($res['uptime'],0,14)); - $min = $sys_ticks / 60; - $hours = $min / 60; - $days = floor($hours / 24); - $hours = floor($hours - ($days * 24)); - $min = floor($min - ($days * 60 * 24) - ($hours * 60)); - if ($days !== 0) $res['uptime'] = $days."Day"; - if ($hours !== 0) $res['uptime'] .= $hours."Hour"; - $res['uptime'] .= $min."Minute"; - - //MEMORY - $res['memTotal'] = round($sysinfo[0]['TotalVisibleMemorySize']/1024,2); - $res['memFree'] = round($sysinfo[0]['FreePhysicalMemory']/1024,2); - $res['memUsed'] = $res['memTotal']-$res['memFree']; //上面两行已经除以1024,这行不用再除了 - $res['memPercent'] = round($res['memUsed'] / $res['memTotal']*100,2); - - $swapinfo = GetWMI($wmi,"Win32_PageFileUsage", array('AllocatedBaseSize','CurrentUsage')); - - // LoadPercentage - $loadinfo = GetWMI($wmi,"Win32_Processor", array("LoadPercentage")); - $res['loadAvg'] = $loadinfo[0]['LoadPercentage']; - - return $res; -} - -function GetWMI($wmi,$strClass, $strValue = array()) -{ - $arrData = array(); - - $objWEBM = $wmi->Get($strClass); - $arrProp = $objWEBM->Properties_; - $arrWEBMCol = $objWEBM->Instances_(); - foreach($arrWEBMCol as $objItem) - { - @reset($arrProp); - $arrInstance = array(); - foreach($arrProp as $propItem) - { - eval("\$value = \$objItem->" . $propItem->Name . ";"); - if (empty($strValue)) - { - $arrInstance[$propItem->Name] = trim($value); - } - else - { - if (in_array($propItem->Name, $strValue)) - { - $arrInstance[$propItem->Name] = trim($value); - } - } - } - $arrData[] = $arrInstance; - } - return $arrData; -} - -//比例条 -function bar($percent) -{ -?> -
 
-"$du",'freeSpace'=>"$df",'hdPercent'=>"$hdPercent",'barhdPercent'=>"$hdPercent%",'TotalMemory'=>"$mt",'UsedMemory'=>"$mu",'FreeMemory'=>"$mf",'CachedMemory'=>"$mc",'Buffers'=>"$mb",'TotalSwap'=>"$st",'swapUsed'=>"$su",'swapFree'=>"$sf",'loadAvg'=>"$load",'uptime'=>"$uptime",'freetime'=>"$freetime",'bjtime'=>"$bjtime",'stime'=>"$stime",'memRealPercent'=>"$memRealPercent",'memRealUsed'=>"$memRealUsed",'memRealFree'=>"$memRealFree",'memPercent'=>"$memPercent%",'memCachedPercent'=>"$memCachedPercent",'barmemCachedPercent'=>"$memCachedPercent%",'swapPercent'=>"$swapPercent",'barmemRealPercent'=>"$memRealPercent%",'barswapPercent'=>"$swapPercent%",'NetOut2'=>"$NetOut[2]",'NetOut3'=>"$NetOut[3]",'NetOut4'=>"$NetOut[4]",'NetOut5'=>"$NetOut[5]",'NetOut6'=>"$NetOut[6]",'NetOut7'=>"$NetOut[7]",'NetOut8'=>"$NetOut[8]",'NetOut9'=>"$NetOut[9]",'NetOut10'=>"$NetOut[10]",'NetInput2'=>"$NetInput[2]",'NetInput3'=>"$NetInput[3]",'NetInput4'=>"$NetInput[4]",'NetInput5'=>"$NetInput[5]",'NetInput6'=>"$NetInput[6]",'NetInput7'=>"$NetInput[7]",'NetInput8'=>"$NetInput[8]",'NetInput9'=>"$NetInput[9]",'NetInput10'=>"$NetInput[10]",'NetOutSpeed2'=>"$NetOutSpeed[2]",'NetOutSpeed3'=>"$NetOutSpeed[3]",'NetOutSpeed4'=>"$NetOutSpeed[4]",'NetOutSpeed5'=>"$NetOutSpeed[5]",'NetInputSpeed2'=>"$NetInputSpeed[2]",'NetInputSpeed3'=>"$NetInputSpeed[3]",'NetInputSpeed4'=>"$NetInputSpeed[4]",'NetInputSpeed5'=>"$NetInputSpeed[5]"); - $jarr=json_encode($arr); - $_GET['callback'] = htmlspecialchars($_GET['callback']); - echo $_GET['callback'],'(',$jarr,')'; - exit; -} -?> - - - - -<?php echo $title.$version; ?> - - - - - - - - - - -
- - - - - - - - - - - - - - - -
PHPModuleOtherDatabasePerformanceSpeedMySQLFunctionMailDownload
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Server Parameters
Server Domain/IP - ()  Your IP address is:
Server identifies the
Server OS  Kernel version: Web Server
Server LanguageServer Port
Server HostNameAbsolute Path
Administrator MailProber Path
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Real-time Data Server
Current Server TimeServer Uptime
CPU Model [Core]
CPU usageView Chart";}else{echo "Only supports the Linux system";}?> -
Space usage - Total Space  G, - Used  G, - Free  G, - Rate % -
 
-
Memory usage - - Total Memory: - - , Used - - , Free - - , Rate - -
 
-0) -{ -?> - Cache Memory - , Rate - - % | Buffers -
 
- - Real Memory Used - - , Real Memory Free - - , Rate - - % -
 
-0) -{ -?> - SWAP: - - , Used - - , Free - - , Rate - - % -
 
- - -
Average System Load
- - - - - - - - - - - - - - - -
NetWork
: In : Real time: 0B/sOut : Real time: 0B/s
- - - - - - - - - -
PHP has been compiled module testing
-$value) { - if ($key!=0 && $key%13==0) { - echo '
'; - } - echo "$value  "; -} -?>
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PHP Parameters
PHP Info: - - PHPINFO";?> - PHP Version:
Run PHP: Memory Limit:
PHP Safe Mode: Post Max Size:
Upload Max Filesize: Floating-point data of significant digits:
Max Execution Time: SecondSocket TimeOut: Second
PHP Doc Root: User Dir:
Enable Dl: Include Path:
Display Errors: Register Globals:
Magic Quotes Gpc: "<?...?>"Short Open Tag:
"<% %>"ASP Tags: Ignore Repeated Errors:
Ignore Repeated Source: Report Memleaks:
Magic Quotes Gpc: Magic Quotes Runtime:
Allow URL Fopen: Register Argc Argv:
Cookie:√' : '×';?>Spell check(ASpell Library):
High-precision math(BCMath):PREL(PCRE):
PDF:SNMP:
VMailMgr:Curl:
SMTP:√' : '×';?>SMTP:×';?>
Enable Functions: Click here to view more!
Disable Functions: -×'; -} -else -{ - //echo $disFuns; - $disFuns_array = explode(',',$disFuns); - foreach ($disFuns_array as $key=>$value) - { - if ($key!=0 && $key%5==0) { - echo '
'; - } - echo "$value  "; -} -} - -?> -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Components
FTP: XML:
Session: Socket:
Calendar - Allow Url Fopen:
GD Library: - ×';} - ?>Zlib:
IMAP: JDToGregorian:
Preg Match: WDDX:
Iconv: mbstring:
BCADD: LDAP:
MCrypt: Mhash Count:
- - - - - - - - - - - - - - - - - - - - - - - -
Other Components
Zend Version×';}else{echo $zend_version;}?> - 2) -{ - echo "ZendGuardLoader[On]"; -} -else -{ - echo "Zend Optimizer"; -} -?> - 2){echo (get_cfg_var("zend_loader.enable"))?'':'×';} else{if(function_exists('zend_optimizer_version')){ echo zend_optimizer_version();}else{ echo (get_cfg_var("zend_optimizer.optimization_level")||get_cfg_var("zend_extension_manager.optimizer_ts")||get_cfg_var("zend.ze1_compatibility_mode")||get_cfg_var("zend_extension_ts"))?'':'×';}}?>
eAccelerator×";} ?>ioncube×";}?>
XCache×";} ?>APC×";} ?>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Database
MySQL: - - ODBC:
Oracle: SQL Server:
dBASE: mSQL:
SQLite: √ ';echo "SQLite3 Ver ";echo $sqliteVer[versionString];}else {echo isfun("sqlite_close");if(isfun("sqlite_close") == '') {echo " : ".@sqlite_libversion();}}?>Hyperwave:
Postgre SQL: Informix:
DBA database: DBM database:
FilePro database:SyBase database:
- - -" method="post"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Server Performance Test
Reference ObjectInt Test
(1+1 Count 3 Million)
Float Test
(Pi times the square root of 3 million)
I/O Test
(10K file read 10,000 times)
CPU Info
LinodeVPS0.357 Second0.802 Second0.023 Second4 x Xeon L5520 @ 2.27GHz
PhotonVPS.com0.431 Second1.024 Second0.034 Second8 x Xeon E5520 @ 2.27GHz
SpaceRich.com0.421 Second1.003 Second0.038 Second4 x Core i7 920 @ 2.67GHz
RiZie.com0.521 Second1.559 Second0.054 Second2 x Pentium4 3.00GHz
CitynetHost.com0.343 Second0.761 Second0.023 Second2 x Core2Duo E4600 @ 2.40GHz
IXwebhosting.com0.535 Second1.607 Second0.058 Second4 x Xeon E5530 @ 2.40GHz
This Server


- - - - - - - - - - - - -
Network Speed Test
-
- 1000k bytes sent to the client data -
- - - - - - - - - - - - - - - - - - -
Bandwidth1M2M3M4M5M6M7M8M9M10M
- - - - -
">">
-
- ".$_GET['speed']." Millisecond, Download Speed: "."".$speed.""." kb/s":" No Test " ?> - -
- - - - - - - - - - -
MySQL Database connection detection
- Host: - Port: - Username: - Password: - - -
- alert('Connect to the MySql database to normal')"; - } else { - echo ""; - } - } else { - echo ""; - } - } - ?> - - - - - - - - - - - alert('$funRe')"; - } - ?> -
Function Test
- Enter the function you want to test: - - - -
- - - - - - - - - - - alert('$mailRe')"; - } - ?> -
Mail Send Test
- Please enter your email address to test: - - - -
- - - - - - - - -
Processed in seconds. memory usage.TOP
- - -
- - diff --git a/images/phpmyadmin/latest/Dockerfile b/images/phpmyadmin/latest/Dockerfile new file mode 100644 index 00000000..13a02498 --- /dev/null +++ b/images/phpmyadmin/latest/Dockerfile @@ -0,0 +1,16 @@ +FROM phpmyadmin/phpmyadmin + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +# Add volume for sessions to allow session persistence +VOLUME /sessions + +RUN echo '' >> /usr/local/etc/php/conf.d/php-phpmyadmin.ini \ + && echo '[PHP]' >> /usr/local/etc/php/conf.d/php-phpmyadmin.ini \ + && echo 'post_max_size = 2G' >> /usr/local/etc/php/conf.d/php-phpmyadmin.ini \ + && echo 'upload_max_filesize = 2G' >> /usr/local/etc/php/conf.d/php-phpmyadmin.ini + +# We expose phpMyAdmin on port 80 +EXPOSE 80 diff --git a/images/portainer/latest/Dockerfile b/images/portainer/latest/Dockerfile new file mode 100644 index 00000000..c36782a5 --- /dev/null +++ b/images/portainer/latest/Dockerfile @@ -0,0 +1,7 @@ +FROM portainer/portainer-ce:latest + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +EXPOSE 9000 diff --git a/images/postgres/10/Dockerfile b/images/postgres/10/Dockerfile new file mode 100644 index 00000000..7b248f00 --- /dev/null +++ b/images/postgres/10/Dockerfile @@ -0,0 +1,10 @@ +FROM postgres:10-alpine +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +VOLUME /var/lib/postgresql/data + +ENTRYPOINT ["docker-entrypoint.sh"] +STOPSIGNAL SIGINT +EXPOSE 5432 +CMD ["postgres"] diff --git a/images/postgres/11/Dockerfile b/images/postgres/11/Dockerfile new file mode 100644 index 00000000..4ec4befe --- /dev/null +++ b/images/postgres/11/Dockerfile @@ -0,0 +1,10 @@ +FROM postgres:11-alpine +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +VOLUME /var/lib/postgresql/data + +ENTRYPOINT ["docker-entrypoint.sh"] +STOPSIGNAL SIGINT +EXPOSE 5432 +CMD ["postgres"] diff --git a/images/postgres/12/Dockerfile b/images/postgres/12/Dockerfile new file mode 100644 index 00000000..771784a3 --- /dev/null +++ b/images/postgres/12/Dockerfile @@ -0,0 +1,10 @@ +FROM postgres:12-alpine +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +VOLUME /var/lib/postgresql/data + +ENTRYPOINT ["docker-entrypoint.sh"] +STOPSIGNAL SIGINT +EXPOSE 5432 +CMD ["postgres"] diff --git a/images/postgres/13/Dockerfile b/images/postgres/13/Dockerfile new file mode 100644 index 00000000..3628475b --- /dev/null +++ b/images/postgres/13/Dockerfile @@ -0,0 +1,10 @@ +FROM postgres:13-alpine +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +VOLUME /var/lib/postgresql/data + +ENTRYPOINT ["docker-entrypoint.sh"] +STOPSIGNAL SIGINT +EXPOSE 5432 +CMD ["postgres"] diff --git a/images/postgres/14/Dockerfile b/images/postgres/14/Dockerfile new file mode 100644 index 00000000..6ec2698b --- /dev/null +++ b/images/postgres/14/Dockerfile @@ -0,0 +1,10 @@ +FROM postgres:14-alpine +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +VOLUME /var/lib/postgresql/data + +ENTRYPOINT ["docker-entrypoint.sh"] +STOPSIGNAL SIGINT +EXPOSE 5432 +CMD ["postgres"] diff --git a/images/postgres/15/Dockerfile b/images/postgres/15/Dockerfile new file mode 100644 index 00000000..c50f650e --- /dev/null +++ b/images/postgres/15/Dockerfile @@ -0,0 +1,10 @@ +FROM postgres:15beta2-alpine +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +VOLUME /var/lib/postgresql/data + +ENTRYPOINT ["docker-entrypoint.sh"] +STOPSIGNAL SIGINT +EXPOSE 5432 +CMD ["postgres"] diff --git a/images/postgres/docker-entrypoint-initdb.d/.gitignore b/images/postgres/docker-entrypoint-initdb.d/.gitignore new file mode 100644 index 00000000..a56b450c --- /dev/null +++ b/images/postgres/docker-entrypoint-initdb.d/.gitignore @@ -0,0 +1,5 @@ +*.sh +!init_gitlab_db.sh +!init_jupyterhub_db.sh +!init_sonarqube_db.sh +!init_confluence_db.sh \ No newline at end of file diff --git a/images/postgres/docker-entrypoint-initdb.d/createdb.sh.example b/images/postgres/docker-entrypoint-initdb.d/createdb.sh.example new file mode 100644 index 00000000..822c7dee --- /dev/null +++ b/images/postgres/docker-entrypoint-initdb.d/createdb.sh.example @@ -0,0 +1,33 @@ +#!/bin/bash +# +# Copy createdb.sh.example to createdb.sh +# then uncomment then set database name and username to create you need databases +# +# example: .env POSTGRES_USER=appuser and need db name is myshop_db +# +# psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL +# CREATE USER myuser WITH PASSWORD 'mypassword'; +# CREATE DATABASE myshop_db; +# GRANT ALL PRIVILEGES ON DATABASE myshop_db TO myuser; +# EOSQL +# +# this sh script will auto run when the postgres container starts and the $DATA_PATH_HOST/postgres not found. +# +# +# psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL +# CREATE USER db1 WITH PASSWORD 'db1'; +# CREATE DATABASE db1; +# GRANT ALL PRIVILEGES ON DATABASE db1 TO db1; +# EOSQL +# +# psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL +# CREATE USER db2 WITH PASSWORD 'db2'; +# CREATE DATABASE db2; +# GRANT ALL PRIVILEGES ON DATABASE db2 TO db2; +# EOSQL +# +# psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL +# CREATE USER db3 WITH PASSWORD 'db3'; +# CREATE DATABASE db3; +# GRANT ALL PRIVILEGES ON DATABASE db3 TO db3; +# EOSQL diff --git a/images/postgres/docker-entrypoint-initdb.d/init_confluence_db.sh b/images/postgres/docker-entrypoint-initdb.d/init_confluence_db.sh new file mode 100644 index 00000000..aa744a1b --- /dev/null +++ b/images/postgres/docker-entrypoint-initdb.d/init_confluence_db.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# +# Copy createdb.sh.example to createdb.sh +# then uncomment then set database name and username to create you need databases +# +# example: .env POSTGRES_USER=appuser and need db name is myshop_db +# +# psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL +# CREATE USER myuser WITH PASSWORD 'mypassword'; +# CREATE DATABASE myshop_db; +# GRANT ALL PRIVILEGES ON DATABASE myshop_db TO myuser; +# EOSQL +# +# this sh script will auto run when the postgres container starts and the $DATA_PATH_HOST/postgres not found. +# +# +# psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL +# CREATE USER db1 WITH PASSWORD 'db1'; +# CREATE DATABASE db1; +# GRANT ALL PRIVILEGES ON DATABASE db1 TO db1; +# EOSQL +# +# psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL +# CREATE USER db2 WITH PASSWORD 'db2'; +# CREATE DATABASE db2; +# GRANT ALL PRIVILEGES ON DATABASE db2 TO db2; +# EOSQL +# +# psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL +# CREATE USER db3 WITH PASSWORD 'db3'; +# CREATE DATABASE db3; +# GRANT ALL PRIVILEGES ON DATABASE db3 TO db3; +# EOSQL +# +### default database and user for confluence ############################################## +if [ "$CONFLUENCE_POSTGRES_INIT" == 'true' ]; then + psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL + CREATE USER $POSTGRES_CONFLUENCE_USER WITH PASSWORD '$POSTGRES_CONFLUENCE_PASSWORD'; + CREATE DATABASE $POSTGRES_CONFLUENCE_DB; + GRANT ALL PRIVILEGES ON DATABASE $POSTGRES_CONFLUENCE_DB TO $POSTGRES_CONFLUENCE_USER; + ALTER ROLE $POSTGRES_CONFLUENCE_USER CREATEROLE SUPERUSER; + EOSQL + echo +fi diff --git a/images/postgres/docker-entrypoint-initdb.d/init_gitlab_db.sh b/images/postgres/docker-entrypoint-initdb.d/init_gitlab_db.sh new file mode 100644 index 00000000..4f4267df --- /dev/null +++ b/images/postgres/docker-entrypoint-initdb.d/init_gitlab_db.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# +# Copy createdb.sh.example to createdb.sh +# then uncomment then set database name and username to create you need databases +# +# example: .env POSTGRES_USER=appuser and need db name is myshop_db +# +# psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL +# CREATE USER myuser WITH PASSWORD 'mypassword'; +# CREATE DATABASE myshop_db; +# GRANT ALL PRIVILEGES ON DATABASE myshop_db TO myuser; +# EOSQL +# +# this sh script will auto run when the postgres container starts and the $DATA_PATH_HOST/postgres not found. +# +# +# psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL +# CREATE USER db1 WITH PASSWORD 'db1'; +# CREATE DATABASE db1; +# GRANT ALL PRIVILEGES ON DATABASE db1 TO db1; +# EOSQL +# +# psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL +# CREATE USER db2 WITH PASSWORD 'db2'; +# CREATE DATABASE db2; +# GRANT ALL PRIVILEGES ON DATABASE db2 TO db2; +# EOSQL +# +# psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL +# CREATE USER db3 WITH PASSWORD 'db3'; +# CREATE DATABASE db3; +# GRANT ALL PRIVILEGES ON DATABASE db3 TO db3; +# EOSQL +# +### default database and user for gitlab ############################################## +if [ "$GITLAB_POSTGRES_INIT" == 'true' ]; then + psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL + CREATE USER $GITLAB_POSTGRES_USER WITH PASSWORD '$GITLAB_POSTGRES_PASSWORD'; + CREATE DATABASE $GITLAB_POSTGRES_DB; + GRANT ALL PRIVILEGES ON DATABASE $GITLAB_POSTGRES_DB TO $GITLAB_POSTGRES_USER; + ALTER ROLE $GITLAB_POSTGRES_USER CREATEROLE SUPERUSER; + EOSQL + echo +fi \ No newline at end of file diff --git a/images/postgres/docker-entrypoint-initdb.d/init_jupyterhub_db.sh b/images/postgres/docker-entrypoint-initdb.d/init_jupyterhub_db.sh new file mode 100644 index 00000000..c3869795 --- /dev/null +++ b/images/postgres/docker-entrypoint-initdb.d/init_jupyterhub_db.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# +# Copy createdb.sh.example to createdb.sh +# then uncomment then set database name and username to create you need databases +# +# example: .env POSTGRES_USER=appuser and need db name is myshop_db +# +# psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL +# CREATE USER myuser WITH PASSWORD 'mypassword'; +# CREATE DATABASE myshop_db; +# GRANT ALL PRIVILEGES ON DATABASE myshop_db TO myuser; +# EOSQL +# +# this sh script will auto run when the postgres container starts and the $DATA_PATH_HOST/postgres not found. +# +# +# psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL +# CREATE USER db1 WITH PASSWORD 'db1'; +# CREATE DATABASE db1; +# GRANT ALL PRIVILEGES ON DATABASE db1 TO db1; +# EOSQL +# +# psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL +# CREATE USER db2 WITH PASSWORD 'db2'; +# CREATE DATABASE db2; +# GRANT ALL PRIVILEGES ON DATABASE db2 TO db2; +# EOSQL +# +# psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL +# CREATE USER db3 WITH PASSWORD 'db3'; +# CREATE DATABASE db3; +# GRANT ALL PRIVILEGES ON DATABASE db3 TO db3; +# EOSQL +# +### default database and user for jupyterhub ############################################## +if [ "$JUPYTERHUB_POSTGRES_INIT" == 'true' ]; then + psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL + CREATE USER $JUPYTERHUB_POSTGRES_USER WITH PASSWORD '$JUPYTERHUB_POSTGRES_PASSWORD'; + CREATE DATABASE $JUPYTERHUB_POSTGRES_DB; + GRANT ALL PRIVILEGES ON DATABASE $JUPYTERHUB_POSTGRES_DB TO $JUPYTERHUB_POSTGRES_USER; + ALTER ROLE $JUPYTERHUB_POSTGRES_USER CREATEROLE SUPERUSER; + EOSQL + echo +fi diff --git a/images/postgres/docker-entrypoint-initdb.d/init_sonarqube_db.sh b/images/postgres/docker-entrypoint-initdb.d/init_sonarqube_db.sh new file mode 100644 index 00000000..fea961de --- /dev/null +++ b/images/postgres/docker-entrypoint-initdb.d/init_sonarqube_db.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# +# Copy createdb.sh.example to createdb.sh +# then uncomment then set database name and username to create you need databases +# +# example: .env POSTGRES_USER=appuser and need db name is myshop_db +# +# psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL +# CREATE USER myuser WITH PASSWORD 'mypassword'; +# CREATE DATABASE myshop_db; +# GRANT ALL PRIVILEGES ON DATABASE myshop_db TO myuser; +# EOSQL +# +# this sh script will auto run when the postgres container starts and the $DATA_PATH_HOST/postgres not found. +# +# +# psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL +# CREATE USER db1 WITH PASSWORD 'db1'; +# CREATE DATABASE db1; +# GRANT ALL PRIVILEGES ON DATABASE db1 TO db1; +# EOSQL +# +# psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL +# CREATE USER db2 WITH PASSWORD 'db2'; +# CREATE DATABASE db2; +# GRANT ALL PRIVILEGES ON DATABASE db2 TO db2; +# EOSQL +# +# psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL +# CREATE USER db3 WITH PASSWORD 'db3'; +# CREATE DATABASE db3; +# GRANT ALL PRIVILEGES ON DATABASE db3 TO db3; +# EOSQL +# +### default database and user for gitlab ############################################## +if [ "$SONARQUBE_POSTGRES_INIT" == 'true' ]; then + psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL + CREATE USER $SONARQUBE_POSTGRES_USER WITH PASSWORD '$SONARQUBE_POSTGRES_PASSWORD'; + CREATE DATABASE $SONARQUBE_POSTGRES_DB; + GRANT ALL PRIVILEGES ON DATABASE $SONARQUBE_POSTGRES_DB TO $SONARQUBE_POSTGRES_USER; + ALTER ROLE $SONARQUBE_POSTGRES_USER CREATEROLE SUPERUSER; + EOSQL + echo +fi diff --git a/images/postgres/latest/Dockerfile b/images/postgres/latest/Dockerfile new file mode 100644 index 00000000..e1d54ca4 --- /dev/null +++ b/images/postgres/latest/Dockerfile @@ -0,0 +1,10 @@ +FROM postgres:alpine +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +VOLUME /var/lib/postgresql/data + +ENTRYPOINT ["docker-entrypoint.sh"] +STOPSIGNAL SIGINT +EXPOSE 5432 +CMD ["postgres"] diff --git a/images/powershell/Dockerfile b/images/powershell/Dockerfile new file mode 100644 index 00000000..514e8107 --- /dev/null +++ b/images/powershell/Dockerfile @@ -0,0 +1,8 @@ +FROM mcr.microsoft.com/powershell:lts-ubuntu-22.04 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv \ + org.opencontainers.image.description='PowerShell' + +CMD ["pwsh"] diff --git a/images/rabbitmq/latest/Dockerfile b/images/rabbitmq/latest/Dockerfile new file mode 100644 index 00000000..b854ad2d --- /dev/null +++ b/images/rabbitmq/latest/Dockerfile @@ -0,0 +1,7 @@ +FROM rabbitmq:alpine +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +RUN rabbitmq-plugins enable --offline rabbitmq_management + +EXPOSE 4369 5671 5672 15691 15692 25672 diff --git a/images/redis-cluster/5.0/Dockerfile b/images/redis-cluster/5.0/Dockerfile new file mode 100644 index 00000000..dbb1407b --- /dev/null +++ b/images/redis-cluster/5.0/Dockerfile @@ -0,0 +1,10 @@ +FROM bitnami/redis-cluster:5.0 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +EXPOSE 6379 + +USER 1001 +ENTRYPOINT [ "/opt/bitnami/scripts/redis-cluster/entrypoint.sh" ] +CMD [ "/opt/bitnami/scripts/redis-cluster/run.sh" ] diff --git a/images/redis-cluster/6.0/Dockerfile b/images/redis-cluster/6.0/Dockerfile new file mode 100644 index 00000000..6df61710 --- /dev/null +++ b/images/redis-cluster/6.0/Dockerfile @@ -0,0 +1,10 @@ +FROM bitnami/redis-cluster:6.0 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +EXPOSE 6379 + +USER 1001 +ENTRYPOINT [ "/opt/bitnami/scripts/redis-cluster/entrypoint.sh" ] +CMD [ "/opt/bitnami/scripts/redis-cluster/run.sh" ] diff --git a/images/redis-cluster/6.2/Dockerfile b/images/redis-cluster/6.2/Dockerfile new file mode 100644 index 00000000..c0cab923 --- /dev/null +++ b/images/redis-cluster/6.2/Dockerfile @@ -0,0 +1,10 @@ +FROM bitnami/redis-cluster:6.2 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +EXPOSE 6379 + +USER 1001 +ENTRYPOINT [ "/opt/bitnami/scripts/redis-cluster/entrypoint.sh" ] +CMD [ "/opt/bitnami/scripts/redis-cluster/run.sh" ] diff --git a/images/redis-webui/Dockerfile b/images/redis-webui/Dockerfile new file mode 100644 index 00000000..fb026acb --- /dev/null +++ b/images/redis-webui/Dockerfile @@ -0,0 +1,3 @@ +FROM erikdubbelboer/phpredisadmin + +LABEL maintainer="ahkui " diff --git a/images/redis/4.0/Dockerfile b/images/redis/4.0/Dockerfile new file mode 100644 index 00000000..ce5196fd --- /dev/null +++ b/images/redis/4.0/Dockerfile @@ -0,0 +1,14 @@ +FROM redis:4-alpine +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +USER redis + +VOLUME /data +WORKDIR /data + +ENTRYPOINT ["docker-entrypoint.sh"] + +EXPOSE 6379 +CMD ["redis-server"] diff --git a/images/redis/5.0/Dockerfile b/images/redis/5.0/Dockerfile new file mode 100644 index 00000000..52f1bfee --- /dev/null +++ b/images/redis/5.0/Dockerfile @@ -0,0 +1,14 @@ +FROM redis:5-alpine +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +USER redis + +VOLUME /data +WORKDIR /data + +ENTRYPOINT ["docker-entrypoint.sh"] + +EXPOSE 6379 +CMD ["redis-server"] diff --git a/images/redis/6.0/Dockerfile b/images/redis/6.0/Dockerfile new file mode 100644 index 00000000..cee4947b --- /dev/null +++ b/images/redis/6.0/Dockerfile @@ -0,0 +1,14 @@ +FROM redis:6.0-alpine +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +USER redis + +VOLUME /data +WORKDIR /data + +ENTRYPOINT ["docker-entrypoint.sh"] + +EXPOSE 6379 +CMD ["redis-server"] diff --git a/images/redis/6.2/Dockerfile b/images/redis/6.2/Dockerfile new file mode 100644 index 00000000..359d76f3 --- /dev/null +++ b/images/redis/6.2/Dockerfile @@ -0,0 +1,14 @@ +FROM redis:6.2-alpine +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +USER redis + +VOLUME /data +WORKDIR /data + +ENTRYPOINT ["docker-entrypoint.sh"] + +EXPOSE 6379 +CMD ["redis-server"] diff --git a/images/redis/7/Dockerfile b/images/redis/7/Dockerfile new file mode 100644 index 00000000..1941abbf --- /dev/null +++ b/images/redis/7/Dockerfile @@ -0,0 +1,14 @@ +FROM redis:7-alpine +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +USER redis + +VOLUME /data +WORKDIR /data + +ENTRYPOINT ["docker-entrypoint.sh"] + +EXPOSE 6379 +CMD ["redis-server"] diff --git a/images/redis/Dockerfile b/images/redis/Dockerfile deleted file mode 100644 index cb8678be..00000000 --- a/images/redis/Dockerfile +++ /dev/null @@ -1,47 +0,0 @@ -FROM registry.cn-hongkong.aliyuncs.com/imxieke/alpine:latest -LABEL MAINTAINER="Cloudflying" \ - MAIL="" - -ENV REDIS_VERSION=5.0.1 \ - REDIS_DOWNLOAD_URL=https://qcloud.coding.net/u/imxieke/p/Collect/git/raw/master/src/redis-5.0.1.tar.gz \ - REDIS_DOWNLOAD_SHA=82a67c0eec97f9ad379384c30ec391b269e17a3e4596393c808f02db7595abcb - -# for redis-sentinel see: http://redis.io/topics/sentinel -# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added -RUN addgroup -S redis && adduser -S -G redis redis ; \ - apk add --no-cache tzdata ; \ - apk add --no-cache --virtual .build-deps coreutils gcc jemalloc-dev linux-headers make musl-dev ; \ - wget -O redis.tar.gz "$REDIS_DOWNLOAD_URL"; \ - echo "$REDIS_DOWNLOAD_SHA *redis.tar.gz" | sha256sum -c -; \ - mkdir -p /usr/src/redis; \ - tar -xzf redis.tar.gz -C /usr/src/redis --strip-components=1; \ - rm redis.tar.gz; \ - # disable Redis protected mode [1] as it is unnecessary in context of Docker - # (ports are not automatically exposed when running inside Docker, but rather explicitly by specifying -p / -P) - # [1]: https://github.com/antirez/redis/commit/edd4d555df57dc84265fdfb4ef59a4678832f6da - grep -q '^#define CONFIG_DEFAULT_PROTECTED_MODE 1$' /usr/src/redis/src/server.h; \ - sed -ri 's!^(#define CONFIG_DEFAULT_PROTECTED_MODE) 1$!\1 0!' /usr/src/redis/src/server.h; \ - grep -q '^#define CONFIG_DEFAULT_PROTECTED_MODE 0$' /usr/src/redis/src/server.h; \ - # for future reference, we modify this directly in the source instead of just supplying a default configuration flag because apparently "if you specify any argument to redis-server, [it assumes] you are going to specify everything" - # see also https://github.com/docker-library/redis/issues/4#issuecomment-50780840 - # (more exactly, this makes sure the default behavior of "save on SIGTERM" stays functional by default) - make -C /usr/src/redis -j "$(nproc)"; \ - make -C /usr/src/redis install; \ - rm -r /usr/src/redis; \ - runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )"; \ - apk add --virtual .redis-rundeps $runDeps; \ - apk del .build-deps; \ - mkdir /data && chown -R redis:redis /data ; \ - rm -fr /var/cache/apk/* - -USER redis -VOLUME /data -WORKDIR /data - -EXPOSE 6379 -CMD ["redis-server"] \ No newline at end of file diff --git a/images/redis/Dockerfile.4 b/images/redis/Dockerfile.4 deleted file mode 100644 index 7e022a47..00000000 --- a/images/redis/Dockerfile.4 +++ /dev/null @@ -1,47 +0,0 @@ -FROM registry.cn-hongkong.aliyuncs.com/imxieke/alpine:latest -LABEL MAINTAINER="Cloudflying" \ - MAIL="" - -ENV REDIS_VERSION=4.0.11 \ - REDIS_DOWNLOAD_URL=https://qcloud.coding.net/u/imxieke/p/Collect/git/raw/master/src/redis-4.0.11.tar.gz \ - REDIS_DOWNLOAD_SHA=fc53e73ae7586bcdacb4b63875d1ff04f68c5474c1ddeda78f00e5ae2eed1bbb - -# for redis-sentinel see: http://redis.io/topics/sentinel -# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added -RUN addgroup -S redis && adduser -S -G redis redis ; \ - apk add --no-cache tzdata ; \ - apk add --no-cache --virtual .build-deps coreutils gcc jemalloc-dev linux-headers make musl-dev ; \ - wget -O redis.tar.gz "$REDIS_DOWNLOAD_URL"; \ - echo "$REDIS_DOWNLOAD_SHA *redis.tar.gz" | sha256sum -c -; \ - mkdir -p /usr/src/redis; \ - tar -xzf redis.tar.gz -C /usr/src/redis --strip-components=1; \ - rm redis.tar.gz; \ - # disable Redis protected mode [1] as it is unnecessary in context of Docker - # (ports are not automatically exposed when running inside Docker, but rather explicitly by specifying -p / -P) - # [1]: https://github.com/antirez/redis/commit/edd4d555df57dc84265fdfb4ef59a4678832f6da - grep -q '^#define CONFIG_DEFAULT_PROTECTED_MODE 1$' /usr/src/redis/src/server.h; \ - sed -ri 's!^(#define CONFIG_DEFAULT_PROTECTED_MODE) 1$!\1 0!' /usr/src/redis/src/server.h; \ - grep -q '^#define CONFIG_DEFAULT_PROTECTED_MODE 0$' /usr/src/redis/src/server.h; \ - # for future reference, we modify this directly in the source instead of just supplying a default configuration flag because apparently "if you specify any argument to redis-server, [it assumes] you are going to specify everything" - # see also https://github.com/docker-library/redis/issues/4#issuecomment-50780840 - # (more exactly, this makes sure the default behavior of "save on SIGTERM" stays functional by default) - make -C /usr/src/redis -j "$(nproc)"; \ - make -C /usr/src/redis install; \ - rm -r /usr/src/redis; \ - runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )"; \ - apk add --virtual .redis-rundeps $runDeps; \ - apk del .build-deps; \ - mkdir /data && chown -R redis:redis /data ; \ - rm -fr /var/cache/apk/* - -USER redis -VOLUME /data -WORKDIR /data - -EXPOSE 6379 -CMD ["redis-server"] \ No newline at end of file diff --git a/images/redis/README.md b/images/redis/README.md index a6a07a45..82f576f0 100644 --- a/images/redis/README.md +++ b/images/redis/README.md @@ -1,2 +1,32 @@ # Redis ->Redis is an open source key-value store that functions as a data structure server. \ No newline at end of file +> Redis is an open source key-value store that functions as a data structure server. + +### start a redis instance + +`$ docker run -d --name redis redis` + +### start with persistent storage +`$ docker run --name some-redis -d redis redis-server --appendonly yes` +> If persistence is enabled, data is stored in the VOLUME /data, which can be used with --volumes-from some-volume-container or -v /docker/host/dir:/data (see docs.docker volumes). + +> For more about Redis Persistence, see http://redis.io/topics/persistence. + +### connecting via redis-cli +`$ docker run -it --network some-network --rm redis redis-cli -h some-redis` + +Additionally, If you want to use your own redis.conf ... +You can create your own Dockerfile that adds a redis.conf from the context into /data/, like so. +```Dockerfile +FROM redis +COPY redis.conf /usr/local/etc/redis/redis.conf +CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ] +``` + +Alternatively, you can specify something along the same lines with docker run options. + +`$ docker run -v /myredis/conf:/usr/local/etc/redis --name myredis redis redis-server /usr/local/etc/redis/redis.conf` + + +> Where /myredis/conf/ is a local directory containing your redis.conf file. Using this method means that there is no need for you to have a Dockerfile for your redis container. + +The mapped directory should be writable, as depending on the configuration and mode of operation, Redis may need to create additional configuration files or rewrite existing ones. diff --git a/images/redis/docker-compose.yml b/images/redis/docker-compose.yml deleted file mode 100644 index c89d3e82..00000000 --- a/images/redis/docker-compose.yml +++ /dev/null @@ -1,25 +0,0 @@ -version: '3' -services: - redis: - image: redis:alpine - ports: - - "6379:6379/tcp" - networks: - - frontend - deploy: - mode: replicatedaria - replicas: 4 - update_config: # 配置如何更新服务 - parallelism: 2 # 每次要更新的容器数量 - delay: 10s # 更新下一组容器前要等待的时间 - resources: - limits: - cpus: "0.5" - memory: 512M - restart_policy: - condition: on-failure - max_attempts: 3 - delay: 10s - -networks: - frontend: \ No newline at end of file diff --git a/images/redis/latest/Dockerfile b/images/redis/latest/Dockerfile new file mode 100644 index 00000000..38af7aa0 --- /dev/null +++ b/images/redis/latest/Dockerfile @@ -0,0 +1,14 @@ +FROM redis:alpine +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +USER redis + +VOLUME /data +WORKDIR /data + +ENTRYPOINT ["docker-entrypoint.sh"] + +EXPOSE 6379 +CMD ["redis-server"] diff --git a/images/rhel/6/Dockerfile b/images/rhel/6/Dockerfile new file mode 100644 index 00000000..bba12cbb --- /dev/null +++ b/images/rhel/6/Dockerfile @@ -0,0 +1,5 @@ +FROM registry.access.redhat.com/rhel6:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +CMD ["bash"] diff --git a/images/rhel/7/Dockerfile b/images/rhel/7/Dockerfile new file mode 100644 index 00000000..d8a1b56a --- /dev/null +++ b/images/rhel/7/Dockerfile @@ -0,0 +1,5 @@ +FROM registry.access.redhat.com/rhel7:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +CMD ["bash"] diff --git a/images/rhel/8/Dockerfile b/images/rhel/8/Dockerfile new file mode 100644 index 00000000..8b74f71f --- /dev/null +++ b/images/rhel/8/Dockerfile @@ -0,0 +1,5 @@ +FROM registry.access.redhat.com/ubi8:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +CMD ["bash"] diff --git a/images/rhel/minimal/Dockerfile b/images/rhel/minimal/Dockerfile new file mode 100644 index 00000000..6460a167 --- /dev/null +++ b/images/rhel/minimal/Dockerfile @@ -0,0 +1,5 @@ +FROM registry.access.redhat.com/rhel-minimal:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +CMD ["bash"] diff --git a/images/rockylinux/8/Dockerfile b/images/rockylinux/8/Dockerfile new file mode 100644 index 00000000..8eb5d53b --- /dev/null +++ b/images/rockylinux/8/Dockerfile @@ -0,0 +1,6 @@ +FROM rockylinux/rockylinux:8 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +CMD [ "/bash" ] diff --git a/images/rockylinux/latest/Dockerfile b/images/rockylinux/latest/Dockerfile new file mode 100644 index 00000000..0db7f389 --- /dev/null +++ b/images/rockylinux/latest/Dockerfile @@ -0,0 +1,6 @@ +FROM rockylinux/rockylinux:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +CMD [ "/bash" ] diff --git a/images/rsync/Dockerfile b/images/rsync/Dockerfile deleted file mode 100644 index d604acb8..00000000 --- a/images/rsync/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM imxieke/alpine:latest - -LABEL MAINTAINER="Sky" \ - MAIL="Sky@gfw.party" - -RUN apk update && \ - apk add --no-cache rsync && \ - rm -fr /var/cache/apk/* - -CMD [ "/bin/sh" ] \ No newline at end of file diff --git a/images/rsync/latest/Dockerfile b/images/rsync/latest/Dockerfile new file mode 100644 index 00000000..3af98dcd --- /dev/null +++ b/images/rsync/latest/Dockerfile @@ -0,0 +1,11 @@ +FROM imxieke/alpine:latest + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +RUN apk update && \ + apk add --no-cache rsync && \ + rm -fr /var/cache/apk/* + +CMD [ "/bin/sh" ] diff --git a/images/scientificlinux/7/Dockerfile b/images/scientificlinux/7/Dockerfile new file mode 100644 index 00000000..ce04c49e --- /dev/null +++ b/images/scientificlinux/7/Dockerfile @@ -0,0 +1,5 @@ +FROM sl:7 +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +CMD [ "/bash" ] diff --git a/images/scientificlinux/latest/Dockerfile b/images/scientificlinux/latest/Dockerfile new file mode 100644 index 00000000..b1f123a0 --- /dev/null +++ b/images/scientificlinux/latest/Dockerfile @@ -0,0 +1,5 @@ +FROM sl:latest +LABEL MAINTAINER="Cloudflying" \ + MAIL="" + +CMD [ "/bash" ] diff --git a/images/seedbox/Dockerfile b/images/seedbox/Dockerfile new file mode 100644 index 00000000..8cf58610 --- /dev/null +++ b/images/seedbox/Dockerfile @@ -0,0 +1,26 @@ +FROM alpine:3.12 +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +COPY conf/ /etc/aria2c/ + +RUN sed -i 's/dl-cdn.alpinelinux.org/repo.huaweicloud.com/g' /etc/apk/repositories \ + && echo 'nameserver 8.8.8.8' > /etc/resolv.conf \ + && apk add --no-cache --virtual .deps curl \ + && apk add --no-cache darkhttpd \ + && curl -L https://cloudflying-generic.pkg.coding.net/storage/mirrors/pkgs/aria2/aria2c-amd64 -o /usr/bin/aria2c \ + && chmod +x /usr/bin/aria2c \ + && mkdir -p /etc/aria2c \ + && chmod -R 777 /etc/aria2c \ + && mkdir -p /opt/ariang \ + && chmod -R 777 /opt/ariang \ + && mkdir -p /data/downloads \ + && chmod -R 777 /data/downloads \ + && cd /opt/ariang \ + && curl -L https://cloudflying-generic.pkg.coding.net/storage/mirrors/src/ariang/1.17.zip -o /opt/ariang/1.17.zip \ + && unzip 1.17.zip && rm -fr LICENSE && rm -fr 1.17.zip \ + && mv /etc/aria2c/entrypoint.sh /usr/bin/entrypoint.sh \ + && chmod +x /usr/bin/entrypoint.sh \ + && apk del .deps + +CMD ["/usr/bin/entrypoint.sh"] diff --git a/images/seedbox/README.md b/images/seedbox/README.md new file mode 100644 index 00000000..8c7258da --- /dev/null +++ b/images/seedbox/README.md @@ -0,0 +1,13 @@ +rtorrent | rutorrent | flood | transmission | qbittorrent + deluge | mktorrent | ffmpeg | filebrowser | linuxrar + + + +## Tools +- https://github.com/mescon/Muximux php manage tools +- glances, plexPy monitoring tools + +## Trackerlist +- https://ngosang.github.io/trackerslist/ +- https://trackerslist.com +- https://newtrackon.com \ No newline at end of file diff --git a/images/seedbox/conf/aria2c.conf b/images/seedbox/conf/aria2c.conf new file mode 100644 index 00000000..1cd11b41 --- /dev/null +++ b/images/seedbox/conf/aria2c.conf @@ -0,0 +1,272 @@ +## 下载连接相关 ## + +# 最大同时下载任务数, 运行时可修改, 默认:5 +max-concurrent-downloads=64 +# 同一服务器连接数, 添加时可指定, 默认:1 +# 官方的aria2最高设置为16, 如果需要设置任意数值请重新编译aria2 +max-connection-per-server=16 +# 整体下载速度限制, 运行时可修改, 默认:0(不限制) +max-overall-download-limit=0 +# 单个任务下载速度限制, 默认:0(不限制) +max-download-limit=0 +# 整体上传速度限制, 运行时可修改, 默认:0(不限制) +max-overall-upload-limit=0 +# 单个任务上传速度限制, 默认:0(不限制) +max-upload-limit=500kb +# 连接超时时间(秒)。默认:60 +connect-timeout=10 +# 禁用IPv6, 默认:false +# disable-ipv6=true +# 禁用https证书检查 +check-certificate=false +# 连接超时时间, 默认:60 +timeout=60 +# 最大重试次数, 设置为0表示不限制重试次数, 默认:5 +max-tries=5 +# 设置重试等待的秒数, 默认:0 +retry-wait=3 +# 比如此项值为 10M, 当文件为 20MB 会分成两段并使用两个来源下载, 文件为 15MB 则只使用一个来源下载。 +# 理论上值越小使用下载分段就越多,所能获得的实际线程数就越大,下载速度就越快,但受限于所下载文件服务器的策略。 +# 最小文件分片大小, 添加时可指定, 取值范围1M -1024M, 默认:20M +# 假定size=10M, 文件为20MiB 则使用两个来源下载; 文件为15MiB 则使用一个来源下载 +min-split-size=50M +# 单个任务最大线程数, 添加时可指定, 默认:5 +# 建议同max-connection-per-server设置为相同值 +split=64 +# GZip 支持,默认:false +http-accept-gzip=true +# URI 复用,默认: true +reuse-uri=false +# 禁用 netrc 支持,默认:false +no-netrc=true +# 允许覆盖,当相关控制文件(.aria2)不存在时从头开始重新下载。默认:false +allow-overwrite=false +# 文件自动重命名,此选项仅在 HTTP(S)/FTP 下载中有效。新文件名在名称之后扩展名之前加上一个点和一个数字(1..9999)。默认:true +auto-file-renaming=true +# HTTP/FTP 下载分片大小,所有分割都必须是此项值的倍数,最小值为 1M (增强版为 1K),默认:1M +piece-length=1M +# 允许分片大小变化。默认:false +# false:当分片大小与控制文件中的不同时将会中止下载 +# true:丢失部分下载进度继续下载 +allow-piece-length-change=true +# 使用 UTF-8 处理 Content-Disposition ,默认:false +content-disposition-default-utf8=true + + +## 文件保存相关 ## + +# 文件保存目录 +dir=/data/downloads +# 断点续传 +continue=true +# 始终尝试断点续传,无法断点续传则终止下载,默认:true +always-resume=false +# 不支持断点续传的 URI 数值,当 always-resume=false 时生效。 +# 达到这个数值从将头开始下载,值为 0 时所有 URI 不支持断点续传时才从头开始下载。 +max-resume-failure-tries=0 +# 文件未找到重试次数,默认:0 (禁用) +# 重试时同时会记录重试次数,所以也需要设置 max-tries 这个选项 +max-file-not-found=10 +# 获取服务器文件时间,默认:false +remote-time=true + +# 启用磁盘缓存, 0为禁用缓存, 需1.16以上版本, 默认:16M +disk-cache=32M + +## 日志设置 ## + +# 日志文件保存路径,忽略或设置为空为不保存,默认:不保存 +# log=/tmp/aria2c.log + +# 日志级别,可选 debug, info, notice, warn, error 。默认:debug +# log-level=notice + +# 控制台日志级别,可选 debug, info, notice, warn, error ,默认:notice +console-log-level=notice +# 下载进度摘要输出间隔时间(秒),0 为禁止输出。默认:60 +summary-interval=0 + +# 文件预分配方式, 能有效降低磁盘碎片, 默认:prealloc +# 预分配所需时间: none < falloc ? trunc < prealloc +# falloc和trunc则需要文件系统和内核支持 +# NTFS建议使用falloc, EXT3/4建议trunc, MAC 下需要注释此项 +# 文件预分配方式, 可选:none, prealloc, trunc, falloc, 默认:prealloc +# 预分配对于机械硬盘可有效降低磁盘碎片、提升磁盘读写性能、延长磁盘寿命。 +# 机械硬盘使用 ext4(具有扩展支持),btrfs,xfs 或 NTFS(仅 MinGW 编译版本)等文件系统建议设置为 falloc +# 若无法下载,提示 fallocate failed.cause:Operation not supported 则说明不支持,请设置为 none +# prealloc 分配速度慢, trunc 无实际作用,不推荐使用。 +# 固态硬盘不需要预分配,只建议设置为 none ,否则可能会导致双倍文件大小的数据写入,从而影响寿命。 +# file-allocation=none + +# 文件预分配大小限制。小于此选项值大小的文件不预分配空间,单位 K 或 M,默认:5M +no-file-allocation-limit=64M + +# 安静模式,禁止在控制台输出日志,默认:false +quiet=true + +## 进度保存相关 ## + +# 从会话文件中读取下载任务 +input-file=/etc/aria2c/aria2c.session +# 在Aria2退出时保存错误的、未完成的下载任务到会话文件 +save-session=/etc/aria2c/aria2c.session +# 定时保存会话, 0为退出时才保存, 需1.16.1以上版本, 默认:0 +save-session-interval=60 +# 自动保存任务进度的间隔时间(秒),0 为进程正常退出时保存,默认:60 +auto-save-interval=1 +# 强制保存,即使任务已完成也保存信息到会话文件, 默认:false +# 开启后会在任务完成后保留 .aria2 文件,文件被移除且任务存在的情况下重启后会重新下载。 +# 关闭后已完成的任务列表会在重启后清空。 +force-save=false + +## RPC相关设置 ## + +# 启用RPC, 默认:false +enable-rpc=true +# 允许所有来源, 默认:false +rpc-allow-origin-all=true +# 允许外部访问, 默认:false +rpc-listen-all=true +# RPC端口, 仅当默认端口被占用时修改 +rpc-listen-port=6800 +# 设置的RPC授权令牌, v1.18.4新增功能, 取代 --rpc-user 和 --rpc-passwd 选项 +rpc-secret=haspwd +# 启动SSL +# rpc-secure=true +# 证书文件, 如果启用SSL则需要配置证书文件, 例如用https连接aria2 +# rpc-certificate= +# rpc-private-key= +# 保存通过 WebUI(RPC) 上传的种子文件(.torrent),默认:true +# 所有涉及种子文件保存的选项都建议开启,不保存种子文件有任务丢失的风险。 +# 通过 RPC 自定义临时下载目录可能不会保存种子文件。 +rpc-save-upload-metadata=true +# RPC 最大请求大小 +rpc-max-request-size=10M + + +## 高级选项 ## + +# 启用异步 DNS 功能。默认:true +#async-dns=true + +# 指定异步 DNS 服务器列表,未指定则从 /etc/resolv.conf 中读取。 +#async-dns-server=119.29.29.29,223.5.5.5,8.8.8.8,1.1.1.1 +# 指定单个网络接口,可能的值:接口,IP地址,主机名 +# 如果接口具有多个 IP 地址,则建议指定 IP 地址。 +# 已知指定网络接口会影响依赖本地 RPC 的连接的功能场景,即通过 localhost 和 127.0.0.1 无法与 Aria2 服务端进行讯通。 +#interface= + +# 指定多个网络接口,多个值之间使用逗号(,)分隔。 +# 使用 interface 选项时会忽略此项。 +#multiple-interface + +## BT/PT下载相关 ## + +# 当下载的是一个种子(以.torrent结尾)时, 自动开始BT任务, 默认:true +# 下载种子文件(.torrent)自动开始下载, 默认:true,可选:false|mem +# true:保存种子文件 +# false:仅下载种子文件 +# mem:将种子保存在内存中 +follow-torrent=true +# 继续之前的BT任务时, 无需再次校验, 默认:false +bt-seed-unverified=true +# 保存磁力链接元数据为种子文件(.torrent文件), 默认:false +bt-save-metadata=true +# 单个种子最大连接数, 默认:55 0表示不限制 +bt-max-peers=0 +# 最小做种时间, 单位:分 +# seed-time = 60 +# 分离做种任务 +bt-detach-seed-only=true +# 删除 BT 下载任务中未选择文件,默认:false +bt-remove-unselected-file=true +# Try to download first and last pieces of each file first. This is useful for previewing files. +bt-prioritize-piece=head=32M,tail=32M +# BT监听端口, 当端口被屏蔽时使用, 默认:6881-6999 +listen-port=6802-6999 +# 单个种子最大连接数, 默认:55 +bt-max-peers=0 +# 加载已保存的元数据文件(.torrent),默认:false +bt-load-saved-metadata=true +# BT最低加密等级,可选:plain(明文),arc4(加密),默认:plain +#bt-min-crypto-level=arc4 +# BT强制加密, 默认: false +# 启用后将拒绝旧的 BT 握手协议并仅使用混淆握手及加密。可以解决部分运营商对 BT 下载的封锁,且有一定的防版权投诉与迅雷吸血效果。 +# 此选项相当于后面两个选项(bt-require-crypto=true, bt-min-crypto-level=arc4)的快捷开启方式,但不会修改这两个选项的值。 +bt-force-encryption=true +# BT加密需求,默认:false 强制加密, 防迅雷必备 +# 启用后拒绝与旧的 BitTorrent 握手协议(\19BitTorrent protocol)建立连接,始终使用混淆处理握手。 +#bt-require-crypto=true +# 打开DHT功能, PT需要禁用, 默认:true +enable-dht=true +# 打开IPv6 DHT功能, PT需要禁用 +enable-dht6=true +# DHT网络监听端口, 默认:6881-6999 +dht-listen-port=6802-6999 +# DHT(IPv4)文件 +dht-file-path=/etc/aria2c/dht.dat +# DHT(IPv6)文件 +dht-file-path6=/etc/aria2c/dht6.dat +# IPv4 DHT 网络引导节点 +dht-entry-point=dht.transmissionbt.com:6881 +# IPv6 DHT 网络引导节点 +dht-entry-point6=dht.transmissionbt.com:6881 + +# 本地节点查找, PT需要禁用, 默认:false +bt-enable-lpd=true +# 种子交换, PT需要禁用, 默认:true +enable-peer-exchange=true +# 每个种子限速, 对少种的PT很有用, 默认:50K +#bt-request-peer-speed-limit=10M +# 客户端伪装, PT需要 -UT341- -TR2770- -TR2940- +peer-id-prefix=-TR2770- +# user-agent=uTorrent/341(109279400)(30888) +# user agent uTorrent/341(109279400)(30888) +user-agent=Transmission/2.77 +# user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4160.0 Safari/537.36 Edg/85.0.537.0 +# BT 客户端伪装 +# PT 下载需要保持 user-agent 和 peer-agent 两个参数一致 +# 部分 PT 站对 Aria2 有特殊封禁机制,客户端伪装不一定有效,且有封禁账号的风险。 +#user-agent=qBittorrent/4.2.5 +#peer-agent=qBittorrent/4.2.5 +peer-agent=Transmission/2.94 +# 当种子的分享率达到这个数时, 自动停止做种, 0为一直做种, 默认:1.0 +seed-ratio=1.0 +# BT校验相关, 默认:true +bt-hash-check-seed=false +# 仅下载种子文件 +bt-metadata-only=false +#通过网上的种子文件下载,种子保存在内存 https://github.com/ngosang/trackerslist +follow-torrent=true +# BT tracker 服务器连接超时时间(秒)。默认:60 +# 建立连接后,此选项无效,将使用 bt-tracker-timeout 选项的值 +bt-tracker-connect-timeout=10 +# BT tracker 服务器超时时间(秒)。默认:60 +bt-tracker-timeout=10 +# follow-torrent=mem +bt-tracker=http://1337.abcvg.info:80/announce,http://157.7.202.64:8080/announce,http://158.69.146.212:7777/announce,http://173.254.204.71:1096/announce,http://178.175.143.27:80/announce,http://178.33.73.26:2710/announce,http://182.176.139.129:6969/announce,http://185.5.97.139:8089/announce,http://185.83.215.123:6969/announce,http://188.165.253.109:1337/announce,http://194.106.216.222:80/announce,http://195.123.209.37:1337/announce,http://210.244.71.25:6969/announce,http://210.244.71.26:6969/announce,http://213.163.67.56:1337/announce,http://37.19.5.139:6969/announce,http://37.19.5.155:6881/announce,http://46.4.109.148:6969/announce,http://5.79.249.77:6969/announce,http://5.79.83.193:2710/announce,http://51.254.244.161:6969/announce,http://59.36.96.77:6969/announce,http://5rt.tace.ru:60889/announce,http://62.210.202.61:80/announce,http://74.82.52.209:6969/announce,http://78.30.254.12:2710/announce,http://80.246.243.18:6969/announce,http://81.200.2.231:80/announce,http://85.17.19.180:80/announce,http://87.110.238.140:6969/announce,http://87.248.186.252:8080/announce,http://87.253.152.137:80/announce,http://91.216.110.47:80/announce,http://91.217.91.21:3218/announce,http://91.218.230.81:6969/announce,http://93.92.64.5:80/announce,http://95.211.168.204:2710/announce,http://[2001:1b10:1000:8101:0:242:ac11:2]:6969/announce,http://[2001:470:1:189:0:1:2:3]:6969/announce,http://[2a04:ac00:1:3dd8::1:2710]:2710/announce,http://aaa.army:8866/announce,http://agusiq-torrents.pl:6969/announce,http://asnet.pw:2710/announce,http://atrack.pow7.com:80/announce,http://bobbialbano.com:6969/announce,http://bt.3kb.xyz:80/announce,http://bt.okmp3.ru:2710/announce,http://bt.pusacg.org:8080/announce,http://explodie.org:6969/announce,http://fxtt.ru:80/announce,http://h4.trakx.nibba.trade:80/announce,http://mail2.zelenaya.net:80/announce,http://milanesitracker.tekcities.com:80/announce,http://ns349743.ip-91-121-106.eu:80/announce,http://open.acgnxtracker.com:80/announce,http://open.acgtracker.com:1096/announce,http://open.lolicon.eu:7777/announce,http://open.touki.ru:80/announce.php,http://opentracker.i2p.rocks:6969/announce,http://p4p.arenabg.ch:1337/announce,http://p4p.arenabg.com:1337/announce,http://pow7.com:80/announce,http://pt.lax.mx:80/announce,http://retracker.bashtel.ru:80/announce,http://retracker.gorcomnet.ru:80/announce,http://retracker.hotplug.ru:2710/announce,http://retracker.krs-ix.ru:80/announce,http://retracker.mgts.by:80/announce,http://retracker.sevstar.net:2710/announce,http://retracker.spark-rostov.ru:80/announce,http://retracker.telecom.by:80/announce,http://rt.tace.ru:80/announce,http://secure.pow7.com:80/announce,http://share.camoe.cn:8080/announce,http://siambit.org:80/announce.php,http://t.acg.rip:6699/announce,http://t.nyaatracker.com:80/announce,http://t.overflow.biz:6969/announce,http://t1.pow7.com:80/announce,http://t2.pow7.com:80/announce,http://thetracker.org:80/announce,http://torrentclub.online:54123/announce,http://torrentsmd.com:8080/announce,http://torrentsmd.eu:8080/announce,http://torrenttracker.nwc.acsalaska.net:6969/announce,http://tr.cili001.com:8070/announce,http://tr.kxmp.cf:80/announce,http://tracker-cdn.moeking.me:2095/announce,http://tracker.aletorrenty.pl:2710/announce,http://tracker.anonwebz.xyz:8080/announce,http://tracker.birkenwald.de:6969/announce,http://tracker.bittor.pw:1337/announce,http://tracker.bittorrent.am:80/announce,http://tracker.bt4g.com:2095/announce,http://tracker.bz:80/announce,http://tracker.city9x.com:2710/announce,http://tracker.devil-torrents.pl:80/announce,http://tracker.dler.org:6969/announce,http://tracker.dutchtracking.nl:80/announce,http://tracker.edoardocolombo.eu:6969/announce,http://tracker.electro-torrent.pl:80/announce,http://tracker.ex.ua:80/announce,http://tracker.files.fm:6969/announce,http://tracker.flashtorrents.org:6969/announce,http://tracker.gbitt.info:80/announce,http://tracker.grepler.com:6969/announce,http://tracker.ipv6tracker.ru:80/announce,http://tracker.kuroy.me:5944/announce,http://tracker.lelux.fi:80/announce,http://tracker.mg64.net:6881/announce,http://tracker.moeking.me:6969/announce,http://tracker.noobsubs.net:80/announce,http://tracker.opentrackr.org:1337/announce,http://tracker.sakurato.xyz:23333/announce,http://tracker.skyts.net:6969/announce,http://tracker.sloppyta.co:80/announce,http://tracker.tfile.co:80/announce,http://tracker.tfile.me:80/announce,http://tracker.tiny-vps.com:6969/announce,http://tracker.torrentyorg.pl:80/announce,http://tracker.trackerfix.com:80/announce,http://tracker.tvunderground.org.ru:3218/announce,http://tracker.uw0.xyz:6969/announce,http://tracker.vraphim.com:6969/announce,http://tracker.yoshi210.com:6969/announce,http://tracker.zerobytes.xyz:1337/announce,http://tracker.zum.bi:6969/announce,http://tracker01.loveapp.com:6789/announce,http://tracker1.bt.moack.co.kr:80/announce,http://tracker1.itzmx.com:8080/announce,http://tracker1.wasabii.com.tw:6969/announce,http://tracker2.dler.org:80/announce,http://tracker2.itzmx.com:6961/announce,http://tracker3.itzmx.com:6961/announce,http://tracker4.itzmx.com:2710/announce,http://vpn.flying-datacenter.de:6969/announce,http://vps02.net.orel.ru:80/announce,http://www.loushao.net:8080/announce,http://www.wareztorrent.com:80/announce,https://1337.abcvg.info:443/announce,https://2.tracker.eu.org:443/announce,https://3.tracker.eu.org:443/announce,https://aaa.army:8866/announce,https://open.kickasstracker.com:443/announce,https://opentracker.acgnx.se:443/announce,https://tp.m-team.cc:443/announce.php,https://tr.ready4.icu:443/announce,https://tr.steins-gate.moe:2096/announce,https://tracker.bt-hash.com:443/announce,https://tracker.cyber-hub.net:443/announce,https://tracker.foreverpirates.co:443/announce,https://tracker.gbitt.info:443/announce,https://tracker.imgoingto.icu:443/announce,https://tracker.lelux.fi:443/announce,https://tracker.lilithraws.cf:443/announce,https://tracker.nanoha.org:443/announce,https://tracker.nitrix.me:443/announce,https://tracker.parrotsec.org:443/announce,https://tracker.sloppyta.co:443/announce,https://tracker.tamersunion.org:443/announce,https://trakx.herokuapp.com:443/announce,https://w.wwwww.wtf:443/announce,https://www.wareztorrent.com:443/announce,udp://151.80.120.114:2710/announce,udp://168.235.67.63:6969/announce,udp://178.33.73.26:2710/announce,udp://182.176.139.129:6969/announce,udp://185.5.97.139:8089/announce,udp://185.83.215.123:6969/announce,udp://185.86.149.205:1337/announce,udp://188.165.253.109:1337/announce,udp://191.101.229.236:1337/announce,udp://194.106.216.222:80/announce,udp://195.123.209.37:1337/announce,udp://195.123.209.40:80/announce,udp://208.67.16.113:8000/announce,udp://212.1.226.176:2710/announce,udp://212.47.227.58:6969/announce,udp://213.163.67.56:1337/announce,udp://37.19.5.155:2710/announce,udp://3rt.tace.ru:60889/announce,udp://46.4.109.148:6969/announce,udp://47.ip-51-68-199.eu:6969/announce,udp://5.79.249.77:6969/announce,udp://5.79.83.193:6969/announce,udp://51.254.244.161:6969/announce,udp://52.58.128.163:6969/announce,udp://62.138.0.158:6969/announce,udp://62.212.85.66:2710/announce,udp://6ahddutb1ucc3cp.ru:6969/announce,udp://6rt.tace.ru:80/announce,udp://74.82.52.209:6969/announce,udp://78.30.254.12:2710/announce,udp://85.17.19.180:80/announce,udp://89.234.156.205:80/announce,udp://9.rarbg.com:2710/announce,udp://9.rarbg.me:2710/announce,udp://9.rarbg.me:2780/announce,udp://9.rarbg.to:2710/announce,udp://9.rarbg.to:2730/announce,udp://91.216.110.52:451/announce,udp://91.218.230.81:6969/announce,udp://94.23.183.33:6969/announce,udp://95.211.168.204:2710/announce,udp://[2001:1b10:1000:8101:0:242:ac11:2]:6969/announce,udp://[2001:470:1:189:0:1:2:3]:6969/announce,udp://[2a03:7220:8083:cd00::1]:451/announce,udp://[2a04:ac00:1:3dd8::1:2710]:2710/announce,udp://[2a04:c44:e00:32e0:4cf:6aff:fe00:aa1]:6969/announce,udp://aaa.army:8866/announce,udp://adm.category5.tv:6969/announce,udp://admin.videoenpoche.info:6969/announce,udp://adminion.n-blade.ru:6969/announce,udp://anidex.moe:6969/announce,udp://api.bitumconference.ru:6969/announce,udp://aruacfilmes.com.br:6969/announce,udp://bclearning.top:6969/announce,udp://benouworldtrip.fr:6969/announce,udp://bioquantum.co.za:6969/announce,udp://bitsparadise.info:6969/announce,udp://blokas.io:6969/announce,udp://bms-hosxp.com:6969/announce,udp://bt.firebit.org:2710/announce,udp://bt1.archive.org:6969/announce,udp://bt2.3kb.xyz:6969/announce,udp://bt2.54new.com:8080/announce,udp://bt2.archive.org:6969/announce,udp://bubu.mapfactor.com:6969/announce,udp://camera.lei001.com:6969/announce,udp://cdn-1.gamecoast.org:6969/announce,udp://cdn-2.gamecoast.org:6969/announce,udp://chihaya.toss.li:9696/announce,udp://code2chicken.nl:6969/announce,udp://concen.org:6969/announce,udp://cutiegirl.ru:6969/announce,udp://daveking.com:6969/announce,udp://denis.stalker.upeer.me:6969/announce,udp://discord.heihachi.pw:6969/announce,udp://dpiui.reedlan.com:6969/announce,udp://drumkitx.com:6969/announce,udp://eddie4.nl:6969/announce,udp://edu.uifr.ru:6969/announce,udp://engplus.ru:6969/announce,udp://exodus.desync.com:6969/announce,udp://fe.dealclub.de:6969/announce,udp://forever-tracker.zooki.xyz:6969/announce,udp://free-tracker.zooki.xyz:6969/announce,udp://inferno.demonoid.is:3391/announce,udp://ipv4.tracker.harry.lu:80/announce,udp://ipv6.tracker.harry.lu:80/announce,udp://ipv6.tracker.zerobytes.xyz:16661/announce,udp://johnrosen1.com:6969/announce,udp://kanal-4.de:6969/announce,udp://line-net.ru:6969/announce,udp://ln.mtahost.co:6969/announce,udp://mail.realliferpg.de:6969/announce,udp://mgtracker.org:2710/announce,udp://movies.zsw.ca:6969/announce,udp://mts.tvbit.co:6969/announce,udp://nagios.tks.sumy.ua:80/announce,udp://ns-1.x-fins.com:6969/announce,udp://ns389251.ovh.net:6969/announce,udp://open.demonii.com:1337/announce,udp://open.demonii.si:1337/announce,udp://open.lolicon.eu:7777/announce,udp://open.stealth.si:80/announce,udp://opentor.org:2710/announce,udp://opentracker.i2p.rocks:6969/announce,udp://p4p.arenabg.ch:1337/announce,udp://public-tracker.zooki.xyz:6969/announce,udp://public.popcorn-tracker.org:6969/announce,udp://public.publictracker.xyz:6969/announce,udp://retracker.hotplug.ru:2710/announce,udp://retracker.lanta-net.ru:2710/announce,udp://retracker.netbynet.ru:2710/announce,udp://retracker.nts.su:2710/announce,udp://retracker.sevstar.net:2710/announce,udp://sd-161673.dedibox.fr:6969/announce,udp://shadowshq.eddie4.nl:6969/announce,udp://shadowshq.yi.org:6969/announce,udp://storage.groupees.com:6969/announce,udp://t1.leech.ie:1337/announce,udp://t2.leech.ie:1337/announce,udp://t3.leech.ie:1337/announce,udp://teamspeak.value-wolf.org:6969/announce,udp://thetracker.org:80/announce,udp://torrent.tdjs.tech:6969/announce,udp://torrentclub.online:54123/announce,udp://tr.bangumi.moe:6969/announce,udp://tr.cili001.com:8070/announce,udp://tr2.ysagin.top:2710/announce,udp://tracker-udp.gbitt.info:80/announce,udp://tracker-v6.zooki.xyz:6969/announce,udp://tracker.0x.tf:6969/announce,udp://tracker.aletorrenty.pl:2710/announce,udp://tracker.altrosky.nl:6969/announce,udp://tracker.army:6969/announce,udp://tracker.beeimg.com:6969/announce,udp://tracker.birkenwald.de:6969/announce,udp://tracker.bittor.pw:1337/announce,udp://tracker.coppersurfer.tk:6969/announce,udp://tracker.cyberia.is:6969/announce,udp://tracker.dler.org:6969/announce,udp://tracker.ds.is:6969/announce,udp://tracker.e-utp.net:6969/announce,udp://tracker.eddie4.nl:6969/announce,udp://tracker.ex.ua:80/announce,udp://tracker.filemail.com:6969/announce,udp://tracker.flashtorrents.org:6969/announce,udp://tracker.fortu.io:6969/announce,udp://tracker.grepler.com:6969/announce,udp://tracker.kali.org:6969/announce,udp://tracker.kuroy.me:5944/announce,udp://tracker.leechers-paradise.org:6969/announce,udp://tracker.lelux.fi:6969/announce,udp://tracker.moeking.me:6969/announce,udp://tracker.open-internet.nl:6969/announce,udp://tracker.opentrackr.org:1337/announce,udp://tracker.piratepublic.com:1337/announce,udp://tracker.publictracker.xyz:6969/announce,udp://tracker.shkinev.me:6969/announce,udp://tracker.sigterm.xyz:6969/announce,udp://tracker.skyts.net:6969/announce,udp://tracker.swateam.org.uk:2710/announce,udp://tracker.tiny-vps.com:6969/announce,udp://tracker.torrent.eu.org:451/announce,udp://tracker.tvunderground.org.ru:3218/announce,udp://tracker.uw0.xyz:6969/announce,udp://tracker.v6speed.org:6969/announce,udp://tracker.yoshi210.com:6969/announce,udp://tracker.zemoj.com:6969/announce,udp://tracker.zerobytes.xyz:1337/announce,udp://tracker.zum.bi:6969/announce,udp://tracker0.ufibox.com:6969/announce,udp://tracker1.bt.moack.co.kr:80/announce,udp://tracker1.itzmx.com:8080/announce,udp://tracker2.christianbro.pw:6969/announce,udp://tracker2.dler.org:80/announce,udp://tracker2.indowebster.com:6969/announce,udp://tracker2.itzmx.com:6961/announce,udp://tracker3.itzmx.com:6961/announce,udp://tracker4.itzmx.com:2710/announce,udp://u.wwwww.wtf:1/announce,udp://udp-tracker.shittyurl.org:6969/announce,udp://us-tracker.publictracker.xyz:6969/announce,udp://valakas.rollo.dnsabr.com:2710/announce,udp://vibe.community:6969/announce,udp://wassermann.online:6969/announce,udp://www.loushao.net:8080/announce,udp://z.mercax.com:53/announce,udp://zephir.monocul.us:6969/announce,udp://zer0day.ch:1337/announce,udp://zer0day.to:1337/announce,udp://9.rarbg.com:2710/announce,udp://tracker.skyts.net:6969/announce,udp://tracker.safe.moe:6969/announce,udp://tracker.piratepublic.com:1337/announce,udp://tracker.pirateparty.gr:6969/announce,udp://tracker.coppersurfer.tk:6969/announce,udp://tracker.leechers-paradise.org:6969/announce,udp://allesanddro.de:1337/announce,udp://p4p.arenabg.com:1337/announce,udp://tracker.opentrackr.org:1337/announce,udp://public.popcorn-tracker.org:6969/announce,udp://wambo.club:1337/announce,udp://trackerxyz.tk:1337/announce,udp://tracker4.itzmx.com:2710/announce,udp://tracker2.christianbro.pw:6969/announce,udp://tracker1.xku.tv:6969/announce,udp://tracker1.wasabii.com.tw:6969/announce,udp://tracker.zer0day.to:1337/announce + +## 执行额外命令 ## + +# 下载停止后执行的命令 +# 从 正在下载 到 删除、错误、完成 时触发。暂停被标记为未开始下载,故与此项无关。 +#on-download-stop=/root/.aria2/delete.sh + +# 下载完成后执行的命令 +# 此项未定义则执行 下载停止后执行的命令 (on-download-stop) +#on-download-complete=/root/.aria2/clean.sh + +# 下载错误后执行的命令 +# 此项未定义则执行 下载停止后执行的命令 (on-download-stop) +#on-download-error= + +# 下载暂停后执行的命令 +#on-download-pause= + +# 下载开始后执行的命令 +#on-download-start= + +# BT 下载完成后执行的命令 +#on-bt-download-complete= + +# sudo -Hu www aria2c --conf-path=/etc/aria2c/aria2c.conf -D diff --git a/images/seedbox/conf/aria2c.session b/images/seedbox/conf/aria2c.session new file mode 100644 index 00000000..e69de29b diff --git a/images/seedbox/conf/aria2c.torrents.conf b/images/seedbox/conf/aria2c.torrents.conf new file mode 100755 index 00000000..298a1e99 --- /dev/null +++ b/images/seedbox/conf/aria2c.torrents.conf @@ -0,0 +1,252 @@ +## 文件保存相关 ## + +# 文件保存目录 +dir=/mnt/data/Downloads/torrents + +# 启用磁盘缓存, 0为禁用缓存, 需1.16以上版本, 默认:16M +disk-cache=32M + +# 文件预分配方式, 能有效降低磁盘碎片, 默认:prealloc +# 预分配所需时间: none < falloc ? trunc < prealloc +# falloc和trunc则需要文件系统和内核支持 +# NTFS建议使用falloc, EXT3/4建议trunc, MAC 下需要注释此项 +# 文件预分配方式, 可选:none, prealloc, trunc, falloc, 默认:prealloc +# 预分配对于机械硬盘可有效降低磁盘碎片、提升磁盘读写性能、延长磁盘寿命。 +# 机械硬盘使用 ext4(具有扩展支持),btrfs,xfs 或 NTFS(仅 MinGW 编译版本)等文件系统建议设置为 falloc +# 若无法下载,提示 fallocate failed.cause:Operation not supported 则说明不支持,请设置为 none +# prealloc 分配速度慢, trunc 无实际作用,不推荐使用。 +# 固态硬盘不需要预分配,只建议设置为 none ,否则可能会导致双倍文件大小的数据写入,从而影响寿命。 +file-allocation=none +# 文件预分配大小限制。小于此选项值大小的文件不预分配空间,单位 K 或 M,默认:5M +no-file-allocation-limit=64M + +## 下载连接相关 ## +# 断点续传 +continue=true +# 始终尝试断点续传,无法断点续传则终止下载,默认:true +always-resume=false +# 文件未找到重试次数,默认:0 (禁用) +# 重试时同时会记录重试次数,所以也需要设置 max-tries 这个选项 +max-file-not-found=10 +# 最大同时下载任务数, 运行时可修改, 默认:5 +max-concurrent-downloads=64 +# 同一服务器连接数, 添加时可指定, 默认:1 +# 官方的aria2最高设置为16, 如果需要设置任意数值请重新编译aria2 +max-connection-per-server=16 +# 整体下载速度限制, 运行时可修改, 默认:0(不限制) +#max-overall-download-limit=0 +# 单个任务下载速度限制, 默认:0(不限制) +#max-download-limit=0 +# 禁用IPv6, 默认:false +# disable-ipv6=true +# 禁用https证书检查 +check-certificate=false +# 整体上传速度限制, 运行时可修改, 默认:0 +# 设置过低可能影响 BT 下载速度 +max-overall-upload-limit=0 +# 单个任务上传速度限制, 默认:0 +max-upload-limit=0 +# 连接超时时间, 默认:60 +timeout=10 +# 连接超时时间(秒)。默认:60 +connect-timeout=10 +# 最大重试次数, 设置为0表示不限制重试次数, 默认:5 +max-tries=5 +# 设置重试等待的秒数, 默认:0 +retry-wait=3 +# 最小文件分片大小, 添加时可指定, 取值范围1M -1024M, 默认:20M +# 假定size=10M, 文件为20MiB 则使用两个来源下载; 文件为15MiB 则使用一个来源下载 +min-split-size=5M +# HTTP/FTP 下载分片大小,所有分割都必须是此项值的倍数,最小值为 1M (增强版为 1K),默认:1M +piece-length=1M +# 允许分片大小变化。默认:false +# false:当分片大小与控制文件中的不同时将会中止下载 +# true:丢失部分下载进度继续下载 +allow-piece-length-change=true +# 单个任务最大线程数, 添加时可指定, 默认:5 +# 建议同max-connection-per-server设置为相同值 +split=64 +# GZip 支持,默认:false +http-accept-gzip=true +# URI 复用,默认: true +reuse-uri=false +# 禁用 netrc 支持,默认:false +no-netrc=true +# 允许覆盖,当相关控制文件(.aria2)不存在时从头开始重新下载。默认:false +allow-overwrite=true +# 文件自动重命名,此选项仅在 HTTP(S)/FTP 下载中有效。新文件名在名称之后扩展名之前加上一个点和一个数字(1..9999)。默认:true +auto-file-renaming=true + +# 使用 UTF-8 处理 Content-Disposition ,默认:false +content-disposition-default-utf8=true + +## 进度保存相关 ## + +# 从会话文件中读取下载任务 +input-file=/mnt/data/app/aria2c/aria2c.torrents.session +# 在Aria2退出时保存错误的、未完成的下载任务到会话文件 +save-session=/mnt/data/app/aria2c/aria2c.torrents.session +# 定时保存会话, 0为退出时才保存, 需1.16.1以上版本, 默认:0 +save-session-interval=60 +# 自动保存任务进度的间隔时间(秒),0 为进程正常退出时保存,默认:60 +auto-save-interval=1 +# 强制保存,即使任务已完成也保存信息到会话文件, 默认:false +# 开启后会在任务完成后保留 .aria2 文件,文件被移除且任务存在的情况下重启后会重新下载。 +# 关闭后已完成的任务列表会在重启后清空。 +force-save=false + +## RPC相关设置 ## + +# 启用RPC, 默认:false +enable-rpc=true +# 允许所有来源, 默认:false +rpc-allow-origin-all=true +# 允许外部访问, 默认:false +rpc-listen-all=true +# RPC端口, 仅当默认端口被占用时修改 +rpc-listen-port=6801 +# 设置的RPC授权令牌, v1.18.4新增功能, 取代 --rpc-user 和 --rpc-passwd 选项 +rpc-secret=secret +# 启动SSL +# rpc-secure=true +# 证书文件, 如果启用SSL则需要配置证书文件, 例如用https连接aria2 +# rpc-certificate= +# rpc-private-key= +# 保存通过 WebUI(RPC) 上传的种子文件(.torrent),默认:true +# 所有涉及种子文件保存的选项都建议开启,不保存种子文件有任务丢失的风险。 +# 通过 RPC 自定义临时下载目录可能不会保存种子文件。 +rpc-save-upload-metadata=true +# RPC 最大请求大小 +rpc-max-request-size=10M + +## BT/PT下载相关 ## + +# 当下载的是一个种子(以.torrent结尾)时, 自动开始BT任务, 默认:true +# 下载种子文件(.torrent)自动开始下载, 默认:true,可选:false|mem +# true:保存种子文件 +# false:仅下载种子文件 +# mem:将种子保存在内存中 +follow-torrent=false +# 强制保存会话, 即使任务已经完成, 默认:false +# 较新的版本开启后会在任务完成后依然保留.aria2文件 +#force-save=false +# 继续之前的BT任务时, 无需再次校验, 默认:false +bt-seed-unverified=true +# 保存磁力链接元数据为种子文件(.torrent文件), 默认:false +bt-save-metadata=true +# 加载已保存的元数据文件(.torrent),默认:false +bt-load-saved-metadata=true +# 单个种子最大连接数, 默认:55 0表示不限制 +bt-max-peers=0 +# 最小做种时间, 单位:分 +# seed-time = 60 +# 分离做种任务 +bt-detach-seed-only=true +# BT监听端口, 当端口被屏蔽时使用, 默认:6881-6999 +listen-port=7881-7998 +# Try to download first and last pieces of each file first. This is useful for previewing files. +bt-prioritize-piece=head +# 删除 BT 下载任务中未选择文件,默认:false +bt-remove-unselected-file=true +# BT加密需求,默认:false +# 启用后拒绝与旧的 BitTorrent 握手协议(\19BitTorrent protocol)建立连接,始终使用混淆处理握手。 +#bt-require-crypto=true + +# BT最低加密等级,可选:plain(明文),arc4(加密),默认:plain +#bt-min-crypto-level=arc4 +# BT强制加密, 默认: false +# 启用后将拒绝旧的 BT 握手协议并仅使用混淆握手及加密。可以解决部分运营商对 BT 下载的封锁,且有一定的防版权投诉与迅雷吸血效果。 +# 此选项相当于后面两个选项(bt-require-crypto=true, bt-min-crypto-level=arc4)的快捷开启方式,但不会修改这两个选项的值。 +bt-force-encryption=false +# 打开DHT功能, PT需要禁用, 默认:true +enable-dht=true +# 打开IPv6 DHT功能, PT需要禁用 +enable-dht6=true + +# DHT网络监听端口, 默认:6881-6999 +dht-listen-port=7881-7999 +# DHT(IPv4)文件 +dht-file-path=/mnt/data/app/aria2c/dht.dat +# DHT(IPv6)文件 +dht-file-path6=/mnt/data/app/aria2c/dht6.dat +# IPv4 DHT 网络引导节点 +dht-entry-point=dht.transmissionbt.com:6881 +# IPv6 DHT 网络引导节点 +dht-entry-point6=dht.transmissionbt.com:6881 + +# 本地节点查找, PT需要禁用, 默认:false +bt-enable-lpd=true +# 种子交换, PT需要禁用, 默认:true +enable-peer-exchange=true +# 每个种子限速, 对少种的PT很有用, 默认:50K +# bt-request-peer-speed-limit=10M +# 客户端伪装, PT需要 -UT341- -TR2770- -TR2940- +peer-id-prefix=-TR2770- +# user-agent=uTorrent/341(109279400)(30888) +user-agent=Transmission/2.77 +# user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4160.0 Safari/537.36 Edg/85.0.537.0 + +# BT 客户端伪装 +# PT 下载需要保持 user-agent 和 peer-agent 两个参数一致 +# 部分 PT 站对 Aria2 有特殊封禁机制,客户端伪装不一定有效,且有封禁账号的风险。 +#user-agent=qBittorrent/4.2.5 +#peer-agent=qBittorrent/4.2.5 +peer-agent=Transmission/2.94 + +## 日志设置 ## + +# 日志文件保存路径,忽略或设置为空为不保存,默认:不保存 +log=/mnt/data/app/aria2c/aria2c.log + +# 日志级别,可选 debug, info, notice, warn, error 。默认:debug +log-level=notice + +# 控制台日志级别,可选 debug, info, notice, warn, error ,默认:notice +console-log-level=notice + +# 安静模式,禁止在控制台输出日志,默认:false +quiet=false + +# 当种子的分享率达到这个数时, 自动停止做种, 0为一直做种, 默认:1.0 +# 强烈建议您将此选项设置为大于等于 1.0 +seed-ratio=1.0 +# 强制保存会话, 话即使任务已经完成, 默认:false +# 较新的版本开启后会在任务完成后依然保留.aria2文件 +#force-save=false +# BT校验相关, 默认:true +bt-hash-check-seed=false +#仅下载种子文件 +bt-metadata-only=true +# BT tracker 服务器超时时间(秒)。默认:60 +bt-tracker-timeout=10 +# BT tracker 服务器连接超时时间(秒)。默认:60 +# 建立连接后,此选项无效,将使用 bt-tracker-timeout 选项的值 +bt-tracker-connect-timeout=10 + + +## 执行额外命令 ## + +# 下载停止后执行的命令 +# 从 正在下载 到 删除、错误、完成 时触发。暂停被标记为未开始下载,故与此项无关。 +#on-download-stop=/root/.aria2/delete.sh + +# 下载完成后执行的命令 +# 此项未定义则执行 下载停止后执行的命令 (on-download-stop) +#on-download-complete=/root/.aria2/clean.sh + +# 下载错误后执行的命令 +# 此项未定义则执行 下载停止后执行的命令 (on-download-stop) +#on-download-error= + +# 下载暂停后执行的命令 +#on-download-pause= + +# 下载开始后执行的命令 +#on-download-start= + +# BT 下载完成后执行的命令 +#on-bt-download-complete= + +#通过网上的种子文件下载,种子保存在内存 https://github.com/ngosang/trackerslist + +bt-tracker=http://1337.abcvg.info:80/announce,http://157.7.202.64:8080/announce,http://158.69.146.212:7777/announce,http://173.254.204.71:1096/announce,http://178.175.143.27:80/announce,http://178.33.73.26:2710/announce,http://182.176.139.129:6969/announce,http://185.5.97.139:8089/announce,http://185.83.215.123:6969/announce,http://188.165.253.109:1337/announce,http://194.106.216.222:80/announce,http://195.123.209.37:1337/announce,http://210.244.71.25:6969/announce,http://210.244.71.26:6969/announce,http://213.163.67.56:1337/announce,http://37.19.5.139:6969/announce,http://37.19.5.155:6881/announce,http://46.4.109.148:6969/announce,http://5.79.249.77:6969/announce,http://5.79.83.193:2710/announce,http://51.254.244.161:6969/announce,http://59.36.96.77:6969/announce,http://5rt.tace.ru:60889/announce,http://62.210.202.61:80/announce,http://74.82.52.209:6969/announce,http://78.30.254.12:2710/announce,http://80.246.243.18:6969/announce,http://81.200.2.231:80/announce,http://85.17.19.180:80/announce,http://87.110.238.140:6969/announce,http://87.248.186.252:8080/announce,http://87.253.152.137:80/announce,http://91.216.110.47:80/announce,http://91.217.91.21:3218/announce,http://91.218.230.81:6969/announce,http://93.92.64.5:80/announce,http://95.211.168.204:2710/announce,http://[2001:1b10:1000:8101:0:242:ac11:2]:6969/announce,http://[2001:470:1:189:0:1:2:3]:6969/announce,http://[2a04:ac00:1:3dd8::1:2710]:2710/announce,http://aaa.army:8866/announce,http://agusiq-torrents.pl:6969/announce,http://asnet.pw:2710/announce,http://atrack.pow7.com:80/announce,http://bobbialbano.com:6969/announce,http://bt.3kb.xyz:80/announce,http://bt.okmp3.ru:2710/announce,http://bt.pusacg.org:8080/announce,http://explodie.org:6969/announce,http://fxtt.ru:80/announce,http://h4.trakx.nibba.trade:80/announce,http://mail2.zelenaya.net:80/announce,http://milanesitracker.tekcities.com:80/announce,http://ns349743.ip-91-121-106.eu:80/announce,http://open.acgnxtracker.com:80/announce,http://open.acgtracker.com:1096/announce,http://open.lolicon.eu:7777/announce,http://open.touki.ru:80/announce.php,http://opentracker.i2p.rocks:6969/announce,http://p4p.arenabg.ch:1337/announce,http://p4p.arenabg.com:1337/announce,http://pow7.com:80/announce,http://pt.lax.mx:80/announce,http://retracker.bashtel.ru:80/announce,http://retracker.gorcomnet.ru:80/announce,http://retracker.hotplug.ru:2710/announce,http://retracker.krs-ix.ru:80/announce,http://retracker.mgts.by:80/announce,http://retracker.sevstar.net:2710/announce,http://retracker.spark-rostov.ru:80/announce,http://retracker.telecom.by:80/announce,http://rt.tace.ru:80/announce,http://secure.pow7.com:80/announce,http://share.camoe.cn:8080/announce,http://siambit.org:80/announce.php,http://t.acg.rip:6699/announce,http://t.nyaatracker.com:80/announce,http://t.overflow.biz:6969/announce,http://t1.pow7.com:80/announce,http://t2.pow7.com:80/announce,http://thetracker.org:80/announce,http://torrentclub.online:54123/announce,http://torrentsmd.com:8080/announce,http://torrentsmd.eu:8080/announce,http://torrenttracker.nwc.acsalaska.net:6969/announce,http://tr.cili001.com:8070/announce,http://tr.kxmp.cf:80/announce,http://tracker-cdn.moeking.me:2095/announce,http://tracker.aletorrenty.pl:2710/announce,http://tracker.anonwebz.xyz:8080/announce,http://tracker.birkenwald.de:6969/announce,http://tracker.bittor.pw:1337/announce,http://tracker.bittorrent.am:80/announce,http://tracker.bt4g.com:2095/announce,http://tracker.bz:80/announce,http://tracker.city9x.com:2710/announce,http://tracker.devil-torrents.pl:80/announce,http://tracker.dler.org:6969/announce,http://tracker.dutchtracking.nl:80/announce,http://tracker.edoardocolombo.eu:6969/announce,http://tracker.electro-torrent.pl:80/announce,http://tracker.ex.ua:80/announce,http://tracker.files.fm:6969/announce,http://tracker.flashtorrents.org:6969/announce,http://tracker.gbitt.info:80/announce,http://tracker.grepler.com:6969/announce,http://tracker.ipv6tracker.ru:80/announce,http://tracker.kuroy.me:5944/announce,http://tracker.lelux.fi:80/announce,http://tracker.mg64.net:6881/announce,http://tracker.moeking.me:6969/announce,http://tracker.noobsubs.net:80/announce,http://tracker.opentrackr.org:1337/announce,http://tracker.sakurato.xyz:23333/announce,http://tracker.skyts.net:6969/announce,http://tracker.sloppyta.co:80/announce,http://tracker.tfile.co:80/announce,http://tracker.tfile.me:80/announce,http://tracker.tiny-vps.com:6969/announce,http://tracker.torrentyorg.pl:80/announce,http://tracker.trackerfix.com:80/announce,http://tracker.tvunderground.org.ru:3218/announce,http://tracker.uw0.xyz:6969/announce,http://tracker.vraphim.com:6969/announce,http://tracker.yoshi210.com:6969/announce,http://tracker.zerobytes.xyz:1337/announce,http://tracker.zum.bi:6969/announce,http://tracker01.loveapp.com:6789/announce,http://tracker1.bt.moack.co.kr:80/announce,http://tracker1.itzmx.com:8080/announce,http://tracker1.wasabii.com.tw:6969/announce,http://tracker2.dler.org:80/announce,http://tracker2.itzmx.com:6961/announce,http://tracker3.itzmx.com:6961/announce,http://tracker4.itzmx.com:2710/announce,http://vpn.flying-datacenter.de:6969/announce,http://vps02.net.orel.ru:80/announce,http://www.loushao.net:8080/announce,http://www.wareztorrent.com:80/announce,https://1337.abcvg.info:443/announce,https://2.tracker.eu.org:443/announce,https://3.tracker.eu.org:443/announce,https://aaa.army:8866/announce,https://open.kickasstracker.com:443/announce,https://opentracker.acgnx.se:443/announce,https://tp.m-team.cc:443/announce.php,https://tr.ready4.icu:443/announce,https://tr.steins-gate.moe:2096/announce,https://tracker.bt-hash.com:443/announce,https://tracker.cyber-hub.net:443/announce,https://tracker.foreverpirates.co:443/announce,https://tracker.gbitt.info:443/announce,https://tracker.imgoingto.icu:443/announce,https://tracker.lelux.fi:443/announce,https://tracker.lilithraws.cf:443/announce,https://tracker.nanoha.org:443/announce,https://tracker.nitrix.me:443/announce,https://tracker.parrotsec.org:443/announce,https://tracker.sloppyta.co:443/announce,https://tracker.tamersunion.org:443/announce,https://trakx.herokuapp.com:443/announce,https://w.wwwww.wtf:443/announce,https://www.wareztorrent.com:443/announce,udp://151.80.120.114:2710/announce,udp://168.235.67.63:6969/announce,udp://178.33.73.26:2710/announce,udp://182.176.139.129:6969/announce,udp://185.5.97.139:8089/announce,udp://185.83.215.123:6969/announce,udp://185.86.149.205:1337/announce,udp://188.165.253.109:1337/announce,udp://191.101.229.236:1337/announce,udp://194.106.216.222:80/announce,udp://195.123.209.37:1337/announce,udp://195.123.209.40:80/announce,udp://208.67.16.113:8000/announce,udp://212.1.226.176:2710/announce,udp://212.47.227.58:6969/announce,udp://213.163.67.56:1337/announce,udp://37.19.5.155:2710/announce,udp://3rt.tace.ru:60889/announce,udp://46.4.109.148:6969/announce,udp://47.ip-51-68-199.eu:6969/announce,udp://5.79.249.77:6969/announce,udp://5.79.83.193:6969/announce,udp://51.254.244.161:6969/announce,udp://52.58.128.163:6969/announce,udp://62.138.0.158:6969/announce,udp://62.212.85.66:2710/announce,udp://6ahddutb1ucc3cp.ru:6969/announce,udp://6rt.tace.ru:80/announce,udp://74.82.52.209:6969/announce,udp://78.30.254.12:2710/announce,udp://85.17.19.180:80/announce,udp://89.234.156.205:80/announce,udp://9.rarbg.com:2710/announce,udp://9.rarbg.me:2710/announce,udp://9.rarbg.me:2780/announce,udp://9.rarbg.to:2710/announce,udp://9.rarbg.to:2730/announce,udp://91.216.110.52:451/announce,udp://91.218.230.81:6969/announce,udp://94.23.183.33:6969/announce,udp://95.211.168.204:2710/announce,udp://[2001:1b10:1000:8101:0:242:ac11:2]:6969/announce,udp://[2001:470:1:189:0:1:2:3]:6969/announce,udp://[2a03:7220:8083:cd00::1]:451/announce,udp://[2a04:ac00:1:3dd8::1:2710]:2710/announce,udp://[2a04:c44:e00:32e0:4cf:6aff:fe00:aa1]:6969/announce,udp://aaa.army:8866/announce,udp://adm.category5.tv:6969/announce,udp://admin.videoenpoche.info:6969/announce,udp://adminion.n-blade.ru:6969/announce,udp://anidex.moe:6969/announce,udp://api.bitumconference.ru:6969/announce,udp://aruacfilmes.com.br:6969/announce,udp://bclearning.top:6969/announce,udp://benouworldtrip.fr:6969/announce,udp://bioquantum.co.za:6969/announce,udp://bitsparadise.info:6969/announce,udp://blokas.io:6969/announce,udp://bms-hosxp.com:6969/announce,udp://bt.firebit.org:2710/announce,udp://bt1.archive.org:6969/announce,udp://bt2.3kb.xyz:6969/announce,udp://bt2.54new.com:8080/announce,udp://bt2.archive.org:6969/announce,udp://bubu.mapfactor.com:6969/announce,udp://camera.lei001.com:6969/announce,udp://cdn-1.gamecoast.org:6969/announce,udp://cdn-2.gamecoast.org:6969/announce,udp://chihaya.toss.li:9696/announce,udp://code2chicken.nl:6969/announce,udp://concen.org:6969/announce,udp://cutiegirl.ru:6969/announce,udp://daveking.com:6969/announce,udp://denis.stalker.upeer.me:6969/announce,udp://discord.heihachi.pw:6969/announce,udp://dpiui.reedlan.com:6969/announce,udp://drumkitx.com:6969/announce,udp://eddie4.nl:6969/announce,udp://edu.uifr.ru:6969/announce,udp://engplus.ru:6969/announce,udp://exodus.desync.com:6969/announce,udp://fe.dealclub.de:6969/announce,udp://forever-tracker.zooki.xyz:6969/announce,udp://free-tracker.zooki.xyz:6969/announce,udp://inferno.demonoid.is:3391/announce,udp://ipv4.tracker.harry.lu:80/announce,udp://ipv6.tracker.harry.lu:80/announce,udp://ipv6.tracker.zerobytes.xyz:16661/announce,udp://johnrosen1.com:6969/announce,udp://kanal-4.de:6969/announce,udp://line-net.ru:6969/announce,udp://ln.mtahost.co:6969/announce,udp://mail.realliferpg.de:6969/announce,udp://mgtracker.org:2710/announce,udp://movies.zsw.ca:6969/announce,udp://mts.tvbit.co:6969/announce,udp://nagios.tks.sumy.ua:80/announce,udp://ns-1.x-fins.com:6969/announce,udp://ns389251.ovh.net:6969/announce,udp://open.demonii.com:1337/announce,udp://open.demonii.si:1337/announce,udp://open.lolicon.eu:7777/announce,udp://open.stealth.si:80/announce,udp://opentor.org:2710/announce,udp://opentracker.i2p.rocks:6969/announce,udp://p4p.arenabg.ch:1337/announce,udp://public-tracker.zooki.xyz:6969/announce,udp://public.popcorn-tracker.org:6969/announce,udp://public.publictracker.xyz:6969/announce,udp://retracker.hotplug.ru:2710/announce,udp://retracker.lanta-net.ru:2710/announce,udp://retracker.netbynet.ru:2710/announce,udp://retracker.nts.su:2710/announce,udp://retracker.sevstar.net:2710/announce,udp://sd-161673.dedibox.fr:6969/announce,udp://shadowshq.eddie4.nl:6969/announce,udp://shadowshq.yi.org:6969/announce,udp://storage.groupees.com:6969/announce,udp://t1.leech.ie:1337/announce,udp://t2.leech.ie:1337/announce,udp://t3.leech.ie:1337/announce,udp://teamspeak.value-wolf.org:6969/announce,udp://thetracker.org:80/announce,udp://torrent.tdjs.tech:6969/announce,udp://torrentclub.online:54123/announce,udp://tr.bangumi.moe:6969/announce,udp://tr.cili001.com:8070/announce,udp://tr2.ysagin.top:2710/announce,udp://tracker-udp.gbitt.info:80/announce,udp://tracker-v6.zooki.xyz:6969/announce,udp://tracker.0x.tf:6969/announce,udp://tracker.aletorrenty.pl:2710/announce,udp://tracker.altrosky.nl:6969/announce,udp://tracker.army:6969/announce,udp://tracker.beeimg.com:6969/announce,udp://tracker.birkenwald.de:6969/announce,udp://tracker.bittor.pw:1337/announce,udp://tracker.coppersurfer.tk:6969/announce,udp://tracker.cyberia.is:6969/announce,udp://tracker.dler.org:6969/announce,udp://tracker.ds.is:6969/announce,udp://tracker.e-utp.net:6969/announce,udp://tracker.eddie4.nl:6969/announce,udp://tracker.ex.ua:80/announce,udp://tracker.filemail.com:6969/announce,udp://tracker.flashtorrents.org:6969/announce,udp://tracker.fortu.io:6969/announce,udp://tracker.grepler.com:6969/announce,udp://tracker.kali.org:6969/announce,udp://tracker.kuroy.me:5944/announce,udp://tracker.leechers-paradise.org:6969/announce,udp://tracker.lelux.fi:6969/announce,udp://tracker.moeking.me:6969/announce,udp://tracker.open-internet.nl:6969/announce,udp://tracker.opentrackr.org:1337/announce,udp://tracker.piratepublic.com:1337/announce,udp://tracker.publictracker.xyz:6969/announce,udp://tracker.shkinev.me:6969/announce,udp://tracker.sigterm.xyz:6969/announce,udp://tracker.skyts.net:6969/announce,udp://tracker.swateam.org.uk:2710/announce,udp://tracker.tiny-vps.com:6969/announce,udp://tracker.torrent.eu.org:451/announce,udp://tracker.tvunderground.org.ru:3218/announce,udp://tracker.uw0.xyz:6969/announce,udp://tracker.v6speed.org:6969/announce,udp://tracker.yoshi210.com:6969/announce,udp://tracker.zemoj.com:6969/announce,udp://tracker.zerobytes.xyz:1337/announce,udp://tracker.zum.bi:6969/announce,udp://tracker0.ufibox.com:6969/announce,udp://tracker1.bt.moack.co.kr:80/announce,udp://tracker1.itzmx.com:8080/announce,udp://tracker2.christianbro.pw:6969/announce,udp://tracker2.dler.org:80/announce,udp://tracker2.indowebster.com:6969/announce,udp://tracker2.itzmx.com:6961/announce,udp://tracker3.itzmx.com:6961/announce,udp://tracker4.itzmx.com:2710/announce,udp://u.wwwww.wtf:1/announce,udp://udp-tracker.shittyurl.org:6969/announce,udp://us-tracker.publictracker.xyz:6969/announce,udp://valakas.rollo.dnsabr.com:2710/announce,udp://vibe.community:6969/announce,udp://wassermann.online:6969/announce,udp://www.loushao.net:8080/announce,udp://z.mercax.com:53/announce,udp://zephir.monocul.us:6969/announce,udp://zer0day.ch:1337/announce,udp://zer0day.to:1337/announce diff --git a/images/seedbox/conf/build.sh b/images/seedbox/conf/build.sh new file mode 100755 index 00000000..bd2ac92e --- /dev/null +++ b/images/seedbox/conf/build.sh @@ -0,0 +1,101 @@ +#!/usr/bin/env bash + + +USER='www' +VERSION=$(bin/aria2c -v | grep 'aria2 version' | awk -F ' ' '{print $3}') +CONF=`pwd`/aria2c.conf + +# 检查环境 不足则补充 +env() +{ + BIT=$(getconf LONG_BIT) + USER_EXIST=$(grep '^www:' /etc/passwd) # 为空则不存在 + if [[ -z ${USER_EXIST} ]]; then + useradd ${USER} + fi +} + + +clear_env() +{ + if [[ -z $(command -v sudo) ]]; then + echo ' command sudo not found' + fi + + if [[ -z $(command -v curl) ]]; then + echo ' command curl not found' + fi + + userdel ${USER} +} + +do_start() +{ + CMD="sudo -Hu ${USER} bin/aria2c --conf-path=${CONF} -D >> aria2c.run.log" + ${CMD} + + PID=$(ps -aux | grep -v grep | grep aria2c | awk -F ' ' '{print $2}') + if [[ ! -z ${PID} ]]; then + echo "==> Aria2c is start complete pid: ${PID}" + fi +} + +do_stop() +{ + echo "==> Aria2c is running Stop it now" + PID=$(ps -aux | grep -v grep | grep aria2c | awk -F ' ' '{print $2}') + + if [[ -z ${PID} ]]; then + echo "==> Aria2c is running, pid: ${PID} , Stop it Now" + fi + kill -9 ${PID} +} + +do_reload() +{ + do_stop + do_start +} + +# 更新 aria2c 依赖的数据 +do_update() +{ + TRACKERS=$(curl -sL https://cdn.jsdelivr.net/gh/XIU2/TrackersListCollection@master/all_aria2.txt) + sed -i "/^bt-tracker=/d" ${CONF} + echo " +bt-tracker=${TRACKERS}" >> ${CONF} + echo "Update Tracker Complete" +} + +usage(){ +echo "Aria Command Line Helper +" + +} + +do_get_hash() +{ + CMD="bin/aria2c --bt-metadata-only=true --bt-save-metadata=true --bt-tracker=http://1337.abcvg.info:80/announce,http://157.7.202.64:8080/announce,http://158.69.146.212:7777/announce,http://173.254.204.71:1096/announce,http://178.175.143.27:80/announce,http://178.33.73.26:2710/announce,http://182.176.139.129:6969/announce,http://185.5.97.139:8089/announce,http://185.83.215.123:6969/announce,http://188.165.253.109:1337/announce,http://194.106.216.222:80/announce,http://195.123.209.37:1337/announce,http://210.244.71.25:6969/announce,http://210.244.71.26:6969/announce,http://213.163.67.56:1337/announce,http://37.19.5.139:6969/announce,http://37.19.5.155:6881/announce,http://46.4.109.148:6969/announce,http://5.79.249.77:6969/announce,http://5.79.83.193:2710/announce,http://51.254.244.161:6969/announce,http://59.36.96.77:6969/announce,http://5rt.tace.ru:60889/announce,http://62.210.202.61:80/announce,http://74.82.52.209:6969/announce,http://78.30.254.12:2710/announce,http://80.246.243.18:6969/announce,http://81.200.2.231:80/announce,http://85.17.19.180:80/announce,http://87.110.238.140:6969/announce,http://87.248.186.252:8080/announce,http://87.253.152.137:80/announce,http://91.216.110.47:80/announce,http://91.217.91.21:3218/announce,http://91.218.230.81:6969/announce,http://93.92.64.5:80/announce,http://95.211.168.204:2710/announce,http://[2001:1b10:1000:8101:0:242:ac11:2]:6969/announce,http://[2001:470:1:189:0:1:2:3]:6969/announce,http://[2a04:ac00:1:3dd8::1:2710]:2710/announce,http://aaa.army:8866/announce,http://agusiq-torrents.pl:6969/announce,http://asnet.pw:2710/announce,http://atrack.pow7.com:80/announce,http://bobbialbano.com:6969/announce,http://bt.3kb.xyz:80/announce,http://bt.okmp3.ru:2710/announce,http://bt.pusacg.org:8080/announce,http://explodie.org:6969/announce,http://fxtt.ru:80/announce,http://h4.trakx.nibba.trade:80/announce,http://mail2.zelenaya.net:80/announce,http://milanesitracker.tekcities.com:80/announce,http://ns349743.ip-91-121-106.eu:80/announce,http://open.acgnxtracker.com:80/announce,http://open.acgtracker.com:1096/announce,http://open.lolicon.eu:7777/announce,http://open.touki.ru:80/announce.php,http://opentracker.i2p.rocks:6969/announce,http://p4p.arenabg.ch:1337/announce,http://p4p.arenabg.com:1337/announce,http://pow7.com:80/announce,http://pt.lax.mx:80/announce,http://retracker.bashtel.ru:80/announce,http://retracker.gorcomnet.ru:80/announce,http://retracker.hotplug.ru:2710/announce,http://retracker.krs-ix.ru:80/announce,http://retracker.mgts.by:80/announce,http://retracker.sevstar.net:2710/announce,http://retracker.spark-rostov.ru:80/announce,http://retracker.telecom.by:80/announce,http://rt.tace.ru:80/announce,http://secure.pow7.com:80/announce,http://share.camoe.cn:8080/announce,http://siambit.org:80/announce.php,http://t.acg.rip:6699/announce,http://t.nyaatracker.com:80/announce,http://t.overflow.biz:6969/announce,http://t1.pow7.com:80/announce,http://t2.pow7.com:80/announce,http://thetracker.org:80/announce,http://torrentclub.online:54123/announce,http://torrentsmd.com:8080/announce,http://torrentsmd.eu:8080/announce,http://torrenttracker.nwc.acsalaska.net:6969/announce,http://tr.cili001.com:8070/announce,http://tr.kxmp.cf:80/announce,http://tracker-cdn.moeking.me:2095/announce,http://tracker.aletorrenty.pl:2710/announce,http://tracker.anonwebz.xyz:8080/announce,http://tracker.birkenwald.de:6969/announce,http://tracker.bittor.pw:1337/announce,http://tracker.bittorrent.am:80/announce,http://tracker.bt4g.com:2095/announce,http://tracker.bz:80/announce,http://tracker.city9x.com:2710/announce,http://tracker.devil-torrents.pl:80/announce,http://tracker.dler.org:6969/announce,http://tracker.dutchtracking.nl:80/announce,http://tracker.edoardocolombo.eu:6969/announce,http://tracker.electro-torrent.pl:80/announce,http://tracker.ex.ua:80/announce,http://tracker.files.fm:6969/announce,http://tracker.flashtorrents.org:6969/announce,http://tracker.gbitt.info:80/announce,http://tracker.grepler.com:6969/announce,http://tracker.ipv6tracker.ru:80/announce,http://tracker.kuroy.me:5944/announce,http://tracker.lelux.fi:80/announce,http://tracker.mg64.net:6881/announce,http://tracker.moeking.me:6969/announce,http://tracker.noobsubs.net:80/announce,http://tracker.opentrackr.org:1337/announce,http://tracker.sakurato.xyz:23333/announce,http://tracker.skyts.net:6969/announce,http://tracker.sloppyta.co:80/announce,http://tracker.tfile.co:80/announce,http://tracker.tfile.me:80/announce,http://tracker.tiny-vps.com:6969/announce,http://tracker.torrentyorg.pl:80/announce,http://tracker.trackerfix.com:80/announce,http://tracker.tvunderground.org.ru:3218/announce,http://tracker.uw0.xyz:6969/announce,http://tracker.vraphim.com:6969/announce,http://tracker.yoshi210.com:6969/announce,http://tracker.zerobytes.xyz:1337/announce,http://tracker.zum.bi:6969/announce,http://tracker01.loveapp.com:6789/announce,http://tracker1.bt.moack.co.kr:80/announce,http://tracker1.itzmx.com:8080/announce,http://tracker1.wasabii.com.tw:6969/announce,http://tracker2.dler.org:80/announce,http://tracker2.itzmx.com:6961/announce,http://tracker3.itzmx.com:6961/announce,http://tracker4.itzmx.com:2710/announce,http://vpn.flying-datacenter.de:6969/announce,http://vps02.net.orel.ru:80/announce,http://www.loushao.net:8080/announce,http://www.wareztorrent.com:80/announce,https://1337.abcvg.info:443/announce,https://2.tracker.eu.org:443/announce,https://3.tracker.eu.org:443/announce,https://aaa.army:8866/announce,https://open.kickasstracker.com:443/announce,https://opentracker.acgnx.se:443/announce,https://tp.m-team.cc:443/announce.php,https://tr.ready4.icu:443/announce,https://tr.steins-gate.moe:2096/announce,https://tracker.bt-hash.com:443/announce,https://tracker.cyber-hub.net:443/announce,https://tracker.foreverpirates.co:443/announce,https://tracker.gbitt.info:443/announce,https://tracker.imgoingto.icu:443/announce,https://tracker.lelux.fi:443/announce,https://tracker.lilithraws.cf:443/announce,https://tracker.nanoha.org:443/announce,https://tracker.nitrix.me:443/announce,https://tracker.parrotsec.org:443/announce,https://tracker.sloppyta.co:443/announce,https://tracker.tamersunion.org:443/announce,https://trakx.herokuapp.com:443/announce,https://w.wwwww.wtf:443/announce,https://www.wareztorrent.com:443/announce,udp://151.80.120.114:2710/announce,udp://168.235.67.63:6969/announce,udp://178.33.73.26:2710/announce,udp://182.176.139.129:6969/announce,udp://185.5.97.139:8089/announce,udp://185.83.215.123:6969/announce,udp://185.86.149.205:1337/announce,udp://188.165.253.109:1337/announce,udp://191.101.229.236:1337/announce,udp://194.106.216.222:80/announce,udp://195.123.209.37:1337/announce,udp://195.123.209.40:80/announce,udp://208.67.16.113:8000/announce,udp://212.1.226.176:2710/announce,udp://212.47.227.58:6969/announce,udp://213.163.67.56:1337/announce,udp://37.19.5.155:2710/announce,udp://3rt.tace.ru:60889/announce,udp://46.4.109.148:6969/announce,udp://47.ip-51-68-199.eu:6969/announce,udp://5.79.249.77:6969/announce,udp://5.79.83.193:6969/announce,udp://51.254.244.161:6969/announce,udp://52.58.128.163:6969/announce,udp://62.138.0.158:6969/announce,udp://62.212.85.66:2710/announce,udp://6ahddutb1ucc3cp.ru:6969/announce,udp://6rt.tace.ru:80/announce,udp://74.82.52.209:6969/announce,udp://78.30.254.12:2710/announce,udp://85.17.19.180:80/announce,udp://89.234.156.205:80/announce,udp://9.rarbg.com:2710/announce,udp://9.rarbg.me:2710/announce,udp://9.rarbg.me:2780/announce,udp://9.rarbg.to:2710/announce,udp://9.rarbg.to:2730/announce,udp://91.216.110.52:451/announce,udp://91.218.230.81:6969/announce,udp://94.23.183.33:6969/announce,udp://95.211.168.204:2710/announce,udp://[2001:1b10:1000:8101:0:242:ac11:2]:6969/announce,udp://[2001:470:1:189:0:1:2:3]:6969/announce,udp://[2a03:7220:8083:cd00::1]:451/announce,udp://[2a04:ac00:1:3dd8::1:2710]:2710/announce,udp://[2a04:c44:e00:32e0:4cf:6aff:fe00:aa1]:6969/announce,udp://aaa.army:8866/announce,udp://adm.category5.tv:6969/announce,udp://admin.videoenpoche.info:6969/announce,udp://adminion.n-blade.ru:6969/announce,udp://anidex.moe:6969/announce,udp://api.bitumconference.ru:6969/announce,udp://aruacfilmes.com.br:6969/announce,udp://bclearning.top:6969/announce,udp://benouworldtrip.fr:6969/announce,udp://bioquantum.co.za:6969/announce,udp://bitsparadise.info:6969/announce,udp://blokas.io:6969/announce,udp://bms-hosxp.com:6969/announce,udp://bt.firebit.org:2710/announce,udp://bt1.archive.org:6969/announce,udp://bt2.3kb.xyz:6969/announce,udp://bt2.54new.com:8080/announce,udp://bt2.archive.org:6969/announce,udp://bubu.mapfactor.com:6969/announce,udp://camera.lei001.com:6969/announce,udp://cdn-1.gamecoast.org:6969/announce,udp://cdn-2.gamecoast.org:6969/announce,udp://chihaya.toss.li:9696/announce,udp://code2chicken.nl:6969/announce,udp://concen.org:6969/announce,udp://cutiegirl.ru:6969/announce,udp://daveking.com:6969/announce,udp://denis.stalker.upeer.me:6969/announce,udp://discord.heihachi.pw:6969/announce,udp://dpiui.reedlan.com:6969/announce,udp://drumkitx.com:6969/announce,udp://eddie4.nl:6969/announce,udp://edu.uifr.ru:6969/announce,udp://engplus.ru:6969/announce,udp://exodus.desync.com:6969/announce,udp://fe.dealclub.de:6969/announce,udp://forever-tracker.zooki.xyz:6969/announce,udp://free-tracker.zooki.xyz:6969/announce,udp://inferno.demonoid.is:3391/announce,udp://ipv4.tracker.harry.lu:80/announce,udp://ipv6.tracker.harry.lu:80/announce,udp://ipv6.tracker.zerobytes.xyz:16661/announce,udp://johnrosen1.com:6969/announce,udp://kanal-4.de:6969/announce,udp://line-net.ru:6969/announce,udp://ln.mtahost.co:6969/announce,udp://mail.realliferpg.de:6969/announce,udp://mgtracker.org:2710/announce,udp://movies.zsw.ca:6969/announce,udp://mts.tvbit.co:6969/announce,udp://nagios.tks.sumy.ua:80/announce,udp://ns-1.x-fins.com:6969/announce,udp://ns389251.ovh.net:6969/announce,udp://open.demonii.com:1337/announce,udp://open.demonii.si:1337/announce,udp://open.lolicon.eu:7777/announce,udp://open.stealth.si:80/announce,udp://opentor.org:2710/announce,udp://opentracker.i2p.rocks:6969/announce,udp://p4p.arenabg.ch:1337/announce,udp://public-tracker.zooki.xyz:6969/announce,udp://public.popcorn-tracker.org:6969/announce,udp://public.publictracker.xyz:6969/announce,udp://retracker.hotplug.ru:2710/announce,udp://retracker.lanta-net.ru:2710/announce,udp://retracker.netbynet.ru:2710/announce,udp://retracker.nts.su:2710/announce,udp://retracker.sevstar.net:2710/announce,udp://sd-161673.dedibox.fr:6969/announce,udp://shadowshq.eddie4.nl:6969/announce,udp://shadowshq.yi.org:6969/announce,udp://storage.groupees.com:6969/announce,udp://t1.leech.ie:1337/announce,udp://t2.leech.ie:1337/announce,udp://t3.leech.ie:1337/announce,udp://teamspeak.value-wolf.org:6969/announce,udp://thetracker.org:80/announce,udp://torrent.tdjs.tech:6969/announce,udp://torrentclub.online:54123/announce,udp://tr.bangumi.moe:6969/announce,udp://tr.cili001.com:8070/announce,udp://tr2.ysagin.top:2710/announce,udp://tracker-udp.gbitt.info:80/announce,udp://tracker-v6.zooki.xyz:6969/announce,udp://tracker.0x.tf:6969/announce,udp://tracker.aletorrenty.pl:2710/announce,udp://tracker.altrosky.nl:6969/announce,udp://tracker.army:6969/announce,udp://tracker.beeimg.com:6969/announce,udp://tracker.birkenwald.de:6969/announce,udp://tracker.bittor.pw:1337/announce,udp://tracker.coppersurfer.tk:6969/announce,udp://tracker.cyberia.is:6969/announce,udp://tracker.dler.org:6969/announce,udp://tracker.ds.is:6969/announce,udp://tracker.e-utp.net:6969/announce,udp://tracker.eddie4.nl:6969/announce,udp://tracker.ex.ua:80/announce,udp://tracker.filemail.com:6969/announce,udp://tracker.flashtorrents.org:6969/announce,udp://tracker.fortu.io:6969/announce,udp://tracker.grepler.com:6969/announce,udp://tracker.kali.org:6969/announce,udp://tracker.kuroy.me:5944/announce,udp://tracker.leechers-paradise.org:6969/announce,udp://tracker.lelux.fi:6969/announce,udp://tracker.moeking.me:6969/announce,udp://tracker.open-internet.nl:6969/announce,udp://tracker.opentrackr.org:1337/announce,udp://tracker.piratepublic.com:1337/announce,udp://tracker.publictracker.xyz:6969/announce,udp://tracker.shkinev.me:6969/announce,udp://tracker.sigterm.xyz:6969/announce,udp://tracker.skyts.net:6969/announce,udp://tracker.swateam.org.uk:2710/announce,udp://tracker.tiny-vps.com:6969/announce,udp://tracker.torrent.eu.org:451/announce,udp://tracker.tvunderground.org.ru:3218/announce,udp://tracker.uw0.xyz:6969/announce,udp://tracker.v6speed.org:6969/announce,udp://tracker.yoshi210.com:6969/announce,udp://tracker.zemoj.com:6969/announce,udp://tracker.zerobytes.xyz:1337/announce,udp://tracker.zum.bi:6969/announce,udp://tracker0.ufibox.com:6969/announce,udp://tracker1.bt.moack.co.kr:80/announce,udp://tracker1.itzmx.com:8080/announce,udp://tracker2.christianbro.pw:6969/announce,udp://tracker2.dler.org:80/announce,udp://tracker2.indowebster.com:6969/announce,udp://tracker2.itzmx.com:6961/announce,udp://tracker3.itzmx.com:6961/announce,udp://tracker4.itzmx.com:2710/announce,udp://u.wwwww.wtf:1/announce,udp://udp-tracker.shittyurl.org:6969/announce,udp://us-tracker.publictracker.xyz:6969/announce,udp://valakas.rollo.dnsabr.com:2710/announce,udp://vibe.community:6969/announce,udp://wassermann.online:6969/announce,udp://www.loushao.net:8080/announce,udp://z.mercax.com:53/announce,udp://zephir.monocul.us:6969/announce,udp://zer0day.ch:1337/announce,udp://zer0day.to:1337/announce magnet:?xt=urn:btih:"$1 + $CMD +} + +case $1 in + r|-r|run) + do_start + ;; + reload) + do_reload + ;; + stop) + do_stop + ;; + u|-u|update) + do_update + ;; + -d|get-hash) + do_get_hash $2 + ;; + *|help) + usage + ;; +esac \ No newline at end of file diff --git a/images/seedbox/conf/delete.sh b/images/seedbox/conf/delete.sh new file mode 100644 index 00000000..caf6b0ce --- /dev/null +++ b/images/seedbox/conf/delete.sh @@ -0,0 +1,21 @@ +#!/bin/bash +filePath=$3 +relativePath=${filepath#./downloads/} +topPath=./downloads/${relativePath%%/*} # It will be the path of folder when it has multiple files, otherwise it will be the same as file path. + +LIGHT_GREEN_FONT_PREFIX="\033[1;32m" +FONT_COLOR_SUFFIX="\033[0m" +INFO="[${LIGHT_GREEN_FONT_PREFIX}INFO${FONT_COLOR_SUFFIX}]" + +echo -e "$(date +"%m/%d %H:%M:%S") ${INFO} Download error or stop, start deleting files..." + +if [ $2 -eq 0 ]; then + exit 0 +elif [ -e "${filePath}.aria2" ]; then + rm -vf "${filePath}.aria2" "${filePath}" +elif [ -e "${topPath}.aria2" ]; then + rm -vrf "${topPath}.aria2" "${topPath}" +fi +find "${topPath}" ! -path "${topPath}" -depth -type d -empty -exec rm -vrf {} \; + +echo -e "$(date +"%m/%d %H:%M:%S") ${INFO} Download error or stop, start deleting files finish" diff --git a/images/seedbox/conf/dht.dat b/images/seedbox/conf/dht.dat new file mode 100644 index 00000000..11dec6e8 Binary files /dev/null and b/images/seedbox/conf/dht.dat differ diff --git a/images/seedbox/conf/dht6.dat b/images/seedbox/conf/dht6.dat new file mode 100755 index 00000000..7b643350 Binary files /dev/null and b/images/seedbox/conf/dht6.dat differ diff --git a/images/seedbox/conf/entrypoint.sh b/images/seedbox/conf/entrypoint.sh new file mode 100644 index 00000000..7d072d85 --- /dev/null +++ b/images/seedbox/conf/entrypoint.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env sh +ARIA2_CONF='/etc/aria2c/aria2c.conf' +if [[ -z "${ARIA2_PORT}" ]]; then + ARIA2_PORT=6800 +fi + +if [[ -z "${WEBUI_PORT}" ]]; then + WEBUI_PORT=6801 +fi + +if [[ -z "${DHT_PORT}" ]]; then + DHT_PORT='6802:6999' +fi + +if [[ -z "${RPC_SECRET}" ]]; then + RPC_SECRET='haspwd' +fi + +sed -i "s/ARIA2_PORT/${ARIA2_PORT}/g" ${ARIA2_CONF} +sed -i "s/RPC_SECRET/${RPC_SECRET}/g" ${ARIA2_CONF} +sed -i "s/DHT_PORT/${DHT_PORT}/g" ${ARIA2_CONF} + +aria2c --conf-path=/etc/aria2c/aria2c.conf -D +darkhttpd /opt/ariang --port ${WEBUI_PORT} --daemon >>/dev/null +echo -e " + Welcome to Aria2c Container is Running + +Aria2 Port : 127.0.0.1:${ARIA2_PORT} +WEBUI Port : 127.0.0.1:${WEBUI_PORT} +RPC Secret : ${RPC_SECRET} + +" > /tmp/welcome.log + + +tail -f /tmp/welcome.log diff --git a/images/seedbox/conf/on-complete.sh b/images/seedbox/conf/on-complete.sh new file mode 100644 index 00000000..3ff1e105 --- /dev/null +++ b/images/seedbox/conf/on-complete.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +filePath=$3 +relativePath=${filepath#./downloads/} +topPath=./downloads/${relativePath%%/*} # It will be the path of folder when it has multiple files, otherwise it will be the same as file path. + +LIGHT_GREEN_FONT_PREFIX="\033[1;32m" +FONT_COLOR_SUFFIX="\033[0m" +INFO="[${LIGHT_GREEN_FONT_PREFIX}INFO${FONT_COLOR_SUFFIX}]" + +echo -e "$(date +"%m/%d %H:%M:%S") ${INFO} Delete .aria2 file ..." + +if [ $2 -eq 0 ]; then + exit 0 +elif [ -e "${filepath}.aria2" ]; then + rm -vf "${filepath}.aria2" +elif [ -e "${topPath}.aria2" ]; then + rm -vf "${topPath}.aria2" +fi +echo -e "$(date +"%m/%d %H:%M:%S") ${INFO} Delete .aria2 file finish" +echo "$(($(cat numUpload)+1))" > numUpload # Plus 1 + +if [[ $2 -eq 1 ]]; then # single file + rclone -v --config="rclone.conf" copy "$3" "DRIVE:$RCLONE_DESTINATION" 2>&1 +elif [[ $2 -gt 1 ]]; then # multiple file + rclone -v --config="rclone.conf" copy "$topPath" "DRIVE:$RCLONE_DESTINATION/${relativePath%%/*}" +fi + +echo "$(($(cat numUpload)-1))" > numUpload # Minus 1 diff --git a/images/seedbox/conf/on-delete.sh b/images/seedbox/conf/on-delete.sh new file mode 100755 index 00000000..0aa56199 --- /dev/null +++ b/images/seedbox/conf/on-delete.sh @@ -0,0 +1,81 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2018-2020 P3TERX +# +# This is free software, licensed under the MIT License. +# See /LICENSE for more information. +# +# https://github.com/P3TERX/aria2.conf +# File name:delete.sh +# Description: Delete files after Aria2 download error or task removed +# Version: 3.0 +# + +CHECK_CORE_FILE() { + CORE_FILE="$(dirname $0)/core" + if [[ -f "${CORE_FILE}" ]]; then + . "${CORE_FILE}" + else + echo "!!! core file does not exist !!!" + exit 1 + fi +} + +CHECK_RPC_CONECTION() { + READ_ARIA2_CONF + if [[ "${RPC_SECRET}" ]]; then + RPC_PAYLOAD='{"jsonrpc":"2.0","method":"aria2.getVersion","id":"P3TERX","params":["token:'${RPC_SECRET}'"]}' + else + RPC_PAYLOAD='{"jsonrpc":"2.0","method":"aria2.getVersion","id":"P3TERX"}' + fi + (curl "${RPC_ADDRESS}" -fsSd "${RPC_PAYLOAD}" || curl "https://${RPC_ADDRESS}" -kfsSd "${RPC_PAYLOAD}") >/dev/null +} + +DELETE_ON_STOP() { + if [[ "${TASK_STATUS}" = "error" && "${DELETE_ON_ERROR}" = "true" ]] || [[ "${TASK_STATUS}" = "removed" && "${DELETE_ON_REMOVED}" = "true" ]]; then + if [[ -f "${TASK_PATH}.aria2" ]]; then + echo -e "$(DATE_TIME) ${INFO} Download task ${TASK_STATUS}, deleting files..." + rm -vrf "${TASK_PATH}.aria2" "${TASK_PATH}" + else + [[ -e "${TASK_PATH}" ]] && + echo -e "$(DATE_TIME) ${WARRING} Skip delete. Download completed files: ${TASK_PATH}" || + echo -e "$(DATE_TIME) ${WARRING} Skip delete. File does not exist: ${TASK_PATH}" + fi + else + echo -e "$(DATE_TIME) ${WARRING} Skip delete. Task status invalid: ${TASK_STATUS}" + fi +} + +DELETE_ON_UNKNOWN() { + if [[ -f "${FILE_PATH}.aria2" ]]; then + echo -e "$(DATE_TIME) ${INFO} Download task force removed, deleting files..." + rm -vrf "${FILE_PATH}.aria2" "${FILE_PATH}" + else + [[ -e "${FILE_PATH}" ]] && + echo -e "$(DATE_TIME) ${WARRING} Skip delete. Download completed files: ${FILE_PATH}" || + echo -e "$(DATE_TIME) ${WARRING} Skip delete. File does not exist: ${FILE_PATH}" + fi +} + +DELETE_FILE() { + if GET_TASK_INFO; then + GET_DOWNLOAD_DIR + GET_TASK_STATUS + CONVERSION_PATH + DELETE_ON_STOP + DELETE_DOT_TORRENT + DELETE_EMPTY_DIR + elif CHECK_RPC_CONECTION && [[ "${DELETE_ON_UNKNOWN}" = "true" && ${FILE_NUM} -eq 1 ]]; then + DELETE_ON_UNKNOWN + else + echo -e "$(DATE_TIME) ${ERROR} Aria2 RPC interface error!" + exit 1 + fi +} + +CHECK_CORE_FILE "$@" +CHECK_PARAMETER "$@" +CHECK_FILE_NUM +CHECK_SCRIPT_CONF +DELETE_FILE +exit 0 diff --git a/images/seedbox/conf/on-move.sh b/images/seedbox/conf/on-move.sh new file mode 100755 index 00000000..ee1e961d --- /dev/null +++ b/images/seedbox/conf/on-move.sh @@ -0,0 +1,81 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2018-2020 P3TERX +# +# This is free software, licensed under the MIT License. +# See /LICENSE for more information. +# +# https://github.com/P3TERX/aria2.conf +# File name:move.sh +# Description: Move files after Aria2 download is complete +# Version: 3.0 +# + +CHECK_CORE_FILE() { + CORE_FILE="$(dirname $0)/core" + if [[ -f "${CORE_FILE}" ]]; then + . "${CORE_FILE}" + else + echo "!!! core file does not exist !!!" + exit 1 + fi +} + +TASK_INFO() { + echo -e " +-------------------------- [${YELLOW_FONT_PREFIX}Task Infomation${FONT_COLOR_SUFFIX}] -------------------------- +${LIGHT_PURPLE_FONT_PREFIX}Task GID:${FONT_COLOR_SUFFIX} ${TASK_GID} +${LIGHT_PURPLE_FONT_PREFIX}Number of Files:${FONT_COLOR_SUFFIX} ${FILE_NUM} +${LIGHT_PURPLE_FONT_PREFIX}First File Path:${FONT_COLOR_SUFFIX} ${FILE_PATH} +${LIGHT_PURPLE_FONT_PREFIX}Task File Name:${FONT_COLOR_SUFFIX} ${TASK_FILE_NAME} +${LIGHT_PURPLE_FONT_PREFIX}Task Path:${FONT_COLOR_SUFFIX} ${TASK_PATH} +${LIGHT_PURPLE_FONT_PREFIX}Aria2 Download Directory:${FONT_COLOR_SUFFIX} ${ARIA2_DOWNLOAD_DIR} +${LIGHT_PURPLE_FONT_PREFIX}Custom Download Directory:${FONT_COLOR_SUFFIX} ${DOWNLOAD_DIR} +${LIGHT_PURPLE_FONT_PREFIX}Source Path:${FONT_COLOR_SUFFIX} ${SOURCE_PATH} +${LIGHT_PURPLE_FONT_PREFIX}Destination Path:${FONT_COLOR_SUFFIX} ${DEST_PATH} +${LIGHT_PURPLE_FONT_PREFIX}.aria2 File Path:${FONT_COLOR_SUFFIX} ${DOT_ARIA2_FILE} +-------------------------- [${YELLOW_FONT_PREFIX}Task Infomation${FONT_COLOR_SUFFIX}] -------------------------- +" +} + +OUTPUT_MOVE_LOG() { + LOG="${MOVE_LOG}" + LOG_PATH="${MOVE_LOG_PATH}" + OUTPUT_LOG +} + +DEFINITION_PATH() { + SOURCE_PATH="${TASK_PATH}" + if [[ "${DOWNLOAD_DIR}" != "${ARIA2_DOWNLOAD_DIR}" && "${DOWNLOAD_DIR}" =~ "${ARIA2_DOWNLOAD_DIR}" ]]; then + DEST_PATH="${DEST_DIR}${DEST_PATH_SUFFIX%/*}" + else + DEST_PATH="${DEST_DIR}" + fi +} + +MOVE_FILE() { + echo -e "$(DATE_TIME) ${INFO} Start move files ..." + TASK_INFO + mkdir -p "${DEST_PATH}" + mv -vf "${SOURCE_PATH}" "${DEST_PATH}" + MOVE_EXIT_CODE=$? + if [ ${MOVE_EXIT_CODE} -eq 0 ]; then + MOVE_LOG="$(DATE_TIME) ${INFO} Move done: ${SOURCE_PATH} -> ${DEST_PATH}" + else + MOVE_LOG="$(DATE_TIME) ${ERROR} Move failed: ${SOURCE_PATH}" + fi + OUTPUT_MOVE_LOG + DELETE_EMPTY_DIR +} + +CHECK_CORE_FILE "$@" +CHECK_PARAMETER "$@" +CHECK_FILE_NUM +CHECK_SCRIPT_CONF +GET_TASK_INFO +GET_DOWNLOAD_DIR +CONVERSION_PATH +DEFINITION_PATH +CLEAN_UP +MOVE_FILE +exit 0 diff --git a/images/seedbox/conf/rtorrent.rc b/images/seedbox/conf/rtorrent.rc new file mode 100644 index 00000000..ef1602f7 --- /dev/null +++ b/images/seedbox/conf/rtorrent.rc @@ -0,0 +1,72 @@ +# This is the rtorrent configuration file installed by rtinst script - https://github.com/arakasi72/rtinst +# This file is installed to ~/.rtorrent.rc +# Enable/modify the options as needed, uncomment the options you wish to enable. +# This configuration will work with most systems, but optimal settings are dependant on specific server setup + +### Set Directories +method.insert = cfg.basedir, private|const|string, (cat,"/rtorrent/") +method.insert = cfg.watch, private|const|string, (cat,(cfg.basedir),"watch/") + +#method.insert = cfg.logs, private|const|string, (cat,(cfg.basedir),"log/") +#method.insert = cfg.logfile, private|const|string, (cat,(cfg.logs),"rtorrent-",(system.time),".log") + +session.path.set = (cat,(cfg.basedir),".session") +directory.default.set = (cat,(cfg.basedir),"download") + +schedule = watch_directory,5,5,((load.start,(cat,(cfg.watch),"*.torrent"))) + +#system.umask.set = 0000 + +### BitTorrent +# Global upload and download rate in KiB, `0` for unlimited +throttle.global_down.max_rate.set = 0 +throttle.global_up.max_rate.set = 0 + +# Maximum number of simultaneous downloads and uploads slots +throttle.max_downloads.global.set = 150 +throttle.max_uploads.global.set = 150 + +# Maximum and minimum number of peers to connect to per torrent while downloading +throttle.min_peers.normal.set = 30 +throttle.max_peers.normal.set = 150 + +# Same as above but for seeding completed torrents (seeds per torrent) +throttle.min_peers.seed.set = -1 +throttle.max_peers.seed.set = -1 + +### Networking +network.port_range.set = 51001-51250 +network.port_random.set = yes +dht.mode.set = disable +protocol.pex.set = no +trackers.use_udp.set = yes + +# network.scgi.open_port = localhost:5000 +network.scgi.open_port = 127.0.0.1:5000 +network.http.ssl_verify_peer.set = 0 +protocol.encryption.set = allow_incoming,enable_retry,prefer_plaintext + +network.max_open_files.set = 4096 +network.max_open_sockets.set = 1536 +network.http.max_open.set = 48 +network.send_buffer.size.set = 4M +network.receive_buffer.size.set = 4M + +### Memory Settings +pieces.hash.on_completion.set = no +pieces.preload.type.set = 1 +pieces.memory.max.set = 3500M + +### Logging: +# Levels = critical error warn notice info debug +# Groups = connection_* dht_* peer_* rpc_* storage_* thread_* tracker_* torrent_* +#print = (cat,"Logging to ",(cfg.logfile)) +#log.open_file = "log", (cfg.logfile) +#log.add_output = "info", "log" +#log.add_output = "tracker_debug", "log" + + +### The following line initialises rutorrent plugins without needing to open the web interface +execute = {sh,-c,/usr/bin/php /var/www/rutorrent/php/initplugins.php &} + +#EOF diff --git a/images/selenium/node-chrome/Dockerfile b/images/selenium/node-chrome/Dockerfile new file mode 100644 index 00000000..9db82875 --- /dev/null +++ b/images/selenium/node-chrome/Dockerfile @@ -0,0 +1,7 @@ +FROM selenium/node-chrome:latest + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +EXPOSE 4444 diff --git a/images/selenium/node-edge/Dockerfile b/images/selenium/node-edge/Dockerfile new file mode 100644 index 00000000..08c2e4b9 --- /dev/null +++ b/images/selenium/node-edge/Dockerfile @@ -0,0 +1,7 @@ +FROM selenium/node-edge:latest + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +EXPOSE 4444 diff --git a/images/selenium/node-firefox/Dockerfile b/images/selenium/node-firefox/Dockerfile new file mode 100644 index 00000000..44f8b3d0 --- /dev/null +++ b/images/selenium/node-firefox/Dockerfile @@ -0,0 +1,7 @@ +FROM selenium/node-firefox:latest + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +EXPOSE 4444 diff --git a/images/selenium/standalone-chrome/Dockerfile b/images/selenium/standalone-chrome/Dockerfile new file mode 100644 index 00000000..48f8e779 --- /dev/null +++ b/images/selenium/standalone-chrome/Dockerfile @@ -0,0 +1,7 @@ +FROM selenium/standalone-chrome:latest + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +EXPOSE 4444 diff --git a/images/selenium/standalone-edge/Dockerfile b/images/selenium/standalone-edge/Dockerfile new file mode 100644 index 00000000..f417a7dc --- /dev/null +++ b/images/selenium/standalone-edge/Dockerfile @@ -0,0 +1,7 @@ +FROM selenium/standalone-edge:latest + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +EXPOSE 4444 diff --git a/images/selenium/standalone-firefox/Dockerfile b/images/selenium/standalone-firefox/Dockerfile new file mode 100644 index 00000000..487f3456 --- /dev/null +++ b/images/selenium/standalone-firefox/Dockerfile @@ -0,0 +1,7 @@ +FROM selenium/standalone-firefox:latest + +LABEL MAINTAINER="Cloudflying" \ + MAIL="" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +EXPOSE 4444 diff --git a/images/shadowsocks/Dockerfile b/images/shadowsocks/Dockerfile deleted file mode 100644 index aa92339c..00000000 --- a/images/shadowsocks/Dockerfile +++ /dev/null @@ -1,46 +0,0 @@ -FROM registry.cn-hongkong.aliyuncs.com/imxieke/alpine:latest - -LABEL MAINTAINER="Sky" \ - MAIL="Sky@gfw.party" - -ENV SERVER_ADDR 0.0.0.0 -ENV SERVER_PORT 6443 -ENV PASSWORD shadowpass -ENV METHOD aes-256-gcm -ENV TIMEOUT 300 -ENV DNS 8.8.8.8,8.8.4.4 -ENV ARGS= -ENV SHADOW_VER 3.2.5 - -RUN set -ex \ - # Build environment setup - && apk add --no-cache --virtual .build-deps \ - autoconf automake build-base libc-dev c-ares-dev libev-dev libtool libsodium-dev \ - linux-headers mbedtls-dev pcre-dev wget asciidoc xmlto gettext-dev \ - # Build & install - && wget https://mirrors.xieke.org/Src/shadowsocks-libev-${SHADOW_VER}.tar.gz -O /tmp/shadowsocks-libev-${SHADOW_VER}.tar.gz \ - && mkdir -p /tmp/shadowsocks \ - && tar -xvf /tmp/shadowsocks-libev-${SHADOW_VER}.tar.gz -C /tmp/shadowsocks \ - && cd /tmp/shadowsocks/shadowsocks-libev-${SHADOW_VER} \ - && ./configure --prefix=/usr --disable-documentation \ - && make install \ - && apk del .build-deps \ - # Runtime dependencies setup - && apk add --no-cache \ - rng-tools \ - $(scanelf --needed --nobanner /usr/bin/ss-* \ - | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ - | sort -u) \ - && rm -rf /tmp/* - -USER nobody - -CMD exec ss-server \ - -s $SERVER_ADDR \ - -p $SERVER_PORT \ - -k ${PASSWORD} \ - -m $METHOD \ - -t $TIMEOUT \ - -d $DNS \ - -u \ - $ARGS diff --git a/images/shadowsocks/README.md b/images/shadowsocks/README.md index daa145e2..61aa29f3 100644 --- a/images/shadowsocks/README.md +++ b/images/shadowsocks/README.md @@ -1,3 +1,10 @@ +## 自实现 +shadowsocks + v2ray +shadowsocks + vray +shadowsocks + obfs 覆盖客户端多 + +docker run -d -e PASSWORD=secret -p6443:6443 -p6443:6443/udp shadowsocks/shadowsocks-libev ss-server -s 0.0.0.0 -p 6443 -k secret -t 300 -u -m xchacha20-ietf-poly1305 + ENV SERVER_ADDR=0.0.0.0 \ SERVER_PORT=6433 \ PASSWORD=shadowpass \ diff --git a/images/shadowsocks/latest/Dockerfile b/images/shadowsocks/latest/Dockerfile new file mode 100644 index 00000000..5a303803 --- /dev/null +++ b/images/shadowsocks/latest/Dockerfile @@ -0,0 +1,18 @@ +FROM teddysun/shadowsocks-libev:latest + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +COPY entrypoint.sh /tmp/entrypoint.sh +COPY shadowsocks.json /tmp/shadowsocks.json + +ENV PORT 6443 +ENV PASSWD sspass +ENV METHOD xchacha20-ietf-poly1305 + +USER root + +# RUN rm -fr /etc/service + +# CMD [ "/bin/bash" ]h /tmp/entrypoint.sh +CMD [ "/bin/bash" ]h diff --git a/images/shadowsocks/docker-compose.yml b/images/shadowsocks/latest/docker-compose.yml similarity index 70% rename from images/shadowsocks/docker-compose.yml rename to images/shadowsocks/latest/docker-compose.yml index 86624e49..9ec9e026 100644 --- a/images/shadowsocks/docker-compose.yml +++ b/images/shadowsocks/latest/docker-compose.yml @@ -1,5 +1,5 @@ shadowsocks: - image: registry.cn-hongkong.aliyuncs.com/imxieke/shadowsocks + image: ghcr.io/dockenv/shadowsocks:latest ports: - "8388:8388/tcp" - "8388:8388/udp" diff --git a/images/shadowsocks/latest/entrypoint.sh b/images/shadowsocks/latest/entrypoint.sh new file mode 100644 index 00000000..02128cd8 --- /dev/null +++ b/images/shadowsocks/latest/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/sh +sed -i "s#PORT#${PORT}#g" /tmp/shadowsocks.json +sed -i "s#PASSWD#${PASSWD}#g" /tmp/shadowsocks.json +sed -i "s#METHOD#${METHOD}#g" /tmp/shadowsocks.json +exec ss-server -c /tmp/shadowsocks.json -u diff --git a/images/shadowsocks/latest/shadowsocks.json b/images/shadowsocks/latest/shadowsocks.json new file mode 100644 index 00000000..72fd10a6 --- /dev/null +++ b/images/shadowsocks/latest/shadowsocks.json @@ -0,0 +1,13 @@ +{ + "server":"0.0.0.0", + "server_port":PORT, + "password":"PASSWD", + "timeout":300, + "user":"nobody", + "method":"METHOD", + "fast_open":false, + "nameserver":"8.8.8.8,8.8.4.4", + "mode":"tcp_and_udp", + "plugin":"obfs-server", + "plugin_opts":"obfs=tls" +} diff --git a/images/shadowsocks/latest/ss.json b/images/shadowsocks/latest/ss.json new file mode 100644 index 00000000..adfe147f --- /dev/null +++ b/images/shadowsocks/latest/ss.json @@ -0,0 +1,13 @@ +{ + "server":"0.0.0.0", + "server_port":6443, + "password": "secret", + "timeout":300, + "user":"nobody", + "method":"xchacha20-ietf-poly1305", + "fast_open":false, + "nameserver":"8.8.8.8,8.8.4.4", + "mode":"tcp_and_udp", + "plugin":"obfs-server", + "plugin_opts":"obfs=tls" +} diff --git a/images/sshd/tools.sh b/images/sshd/tools.sh index 7c48e64c..e84113ea 100644 --- a/images/sshd/tools.sh +++ b/images/sshd/tools.sh @@ -1,29 +1,37 @@ -#!/usr/bin/env bash -PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/games" -export PATH - -#Config Veriable -XCLOUD_REPO="https://git.coding.net/imxieke/XCloud.git" -XCLOUD_RUN_DIR="/var/www/html/Cloud" -TTYD_REPO="https://git.coding.net/tsl0922/ttyd.git" -#TTYD_REPO="https://github.com/tsl0922/ttyd.git" - - Install_env{ - apt-get install -y build-essential gcc g++ cpp cmake make pkg-config automake \ - autoconf libwebsockets-dev libjson-c-dev libssl-dev libjson-c2 curl unzip wget zsh vim git apt-utils apt-transport-https ca-certificates - } - - Install_ttyd{ - git clone $TTYD_REPO /tmp/ttyd - mkdir -p /tmp/ttyd/build - cd /tmp/ttyd/build - cmake .. && make && make install - cd ~ && rm -fr /tmp/ttyd - } - - - Install_XCloud{ - git clone $XCLOUD_REPO $XCLOUD_RUN_DIR && \ - chmod 777 -R $XCLOUD_RUN_DIR && \ - rm -fr /var/www/html/Cloud/.git - } \ No newline at end of file +#!/usr/bin/env bash +#!/usr/bin/env bash +### + # @Author: Cloudflying + # @Date: 2019-12-13 06:33:13 + # @LastEditTime: 2021-07-07 23:12:52 + # @LastEditors: Cloudflying + # @Description: + # @FilePath: /dockenv/images/sshd/tools.sh +### +PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/games" +export PATH + +#Config Veriable +XCLOUD_REPO="https://git.coding.net/imxieke/XCloud.git" +XCLOUD_RUN_DIR="/var/www/html/Cloud" +TTYD_REPO="https://git.coding.net/tsl0922/ttyd.git" +#TTYD_REPO="https://github.com/tsl0922/ttyd.git" + + Install_env(){ + apt-get install -y build-essential gcc g++ cpp cmake make pkg-config automake autoconf libwebsockets-dev libjson-c-dev libssl-dev libjson-c2 curl unzip wget zsh vim git apt-utils apt-transport-https ca-certificates + } + + Install_ttyd(){ + git clone $TTYD_REPO /tmp/ttyd + mkdir -p /tmp/ttyd/build + cd /tmp/ttyd/build + cmake .. && make && make install + cd ~ && rm -fr /tmp/ttyd + } + + + Install_XCloud(){ + git clone $XCLOUD_REPO $XCLOUD_RUN_DIR && \ + chmod 777 -R $XCLOUD_RUN_DIR && \ + rm -fr /var/www/html/Cloud/.git + } diff --git a/images/ssr/Dockerfile b/images/ssr/Dockerfile deleted file mode 100644 index 040dbfd0..00000000 --- a/images/ssr/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM imxieke/alpine:latest -LABEL MAINTAINER="Sky" \ - MAIL="Sky@gfw.party" - -ENV PORT="8838" \ - PASSWD="ssrondocker" - -RUN set -ex \ - && apk --update add --no-cache libsodium py-pip \ - && pip --no-cache-dir install https://github.com/shadowsocksr/shadowsocksr/archive/manyuser.zip - -EXPOSE ${PORT} - -ENTRYPOINT /usr/bin/ssserver -s 0.0.0.0 -p $PORT -k $PASSWD -m aes-256-cfb -o tls1.2_ticket_auth -O auth_sha1_v4 \ No newline at end of file diff --git a/images/ssr/README.md b/images/ssr/README.md deleted file mode 100644 index b7e682cd..00000000 --- a/images/ssr/README.md +++ /dev/null @@ -1,34 +0,0 @@ -### SSR -``` -Usage: -docker run -d --name ssr -p 8388:8388/tcp -p 8388:8388/udp -e PASSWD=passwd -e PORT=8388 image:latest - -``` - -## Config - -config path:`/etc/shadowsocks.json` - -``` -{ -"server":"0.0.0.0", -"server_ipv6": "[::]", -"local_address":"127.0.0.1", -"local_port":1080, -"port_password":{ - "8989":"password1", - "8990":"password2", - "8991":"password3" -}, -"timeout":300, -"method":"aes-256-cfb", -"protocol": "origin", -"protocol_param": "", -"obfs": "plain", -"obfs_param": "", -"redirect": "", -"dns_ipv6": false, -"fast_open": false, -"workers": 1 -} -``` \ No newline at end of file diff --git a/images/tengine/2.3/Dockerfile b/images/tengine/2.3/Dockerfile new file mode 100644 index 00000000..995bc9b0 --- /dev/null +++ b/images/tengine/2.3/Dockerfile @@ -0,0 +1,12 @@ +FROM ghcr.io/dockenv/ubuntu:21.04 + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +ADD build.sh /tmp/build.sh + +RUN sh /tmp/build.sh && rm -fr /tmp/* && rm -fr /tmp/.build + +EXPOSE 80 443 + +CMD ["tengine", "-g", "daemon off;"] diff --git a/images/tengine/2.3/build.sh b/images/tengine/2.3/build.sh new file mode 100644 index 00000000..0edcd6dc --- /dev/null +++ b/images/tengine/2.3/build.sh @@ -0,0 +1,123 @@ +#!/usr/bin/env bash +### + # @Author: Cloudflying + # @Date: 2021-11-23 12:40:36 + # @LastEditTime: 2021-11-23 17:48:37 + # @LastEditors: Cloudflying + # @Description: + # @FilePath: /dockenv/images/tengine/2.3/build.sh +### + +TENGINE_VER='2.3.3' +CORES=$(grep -c 'processor' /proc/cpuinfo) + +BUILD_DEPS='wget make gcc g++' + +# apt update -y +# apt install --no-install-recommends -y ${BUILD_DEPS} +mkdir -p /tmp/build +cd /tmp/build + +if [[ ! -d "/tmp/build/tengine-${TENGINE_VER}" ]]; then + echo 'Not' +fi + +# if [[ ! -d "/tmp/build/tengine-${TENGINE_VER}" ]]; then +# wget -c --no-check-certificate https://tengine.taobao.org/download/tengine-2.3.3.tar.gz +# tar -xvf tengine-${TENGINE_VER}.tar.gz +# fi +exit +groupadd --gid 101 --system tengine +useradd --system --no-create-home --shell /sbin/nologin --uid 101 --gid tengine tengine + +# ./configure: no supported file AIO was found +# apk add linux-headers +# apk add lua5.1-dev luajit-dev pcre-dev libxslt-dev gd-dev geoip-dev libatomic_ops-dev jemalloc-dev libressl-dev + +apt install --no-install-recommends -y libluajit-5.1-dev libpcre3-dev libssl-dev zlib1g-dev libxslt1-dev libgd-dev libgeoip-dev \ + libatomic-ops-dev libjemalloc-dev + +# if [[ ! -f "/usr/lib/x86_64-linux-gnu/libssl.a" ]]; then +# mkdir -p /usr/lib/x86_64-linux-gnu +# ln -s /usr/lib/libssl.a /usr/lib/x86_64-linux-gnu/libssl.a +# ln -s /usr/lib/libcrypto.a /usr/lib/x86_64-linux-gnu/libcrypto.a +# fi + +cd /tmp/build/tengine-${TENGINE_VER} + +# 使 Nginx 可以直接使用本地已安装 openssl +# sed -i 's/\.openssl\///g' auto/lib/openssl/conf +# sed -i 's/libssl\.a/x86_64-linux-gnu\/libssl\.a/g' auto/lib/openssl/conf +# sed -i 's/libcrypto\.a/x86_64-linux-gnu\/libcrypto\.a/g' auto/lib/openssl/conf + +# apk add --no-cache --virtual .build_deps make gcc g++ + +./configure \ + --prefix=/etc/tengine \ + --sbin-path=/usr/sbin/tengine \ + --modules-path=/usr/lib/tengine/modules \ + --conf-path=/etc/tengine/tengine.conf \ + --error-log-path=/var/log/tengine/error.log \ + --http-log-path=/var/log/tengine/access.log \ + --pid-path=/var/run/tengine.pid \ + --lock-path=/var/run/tengine.lock \ + --http-client-body-temp-path=/var/cache/tengine/client_temp \ + --http-proxy-temp-path=/var/cache/tengine/proxy_temp \ + --http-fastcgi-temp-path=/var/cache/tengine/fastcgi_temp \ + --http-uwsgi-temp-path=/var/cache/tengine/uwsgi_temp \ + --http-scgi-temp-path=/var/cache/tengine/scgi_temp \ + --user=tengine \ + --group=tengine \ + --with-threads \ + --with-file-aio \ + --with-pcre \ + --with-pcre-jit \ + --with-libatomic \ + --with-jemalloc \ + --with-mail \ + --with-mail_ssl_module \ + --with-http_ssl_module \ + --with-http_v2_module \ + --with-http_realip_module \ + --with-http_addition_module \ + --with-http_xslt_module \ + --with-http_image_filter_module \ + --with-http_geoip_module \ + --with-http_sub_module \ + --with-http_dav_module \ + --with-http_flv_module \ + --with-http_mp4_module \ + --with-http_gunzip_module \ + --with-http_gzip_static_module \ + --with-http_auth_request_module \ + --with-http_random_index_module \ + --with-http_secure_link_module \ + --with-http_degradation_module \ + --with-http_slice_module \ + --with-http_stub_status_module \ + --with-http_lua_module \ + --with-stream \ + --with-stream_ssl_module \ + --with-stream_realip_module \ + --with-stream_geoip_module \ + --with-stream_ssl_preread_module \ + --with-stream_sni \ + --with-luajit-inc=/usr/include/luajit-2.1 \ + --with-luajit-lib=/usr/lib \ + --with-lua-inc=/usr/include \ + --with-lua-lib=/usr/lib + +make -j${CORES} +make install + +mkdir -p /var/log/tengine /etc/tengine/conf.d /var/cache/tengine /usr/lib/tengine/modules +cp -fr conf/* /etc/tengine/ +# mv /etc/tengine/nginx.conf /etc/tengine/tengine.conf +rm -fr /etc/tengine/nginx.conf +cp packages/debian/nginx.conf /etc/tengine/tengine.conf +cp packages/debian/nginx.vh.default.conf /etc/tengine/conf.d +cp packages/debian/nginx.vh.example_ssl.conf /etc/tengine/conf.d + +# --with-openssl=/usr \ +# --with-zlib=/usr \ +# apk del .build_deps diff --git a/images/tengine/2.3/build2.sh b/images/tengine/2.3/build2.sh new file mode 100644 index 00000000..3dc23fd9 --- /dev/null +++ b/images/tengine/2.3/build2.sh @@ -0,0 +1,100 @@ +#!/usr/bin/env sh +### + # @Author: Cloudflying + # @Date: 2021-11-23 01:57:59 + # @LastEditTime: 2021-11-23 12:31:50 + # @LastEditors: Cloudflying + # @Description: + # @FilePath: /dockenv/images/tengine/2.3/build.sh +### +TENGINE_VER='2.3.3' +CORES=$(grep -c 'processor' /proc/cpuinfo) +mkdir -p /tmp/build +cd /tmp/build +if [[ ! -d "/tmp/build/tengine-${TENGINE_VER}" ]]; then + wget -cq https://tengine.taobao.org/download/tengine-2.3.3.tar.gz + tar -xvf tengine-${TENGINE_VER}.tar.gz +fi + +addgroup -g 101 -S tengine +adduser -S -D -H -u 101 -h /var/cache/tengine -s /sbin/nologin -G tengine -g tengine tengine + +# ./configure: no supported file AIO was found +apk add linux-headers +apk add lua5.1-dev luajit-dev pcre-dev libxslt-dev gd-dev geoip-dev libatomic_ops-dev jemalloc-dev libressl-dev + +if [[ ! -f "/usr/lib/x86_64-linux-gnu/libssl.a" ]]; then + mkdir -p /usr/lib/x86_64-linux-gnu + ln -s /usr/lib/libssl.a /usr/lib/x86_64-linux-gnu/libssl.a + ln -s /usr/lib/libcrypto.a /usr/lib/x86_64-linux-gnu/libcrypto.a +fi + +cd /tmp/build/tengine-${TENGINE_VER} + +# 使 Nginx 可以直接使用本地已安装 openssl +# sed -i 's/\.openssl\///g' auto/lib/openssl/conf +# sed -i 's/libssl\.a/x86_64-linux-gnu\/libssl\.a/g' auto/lib/openssl/conf +# sed -i 's/libcrypto\.a/x86_64-linux-gnu\/libcrypto\.a/g' auto/lib/openssl/conf + +apk add --no-cache --virtual .build_deps make gcc g++ +./configure \ + --prefix=/etc/tengine \ + --sbin-path=/usr/sbin/tengine \ + --modules-path=/usr/lib/tengine/modules \ + --conf-path=/etc/tengine/tengine.conf \ + --error-log-path=/var/log/tengine/error.log \ + --http-log-path=/var/log/tengine/access.log \ + --pid-path=/var/run/tengine.pid \ + --lock-path=/var/run/tengine.lock \ + --http-client-body-temp-path=/var/cache/tengine/client_temp \ + --http-proxy-temp-path=/var/cache/tengine/proxy_temp \ + --http-fastcgi-temp-path=/var/cache/tengine/fastcgi_temp \ + --http-uwsgi-temp-path=/var/cache/tengine/uwsgi_temp \ + --http-scgi-temp-path=/var/cache/tengine/scgi_temp \ + --user=tengine \ + --group=tengine \ + --with-threads \ + --with-file-aio \ + --with-pcre \ + --with-pcre-jit \ + --with-libatomic \ + --with-jemalloc \ + --with-mail \ + --with-mail_ssl_module \ + --with-http_ssl_module \ + --with-http_v2_module \ + --with-http_realip_module \ + --with-http_addition_module \ + --with-http_xslt_module \ + --with-http_image_filter_module \ + --with-http_geoip_module \ + --with-http_sub_module \ + --with-http_dav_module \ + --with-http_flv_module \ + --with-http_mp4_module \ + --with-http_gunzip_module \ + --with-http_gzip_static_module \ + --with-http_auth_request_module \ + --with-http_random_index_module \ + --with-http_secure_link_module \ + --with-http_degradation_module \ + --with-http_slice_module \ + --with-http_stub_status_module \ + --with-http_lua_module \ + --with-stream \ + --with-stream_ssl_module \ + --with-stream_realip_module \ + --with-stream_geoip_module \ + --with-stream_ssl_preread_module \ + --with-stream_sni \ + --with-luajit-inc=/usr/include/luajit-2.1 \ + --with-luajit-lib=/usr/lib \ + --with-lua-inc=/usr/include \ + --with-lua-lib=/usr/lib + +make -j${CORES} +make install + +# --with-openssl=/usr \ +# --with-zlib=/usr \ +apk del .build_deps diff --git a/images/ttyd/Dockerfile b/images/ttyd/latest/Dockerfile similarity index 100% rename from images/ttyd/Dockerfile rename to images/ttyd/latest/Dockerfile diff --git a/images/ttyd/run.sh b/images/ttyd/latest/run.sh similarity index 100% rename from images/ttyd/run.sh rename to images/ttyd/latest/run.sh diff --git a/images/ttyd/set_root_pw.sh b/images/ttyd/latest/set_root_pw.sh similarity index 100% rename from images/ttyd/set_root_pw.sh rename to images/ttyd/latest/set_root_pw.sh diff --git a/images/ubuntu/14.04/Dockerfile b/images/ubuntu/14.04/Dockerfile new file mode 100644 index 00000000..cd828f28 --- /dev/null +++ b/images/ubuntu/14.04/Dockerfile @@ -0,0 +1,18 @@ +# Ubuntu 14.04 +FROM ubuntu:trusty + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" +ENV DEBIAN_FRONTEND noninteractive +ENV VERSION_CODENAME=trusty + +RUN . /etc/os-release \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} main restricted multiverse universe" > /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-backports main restricted multiverse universe" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-proposed main restricted multiverse universe" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-security main restricted multiverse universe" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-updates main restricted multiverse universe" >> /etc/apt/sources.list + +CMD ["/usr/bin/bash"] diff --git a/images/ubuntu/Dockerfile.trusty b/images/ubuntu/14.10/Dockerfile similarity index 65% rename from images/ubuntu/Dockerfile.trusty rename to images/ubuntu/14.10/Dockerfile index 7ace4480..5986c8e5 100644 --- a/images/ubuntu/Dockerfile.trusty +++ b/images/ubuntu/14.10/Dockerfile @@ -1,5 +1,5 @@ -# Ubuntu 14.04 -FROM ubuntu:trusty +# Ubuntu 14.10 +FROM ubuntu:utopic LABEL MAINTAINER="Cloudflying" \ MAIL="oss@live.hk" @@ -7,7 +7,7 @@ LABEL MAINTAINER="Cloudflying" \ ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" ENV DEBIAN_FRONTEND noninteractive -RUN sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list \ +RUN sed -i 's/archive.ubuntu.com/repo.huaweicloud.com/g' /etc/apt/sources.list \ && sed -i 's/deb\ http:\/\/security/#deb\ http:\/\/security/g' /etc/apt/sources.list -CMD ['/bin/bash'] +CMD ["/usr/bin/bash"] diff --git a/images/ubuntu/15.04/Dockerfile b/images/ubuntu/15.04/Dockerfile new file mode 100644 index 00000000..a138638a --- /dev/null +++ b/images/ubuntu/15.04/Dockerfile @@ -0,0 +1,13 @@ +# Ubuntu 15.04 +FROM ubuntu:vivid + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" \ + DEBIAN_FRONTEND=noninteractive + +RUN sed -i 's/archive.ubuntu.com/repo.huaweicloud.com/g' /etc/apt/sources.list \ + && sed -i 's/deb\ http:\/\/security/#deb\ http:\/\/security/g' /etc/apt/sources.list + +CMD ["/usr/bin/bash"] diff --git a/images/ubuntu/15.10/Dockerfile b/images/ubuntu/15.10/Dockerfile new file mode 100644 index 00000000..b9b35e7f --- /dev/null +++ b/images/ubuntu/15.10/Dockerfile @@ -0,0 +1,13 @@ +# Ubuntu 15.10 +FROM ubuntu:wily + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" \ + DEBIAN_FRONTEND=noninteractive + +RUN sed -i 's/archive.ubuntu.com/repo.huaweicloud.com/g' /etc/apt/sources.list \ + && sed -i 's/deb\ http:\/\/security/#deb\ http:\/\/security/g' /etc/apt/sources.list + +CMD ["/usr/bin/bash"] diff --git a/images/ubuntu/Dockerfile.xenial b/images/ubuntu/16.04/Dockerfile similarity index 69% rename from images/ubuntu/Dockerfile.xenial rename to images/ubuntu/16.04/Dockerfile index 84a1abfd..5c6aed72 100644 --- a/images/ubuntu/Dockerfile.xenial +++ b/images/ubuntu/16.04/Dockerfile @@ -1,4 +1,4 @@ -# Ubuntu 16.04 +# Ubuntu 16.04 FROM ubuntu:xenial LABEL MAINTAINER="Cloudflying" \ @@ -7,7 +7,7 @@ LABEL MAINTAINER="Cloudflying" \ ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" \ DEBIAN_FRONTEND=noninteractive -RUN sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list \ +RUN sed -i 's/archive.ubuntu.com/repo.huaweicloud.com/g' /etc/apt/sources.list \ && sed -i 's/deb\ http:\/\/security/#deb\ http:\/\/security/g' /etc/apt/sources.list -CMD ['/bin/bash'] +CMD ["/usr/bin/bash"] diff --git a/images/ubuntu/16.10/Dockerfile b/images/ubuntu/16.10/Dockerfile new file mode 100644 index 00000000..f2f96a4e --- /dev/null +++ b/images/ubuntu/16.10/Dockerfile @@ -0,0 +1,14 @@ +# Ubuntu 16.10 +FROM ubuntu:yakkety + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" +ENV DEBIAN_FRONTEND=noninteractive + +RUN sed -i 's#archive.ubuntu.com#repo.huaweicloud.com/oldubuntu-releases#g' /etc/apt/sources.list \ + && sed -i 's/deb\ http:\/\/security/#deb\ http:\/\/security/g' /etc/apt/sources.list \ + && sed -i 's/deb-src\ http:\/\/security/#deb-src\ http:\/\/security/g' /etc/apt/sources.list + +CMD ["/usr/bin/bash"] diff --git a/images/ubuntu/17.04/Dockerfile b/images/ubuntu/17.04/Dockerfile new file mode 100644 index 00000000..abb26991 --- /dev/null +++ b/images/ubuntu/17.04/Dockerfile @@ -0,0 +1,13 @@ +FROM ubuntu:zesty + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" +ENV DEBIAN_FRONTEND=noninteractive + +RUN sed -i 's#archive.ubuntu.com#repo.huaweicloud.com/oldubuntu-releases#g' /etc/apt/sources.list \ + && sed -i 's/deb\ http:\/\/security/#deb\ http:\/\/security/g' /etc/apt/sources.list \ + && sed -i 's/deb-src\ http:\/\/security/#deb-src\ http:\/\/security/g' /etc/apt/sources.list + +CMD ["/usr/bin/bash"] diff --git a/images/ubuntu/17.10/Dockerfile b/images/ubuntu/17.10/Dockerfile new file mode 100644 index 00000000..a6b0e96d --- /dev/null +++ b/images/ubuntu/17.10/Dockerfile @@ -0,0 +1,14 @@ +# Ubuntu 17.10 +FROM ubuntu:artful + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" +ENV DEBIAN_FRONTEND=noninteractive + +RUN sed -i 's#archive.ubuntu.com#repo.huaweicloud.com/oldubuntu-releases#g' /etc/apt/sources.list \ + && sed -i 's/deb\ http:\/\/security/#deb\ http:\/\/security/g' /etc/apt/sources.list \ + && sed -i 's/deb-src\ http:\/\/security/#deb-src\ http:\/\/security/g' /etc/apt/sources.list + +CMD ["/usr/bin/bash"] diff --git a/images/ubuntu/18.04/Dockerfile b/images/ubuntu/18.04/Dockerfile new file mode 100644 index 00000000..13f08b02 --- /dev/null +++ b/images/ubuntu/18.04/Dockerfile @@ -0,0 +1,17 @@ +# Ubuntu 18.04 +FROM ubuntu:bionic + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" +ENV DEBIAN_FRONTEND=noninteractive + +RUN . /etc/os-release \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} main restricted multiverse universe" > /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-backports main restricted multiverse universe" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-proposed main restricted multiverse universe" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-security main restricted multiverse universe" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-updates main restricted multiverse universe" >> /etc/apt/sources.list + +CMD ["/usr/bin/bash"] diff --git a/images/ubuntu/18.10/Dockerfile b/images/ubuntu/18.10/Dockerfile new file mode 100644 index 00000000..635fdbf4 --- /dev/null +++ b/images/ubuntu/18.10/Dockerfile @@ -0,0 +1,13 @@ +# Ubuntu 18.10 +FROM ubuntu:cosmic + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" \ + DEBIAN_FRONTEND=noninteractive + +RUN sed -i 's/archive.ubuntu.com/repo.huaweicloud.com/g' /etc/apt/sources.list \ + && sed -i 's/deb\ http:\/\/security/#deb\ http:\/\/security/g' /etc/apt/sources.list + +CMD ["/usr/bin/bash"] diff --git a/images/ubuntu/19.04/Dockerfile b/images/ubuntu/19.04/Dockerfile new file mode 100644 index 00000000..dad42e22 --- /dev/null +++ b/images/ubuntu/19.04/Dockerfile @@ -0,0 +1,14 @@ +# Ubuntu 19.04 +FROM ubuntu:disco + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" +ENV DEBIAN_FRONTEND=noninteractive + +RUN sed -i 's#archive.ubuntu.com#repo.huaweicloud.com/oldubuntu-releases#g' /etc/apt/sources.list \ + && sed -i 's/deb\ http:\/\/security/#deb\ http:\/\/security/g' /etc/apt/sources.list \ + && sed -i 's/deb-src\ http:\/\/security/#deb-src\ http:\/\/security/g' /etc/apt/sources.list + +CMD ["/usr/bin/bash"] diff --git a/images/ubuntu/19.10/Dockerfile b/images/ubuntu/19.10/Dockerfile new file mode 100644 index 00000000..f4ecf720 --- /dev/null +++ b/images/ubuntu/19.10/Dockerfile @@ -0,0 +1,14 @@ +# Ubuntu 19.10 +FROM ubuntu:eoan + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" +ENV DEBIAN_FRONTEND=noninteractive + +RUN sed -i 's#archive.ubuntu.com#repo.huaweicloud.com/oldubuntu-releases#g' /etc/apt/sources.list \ + && sed -i 's/deb\ http:\/\/security/#deb\ http:\/\/security/g' /etc/apt/sources.list \ + && sed -i 's/deb-src\ http:\/\/security/#deb-src\ http:\/\/security/g' /etc/apt/sources.list + +CMD ["/usr/bin/bash"] diff --git a/images/ubuntu/20.04/Dockerfile b/images/ubuntu/20.04/Dockerfile new file mode 100644 index 00000000..916f4235 --- /dev/null +++ b/images/ubuntu/20.04/Dockerfile @@ -0,0 +1,17 @@ +# Ubuntu 20.04 +FROM ubuntu:focal + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" + +ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" \ + DEBIAN_FRONTEND=noninteractive + +RUN . /etc/os-release \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} main restricted multiverse universe" > /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-backports main restricted multiverse universe" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-proposed main restricted multiverse universe" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-security main restricted multiverse universe" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-updates main restricted multiverse universe" >> /etc/apt/sources.list + +CMD ["/usr/bin/bash"] diff --git a/images/ubuntu/20.10/Dockerfile b/images/ubuntu/20.10/Dockerfile new file mode 100644 index 00000000..b236dd45 --- /dev/null +++ b/images/ubuntu/20.10/Dockerfile @@ -0,0 +1,14 @@ +# Ubuntu 20.10 +FROM ubuntu:groovy + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" \ + DEBIAN_FRONTEND=noninteractive + +RUN sed -i 's/archive.ubuntu.com/repo.huaweicloud.com/g' /etc/apt/sources.list \ + && sed -i 's/deb\ http:\/\/security/#deb\ http:\/\/security/g' /etc/apt/sources.list + +CMD ["/usr/bin/bash"] diff --git a/images/ubuntu/21.04/Dockerfile b/images/ubuntu/21.04/Dockerfile new file mode 100644 index 00000000..f4b55118 --- /dev/null +++ b/images/ubuntu/21.04/Dockerfile @@ -0,0 +1,18 @@ +# Ubuntu 21.04 +FROM ubuntu:hirsute + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" +ENV DEBIAN_FRONTEND=noninteractive + +RUN . /etc/os-release \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} main restricted multiverse universe" > /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-backports main restricted multiverse universe" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-proposed main restricted multiverse universe" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-security main restricted multiverse universe" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-updates main restricted multiverse universe" >> /etc/apt/sources.list + +CMD ["/usr/bin/bash"] diff --git a/images/ubuntu/21.10/Dockerfile b/images/ubuntu/21.10/Dockerfile new file mode 100644 index 00000000..641dfb19 --- /dev/null +++ b/images/ubuntu/21.10/Dockerfile @@ -0,0 +1,18 @@ +# Ubuntu 21.10 +FROM ubuntu:impish + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" +ENV DEBIAN_FRONTEND=noninteractive + +RUN . /etc/os-release \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} main restricted multiverse universe" > /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-backports main restricted multiverse universe" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-proposed main restricted multiverse universe" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-security main restricted multiverse universe" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-updates main restricted multiverse universe" >> /etc/apt/sources.list + +CMD ["/usr/bin/bash"] diff --git a/images/ubuntu/22.04/Dockerfile b/images/ubuntu/22.04/Dockerfile new file mode 100644 index 00000000..0537a579 --- /dev/null +++ b/images/ubuntu/22.04/Dockerfile @@ -0,0 +1,18 @@ +# Ubuntu 22.04 +FROM ubuntu:jammy + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" +ENV DEBIAN_FRONTEND=noninteractive + +RUN . /etc/os-release \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} main restricted multiverse universe" > /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-backports main restricted multiverse universe" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-proposed main restricted multiverse universe" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-security main restricted multiverse universe" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-updates main restricted multiverse universe" >> /etc/apt/sources.list + +CMD ["/usr/bin/bash"] diff --git a/images/ubuntu/22.10/Dockerfile b/images/ubuntu/22.10/Dockerfile new file mode 100644 index 00000000..a9bf490f --- /dev/null +++ b/images/ubuntu/22.10/Dockerfile @@ -0,0 +1,18 @@ +# Ubuntu 22.10 +FROM ubuntu:kinetic + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv + +ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" +ENV DEBIAN_FRONTEND=noninteractive + +RUN . /etc/os-release \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME} main restricted multiverse universe" > /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-backports main restricted multiverse universe" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-proposed main restricted multiverse universe" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-security main restricted multiverse universe" >> /etc/apt/sources.list \ + && echo "deb http://repo.huaweicloud.com/${ID} ${VERSION_CODENAME}-updates main restricted multiverse universe" >> /etc/apt/sources.list + +CMD ["/usr/bin/bash"] diff --git a/images/ubuntu/Dockerfile b/images/ubuntu/Dockerfile deleted file mode 100644 index b90d8924..00000000 --- a/images/ubuntu/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -# Ubuntu 18.10 -FROM ubuntu:cosmic - -LABEL MAINTAINER="Cloudflying" \ - MAIL="oss@live.hk" - -ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" \ - DEBIAN_FRONTEND=noninteractive - -RUN sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list \ - && sed -i 's/deb\ http:\/\/security/#deb\ http:\/\/security/g' /etc/apt/sources.list \ - && apt update -y --fix-missing \ - && apt upgrade -y \ - && apt install -y tzdata \ - && rm -fr /etc/localtime \ - && rm -fr /etc/timezone \ - && ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ - && echo "Asia/Shanghai" > /etc/timezone \ - && apt autoremove -y \ - && apt-get clean all \ - && rm -fr /var/lib/apt/lists/* - -CMD ['/bin/bash'] diff --git a/images/ubuntu/Dockerfile.bionic b/images/ubuntu/Dockerfile.bionic deleted file mode 100644 index c1278430..00000000 --- a/images/ubuntu/Dockerfile.bionic +++ /dev/null @@ -1,22 +0,0 @@ -# Ubuntu 18.04 -FROM ubuntu:bionic - -LABEL MAINTAINER="Cloudflying" \ - MAIL="oss@live.hk" - -ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" -ENV DEBIAN_FRONTEND noninteractive - -RUN sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list \ - && sed -i 's/deb\ http:\/\/security/#deb\ http:\/\/security/g' /etc/apt/sources.list \ - && apt update -y --fix-missing \ - && apt install -y tzdata \ - && rm -fr /etc/localtime \ - && rm -fr /etc/timezone \ - && ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ - && echo "Asia/Shanghai" > /etc/timezone \ - && apt autoremove -y \ - && apt-get clean all \ - && rm -fr /var/lib/apt/lists/* - -CMD ['/bin/bash'] diff --git a/images/ubuntu/Dockerfile.btpanel b/images/ubuntu/Dockerfile.btpanel deleted file mode 100644 index b90d8924..00000000 --- a/images/ubuntu/Dockerfile.btpanel +++ /dev/null @@ -1,23 +0,0 @@ -# Ubuntu 18.10 -FROM ubuntu:cosmic - -LABEL MAINTAINER="Cloudflying" \ - MAIL="oss@live.hk" - -ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" \ - DEBIAN_FRONTEND=noninteractive - -RUN sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list \ - && sed -i 's/deb\ http:\/\/security/#deb\ http:\/\/security/g' /etc/apt/sources.list \ - && apt update -y --fix-missing \ - && apt upgrade -y \ - && apt install -y tzdata \ - && rm -fr /etc/localtime \ - && rm -fr /etc/timezone \ - && ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ - && echo "Asia/Shanghai" > /etc/timezone \ - && apt autoremove -y \ - && apt-get clean all \ - && rm -fr /var/lib/apt/lists/* - -CMD ['/bin/bash'] diff --git a/images/ubuntu/Dockerfile.cosmic b/images/ubuntu/Dockerfile.cosmic deleted file mode 100644 index 13796313..00000000 --- a/images/ubuntu/Dockerfile.cosmic +++ /dev/null @@ -1,22 +0,0 @@ -# Ubuntu 18.10 -FROM ubuntu:cosmic - -LABEL MAINTAINER="Cloudflying" \ - MAIL="oss@live.hk" - -ENV DEBIAN_FRONTEND noninteractive \ - PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" - -RUN sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list \ - && sed -i 's/deb\ http:\/\/security/#deb\ http:\/\/security/g' /etc/apt/sources.list \ - && apt update -y --fix-missing \ - && apt install -y tzdata \ - && rm -fr /etc/localtime \ - && rm -fr /etc/timezone \ - && ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ - && echo "Asia/Shanghai" > /etc/timezone \ - && apt autoremove -y \ - && apt-get clean all \ - && rm -fr /var/lib/apt/lists/* - -CMD ['/bin/bash'] \ No newline at end of file diff --git a/images/ubuntu/Dockerfile.unity b/images/ubuntu/Dockerfile.unity deleted file mode 100644 index 9810f021..00000000 --- a/images/ubuntu/Dockerfile.unity +++ /dev/null @@ -1,31 +0,0 @@ -FROM registry.cn-hongkong.aliyuncs.com/imxieke/ubuntu:xenial-vncenv - -LABEL MAINTAINER="Cloudflying" \ - MAIL="oss@live.hk" - -ENV DEBIAN_FRONTEND noninteractive -ENV USER=ubuntu -ENV HOME=/home/${USER} -ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" \ - PASSWD=ubuntu \ - TERM=xterm \ - NO_VNC_HOME=/opt/noVNC \ - VNC_COL_DEPTH=24 \ - VNC_RESOLUTION=1360x768 \ - VNC_PW=ubuntu \ - VNC_VIEW_ONLY=false \ - DISPLAY=:1 \ - VNC_PORT=5901 \ - NO_VNC_PORT=6901 - -COPY ./unity/startup.sh /bin/startup.sh -COPY ./unity/unity.sh tmp/ - -RUN chmod +x /tmp/unity.sh \ - && /tmp/unity.sh \ - && rm -fr /tmp/* - -WORKDIR ${HOME} -# USER ${USER} -EXPOSE 6080 ${VNC_PORT} ${NO_VNC_PORT} -CMD ["/bin/bash", "/bin/startup.sh"] \ No newline at end of file diff --git a/images/ubuntu/Dockerfile.unity.bak b/images/ubuntu/Dockerfile.unity.bak deleted file mode 100644 index f1ea8d8e..00000000 --- a/images/ubuntu/Dockerfile.unity.bak +++ /dev/null @@ -1,40 +0,0 @@ -FROM reg.qiniu.com/imxieke/ubuntu:xenial-vncenv -ENV DEBIAN_FRONTEND noninteractive -ENV MAINTAINER=Cloudflying \ - MAIL=oss@live.hk \ - USER=ubuntu \ - PASSWD=ubuntu \ - SHELL_DIR=tmp/shell \ - TERM=xterm \ - STARTUPDIR=/startup \ - INST_SCRIPTS=/home/ubuntu/install \ - NO_VNC_HOME=/home/ubuntu/.noVNC \ - DEBIAN_FRONTEND=noninteractive \ - VNC_COL_DEPTH=24 \ - VNC_RESOLUTION=1360x768 \ - VNC_PW=ubuntu \ - VNC_VIEW_ONLY=false \ - DISPLAY=:1 \ - VNC_PORT=5901 \ - NO_VNC_PORT=6901 -ENV HOME=/home/${USER} - -# COPY ./unity/supervisor.conf /etc/supervisor/conf.d/ -COPY ./unity/xsession ${HOME}/.xsession -COPY ./unity/startup.sh /bin/startup.sh -COPY ./unity/unity.sh ${SHELL_DIR}/ - -RUN apt-get update \ - && apt-get install -y --no-install-recommends ubuntu-desktop unity-lens-applications gnome-panel metacity nautilus locales gedit \ - pwgen libtasn1-3-bin libglu1-mesa \ - && apt-get autoclean \ - && apt-get autoremove \ - && rm -rf /var/lib/apt/lists/* - -RUN chmod +x ${SHELL_DIR}/unity.sh \ - && ${SHELL_DIR}/unity.sh - -USER ${USER} -EXPOSE ${VNC_PORT} ${NO_VNC_PORT} -ENTRYPOINT ["/bin/bash", "/bin/startup.sh"] -CMD ["--wait"] \ No newline at end of file diff --git a/images/ubuntu/Dockerfile.vncenv b/images/ubuntu/Dockerfile.vncenv deleted file mode 100644 index 1ad0ec8f..00000000 --- a/images/ubuntu/Dockerfile.vncenv +++ /dev/null @@ -1,20 +0,0 @@ -# Ubuntu 18.04 -# Base image for vnc -FROM registry.cn-hongkong.aliyuncs.com/imxieke/ubuntu:bionic - -LABEL MAINTAINER="Cloudflying" \ - MAIL="oss@live.hk" - -ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" \ - DEBIAN_FRONTEND=noninteractive -RUN apt update -y --fix-missing \ - && apt upgrade -y \ - && apt install -y --no-install-recommends sudo apt-utils zsh vim git wget net-tools locales bzip2 apt-utils openssl ca-certificates \ - && apt install -y --no-install-recommends python-numpy supervisor xfce4 xfce4-terminal xterm libnss-wrapper gettext ttf-wqy-zenhei supervisor \ - curl chromium-browser chromium-browser-l10n chromium-codecs-ffmpeg \ - && apt-get purge -y pm-utils xscreensaver* \ - && apt autoremove -y \ - && apt-get clean all \ - && rm -fr /var/lib/apt/lists/* - -CMD ['/bin/bash'] diff --git a/images/ubuntu/Dockerfile.xenial-vncenv b/images/ubuntu/Dockerfile.xenial-vncenv deleted file mode 100644 index fe37bae0..00000000 --- a/images/ubuntu/Dockerfile.xenial-vncenv +++ /dev/null @@ -1,28 +0,0 @@ -# Ubuntu 16.04 -# Base image for vnc -FROM registry.cn-hongkong.aliyuncs.com/imxieke/ubuntu:xenial - -LABEL MAINTAINER="Cloudflying" \ - MAIL="oss@live.hk" - -ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" -ENV DEBIAN_FRONTEND noninteractive -RUN apt update -y --fix-missing \ - && apt upgrade -y \ - && apt install -y --no-install-recommends sudo apt-utils ubuntu-desktop \ - unity-lens-applications gnome-panel metacity nautilus supervisor net-tools \ - wget locales curl git zsh vim pwgen libtasn1-3-bin libglu1-mesa mate-terminal \ - fonts-liberation language-pack-zh-hans fonts-droid-fallback ttf-wqy-zenhei \ - ttf-wqy-microhei fonts-arphic-ukai fonts-arphic-uming xfonts-wqy libxss1 xdg-utils \ - openssl ca-certificates \ - && wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -O /tmp/chrome.deb \ - && dpkg -i /tmp/chrome.deb \ - && wget -qO- --no-check-certificate https://dev.tencent.com/u/imxieke/p/attachment/git/raw/master/pkgs/sublime_text_3_build_3176_x64.tar.bz2 -O /tmp/sublime.tar.gz \ - && tar -xvf /tmp/sublime.tar.gz -C /opt \ - && ln -s /opt/sublime_text_3/sublime_text /bin/subl \ - && apt autoremove -y \ - && apt-get clean all \ - && rm -fr /var/lib/apt/lists/* \ - && rm -fr /tmp/* - -CMD ['/bin/bash'] diff --git a/images/ubuntu/Dockerfile.xfce b/images/ubuntu/Dockerfile.xfce deleted file mode 100644 index ca2aada8..00000000 --- a/images/ubuntu/Dockerfile.xfce +++ /dev/null @@ -1,32 +0,0 @@ -FROM registry.cn-hongkong.aliyuncs.com/imxieke/ubuntu:vncenv -LABEL MAINTAINER=Cloudflying \ - MAIL=oss@live.hk - -ENV HOME=/home/ubuntu \ - TERM=xterm \ - STARTUPDIR=/startup \ - INST_SCRIPTS=/home/ubuntu/install \ - NO_VNC_HOME=/home/ubuntu/.noVNC \ - DEBIAN_FRONTEND=noninteractive \ - VNC_COL_DEPTH=24 \ - VNC_RESOLUTION=1360x768 \ - VNC_PW=ubuntu \ - VNC_VIEW_ONLY=false \ - DISPLAY=:1 \ - VNC_PORT=5901 \ - NO_VNC_PORT=6901 \ - USER=ubuntu \ - PASSWD=ubuntu - -ADD ./xfce/ $HOME/ -ADD ./script $STARTUPDIR - -RUN chmod +x ${STARTUPDIR}/*.sh \ - && ${STARTUPDIR}/build.sh - -USER ${USER} -WORKDIR $HOME - -EXPOSE $VNC_PORT $NO_VNC_PORT -ENTRYPOINT ["/startup/startup.sh"] -CMD ["--wait"] diff --git a/images/ubuntu/README.md b/images/ubuntu/README.md index b6544ed3..8aad526d 100644 --- a/images/ubuntu/README.md +++ b/images/ubuntu/README.md @@ -1,18 +1,50 @@ -## Connection ports for controlling the UI: -# VNC port:5901 -# noVNC webport, connect via http://IP:6901/?password=vncpassword +## 已停止软件源的版本 +- groovy 20.10 +- 19.10 +- 19.04 +- 18.10 +- 17.10 +- 17.04 +- 16.10 -14.10 -## Unity - -`docker run -d --name="ubuntu" --hostname="ubuntu" -p 5901:5901 -p 6901:6901 registry.cn-hongkong.aliyuncs.com/imxieke/ubuntu:unity` - -``` -noVNC: ip:6901 -VNC: ip:5901 -User: ubuntu -Pass: ubuntu -VNC Pass: ubuntu -``` +## Ubuntu 版本信息 +4.10 Warty Warthog +5.04 Hoary Hedgehog +5.10 Breezy Badger +6.06 LTS Dapper +6.10 Edgy Eft +7.04 Feisty Fawn +7.10 Gutsy Gibbon +8.04 LTS Hardy +8.10 Intrepid Ibex +9.04 Jaunty Jackalope +9.10 Karmic Koala +10.04 lucid LTS Lucid +10.10 Maverick Meerkat +11.04 Natty Narwhal +11.10 Oneiric Ocelot +12.04 Precise Pangolin +12.10 Quantal Quetzal +13.04 Raring Ringtail +13.10 saucy Saucy Salamander +14.04 trusty Trusty Tahr lts +14.10 utopic Utopic Unicorn +15.04 vivid Vivid Vervet +15.10 wily Wily Werewolf +16.04 xenial Xenial Xerus lts +16.10 yakkety Yakkety Yak +17.04 zesty Zesty Zapus +17.10 artful Artful Aardvark +18.04 bionic Bionic Beaver lts +18.10 cosmic Cosmic Cuttlefish +19.04 disco Disco Dingo +19.10 eoan Eoan Ermine +20.04 focal Focal Fossa +20.10 groovy Groovy Gorilla lts +21.04 hirsute Hirsute Hippo +21.10 impish Impish Indri +22.04 jammy Jammy Jellyfish lts +22.10 kinetic Kinetic Kudu ### PS: if want to run Chrome , need add param `--privileged` ### Ubuntu Unity Desktop not work please wait a while or run ` docker restart container-id ` or `docker exec container-id unity > /tmp/unity.log & ` diff --git a/images/ubuntu/README.unity.md b/images/ubuntu/README.unity.md deleted file mode 100644 index 62430e81..00000000 --- a/images/ubuntu/README.unity.md +++ /dev/null @@ -1,120 +0,0 @@ -# Docker-Ubuntu-Unity-noVNC - -Dockfile for Ubuntu with Unity desktop environment and noVNC. - -This **Image/Dockerfile** aims to create a container for **Ubuntu 16.04** with **Unity Desktop** and using **TightVNCServer**, **noVNC**, **Ngrok(Optional)** which allow user use browser to log in into this container. - - -## How to use? - -You can build this **Dockerfile** yourself: - -``` -sudo docker build -t "chenjr0719/ubuntu-unity-novnc" . -``` - -Or, just pull my **image**: - -``` -sudo docker pull chenjr0719/ubuntu-unity-novnc -``` - -The default usage of this image is: - -``` -sudo docker run -itd -p 80:6080 chenjr0719/ubuntu-unity-novnc -``` - -Wait for a few second, you can access http://localhost/vnc.html and see this screen: - -![alt text](https://github.com/chenjr0719/Docker-Ubuntu-Unity-noVNC/raw/master/noVNC.png "vnc.html") - - -### Password - -In default, the **password** will create randomly, to find the password, please using the following command: - -``` -sudo docker exec $CONTAINER_ID cat /home/ubuntu/password.txt -``` - -And you can use this password to log in into this container. - -After log in, you can see this screen: - -![alt text](https://github.com/chenjr0719/Docker-Ubuntu-Unity-noVNC/raw/master/desktop.png "Unity desktop") - - -## Arguments - -This image contains 3 input argument: - -1. Password - - You can set your own user password as you like: - ``` - sudo docker run -itd -p 80:6080 -e PASSWORD=$YOUR_PASSWORD chenjr0719/ubuntu-unity-novnc - ``` - Now, you can user your own password to log in. - -2. Sudo - - In default, the user **ubuntu** will not be the sudoer, but if you need, you can use this command: - ``` - sudo docker run -itd -p 80:6080 -e SUDO=yes chenjr0719/ubuntu-unity-novnc - ``` - - This command will grant the **sudo** to user **ubuntu**. - - And use **SUDO=YES**, **SUDO=Yes**, **SUDO=Y**, **SUDO=y** are also supported. - - To check the sudo is work , when you open **xTerm** it should show following message: - ``` - To run a command as administrator (user "root"), use "sudo ". - See "man sudo_root" for details. - ``` - - ![alt text](https://github.com/chenjr0719/Docker-Ubuntu-Unity-noVNC/raw/master/sudo.png "sudo") - - **Caution!!** allow your user as sudoer may cause security issues, use it carefully. - -3. Ngrok - - [Ngrok](https://ngrok.com/) can be used to deploy localhost to the internet. - - If you need to use this image across the internet, Ngrok is what you need. - - To enable Ngrok, use following command: - - ``` - sudo docker run -itd -p 80:6080 -e NGROK=yes chenjr0719/ubuntu-unity-novnc - ``` - - And find the link address: - - ``` - sudo docker exec $CONTAINER_ID cat /home/ubuntu/ngrok/Ngrok_URL.txt - ``` - - **NGROK=YES**, **NGROK=Yes**, **NGROK=Y**, **NGROK=y** are also supported. - - **Caution!!** this may also cause security issues, use it carefully. - - -## Screen size - -The default setting of screen siz is 1600x900. - -You can change screen by using following command, this will change screen size to 1024x768: - -``` -sudo docker exec $CONTAINER_ID sed -i "s|-geometry 1600x900|-geometry 1024x768|g" /etc/supervisor/conf.d/supervisor.conf -sudo docker restart $CONTAINER_ID -``` - - -## Issues - -Can't work properly with gnome-terminal, use XTerm to place it. - -Some components of Unity may not work properly with vncserver. diff --git a/images/ubuntu/latest/Dockerfile b/images/ubuntu/latest/Dockerfile new file mode 100644 index 00000000..01b544d9 --- /dev/null +++ b/images/ubuntu/latest/Dockerfile @@ -0,0 +1,15 @@ +# Ubuntu Latest +FROM ubuntu:latest + +LABEL MAINTAINER="Cloudflying" \ + MAIL="oss@live.hk" \ + org.opencontainers.image.source=https://github.com/dockenv/dockenv \ + org.opencontainers.image.description='PHP latest' + +ENV PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" \ + DEBIAN_FRONTEND=noninteractive + +RUN sed -i 's/archive.ubuntu.com/repo.huaweicloud.com/g' /etc/apt/sources.list \ + && sed -i 's/deb\ http:\/\/security/#deb\ http:\/\/security/g' /etc/apt/sources.list + +CMD ["/usr/bin/bash"] diff --git a/images/ubuntu/script/bt.sh b/images/ubuntu/script/bt.sh deleted file mode 100644 index e4d849bf..00000000 --- a/images/ubuntu/script/bt.sh +++ /dev/null @@ -1,457 +0,0 @@ -#!/bin/bash -PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin -export PATH -LANG=en_US.UTF-8 - - -echo " -+---------------------------------------------------------------------- -| Bt-WebPanel 5.x FOR Ubuntu/Debian -+---------------------------------------------------------------------- -| Copyright © 2015-2018 BT-SOFT(http://www.bt.cn) All rights reserved. -+---------------------------------------------------------------------- -| The WebPanel URL will be http://SERVER_IP:8888 when installed. -+---------------------------------------------------------------------- -" - -if [ `whoami` != "root" ];then - echo -e "\033[31mError: Please run the script with root privileges on Ubuntu, for example: sudo bash install.sh\033[0m"; - exit; -fi - -#自动选择下载节点 -get_node_url(){ - nodes=(http://125.88.182.172:5880 http://103.224.251.67 http://128.1.164.196 http://download.bt.cn); - i=1; - - for node in ${nodes[@]}; - do - start=`date +%s.%N` - result=`curl -sS --connect-timeout 3 -m 60 $node/check.txt` - if [ $result = 'True' ];then - end=`date +%s.%N` - start_s=`echo $start | cut -d '.' -f 1` - start_ns=`echo $start | cut -d '.' -f 2` - end_s=`echo $end | cut -d '.' -f 1` - end_ns=`echo $end | cut -d '.' -f 2` - time_micro=$(( (10#$end_s-10#$start_s)*1000000 + (10#$end_ns/1000 - 10#$start_ns/1000) )) - time_ms=$(($time_micro/1000)) - values[$i]=$time_ms; - urls[$time_ms]=$node - i=$(($i+1)) - fi - done - j=5000 - for n in ${values[@]}; - do - if [ $j -gt $n ];then - j=$n - fi - done - if [ $j = 5000 ];then - NODE_URL='http://download.bt.cn'; - else - NODE_URL=${urls[$j]} - fi - -} - -echo '---------------------------------------------'; -echo "Selected download node..."; -get_node_url -download_Url=$NODE_URL -echo "Download node: $download_Url"; -echo '---------------------------------------------'; -setup_path=/www -if [ -f $setup_path/server/panel/data/port.pl ];then - port=`cat $setup_path/server/panel/data/port.pl` -else - port='8888' -fi - -echo "=>BT Panel will be install to the $setup_path directory now" -startTime=`date +%s` - -#数据盘自动分区 -fdiskP(){ - - for i in `cat /proc/partitions|grep -v name|grep -v ram|awk '{print $4}'|grep -v '^$'|grep -v '[0-9]$'|grep -e 'vd' -e 'sd' -e 'xv'`; - do - #判断/www是否被挂载 - isR=`df -P|grep $setup_path` - if [ "$isR" != "" ];then - echo 'Warning: The /www directory has been mounted.' - return; - fi - #判断是否存在未分区磁盘 - isP=`fdisk -l /dev/$i |grep -v 'bytes'|grep "$i[1-9]*"` - if [ "$isP" = "" ];then - #开始分区 - fdisk -S 56 /dev/$i << EOF -n -p -1 - - -wq -EOF - - sleep 5 - #检查是否分区成功 - checkP=`fdisk -l /dev/$i|grep "/dev/${i}1"` - if [ "$checkP" != "" ];then - #格式化分区 - mkfs.ext4 /dev/${i}1 - mkdir $setup_path - #挂载分区 - sed -i "/\/dev\/${i}1/d" /etc/fstab - echo "/dev/${i}1 $setup_path ext4 defaults 0 0" >> /etc/fstab - mount -a - df -h - fi - else - #判断是否存在Windows磁盘分区 - isN=`fdisk -l /dev/$i|grep -v 'bytes'|grep -v "NTFS"|grep -v "FAT32"` - if [ "$isN" = "" ];then - echo 'Warning: The Windows partition was detected. For your data security, Mount manually.'; - return; - fi - - #挂载已有分区 - checkR=`df -P|grep "/dev/$i"` - if [ "$checkR" = "" ];then - mkdir $setup_path - sed -i "/\/dev\/${i}1/d" /etc/fstab - echo "/dev/${i}1 $setup_path ext4 defaults 0 0" >> /etc/fstab - mount -a - df -h - fi - - #清理不可写分区 - echo 'True' > $setup_path/checkD.pl - if [ ! -f $setup_path/checkD.pl ];then - sed -i "/\/dev\/${i}1/d" /etc/fstab - mount -a - df -h - else - rm -f $setup_path/checkD.pl - fi - fi - done -} -#fdiskP - -ln -sf bash /bin/sh -apt-get install ruby -y -apt-get update -y -apt-get install lsb-release -y -#apt-get install ntp ntpdate -y -#/etc/init.d/ntp stop -#update-rc.d ntp remove -#cat >>~/.profile<&1|awk '{print $2}') -pVersion=${tmp:0:3} - -Install_setuptools() -{ - if [ ! -f "/usr/bin/easy_install" ];then - wget -O setuptools-33.1.1.zip $download_Url/install/src/setuptools-33.1.1.zip -T 10 - unzip setuptools-33.1.1.zip - rm -f setuptools-33.1.1.zip - cd setuptools-33.1.1 - python setup.py install - cd .. - rm -rf setuptools-33.1.1 - fi - - if [ ! -f "/usr/bin/easy_install" ];then - echo '================================================='; - echo -e "\033[31msetuptools installation failed. \033[0m"; - exit; - fi -} -Install_Pillow() -{ - isSetup=`python -m PIL 2>&1|grep package` - if [ "$isSetup" = "" ];then - wget -O Pillow-3.2.0.zip $download_Url/install/src/Pillow-3.2.0.zip -T 10 - unzip Pillow-3.2.0.zip - rm -f Pillow-3.2.0.zip - cd Pillow-3.2.0 - python setup.py install - cd .. - rm -rf Pillow-3.2.0 - fi - isSetup=`python -m PIL 2>&1|grep package` - if [ "$isSetup" = "" ];then - echo '================================================='; - echo -e "\033[31mPillow installation failed. \033[0m"; - exit; - fi -} - -Install_psutil() -{ - isSetup=`python -m psutil 2>&1|grep package` - if [ "$isSetup" = "" ];then - wget -O psutil-5.2.2.tar.gz $download_Url/install/src/psutil-5.2.2.tar.gz -T 10 - tar xvf psutil-5.2.2.tar.gz - rm -f psutil-5.2.2.tar.gz - cd psutil-5.2.2 - python setup.py install - cd .. - rm -rf psutil-5.2.2 - fi - isSetup=`python -m psutil 2>&1|grep package` - if [ "$isSetup" = "" ];then - echo '================================================='; - echo -e "\033[31mpsutil installation failed. \033[0m"; - exit; - fi -} - -Install_mysqldb() -{ - isSetup=`python -m MySQLdb 2>&1|grep package` - if [ "$isSetup" = "" ];then - wget -O MySQL-python-1.2.5.zip $download_Url/install/src/MySQL-python-1.2.5.zip -T 10 - unzip MySQL-python-1.2.5.zip - rm -f MySQL-python-1.2.5.zip - cd MySQL-python-1.2.5 - python setup.py install - cd .. - rm -rf MySQL-python-1.2.5 - fi - -} - -Install_chardet() -{ - isSetup=`python -m chardet 2>&1|grep package` - if [ "$isSetup" = "" ];then - wget -O chardet-2.3.0.tar.gz $download_Url/install/src/chardet-2.3.0.tar.gz -T 10 - tar xvf chardet-2.3.0.tar.gz - rm -f chardet-2.3.0.tar.gz - cd chardet-2.3.0 - python setup.py install - cd .. - rm -rf chardet-2.3.0 - fi - isSetup=`python -m chardet 2>&1|grep package` - if [ "$isSetup" = "" ];then - echo '================================================='; - echo -e "\033[31mchardet installation failed. \033[0m"; - exit; - fi -} - -Install_webpy() -{ - isSetup=`python -m web 2>&1|grep package` - if [ "$isSetup" = "" ];then - wget -O web.py-0.38.tar.gz $download_Url/install/src/web.py-0.38.tar.gz -T 10 - tar xvf web.py-0.38.tar.gz - rm -f web.py-0.38.tar.gz - cd web.py-0.38 - python setup.py install - cd .. - rm -rf web.py-0.38 - fi - - isSetup=`python -m web 2>&1|grep package` - if [ "$isSetup" = "" ];then - echo '================================================='; - echo -e "\033[31mweb.py installation failed. \033[0m"; - exit; - fi -} -pipArg='' - - -pip install setuptools -#pip install --upgrade pip $pipArg -pip install psutil chardet web.py virtualenv Pillow $pipArg - - -Install_Pillow -Install_psutil -if [ -f /www/server/mysql/bin/mysql ]; then - pip install mysql-python - Install_mysqldb -fi -Install_chardet -Install_webpy - -mkdir -p $setup_path/server/panel/logs -mkdir -p $setup_path/server/panel/vhost/apache -mkdir -p $setup_path/server/panel/vhost/nginx -mkdir -p $setup_path/server/panel/vhost/rewrite -wget -O $setup_path/server/panel/certbot-auto $download_Url/install/certbot-auto.init -T 5 -chmod +x $setup_path/server/panel/certbot-auto - - -if [ -f '/etc/init.d/bt' ];then - /etc/init.d/bt stop -fi - -mkdir -p /www/server -mkdir -p /www/wwwroot -mkdir -p /www/wwwlogs -mkdir -p /www/backup/database -mkdir -p /www/backup/site - -wget -O panel.zip $download_Url/install/src/panel.zip -T 10 -wget -O /etc/init.d/bt $download_Url/install/src/bt.init -T 10 -if [ -f "$setup_path/server/panel/data/default.db" ];then - if [ -d "/$setup_path/server/panel/old_data" ];then - rm -rf $setup_path/server/panel/old_data - fi - mkdir -p $setup_path/server/panel/old_data - mv -f $setup_path/server/panel/data/default.db $setup_path/server/panel/old_data/default.db - mv -f $setup_path/server/panel/data/system.db $setup_path/server/panel/old_data/system.db - mv -f $setup_path/server/panel/data/aliossAs.conf $setup_path/server/panel/old_data/aliossAs.conf - mv -f $setup_path/server/panel/data/qiniuAs.conf $setup_path/server/panel/old_data/qiniuAs.conf - mv -f $setup_path/server/panel/data/iplist.txt $setup_path/server/panel/old_data/iplist.txt - mv -f $setup_path/server/panel/data/port.pl $setup_path/server/panel/old_data/port.pl -fi - -unzip -o panel.zip -d $setup_path/server/ > /dev/null - -if [ -d "$setup_path/server/panel/old_data" ];then - mv -f $setup_path/server/panel/old_data/default.db $setup_path/server/panel/data/default.db - mv -f $setup_path/server/panel/old_data/system.db $setup_path/server/panel/data/system.db - mv -f $setup_path/server/panel/old_data/aliossAs.conf $setup_path/server/panel/data/aliossAs.conf - mv -f $setup_path/server/panel/old_data/qiniuAs.conf $setup_path/server/panel/data/qiniuAs.conf - mv -f $setup_path/server/panel/old_data/iplist.txt $setup_path/server/panel/data/iplist.txt - mv -f $setup_path/server/panel/old_data/port.pl $setup_path/server/panel/data/port.pl - - if [ -d "/$setup_path/server/panel/old_data" ];then - rm -rf $setup_path/server/panel/old_data - fi -fi - -rm -f panel.zip - -if [ ! -f $setup_path/server/panel/tools.py ];then - echo -e "\033[31mERROR: Failed to download, please try again!\033[0m"; - echo '============================================' - exit; -fi - -rm -f $setup_path/server/panel/class/*.pyc -rm -f $setup_path/server/panel/*.pyc -python -m compileall $setup_path/server/panel -#rm -f $setup_path/server/panel/class/*.py -#rm -f $setup_path/server/panel/*.py - -chmod 777 /tmp -chmod +x /etc/init.d/bt -update-rc.d bt defaults -chmod -R 600 $setup_path/server/panel -chmod +x $setup_path/server/panel/certbot-auto -chmod -R +x $setup_path/server/panel/script -echo "$port" > $setup_path/server/panel/data/port.pl -/etc/init.d/bt start -password=`cat /dev/urandom | head -n 16 | md5sum | head -c 8` -cd $setup_path/server/panel/ -python tools.py username -username=`python tools.pyc panel $password` -cd ~ -echo "$password" > $setup_path/server/panel/default.pl -chmod 600 $setup_path/server/panel/default.pl - -isStart=`ps aux |grep 'python main.pyc'|grep -v grep|awk '{print $2}'` -if [ "$isStart" == '' ];then - echo -e "\033[31mERROR: The BT-Panel service startup failed.\033[0m"; - echo '============================================' - exit; -fi - -if [ ! -f "/usr/bin/ufw" ];then - apt-get install -y ufw -fi - -if [ -f "/usr/sbin/ufw" ];then - ufw allow 888,20,21,22,80,$port/tcp - ufw allow 39000:40000/tcp - ufw_status=`ufw status` - echo y|ufw enable - ufw default deny - ufw reload -fi - -pip install psutil chardet web.py psutil virtualenv $pipArg -if [ ! -d '/etc/letsencrypt' ];then - - mkdir -p /var/spool/cron - if [ ! -f '/var/spool/cron/crontabs/root' ];then - echo '' > /var/spool/cron/crontabs/root - chmod 600 /var/spool/cron/crontabs/root - fi - isCron=`cat /var/spool/cron/crontabs/root|grep certbot.log` - if [ "${isCron}" == "" ];then - echo "30 2 * * * $setup_path/server/panel/certbot-auto renew >> $setup_path/server/panel/logs/certbot.log" >> /var/spool/cron/crontabs/root - chown 600 /var/spool/cron/crontabs/root - fi - service cron restart - nohup $setup_path/server/panel/certbot-auto -n > /tmp/certbot-auto.log 2>&1 & -fi -if [[ "${deepinSys}" =~ eepin ]]; then - address="localhost" -else - address=`curl -sS --connect-timeout 10 -m 60 https://www.bt.cn/Api/getIpAddress` - - if [ "$address" == '0.0.0.0' ] || [ "$address" == '' ];then - isHosts=`cat /etc/hosts|grep 'www.bt.cn'` - if [ "$isHosts" == '' ];then - echo "" >> /etc/hosts - echo "125.88.182.170 www.bt.cn" >> /etc/hosts - address=`curl -sS --connect-timeout 10 -m 60 https://www.bt.cn/Api/getIpAddress` - if [ "$address" == '' ];then - sed -i "/bt.cn/d" /etc/hosts - fi - fi - fi - - ipCheck=`python -c "import re; print re.match('^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$','$address')"` - if [ "$address" == "None" ];then - address="SERVER_IP" - fi - if [ "$address" != "SERVER_IP" ];then - echo "$address" > $setup_path/server/panel/data/iplist.txt - fi -fi - -curl -sS --connect-timeout 10 -m 60 https://www.bt.cn/Api/SetupCount?type=Linux\&o=$1 > /dev/null 2>&1 -if [ $1 != "" ];then - echo $1 > /www/server/panel/data/o.pl - cd /www/server/panel - python tools.py o -fi - -echo -e "==================================================================" -echo -e "\033[32mCongratulations! Install succeeded!\033[0m" -echo -e "==================================================================" -echo -e "Bt-Panel: http://$address:$port" -echo -e "username: $username" -echo -e "password: $password" -echo -e "\033[33mWarning:\033[0m" -echo -e "\033[33mIf you cannot access the panel, \033[0m" -echo -e "\033[33mrelease the following port (8888|888|80|443|20|21) in the security group\033[0m" -echo -e "==================================================================" - -endTime=`date +%s` -((outTime=($endTime-$startTime)/60)) -echo -e "Time consumed:\033[32m $outTime \033[0mMinute!" -rm -f install.sh diff --git a/images/ubuntu/script/btpanel.sh b/images/ubuntu/script/btpanel.sh deleted file mode 100644 index bad4daa9..00000000 --- a/images/ubuntu/script/btpanel.sh +++ /dev/null @@ -1,404 +0,0 @@ - #!/bin/bash - PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin - export PATH - LANG=en_US.UTF-8 - - echo " - +---------------------------------------------------------------------- - | Bt-WebPanel 5.x FOR Ubuntu/Debian - +---------------------------------------------------------------------- - | Copyright © 2015-2018 BT-SOFT(http://www.bt.cn) All rights reserved. - +---------------------------------------------------------------------- - | The WebPanel URL will be http://SERVER_IP:8888 when installed. - +----------------------------------------------------------------------" - - if [ $(id -u) != "0" ];then - echo -e "\033[31mError: Please run the script with root privileges on Ubuntu, for example: sudo bash $0\033[0m"; - exit; - fi - - if [[ `cat /etc/issue | grep buntu` == '' ]]; then - echo "Only Support Ubuntu" - fi - - #自动选择下载节点 - get_node_url(){ - nodes=(http://125.88.182.172:5880 http://103.224.251.67 http://128.1.164.196 http://download.bt.cn); - for node in ${nodes[@]}; - do - start=`date +%s.%N` - result=`curl -sS --connect-timeout 3 -m 60 $node/check.txt` - if [ $result = 'True' ];then - end=`date +%s.%N` - start_s=`echo $start | cut -d '.' -f 1` - start_ns=`echo $start | cut -d '.' -f 2` - end_s=`echo $end | cut -d '.' -f 1` - end_ns=`echo $end | cut -d '.' -f 2` - time_micro=$(( (10#$end_s-10#$start_s)*1000000 + (10#$end_ns/1000 - 10#$start_ns/1000) )) - time_ms=$(($time_micro/1000)) - values[$i]=$time_ms; - urls[$time_ms]=$node - i=$(($i+1)) - fi - done - j=5000 - for n in ${values[@]}; - do - if [ $j -gt $n ];then - j=$n - fi - done - if [ $j = 5000 ];then - NODE_URL='http://download.bt.cn'; - else - NODE_URL=${urls[$j]} - fi - - } - - function set_pip() - { - mkdir -p ${HOME}/.pip - touch ${HOME}/.pip/pip.conf - echo "[global] - index-url=http://mirrors.aliyun.com/pypi/simple/ - - [install] - trusted-host=mirrors.aliyun.com" >${HOME}/.pip/pip.conf - } - - ln -sf bash /bin/sh - apt-get update -y - apt-get upgrade -y - apt-get install ruby -y - apt-get install lsb-release -y - apt-get install -y --no-install-recommends wget curl zip unzip vim git - apt-get install -y --no-install-recommends python python-pip python-dev python-imaging python-pil openssl libssl-dev gcc libxml2 libxml2-dev libxslt zlib1g zlib1g-dev libjpeg-dev libpng-dev lsof libpcre3 libpcre3-dev cron - set_pip - - # apt-get install -y --no-install-recommends ntp ntpdate - - #/etc/init.d/ntp stop - #update-rc.d ntp remove - #cat >>~/.profile<BT Panel will be install to the $setup_path directory now" - - startTime=`date +%s` - - tmp=$(python -V 2>&1|awk '{print $2}') - pVersion=${tmp:0:3} - - Install_setuptools() - { - if [ ! -f "/usr/bin/easy_install" ];then - wget -O setuptools-33.1.1.zip $download_Url/install/src/setuptools-33.1.1.zip -T 10 - unzip setuptools-33.1.1.zip - rm -f setuptools-33.1.1.zip - cd setuptools-33.1.1 - python setup.py install - cd .. - rm -rf setuptools-33.1.1 - fi - - if [ ! -f "/usr/bin/easy_install" ];then - echo '================================================='; - echo -e "\033[31msetuptools installation failed. \033[0m"; - exit; - fi - } - Install_Pillow() - { - isSetup=`python -m PIL 2>&1|grep package` - if [ "$isSetup" = "" ];then - wget -O Pillow-3.2.0.zip $download_Url/install/src/Pillow-3.2.0.zip -T 10 - unzip Pillow-3.2.0.zip - rm -f Pillow-3.2.0.zip - cd Pillow-3.2.0 - python setup.py install - cd .. - rm -rf Pillow-3.2.0 - fi - isSetup=`python -m PIL 2>&1|grep package` - if [ "$isSetup" = "" ];then - echo '================================================='; - echo -e "\033[31mPillow installation failed. \033[0m"; - exit; - fi - } - - Install_psutil() - { - isSetup=`python -m psutil 2>&1|grep package` - if [ "$isSetup" = "" ];then - wget -O psutil-5.2.2.tar.gz $download_Url/install/src/psutil-5.2.2.tar.gz -T 10 - tar xvf psutil-5.2.2.tar.gz - rm -f psutil-5.2.2.tar.gz - cd psutil-5.2.2 - python setup.py install - cd .. - rm -rf psutil-5.2.2 - fi - isSetup=`python -m psutil 2>&1|grep package` - if [ "$isSetup" = "" ];then - echo '================================================='; - echo -e "\033[31mpsutil installation failed. \033[0m"; - exit; - fi - } - - Install_mysqldb() - { - isSetup=`python -m MySQLdb 2>&1|grep package` - if [ "$isSetup" = "" ];then - wget -O MySQL-python-1.2.5.zip $download_Url/install/src/MySQL-python-1.2.5.zip -T 10 - unzip MySQL-python-1.2.5.zip - rm -f MySQL-python-1.2.5.zip - cd MySQL-python-1.2.5 - python setup.py install - cd .. - rm -rf MySQL-python-1.2.5 - fi - - } - - Install_chardet() - { - isSetup=`python -m chardet 2>&1|grep package` - if [ "$isSetup" = "" ];then - wget -O chardet-2.3.0.tar.gz $download_Url/install/src/chardet-2.3.0.tar.gz -T 10 - tar xvf chardet-2.3.0.tar.gz - rm -f chardet-2.3.0.tar.gz - cd chardet-2.3.0 - python setup.py install - cd .. - rm -rf chardet-2.3.0 - fi - isSetup=`python -m chardet 2>&1|grep package` - if [ "$isSetup" = "" ];then - echo '================================================='; - echo -e "\033[31mchardet installation failed. \033[0m"; - exit; - fi - } - - Install_webpy() - { - isSetup=`python -m web 2>&1|grep package` - if [ "$isSetup" = "" ];then - wget -O web.py-0.38.tar.gz $download_Url/install/src/web.py-0.38.tar.gz -T 10 - tar xvf web.py-0.38.tar.gz - rm -f web.py-0.38.tar.gz - cd web.py-0.38 - python setup.py install - cd .. - rm -rf web.py-0.38 - fi - - isSetup=`python -m web 2>&1|grep package` - if [ "$isSetup" = "" ];then - echo '================================================='; - echo -e "\033[31mweb.py installation failed. \033[0m"; - exit; - fi - } - pipArg='' - - - pip install setuptools - #pip install --upgrade pip $pipArg - pip install psutil chardet web.py virtualenv Pillow $pipArg - - Install_Pillow - Install_psutil - if [ -f /www/server/mysql/bin/mysql ]; then - pip install mysql-python - Install_mysqldb - fi - Install_chardet - Install_webpy - - mkdir -p $setup_path/server/panel/logs - mkdir -p $setup_path/server/panel/vhost/apache - mkdir -p $setup_path/server/panel/vhost/nginx - mkdir -p $setup_path/server/panel/vhost/rewrite - wget -O $setup_path/server/panel/certbot-auto $download_Url/install/certbot-auto.init -T 5 - chmod +x $setup_path/server/panel/certbot-auto - - - if [ -f '/etc/init.d/bt' ];then - /etc/init.d/bt stop - fi - - mkdir -p /www/server - mkdir -p /www/wwwroot - mkdir -p /www/wwwlogs - mkdir -p /www/backup/database - mkdir -p /www/backup/site - - wget -O panel.zip $download_Url/install/src/panel.zip -T 10 - wget -O /etc/init.d/bt $download_Url/install/src/bt.init -T 10 - if [ -f "$setup_path/server/panel/data/default.db" ];then - if [ -d "/$setup_path/server/panel/old_data" ];then - rm -rf $setup_path/server/panel/old_data - fi - mkdir -p $setup_path/server/panel/old_data - mv -f $setup_path/server/panel/data/default.db $setup_path/server/panel/old_data/default.db - mv -f $setup_path/server/panel/data/system.db $setup_path/server/panel/old_data/system.db - mv -f $setup_path/server/panel/data/aliossAs.conf $setup_path/server/panel/old_data/aliossAs.conf - mv -f $setup_path/server/panel/data/qiniuAs.conf $setup_path/server/panel/old_data/qiniuAs.conf - mv -f $setup_path/server/panel/data/iplist.txt $setup_path/server/panel/old_data/iplist.txt - mv -f $setup_path/server/panel/data/port.pl $setup_path/server/panel/old_data/port.pl - fi - - unzip -o panel.zip -d $setup_path/server/ > /dev/null - - if [ -d "$setup_path/server/panel/old_data" ];then - mv -f $setup_path/server/panel/old_data/default.db $setup_path/server/panel/data/default.db - mv -f $setup_path/server/panel/old_data/system.db $setup_path/server/panel/data/system.db - mv -f $setup_path/server/panel/old_data/aliossAs.conf $setup_path/server/panel/data/aliossAs.conf - mv -f $setup_path/server/panel/old_data/qiniuAs.conf $setup_path/server/panel/data/qiniuAs.conf - mv -f $setup_path/server/panel/old_data/iplist.txt $setup_path/server/panel/data/iplist.txt - mv -f $setup_path/server/panel/old_data/port.pl $setup_path/server/panel/data/port.pl - - if [ -d "/$setup_path/server/panel/old_data" ];then - rm -rf $setup_path/server/panel/old_data - fi - fi - - rm -f panel.zip - - if [ ! -f $setup_path/server/panel/tools.py ];then - echo -e "\033[31mERROR: Failed to download, please try again!\033[0m"; - echo '============================================' - exit; - fi - - rm -f $setup_path/server/panel/class/*.pyc - rm -f $setup_path/server/panel/*.pyc - python -m compileall $setup_path/server/panel - #rm -f $setup_path/server/panel/class/*.py - #rm -f $setup_path/server/panel/*.py - - chmod 777 /tmp - chmod +x /etc/init.d/bt - update-rc.d bt defaults - chmod -R 600 $setup_path/server/panel - chmod +x $setup_path/server/panel/certbot-auto - chmod -R +x $setup_path/server/panel/script - echo "$port" > $setup_path/server/panel/data/port.pl - /etc/init.d/bt start - # username=`python tools.pyc panel $password` - username='ubuntu' - # password=`cat /dev/urandom | head -n 16 | md5sum | head -c 8` - password='ubuntu' - cd $setup_path/server/panel/ - python tools.py username - cd ~ - echo "$password" > $setup_path/server/panel/default.pl - chmod 600 $setup_path/server/panel/default.pl - - isStart=`ps aux |grep 'python main.pyc'|grep -v grep|awk '{print $2}'` - if [ "$isStart" == '' ];then - echo -e "\033[31mERROR: The BT-Panel service startup failed.\033[0m"; - echo '============================================' - exit; - fi - - if [ ! -f "/usr/bin/ufw" ];then - apt-get install -y ufw - fi - - if [ -f "/usr/sbin/ufw" ];then - ufw allow 888,20,21,22,80,$port/tcp - ufw allow 39000:40000/tcp - ufw_status=`ufw status` - echo y|ufw enable - ufw default deny - ufw reload - fi - - pip install psutil chardet web.py psutil virtualenv $pipArg - if [ ! -d '/etc/letsencrypt' ];then - - mkdir -p /var/spool/cron - if [ ! -f '/var/spool/cron/crontabs/root' ];then - echo '' > /var/spool/cron/crontabs/root - chmod 600 /var/spool/cron/crontabs/root - fi - isCron=`cat /var/spool/cron/crontabs/root|grep certbot.log` - if [ "${isCron}" == "" ];then - echo "30 2 * * * $setup_path/server/panel/certbot-auto renew >> $setup_path/server/panel/logs/certbot.log" >> /var/spool/cron/crontabs/root - chown 600 /var/spool/cron/crontabs/root - fi - service cron restart - nohup $setup_path/server/panel/certbot-auto -n > /tmp/certbot-auto.log 2>&1 & - fi - if [[ "${deepinSys}" =~ eepin ]]; then - address="localhost" - else - address=`curl -sS --connect-timeout 10 -m 60 https://www.bt.cn/Api/getIpAddress` - - if [ "$address" == '0.0.0.0' ] || [ "$address" == '' ];then - isHosts=`cat /etc/hosts|grep 'www.bt.cn'` - if [ "$isHosts" == '' ];then - echo "" >> /etc/hosts - echo "125.88.182.170 www.bt.cn" >> /etc/hosts - address=`curl -sS --connect-timeout 10 -m 60 https://www.bt.cn/Api/getIpAddress` - if [ "$address" == '' ];then - sed -i "/bt.cn/d" /etc/hosts - fi - fi - fi - - ipCheck=`python -c "import re; print re.match('^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$','$address')"` - if [ "$address" == "None" ];then - address="SERVER_IP" - fi - if [ "$address" != "SERVER_IP" ];then - echo "$address" > $setup_path/server/panel/data/iplist.txt - fi - fi - - curl -sS --connect-timeout 10 -m 60 https://www.bt.cn/Api/SetupCount?type=Linux\&o=$1 > /dev/null 2>&1 - if [ $1 != "" ];then - echo $1 > /www/server/panel/data/o.pl - cd /www/server/panel - python tools.py o - fi - - echo -e "==================================================================" - echo -e "\033[32mCongratulations! Install succeeded!\033[0m" - echo -e "==================================================================" - echo -e "Bt-Panel: http://$address:$port" - echo -e "username: $username" - echo -e "password: $password" - echo -e "\033[33mWarning:\033[0m" - echo -e "\033[33mIf you cannot access the panel, \033[0m" - echo -e "\033[33mrelease the following port (8888|888|80|443|20|21) in the security group\033[0m" - echo -e "==================================================================" - - endTime=`date +%s` - ((outTime=($endTime-$startTime)/60)) - echo -e "Time consumed:\033[32m $outTime \033[0mMinute!" - # rm -f install.sh diff --git a/images/ubuntu/script/build.sh b/images/ubuntu/script/build.sh deleted file mode 100644 index a05dcaa6..00000000 --- a/images/ubuntu/script/build.sh +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env bash - -function init_env() -{ - echo '=>Modify Default Ubutnu Software Mirrors' - sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list - sed -i 's/deb\ http:\/\/security/#deb\ http:\/\/security/g' /etc/apt/sources.list - - # Install nss-wrapper to be able to execute image as non-root user - # echo '=>Update Local Software' - - echo '=>Install Xfce4 UI' - # apt install -y firefox firefox-locale-en firefox-locale-zh-hans - # apt update - # apt install -y xfce4 xfce4-terminal - # apt autoremove -y \ - # apt-get clean all \ - # rm -fr /var/lib/apt/lists/* - - echo "=>Generate locales en_US.UTF-8" - locale-gen en_US.UTF-8 - - # echo "=>Add 'source generate_container_user' to .bashrc" - # have to be added to hold all env vars correctly - # echo 'source $STARTUPDIR/generate_container_user' >> $HOME/.bashrc - - echo '=>Set Locale' - echo 'LANG='en_US.UTF-8'' >> $HOME/.bashrc - echo 'LANGUAGE='en_US:en'' >> $HOME/.bashrc - echo 'LC_ALL='en_US.UTF-8'' >> $HOME/.bashrc - - echo '=> Config Chromium: write correct window size to chrome properties' - VNC_RES_W=${VNC_RESOLUTION%x*} - VNC_RES_H=${VNC_RESOLUTION#*x} - - echo -e "\n=>Update chromium-browser.init" - echo -e "\n=>Set window size $VNC_RES_W x $VNC_RES_H as chrome window size!\n" - echo "CHROMIUM_FLAGS='--no-sandbox --disable-gpu --user-data-dir --window-size=$VNC_RES_W,$VNC_RES_H --window-position=0,0'" > $HOME/.chromium-browser.init - - # Config VNC - echo '=>Start Config VNC' - echo "==>Install TigerVNC server" - wget -qO- --no-check-certificate https://dev.tencent.com/u/imxieke/p/attachment/git/raw/master/src/tigervnc-1.8.0.x86_64.tar.gz | tar xz --strip 1 -C / - echo "==>Install noVNC - HTML5 based VNC viewer" - mkdir -p $NO_VNC_HOME/utils/websockify - wget -qO- --no-check-certificate https://dev.tencent.com/u/imxieke/p/attachment/git/raw/master/src/no-vnc_v1.0.0.tar.gz | tar xz --strip 1 -C $NO_VNC_HOME - # use older version of websockify to prevent hanging connections on offline containers, see https://github.com/ConSol/docker-headless-vnc-container/issues/50 - wget -qO- --no-check-certificate https://dev.tencent.com/u/imxieke/p/attachment/git/raw/master/src/websockify_v0.6.1.tar.gz | tar xz --strip 1 -C $NO_VNC_HOME/utils/websockify - chmod +x -v $NO_VNC_HOME/utils/*.sh - ## create index.html to forward automatically to `vnc_lite.html` - ln -s $NO_VNC_HOME/vnc.html $NO_VNC_HOME/index.html -} - -# Start Build -echo '=>Start Build Ubuntu VNC Server on Docker ' -init_env - -# Set current user in nss_wrapper -NSS_WRAPPER_PASSWD=/etc/passwd -NSS_WRAPPER_GROUP=/etc/group - -# cat /etc/passwd > $NSS_WRAPPER_PASSWD -# echo "${USER}:x:${USER_ID}:${GROUP_ID}:Default Application User:${HOME}:/bin/bash" >> $NSS_WRAPPER_PASSWD - -echo 'export NSS_WRAPPER_PASSWD' >> $HOME/.bashrc -echo 'export NSS_WRAPPER_GROUP' >> $HOME/.bashrc - -if [ -r /usr/lib/libnss_wrapper.so ]; then - LD_PRELOAD=/usr/lib/libnss_wrapper.so -elif [ -r /usr/lib64/libnss_wrapper.so ]; then - LD_PRELOAD=/usr/lib64/libnss_wrapper.so -else - echo "no libnss_wrapper.so installed!" - exit 1 -fi - -echo 'export LD_PRELOAD' >> $HOME/.bashrc -useradd -d /home/${USER} -m -s /bin/zsh ${USER} -echo "${USER}:${PASSWD}" | chpasswd -echo "root:${PASSWD}" | chpasswd -echo "${USER} ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers - -echo 'Config oh my zsh' -echo "Cloning oh my zsh to $HOME" -#sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" -git clone --depth=1 https://git.dev.tencent.com/imxieke/ohmyzsh.git ${HOME}/.oh-my-zsh -cp ${HOME}/.oh-my-zsh/templates/zshrc.zsh-template ${HOME}/.zshrc - -echo 'Set Catelog Permission' -find "${HOME}"/ -name '*.desktop' -exec chmod $verbose a+x {} + -chmod -R a+rw ${HOME} -chmod -R a+rw ${STARTUPDIR} -chmod -R a+x ${STARTUPDIR}/*.sh -chmod -R 755 $HOME -chown -R ${USER}:${USER} ${HOME} -chown -R ${USER}:${USER} ${STARTUPDIR} -chown -R ${USER}:${USER} ${HOME}/.* -chown ${USER}:${USER} ${HOME}/.zshrc diff --git a/images/ubuntu/script/startup.sh b/images/ubuntu/script/startup.sh deleted file mode 100644 index 524e6488..00000000 --- a/images/ubuntu/script/startup.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/bash -### every exit != 0 fails the script -set -e - -## print out help -help (){ -echo " -USAGE: -docker run -it -p 6901:6901 -p 5901:5901 consol/: