Add a sitemap.txt for popular public repos
and reference it from the robots.txt
This commit is contained in:
parent
c712be05e2
commit
a1cf12e460
11 changed files with 146 additions and 52 deletions
13
initdb.py
13
initdb.py
|
@ -6,7 +6,7 @@ import calendar
|
|||
import os
|
||||
import argparse
|
||||
|
||||
from datetime import datetime, timedelta
|
||||
from datetime import datetime, timedelta, date
|
||||
from peewee import (SqliteDatabase, create_model_tables, drop_model_tables, savepoint_sqlite,
|
||||
savepoint)
|
||||
from itertools import count
|
||||
|
@ -506,9 +506,9 @@ def populate_database(minimal=False, with_storage=False):
|
|||
(1, [(1, [], 'v5.0'), (1, [], 'v6.0')], None)],
|
||||
None))
|
||||
|
||||
__generate_repository(with_storage, new_user_2, 'publicrepo',
|
||||
'Public repository pullable by the world.', True,
|
||||
[], (10, [], 'latest'))
|
||||
publicrepo = __generate_repository(with_storage, new_user_2, 'publicrepo',
|
||||
'Public repository pullable by the world.', True,
|
||||
[], (10, [], 'latest'))
|
||||
|
||||
__generate_repository(with_storage, outside_org, 'coolrepo',
|
||||
'Some cool repo.', False,
|
||||
|
@ -653,6 +653,7 @@ def populate_database(minimal=False, with_storage=False):
|
|||
week_ago = today - timedelta(6)
|
||||
six_ago = today - timedelta(5)
|
||||
four_ago = today - timedelta(4)
|
||||
yesterday = datetime.combine(date.today(), datetime.min.time()) - timedelta(hours=6)
|
||||
|
||||
__generate_service_key('kid1', 'somesamplekey', new_user_1, today,
|
||||
ServiceKeyApprovalType.SUPERUSER)
|
||||
|
@ -740,6 +741,10 @@ def populate_database(minimal=False, with_storage=False):
|
|||
timestamp=today,
|
||||
metadata={'token_code': 'somecode', 'repo': 'orgrepo'})
|
||||
|
||||
model.log.log_action('pull_repo', new_user_2.username, repository=publicrepo,
|
||||
timestamp=yesterday,
|
||||
metadata={'token_code': 'somecode', 'repo': 'publicrepo'})
|
||||
|
||||
model.log.log_action('build_dockerfile', new_user_1.username, repository=building,
|
||||
timestamp=today,
|
||||
metadata={'repo': 'building', 'namespace': new_user_1.username,
|
||||
|
|
Reference in a new issue