Theming #624
无评审员
标签
未选择标签
A: API
A: Backend
A: Federation
A: Front-End
A: I18N
A: Meta
A: Security
Build
C: Bug
C: Discussion
C: Enhancement
C: Feature
Compatibility
Dependency
Design
Documentation
Good first issue
Help welcome
Mobile
Rendering
S: Blocked
S: Duplicate
S: Incomplete
S: Instance specific
S: Invalid
S: Needs Voting/Discussion
S: Ready for review
Suggestion
S: Voted on Loomio
S: Wontfix
暂无项目
未指派成员
2 位参与者
通知
到期时间
未设置到期时间。
依赖工单
没有设置依赖项。
引用:Plume/Plume#624
正在加载…
添加表格
在新工单中引用
没有提供说明。
删除分支 "themes"
删除分支是永久的。虽然已删除的分支在实际被删除前有可能会短时间存在,但这在大多数情况下无法撤销。是否继续?
Instance level themes are just CSS files, stored in
static/css
(seeInstance::list_themes
).TODO:
Fixes #354, #403
Codecov Report
❓
@ -0,0 +1,4 @@
-- Your SQL goes here
ALTER TABLE blogs ADD COLUMN theme VARCHAR;
ALTER TABLE users ADD COLUMN preferred_theme VARCHAR;
this should be a cookie setting
I really hope this is a cookie setting.
@ -0,0 +1,4 @@
-- Your SQL goes here
ALTER TABLE blogs ADD COLUMN theme VARCHAR;
ALTER TABLE users ADD COLUMN preferred_theme VARCHAR;
Why should it be a cookie setting? Storing it in the database as the advantage of having it synced across devices (and also it will never expire).
@ -0,0 +1,4 @@
-- Your SQL goes here
ALTER TABLE blogs ADD COLUMN theme VARCHAR;
ALTER TABLE users ADD COLUMN preferred_theme VARCHAR;
you'd have to sync it to the cookie, but that way it'd be easier & quicker to access.
@ -0,0 +1,4 @@
-- Your SQL goes here
ALTER TABLE blogs ADD COLUMN theme VARCHAR;
ALTER TABLE users ADD COLUMN preferred_theme VARCHAR;
The whole user struct is already loaded for every page anyway, I'm not sure it is going to make a real difference 🤷♀️
is it still ready for review considering the design flaw pointed regarding arbitrary css security?
No, I'm implementing another approach, I think I will be able to push it this evening.
If you want to review this PR, the new version is there. Admins should now approve remote blog themes, but they may contain anything. Once a theme is approved, it is also available for use on this instance. Admins can also upload themes if they have SSH acces to their instance: they just need to create a folder called "blog-SOMETHING" in
static/css
, and add the theme files inside.I will update the docs too.
Does it really make sense to have admins approve remote blog themes? Using remote resources on the local site seems fragile and prone to many more errors in the future. I think it makes more sense to limit themes to site-wide and local-user.
More generally, this is an issue that has to do with the way articles federate in Plume -- the HTML is delivered and cached to many different sites that may have varying CSS. Federating CSS as well is, I think, out-of-scope of ActivityPub (although there is nothing preventing this). In any case, it is much simpler to say that users should view the original URL if they wish to read the article with the original CSS.
I'm not sure this is an actual concern but how does it play with caching? Where are the file stored and are they given a unique name (hash based?)?
The themes are stored in
static/css
so they should integrate with the current caching system I think?I think they are cached, but not evicted when modified, so client might think the file was not updated when it was. Adding a timestamp, a hash, a random string or anything to the name (
myfile-DEADBEEF1312.css
) would fix itI think it is going to be quite difficult, because in the current implementation, the main theme file should be named
theme.css
, and it may load other files of the theme, so we would have to find a way to detect the main theme file even if it has a hash in its name, and to edit allurl()
/@import
inside of it to make sure other files are correctly loaded too… Maybe we can just set a default cache duration of one week or something like that, with a HTTP header? Or is it a problem not to have the latest theme update for a few days?Even 7 days is quiet long and will definitely be reported as a bug at some point. I'm at work currently, maybe we can discuss of it later on riot?
OK, feel free to ping me when you want to talk about it :)
👀
????
@ -0,0 +83,4 @@
last_fetched_date,
fqn,
summary_html
FROM users;
sqlite migration mi amor
in case of error, return empty
Vec
? I think returning aResult<...>
would make more sens, to have a proper error in case of.. errorSame goes
so this whole function was useless? Some other must be too then
Yes, I would like to do a big code cleanup one day, removing all
pub
, progressively reintroducing them until it compiles, and remove everything that Rust says is unused.lgtm