Просмотр исходного кода

Copyvios NG: Move legacy code to a subdirectory

copyvios-ng
Ben Kurtovic 10 месяцев назад
Родитель
Сommit
b896b5343c
34 измененных файлов: 20 добавлений и 63 удалений
  1. +1
    -9
      .gitignore
  2. +5
    -5
      LICENSE
  3. +5
    -49
      README.md
  4. +9
    -0
      legacy/.gitignore
  5. +0
    -0
      legacy/app.py
  6. +0
    -0
      legacy/build.py
  7. +0
    -0
      legacy/copyvios/__init__.py
  8. +0
    -0
      legacy/copyvios/api.py
  9. +0
    -0
      legacy/copyvios/attribution.py
  10. +0
    -0
      legacy/copyvios/background.py
  11. +0
    -0
      legacy/copyvios/checker.py
  12. +0
    -0
      legacy/copyvios/cookies.py
  13. +0
    -0
      legacy/copyvios/highlighter.py
  14. +0
    -0
      legacy/copyvios/misc.py
  15. +0
    -0
      legacy/copyvios/settings.py
  16. +0
    -0
      legacy/copyvios/sites.py
  17. +0
    -0
      legacy/copyvios/turnitin.py
  18. +0
    -0
      legacy/logs/.gitinclude
  19. +0
    -0
      legacy/schema.sql
  20. +0
    -0
      legacy/scripts/log_analyzer.py
  21. +0
    -0
      legacy/static/api.css
  22. +0
    -0
      legacy/static/api.min.css
  23. +0
    -0
      legacy/static/background.png
  24. +0
    -0
      legacy/static/script.js
  25. +0
    -0
      legacy/static/script.min.js
  26. +0
    -0
      legacy/static/style.css
  27. +0
    -0
      legacy/static/style.min.css
  28. +0
    -0
      legacy/static/toolinfo.json
  29. +0
    -0
      legacy/templates/api.mako
  30. +0
    -0
      legacy/templates/error.mako
  31. +0
    -0
      legacy/templates/index.mako
  32. +0
    -0
      legacy/templates/settings.mako
  33. +0
    -0
      legacy/templates/support/footer.mako
  34. +0
    -0
      legacy/templates/support/header.mako

+ 1
- 9
.gitignore Просмотреть файл

@@ -1,9 +1 @@
*.pyc
*.egg
*.egg-info
.DS_Store
__pycache__

.earwigbot
logs/*
!logs/.gitinclude
/target

+ 5
- 5
LICENSE Просмотреть файл

@@ -1,11 +1,11 @@
Copyright (c) 2009-2021 Ben Kurtovic <ben.kurtovic@gmail.com>
Copyright (c) 2009-2023 Ben Kurtovic <ben@benkurtovic.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.


+ 5
- 49
README.md Просмотреть файл

@@ -1,50 +1,6 @@
This is a [copyright violation](https://en.wikipedia.org/wiki/WP:COPYVIO)
detector running on [Wikimedia Cloud Services](https://copyvios.toolforge.org/).

It can search the web for content similar to a given article, and graphically
compare an article to a specific URL. Some technical details are expanded upon
[in a blog post](https://benkurtovic.com/2014/08/20/copyvio-detector.html).

Dependencies
============

* [earwigbot](https://github.com/earwig/earwigbot) >= 0.1
* [flask](https://flask.palletsprojects.com/) >= 0.10.1
* [flask-mako](https://pythonhosted.org/Flask-Mako/) >= 0.3
* [mako](https://www.makotemplates.org/) >= 0.7.2
* [mwparserfromhell](https://github.com/earwig/mwparserfromhell) >= 0.3
* [oursql](https://pythonhosted.org/oursql/) >= 0.9.3.1
* [requests](https://requests.readthedocs.io/) >= 2.9.1
* [SQLAlchemy](https://www.sqlalchemy.org/) >= 0.9.6
* [apsw](https://github.com/rogerbinns/apsw) >= 3.26.0
* [uglifyjs](https://github.com/mishoo/UglifyJS) >= 3.12.6
* [cssnano](https://github.com/cssnano/cssnano) >= 4.1.10
* [postcss-cli](https://github.com/postcss/postcss-cli) >= 8.3.1

Running
=======

- If using Toolforge, you should clone the repository to `~/www/python/src`, or
otherwise symlink it to that directory. A
[virtualenv](https://virtualenv.pypa.io/) should be created at
`~/www/python/venv`.

- Install all dependencies listed above.

- Create an SQL database with the `cache` and `cache_data` tables defined by
[earwigbot-plugins](https://github.com/earwig/earwigbot-plugins/blob/develop/tasks/schema/afc_copyvios.sql).

- Create an earwigbot instance in `.earwigbot` (run `earwigbot .earwigbot`). In
`.earwigbot/config.yml`, fill out the connection info for the database by
adding the following to the `wiki` section:

_copyviosSQL:
host: <hostname of database server>
db: <name of database>

If additional arguments are needed by `oursql.connect()`, like usernames or
passwords, they should be added to the `_copyviosSQL` section.

- Run `./build.py` to minify JS and CSS files.

- Start the web server (on Toolforge, `webservice uwsgi-python start`).
detector for Wikipedia articles, running on
[Wikimedia Cloud Services](https://en.wikipedia.org/wiki/Wikipedia:Wikimedia_Cloud_Services)
at [copyvios.toolforge.org](https://copyvios.toolforge.org/). It can search
the web for content similar to a given article, and graphically compare
an article to a specific URL.

+ 9
- 0
legacy/.gitignore Просмотреть файл

@@ -0,0 +1,9 @@
*.pyc
*.egg
*.egg-info
.DS_Store
__pycache__

.earwigbot
logs/*
!logs/.gitinclude

app.py → legacy/app.py Просмотреть файл


build.py → legacy/build.py Просмотреть файл


copyvios/__init__.py → legacy/copyvios/__init__.py Просмотреть файл


copyvios/api.py → legacy/copyvios/api.py Просмотреть файл


copyvios/attribution.py → legacy/copyvios/attribution.py Просмотреть файл


copyvios/background.py → legacy/copyvios/background.py Просмотреть файл


copyvios/checker.py → legacy/copyvios/checker.py Просмотреть файл


copyvios/cookies.py → legacy/copyvios/cookies.py Просмотреть файл


copyvios/highlighter.py → legacy/copyvios/highlighter.py Просмотреть файл


copyvios/misc.py → legacy/copyvios/misc.py Просмотреть файл


copyvios/settings.py → legacy/copyvios/settings.py Просмотреть файл


copyvios/sites.py → legacy/copyvios/sites.py Просмотреть файл


copyvios/turnitin.py → legacy/copyvios/turnitin.py Просмотреть файл


logs/.gitinclude → legacy/logs/.gitinclude Просмотреть файл


schema.sql → legacy/schema.sql Просмотреть файл


scripts/log_analyzer.py → legacy/scripts/log_analyzer.py Просмотреть файл


static/api.css → legacy/static/api.css Просмотреть файл


static/api.min.css → legacy/static/api.min.css Просмотреть файл


static/background.png → legacy/static/background.png Просмотреть файл


static/script.js → legacy/static/script.js Просмотреть файл


static/script.min.js → legacy/static/script.min.js Просмотреть файл


static/style.css → legacy/static/style.css Просмотреть файл


static/style.min.css → legacy/static/style.min.css Просмотреть файл


static/toolinfo.json → legacy/static/toolinfo.json Просмотреть файл


templates/api.mako → legacy/templates/api.mako Просмотреть файл


templates/error.mako → legacy/templates/error.mako Просмотреть файл


templates/index.mako → legacy/templates/index.mako Просмотреть файл


templates/settings.mako → legacy/templates/settings.mako Просмотреть файл


templates/support/footer.mako → legacy/templates/support/footer.mako Просмотреть файл


templates/support/header.mako → legacy/templates/support/header.mako Просмотреть файл


Загрузка…
Отмена
Сохранить