diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/DoctrineMigrations/Version20190425115043.php | 58 | ||||
-rw-r--r-- | app/Resources/static/themes/baggy/css/article.scss | 6 | ||||
-rw-r--r-- | app/Resources/static/themes/baggy/css/pictos.scss | 2 | ||||
-rw-r--r-- | app/config/routing.yml | 36 | ||||
-rw-r--r-- | app/config/security.yml | 2 |
5 files changed, 100 insertions, 4 deletions
diff --git a/app/DoctrineMigrations/Version20190425115043.php b/app/DoctrineMigrations/Version20190425115043.php new file mode 100644 index 00000000..4c5c49cc --- /dev/null +++ b/app/DoctrineMigrations/Version20190425115043.php | |||
@@ -0,0 +1,58 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Application\Migrations; | ||
4 | |||
5 | use Doctrine\DBAL\Schema\Schema; | ||
6 | use Wallabag\CoreBundle\Doctrine\WallabagMigration; | ||
7 | |||
8 | /** | ||
9 | * Rename rss_token & rss_limit to feed_token & feed_limit. | ||
10 | */ | ||
11 | final class Version20190425115043 extends WallabagMigration | ||
12 | { | ||
13 | public function up(Schema $schema): void | ||
14 | { | ||
15 | switch ($this->connection->getDatabasePlatform()->getName()) { | ||
16 | case 'sqlite': | ||
17 | $this->addSql('DROP INDEX UNIQ_87E64C53A76ED395'); | ||
18 | $this->addSql('CREATE TEMPORARY TABLE __temp__' . $this->getTable('config', true) . ' AS SELECT id, user_id, theme, items_per_page, language, rss_token, rss_limit, reading_speed, pocket_consumer_key, action_mark_as_read, list_mode FROM ' . $this->getTable('config', true)); | ||
19 | $this->addSql('DROP TABLE ' . $this->getTable('config', true)); | ||
20 | $this->addSql('CREATE TABLE ' . $this->getTable('config', true) . ' (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, user_id INTEGER DEFAULT NULL, theme VARCHAR(255) NOT NULL COLLATE BINARY, items_per_page INTEGER NOT NULL, language VARCHAR(255) NOT NULL COLLATE BINARY, reading_speed DOUBLE PRECISION DEFAULT NULL, pocket_consumer_key VARCHAR(255) DEFAULT NULL COLLATE BINARY, action_mark_as_read INTEGER DEFAULT 0, list_mode INTEGER DEFAULT NULL, feed_token VARCHAR(255) DEFAULT NULL, feed_limit INTEGER DEFAULT NULL, CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE)'); | ||
21 | $this->addSql('INSERT INTO ' . $this->getTable('config', true) . ' (id, user_id, theme, items_per_page, language, feed_token, feed_limit, reading_speed, pocket_consumer_key, action_mark_as_read, list_mode) SELECT id, user_id, theme, items_per_page, language, rss_token, rss_limit, reading_speed, pocket_consumer_key, action_mark_as_read, list_mode FROM __temp__' . $this->getTable('config', true)); | ||
22 | $this->addSql('DROP TABLE __temp__' . $this->getTable('config', true)); | ||
23 | $this->addSql('CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON ' . $this->getTable('config', true) . ' (user_id)'); | ||
24 | break; | ||
25 | case 'mysql': | ||
26 | $this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE rss_token feed_token VARCHAR(255) DEFAULT NULL'); | ||
27 | $this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE rss_limit feed_limit INT DEFAULT NULL'); | ||
28 | break; | ||
29 | case 'postgresql': | ||
30 | $this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN rss_token TO feed_token'); | ||
31 | $this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN rss_limit TO feed_limit'); | ||
32 | break; | ||
33 | } | ||
34 | } | ||
35 | |||
36 | public function down(Schema $schema): void | ||
37 | { | ||
38 | switch ($this->connection->getDatabasePlatform()->getName()) { | ||
39 | case 'sqlite': | ||
40 | $this->addSql('DROP INDEX UNIQ_87E64C53A76ED395'); | ||
41 | $this->addSql('CREATE TEMPORARY TABLE __temp__' . $this->getTable('config', true) . ' AS SELECT id, user_id, theme, items_per_page, language, feed_token, feed_limit, reading_speed, pocket_consumer_key, action_mark_as_read, list_mode FROM "' . $this->getTable('config', true) . '"'); | ||
42 | $this->addSql('DROP TABLE "' . $this->getTable('config', true) . '"'); | ||
43 | $this->addSql('CREATE TABLE "' . $this->getTable('config', true) . '" (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, user_id INTEGER DEFAULT NULL, theme VARCHAR(255) NOT NULL, items_per_page INTEGER NOT NULL, language VARCHAR(255) NOT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, pocket_consumer_key VARCHAR(255) DEFAULT NULL, action_mark_as_read INTEGER DEFAULT 0, list_mode INTEGER DEFAULT NULL, rss_token VARCHAR(255) DEFAULT NULL COLLATE BINARY, rss_limit INTEGER DEFAULT NULL)'); | ||
44 | $this->addSql('INSERT INTO "' . $this->getTable('config', true) . '" (id, user_id, theme, items_per_page, language, rss_token, rss_limit, reading_speed, pocket_consumer_key, action_mark_as_read, list_mode) SELECT id, user_id, theme, items_per_page, language, feed_token, feed_limit, reading_speed, pocket_consumer_key, action_mark_as_read, list_mode FROM __temp__' . $this->getTable('config', true)); | ||
45 | $this->addSql('DROP TABLE __temp__' . $this->getTable('config', true)); | ||
46 | $this->addSql('CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON "' . $this->getTable('config', true) . '" (user_id)'); | ||
47 | break; | ||
48 | case 'mysql': | ||
49 | $this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE feed_token rss_token'); | ||
50 | $this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE feed_limit rss_limit'); | ||
51 | break; | ||
52 | case 'postgresql': | ||
53 | $this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN feed_token TO rss_token'); | ||
54 | $this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN feed_limit TO rss_limit'); | ||
55 | break; | ||
56 | } | ||
57 | } | ||
58 | } | ||
diff --git a/app/Resources/static/themes/baggy/css/article.scss b/app/Resources/static/themes/baggy/css/article.scss index 9094ad55..d203ce31 100644 --- a/app/Resources/static/themes/baggy/css/article.scss +++ b/app/Resources/static/themes/baggy/css/article.scss | |||
@@ -85,7 +85,7 @@ blockquote { | |||
85 | color: #999; | 85 | color: #999; |
86 | } | 86 | } |
87 | 87 | ||
88 | .icon-rss { | 88 | .icon-feed { |
89 | background-color: #000; | 89 | background-color: #000; |
90 | color: #fff; | 90 | color: #fff; |
91 | padding: 0.2em 0.5em; | 91 | padding: 0.2em 0.5em; |
@@ -101,8 +101,8 @@ blockquote { | |||
101 | margin-bottom: 0.5em; | 101 | margin-bottom: 0.5em; |
102 | } | 102 | } |
103 | 103 | ||
104 | .icon-rss:hover, | 104 | .icon-feed:hover, |
105 | .icon-rss:focus { | 105 | .icon-feed:focus { |
106 | background-color: #fff; | 106 | background-color: #fff; |
107 | color: #000; | 107 | color: #000; |
108 | text-decoration: none; | 108 | text-decoration: none; |
diff --git a/app/Resources/static/themes/baggy/css/pictos.scss b/app/Resources/static/themes/baggy/css/pictos.scss index 2ff01937..b6ebf311 100644 --- a/app/Resources/static/themes/baggy/css/pictos.scss +++ b/app/Resources/static/themes/baggy/css/pictos.scss | |||
@@ -136,7 +136,7 @@ | |||
136 | content: "\ea3a"; | 136 | content: "\ea3a"; |
137 | } | 137 | } |
138 | 138 | ||
139 | .icon-rss::before { | 139 | .icon-feed::before { |
140 | content: "\e808"; | 140 | content: "\e808"; |
141 | } | 141 | } |
142 | 142 | ||
diff --git a/app/config/routing.yml b/app/config/routing.yml index a7c0f7e9..d4defca0 100644 --- a/app/config/routing.yml +++ b/app/config/routing.yml | |||
@@ -59,3 +59,39 @@ fos_js_routing: | |||
59 | 59 | ||
60 | 2fa_login_check: | 60 | 2fa_login_check: |
61 | path: /2fa_check | 61 | path: /2fa_check |
62 | |||
63 | # redirect RSS feed to Atom | ||
64 | rss_to_atom_unread: | ||
65 | path: /{username}/{token}/unread.xml | ||
66 | defaults: | ||
67 | _controller: FrameworkBundle:Redirect:redirect | ||
68 | route: unread_feed | ||
69 | permanent: true | ||
70 | |||
71 | rss_to_atom_archive: | ||
72 | path: /{username}/{token}/archive.xml | ||
73 | defaults: | ||
74 | _controller: FrameworkBundle:Redirect:redirect | ||
75 | route: archive_feed | ||
76 | permanent: true | ||
77 | |||
78 | rss_to_atom_starred: | ||
79 | path: /{username}/{token}/starred.xml | ||
80 | defaults: | ||
81 | _controller: FrameworkBundle:Redirect:redirect | ||
82 | route: starred_feed | ||
83 | permanent: true | ||
84 | |||
85 | rss_to_atom_all: | ||
86 | path: /{username}/{token}/all.xml | ||
87 | defaults: | ||
88 | _controller: FrameworkBundle:Redirect:redirect | ||
89 | route: all_feed | ||
90 | permanent: true | ||
91 | |||
92 | rss_to_atom_tags: | ||
93 | path: /{username}/{token}/tags/{slug}.xml | ||
94 | defaults: | ||
95 | _controller: FrameworkBundle:Redirect:redirect | ||
96 | route: tag_feed | ||
97 | permanent: true | ||
diff --git a/app/config/security.yml b/app/config/security.yml index 6a21b4e5..760b2550 100644 --- a/app/config/security.yml +++ b/app/config/security.yml | |||
@@ -72,6 +72,8 @@ security: | |||
72 | - { path: /(unread|starred|archive|all).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY } | 72 | - { path: /(unread|starred|archive|all).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY } |
73 | - { path: ^/locale, role: IS_AUTHENTICATED_ANONYMOUSLY } | 73 | - { path: ^/locale, role: IS_AUTHENTICATED_ANONYMOUSLY } |
74 | - { path: /tags/(.*).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY } | 74 | - { path: /tags/(.*).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY } |
75 | - { path: ^/feed, roles: IS_AUTHENTICATED_ANONYMOUSLY } | ||
76 | - { path: /(unread|starred|archive).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY } # For backwards compatibility | ||
75 | - { path: ^/share, roles: IS_AUTHENTICATED_ANONYMOUSLY } | 77 | - { path: ^/share, roles: IS_AUTHENTICATED_ANONYMOUSLY } |
76 | - { path: ^/settings, roles: ROLE_SUPER_ADMIN } | 78 | - { path: ^/settings, roles: ROLE_SUPER_ADMIN } |
77 | - { path: ^/annotations, roles: ROLE_USER } | 79 | - { path: ^/annotations, roles: ROLE_USER } |