Giter VIP home page Giter VIP logo

cc.engine's Introduction

cc.engine


🛑 As of 2023-09-27, this project was deprecated by the new CC Legal Tools (cc-legal-tools-app, cc-legal-tools-data) and Chooser.


Date: $LastChangedDate: 2006-11-21 11:23:54 -0500 (Tue, 21 Nov 2006) $
Version: $LastChangedRevision: 4737 $
Author: Nathan R. Yergler <[email protected]>
Organization: Creative Commons
Copyright: 2007, Nathan R. Yergler, Creative Commons; licensed to the public under the Expat/MIT License.

cc.engine provides the Creative Commons license engine along with a set of related scripts. The scripts can be used for generating static versions of the license deeds.

WARNING

Much of the documentation associated with this project is no longer accurate!

Installation

NOTE: Unless you are installing this in Development Mode, you will need to run sudo ./bin/buildout (with root privileges), because the script needs to create directories in /etc and /var.

cc.engine uses zc.buildout to assemble the software and its dependencies. For example

$ python bootstrap/bootstrap.py
$ ./bin/buildout

After the buildout process completes the application may be started using the generated init script

# /etc/init.d/cc_engine-run-cc_engine start

You can prevent the service from detaching from the console as a daemon with the fg argument (instead of ``start'')

# /etc/init.d/cc_engine-run-cc_engine fg

If you get a UnicodeDecodeError from the cc.engine (you'll see this if it's running in the foreground) when you try to access the http://host:9080/license/ then it's likely that the install of python you are using is set to use ASCII as it's default output. You can change this to UTF-8 by creating the file /usr/lib/python<version>/sitecustomize.py and adding these lines:

import sys sys.setdefaultencoding("utf-8")

Development Mode

If you are working on developing cc.engine, a special buildout configuration is provided. This configuration differs from the default in the following ways:

  • Zope is configured to run in devmode.
  • A XXX report is generated at time of buildout.

You can build cc.engine for development by specifying the buildout configuration on the command line

$ ./bin/buildout -c dev.buildout.cfg

Building lxml + Dependencies

cc.engine relies of lxml, which is a Python wrapper for libxml2 and libxslt1. If you system has older versions of these libraries installed, cc.engine may fail with Unknown symbol errors. A specialized buildout configuration is provided to download and build a local version of libxml2, libxslt1 and lxml if needed. To use this, specify the configuration on the command line

$ ./bin/buildout -c lxml.buildout.cfg

Note that this builds in production mode.

Dependencies

Debian

Python

Additional Documentation

cc.engine's People

Contributors

abbas-000 avatar altrugon avatar christopheradams avatar cwebber avatar dale42 avatar doigoid avatar enyst avatar ewilfong avatar fmann avatar hugosolar avatar kgodey avatar mattl avatar mzeinstra avatar nyergler avatar peterdavehello avatar timidrobot avatar vthunder avatar yashs911 avatar zackkrida avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cc.engine's Issues

Broken link on BY-NC license page

Email from user:

The website
https://creativecommons.org/licenses/by-nc/4.0/
has a semi-broken FAQ link when clicking on "commercial use" and then
"more info".

The wrong link only leads to the FAQ overview because the link anchor
(#...) is wrong:
https://creativecommons.org/faq/#Does_my_use_violate_the_NonCommercial_clause_of_the_licenses.3F

Corrected version that directly points to the right FAQ question:
https://creativecommons.org/faq/#does-my-use-violate-the-noncommercial-clause-of-the-licenses

Issue with webpage for license chooser tool (legacy tool)

There's something amiss with the page the page that includes the tool for choosing a license (https://creativecommons.org/choose/). When I select the option to enter metadata, the page gets all goofed up. This happens in both Firefox and in Chrome. Screenshots included here. The first is a screenshot in Firefox, the second is a screenshot in Chrome. I’m using a Mac running Catalina version 10.15.7. Thanks! -Maran
Firefox - Screen Shot 2020-10-26 at 7 14 36 AM
Chrome - Screen Shot 2020-10-26 at 7 15 28 AM

XMP: invalid xml:lang content

tl;dr: Chooser outputs XMP containing xml:lang='en_US' which is wrong.
xml:lang='en-US' is correct.

Reproduce

(Have a browser request the page with accept-language:en-US,en;q=0.8 or similar) and GET: https://creativecommons.org/choose/metadata.xmp?field_commercial=y&field_derivatives=y&field_worktitle=ISSUE&field_attribute_to_name=-1&field_attribute_to_url=https://creativecommons.org/choose/

or with curl:
curl 'https://creativecommons.org/choose/metadata.xmp?field_commercial=y&field_derivatives=y&field_worktitle=ISSUE&field_attribute_to_name=-1&field_attribute_to_url=https://creativecommons.org/choose/' -H 'accept-language: en-US,en;q=0.8' 'https://creativecommons.org/choose/'

Enter RDF-parts (everything from <rdf:RDF to </rdf:RDF>) into W3C validator to receive:
Error: {W115} Primary subtag must be between 1 and 8 alpha characters: en_US[Line = 13, Column = 39]

Fix

I guess the problem is in https://github.com/creativecommons/creativecommons.org/blob/master/python_env/src/cc.engine/cc/engine/util.py#L542
as gettext might expect a language id format other than BCP47

Quick and Easy fix

add:
target_lang.replace('_','-') after this line https://github.com/creativecommons/creativecommons.org/blob/master/python_env/src/cc.engine/cc/engine/chooser/views.py#L575

Template says to include @robmyers and @little-wow ?

Multiple jQuery versions and locations?

Describe the bug

We are currently using 2 different versions of jQuery spread across 3 different hosting providers:

  1. 1.10.2
  2. 1.12.4

We should also update jQuery-Migrate to use the same CDN:

  1. https://creativecommons.org/wordpress/wp-includes/js/jquery/jquery-migrate.js?ver=1.4.0
    • (The URL query string says 1.4.0, but the file says 1.4.1)
    • See source file cc/engine/templates/macros_templates/engine.html:Line 50

To Reproduce

  1. Load https://creativecommons.org/licenses/
  2. View source
  3. Search for jquery

Expected behavior

Structured metadata in the deed pages wrongly describe the CC-BY license alone

Problem

The RDFa about attribute in the deed.html template contains the hardcoded value http://creativecommons.org/licenses/by/4.0/:
https://github.com/creativecommons/cc.engine/blob/d0b93aea9920f070509569667574a6928b782241/cc/engine/templates/macros_templates/deed.html#L48

Consequence

The consequence is that the structured metadata for each license asserts those statements about <http://creativecommons.org/licenses/by/4.0/>, regardless of which actual license page is served. Thus, these statements are mostly wrong.

Solution

All that should be needed is to use {{ license.uri }} in that place instead.

Context

At the National Library of Sweden we are consuming more and more linked data automatically. We would like to link to the CC licenses in our union catalogue, and to support that we need to show their metadata (identifiers, titles etc.) in our editing and presentation interfaces. Our system can cache copies of linked metadata verbatim, but due to this issue, right now we have to tweak this on our side. We would like assist to resolve this issue if possible.

Make repository contribution friendly.

See: https://wikijs.creativecommons.org/tech/github-repo-guidelines

Broken link in Italian chooser

Reported via email:

I have found two typos in the html produced by your Italian "Choose a license" page, here:
https://creativecommons.org/choose/?lang=it

Both typos show up when one uses the optional metadata part, here:
https://creativecommons.org/choose/?lang=it#metadata

typo 1:
there is a missing space just before the html span element having property="cc:attributionName".
It is produced like this:
di
and it ought to be like this:
di
that is, there is a space missing between "di" and "<span".

typo 2:
the html text related to "Source work URL"/"URL dell'opera originaria" is not translated.
When one fills in the field, the html produced is like this:

Based on a work at
and it ought to be like this:

Basato su un’opera presso

CC 3.0 Armenian port Deed URLs 404

Description

CC 3.0 Armenian port Deed URLs 404. Since we have legalcode for these licenses, we must also have the Deeds. The missing deeds are probably the result of CC 3.0 Armenian port RDF files are missing · Issue #15.

Reproduction

404 Deed:

Expectation

CC 3.0 Armenian port Deed URLs 404. Since we have legalcode for these licenses, we must also have the Deeds. The missing deeds are probably the result of CC 3.0 Armenian port RDF files are missing · Issue #15.

Additional context

200 Legalcode:

XSS Vulnerability in CC0 Waiver form and possibly elsewhere [SECURITY]

Thanks for reporting an issue, to help us file this efficiently we made this template. Feel free to ignore the template if you wish :)

If this is a bug or a problem with one of our websites or page on one of our sites, please put the URL or page address here:

https://creativecommons.org/choose/zero/waiver

Please tell us the steps to reproduce the problem, if needed:

  1. Go to the URL https://creativecommons.org/choose/zero/waiver.
  2. Enter a name with HTML in it. You can test with the text "dummy <strike>".
  3. Enter dummy title, tick the checkboxes, and press continue.
  4. Press the "Yes, I waive" button.
  5. (!) All the text after the name in the displayed HTML is striked through. The HTML you entered is placed directly in the URL bar and rendered on the page! ANY ATTACKER CAN PUT ANY HTML AND JAVASCRIPT THERE THEY WANT!

This vulnerability is called XSS, and it is pretty serious! Wikipedia link.

If the attacker can insert a script tag, which they can - Chrome will block naive script tags, but it's probably possible to get around and lots of people don't use Chrome - then the attacker can insert any malicious code they want in the page, control everything in the page, and send a link to the page with this malicious code added to anyone they want.

Many sites, such as GitHub, allow a limited subset of HTML in certain places, like this issue box. This vulnerability is neither a limited subset - AFAICT all HTML is allowed and not controlled - nor the kind of place you'd want to allow HTML - the "Name" field. It's likely that many other places in the site are also open to XSS.

This is a screenshot of how the page looks when I did what I described above in the steps to reproduce:
capture
As you can see, it doesn't look like it should.

Please tell us a little bit about how you're accessing the site or page, such as which web browser and which version of the browser:
Google Chrome
Version 71.0.3578.98 (Official Build) (64-bit)

(You can also vist https://aboutmybrowser.com/ which will give you a link you can share with us that'll tell us everything we need to know)

You can also attach a screenshot to this issue if you have a visual bug to report. That'll help us figure it out faster. http://www.take-a-screenshot.org/ has instructions on taking screenshots.

Finally, we're going to put someone's name here, so they get alerted to the new issue and can assign it to the right person. @robmyers @little-wow

Te Reo Māori deeds are not linked from the language drop down list

Email from user:

An official translation of the licence deeds and legal codes has been made into Te Reo Māori and these are live, but for the deeds they're not linked from the language drop-down on the other language pages.

Eg:
English https://creativecommons.org/licenses/by/4.0/deed.en has no link to
Māori https://creativecommons.org/licenses/by/4.0/deed.mi

The legal code links seem to be in place eg
English https://creativecommons.org/licenses/by-nc/4.0/legalcode.en does correctly link to
te reo Māori https://creativecommons.org/licenses/by-nc/4.0/legalcode.mi

Hopefully this is an easy fix. May be worth checking the full list at the same time though just in case another language has slipped through the cracks :-)
An official translation of the licence deeds and legal codes has been made into Te Reo Māori and these are live, but for the deeds they're not linked from the language drop-down on the other language pages.

Eg:
English https://creativecommons.org/licenses/by/4.0/deed.en has no link to
Māori https://creativecommons.org/licenses/by/4.0/deed.mi

The legal code links seem to be in place eg
English https://creativecommons.org/licenses/by-nc/4.0/legalcode.en does correctly link to
te reo Māori https://creativecommons.org/licenses/by-nc/4.0/legalcode.mi

Hopefully this is an easy fix. May be worth checking the full list at the same time though just in case another language has slipped through the cracks :-)

no differentiation between ports and translations in license URLs

Description

The ccEngine needs to serve both ports (based on jurisdiction) and translations (based on language). However, it treats both essentially the same.

Reproduction

Based on the existence of creativecommons/creativecommons.org:docroot/legalcode/by-nc-nd_3.0_am.html, both of the following legalcode URLs are served by ccEngine:

Expectation

Ports and Translations should not be interchangeable in the URL.

Additional context

French: "Donate Now" (Faites un don Maintenant) label overflows button

The orange donation box at the bottom left of pages (such as https://creativecommons.org/licenses/by/4.0/deed.fr ) has a label ("Faites un don Maintenant") excessively long for its button in French. The last letters are invisible, as can be seen in the following screenshot:
CC don

Multiple solutions are possible:

  1. Shorten the text. Strangely, the same text is translated at the top to a different French version, "Faire un don Maintenant". That version has the advantage of being shorter, and it is a (more) accurate translation of the English version. However, it remains incorrect ("m" should be lowercase) and too long. A very simple fix would be "Donner maintenant", however "Now" seems superfluous so this could be just "Donner".
  2. Reduce the font size
  3. Remove this box. As there is already a big donation button at the top of all pages as well as a very prominent form on the homepage, this amateur-looking box seems superfluous.

Links from CC0 and BY* 4.0 Deeds to Legalcode do not maintain language selection

Describe the bug

Links from CC0 and BY* 4.0 Deeds to Legalcode do not maintain language selection.

ccEngine does not appear to have any knowledge of what CC0 and BY* 4.0 legalcode translations are available.

This issue was first identified and described by @mzeinstra (Thank you!)

To Reproduce

Expected behavior

Users who have selected/visited a translated deed should be taken to the legalcode in the same language, if it is available.

Translation Team Guidance

Until further notice, do not include the language suffix for legalcode links in the following message strings.

It is better to degrade the user experience (link to English from 4.0 deeds) than to completely break the user experience (invalid/HTTP/1.1 404 Not Found links from 2.x and 3.0 deeds)

Assuming Polish:

msgid ""
"This is a human-readable summary of the <a href=\"./legalcode\">Legal Code "
"(read the full text)</a>."
msgid ""
"This is a human-readable summary of (and not a substitute for) the <a "
"href=\"legalcode\" class=\"fulltext\">license</a>."

Related Issues

The following issues were superseded by this issue and were closed:

Issues Relating to pre-4.0 Legalcode Links in Deeds

The following issues were either fixed according to the Translation Team Guidance, above, and were closed:

‼️ 23 Language translations were updated to mitigate the issues relating to pre-4.0 Legalcode links in Deeds!

Solution Related

Add meta tags to License Chooser homepage

Description

A Google search for cc license chooser points to https://creativecommons.org/choose/, but the subtitle of the search results exposes the HTML code of the page. Discussions on Slack has pointed to lack of description meta tags as the culprit.

Reproduction

  1. Google cc license chooser or follow this

Expectation

The subtitle for the first page(Home page) and a few others shouldn't have HTML code.

Screenshots

annotation_2020-07-03_210702

Additional context

Slack conversation

Removing This

But think about how to share website resoures again.

[svn-resources]
recipe = infrae.subversion
urls = 
    http://code.creativecommons.org/svnroot/ccwordpress/trunk/www/wp-content/themes/cc3 cc3
    http://code.creativecommons.org/svnroot/ccwordpress/trunk/www/wp-content/themes/cc3 cc3
    http://code.creativecommons.org/svnroot/ccwordpress/trunk/www/wp-content/themes/cc4 cc4
    http://code.creativecommons.org/svnroot/ccwordpress/trunk/www/wp-content/themes/cc5 cc5
    http://code.creativecommons.org/svnroot/ccwordpress/trunk/www/wp-content/themes/cc6 cc6
    http://code.creativecommons.org/svnroot/themes/creativecommons.org/trunk cctheme
    http://code.creativecommons.org/svnroot/ccwordpress/trunk/www/images images
    http://code.creativecommons.org/svnroot/ccwordpress/trunk/www/includes includes
location = cc/engine/resources

edit to the About the Licenses page

To resolve some confusion within the CC Certificate course, we need to make a small edit to this page. It has been signed off by @peterspdx.

The change is to the 1-sentence description of the Attribution-NoDerivs license, about 2/3 of the way down the page.

Currently it says: "This license allows for redistribution, commercial and non-commercial, as long as it is passed along unchanged and in whole, with credit to you."

Please change it to read: This license lets others reuse the work for any purpose, including commercially; however, it cannot be shared with others in adapted form, and credit must be provided to you.

Thank you!

CC0 deed template differs, leaving phrase untranslated

Describe the bug

None of the CC0 translations have the following translated:

Learn more about CC licensing, or use the license for your own material.

Examples

As of 2019-11-26:

Translation Details

  • Key:
    <a href="http://wiki.creativecommons.org/FAQ">Learn more</a> about CC licensing, or <a id="get_this" href="%(get_this)s">use the license</a> for your own material.
  • String in cc/engine/templates/macros_templates/deed.html accurately represents the Translation key and is translated, as expected:
    <a href="http://wiki.creativecommons.org/FAQ">Learn more</a> about CC licensing, or <a id="get_this" href="{{ get_this }}">use the license</a> for your own material.
  • String in cc/engine/templates/licenses/zero_deed.html differs from the Translation key and is not translated:
    <a href="http://wiki.creativecommons.org/FAQ">Learn more</a> about CC licensing, or <a id="get_this" href="https://creativecommons.org/choose/zero/">use the license</a> for your own material.

lang cookie is broken/useless

Description

lang cookie is broken/useless

Reproduction

Load a ccEngine URL (ex. https://creativecommons.org/licenses/by/4.0/) and observe cookies. The lang cookie value is always %25s.

The issue lies in cc/engine/templates/includes/language_javascript.html. It appears it was written to use string formatting (ex. Node.js' util.format()), but isn't. Additionally the value %s is being URL encoded to %25s.

Expectation

If the cookie provides value, it should be set with a correct value. However, there is no indication to me that the cookie provides any value. I didn't find any support for cookies in the ccEngine python code.

Screenshots

Screen Shot 2020-06-16 at 06 44 25

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.