WordPress.org

Making WordPress.org

Opened 4 months ago

Last modified 4 months ago

#4524 assigned task

Gitlab support for remote css

Reported by: tippl Owned by:
Milestone: Priority: normal
Component: WordCamp Site & Plugins Keywords: needs-patch good-first-bug
Cc:

Description

Hi,
I am creating our WordCamp website for Düsseldorf/Germany right now. For this I use the remote css feature.

When I tried to add the style.css I learned that only a Github link is accepted. I would like to use Gitlab instead of Github. What is the reason for this limitation?

Best
Manja

Change History (3)

#1 @vdwijngaert
4 months ago

Hey Manja,

You are working locally, right? You can use the "wcrcss_trusted_remote_hostnames" filter to add gitlab.com to the list. This might get you started while waiting for this ticket to be resolved.

<?php
add_filter( 'wcrcss_trusted_remote_hostnames', function( $trusted_hostnames ) {
  $trusted_hostnames[] = 'gitlab.com';
  return $trusted_hostnames;
} );

Best of luck with your WordCamp!

Edit: I think it's partly because there has never been a need for another platform. I found this gitlab.php.

<?php
/*
 * @todo -- Once another platform has been added and you can see the similarities, this should probably be
 * refactored to extend an abstract class or implement an interface.
 */

https://meta.trac.wordpress.org/browser/sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-remote-css/platforms/github.php#L9

I'd be willing to take this up if meta team thinks it's a good idea. Thoughts?

Last edited 4 months ago by vdwijngaert (previous) (diff)

#2 @iandunn
4 months ago

  • Keywords good-first-bug added
  • Status changed from new to assigned

Remote CSS uses a safelist approach for security reasons, but it'd be great to add more popular platforms, and GitLab would be perfect.

The only reason we haven't already is just that there's always more work to do than people to do it, but if anyone wants to contribute a patch that'd be great. You could look at github.php as an example.

It'd be good to update the contextual help docs as well.

This ticket was mentioned in Slack in #meta by tellyworth. View the logs.


4 months ago

Note: See TracTickets for help on using tickets.