# Launch Python shell in the running Docker container docker exec -ti photonix python photonix/manage.py shell # Import Django models from photonix.accounts.models import User from photonix.photos.models import Library, LibraryUser, LibraryPath # Create a user user = User(username='YOUR_USERNAME') user.set_password('YOUR_PASSWORD') user.save() # Create a library library = Library(name='YOUR_NEW_LIBRARY_NAME', classification_color_enabled=True, classification_location_enabled=True, classification_style_enabled=True, classification_object_enabled=True, setup_stage_completed='Th') library.save() # Create a path attached to the library so files can be imported library_path = LibraryPath(library=library, type='St', backend_type='Lo', path='YOUR_PATH_INSIDE_DOCKER_CONTAINER', watch_for_changes=True) library_path.save() # Link the user created above to the library created above library_user = LibraryUser(library=library, user=user, owner=True) # owner=True only if this new library user is going to be in charge of managing it library_user.save() # Alternatively, if you want to be the owner in charge, set owner=False above and then also run this owner_user = User.objects.get(username='demo') library_user = LibraryUser(library=library, user=owner_user, owner=True) library_user.save()
Afternoon everyone! Bit stumped so I'm hoping you all can help me out. Just tried launching Photonix for the first time in my stack and while it appears everything is set up properly per the documentation, I cannot get logged in at all. Every time I try to authenticate with the credentials I set up through the python script, it just hands at Loading... and never goes anywhere. Logs just show the same thing over and over
today at 1:45:51 PM {GatewayIP} - - [23/Jun/2021:17:45:51 +0000] "POST /graphql HTTP/1.1" 400 154 "https://{domain}/login" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36"
photonix:
image: photonixapp/photonix:0.11.0
container_name: photonix
restart: unless-stopped
depends_on:
- traefik
- redis_photonix
- postgres
security_opt:
- no-new-privileges:true
networks:
xinstitute:
socket_proxy:
environment:
- ENV=prd
- POSTGRES_HOST=postgres
- POSTGRES_USER=photonix
- POSTGRES_PASSWORD={redacted}
- REDIS_HOST=redis_photonix
- ALLOWED_HOSTS='*'
volumes:
- $DOCKERDIR/photonix/photos:/data/photos
- $DOCKERDIR/photonix/raw-photos-processed:/data/raw-photos-processed
- $DOCKERDIR/photonix/cache:/data/cache
- $DOCKERDIR/photonix/models:/data/models
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.photonix-rtr.entrypoints=https"
- "traefik.http.routers.photonix-rtr.rule=Host(`mysphotonix.$DOMAINNAME`)"
## Middlewares
- "traefik.http.routers.photonix-rtr.middlewares=chain-no-auth@file"
## HTTP Services
- "traefik.http.routers.photonix-rtr.service=photonix-svc"
- "traefik.http.services.photonix-svc.loadbalancer.server.port=80"
Operations to perform:
Apply all migrations: accounts, admin, auth, contenttypes, photos, refresh_token, sessions
Running migrations:
No migrations to apply.
actually this is the only other thing i could find that failed
today at 2:57:22 PM WARNING:root:Limited tf.compat.v2.summary API due to missing TensorBoard installation.
today at 2:57:22 PM WARNING:root:Limited tf.summary API due to missing TensorBoard installation.
this a problem that may result in what i'm seeing?
ok, so i got rid of everything and started from scratch. saved the initial log file before i tried to load up at all so i have a copy of that initial log to share. as soon as i went to the website to try and load up for the initial, i'm met with the login screen and that same error starts to fly into the log over and over
today at 3:32:04 PM {GW IP} - - [23/Jun/2021:19:32:04 +0000] "POST /graphql HTTP/1.1" 400 154 "https://{domain}/login" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36"
so it looks like it's having a problem as soon as I try to load up for some reason. i also took out all of the middlewares for traefik just to make sure there wasn't some issue i was missing from that perspective on routing but that didn't have any effect. i'll let you know how the stock run on the RPi4 goes, i apparently now have to fight with my orbi routers as the firmware they're on is borked and i cant keep them from randomly restarting throughout the day
docker-compose.yml
that I use on a home server. (I've only removed some irrelevant other services and replaced my home server domain name with mydomain.com
. This successfully uses Traefik with LetsEncrypt, I access it via domain name and it redirects to /onboarding
as I haven't started using it fully yet. Hopefully this gives you something else to try.
version: '3.3'
services:
traefik:
image: "traefik:v2.2"
restart: always
container_name: "traefik"
command:
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.web.http.redirections.entryPoint.to=websecure"
- "--entrypoints.web.http.redirections.entryPoint.scheme=https"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.myresolver.acme.tlschallenge=true"
# - "--certificatesresolvers.myresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
- "--certificatesresolvers.myresolver.acme.email=webmaster@mydomain.com"
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "/volumes/letsencrypt:/letsencrypt"
postgres:
container_name: postgres
image: postgres:11.1-alpine
restart: always
ports:
- '5432:5432'
environment:
POSTGRES_DB: photonix
POSTGRES_PASSWORD: password
volumes:
- /volumes/postgres:/var/lib/postgresql/data
redis:
container_name: redis
image: redis:3.2.8
restart: always
ports:
- '6379:6379'
photonix:
container_name: photonix
image: photonixapp/photonix:latest
restart: always
ports:
- '8888:80'
environment:
ENV: prd
POSTGRES_HOST: postgres
POSTGRES_DB: photonix
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
REDIS_HOST: redis
ALLOWED_HOSTS: '*'
volumes:
- /volumes/photonix/photos:/data/photos
- /volumes/photonix/raw-photos-processed:/data/raw-photos-processed
- /volumes/photonix/cache:/data/cache
- /volumes/photonix/models:/data/models
links:
- postgres
- redis
labels:
- "traefik.enable=true"
- "traefik.http.routers.photonix.rule=Host(`photonix.mydomain.com`)"
- "traefik.http.routers.photonix.entrypoints=websecure"
- "traefik.http.routers.photonix.tls.certresolver=myresolver"
- "traefik.http.services.photonix.loadbalancer.server.port=80"