-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit dd08335
Showing
35 changed files
with
1,313 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
# Created by https://www.toptal.com/developers/gitignore/api/django | ||
# Edit at https://www.toptal.com/developers/gitignore?templates=django | ||
|
||
### Django ### | ||
*.log | ||
*.pot | ||
*.pyc | ||
__pycache__/ | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
media | ||
|
||
# If your build process includes running collectstatic, then you probably don't need or want to include staticfiles/ | ||
# in your Git repository. Update and uncomment the following line accordingly. | ||
# <django-project-name>/staticfiles/ | ||
|
||
### Django.Python Stack ### | ||
# Byte-compiled / optimized / DLL files | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
pip-wheel-metadata/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
|
||
# Django stuff: | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# pipenv | ||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
# However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
# having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
# install all needed dependencies. | ||
#Pipfile.lock | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# pytype static type analyzer | ||
.pytype/ | ||
|
||
# End of https://www.toptal.com/developers/gitignore/api/django | ||
|
||
# portsfallout | ||
INDEX-*.bz2 | ||
portsfallout/settings.py | ||
scripts/scrapy_output/*.json | ||
scripts/scrapy_output/processed/*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Ports Fallout | ||
============= | ||
|
||
- Django application | ||
- Web crawling (Scrapy) | ||
|
||
An easy way to search the FreeBSD pkg-fallout reports. | ||
|
||
Be nice! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env python | ||
"""Django's command-line utility for administrative tasks.""" | ||
import os | ||
import sys | ||
|
||
|
||
def main(): | ||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'portsfallout.settings') | ||
try: | ||
from django.core.management import execute_from_command_line | ||
except ImportError as exc: | ||
raise ImportError( | ||
"Couldn't import Django. Are you sure it's installed and " | ||
"available on your PYTHONPATH environment variable? Did you " | ||
"forget to activate a virtual environment?" | ||
) from exc | ||
execute_from_command_line(sys.argv) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from django.contrib import admin | ||
from ports.models import Category, Port, Fallout | ||
|
||
|
||
class PortAdmin(admin.ModelAdmin): | ||
ordering = ['origin'] | ||
search_fields = ['name', 'origin', 'maintainer'] | ||
list_display = ['origin', 'maintainer', 'www'] | ||
list_filter = ['main_category'] | ||
|
||
|
||
class CategoryAdmin(admin.ModelAdmin): | ||
ordering = ['name'] | ||
search_fields = ['name'] | ||
|
||
|
||
class FalloutAdmin(admin.ModelAdmin): | ||
list_display = ('port', 'maintainer', 'version', 'env', 'category', 'date') | ||
ordering = ['-date'] | ||
readonly_fields = ['port'] | ||
search_fields = ['env', 'maintainer', 'log_url'] | ||
list_filter = ['date', 'env', 'category'] | ||
date_hierarchy = 'date' | ||
actions_selection_counter = True | ||
actions_on_top = True | ||
actions_on_bottom = True | ||
|
||
|
||
admin.site.register(Port, PortAdmin) | ||
admin.site.register(Category, CategoryAdmin) | ||
admin.site.register(Fallout, FalloutAdmin) | ||
|
||
admin.site.site_header = "Ports Fallout Admin" | ||
admin.site.site_title = "Admin Ports Fallout" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class PortsConfig(AppConfig): | ||
name = 'ports' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Generated by Django 3.0.8 on 2020-07-30 23:23 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Category', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('name', models.CharField(max_length=64, unique=True)), | ||
], | ||
options={ | ||
'verbose_name_plural': 'Categories', | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='Port', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('origin', models.CharField(max_length=128, unique=True)), | ||
('name', models.CharField(max_length=64)), | ||
('comment', models.CharField(blank=True, max_length=192)), | ||
('maintainer', models.EmailField(max_length=254)), | ||
('www', models.URLField(blank=True)), | ||
('main_category', models.CharField(max_length=64)), | ||
('categories', models.ManyToManyField(to='ports.Category')), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='Fallout', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('env', models.CharField(max_length=48)), | ||
('version', models.CharField(max_length=24)), | ||
('category', models.CharField(max_length=48)), | ||
('maintainer', models.EmailField(max_length=254)), | ||
('last_committer', models.EmailField(max_length=254)), | ||
('date', models.DateTimeField()), | ||
('log_url', models.URLField()), | ||
('build_url', models.URLField()), | ||
('report_url', models.URLField()), | ||
('server', models.CharField(blank=True, max_length=48)), | ||
('port', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ports.Port')), | ||
], | ||
), | ||
] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
from django.db import models | ||
|
||
class Category(models.Model): | ||
name = models.CharField(max_length=64, unique=True) | ||
|
||
def __str__(self): | ||
return self.name | ||
|
||
class Meta: | ||
verbose_name_plural = "Categories" | ||
|
||
|
||
class Port(models.Model): | ||
origin = models.CharField(max_length=128, unique=True) | ||
name = models.CharField(max_length=64) | ||
comment = models.CharField(max_length=192, blank=True) | ||
maintainer = models.EmailField() | ||
www = models.URLField(blank=True) | ||
|
||
# Categories | ||
main_category = models.CharField(max_length=64) | ||
categories = models.ManyToManyField(Category) | ||
|
||
def __str__(self): | ||
return self.origin | ||
|
||
|
||
class Fallout(models.Model): | ||
port = models.ForeignKey(Port, on_delete=models.CASCADE) | ||
env = models.CharField(max_length=48) | ||
version = models.CharField(max_length=24) | ||
category = models.CharField(max_length=48) | ||
maintainer = models.EmailField() | ||
last_committer = models.EmailField() | ||
date = models.DateTimeField() | ||
log_url = models.URLField() | ||
build_url = models.URLField() | ||
report_url = models.URLField() | ||
server = models.CharField(max_length=48, blank=True) | ||
|
||
def __str__(self): | ||
# head-arm64-default | net/findomain | ||
return self.env + " | " + self.port.origin | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{% extends "ports/base.html" %} | ||
{% block title %}About{% endblock %} | ||
{% block body_block %} | ||
|
||
<br /> | ||
|
||
<h3>About</h3> | ||
|
||
<br /> | ||
|
||
<p>Maintained by dbaio@, just an easy way to search the FreeBSD pkg-fallout | ||
reports while portsmon is under maintenance.</p> | ||
|
||
<p>v1.0.0.</p> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!DOCTYPE html> | ||
{% load static %} | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title> | ||
{% block title %}{% endblock %} | ||
</title> | ||
<link rel="stylesheet" href="{% static "css/bootstrap.min.css" %}" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous"> | ||
</head> | ||
<body> | ||
<nav class="navbar navbar-expand-lg navbar-dark" style="background-color: #800000"> | ||
<a class="navbar-brand" href="{% url 'ports:index' %}">Home</a> | ||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation"> | ||
<span class="navbar-toggler-icon"></span> | ||
</button> | ||
<div class="collapse navbar-collapse" id="navbarNav"> | ||
<ul class="navbar-nav"> | ||
<li class="nav-item {{ navbar_fallout }}"> | ||
<a class="nav-link" href="{% url 'ports:fallout' %}">Fallouts</a> | ||
</li> | ||
<li class="nav-item {{ navbar_list }}"> | ||
<a class="nav-link" href="{% url 'ports:list' %}">Ports</a> | ||
</li> | ||
<li class="nav-item {{ navbar_about }}"> | ||
<a class="nav-link" href="{% url 'ports:about' %}">About</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</nav> | ||
<div class="container"> | ||
{% block body_block %} | ||
{% endblock %} | ||
</div> | ||
<script src="{% static "js/jquery-3.5.1.slim.min.js" %}" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script> | ||
<script src="{% static "js/bootstrap.min.js" %}" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.