diff --git a/.gitignore b/.gitignore index f2df2c1..4b1016f 100644 --- a/.gitignore +++ b/.gitignore @@ -16,5 +16,5 @@ media # End of https://www.gitignore.io/api/django /static/ -/var/ .venv/ +*.sqlite3 diff --git a/README.md b/README.md index 93a5781..f782e06 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ -# Pasteque +# Paf'Pastèque ## About **Pasteque** is a free and open source (MIT License) **Pastebin like** application written in Python/Django. -An instance can be found at: [wyz.fr](https://wyz.fr). The wyz.fr +An instance can be found at: [p.afpy.org](https://p.afpy.org). The AFPy instance is installed by ansible, the role is available here: -[https://git.afpy.org/mdk/infra/src/branch/main/roles/pasteque](https://git.afpy.org/mdk/infra/src/branch/main/roles/pasteque). +[https://git.afpy.org/AFPy/infra/src/branch/main/roles/pasteque](https://git.afpy.org/AFPy/infra/src/branch/main/roles/pasteque). ## Features @@ -15,10 +15,7 @@ instance is installed by ansible, the role is available here: - Support any database supported by Django (Sqlite3, MySQL, PostgreSQL, Oracle, ...) - Available in english, french .. and easily translatable into another languages. - Syntax highlighting for a bunch of languages using Pygments. -- Time-based or "page loads"-based pastes expiration. -- Password protection. -- Possibility to enable/disable renderers and to choose the default one. -- Limit pastes size. +- Easy paste from command line or any programming language. ## Running Pasteque @@ -27,25 +24,18 @@ In a [venv](https://docs.python.org/3/library/venv.html), install the requiremen pip install -r requirements.txt -In `settings.py` edit: +In a `local_settings.py` file, at the root of the repo: DISPLAY_NAME = 'YourCompany-Paste' COMPRESS_ENABLED = True + DEBUG = False SECRET_KEY = 'fill_a_secret_key_here' - ALLOWED_HOSTS = ['localhost','127.0.0.1','paste.henriet.eu'] + ALLOWED_HOSTS = ['localhost', '127.0.0.1', 'paste.henriet.eu'] -Create some needed directories: - - mkdir -p var/{logs,db} - -Then create the database: +Create the database: ./manage.py migrate -Insert initial data (like known languages): - - ./manage.py loaddata initial - If you're in production collect static files: ./manage.py collectstatic diff --git a/webtools/settings.py b/webtools/settings.py index 6bee187..a032e2e 100644 --- a/webtools/settings.py +++ b/webtools/settings.py @@ -20,7 +20,7 @@ ADMINS = (("user", "user@hostname.domain"),) DATABASES = { "default": { "ENGINE": "django.db.backends.sqlite3", # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. - "NAME": os.path.join(SITE_ROOT, "var", "db", "webtools.sqlite3"), + "NAME": os.path.join(SITE_ROOT, "webtools.sqlite3"), # The following settings are not used with sqlite3: "USER": "", "PASSWORD": "", @@ -37,7 +37,6 @@ SITE_ID = 1 MANAGERS = ADMINS USE_TZ = True MEDIA_URL = "" -CACHE_PATH = os.path.join(SITE_ROOT, "var", "pygments-static") COMPRESS_ROOT = os.path.join(SITE_ROOT, "static") MEDIA_ROOT = os.path.join(SITE_ROOT, "assets") STATIC_ROOT = os.path.join(SITE_ROOT, "static") @@ -96,37 +95,6 @@ PASTE = { "default_language": "Python", } -LOGGING = { - "version": 1, - "disable_existing_loggers": False, - "filters": {"require_debug_false": {"()": "django.utils.log.RequireDebugFalse"}}, - "handlers": { - "mail_admins": { - "level": "ERROR", - "filters": ["require_debug_false"], - "class": "django.utils.log.AdminEmailHandler", - }, - "console": { - "level": "DEBUG", - "class": "logging.StreamHandler", - }, - "logfile": { - "level": "DEBUG", - "class": "logging.handlers.RotatingFileHandler", - "filename": os.path.join(SITE_ROOT, "var", "logs", "error.log"), - "maxBytes": 50000, - "backupCount": 2, - }, - }, - "loggers": { - "django.request": { - "handlers": ["console", "logfile"], - "level": "ERROR", - "propagate": True, - }, - }, -} - try: from local_settings import * except ImportError: