diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..e70ffba37e --- /dev/null +++ b/.gitattributes @@ -0,0 +1,18 @@ +# AVideo .gitattributes file. + +# Refer to: +# https://help.github.com/articles/dealing-with-line-endings/ + +*.yaml eol=lf +*.yml eol=lf + +# Refer to: +# https://github.com/github/linguist + +*.md linguist-documentation +*.txt linguist-documentation + +.github/* -linguist-detectable +.vscode/* -linguist-detectable +node_modules/* -linguist-detectable +vendor/* -linguist-detectable diff --git a/.github/stale.yml b/.github/stale.yml index 8bc9b21d4d..e127e6d821 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -1,17 +1,17 @@ -# Number of days of inactivity before an issue becomes stale -daysUntilStale: 30 -# Number of days of inactivity before a stale issue is closed -daysUntilClose: 3 -# Issues with these labels will never be considered stale -exemptLabels: - - pinned - - security -# Label to use when marking an issue as stale -staleLabel: wontfix -# Comment to post when marking an issue as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. -# Comment to post when closing a stale issue. Set to `false` to disable -closeComment: false +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 30 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 3 +# Issues with these labels will never be considered stale +exemptLabels: + - pinned + - security +# Label to use when marking an issue as stale +staleLabel: wontfix +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 4365e552aa..73e3565f6d 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,38 +1,38 @@ -name: Docker Image CI - -on: - push: - branches: - - "master" - pull_request: - branches: - - "master" -# schedule: -# - cron: '35 2 * * 1' - -permissions: - contents: read - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push - id: docker_build - uses: docker/build-push-action@v3 - with: - push: true - tags: ${{ secrets.DOCKERHUB_IMAGE }} +name: Docker Image CI + +on: + push: + branches: + - "master" + pull_request: + branches: + - "master" +# schedule: +# - cron: '35 2 * * 1' + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v3 + with: + push: true + tags: ${{ secrets.DOCKERHUB_IMAGE }} diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index d2e5869006..41a4dee361 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -1,54 +1,54 @@ -name: Validate/Lint - -on: [push, pull_request] - -permissions: - contents: read - -jobs: - build: - runs-on: ${{ matrix.operating-system }} - - strategy: - matrix: - operating-system: [ubuntu-latest] - php-versions: ['7.3', '7.4', '8.0', '8.1'] - name: PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }} - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - extensions: pcre - - - name: Validate composer.json and composer.lock - run: composer validate - - - name: Lint - run: | - lintPaths=() - lintPaths+=("${GITHUB_WORKSPACE}/admin") - lintPaths+=("${GITHUB_WORKSPACE}/feed") - lintPaths+=("${GITHUB_WORKSPACE}/install") - lintPaths+=("${GITHUB_WORKSPACE}/locale") - lintPaths+=("${GITHUB_WORKSPACE}/objects") - lintPaths+=("${GITHUB_WORKSPACE}/view") - lintPaths+=("${GITHUB_WORKSPACE}/index.php") - for lintPath in "${lintPaths[@]}" - do - for file in `find "$lintPath"` - do - EXTENSION="${file##*.}" - if [ "$EXTENSION" == "php" ] || [ "$EXTENSION" == "phtml" ] - then - RESULTS=`php -l "$file"` - if [ "$RESULTS" != "No syntax errors detected in $file" ] - then - echo $RESULTS - fi - fi - done - done +name: Validate/Lint + +on: [push, pull_request] + +permissions: + contents: read + +jobs: + build: + runs-on: ${{ matrix.operating-system }} + + strategy: + matrix: + operating-system: [ubuntu-latest] + php-versions: ['7.3', '7.4', '8.0', '8.1'] + name: PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }} + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: pcre + + - name: Validate composer.json and composer.lock + run: composer validate + + - name: Lint + run: | + lintPaths=() + lintPaths+=("${GITHUB_WORKSPACE}/admin") + lintPaths+=("${GITHUB_WORKSPACE}/feed") + lintPaths+=("${GITHUB_WORKSPACE}/install") + lintPaths+=("${GITHUB_WORKSPACE}/locale") + lintPaths+=("${GITHUB_WORKSPACE}/objects") + lintPaths+=("${GITHUB_WORKSPACE}/view") + lintPaths+=("${GITHUB_WORKSPACE}/index.php") + for lintPath in "${lintPaths[@]}" + do + for file in `find "$lintPath"` + do + EXTENSION="${file##*.}" + if [ "$EXTENSION" == "php" ] || [ "$EXTENSION" == "phtml" ] + then + RESULTS=`php -l "$file"` + if [ "$RESULTS" != "No syntax errors detected in $file" ] + then + echo $RESULTS + fi + fi + done + done diff --git a/_config.yml b/_config.yml index c4192631f2..277f1f2c51 100644 --- a/_config.yml +++ b/_config.yml @@ -1 +1 @@ -theme: jekyll-theme-cayman \ No newline at end of file +theme: jekyll-theme-cayman diff --git a/docker-compose.yml b/docker-compose.yml index 6e67d7106e..1bb02b157b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,65 +1,65 @@ -version: '3' - -services: - web: - build: . - restart: "unless-stopped" - ports: - - "80:80" - - "443:443" - environment: - DB_MYSQL_HOST: "database" - DB_MYSQL_PORT: 3306 - DB_MYSQL_NAME: "avideo" - DB_MYSQL_USER: "avideo" - DB_MYSQL_PASSWORD: "avideo" - SERVER_NAME: "localhost" +version: '3' + +services: + web: + build: . + restart: "unless-stopped" + ports: + - "80:80" + - "443:443" + environment: + DB_MYSQL_HOST: "database" + DB_MYSQL_PORT: 3306 + DB_MYSQL_NAME: "avideo" + DB_MYSQL_USER: "avideo" + DB_MYSQL_PASSWORD: "avideo" + SERVER_NAME: "localhost" ENABLE_PHPMYADMIN: "yes" CREATE_TLS_CERTIFICATE: "yes" TLS_CERTIFICATE_FILE: "/etc/apache2/ssl/localhost.crt" - TLS_CERTIFICATE_KEY: "/etc/apache2/ssl/localhost.key" + TLS_CERTIFICATE_KEY: "/etc/apache2/ssl/localhost.key" CONTACT_EMAIL: "admin@localhost" SYSTEM_ADMIN_PASSWORD: "password" WEBSITE_TITLE: "AVideo" - MAIN_LANGUAGE: "en_US" - volumes: - - "./var/www/avideo:/var/www/avideo" - depends_on: - - database - - phpmyadmin - networks: - - app_net - - phpmyadmin: - image: "phpmyadmin/phpmyadmin" - restart: "unless-stopped" - environment: - PMA_ABSOLUTE_URI: "https://localhost/phpmyadmin" - PMA_HOST: "database" - PMA_PORT: 3306 - PMA_CONTROLUSER: "avideo" - PMA_CONTROLPASS: "avideo" - PMA_PMADB: "avideo" - HIDE_PHP_VERSION: "true" - depends_on: - - database - networks: - - app_net - - database: - image: "mariadb:latest" - restart: "unless-stopped" - environment: - MYSQL_RANDOM_ROOT_PASSWORD: "yes" - MYSQL_INITDB_SKIP_TZINFO: 1 + MAIN_LANGUAGE: "en_US" + volumes: + - "./var/www/avideo:/var/www/avideo" + depends_on: + - database + - phpmyadmin + networks: + - app_net + + phpmyadmin: + image: "phpmyadmin/phpmyadmin" + restart: "unless-stopped" + environment: + PMA_ABSOLUTE_URI: "https://localhost/phpmyadmin" + PMA_HOST: "database" + PMA_PORT: 3306 + PMA_CONTROLUSER: "avideo" + PMA_CONTROLPASS: "avideo" + PMA_PMADB: "avideo" + HIDE_PHP_VERSION: "true" + depends_on: + - database + networks: + - app_net + + database: + image: "mariadb:latest" + restart: "unless-stopped" + environment: + MYSQL_RANDOM_ROOT_PASSWORD: "yes" + MYSQL_INITDB_SKIP_TZINFO: 1 MYSQL_DATABASE: "avideo" MYSQL_USER: "avideo" - MYSQL_PASSWORD: "avideo" - volumes: - - ./.compose/db:/var/lib/mysql - networks: - - app_net - -networks: - app_net: - driver: bridge + MYSQL_PASSWORD: "avideo" + volumes: + - ./.compose/db:/var/lib/mysql + networks: + - app_net + +networks: + app_net: + driver: bridge