No description
Find a file
krek0 e630494543
All checks were successful
Docker / build (release) Successful in 8s
Use object-fit: contain to show full images in gallery grid
2026-05-05 14:16:11 +02:00
.forgejo/workflows Push latest tag on docker image on release 2026-05-04 09:04:59 +02:00
allauth_oauth Make database, oauth, smtp server, mail verificaiton configurable in .env 2026-05-02 14:18:02 +02:00
docs add metrics 2025-11-30 13:51:18 +01:00
photo21 Use object-fit: contain to show full images in gallery grid 2026-05-05 14:16:11 +02:00
photologue Drop de/es locales, complete fr translations, add navbar language switcher. 2026-05-03 23:35:51 +02:00
Scripts Caches é SQL optimisations 2025-11-23 14:43:49 +01:00
.env.example Add Docker support with Dockerfile and entrypoin 2026-05-03 16:54:46 +02:00
.gitignore Add nex requirements and gitignore 2025-11-23 16:38:47 +01:00
.gitlab-ci.yml Fix pipiline errors 2025-11-23 16:54:25 +01:00
Cold_Backup.md Add Cold Backup 2026-01-27 10:52:58 +01:00
COPYING Add COPYING 2021-09-22 21:33:46 +02:00
docker-compose.yml Add Docker support with Dockerfile and entrypoin 2026-05-03 16:54:46 +02:00
Dockerfile Fix image display in Docker by loading initial fixtures on startup 2026-05-04 09:04:54 +02:00
entrypoint.sh Fix image display in Docker by loading initial fixtures on startup 2026-05-04 09:04:54 +02:00
maintenance_tool.sh Nginx debug and mantenance mode working 2025-11-27 10:07:35 +01:00
manage.py Unifomize license headers 2022-03-11 17:16:11 +01:00
README.md update readme 2026-05-03 18:29:54 +02:00
requirements.txt Add Docker support with Dockerfile and entrypoin 2026-05-03 16:54:46 +02:00
tox.ini Make database, oauth, smtp server, mail verificaiton configurable in .env 2026-05-02 14:18:02 +02:00

Photo server

License: GPL v3

This is the source code for the webserver hosting pictures from the ENS Rennes student life.

The philosophy of this project is to keep this code as simple as possible to run and to maintain.

This project is a fork of Photo21, originally developed at ENS Paris-Saclay.

  1. Create a docker-compose.yml (a ready-to-use file is provided in the repository):

    version: "3.9"
    
    networks:
      photo26:
    
    services:
      db:
        image: postgres:16
        container_name: photo26-db
        restart: unless-stopped
        environment:
          POSTGRES_DB: photo26
          POSTGRES_USER: photo26
          POSTGRES_PASSWORD: change-me
        volumes:
          - ./postgres_data:/var/lib/postgresql/data
        networks:
          - photo26
    
      photo26:
        image: git.sinfonie.org/sinfonie/photo26:latest
        container_name: photo26-app
        restart: unless-stopped
        depends_on:
          - db
        environment:
          DB_ENGINE: postgres
          DB_NAME: photo26
          DB_USER: photo26
          DB_PASSWORD: change-me
          DB_HOST: db
          DB_PORT: 5432
          SECRET_KEY: change-me
          EXTRA_HOSTS: photos.example.org
        volumes:
          - ./media:/app/media
        ports:
          - "8080:8000"
        networks:
          - photo26
    
  2. Start the stack:

    docker compose up -d
    

    On first start the container will run migrations and create a default admin account automatically.

  3. Default credentials — change these immediately after first login:

    Field Value
    Username admin
    Password admin
    Email admin@localhost

    Admin panel: http://localhost:8080/admin/

  4. Passwords to change in docker-compose.yml before going to production:

    • POSTGRES_PASSWORD / DB_PASSWORD — database password
    • SECRET_KEY — Django secret key (use a long random string)
    • Log in to the admin panel and change the admin user password

Development setup

  1. Cloning. Change directory to where you want the project to be.

    git clone https://codeberg.org/krek0/photo21.git && cd photo21
    
  2. Dependency installation. If you are not using Debian, please feel free to adapt the following instructions.

    sudo apt install git gettext python3-django python3-django-allauth python3-django-crispy-forms python3-docutils python3-exifread python3-pil
    
  3. Configuration.

    sudo mkdir static media
    sudo chmod +x maintenance_tool.sh
    
  4. Database. In development, you may use SQLite (no setup). In production, we use PostgreSQL which require a bit of setup:

    sudo apt install postgresql postgresql-contrib
    sudo -u postgres psql
    postgres=# CREATE USER photo21 WITH PASSWORD 'your_password';
    postgres=# CREATE DATABASE photo21 OWNER photo21;
    
  5. Initialization.

    ./manage.py collectstatic
    ./manage.py check
    ./manage.py migrate
    ./manage.py compilemessages
    
    # Only when creating a new database
    ./manage.py loaddata initial
    ./manage.py createsuperuser
    
  6. Maintenance Mode. In production to toggle the server maintenance mode

    ./maintenance_tool.sh

  7. Enjoy \o/

    (env)$ ./manage.py runserver