From: Jérémy Benoist Date: Sat, 25 Nov 2017 11:29:53 +0000 (+0100) Subject: Merge pull request #3419 from NatJNP/patch1 X-Git-Tag: 2.3.0~13 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=773ac5b0f7a56ff2527601498b0822d6ef8bfa40;hp=2020b4456c15d61ced822dafbe298a90b4d9f8ce;p=github%2Fwallabag%2Fwallabag.git Merge pull request #3419 from NatJNP/patch1 Add Thai language --- diff --git a/.travis.yml b/.travis.yml index 6b279ed6..c6c03dc3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -70,11 +70,9 @@ before_install: script: - travis_wait bash composer install -o --no-interaction --no-progress --prefer-dist - - ant prepare-$DB - - - echo "travis_fold:start:migrations" - - php bin/console doctrine:migrations:migrate --no-interaction --env=test - - echo "travis_fold:end:migrations" + - echo "travis_fold:start:prepare" + - make prepare DB=$DB + - echo "travis_fold:end:prepare" - echo "travis_fold:start:fixtures" - php bin/console doctrine:fixtures:load --no-interaction --env=test diff --git a/Makefile b/Makefile index ffbe102a..0686454f 100755 --- a/Makefile +++ b/Makefile @@ -1,15 +1,13 @@ TMP_FOLDER=/tmp RELEASE_FOLDER=wllbg-release -ifndef ENV - ENV=prod -endif +ENV ?= prod help: ## Display this help menu @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' clean: ## Clear the application cache - @rm -rf var/cache/* + rm -rf var/cache/* install: ## Install wallabag with the latest version @sh scripts/install.sh $(ENV) @@ -26,8 +24,19 @@ run: ## Run the wallabag built-in server build: ## Run webpack @npm run build:$(ENV) -test: ## Launch wallabag testsuite - @ant prepare && bin/simple-phpunit -v +prepare: clean ## Prepare database for testsuite +ifdef DB + cp app/config/tests/parameters_test.$(DB).yml app/config/parameters_test.yml +endif + -php bin/console doctrine:database:drop --force --env=test + php bin/console doctrine:database:create --env=test + php bin/console doctrine:migrations:migrate --no-interaction --env=test + +fixtures: ## Load fixtures into database + php bin/console doctrine:fixtures:load --no-interaction --env=test + +test: prepare fixtures ## Launch wallabag testsuite + bin/simple-phpunit -v release: ## Create a package. Need a VERSION parameter (eg: `make release VERSION=master`). ifndef VERSION @@ -35,11 +44,9 @@ ifndef VERSION endif @sh scripts/release.sh $(VERSION) $(TMP_FOLDER) $(RELEASE_FOLDER) $(ENV) -travis: ## Make some stuff for Travis-CI - deploy: ## Deploy wallabag @bundle exec cap staging deploy -.PHONY: help clean install update build test release travis deploy run dev +.PHONY: help clean prepare install fixtures update build test release deploy run dev .DEFAULT_GOAL := install diff --git a/app/DoctrineMigrations/Version20160401000000.php b/app/DoctrineMigrations/Version20160401000000.php new file mode 100644 index 00000000..a8603abf --- /dev/null +++ b/app/DoctrineMigrations/Version20160401000000.php @@ -0,0 +1,191 @@ +version->getConfiguration()->getNumberOfExecutedMigrations() > 0) { + $this->version->markMigrated(); + $this->skipIf(true, 'Database already initialized'); + } + + switch ($this->connection->getDatabasePlatform()->getName()) { + case 'sqlite': + $sql = <<<'SQL' +CREATE TABLE wallabag_craue_config_setting (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, PRIMARY KEY(name)); +CREATE UNIQUE INDEX UNIQ_5D9649505E237E06 ON wallabag_craue_config_setting (name); +CREATE TABLE "wallabag_tagging_rule" (id INTEGER NOT NULL, config_id INTEGER DEFAULT NULL, rule VARCHAR(255) NOT NULL, tags CLOB NOT NULL, PRIMARY KEY(id), CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES "wallabag_config" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); +CREATE INDEX IDX_2D9B3C5424DB0683 ON "wallabag_tagging_rule" (config_id); +CREATE TABLE "wallabag_tag" (id INTEGER NOT NULL, label CLOB NOT NULL, slug VARCHAR(128) NOT NULL, PRIMARY KEY(id)); +CREATE UNIQUE INDEX UNIQ_4CA58A8C989D9B62 ON "wallabag_tag" (slug); +CREATE TABLE "wallabag_entry" (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, title CLOB DEFAULT NULL, url CLOB DEFAULT NULL, is_archived BOOLEAN NOT NULL, is_starred BOOLEAN NOT NULL, content CLOB DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype CLOB DEFAULT NULL, language CLOB DEFAULT NULL, reading_time INTEGER DEFAULT NULL, domain_name CLOB DEFAULT NULL, preview_picture CLOB DEFAULT NULL, is_public BOOLEAN DEFAULT '0', PRIMARY KEY(id), CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); +CREATE INDEX IDX_F4D18282A76ED395 ON "wallabag_entry" (user_id); +CREATE TABLE wallabag_entry_tag (entry_id INTEGER NOT NULL, tag_id INTEGER NOT NULL, PRIMARY KEY(entry_id, tag_id), CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES "wallabag_tag" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); +CREATE INDEX IDX_C9F0DD7CBA364942 ON wallabag_entry_tag (entry_id); +CREATE INDEX IDX_C9F0DD7CBAD26311 ON wallabag_entry_tag (tag_id); +CREATE TABLE "wallabag_config" (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, theme VARCHAR(255) NOT NULL, items_per_page INTEGER NOT NULL, language VARCHAR(255) NOT NULL, rss_token VARCHAR(255) DEFAULT NULL, rss_limit INTEGER DEFAULT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); +CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON "wallabag_config" (user_id); +CREATE TABLE wallabag_oauth2_refresh_tokens (id INTEGER NOT NULL, client_id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INTEGER DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_20C9FB2419EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); +CREATE UNIQUE INDEX UNIQ_20C9FB245F37A13B ON wallabag_oauth2_refresh_tokens (token); +CREATE INDEX IDX_20C9FB2419EB6921 ON wallabag_oauth2_refresh_tokens (client_id); +CREATE INDEX IDX_20C9FB24A76ED395 ON wallabag_oauth2_refresh_tokens (user_id); +CREATE TABLE wallabag_oauth2_access_tokens (id INTEGER NOT NULL, client_id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INTEGER DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_368A420919EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); +CREATE UNIQUE INDEX UNIQ_368A42095F37A13B ON wallabag_oauth2_access_tokens (token); +CREATE INDEX IDX_368A420919EB6921 ON wallabag_oauth2_access_tokens (client_id); +CREATE INDEX IDX_368A4209A76ED395 ON wallabag_oauth2_access_tokens (user_id); +CREATE TABLE wallabag_oauth2_auth_codes (id INTEGER NOT NULL, client_id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, token VARCHAR(255) NOT NULL, redirect_uri CLOB NOT NULL, expires_at INTEGER DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); +CREATE UNIQUE INDEX UNIQ_EE52E3FA5F37A13B ON wallabag_oauth2_auth_codes (token); +CREATE INDEX IDX_EE52E3FA19EB6921 ON wallabag_oauth2_auth_codes (client_id); +CREATE INDEX IDX_EE52E3FAA76ED395 ON wallabag_oauth2_auth_codes (user_id); +CREATE TABLE wallabag_oauth2_clients (id INTEGER NOT NULL, random_id VARCHAR(255) NOT NULL, redirect_uris CLOB NOT NULL, secret VARCHAR(255) NOT NULL, allowed_grant_types CLOB NOT NULL, PRIMARY KEY(id)); +CREATE TABLE "wallabag_user" (id INTEGER NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled BOOLEAN NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, locked BOOLEAN NOT NULL, expired BOOLEAN NOT NULL, expires_at DATETIME DEFAULT NULL, confirmation_token VARCHAR(255) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles CLOB NOT NULL, credentials_expired BOOLEAN NOT NULL, credentials_expire_at DATETIME DEFAULT NULL, name CLOB DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INTEGER DEFAULT NULL, twoFactorAuthentication BOOLEAN NOT NULL, trusted CLOB DEFAULT NULL, PRIMARY KEY(id)); +CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON "wallabag_user" (username_canonical); +CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON "wallabag_user" (email_canonical); +CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON "wallabag_user" (confirmation_token); +CREATE TABLE wallabag_annotation (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, entry_id INTEGER DEFAULT NULL, text CLOB NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, quote VARCHAR(255) NOT NULL, ranges CLOB NOT NULL, PRIMARY KEY(id), CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); +CREATE INDEX IDX_A7AED006A76ED395 ON wallabag_annotation (user_id); +CREATE INDEX IDX_A7AED006BA364942 ON wallabag_annotation (entry_id); +SQL + ; + + foreach (explode("\n", $sql) as $query) { + $this->addSql($query); + } + + break; + case 'mysql': + $sql = <<<'SQL' +CREATE TABLE wallabag_craue_config_setting (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_5D9649505E237E06 (name), PRIMARY KEY(name)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; +CREATE TABLE `wallabag_entry` (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, title LONGTEXT DEFAULT NULL, url LONGTEXT DEFAULT NULL, is_archived TINYINT(1) NOT NULL, is_starred TINYINT(1) NOT NULL, content LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype LONGTEXT DEFAULT NULL, language LONGTEXT DEFAULT NULL, reading_time INT DEFAULT NULL, domain_name LONGTEXT DEFAULT NULL, preview_picture LONGTEXT DEFAULT NULL, is_public TINYINT(1) DEFAULT '0', INDEX IDX_F4D18282A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; +CREATE TABLE wallabag_entry_tag (entry_id INT NOT NULL, tag_id INT NOT NULL, INDEX IDX_C9F0DD7CBA364942 (entry_id), INDEX IDX_C9F0DD7CBAD26311 (tag_id), PRIMARY KEY(entry_id, tag_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; +CREATE TABLE `wallabag_config` (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, theme VARCHAR(255) NOT NULL, items_per_page INT NOT NULL, language VARCHAR(255) NOT NULL, rss_token VARCHAR(255) DEFAULT NULL, rss_limit INT DEFAULT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, UNIQUE INDEX UNIQ_87E64C53A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; +CREATE TABLE `wallabag_tagging_rule` (id INT AUTO_INCREMENT NOT NULL, config_id INT DEFAULT NULL, rule VARCHAR(255) NOT NULL, tags LONGTEXT NOT NULL COMMENT '(DC2Type:simple_array)', INDEX IDX_2D9B3C5424DB0683 (config_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; +CREATE TABLE `wallabag_tag` (id INT AUTO_INCREMENT NOT NULL, `label` LONGTEXT NOT NULL, slug VARCHAR(128) NOT NULL, UNIQUE INDEX UNIQ_4CA58A8C989D9B62 (slug), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; +CREATE TABLE wallabag_oauth2_clients (id INT AUTO_INCREMENT NOT NULL, random_id VARCHAR(255) NOT NULL, redirect_uris LONGTEXT NOT NULL COMMENT '(DC2Type:array)', secret VARCHAR(255) NOT NULL, allowed_grant_types LONGTEXT NOT NULL COMMENT '(DC2Type:array)', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; +CREATE TABLE wallabag_oauth2_access_tokens (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_368A42095F37A13B (token), INDEX IDX_368A420919EB6921 (client_id), INDEX IDX_368A4209A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; +CREATE TABLE wallabag_oauth2_refresh_tokens (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_20C9FB245F37A13B (token), INDEX IDX_20C9FB2419EB6921 (client_id), INDEX IDX_20C9FB24A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; +CREATE TABLE wallabag_oauth2_auth_codes (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, redirect_uri LONGTEXT NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_EE52E3FA5F37A13B (token), INDEX IDX_EE52E3FA19EB6921 (client_id), INDEX IDX_EE52E3FAA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; +CREATE TABLE `wallabag_user` (id INT AUTO_INCREMENT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled TINYINT(1) NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, locked TINYINT(1) NOT NULL, expired TINYINT(1) NOT NULL, expires_at DATETIME DEFAULT NULL, confirmation_token VARCHAR(255) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles LONGTEXT NOT NULL COMMENT '(DC2Type:array)', credentials_expired TINYINT(1) NOT NULL, credentials_expire_at DATETIME DEFAULT NULL, name LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INT DEFAULT NULL, twoFactorAuthentication TINYINT(1) NOT NULL, trusted LONGTEXT DEFAULT NULL COMMENT '(DC2Type:json_array)', UNIQUE INDEX UNIQ_1D63E7E592FC23A8 (username_canonical), UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF (email_canonical), UNIQUE INDEX UNIQ_1D63E7E5C05FB297 (confirmation_token), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; +CREATE TABLE wallabag_annotation (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, entry_id INT DEFAULT NULL, text LONGTEXT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, quote VARCHAR(255) NOT NULL, ranges LONGTEXT NOT NULL COMMENT '(DC2Type:array)', INDEX IDX_A7AED006A76ED395 (user_id), INDEX IDX_A7AED006BA364942 (entry_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; +ALTER TABLE `wallabag_entry` ADD CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id); +ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES `wallabag_entry` (id); +ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES `wallabag_tag` (id); +ALTER TABLE `wallabag_config` ADD CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id); +ALTER TABLE `wallabag_tagging_rule` ADD CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES `wallabag_config` (id); +ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A420919EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id); +ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id); +ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB2419EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id); +ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id); +ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id); +ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id); +ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id); +ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES `wallabag_entry` (id); +SQL + ; + foreach (explode("\n", $sql) as $query) { + $this->addSql($query); + } + break; + case 'postgresql': + $sql = <<<'SQL' +CREATE TABLE wallabag_craue_config_setting (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, PRIMARY KEY(name)); +CREATE UNIQUE INDEX UNIQ_5D9649505E237E06 ON wallabag_craue_config_setting (name); +CREATE TABLE "wallabag_entry" (id INT NOT NULL, user_id INT DEFAULT NULL, title TEXT DEFAULT NULL, url TEXT DEFAULT NULL, is_archived BOOLEAN NOT NULL, is_starred BOOLEAN NOT NULL, content TEXT DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, mimetype TEXT DEFAULT NULL, language TEXT DEFAULT NULL, reading_time INT DEFAULT NULL, domain_name TEXT DEFAULT NULL, preview_picture TEXT DEFAULT NULL, is_public BOOLEAN DEFAULT 'false', PRIMARY KEY(id)); +CREATE INDEX IDX_F4D18282A76ED395 ON "wallabag_entry" (user_id); +CREATE TABLE wallabag_entry_tag (entry_id INT NOT NULL, tag_id INT NOT NULL, PRIMARY KEY(entry_id, tag_id)); +CREATE INDEX IDX_C9F0DD7CBA364942 ON wallabag_entry_tag (entry_id); +CREATE INDEX IDX_C9F0DD7CBAD26311 ON wallabag_entry_tag (tag_id); +CREATE TABLE "wallabag_config" (id INT NOT NULL, user_id INT DEFAULT NULL, theme VARCHAR(255) NOT NULL, items_per_page INT NOT NULL, language VARCHAR(255) NOT NULL, rss_token VARCHAR(255) DEFAULT NULL, rss_limit INT DEFAULT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, PRIMARY KEY(id)); +CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON "wallabag_config" (user_id); +CREATE TABLE "wallabag_tagging_rule" (id INT NOT NULL, config_id INT DEFAULT NULL, rule VARCHAR(255) NOT NULL, tags TEXT NOT NULL, PRIMARY KEY(id)); +CREATE INDEX IDX_2D9B3C5424DB0683 ON "wallabag_tagging_rule" (config_id); +COMMENT ON COLUMN "wallabag_tagging_rule".tags IS '(DC2Type:simple_array)'; +CREATE TABLE "wallabag_tag" (id INT NOT NULL, label TEXT NOT NULL, slug VARCHAR(128) NOT NULL, PRIMARY KEY(id)); +CREATE UNIQUE INDEX UNIQ_4CA58A8C989D9B62 ON "wallabag_tag" (slug); +CREATE TABLE wallabag_oauth2_clients (id INT NOT NULL, random_id VARCHAR(255) NOT NULL, redirect_uris TEXT NOT NULL, secret VARCHAR(255) NOT NULL, allowed_grant_types TEXT NOT NULL, PRIMARY KEY(id)); +COMMENT ON COLUMN wallabag_oauth2_clients.redirect_uris IS '(DC2Type:array)'; +COMMENT ON COLUMN wallabag_oauth2_clients.allowed_grant_types IS '(DC2Type:array)'; +CREATE TABLE wallabag_oauth2_access_tokens (id INT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)); +CREATE UNIQUE INDEX UNIQ_368A42095F37A13B ON wallabag_oauth2_access_tokens (token); +CREATE INDEX IDX_368A420919EB6921 ON wallabag_oauth2_access_tokens (client_id); +CREATE INDEX IDX_368A4209A76ED395 ON wallabag_oauth2_access_tokens (user_id); +CREATE TABLE wallabag_oauth2_refresh_tokens (id INT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)); +CREATE UNIQUE INDEX UNIQ_20C9FB245F37A13B ON wallabag_oauth2_refresh_tokens (token); +CREATE INDEX IDX_20C9FB2419EB6921 ON wallabag_oauth2_refresh_tokens (client_id); +CREATE INDEX IDX_20C9FB24A76ED395 ON wallabag_oauth2_refresh_tokens (user_id); +CREATE TABLE wallabag_oauth2_auth_codes (id INT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, redirect_uri TEXT NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)); +CREATE UNIQUE INDEX UNIQ_EE52E3FA5F37A13B ON wallabag_oauth2_auth_codes (token); +CREATE INDEX IDX_EE52E3FA19EB6921 ON wallabag_oauth2_auth_codes (client_id); +CREATE INDEX IDX_EE52E3FAA76ED395 ON wallabag_oauth2_auth_codes (user_id); +CREATE TABLE "wallabag_user" (id INT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled BOOLEAN NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, last_login TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, locked BOOLEAN NOT NULL, expired BOOLEAN NOT NULL, expires_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, confirmation_token VARCHAR(255) DEFAULT NULL, password_requested_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, roles TEXT NOT NULL, credentials_expired BOOLEAN NOT NULL, credentials_expire_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, name TEXT DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, authCode INT DEFAULT NULL, twoFactorAuthentication BOOLEAN NOT NULL, trusted TEXT DEFAULT NULL, PRIMARY KEY(id)); +CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON "wallabag_user" (username_canonical); +CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON "wallabag_user" (email_canonical); +CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON "wallabag_user" (confirmation_token); +COMMENT ON COLUMN "wallabag_user".roles IS '(DC2Type:array)'; +COMMENT ON COLUMN "wallabag_user".trusted IS '(DC2Type:json_array)'; +CREATE TABLE wallabag_annotation (id INT NOT NULL, user_id INT DEFAULT NULL, entry_id INT DEFAULT NULL, text TEXT NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, quote VARCHAR(255) NOT NULL, ranges TEXT NOT NULL, PRIMARY KEY(id)); +CREATE INDEX IDX_A7AED006A76ED395 ON wallabag_annotation (user_id); +CREATE INDEX IDX_A7AED006BA364942 ON wallabag_annotation (entry_id); +COMMENT ON COLUMN wallabag_annotation.ranges IS '(DC2Type:array)'; +CREATE SEQUENCE "entry_id_seq" INCREMENT BY 1 MINVALUE 1 START 1; +CREATE SEQUENCE "config_id_seq" INCREMENT BY 1 MINVALUE 1 START 1; +CREATE SEQUENCE "tagging_rule_id_seq" INCREMENT BY 1 MINVALUE 1 START 1; +CREATE SEQUENCE "tag_id_seq" INCREMENT BY 1 MINVALUE 1 START 1; +CREATE SEQUENCE oauth2_clients_id_seq INCREMENT BY 1 MINVALUE 1 START 1; +CREATE SEQUENCE oauth2_access_tokens_id_seq INCREMENT BY 1 MINVALUE 1 START 1; +CREATE SEQUENCE oauth2_refresh_tokens_id_seq INCREMENT BY 1 MINVALUE 1 START 1; +CREATE SEQUENCE oauth2_auth_codes_id_seq INCREMENT BY 1 MINVALUE 1 START 1; +CREATE SEQUENCE "user_id_seq" INCREMENT BY 1 MINVALUE 1 START 1; +CREATE SEQUENCE annotation_id_seq INCREMENT BY 1 MINVALUE 1 START 1; +ALTER TABLE "wallabag_entry" ADD CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; +ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; +ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES "wallabag_tag" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; +ALTER TABLE "wallabag_config" ADD CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; +ALTER TABLE "wallabag_tagging_rule" ADD CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES "wallabag_config" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; +ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A420919EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE; +ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; +ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB2419EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE; +ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; +ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE; +ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; +ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; +ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; +SQL + ; + foreach (explode("\n", $sql) as $query) { + $this->addSql($query); + } + break; + } + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $this->addSql('DROP TABLE wallabag_craue_config_setting'); + $this->addSql('DROP TABLE "wallabag_tagging_rule"'); + $this->addSql('DROP TABLE "wallabag_config"'); + $this->addSql('DROP TABLE "wallabag_entry"'); + $this->addSql('DROP TABLE wallabag_entry_tag'); + $this->addSql('DROP TABLE "wallabag_tag"'); + $this->addSql('DROP TABLE wallabag_oauth2_refresh_tokens'); + $this->addSql('DROP TABLE wallabag_oauth2_access_tokens'); + $this->addSql('DROP TABLE wallabag_oauth2_clients'); + $this->addSql('DROP TABLE wallabag_oauth2_auth_codes'); + $this->addSql('DROP TABLE "wallabag_user"'); + $this->addSql('DROP TABLE wallabag_annotation'); + } +} diff --git a/app/DoctrineMigrations/Version20160812120952.php b/app/DoctrineMigrations/Version20160812120952.php index 677f30c3..d28f3a71 100644 --- a/app/DoctrineMigrations/Version20160812120952.php +++ b/app/DoctrineMigrations/Version20160812120952.php @@ -30,7 +30,20 @@ class Version20160812120952 extends AbstractMigration implements ContainerAwareI $clientsTable = $schema->getTable($this->getTable('oauth2_clients')); $this->skipIf($clientsTable->hasColumn('name'), 'It seems that you already played this migration.'); - $clientsTable->addColumn('name', 'blob'); + if ('sqlite' === $this->connection->getDatabasePlatform()->getName()) { + // Can't use $clientsTable->addColumn('name', 'blob'); + // because of the error: + // SQLSTATE[HY000]: General error: 1 Cannot add a NOT NULL column with default value NULL + $databaseTablePrefix = $this->container->getParameter('database_table_prefix'); + $this->addSql('CREATE TEMPORARY TABLE __temp__' . $databaseTablePrefix . 'oauth2_clients AS SELECT id, random_id, redirect_uris, secret, allowed_grant_types FROM ' . $databaseTablePrefix . 'oauth2_clients'); + $this->addSql('DROP TABLE ' . $databaseTablePrefix . 'oauth2_clients'); + $this->addSql('CREATE TABLE ' . $databaseTablePrefix . 'oauth2_clients (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, random_id VARCHAR(255) NOT NULL COLLATE BINARY, secret VARCHAR(255) NOT NULL COLLATE BINARY, redirect_uris CLOB NOT NULL, allowed_grant_types CLOB NOT NULL, name CLOB NOT NULL, PRIMARY KEY(id), CONSTRAINT FK_635D765EA76ED395 FOREIGN KEY (user_id) REFERENCES "' . $databaseTablePrefix . 'user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE)'); + $this->addSql('INSERT INTO ' . $databaseTablePrefix . 'oauth2_clients (id, random_id, redirect_uris, secret, allowed_grant_types) SELECT id, random_id, redirect_uris, secret, allowed_grant_types FROM __temp__' . $databaseTablePrefix . 'oauth2_clients'); + $this->addSql('DROP TABLE __temp__' . $databaseTablePrefix . 'oauth2_clients'); + $this->addSql('CREATE INDEX IDX_635D765EA76ED395 ON ' . $databaseTablePrefix . 'oauth2_clients (user_id)'); + } else { + $clientsTable->addColumn('name', 'blob'); + } } /** @@ -39,7 +52,18 @@ class Version20160812120952 extends AbstractMigration implements ContainerAwareI public function down(Schema $schema) { $clientsTable = $schema->getTable($this->getTable('oauth2_clients')); - $clientsTable->dropColumn('name'); + + if ('sqlite' === $this->connection->getDatabasePlatform()->getName()) { + $databaseTablePrefix = $this->container->getParameter('database_table_prefix'); + $this->addSql('DROP INDEX IDX_635D765EA76ED395'); + $this->addSql('CREATE TEMPORARY TABLE __temp__' . $databaseTablePrefix . 'oauth2_clients AS SELECT id, random_id, redirect_uris, secret, allowed_grant_types FROM ' . $databaseTablePrefix . 'oauth2_clients'); + $this->addSql('DROP TABLE ' . $databaseTablePrefix . 'oauth2_clients'); + $this->addSql('CREATE TABLE ' . $databaseTablePrefix . 'oauth2_clients (id INTEGER NOT NULL, random_id VARCHAR(255) NOT NULL, secret VARCHAR(255) NOT NULL, redirect_uris CLOB NOT NULL COLLATE BINARY, allowed_grant_types CLOB NOT NULL COLLATE BINARY, PRIMARY KEY(id))'); + $this->addSql('INSERT INTO ' . $databaseTablePrefix . 'oauth2_clients (id, random_id, redirect_uris, secret, allowed_grant_types) SELECT id, random_id, redirect_uris, secret, allowed_grant_types FROM __temp__' . $databaseTablePrefix . 'oauth2_clients'); + $this->addSql('DROP TABLE __temp__' . $databaseTablePrefix . 'oauth2_clients'); + } else { + $clientsTable->dropColumn('name'); + } } private function getTable($tableName) diff --git a/app/DoctrineMigrations/Version20170824113337.php b/app/DoctrineMigrations/Version20170824113337.php index 7393d683..e54a9bcf 100644 --- a/app/DoctrineMigrations/Version20170824113337.php +++ b/app/DoctrineMigrations/Version20170824113337.php @@ -41,7 +41,12 @@ class Version20170824113337 extends AbstractMigration implements ContainerAwareI $entryTable = $schema->getTable($this->getTable('entry')); $this->skipIf(!$entryTable->hasColumn('starred_at'), 'Unable to add starred_at colum'); - $this->connection->executeQuery('UPDATE ' . $this->getTable('entry') . ' SET starred_at = updated_at WHERE is_starred = true'); + $this->connection->executeQuery( + 'UPDATE ' . $this->getTable('entry') . ' SET starred_at = updated_at WHERE is_starred = :is_starred', + [ + 'is_starred' => true, + ] + ); } /** diff --git a/app/DoctrineMigrations/Version20171008195606.php b/app/DoctrineMigrations/Version20171008195606.php index c190f4ed..f09726c8 100644 --- a/app/DoctrineMigrations/Version20171008195606.php +++ b/app/DoctrineMigrations/Version20171008195606.php @@ -31,6 +31,7 @@ class Version20171008195606 extends AbstractMigration implements ContainerAwareI switch ($this->connection->getDatabasePlatform()->getName()) { case 'mysql': + $this->addSql('UPDATE ' . $this->getTable('entry') . ' SET reading_time = 0 WHERE reading_time IS NULL;'); $this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE reading_time reading_time INT(11) NOT NULL;'); break; case 'postgresql': diff --git a/app/DoctrineMigrations/Version20171105202000.php b/app/DoctrineMigrations/Version20171105202000.php new file mode 100644 index 00000000..3769045f --- /dev/null +++ b/app/DoctrineMigrations/Version20171105202000.php @@ -0,0 +1,55 @@ +container = $container; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $entryTable = $schema->getTable($this->getTable('entry')); + + $this->skipIf($entryTable->hasColumn('origin_url'), 'It seems that you already played this migration.'); + + $entryTable->addColumn('origin_url', 'text', [ + 'notnull' => false, + ]); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $entryTable = $schema->getTable($this->getTable('entry')); + + $this->skipIf(!$entryTable->hasColumn('origin_url'), 'It seems that you already played this migration.'); + + $entryTable->dropColumn('origin_url'); + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } +} diff --git a/app/DoctrineMigrations/Version20171120163128.php b/app/DoctrineMigrations/Version20171120163128.php new file mode 100644 index 00000000..fc3d4c37 --- /dev/null +++ b/app/DoctrineMigrations/Version20171120163128.php @@ -0,0 +1,52 @@ +container = $container; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $storeArticleHeaders = $this->container + ->get('doctrine.orm.default_entity_manager') + ->getConnection() + ->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'store_article_headers'"); + + $this->skipIf(false !== $storeArticleHeaders, 'It seems that you already played this migration.'); + + $this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('store_article_headers', '0', 'entry')"); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'store_article_headers';"); + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } +} diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml index 5475e571..c3fd843f 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml @@ -12,6 +12,8 @@ export_xml: Aktiver eksport til XML # import_with_rabbitmq: Enable RabbitMQ to import data asynchronously # import_with_redis: Enable Redis to import data asynchronously shaarli_url: Shaarli-URL, hvis tjenesten er aktiv +scuttle_url: Scuttle-URL, hvis tjenesten er aktiv +unmark_url: Unmark-URL, hvis tjenesten er aktiv share_diaspora: Aktiver deling til Diaspora share_mail: Aktiver deling med email share_shaarli: Aktiver deling gennem Shaarli @@ -34,3 +36,4 @@ demo_mode_username: "Demobruger" # download_images_enabled: Download images locally # restricted_access: Enable authentication for websites with paywall # api_user_registration: Enable user to be registered using the API +# store_article_headers: Enable if wallabag stores HTTP headers for each article diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml index a066c8e3..37da383e 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml @@ -12,6 +12,8 @@ export_xml: 'XML-Export aktivieren' import_with_rabbitmq: 'Aktiviere RabbitMQ, um Artikel asynchron zu importieren' import_with_redis: 'Aktiviere Redis, um Artikel asynchron zu importieren' shaarli_url: 'Shaarli-URL, sofern der Service aktiviert ist' +scuttle_url: 'Scuttle-URL, sofern der Service aktiviert ist' +unmark_url: 'Unmark-URL, sofern der Service aktiviert ist' share_diaspora: 'Teilen zu Diaspora aktiveren' share_mail: 'Teilen via E-Mail aktiveren' share_shaarli: 'Teilen zu Shaarli aktiveren' @@ -34,3 +36,4 @@ share_public: 'Erlaube eine öffentliche URL für Einträge' download_images_enabled: 'Bilder lokal herunterladen' restricted_access: 'Authentifizierung für Webseiten mit Paywall aktivieren' api_user_registration: 'Registrierung eines Benutzers über die API ermöglichen' +# store_article_headers: Enable if wallabag stores HTTP headers for each article diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml index 1e4f4668..0a89ce2c 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml @@ -1,7 +1,7 @@ settings_changed: Configuration updated download_pictures: Download pictures on your server carrot: Enable share to Carrot -diaspora_url: Diaspora URL, if the service is enabled +diaspora_url: diaspora* URL, if the service is enabled export_epub: Enable ePub export export_mobi: Enable .mobi export export_pdf: Enable PDF export @@ -12,12 +12,14 @@ export_xml: Enable XML export import_with_rabbitmq: Enable RabbitMQ to import data asynchronously import_with_redis: Enable Redis to import data asynchronously shaarli_url: Shaarli URL, if the service is enabled -share_diaspora: Enable share to Diaspora -share_mail: Enable share by email -share_shaarli: Enable share to Shaarli -share_scuttle: Enable share to Scuttle -share_twitter: Enable share to Twitter -share_unmark: Enable share to Unmark.it +scuttle_url: Scuttle URL, if the service is enabled +unmark_url: Unmark URL, if the service is enabled +share_diaspora: Enable share to diaspora* +share_mail: Enable share by e-mail +share_shaarli: Enable sharing to Shaarli +share_scuttle: Enable sharing to Scuttle +share_twitter: Enable sharing to Twitter +share_unmark: Enable sharing to Unmark.it show_printlink: Display a link to print content wallabag_support_url: Support URL for wallabag entry: "article" @@ -28,9 +30,10 @@ modify_settings: "apply" piwik_host: Host of your website in Piwik (without http:// ou https://) piwik_site_id: ID of your website in Piwik piwik_enabled: Enable Piwik -demo_mode_enabled: "Enable demo mode ? (only used for the wallabag public demo)" +demo_mode_enabled: "Enable demo mode? (Only used for the public wallabag demo)" demo_mode_username: "Demo user" -share_public: Allow public url for entries +share_public: Allow public URL for entries download_images_enabled: Download images locally -restricted_access: Enable authentication for websites with paywall +restricted_access: Enable authentication for paywalled websites api_user_registration: Enable user to be registered using the API +store_article_headers: Enable if wallabag stores HTTP headers for each article diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml index 46ed4040..db5858d6 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml @@ -12,6 +12,8 @@ export_xml: Activar exportación a XML import_with_rabbitmq: Activar RabbitMQ para importar datos de forma asíncrona import_with_redis: Activar Redis para importar datos de forma asíncrona shaarli_url: URL de Shaarli, si el servicio está activado +scuttle_url: URL de Scuttle, si el servicio está activado +unmark_url: URL de Unmark, si el servicio está activado share_diaspora: Activar compartir con Diaspora share_mail: Activar compartir con Email share_shaarli: Activar compartir con Shaarli @@ -34,3 +36,4 @@ share_public: Permitir URL pública para los artículos download_images_enabled: Descargar imágenes localmente restricted_access: Activar autenticación para websites con paywall # api_user_registration: Enable user to be registered using the API +# store_article_headers: Enable if wallabag stores HTTP headers for each article diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml index f8da4acf..11cc601b 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml @@ -12,6 +12,8 @@ export_xml: فعال‌سازی برون‌سپاری به XML # import_with_rabbitmq: Enable RabbitMQ to import data asynchronously # import_with_redis: Enable Redis to import data asynchronously shaarli_url: نشانی Shaarli، اگر فعال بود +scuttle_url: نشانی Scuttle، اگر فعال بود +unmark_url: نشانی Unmark، اگر فعال بود share_diaspora: فعال‌سازی هم‌رسانی به Diaspora share_mail: فعال‌سازی هم‌رسانی با ایمیل share_shaarli: فعال‌سازی هم‌رسانی به Shaarli @@ -34,3 +36,4 @@ modify_settings: "اعمال" # download_images_enabled: Download images locally # restricted_access: Enable authentication for websites with paywall # api_user_registration: Enable user to be registered using the API +# store_article_headers: Enable if wallabag stores HTTP headers for each article diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml index a79409b4..f23b5bf9 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml @@ -12,6 +12,8 @@ export_xml: Activer l'export XML import_with_rabbitmq: Activer RabbitMQ pour gérer les imports de façon asynchrone import_with_redis: Activer Redis pour gérer les imports de façon asynchrone shaarli_url: URL de Shaarli, si le service Shaarli est activé +scuttle_url: URL de Scuttle, si le service Scuttle est activé +unmark_url: URL de Unmark, si le service Unmark est activé share_diaspora: Activer le partage vers Diaspora share_mail: Activer le partage par email share_shaarli: Activer le partage vers Shaarli @@ -34,3 +36,4 @@ share_public: Autoriser une URL publique pour les articles download_images_enabled: Télécharger les images en local restricted_access: Activer l'authentification pour les articles derrière un paywall api_user_registration: Activer la création de compte depuis l'API +store_article_headers: Activer le stockage des en-têtes HTTP de chaque article diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml index dd4def4b..ade6f7da 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml @@ -12,6 +12,8 @@ export_xml: Abilita esportazione XML # import_with_rabbitmq: Enable RabbitMQ to import data asynchronously # import_with_redis: Enable Redis to import data asynchronously shaarli_url: Shaarli URL, se il servizio è abilitato +scuttle_url: Scuttle URL, se il servizio è abilitato +unmark_url: Unmark URL, se il servizio è abilitato share_diaspora: Abilita la condivisione con Diaspora share_mail: Abilita la condivisione per email share_shaarli: Abilita la condivisione con Shaarli @@ -34,3 +36,4 @@ demo_mode_username: "Utente Demo" # download_images_enabled: Download images locally # restricted_access: Enable authentication for websites with paywall api_user_registration: Abilita la registrazione dell'utente attraverso l'API +# store_article_headers: Enable if wallabag stores HTTP headers for each article diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml index fb163ce7..99986642 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml @@ -12,6 +12,8 @@ export_xml: Activar l'expòrt XML import_with_rabbitmq: Activar RabbitMQ per importar de donadas de manièra asincròna import_with_redis: Activar Redis per importar de donadas de manièra asincròna shaarli_url: URL de Shaarli, se lo servici Shaarli es activat +scuttle_url: URL de Scuttle, se lo servici Scuttle es activat +unmark_url: URL de Unmark, se lo servici Scuttle es activat share_diaspora: Activar lo partatge cap a Diaspora* share_mail: Activar lo partatge per corrièl share_shaarli: Activar lo partatge cap a Shaarli @@ -34,3 +36,4 @@ share_public: Autorizar una URL publica pels articles download_images_enabled: Telecargar los imatges en local restricted_access: Activar l'autenticacion pels sites amb peatge api_user_registration: Autorizar los utilizaires a se marcar amb l'API +# store_article_headers: Enable if wallabag stores HTTP headers for each article diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml index 04ad4fd3..8b8f2ebd 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml @@ -12,6 +12,7 @@ export_xml: Włącz eksport do XML import_with_rabbitmq: Włącz RabbitMQ dla asynchronicznego importu danych import_with_redis: Włącz Redis dla asynchronicznego importu danych shaarli_url: Adress URL Shaarli, jeżeli usługa jest włączona +scuttle_url: Adress URL Scuttle, jeżeli usługa jest włączona share_diaspora: Włącz udostępnianie dla Diaspora share_mail: Włącz udostępnianie przez email share_shaarli: Włącz udostępnianie dla Shaarli @@ -34,3 +35,4 @@ share_public: Zezwalaj na publiczny adres url dla wpisow download_images_enabled: Pobierz obrazy lokalnie restricted_access: Włącz autoryzację dla stron z paywallem api_user_registration: Włącz rejestrację użytkownika przy użyciu API +# store_article_headers: Enable if wallabag stores HTTP headers for each article diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml index 77e22b37..76cb0174 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml @@ -12,6 +12,8 @@ export_xml: Habilita exportação para XML # import_with_rabbitmq: Enable RabbitMQ to import data asynchronously # import_with_redis: Enable Redis to import data asynchronously shaarli_url: URL Shaarli, se o serviço está habilitado +scuttle_url: URL Scuttle, se o serviço está habilitado +unmark_url: URL Unmark, se o serviço está habilitado share_diaspora: Habilitar compartilhamento para o Diaspora share_mail: Habilitar compartilhamento por e-mail share_shaarli: Habilitar compartilhamento para o Shaarli @@ -34,3 +36,4 @@ demo_mode_username: "Usuário demo" # download_images_enabled: Download images locally # restricted_access: Enable authentication for websites with paywall # api_user_registration: Enable user to be registered using the API +# store_article_headers: Enable if wallabag stores HTTP headers for each article diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml index 1b4bfb5b..8300cec8 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml @@ -12,6 +12,8 @@ export_xml: Permite exportare XML # import_with_rabbitmq: Enable RabbitMQ to import data asynchronously # import_with_redis: Enable Redis to import data asynchronously shaarli_url: Shaarli URL, dacă serviciul este permis +scuttle_url: Scuttle URL, dacă serviciul este permis +unmark_url: Unmark URL, dacă serviciul este permis share_diaspora: Permite share către Diaspora share_mail: Permite share prin email share_shaarli: Permite share către Shaarli @@ -34,3 +36,4 @@ modify_settings: "aplică" # download_images_enabled: Download images locally # restricted_access: Enable authentication for websites with paywall # api_user_registration: Enable user to be registered using the API +# store_article_headers: Enable if wallabag stores HTTP headers for each article diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ru.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ru.yml index 37b4bbfd..8fed84ae 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ru.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ru.yml @@ -12,6 +12,8 @@ export_xml: "Включить XML экспорт" import_with_rabbitmq: "Включить RabbitMQ для импорта данных(асинхронно)" import_with_redis: "Включить Redis для импорта данных(асинхронно)" shaarli_url: "Shaarli URL, если сервис включен" +scuttle_url: "Scuttle URL, если сервис включен" +unmark_url: "Unmark URL, если сервис включен" share_diaspora: "Включить возможность поделиться в соц.сети Diaspora" share_mail: "Включить возможность поделиться по email" share_shaarli: "Включить возможность поделиться в Shaarli" @@ -33,3 +35,5 @@ demo_mode_username: "Демо пользователь" share_public: "Разрешить публичные ссылки на записи" download_images_enabled: "Скачивать изображения локально" restricted_access: "Включить авторизацию на сайте с помощью paywall" +# api_user_registration: Enable user to be registered using the API +# store_article_headers: Enable if wallabag stores HTTP headers for each article diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml index 1579366d..b992ccc2 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml @@ -12,6 +12,8 @@ # import_with_rabbitmq: Enable RabbitMQ to import data asynchronously # import_with_redis: Enable Redis to import data asynchronously # shaarli_url: Shaarli URL, if the service is enabled +# scuttle_url: Scuttle URL, if the service is enabled +# unmark_url: Unmark URL, if the service is enabled # share_diaspora: Enable share to Diaspora # share_mail: Enable share by email # share_shaarli: Enable share to Shaarli @@ -35,3 +37,4 @@ # download_images_enabled: Download images locally # restricted_access: Enable authentication for websites with paywall # api_user_registration: Enable user to be registered using the API +# store_article_headers: Enable if wallabag stores HTTP headers for each article diff --git a/app/config/wallabag.yml b/app/config/wallabag.yml index 19401aa7..ec6aae63 100644 --- a/app/config/wallabag.yml +++ b/app/config/wallabag.yml @@ -154,6 +154,10 @@ wallabag_core: name: api_user_registration value: 0 section: api + - + name: store_article_headers + value: 0 + section: entry wallabag_user: registration_enabled: "%fosuser_registration%" diff --git a/build.xml b/build.xml deleted file mode 100644 index b9fe6136..00000000 --- a/build.xml +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/composer.json b/composer.json index d1f970c7..23c7cdc2 100644 --- a/composer.json +++ b/composer.json @@ -43,46 +43,46 @@ "ext-iconv": "*", "ext-tokenizer": "*", "ext-pdo": "*", - "symfony/symfony": "3.3.*", - "doctrine/orm": "^2.5", - "doctrine/doctrine-bundle": "^1.6", - "doctrine/doctrine-cache-bundle": "^1.2", - "twig/extensions": "~1.0", - "symfony/swiftmailer-bundle": "^2.3", - "symfony/monolog-bundle": "^3.0", - "sensio/distribution-bundle": "^5.0", - "sensio/framework-extra-bundle": "^3.0", - "incenteev/composer-parameter-handler": "^2.0", - "nelmio/cors-bundle": "~1.4", + "symfony/symfony": "~3.3.13", + "doctrine/orm": "^2.5.12", + "doctrine/doctrine-bundle": "^1.8.0", + "doctrine/doctrine-cache-bundle": "^1.3.2", + "twig/extensions": "^1.5.1", + "symfony/swiftmailer-bundle": "^2.6.7", + "symfony/monolog-bundle": "^3.1.2", + "sensio/distribution-bundle": "^5.0.21", + "sensio/framework-extra-bundle": "^3.0.28", + "incenteev/composer-parameter-handler": "^2.1.2", + "nelmio/cors-bundle": "~1.5", "friendsofsymfony/rest-bundle": "~2.1", "jms/serializer-bundle": "~2.2", - "nelmio/api-doc-bundle": "~2.7", + "nelmio/api-doc-bundle": "^2.13.2", "mgargano/simplehtmldom": "~1.5", - "wallabag/tcpdf": "^6.2", + "wallabag/tcpdf": "^6.2.15", "simplepie/simplepie": "~1.5", - "willdurand/hateoas-bundle": "~1.0", - "liip/theme-bundle": "~1.1", - "lexik/form-filter-bundle": "~5.0", + "willdurand/hateoas-bundle": "~1.3", + "liip/theme-bundle": "^1.4.6", + "lexik/form-filter-bundle": "^5.0.4", "j0k3r/graby": "^1.0", - "friendsofsymfony/user-bundle": "^2.0", - "friendsofsymfony/oauth-server-bundle": "^1.5", + "friendsofsymfony/user-bundle": "^2.0.1", + "friendsofsymfony/oauth-server-bundle": "^1.5.2", "stof/doctrine-extensions-bundle": "^1.2", - "scheb/two-factor-bundle": "~2.0", - "grandt/phpepub": "~4.0", + "scheb/two-factor-bundle": "^2.14.0", + "grandt/phpepub": "^4.0.7", "wallabag/php-mobi": "~1.0.0", "kphoen/rulerz-bundle": "~0.13", "guzzlehttp/guzzle": "^5.3.1", - "doctrine/doctrine-migrations-bundle": "^1.0", - "paragonie/random_compat": "~2.0", + "doctrine/doctrine-migrations-bundle": "^1.3", + "paragonie/random_compat": "^2.0.11", "craue/config-bundle": "~2.0", "mnapoli/piwik-twig-extension": "^1.0", - "ocramius/proxy-manager": "1.*", - "white-october/pagerfanta-bundle": "^1.0", - "php-amqplib/rabbitmq-bundle": "^1.8", - "predis/predis": "^1.0", - "javibravo/simpleue": "^1.0", - "symfony/dom-crawler": "^3.1", - "friendsofsymfony/jsrouting-bundle": "^1.6", + "ocramius/proxy-manager": "^1.0.2", + "white-october/pagerfanta-bundle": "^1.1.0", + "php-amqplib/rabbitmq-bundle": "^1.14", + "predis/predis": "^1.1.1", + "javibravo/simpleue": "^2.0", + "symfony/dom-crawler": "^3.3.13", + "friendsofsymfony/jsrouting-bundle": "^1.6.3", "bdunogier/guzzle-site-authenticator": "^1.0.0@dev", "defuse/php-encryption": "^2.1", "html2text/html2text": "^4.1" diff --git a/data/sql/mysql_base.sql b/data/sql/mysql_base.sql deleted file mode 100644 index 13fa6302..00000000 --- a/data/sql/mysql_base.sql +++ /dev/null @@ -1,25 +0,0 @@ -CREATE TABLE wallabag_craue_config_setting (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_5D9649505E237E06 (name), PRIMARY KEY(name)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; -CREATE TABLE `wallabag_entry` (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, title LONGTEXT DEFAULT NULL, url LONGTEXT DEFAULT NULL, is_archived TINYINT(1) NOT NULL, is_starred TINYINT(1) NOT NULL, content LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype LONGTEXT DEFAULT NULL, language LONGTEXT DEFAULT NULL, reading_time INT DEFAULT NULL, domain_name LONGTEXT DEFAULT NULL, preview_picture LONGTEXT DEFAULT NULL, is_public TINYINT(1) DEFAULT '0', INDEX IDX_F4D18282A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; -CREATE TABLE wallabag_entry_tag (entry_id INT NOT NULL, tag_id INT NOT NULL, INDEX IDX_C9F0DD7CBA364942 (entry_id), INDEX IDX_C9F0DD7CBAD26311 (tag_id), PRIMARY KEY(entry_id, tag_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; -CREATE TABLE `wallabag_config` (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, theme VARCHAR(255) NOT NULL, items_per_page INT NOT NULL, language VARCHAR(255) NOT NULL, rss_token VARCHAR(255) DEFAULT NULL, rss_limit INT DEFAULT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, UNIQUE INDEX UNIQ_87E64C53A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; -CREATE TABLE `wallabag_tagging_rule` (id INT AUTO_INCREMENT NOT NULL, config_id INT DEFAULT NULL, rule VARCHAR(255) NOT NULL, tags LONGTEXT NOT NULL COMMENT '(DC2Type:simple_array)', INDEX IDX_2D9B3C5424DB0683 (config_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; -CREATE TABLE `wallabag_tag` (id INT AUTO_INCREMENT NOT NULL, `label` LONGTEXT NOT NULL, slug VARCHAR(128) NOT NULL, UNIQUE INDEX UNIQ_4CA58A8C989D9B62 (slug), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; -CREATE TABLE wallabag_oauth2_clients (id INT AUTO_INCREMENT NOT NULL, random_id VARCHAR(255) NOT NULL, redirect_uris LONGTEXT NOT NULL COMMENT '(DC2Type:array)', secret VARCHAR(255) NOT NULL, allowed_grant_types LONGTEXT NOT NULL COMMENT '(DC2Type:array)', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; -CREATE TABLE wallabag_oauth2_access_tokens (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_368A42095F37A13B (token), INDEX IDX_368A420919EB6921 (client_id), INDEX IDX_368A4209A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; -CREATE TABLE wallabag_oauth2_refresh_tokens (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_20C9FB245F37A13B (token), INDEX IDX_20C9FB2419EB6921 (client_id), INDEX IDX_20C9FB24A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; -CREATE TABLE wallabag_oauth2_auth_codes (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, redirect_uri LONGTEXT NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_EE52E3FA5F37A13B (token), INDEX IDX_EE52E3FA19EB6921 (client_id), INDEX IDX_EE52E3FAA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; -CREATE TABLE `wallabag_user` (id INT AUTO_INCREMENT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled TINYINT(1) NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, locked TINYINT(1) NOT NULL, expired TINYINT(1) NOT NULL, expires_at DATETIME DEFAULT NULL, confirmation_token VARCHAR(255) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles LONGTEXT NOT NULL COMMENT '(DC2Type:array)', credentials_expired TINYINT(1) NOT NULL, credentials_expire_at DATETIME DEFAULT NULL, name LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INT DEFAULT NULL, twoFactorAuthentication TINYINT(1) NOT NULL, trusted LONGTEXT DEFAULT NULL COMMENT '(DC2Type:json_array)', UNIQUE INDEX UNIQ_1D63E7E592FC23A8 (username_canonical), UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF (email_canonical), UNIQUE INDEX UNIQ_1D63E7E5C05FB297 (confirmation_token), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; -CREATE TABLE wallabag_annotation (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, entry_id INT DEFAULT NULL, text LONGTEXT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, quote VARCHAR(255) NOT NULL, ranges LONGTEXT NOT NULL COMMENT '(DC2Type:array)', INDEX IDX_A7AED006A76ED395 (user_id), INDEX IDX_A7AED006BA364942 (entry_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; -ALTER TABLE `wallabag_entry` ADD CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id); -ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES `wallabag_entry` (id); -ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES `wallabag_tag` (id); -ALTER TABLE `wallabag_config` ADD CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id); -ALTER TABLE `wallabag_tagging_rule` ADD CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES `wallabag_config` (id); -ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A420919EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id); -ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id); -ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB2419EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id); -ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id); -ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id); -ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id); -ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id); -ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES `wallabag_entry` (id); diff --git a/data/sql/pgsql_base.sql b/data/sql/pgsql_base.sql deleted file mode 100644 index 6688fe83..00000000 --- a/data/sql/pgsql_base.sql +++ /dev/null @@ -1,62 +0,0 @@ -CREATE TABLE wallabag_craue_config_setting (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, PRIMARY KEY(name)); -CREATE UNIQUE INDEX UNIQ_5D9649505E237E06 ON wallabag_craue_config_setting (name); -CREATE TABLE "wallabag_entry" (id INT NOT NULL, user_id INT DEFAULT NULL, title TEXT DEFAULT NULL, url TEXT DEFAULT NULL, is_archived BOOLEAN NOT NULL, is_starred BOOLEAN NOT NULL, content TEXT DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, mimetype TEXT DEFAULT NULL, language TEXT DEFAULT NULL, reading_time INT DEFAULT NULL, domain_name TEXT DEFAULT NULL, preview_picture TEXT DEFAULT NULL, is_public BOOLEAN DEFAULT 'false', PRIMARY KEY(id)); -CREATE INDEX IDX_F4D18282A76ED395 ON "wallabag_entry" (user_id); -CREATE TABLE wallabag_entry_tag (entry_id INT NOT NULL, tag_id INT NOT NULL, PRIMARY KEY(entry_id, tag_id)); -CREATE INDEX IDX_C9F0DD7CBA364942 ON wallabag_entry_tag (entry_id); -CREATE INDEX IDX_C9F0DD7CBAD26311 ON wallabag_entry_tag (tag_id); -CREATE TABLE "wallabag_config" (id INT NOT NULL, user_id INT DEFAULT NULL, theme VARCHAR(255) NOT NULL, items_per_page INT NOT NULL, language VARCHAR(255) NOT NULL, rss_token VARCHAR(255) DEFAULT NULL, rss_limit INT DEFAULT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, PRIMARY KEY(id)); -CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON "wallabag_config" (user_id); -CREATE TABLE "wallabag_tagging_rule" (id INT NOT NULL, config_id INT DEFAULT NULL, rule VARCHAR(255) NOT NULL, tags TEXT NOT NULL, PRIMARY KEY(id)); -CREATE INDEX IDX_2D9B3C5424DB0683 ON "wallabag_tagging_rule" (config_id); -COMMENT ON COLUMN "wallabag_tagging_rule".tags IS '(DC2Type:simple_array)'; -CREATE TABLE "wallabag_tag" (id INT NOT NULL, label TEXT NOT NULL, slug VARCHAR(128) NOT NULL, PRIMARY KEY(id)); -CREATE UNIQUE INDEX UNIQ_4CA58A8C989D9B62 ON "wallabag_tag" (slug); -CREATE TABLE wallabag_oauth2_clients (id INT NOT NULL, random_id VARCHAR(255) NOT NULL, redirect_uris TEXT NOT NULL, secret VARCHAR(255) NOT NULL, allowed_grant_types TEXT NOT NULL, PRIMARY KEY(id)); -COMMENT ON COLUMN wallabag_oauth2_clients.redirect_uris IS '(DC2Type:array)'; -COMMENT ON COLUMN wallabag_oauth2_clients.allowed_grant_types IS '(DC2Type:array)'; -CREATE TABLE wallabag_oauth2_access_tokens (id INT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)); -CREATE UNIQUE INDEX UNIQ_368A42095F37A13B ON wallabag_oauth2_access_tokens (token); -CREATE INDEX IDX_368A420919EB6921 ON wallabag_oauth2_access_tokens (client_id); -CREATE INDEX IDX_368A4209A76ED395 ON wallabag_oauth2_access_tokens (user_id); -CREATE TABLE wallabag_oauth2_refresh_tokens (id INT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)); -CREATE UNIQUE INDEX UNIQ_20C9FB245F37A13B ON wallabag_oauth2_refresh_tokens (token); -CREATE INDEX IDX_20C9FB2419EB6921 ON wallabag_oauth2_refresh_tokens (client_id); -CREATE INDEX IDX_20C9FB24A76ED395 ON wallabag_oauth2_refresh_tokens (user_id); -CREATE TABLE wallabag_oauth2_auth_codes (id INT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, redirect_uri TEXT NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)); -CREATE UNIQUE INDEX UNIQ_EE52E3FA5F37A13B ON wallabag_oauth2_auth_codes (token); -CREATE INDEX IDX_EE52E3FA19EB6921 ON wallabag_oauth2_auth_codes (client_id); -CREATE INDEX IDX_EE52E3FAA76ED395 ON wallabag_oauth2_auth_codes (user_id); -CREATE TABLE "wallabag_user" (id INT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled BOOLEAN NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, last_login TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, locked BOOLEAN NOT NULL, expired BOOLEAN NOT NULL, expires_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, confirmation_token VARCHAR(255) DEFAULT NULL, password_requested_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, roles TEXT NOT NULL, credentials_expired BOOLEAN NOT NULL, credentials_expire_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, name TEXT DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, authCode INT DEFAULT NULL, twoFactorAuthentication BOOLEAN NOT NULL, trusted TEXT DEFAULT NULL, PRIMARY KEY(id)); -CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON "wallabag_user" (username_canonical); -CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON "wallabag_user" (email_canonical); -CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON "wallabag_user" (confirmation_token); -COMMENT ON COLUMN "wallabag_user".roles IS '(DC2Type:array)'; -COMMENT ON COLUMN "wallabag_user".trusted IS '(DC2Type:json_array)'; -CREATE TABLE wallabag_annotation (id INT NOT NULL, user_id INT DEFAULT NULL, entry_id INT DEFAULT NULL, text TEXT NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, quote VARCHAR(255) NOT NULL, ranges TEXT NOT NULL, PRIMARY KEY(id)); -CREATE INDEX IDX_A7AED006A76ED395 ON wallabag_annotation (user_id); -CREATE INDEX IDX_A7AED006BA364942 ON wallabag_annotation (entry_id); -COMMENT ON COLUMN wallabag_annotation.ranges IS '(DC2Type:array)'; -CREATE SEQUENCE "entry_id_seq" INCREMENT BY 1 MINVALUE 1 START 1; -CREATE SEQUENCE "config_id_seq" INCREMENT BY 1 MINVALUE 1 START 1; -CREATE SEQUENCE "tagging_rule_id_seq" INCREMENT BY 1 MINVALUE 1 START 1; -CREATE SEQUENCE "tag_id_seq" INCREMENT BY 1 MINVALUE 1 START 1; -CREATE SEQUENCE oauth2_clients_id_seq INCREMENT BY 1 MINVALUE 1 START 1; -CREATE SEQUENCE oauth2_access_tokens_id_seq INCREMENT BY 1 MINVALUE 1 START 1; -CREATE SEQUENCE oauth2_refresh_tokens_id_seq INCREMENT BY 1 MINVALUE 1 START 1; -CREATE SEQUENCE oauth2_auth_codes_id_seq INCREMENT BY 1 MINVALUE 1 START 1; -CREATE SEQUENCE "user_id_seq" INCREMENT BY 1 MINVALUE 1 START 1; -CREATE SEQUENCE annotation_id_seq INCREMENT BY 1 MINVALUE 1 START 1; -ALTER TABLE "wallabag_entry" ADD CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; -ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; -ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES "wallabag_tag" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; -ALTER TABLE "wallabag_config" ADD CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; -ALTER TABLE "wallabag_tagging_rule" ADD CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES "wallabag_config" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; -ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A420919EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE; -ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; -ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB2419EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE; -ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; -ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE; -ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; -ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; -ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; diff --git a/data/sql/sqlite_base.sql b/data/sql/sqlite_base.sql deleted file mode 100644 index d2780d96..00000000 --- a/data/sql/sqlite_base.sql +++ /dev/null @@ -1,33 +0,0 @@ -CREATE TABLE wallabag_craue_config_setting (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, PRIMARY KEY(name)); -CREATE UNIQUE INDEX UNIQ_5D9649505E237E06 ON wallabag_craue_config_setting (name); -CREATE TABLE "wallabag_tagging_rule" (id INTEGER NOT NULL, config_id INTEGER DEFAULT NULL, rule VARCHAR(255) NOT NULL, tags CLOB NOT NULL, PRIMARY KEY(id), CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES "wallabag_config" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); -CREATE INDEX IDX_2D9B3C5424DB0683 ON "wallabag_tagging_rule" (config_id); -CREATE TABLE "wallabag_tag" (id INTEGER NOT NULL, label CLOB NOT NULL, slug VARCHAR(128) NOT NULL, PRIMARY KEY(id)); -CREATE UNIQUE INDEX UNIQ_4CA58A8C989D9B62 ON "wallabag_tag" (slug); -CREATE TABLE "wallabag_entry" (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, title CLOB DEFAULT NULL, url CLOB DEFAULT NULL, is_archived BOOLEAN NOT NULL, is_starred BOOLEAN NOT NULL, content CLOB DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype CLOB DEFAULT NULL, language CLOB DEFAULT NULL, reading_time INTEGER DEFAULT NULL, domain_name CLOB DEFAULT NULL, preview_picture CLOB DEFAULT NULL, is_public BOOLEAN DEFAULT '0', PRIMARY KEY(id), CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); -CREATE INDEX IDX_F4D18282A76ED395 ON "wallabag_entry" (user_id); -CREATE TABLE wallabag_entry_tag (entry_id INTEGER NOT NULL, tag_id INTEGER NOT NULL, PRIMARY KEY(entry_id, tag_id), CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES "wallabag_tag" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); -CREATE INDEX IDX_C9F0DD7CBA364942 ON wallabag_entry_tag (entry_id); -CREATE INDEX IDX_C9F0DD7CBAD26311 ON wallabag_entry_tag (tag_id); -CREATE TABLE "wallabag_config" (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, theme VARCHAR(255) NOT NULL, items_per_page INTEGER NOT NULL, language VARCHAR(255) NOT NULL, rss_token VARCHAR(255) DEFAULT NULL, rss_limit INTEGER DEFAULT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); -CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON "wallabag_config" (user_id); -CREATE TABLE wallabag_oauth2_refresh_tokens (id INTEGER NOT NULL, client_id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INTEGER DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_20C9FB2419EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); -CREATE UNIQUE INDEX UNIQ_20C9FB245F37A13B ON wallabag_oauth2_refresh_tokens (token); -CREATE INDEX IDX_20C9FB2419EB6921 ON wallabag_oauth2_refresh_tokens (client_id); -CREATE INDEX IDX_20C9FB24A76ED395 ON wallabag_oauth2_refresh_tokens (user_id); -CREATE TABLE wallabag_oauth2_access_tokens (id INTEGER NOT NULL, client_id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INTEGER DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_368A420919EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); -CREATE UNIQUE INDEX UNIQ_368A42095F37A13B ON wallabag_oauth2_access_tokens (token); -CREATE INDEX IDX_368A420919EB6921 ON wallabag_oauth2_access_tokens (client_id); -CREATE INDEX IDX_368A4209A76ED395 ON wallabag_oauth2_access_tokens (user_id); -CREATE TABLE wallabag_oauth2_auth_codes (id INTEGER NOT NULL, client_id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, token VARCHAR(255) NOT NULL, redirect_uri CLOB NOT NULL, expires_at INTEGER DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); -CREATE UNIQUE INDEX UNIQ_EE52E3FA5F37A13B ON wallabag_oauth2_auth_codes (token); -CREATE INDEX IDX_EE52E3FA19EB6921 ON wallabag_oauth2_auth_codes (client_id); -CREATE INDEX IDX_EE52E3FAA76ED395 ON wallabag_oauth2_auth_codes (user_id); -CREATE TABLE wallabag_oauth2_clients (id INTEGER NOT NULL, random_id VARCHAR(255) NOT NULL, redirect_uris CLOB NOT NULL, secret VARCHAR(255) NOT NULL, allowed_grant_types CLOB NOT NULL, PRIMARY KEY(id)); -CREATE TABLE "wallabag_user" (id INTEGER NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled BOOLEAN NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, locked BOOLEAN NOT NULL, expired BOOLEAN NOT NULL, expires_at DATETIME DEFAULT NULL, confirmation_token VARCHAR(255) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles CLOB NOT NULL, credentials_expired BOOLEAN NOT NULL, credentials_expire_at DATETIME DEFAULT NULL, name CLOB DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INTEGER DEFAULT NULL, twoFactorAuthentication BOOLEAN NOT NULL, trusted CLOB DEFAULT NULL, PRIMARY KEY(id)); -CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON "wallabag_user" (username_canonical); -CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON "wallabag_user" (email_canonical); -CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON "wallabag_user" (confirmation_token); -CREATE TABLE wallabag_annotation (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, entry_id INTEGER DEFAULT NULL, text CLOB NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, quote VARCHAR(255) NOT NULL, ranges CLOB NOT NULL, PRIMARY KEY(id), CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIATE); -CREATE INDEX IDX_A7AED006A76ED395 ON wallabag_annotation (user_id); -CREATE INDEX IDX_A7AED006BA364942 ON wallabag_annotation (entry_id); diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index 6f161a08..7d820c7e 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php @@ -309,6 +309,7 @@ class EntryRestController extends WallabagRestController * {"name"="published_at", "dataType"="datetime|integer", "format"="YYYY-MM-DDTHH:II:SS+TZ or a timestamp", "required"=false, "description"="Published date of the entry"}, * {"name"="authors", "dataType"="string", "format"="Name Firstname,author2,author3", "required"=false, "description"="Authors of the entry"}, * {"name"="public", "dataType"="integer", "required"=false, "format"="1 or 0", "description"="will generate a public link for the entry"}, + * {"name"="origin_url", "dataType"="string", "required"=false, "format"="http://www.test.com/article.html", "description"="Origin url for the entry (from where you found it)."}, * } * ) * @@ -368,6 +369,10 @@ class EntryRestController extends WallabagRestController $this->get('wallabag_core.tags_assigner')->assignTagsToEntry($entry, $data['tags']); } + if (!empty($data['origin_url'])) { + $entry->setOriginUrl($data['origin_url']); + } + if (null !== $data['isPublic']) { if (true === (bool) $data['isPublic'] && null === $entry->getUid()) { $entry->generateUid(); @@ -404,6 +409,7 @@ class EntryRestController extends WallabagRestController * {"name"="published_at", "dataType"="datetime|integer", "format"="YYYY-MM-DDTHH:II:SS+TZ or a timestamp", "required"=false, "description"="Published date of the entry"}, * {"name"="authors", "dataType"="string", "format"="Name Firstname,author2,author3", "required"=false, "description"="Authors of the entry"}, * {"name"="public", "dataType"="integer", "required"=false, "format"="1 or 0", "description"="will generate a public link for the entry"}, + * {"name"="origin_url", "dataType"="string", "required"=false, "format"="http://www.test.com/article.html", "description"="Origin url for the entry (from where you found it)."}, * } * ) * @@ -480,6 +486,10 @@ class EntryRestController extends WallabagRestController } } + if (!empty($data['origin_url'])) { + $entry->setOriginUrl($data['origin_url']); + } + $em = $this->getDoctrine()->getManager(); $em->persist($entry); $em->flush(); @@ -778,6 +788,7 @@ class EntryRestController extends WallabagRestController 'picture' => $request->request->get('preview_picture'), 'publishedAt' => $request->request->get('published_at'), 'authors' => $request->request->get('authors', ''), + 'origin_url' => $request->request->get('origin_url', ''), ]; } diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index 877dbfa2..dec2bf9c 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php @@ -61,7 +61,6 @@ class InstallCommand extends ContainerAwareCommand ->setupDatabase() ->setupAdmin() ->setupConfig() - ->runMigrations() ; $this->io->success('Wallabag has been successfully installed.'); @@ -70,7 +69,7 @@ class InstallCommand extends ContainerAwareCommand protected function checkRequirements() { - $this->io->section('Step 1 of 5: Checking system requirements.'); + $this->io->section('Step 1 of 4: Checking system requirements.'); $doctrineManager = $this->getContainer()->get('doctrine')->getManager(); @@ -169,7 +168,7 @@ class InstallCommand extends ContainerAwareCommand protected function setupDatabase() { - $this->io->section('Step 2 of 5: Setting up database.'); + $this->io->section('Step 2 of 4: Setting up database.'); // user want to reset everything? Don't care about what is already here if (true === $this->defaultInput->getOption('reset')) { @@ -178,7 +177,7 @@ class InstallCommand extends ContainerAwareCommand $this ->runCommand('doctrine:database:drop', ['--force' => true]) ->runCommand('doctrine:database:create') - ->runCommand('doctrine:schema:create') + ->runCommand('doctrine:migrations:migrate', ['--no-interaction' => true]) ->runCommand('cache:clear') ; @@ -192,7 +191,7 @@ class InstallCommand extends ContainerAwareCommand $this ->runCommand('doctrine:database:create') - ->runCommand('doctrine:schema:create') + ->runCommand('doctrine:migrations:migrate', ['--no-interaction' => true]) ->runCommand('cache:clear') ; @@ -207,7 +206,7 @@ class InstallCommand extends ContainerAwareCommand $this ->runCommand('doctrine:database:drop', ['--force' => true]) ->runCommand('doctrine:database:create') - ->runCommand('doctrine:schema:create') + ->runCommand('doctrine:migrations:migrate', ['--no-interaction' => true]) ; } elseif ($this->isSchemaPresent()) { if ($this->io->confirm('Seems like your database contains schema. Do you want to reset it?', false)) { @@ -215,14 +214,14 @@ class InstallCommand extends ContainerAwareCommand $this ->runCommand('doctrine:schema:drop', ['--force' => true]) - ->runCommand('doctrine:schema:create') + ->runCommand('doctrine:migrations:migrate', ['--no-interaction' => true]) ; } } else { $this->io->text('Creating schema...'); $this - ->runCommand('doctrine:schema:create') + ->runCommand('doctrine:migrations:migrate', ['--no-interaction' => true]) ; } @@ -237,7 +236,7 @@ class InstallCommand extends ContainerAwareCommand protected function setupAdmin() { - $this->io->section('Step 3 of 5: Administration setup.'); + $this->io->section('Step 3 of 4: Administration setup.'); if (!$this->io->confirm('Would you like to create a new admin user (recommended)?', true)) { return $this; @@ -272,7 +271,7 @@ class InstallCommand extends ContainerAwareCommand protected function setupConfig() { - $this->io->section('Step 4 of 5: Config setup.'); + $this->io->section('Step 4 of 4: Config setup.'); $em = $this->getContainer()->get('doctrine.orm.entity_manager'); // cleanup before insert new stuff @@ -293,18 +292,6 @@ class InstallCommand extends ContainerAwareCommand return $this; } - protected function runMigrations() - { - $this->io->section('Step 5 of 5: Run migrations.'); - - $this - ->runCommand('doctrine:migrations:migrate', ['--no-interaction' => true]); - - $this->io->text('Migrations successfully executed.'); - - return $this; - } - /** * Run a command. * diff --git a/src/Wallabag/CoreBundle/Controller/SiteCredentialController.php b/src/Wallabag/CoreBundle/Controller/SiteCredentialController.php index fa2066dc..548de744 100644 --- a/src/Wallabag/CoreBundle/Controller/SiteCredentialController.php +++ b/src/Wallabag/CoreBundle/Controller/SiteCredentialController.php @@ -24,6 +24,8 @@ class SiteCredentialController extends Controller */ public function indexAction() { + $this->isSiteCredentialsEnabled(); + $credentials = $this->get('wallabag_core.site_credential_repository')->findByUser($this->getUser()); return $this->render('WallabagCoreBundle:SiteCredential:index.html.twig', [ @@ -43,6 +45,8 @@ class SiteCredentialController extends Controller */ public function newAction(Request $request) { + $this->isSiteCredentialsEnabled(); + $credential = new SiteCredential($this->getUser()); $form = $this->createForm('Wallabag\CoreBundle\Form\Type\SiteCredentialType', $credential); @@ -83,6 +87,8 @@ class SiteCredentialController extends Controller */ public function editAction(Request $request, SiteCredential $siteCredential) { + $this->isSiteCredentialsEnabled(); + $this->checkUserAction($siteCredential); $deleteForm = $this->createDeleteForm($siteCredential); @@ -125,6 +131,8 @@ class SiteCredentialController extends Controller */ public function deleteAction(Request $request, SiteCredential $siteCredential) { + $this->isSiteCredentialsEnabled(); + $this->checkUserAction($siteCredential); $form = $this->createDeleteForm($siteCredential); @@ -144,6 +152,16 @@ class SiteCredentialController extends Controller return $this->redirectToRoute('site_credentials_index'); } + /** + * Throw a 404 if the feature is disabled. + */ + private function isSiteCredentialsEnabled() + { + if (!$this->get('craue_config')->get('restricted_access')) { + throw $this->createNotFoundException('Feature "restricted_access" is disabled, controllers too.'); + } + } + /** * Creates a form to delete a site credential entity. * diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php index fedad009..0e1510a2 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php @@ -37,6 +37,7 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface $entry2->setMimetype('text/html'); $entry2->setTitle('test title entry2'); $entry2->setContent('This is my content /o/'); + $entry2->setOriginUrl('ftp://oneftp.tld'); $entry2->setLanguage('fr'); $manager->persist($entry2); diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index cfb8db75..2b1f2e05 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -245,6 +245,15 @@ class Entry */ private $tags; + /** + * @var string + * + * @ORM\Column(name="origin_url", type="text", nullable=true) + * + * @Groups({"entries_for_user", "export_all"}) + */ + private $originUrl; + /* * @param User $user */ @@ -831,4 +840,28 @@ class Entry return $this; } + + /** + * Set origin url. + * + * @param string $originUrl + * + * @return Entry + */ + public function setOriginUrl($originUrl) + { + $this->originUrl = $originUrl; + + return $this; + } + + /** + * Get origin url. + * + * @return string + */ + public function getOriginUrl() + { + return $this->originUrl; + } } diff --git a/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php b/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php index 1627cc44..08355928 100644 --- a/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php +++ b/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php @@ -5,6 +5,7 @@ namespace Wallabag\CoreBundle\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\Extension\Core\Type\TextType; +use Symfony\Component\Form\Extension\Core\Type\UrlType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -17,11 +18,16 @@ class EditEntryType extends AbstractType 'required' => true, 'label' => 'entry.edit.title_label', ]) - ->add('url', TextType::class, [ + ->add('url', UrlType::class, [ 'disabled' => true, 'required' => false, 'label' => 'entry.edit.url_label', ]) + ->add('origin_url', UrlType::class, [ + 'required' => false, + 'property_path' => 'originUrl', + 'label' => 'entry.edit.origin_url_label', + ]) ->add('save', SubmitType::class, [ 'label' => 'entry.edit.save_label', ]) diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index 854acb6a..4cc20c9c 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php @@ -24,8 +24,9 @@ class ContentProxy protected $mimeGuesser; protected $fetchingErrorMessage; protected $eventDispatcher; + protected $storeArticleHeaders; - public function __construct(Graby $graby, RuleBasedTagger $tagger, ValidatorInterface $validator, LoggerInterface $logger, $fetchingErrorMessage) + public function __construct(Graby $graby, RuleBasedTagger $tagger, ValidatorInterface $validator, LoggerInterface $logger, $fetchingErrorMessage, $storeArticleHeaders = false) { $this->graby = $graby; $this->tagger = $tagger; @@ -33,6 +34,7 @@ class ContentProxy $this->logger = $logger; $this->mimeGuesser = new MimeTypeExtensionGuesser(); $this->fetchingErrorMessage = $fetchingErrorMessage; + $this->storeArticleHeaders = $storeArticleHeaders; } /** @@ -185,7 +187,7 @@ class ContentProxy $entry->setPublishedBy($content['authors']); } - if (!empty($content['all_headers'])) { + if (!empty($content['all_headers']) && $this->storeArticleHeaders) { $entry->setHeaders($content['all_headers']); } diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml index 31b16739..85306276 100644 --- a/src/Wallabag/CoreBundle/Resources/config/services.yml +++ b/src/Wallabag/CoreBundle/Resources/config/services.yml @@ -94,6 +94,7 @@ services: - "@validator" - "@logger" - '%wallabag_core.fetching_error_message%' + - '@=service(''craue_config'').get(''store_article_headers'')' wallabag_core.tags_assigner: class: Wallabag\CoreBundle\Helper\TagsAssigner diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index d0a38f7e..27dbb388 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -233,6 +233,7 @@ entry: created_at: 'Oprettelsesdato' # published_at: 'Publication date' # published_by: 'Published by' + # provided_by: 'Provided by' new: page_title: 'Gem ny artikel' placeholder: 'http://website.com' @@ -244,6 +245,7 @@ entry: # page_title: 'Edit an entry' # title_label: 'Title' url_label: 'Url' + # origin_url_label: 'Origin url (from where you found that entry)' save_label: 'Gem' public: # shared_by_wallabag: "This article has been shared by %username% with wallabag" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index 158762a9..d47986e5 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -233,6 +233,7 @@ entry: created_at: 'Erstellungsdatum' published_at: 'Erscheinungsdatum' published_by: 'Veröffentlicht von' + # provided_by: 'Provided by' new: page_title: 'Neuen Artikel speichern' placeholder: 'https://website.de' @@ -244,6 +245,7 @@ entry: page_title: 'Eintrag bearbeiten' title_label: 'Titel' url_label: 'URL' + # origin_url_label: 'Origin url (from where you found that entry)' save_label: 'Speichern' public: shared_by_wallabag: 'Dieser Artikel wurde von %username% mittels wallabag geteilt' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index de3e11fe..bbaecb24 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -233,6 +233,7 @@ entry: created_at: 'Creation date' published_at: 'Publication date' published_by: 'Published by' + provided_by: 'Provided by' new: page_title: 'Save new entry' placeholder: 'http://website.com' @@ -244,6 +245,7 @@ entry: page_title: 'Edit an entry' title_label: 'Title' url_label: 'Url' + origin_url_label: 'Origin url (from where you found that entry)' save_label: 'Save' public: shared_by_wallabag: "This article has been shared by %username% with wallabag" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index 6dfc1525..e3b625f7 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -233,6 +233,7 @@ entry: created_at: 'Fecha de creación' # published_at: 'Publication date' # published_by: 'Published by' + # provided_by: 'Provided by' new: page_title: 'Guardar un nuevo artículo' placeholder: 'http://sitioweb.com' @@ -244,6 +245,7 @@ entry: page_title: 'Editar un artículo' title_label: 'Título' url_label: 'URL' + # origin_url_label: 'Origin url (from where you found that entry)' save_label: 'Guardar' public: shared_by_wallabag: "Este artículo se ha compartido con wallabag" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index ffc48933..c03cca46 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -233,6 +233,7 @@ entry: created_at: 'زمان ساخت' # published_at: 'Publication date' # published_by: 'Published by' + # provided_by: 'Provided by' new: page_title: 'ذخیرهٔ مقالهٔ تازه' placeholder: 'http://website.com' @@ -244,6 +245,7 @@ entry: page_title: 'ویرایش مقاله' title_label: 'عنوان' url_label: 'نشانی' + # origin_url_label: 'Origin url (from where you found that entry)' save_label: 'ذخیره' public: # shared_by_wallabag: "This article has been shared by %username% with wallabag" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index c9d95e2b..b0037ad2 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -233,6 +233,7 @@ entry: created_at: "Date de création" published_at: "Date de publication" published_by: "Publié par" + provided_by: "Fourni par" new: page_title: "Sauvegarder un nouvel article" placeholder: "http://website.com" @@ -244,6 +245,7 @@ entry: page_title: "Éditer un article" title_label: "Titre" url_label: "Adresse" + origin_url_label: "Adresse d'origine (d'où vous avez trouvé cet article)" save_label: "Enregistrer" public: shared_by_wallabag: "Cet article a été partagé par %username% avec wallabag" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index c53266ca..56cf341b 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -233,6 +233,7 @@ entry: created_at: 'Data di creazione' published_at: 'Data di pubblicazione' published_by: 'Pubblicato da' + # provided_by: 'Provided by' new: page_title: 'Salva un nuovo contenuto' placeholder: 'http://website.com' @@ -244,6 +245,7 @@ entry: page_title: 'Modifica voce' title_label: 'Titolo' url_label: 'Url' + # origin_url_label: 'Origin url (from where you found that entry)' save_label: 'Salva' public: shared_by_wallabag: "Questo articolo è stato condiviso da %username% con wallabag" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index 3ae64c49..1b5b221f 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -233,6 +233,7 @@ entry: created_at: 'Data de creacion' published_at: 'Data de publicacion' published_by: 'Publicat per' + # provided_by: 'Provided by' new: page_title: 'Enregistrar un novèl article' placeholder: 'http://website.com' @@ -244,6 +245,7 @@ entry: page_title: 'Modificar un article' title_label: 'Títol' url_label: 'Url' + # origin_url_label: 'Origin url (from where you found that entry)' save_label: 'Enregistrar' public: shared_by_wallabag: "Aqueste article es estat partejat per wallabag" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index e642c530..88f35738 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -233,6 +233,7 @@ entry: created_at: 'Czas stworzenia' published_at: 'Data publikacji' published_by: 'Opublikowane przez' + # provided_by: 'Provided by' new: page_title: 'Zapisz nowy wpis' placeholder: 'http://website.com' @@ -244,6 +245,7 @@ entry: page_title: 'Edytuj wpis' title_label: 'Tytuł' url_label: 'Adres URL' + # origin_url_label: 'Origin url (from where you found that entry)' save_label: 'Zapisz' public: shared_by_wallabag: "Ten artykuł został udostępniony przez wallabag" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index 9b3fea6b..3987cec3 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -233,6 +233,7 @@ entry: created_at: 'Data de criação' # published_at: 'Publication date' # published_by: 'Published by' + # provided_by: 'Provided by' new: page_title: 'Salvar nova entrada' placeholder: 'http://website.com' @@ -244,6 +245,7 @@ entry: page_title: 'Editar uma entrada' title_label: 'Título' url_label: 'Url' + # origin_url_label: 'Origin url (from where you found that entry)' save_label: 'Salvar' public: shared_by_wallabag: "Este artigo foi compartilhado pelo wallabag" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index 673ca183..4d2fd569 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -233,6 +233,7 @@ entry: created_at: 'Data creării' # published_at: 'Publication date' # published_by: 'Published by' + # provided_by: 'Provided by' new: page_title: 'Salvează un nou articol' placeholder: 'http://website.com' @@ -244,6 +245,7 @@ entry: # page_title: 'Edit an entry' # title_label: 'Title' url_label: 'Url' + # origin_url_label: 'Origin url (from where you found that entry)' save_label: 'Salvează' public: # shared_by_wallabag: "This article has been shared by %username% with wallabag" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index eceecabf..a560e58d 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml @@ -223,6 +223,7 @@ entry: original_article: 'оригинал' annotations_on_the_entry: '{0} Нет аннотации|{1} Одна аннотация|]1,Inf[ %count% аннотаций' created_at: 'Дата создания' + # provided_by: 'Provided by' new: page_title: 'Сохранить новую запись' placeholder: 'http://website.com' @@ -234,6 +235,7 @@ entry: page_title: 'Изменить запись' title_label: 'Название' url_label: 'Ссылка' + # origin_url_label: 'Origin url (from where you found that entry)' is_public_label: 'Публичная' save_label: 'Сохранить' public: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 563bc50b..0fd6e989 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -231,6 +231,7 @@ entry: created_at: 'Oluşturulma tarihi' # published_at: 'Publication date' # published_by: 'Published by' + # provided_by: 'Provided by' new: page_title: 'Yeni makaleyi kaydet' placeholder: 'http://website.com' @@ -242,6 +243,7 @@ entry: page_title: 'Makaleyi düzenle' title_label: 'Başlık' url_label: 'Url' + # origin_url_label: 'Origin url (from where you found that entry)' save_label: 'Kaydet' public: # shared_by_wallabag: "This article has been shared by %username% with wallabag" diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig index f8723189..0c7cbaa6 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig @@ -71,6 +71,14 @@ comment {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }} + + {% if entry.originUrl is not empty %} + launch + + {{ entry.originUrl|striptags|removeSchemeAndWww|truncate(32) }} + + {% endif %} +