From 297628dffa58fcd77a591935de2fe3042a2db1a4 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 e4f0b54cd5d89471c77cbe5f07d8da98c3bab70c 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 dcbd20ab3d481a509fecec4d29a59f96ae216532 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 8b70517f3db4784230b654cf7868cf6e61dffa30 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 ae0bd09d0e7261e83e4ef93728effad86bb4f11f 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 dff2aaa9d0d0e2d8429fae261eff5318a6d80329 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 0b02ca44243b4fc1977316f1c82da8d4c9db3242 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 5fe6ddacb39bdb3b84b78512d53e7d906536e0f2 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 ea4adff8c939a9d926b69b6a7cd423e188ff62c5 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 7e4da93330006ee0f3feb221d0eb19945f36e658 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 d54be24b372bf8c273b785acffb6357ad906ca25 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 6425580b00b13c368693f73a48428fe6918d1528 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 f86b715df6afe10d4692e383a5414074436b24fb 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 9791aa8113c718bf06c38d2b31cbde719c500b96 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 b1996628acd983903e1b58018487764c19793660 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 bb07d336112f571132a0fe48d798e5380b55f3f2 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