From: Jérémy Benoist Date: Mon, 24 Jun 2019 08:18:07 +0000 (+0200) Subject: Merge pull request #4027 from wallabag/dependabot/composer/mnapoli/piwik-twig-extensi... X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=689b5fdf80de8d43bbcaa850ac5e46b6c73ac393;hp=c546548ec333be76924c679d41eb03755c7d3bc2;p=github%2Fwallabag%2Fwallabag.git Merge pull request #4027 from wallabag/dependabot/composer/mnapoli/piwik-twig-extension-2.0.1 Bump mnapoli/piwik-twig-extension from 1.0.0 to 2.0.1 --- diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 920f1905..d5599206 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,11 +1,41 @@ # How to contribute +## Test it locally + +### Using Docker + +- Clone the repository +- Ensure your Docker daemon is running +- Launch `docker-compose up` + +You'll then have: +- a web server (nginx) +- a PHP daemon (using FPM) +- a Redis database (to handle imports) +- a SQLite database to store articles + +You can now access your wallabag instance using that url: `http://127.0.0.1:8000` + +If you want to test using an other database than SQLite, uncomment the `postgres` or `mariadb` code from the `docker-compose.yml` file at the root of the repo. Also uncomment related line in the `php` section so the database will be linked to your PHP instance. + +### Using your own PHP server + +- Ensure you are running PHP > 7.1. +- Clone the repository +- Launch `composer install` +- If you got some errors, fix them (they might be related to some missing PHP extension from your machine) +- Then `php bin/console wallabag:install` +- If you got some errors, fix them (they might be related to some missing PHP extension from your machine) +- Run `php bin/console server:run` + +You can now access your wallabag instance using that url: `http://127.0.0.1:8000` + ## You found a bug Please [open a new issue](https://github.com/wallabag/wallabag/issues/new). To fix the bug quickly, we need some infos: please answer to the questions in the issue form. -If you have the skills, look for errors into php, server and application (see `var/logs`) logs. +If you have the skills, look for errors into PHP, server and application logs (see `var/logs`). Note : If you have large portions of text, use [Github's Gist service](https://gist.github.com/) or other pastebin-like. diff --git a/app/DoctrineMigrations/Version20190619093534.php b/app/DoctrineMigrations/Version20190619093534.php new file mode 100644 index 00000000..e9744f1b --- /dev/null +++ b/app/DoctrineMigrations/Version20190619093534.php @@ -0,0 +1,65 @@ +skipIf('sqlite' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'sqlite\'.'); + + $this->addSql('UPDATE ' . $this->getTable('entry', true) . ' SET reading_time = 0 WHERE reading_time IS NULL;'); + + $this->addSql('DROP INDEX hashed_given_url_user_id'); + $this->addSql('DROP INDEX IDX_entry_uid'); + $this->addSql('DROP INDEX IDX_F4D18282A76ED395'); + $this->addSql('DROP INDEX IDX_entry_created_at'); + $this->addSql('DROP INDEX IDX_entry_starred'); + $this->addSql('DROP INDEX IDX_entry_archived'); + $this->addSql('DROP INDEX hashed_url_user_id'); + $this->addSql('CREATE TEMPORARY TABLE __temp__' . $this->getTable('entry', true) . ' AS SELECT id, user_id, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, uid, http_status, published_at, published_by, headers, starred_at, origin_url, archived_at, hashed_url, given_url, hashed_given_url FROM ' . $this->getTable('entry', true) . ''); + $this->addSql('DROP TABLE ' . $this->getTable('entry', true) . ''); + $this->addSql('CREATE TABLE ' . $this->getTable('entry', true) . ' (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, user_id INTEGER DEFAULT NULL, title CLOB DEFAULT NULL COLLATE BINARY, url CLOB DEFAULT NULL COLLATE BINARY, is_archived BOOLEAN NOT NULL, is_starred BOOLEAN NOT NULL, content CLOB DEFAULT NULL COLLATE BINARY, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype CLOB DEFAULT NULL COLLATE BINARY, language CLOB DEFAULT NULL COLLATE BINARY, domain_name CLOB DEFAULT NULL COLLATE BINARY, preview_picture CLOB DEFAULT NULL COLLATE BINARY, uid VARCHAR(23) DEFAULT NULL COLLATE BINARY, http_status VARCHAR(3) DEFAULT NULL COLLATE BINARY, published_at DATETIME DEFAULT NULL, starred_at DATETIME DEFAULT NULL, origin_url CLOB DEFAULT NULL COLLATE BINARY, archived_at DATETIME DEFAULT NULL, given_url CLOB DEFAULT NULL COLLATE BINARY, reading_time INTEGER NOT NULL, published_by CLOB DEFAULT NULL --(DC2Type:array) + , headers CLOB DEFAULT NULL --(DC2Type:array) + , hashed_url VARCHAR(40) DEFAULT NULL, hashed_given_url VARCHAR(40) DEFAULT NULL, CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE)'); + $this->addSql('INSERT INTO ' . $this->getTable('entry', true) . ' (id, user_id, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, uid, http_status, published_at, published_by, headers, starred_at, origin_url, archived_at, hashed_url, given_url, hashed_given_url) SELECT id, user_id, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, uid, http_status, published_at, published_by, headers, starred_at, origin_url, archived_at, hashed_url, given_url, hashed_given_url FROM __temp__' . $this->getTable('entry', true) . ''); + $this->addSql('DROP TABLE __temp__' . $this->getTable('entry', true) . ''); + $this->addSql('CREATE INDEX hashed_given_url_user_id ON ' . $this->getTable('entry', true) . ' (user_id, hashed_given_url)'); + $this->addSql('CREATE INDEX IDX_F4D18282A76ED395 ON ' . $this->getTable('entry', true) . ' (user_id)'); + $this->addSql('CREATE INDEX hashed_url_user_id ON ' . $this->getTable('entry', true) . ' (user_id, hashed_url)'); + $this->addSql('CREATE INDEX created_at ON ' . $this->getTable('entry', true) . ' (created_at)'); + $this->addSql('CREATE INDEX uid ON ' . $this->getTable('entry', true) . ' (uid)'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->skipIf('sqlite' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'sqlite\'.'); + + $this->addSql('DROP INDEX IDX_F4D18282A76ED395'); + $this->addSql('DROP INDEX created_at'); + $this->addSql('DROP INDEX uid'); + $this->addSql('DROP INDEX hashed_url_user_id'); + $this->addSql('DROP INDEX hashed_given_url_user_id'); + $this->addSql('CREATE TEMPORARY TABLE __temp__' . $this->getTable('entry', true) . ' AS SELECT id, user_id, uid, title, url, hashed_url, origin_url, given_url, hashed_given_url, is_archived, archived_at, is_starred, content, created_at, updated_at, published_at, published_by, starred_at, mimetype, language, reading_time, domain_name, preview_picture, http_status, headers FROM "' . $this->getTable('entry', true) . '"'); + $this->addSql('DROP TABLE "' . $this->getTable('entry', true) . '"'); + $this->addSql('CREATE TABLE "' . $this->getTable('entry', true) . '" (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, user_id INTEGER DEFAULT NULL, uid VARCHAR(23) DEFAULT NULL, title CLOB DEFAULT NULL, url CLOB DEFAULT NULL, origin_url CLOB DEFAULT NULL, given_url CLOB DEFAULT NULL, is_archived BOOLEAN NOT NULL, archived_at DATETIME DEFAULT NULL, is_starred BOOLEAN NOT NULL, content CLOB DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, published_at DATETIME DEFAULT NULL, starred_at DATETIME DEFAULT NULL, mimetype CLOB DEFAULT NULL, language CLOB DEFAULT NULL, domain_name CLOB DEFAULT NULL, preview_picture CLOB DEFAULT NULL, http_status VARCHAR(3) DEFAULT NULL, hashed_url CLOB DEFAULT NULL COLLATE BINARY, hashed_given_url CLOB DEFAULT NULL COLLATE BINARY, published_by CLOB DEFAULT NULL COLLATE BINARY, reading_time INTEGER DEFAULT NULL, headers CLOB DEFAULT NULL COLLATE BINARY)'); + $this->addSql('INSERT INTO "' . $this->getTable('entry', true) . '" (id, user_id, uid, title, url, hashed_url, origin_url, given_url, hashed_given_url, is_archived, archived_at, is_starred, content, created_at, updated_at, published_at, published_by, starred_at, mimetype, language, reading_time, domain_name, preview_picture, http_status, headers) SELECT id, user_id, uid, title, url, hashed_url, origin_url, given_url, hashed_given_url, is_archived, archived_at, is_starred, content, created_at, updated_at, published_at, published_by, starred_at, mimetype, language, reading_time, domain_name, preview_picture, http_status, headers FROM __temp__' . $this->getTable('entry', true) . ''); + $this->addSql('DROP TABLE __temp__' . $this->getTable('entry', true) . ''); + $this->addSql('CREATE INDEX IDX_F4D18282A76ED395 ON "' . $this->getTable('entry', true) . '" (user_id)'); + $this->addSql('CREATE INDEX hashed_url_user_id ON "' . $this->getTable('entry', true) . '" (user_id, hashed_url)'); + $this->addSql('CREATE INDEX hashed_given_url_user_id ON "' . $this->getTable('entry', true) . '" (user_id, hashed_given_url)'); + $this->addSql('CREATE INDEX IDX_entry_starred ON "' . $this->getTable('entry', true) . '" (is_starred)'); + $this->addSql('CREATE INDEX IDX_entry_archived ON "' . $this->getTable('entry', true) . '" (is_archived)'); + $this->addSql('CREATE INDEX IDX_entry_uid ON "' . $this->getTable('entry', true) . '" (uid)'); + $this->addSql('CREATE INDEX IDX_entry_created_at ON "' . $this->getTable('entry', true) . '" (created_at)'); + } +} diff --git a/docker-compose.yml b/docker-compose.yml index 3c28f2f1..0f8f0970 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,9 @@ version: '2' services: nginx: - image: nginx + image: nginx:alpine ports: - - "8080:80" + - "8000:80" volumes: - ./docker/nginx/nginx.conf:/nginx.conf - ./docker/logs/nginx:/var/log/nginx @@ -32,8 +32,8 @@ services: # - ./docker/postgres/env # - ./docker/mariadb/env - #postgres: - # image: postgres:9 + # postgres: + # image: postgres:11-alpine # ports: # - "5432:5432" # volumes: @@ -41,7 +41,7 @@ services: # env_file: # - ./docker/postgres/env - #mariadb: + # mariadb: # image: mariadb:10 # ports: # - "3306:3306" @@ -50,12 +50,12 @@ services: # env_file: # - ./docker/mariadb/env - rabbitmq: - image: rabbitmq:3-management - ports: - - "15672:15672" + # rabbitmq: + # image: rabbitmq:3-management-alpine + # ports: + # - "15672:15672" redis: - image: redis + image: redis:4-alpine ports: - "6379:6379" diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile index b632cb8a..d9b2e5cc 100644 --- a/docker/php/Dockerfile +++ b/docker/php/Dockerfile @@ -4,10 +4,25 @@ FROM php:7.2-fpm ARG timezone='Europe/Paris' RUN apt-get update && apt-get install -y \ - libmcrypt-dev libicu-dev libpq-dev libxml2-dev libpng-dev libjpeg-dev \ - && /usr/local/bin/docker-php-ext-configure gd --with-jpeg-dir=/usr/include \ - && docker-php-ext-install \ - iconv mbstring intl pdo pdo_mysql pdo_pgsql gd + libmcrypt-dev \ + libicu-dev \ + libpq-dev \ + libxml2-dev \ + libpng-dev \ + libjpeg-dev \ + libsqlite3-dev \ + imagemagick \ + libmagickwand-dev +RUN docker-php-ext-install \ + iconv \ + mbstring \ + intl \ + pdo \ + pdo_mysql \ + pdo_pgsql \ + pdo_sqlite + +RUN printf "\n" | pecl install imagick && docker-php-ext-enable imagick RUN echo "date.timezone="$timezone > /usr/local/etc/php/conf.d/date_timezone.ini