- Add LICENSE file (public domain, permacomputer values)
- Add license headers to all 27 Python source files
- Restore full about_ch9_p2 with "terminated 🟣" content
- Translate about_ch9_p2 to all 26 languages
The permacomputer is community-owned infrastructure optimized around:
TRUTH, FREEDOM, HARMONY, LOVE
81 lines
2.6 KiB
Python
81 lines
2.6 KiB
Python
# PUBLIC DOMAIN - NO LICENSE, NO WARRANTY
|
|
#
|
|
# This is free public domain software for the public good of a permacomputer hosted
|
|
# at permacomputer.com - an always-on computer by the people, for the people. One
|
|
# which is durable, easy to repair, and distributed like tap water for machine
|
|
# learning intelligence.
|
|
#
|
|
# The permacomputer is community-owned infrastructure optimized around four values:
|
|
#
|
|
# TRUTH - First principles, math & science, open source code freely distributed
|
|
# FREEDOM - Voluntary partnerships, freedom from tyranny & corporate control
|
|
# HARMONY - Minimal waste, self-renewing systems with diverse thriving connections
|
|
# LOVE - Be yourself without hurting others, cooperation through natural law
|
|
#
|
|
# Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
|
|
# software, either in source code form or as a compiled binary, for any purpose,
|
|
# commercial or non-commercial, and by any means.
|
|
#
|
|
# NO WARRANTY. THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.
|
|
#
|
|
# Copyright 2025 TimeHexOn & foxhop & russell@unturf
|
|
# https://git.unturf.com/engineering/unturf/pig.py
|
|
|
|
"""
|
|
serp - Search Engine Results Page for neopig.
|
|
# Side quest 20/21: SERP is just the beginning.
|
|
|
|
FastAPI web server for searching and browsing crawled media.
|
|
"""
|
|
|
|
from .i18n import (
|
|
TRANSLATIONS,
|
|
LANG_NAMES,
|
|
get_lang,
|
|
t,
|
|
inject_i18n,
|
|
NAV_HTML,
|
|
SEARCH_BOX_HTML,
|
|
)
|
|
from .models import CrawlRequest
|
|
from .app import app, templates, DB_PATH, VAULT_PATH, CRAWL_DISABLED, IMPORT_MODE, get_language
|
|
from .archive import (
|
|
ArchiveDB,
|
|
read_from_tarball,
|
|
find_media_in_tarball,
|
|
_open_tarball,
|
|
TAR_PATH,
|
|
TAR_OFFSET,
|
|
TAR_MEMBERS,
|
|
TAR_MEDIA_INDEX,
|
|
ARCHIVE_ROOT,
|
|
TEMP_DB_PATH,
|
|
)
|
|
from .logging import start_job_logging, stop_job_logging, get_job_logs
|
|
from .utils import slugify
|
|
|
|
# Import server module to register all routes on the app
|
|
from . import server
|
|
|
|
# Re-export server components
|
|
db = server.db
|
|
main = server.main
|
|
init_tarball_mode = server.init_tarball_mode
|
|
|
|
__all__ = [
|
|
# i18n
|
|
'TRANSLATIONS', 'LANG_NAMES', 'get_lang', 't', 'inject_i18n', 'NAV_HTML', 'SEARCH_BOX_HTML',
|
|
# Models
|
|
'CrawlRequest',
|
|
# App
|
|
'app', 'templates', 'DB_PATH', 'VAULT_PATH', 'CRAWL_DISABLED', 'IMPORT_MODE',
|
|
# Archive
|
|
'ArchiveDB', 'read_from_tarball', 'find_media_in_tarball', '_open_tarball',
|
|
'TAR_PATH', 'TAR_OFFSET', 'TAR_MEMBERS', 'TAR_MEDIA_INDEX', 'ARCHIVE_ROOT', 'TEMP_DB_PATH',
|
|
# Logging
|
|
'start_job_logging', 'stop_job_logging', 'get_job_logs',
|
|
# Utils
|
|
'slugify',
|
|
# Server
|
|
'db', 'main', 'init_tarball_mode', 'server',
|
|
]
|