Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customization improvements (name, tagline, logo, favicon) #639

Open
ghost opened this issue Jun 14, 2020 · 10 comments
Open

Customization improvements (name, tagline, logo, favicon) #639

ghost opened this issue Jun 14, 2020 · 10 comments

Comments

@ghost
Copy link

ghost commented Jun 14, 2020

Hi

I have a few small suggestions for improving user customization. One small issue to address, plus a few additional suggestions.

Problem:

If you edit the name configuration setting, it changes the software description too

MyCustomPastebin - because ignorance is bliss

MyCustomPastebin is a minimalist, open source online pastebin where the server has zero knowledge of pasted data. Data is encrypted/decrypted in the browser using 256 bits AES. More information on the project page.

In my opinion, it should not be modifying the description of the software with a new name unless it's a completely different product/fork.

Solution:

Include a "powered-by" style footer message when a custom name is configured.

If modified:

MyCustomPastebin - Powered by PrivateBin
PrivateBin is a minimalist, open source online pastebin where the server has zero knowledge of pasted data. Data is encrypted/decrypted in the browser using 256 bits AES.

If not modified:

PrivateBin is a minimalist, open source online pastebin where the server has zero knowledge of pasted data. Data is encrypted/decrypted in the browser using 256 bits AES.

Suggestion/wishlist:
New configuration options:

  • tagline = "because taglines should be editable" (hide hyphen between tagline and name if empty)
  • customFavicon = true - reads from /userstyles/favicon/<favicon files>
  • customLogo = mylogo.svg - reads from /userstyles/mylogo.svg
  • Automatically read custom language file edits from /userstyles/i18n/*.json and append to the defaults
  • (maybe) customCss = true - reads from /userstyles/user.css, which could be used to override default CSS classes by simply reading the user.css class last
  • (maybe) footer = false to disable the footer entirely

Maybe not set up exactly like that, but you get the idea.

Currently, the above changes require modifications to the PHP source, which need to be manually edited again after each software update. Changing via the config file and reading custom files from an optional folder would make software updates easier to manage and allow for greater user customization.

@rugk
Copy link
Member

rugk commented Jun 14, 2020

If you edit the name configuration setting, it changes the software description too

Agree, sounds like a bug.

Include a "powered-by" style footer message when a custom name is configured.

Good idea.

Suggestion/wishlist:

Yeah, as long as these are easy to implement, I agree and tend to say these are all useful.
So we'd totally appreciate PR's here. 😃

Changing via the config file and reading custom files from an optional folder would make software updates easier to manage and allow for greater user customization.

I agree. I mean technically we have great customizability – the greatest you can have with editing the PHP template –, but your arguments regarding easier upgrades are totally valid.
Maybe it also helps that admins don't get "stuck" on old versions, because they've customized something or so…

But we don't really know why people don't upgrade from v1.2 e.g.. 🤔

@ghost
Copy link
Author

ghost commented Jun 15, 2020

Maybe I will give it a whirl if I get some time. I haven't touched PHP in over a decade. I don't think it would be too much work. They pretty much all amount to "if set, use custom, if unset, use default".

The custom CSS styling would just be the last CSS file loaded, so it would override any same-named classes automatically. This is how Stylish handles theming, as does protonmail.

It's very simple to make themes using browser's inspector tool this way, and keeps all the theme files detached from the source code.

Thanks for the feedback 👍

@elrido
Copy link
Contributor

elrido commented Jun 16, 2020

Just a short addendum:

If you edit the name configuration setting, it changes the software description too

Agree, sounds like a bug.

This is implemented deliberately in that way, as the intent is for the software name to be replaced in all instances. If you only want a different logo, but keep a "powered by" message with the software name, a custom template would be the currently recommended way to go. Since these rarely change, they should not be a hassle for ugrades, if customized.

But I'm not opposed to splitting the message at all or allowing configurable custom logos and favicons sets. Since we require the GD library for the user icons in the discussions, we might take a single logo and generate the different favicon flavours, if not present on disk, to make it simpler for the admins.

@ZerooCool
Copy link
Contributor

+1 : Problem:
If you edit the name configuration setting, it changes the software description too

I have open the same, today :
#641

@AnonymousWP
Copy link
Contributor

Is there any update on this? E.g. using your own favicon and/or logo within your own PrivateBin instance?

@elrido
Copy link
Contributor

elrido commented Dec 16, 2022

Yes, you can: create a copy of one of the templates and tweak the things you'd like to change, like the logo, favicon, etc.

@AnonymousWP
Copy link
Contributor

Yes, you can: create a copy of one of the templates and tweak the things you'd like to change, like the logo, favicon, etc.

Thanks, I have looked into this, but I can only find something about icons (which seems to be about icons of users, not logos). Also, it's not really clear how to configure it, let alone when using it in combination with Docker (Compose).

@elrido
Copy link
Contributor

elrido commented Dec 17, 2022

You would bind mount both the custom template and config file into the appropriate locations in the image. For example:

docker run -d --restart="always" --read-only -p 8080:8080 -v $PWD/myawesometemplate.php:/srv/tpl/myawesometemplate.php:ro -v $PWD/conf.php:/srv/cfg/conf.php:ro -v $PWD/privatebin-data:/srv/data privatebin/nginx-fpm-alpine

This would add your new template file myawesometemplate.php and your custom config.php. The minimal configuration to enable this would be:

;<?php http_response_code(403); /*
[main]
template = "myawesometemplate"
[model]
[model_options]

In your custom template file you could then replace all the img-tags source addresses to point to your own images, etc. Note that our docker image will cache the php code on first use and will need to be restarted when you update the template file, in order to flush the php opcache.

@Brawl345
Copy link

Brawl345 commented May 5, 2024

Wanted to bump this if this can be considered for a future release? Mainly using custom icons, logos and favicons. Currently I copy some icons manually and override the built-in ones. I've also used a custom template over the years but it's very annoying to maintain :/

@rugk
Copy link
Member

rugk commented May 8, 2024

Okay, seems like there is some demand for that. I've created a discussion/poll on https://github.com/orgs/PrivateBin/discussions/1321 where you can vote for if, and if so, what should be customizable. (And yeah, unfortunately AFAIK GitHub does not support multiple answers/multi-choice answers, unfortunately yet.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants