From adb4c86f91747287001c724d7364f2ce7678ff6f Mon Sep 17 00:00:00 2001 From: Barbara-Pitt <76412907+Barbara-Pitt@users.noreply.github.com> Date: Sun, 27 Dec 2020 02:41:42 -0600 Subject: [PATCH 01/16] Create php.yml github workflow --- .github/workflows/php.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/php.yml diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 00000000..9385d5bb --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,37 @@ +name: PHP Composer + +on: + push: + branches: [ config ] + pull_request: + branches: [ config ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Validate composer.json and composer.lock + run: composer validate + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v2 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + if: steps.composer-cache.outputs.cache-hit != 'true' + run: composer install --prefer-dist --no-progress --no-suggest + + # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" + # Docs: https://getcomposer.org/doc/articles/scripts.md + + - name: Run test suite + run: composer run-script test From 423d5f993597c494944f337c98973d9f8ade5874 Mon Sep 17 00:00:00 2001 From: Barbara Pitt Date: Sun, 27 Dec 2020 02:42:30 -0600 Subject: [PATCH 02/16] github workflows update --- composer.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/composer.json b/composer.json index 6d93a6ef..f3d7a34a 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,8 @@ { "require": { "phpunit/phpunit": "^5" + }, + "scripts":{ + "test": "vendor/bin/phpunit tests" } } From c0351eaaa3b231bd89680b0dd8d881071cd0f0f3 Mon Sep 17 00:00:00 2001 From: Barbara Pitt Date: Sun, 27 Dec 2020 02:48:02 -0600 Subject: [PATCH 03/16] github workflows update --- composer.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/composer.json b/composer.json index f3d7a34a..490b5498 100644 --- a/composer.json +++ b/composer.json @@ -1,4 +1,6 @@ { + "name": "leftypol/leftypol", + "description": "An imageboard based on lainchans", "require": { "phpunit/phpunit": "^5" }, From c82e60e28dfe1dbdd76346f7040463de811789fe Mon Sep 17 00:00:00 2001 From: Barbara Pitt Date: Sun, 27 Dec 2020 02:49:22 -0600 Subject: [PATCH 04/16] github workflows update --- composer.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.lock b/composer.lock index 7703065d..f671350f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f6415b642f3e5a639d8206e318a777b3", + "content-hash": "8ccff279f128dadb7c4e24b60c31194a", "packages": [ { "name": "doctrine/instantiator", From 911c48123384b3f74928d6d181375190cca61597 Mon Sep 17 00:00:00 2001 From: Barbara Pitt Date: Sun, 27 Dec 2020 03:10:12 -0600 Subject: [PATCH 05/16] composer updates --- composer.json | 1 + composer.lock | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 490b5498..fce5e9a7 100644 --- a/composer.json +++ b/composer.json @@ -2,6 +2,7 @@ "name": "leftypol/leftypol", "description": "An imageboard based on lainchans", "require": { + "php": "5.6.40", "phpunit/phpunit": "^5" }, "scripts":{ diff --git a/composer.lock b/composer.lock index f671350f..bd19e4c1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8ccff279f128dadb7c4e24b60c31194a", + "content-hash": "18e1c1169d7719a196dbf162a8d01fb6", "packages": [ { "name": "doctrine/instantiator", @@ -1550,7 +1550,9 @@ "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, - "platform": [], + "platform": { + "php": "5.6.40" + }, "platform-dev": [], "plugin-api-version": "2.0.0" } From 752ebbe3e2cbfed4c54cd020b7530539d3182072 Mon Sep 17 00:00:00 2001 From: Barbara Pitt Date: Sun, 27 Dec 2020 03:13:52 -0600 Subject: [PATCH 06/16] git workflow updates --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 9385d5bb..2cab0aa0 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -9,7 +9,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-16.04 steps: - uses: actions/checkout@v2 From a4396ff9feeff7dae2796ca027dea6eaeb55e83e Mon Sep 17 00:00:00 2001 From: Barbara-Pitt <76412907+Barbara-Pitt@users.noreply.github.com> Date: Sun, 27 Dec 2020 03:33:14 -0600 Subject: [PATCH 07/16] Update php.yml --- .github/workflows/php.yml | 62 ++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 2cab0aa0..712e0f96 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -8,30 +8,38 @@ on: jobs: build: - - runs-on: ubuntu-16.04 - - steps: - - uses: actions/checkout@v2 - - - name: Validate composer.json and composer.lock - run: composer validate - - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@v2 - with: - path: vendor - key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-php- - - - name: Install dependencies - if: steps.composer-cache.outputs.cache-hit != 'true' - run: composer install --prefer-dist --no-progress --no-suggest - - # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" - # Docs: https://getcomposer.org/doc/articles/scripts.md - - - name: Run test suite - run: composer run-script test + strategy: + matrix: + php: ['5.6.40'] + os: ['ubuntu-16.04'] + include: + - php: '5.6.40' + os: 'ubuntu-16.04' + + runs-on: ${{ matrix.os }} + env: + PHP_VERSION: ${{ matrix.php }} + steps: + - uses: actions/checkout@v2 + + - name: Validate composer.json and composer.lock + run: composer validate + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v2 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + if: steps.composer-cache.outputs.cache-hit != 'true' + run: composer install --prefer-dist --no-progress --no-suggest + + # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" + # Docs: https://getcomposer.org/doc/articles/scripts.md + + - name: Run test suite + run: composer run-script test From 63ec76a0b0cf76c472079da7c6858da9295a87a6 Mon Sep 17 00:00:00 2001 From: Barbara-Pitt <76412907+Barbara-Pitt@users.noreply.github.com> Date: Sun, 27 Dec 2020 03:36:07 -0600 Subject: [PATCH 08/16] Update php.yml --- .github/workflows/php.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 712e0f96..1a3fe955 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -10,10 +10,10 @@ jobs: build: strategy: matrix: - php: ['5.6.40'] + php: ['5.6'] os: ['ubuntu-16.04'] include: - - php: '5.6.40' + - php: '5.6' os: 'ubuntu-16.04' runs-on: ${{ matrix.os }} @@ -30,9 +30,9 @@ jobs: uses: actions/cache@v2 with: path: vendor - key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + key: ${{ matrix.os }}-php-${{ hashFiles('**/composer.lock') }} restore-keys: | - ${{ runner.os }}-php- + ${{ matrix.os }}-php- - name: Install dependencies if: steps.composer-cache.outputs.cache-hit != 'true' From a3b2c96df5d0ae95c6454b540150de10f3ca50dc Mon Sep 17 00:00:00 2001 From: Barbara-Pitt <76412907+Barbara-Pitt@users.noreply.github.com> Date: Sun, 27 Dec 2020 03:40:57 -0600 Subject: [PATCH 09/16] Update php.yml --- .github/workflows/php.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 1a3fe955..60bf36fe 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -21,6 +21,9 @@ jobs: PHP_VERSION: ${{ matrix.php }} steps: - uses: actions/checkout@v2 + + - name: Install composer + run: composer install --prefer-dist --no-progress --no-suggest - name: Validate composer.json and composer.lock run: composer validate From 43c333654dcbd0bfe02d0270e94876bc3d85db98 Mon Sep 17 00:00:00 2001 From: Barbara-Pitt <76412907+Barbara-Pitt@users.noreply.github.com> Date: Sun, 27 Dec 2020 03:46:50 -0600 Subject: [PATCH 10/16] Update php.yml --- .github/workflows/php.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 60bf36fe..079d1d6a 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -21,9 +21,6 @@ jobs: PHP_VERSION: ${{ matrix.php }} steps: - uses: actions/checkout@v2 - - - name: Install composer - run: composer install --prefer-dist --no-progress --no-suggest - name: Validate composer.json and composer.lock run: composer validate @@ -33,6 +30,7 @@ jobs: uses: actions/cache@v2 with: path: vendor + php-version: '5.6' key: ${{ matrix.os }}-php-${{ hashFiles('**/composer.lock') }} restore-keys: | ${{ matrix.os }}-php- From 122d3e9f0537fa345eb967da2bef6866485de741 Mon Sep 17 00:00:00 2001 From: Barbara-Pitt <76412907+Barbara-Pitt@users.noreply.github.com> Date: Sun, 27 Dec 2020 03:49:45 -0600 Subject: [PATCH 11/16] Update php.yml --- .github/workflows/php.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 079d1d6a..3c583c93 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -20,23 +20,11 @@ jobs: env: PHP_VERSION: ${{ matrix.php }} steps: - - uses: actions/checkout@v2 - name: Validate composer.json and composer.lock run: composer validate - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@v2 - with: - path: vendor - php-version: '5.6' - key: ${{ matrix.os }}-php-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ matrix.os }}-php- - - name: Install dependencies - if: steps.composer-cache.outputs.cache-hit != 'true' run: composer install --prefer-dist --no-progress --no-suggest # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" From a302727d9ef612fa905fe1810114897200aa6ac2 Mon Sep 17 00:00:00 2001 From: Barbara Pitt Date: Sun, 27 Dec 2020 03:57:23 -0600 Subject: [PATCH 12/16] undoing github actions --- .github/workflows/php.yml | 37 ------------------------------------- composer.json | 6 ------ 2 files changed, 43 deletions(-) delete mode 100644 .github/workflows/php.yml diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml deleted file mode 100644 index 2cab0aa0..00000000 --- a/.github/workflows/php.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: PHP Composer - -on: - push: - branches: [ config ] - pull_request: - branches: [ config ] - -jobs: - build: - - runs-on: ubuntu-16.04 - - steps: - - uses: actions/checkout@v2 - - - name: Validate composer.json and composer.lock - run: composer validate - - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@v2 - with: - path: vendor - key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-php- - - - name: Install dependencies - if: steps.composer-cache.outputs.cache-hit != 'true' - run: composer install --prefer-dist --no-progress --no-suggest - - # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" - # Docs: https://getcomposer.org/doc/articles/scripts.md - - - name: Run test suite - run: composer run-script test diff --git a/composer.json b/composer.json index fce5e9a7..6d93a6ef 100644 --- a/composer.json +++ b/composer.json @@ -1,11 +1,5 @@ { - "name": "leftypol/leftypol", - "description": "An imageboard based on lainchans", "require": { - "php": "5.6.40", "phpunit/phpunit": "^5" - }, - "scripts":{ - "test": "vendor/bin/phpunit tests" } } From 44f762458ce424d986646791d2a655565285af60 Mon Sep 17 00:00:00 2001 From: Barbara Pitt Date: Sun, 27 Dec 2020 03:59:16 -0600 Subject: [PATCH 13/16] undoing github actions --- composer.lock | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index bd19e4c1..7703065d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "18e1c1169d7719a196dbf162a8d01fb6", + "content-hash": "f6415b642f3e5a639d8206e318a777b3", "packages": [ { "name": "doctrine/instantiator", @@ -1550,9 +1550,7 @@ "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, - "platform": { - "php": "5.6.40" - }, + "platform": [], "platform-dev": [], "plugin-api-version": "2.0.0" } From 46a9a245bc20653bd3af32262dfbedfd2e5eef85 Mon Sep 17 00:00:00 2001 From: Barbara Pitt Date: Sun, 27 Dec 2020 16:59:07 -0600 Subject: [PATCH 14/16] fixing spoiler --- inc/instance-config.php | 1 + 1 file changed, 1 insertion(+) diff --git a/inc/instance-config.php b/inc/instance-config.php index da59ca2e..409bd0fc 100644 --- a/inc/instance-config.php +++ b/inc/instance-config.php @@ -139,6 +139,7 @@ $config['stylesheets']['Dark'] = 'dark.css'; $config['stylesheets']['Dark Red'] = 'dark_red.css'; $config['always_noko'] = true; $config['spoiler_images'] = true; +$config['spoiler_image'] = 'static/spoiler.png'; //more themes (issue#26) $config['stylesheets']['Burichan'] = 'burichan.css'; From 464bbd6ac3350f929462c2aaec7d82e06911f455 Mon Sep 17 00:00:00 2001 From: Barbara Pitt Date: Sun, 27 Dec 2020 17:01:37 -0600 Subject: [PATCH 15/16] fixing 'image deleted' --- inc/instance-config.php | 1 + 1 file changed, 1 insertion(+) diff --git a/inc/instance-config.php b/inc/instance-config.php index 409bd0fc..865c30ec 100644 --- a/inc/instance-config.php +++ b/inc/instance-config.php @@ -140,6 +140,7 @@ $config['stylesheets']['Dark Red'] = 'dark_red.css'; $config['always_noko'] = true; $config['spoiler_images'] = true; $config['spoiler_image'] = 'static/spoiler.png'; +$config['image_deleted'] = 'static/deleted.png'; //more themes (issue#26) $config['stylesheets']['Burichan'] = 'burichan.css'; From 8c1c680ea07aaf42b9987898d252e33243e77894 Mon Sep 17 00:00:00 2001 From: Barbara Pitt Date: Sun, 27 Dec 2020 17:15:12 -0600 Subject: [PATCH 16/16] adding docker items --- Dockerfile | 22 ++++++++++++++++++++++ docker-compose.yml | 45 +++++++++++++++++++++++++++++++++++++++++++++ site.conf | 16 ++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 site.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..c568280f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM php:5.6-fpm +RUN docker-php-ext-install pdo pdo_mysql +RUN apt-get update -y && apt-get install -y libpng-dev libjpeg-dev +RUN docker-php-ext-install mbstring +RUN apt-get update -y && apt-get install -y libmcrypt-dev +RUN docker-php-ext-install -j$(nproc) mcrypt +RUN docker-php-ext-install iconv +RUN apt-get update -y && apt-get install -y imagemagick +RUN apt-get update -y && apt-get install -y graphicsmagick +RUN apt-get update -y && apt-get install -y gifsicle +RUN docker-php-ext-configure gd \ + --with-png-dir=/usr \ + --with-jpeg-dir=/usr +RUN docker-php-ext-install gd +RUN apt-get update -y \ + && apt-get install -y libmemcached11 libmemcachedutil2 build-essential libmemcached-dev libz-dev \ + && pecl install memcached-2.2.0 \ + && echo extension=memcached.so >> /usr/local/etc/php/conf.d/memcached.ini \ + && apt-get remove -y build-essential libmemcached-dev libz-dev \ + && apt-get autoremove -y \ + && apt-get clean \ + && rm -rf /tmp/pear \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..3d61f915 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,45 @@ +services: + #nginx webserver + php 5.6 + web: + image: nginx:1.19.6-alpine + ports: + - "8080:80" + depends_on: + - db + volumes: + - ./:/code + - ./site.conf:/etc/nginx/conf.d/default.conf + networks: + leftchan_net: + ipv4_address: 172.20.0.3 + links: + - php + php: + build: . + volumes: + - ./:/code + networks: + leftchan_net: + ipv4_address: 172.20.0.4 + #MySQL Service + db: + image: mysql:5.6.50 + container_name: db + restart: unless-stopped + tty: true + ports: + - "3306:3306" + environment: + MYSQL_DATABASE: lainchan + MYSQL_ROOT_PASSWORD: M9q5lO0RxJVh + networks: + leftchan_net: + ipv4_address: 172.20.0.2 + +#Docker Networks +networks: + leftchan_net: + ipam: + driver: default + config: + - subnet: 172.20.0.0/16 \ No newline at end of file diff --git a/site.conf b/site.conf new file mode 100644 index 00000000..80bc50fb --- /dev/null +++ b/site.conf @@ -0,0 +1,16 @@ +server { + index index.php index.html; + error_log /var/log/nginx/error.log; + access_log /var/log/nginx/access.log; + root /code; + + location ~ \.php$ { + try_files $uri =404; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass php:9000; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; + } +} \ No newline at end of file