ALTRepo Front is a web interface for the ALTRepo API.
  • Python 66.7%
  • HTML 15.6%
  • CSS 9.9%
  • JavaScript 7.7%
  • Dockerfile 0.1%
Find a file
2026-06-02 12:09:59 +03:00
apps fix(vulns): replace bug_id_type with bdu_id_type in ReferenceModel __post_init__ 2026-05-29 16:46:02 +03:00
conf bump version v26.6.0 -> v26.6.1 2026-06-02 12:09:59 +03:00
core fix(vulns): tighten CVE/BDU/GHSA regex patterns to prevent false positives 2026-06-02 10:33:34 +03:00
locale feat: update translation 2026-03-30 17:04:31 +03:00
nginx fix(nginx) Add chrooted package to nginx Docker image 2025-07-22 17:22:06 +03:00
redis docker: update base image to p11 in Redis Dockerfile 2025-05-13 09:23:46 +03:00
templates Merge pull request 'Add Branch History page with interactive task graph' (#21) from dshein/altrepo_front:master into master 2026-03-27 09:36:40 +03:00
templatetags style: apply black and isort formatting 2026-01-30 10:33:10 +03:00
tests Fix branch history timezone formatting 2026-04-29 09:21:07 +03:00
utils fix(utils): Accept HTTP 200 as valid response status in result_json_post 2026-04-14 06:12:32 +03:00
.dockerignore core: add a command to update the translation of package descriptions 2022-05-19 17:15:35 +03:00
.env.example feat: enrich commit data, configurable branches model, and UI improvements 2026-02-24 17:09:16 +03:00
.gitignore packages: add translation for description packages 2022-05-23 11:54:48 +03:00
AUTHORS add authors 2021-12-09 17:02:36 +03:00
CHANGELOG.rst bump version v26.6.0 -> v26.6.1 2026-06-02 12:09:59 +03:00
docker-compose.dev.yml fix(docker): revert 4fa452d0 and ff9561d3 commits 2025-09-26 10:38:36 +03:00
docker-compose.yml fix(docker): revert 4fa452d0 and ff9561d3 commits 2025-09-26 10:38:36 +03:00
Dockerfile fix: replace deprecated pkg_resources.parse_version with packaging.version.parse 2026-02-19 10:53:56 +03:00
Dockerfile-dev fix: replace deprecated pkg_resources.parse_version with packaging.version.parse 2026-02-19 10:53:56 +03:00
entrypoint.sh docker: use p11 based Docker containers 2025-04-30 13:21:22 +03:00
LICENSE add license 2021-12-09 17:02:10 +03:00
manage.py style: apply black and isort formatting 2026-01-30 10:33:10 +03:00
README.rst update README.rst 2022-06-23 14:24:32 +03:00
requirements_pip.txt chore: Update Python dependencies to latest 2025-11-12 15:11:51 +03:00

ALTRepo Frontend =============

ALTRepo Front is a web interface for the ALTRepo API.

LICENSE

GNU AGPLv3

Run Docker

  1. Clone project:

    $ git clone 'git_project_repository'
  2. Create configuration file .env:

    DEBUG=False
    ALLOWED_HOSTS=*,
    SQLITE_URL=sqlite:///databases/altrepo_front.sqlite3
    CACHE_FILE=filecache://django_cache
    LOGGING_LEVEL=DEBUG
    LOGGING_FILENAME=log/logging.log
    SECRET_KEY=9f735e0df9a1ddc702bf0a1a7b83033f9f7153a00c29de82cedadc9957289b05
    SECRET_LOGIN=admin
    SECRET_PASSWORD=admin
    BASE_API_ADDRESS=https://rdb.altlinux.org
    API_ADDRESS_FOR_TESTS=http://beta-repodb-api.mskdc.altlinux.org
    APP_PORT_EXT=1337
    ALLOWED_IP=127.0.0.1,
    AWS_S3_ENDPOINT_URL=URL for S3 Storage
    AWS_ACCESS_KEY_ID=Access key ID for S3 Storage
    AWS_SECRET_ACCESS_KEY=Secret access key ID for S3 Storage
    AWS_REGION_NAME=us-east-1
    AWS_BUCKET_NAME=Bucket name
    TG_TOKEN=Telegram bot token
    TG_CHAT_ID=Telegram chat id
  3. Build the images and spin up the containers:

    #For production
    $ docker-compose -f docker-compose.yml up -d --build
    
    #For development
    $ docker-compose -f docker-compose.dev.yml up -d --build
  4. If the container fails to start, check for errors in the logs via:

    docker-compose logs -f
  5. First well need to create a user who can login to the admin site. Run the following command::

    $ docker exec -it container_id python3 manage.py createsuperuser
    
    #Enter your desired username and press enter::
        Username: admin
    
    #You will then be prompted for your desired email address::
        Email address: admin@example.com
    
    #The final step is to enter your password. You will be asked to enter
    your password twice, the second time as a confirmation of the first.
        Password: **********
        Password (again): *********
        Superuser created successfully.

Run a local server

  1. Clone project:

    $ git clone 'git_project_repository'
  2. Create a Python ≥ 3.7 virtualenv:

    $ python3 -m venv env
  3. Install requirements:

    # for pip
    $ source env/bin/activate
    $ pip3 install -r requirements/pip.txt
    
    #for altlinux
    $ apt-get install \
        python3-module-asgiref \
        python3-module-certifi \
        python3-module-chardet \
        python3-module-django \
        python3-module-django-ckeditor \
        python3-module-django-js-asset \
        python3-module-gunicorn \
        python3-module-idna \
        python3-module-dateutil \
        python3-module-pytz \
        python3-module-requests \
        python3-module-six \
        python3-module-sqlparse \
        python3-module-urllib3 \
        python3-module-django-environ \
        python3-module-django-gunicorn \
  4. If requirements install from altlinux.txt then change in the file env/pyvenv.cfg:

    include-system-site-packages = true
  5. Create configuration file .env:

    DEBUG=True
    ALLOWED_HOSTS=List of allowed hosts(specify comma-separated)
    SQLITE_URL=sqlite:///databases/altrepo_front.sqlite3
    CACHE_FILE=filecache://django_cache
    LOGGING_LEVEL=DEBUG
    LOGGING_FILENAME=log/logging.log
    SECRET_KEY=Secret key for Django Project
    SECRET_LOGIN=Administrator login for api
    SECRET_PASSWORD=Administrator password for api
    BASE_API_ADDRESS=url api
    APP_PORT_EXT=8001
    AWS_S3_ENDPOINT_URL=URL for S3 Storage
    AWS_ACCESS_KEY_ID=Access key ID for S3 Storage
    AWS_SECRET_ACCESS_KEY=Secret access key ID for S3 Storage
    AWS_REGION_NAME=us-east-1
    AWS_BUCKET_NAME=Bucket name
    TG_TOKEN=Telegram bot token
    TG_CHAT_ID=Telegram chat id
  6. Create database:

    $ python3 manage.py migrate
  7. First well need to create a user who can login to the admin site. Run the following command::

    $ python3 manage.py createsuperuser
    
    #Enter your desired username and press enter::
        Username: admin
    
    #You will then be prompted for your desired email address::
        Email address: admin@example.com
    
    #The final step is to enter your password. You will be asked to enter
    your password twice, the second time as a confirmation of the first.
        Password: **********
        Password (again): *********
        Superuser created successfully.
  8. Populate the maintainers table using the command:

    $ python3 manage.py scrape
  9. Start the development server:

    $ python3 manage.py runserver

Gunicorn + Nginx

  1. Create a systemd socket file for Gunicorn:

    $ nano /etc/systemd/system/gunicorn.socket
    
    [Unit]
    Description=gunicorn socket
    
    [Socket]
    ListenStream=/run/gunicorn.sock
    
    [Install]
    WantedBy=sockets.target
  2. Create a systemd service file for Gunicorn:

    $ nano /etc/systemd/system/gunicorn.service
    
    [Unit]
    Description=gunicorn daemon
    Requires=gunicorn.socket
    After=network.target
    
    [Service]
    WorkingDirectory=/path_to_app/altrepo_front
    ExecStart=--access-logfile - \
              --workers 5 \
              --bind unix:/run/gunicorn.sock \
              altrepo_front.wsgi:application
    
    [Install]
    WantedBy=multi-user.target
  3. Start and activate the Gunicorn socket:

    $ systemctl start gunicorn.socket
    
    #Check the status of the process:
    $ systemctl status gunicorn.socket
  4. Create a new server block in the Nginx sites-enabled directory:

    $ nano /etc/nginx/sites-enabled.d/altrepo_front.conf
    
    server {
        listen 80;
        server_name 127.0.0.1;
    
        root /path_to_app/altrepo_front;
    
        access_log /path_to_app/altrepo_front/nginx_access.log;
        error_log /path_to_app/altrepo_front/nginx_error.log;
    
        #location = /favicon.ico { access_log off; log_not_found off; }
    
        location /static/ {
            root /path_to_app/altrepo_front;
        }
    
        location / {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_pass http://unix:/run/gunicorn.sock;
        }
    }

Run tests

  1. Running fast tests:

    python3 manage.py test tests --exclude-tag=slow --exclude-tag=selenium
  2. Running slow tests(Make a request to the api for all packages in the sisyphus branch):

    python3 manage.py test tests --tag=slow
  3. Running selenium tests:

    python3 manage.py test tests --tag=selenium
  4. Running pytest:

    python3 -m pytest tests/pytest/