directus oidc
This commit is contained in:
16
.gitea/workflow/deploy.yml
Normal file
16
.gitea/workflow/deploy.yml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
name: Deploy to CapRover
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-deploy:
|
||||||
|
runs-on: ubuntu-latest # ou o label do seu runner
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Deploy to CapRover
|
||||||
|
uses: caprover/deploy-from-github@v1.0.1
|
||||||
|
with:
|
||||||
|
server: ${{ secrets.CAPROVER_SERVER }}
|
||||||
|
app: 'meu-directus'
|
||||||
|
token: ${{ secrets.CAPROVER_APP_TOKEN }}
|
||||||
13
Dockerfile
Normal file
13
Dockerfile
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
FROM directus/directus:11
|
||||||
|
|
||||||
|
USER root
|
||||||
|
RUN apk add --no-cache openssl
|
||||||
|
|
||||||
|
USER node
|
||||||
|
RUN npm install directus-extension-openid-connect-provider
|
||||||
|
|
||||||
|
COPY --chown=node:node ./docker-entrypoint-oidc.sh /usr/local/bin/docker-entrypoint-oidc.sh
|
||||||
|
RUN chmod +x /usr/local/bin/entrypoint-custom.sh
|
||||||
|
|
||||||
|
ENTRYPOINT ["docker-entrypoint-oidc.sh"]
|
||||||
|
CMD ["npx", "directus", "start"]
|
||||||
4
captain-definition
Normal file
4
captain-definition
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"schemaVersion": 2,
|
||||||
|
"dockerfilePath": "./Dockerfile"
|
||||||
|
}
|
||||||
18
docker-compose.yml
Normal file
18
docker-compose.yml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
services:
|
||||||
|
directus:
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- "8055:8055"
|
||||||
|
environment:
|
||||||
|
KEY: "uma-chave-aleatoria"
|
||||||
|
SECRET: "um-segredo-aleatoria"
|
||||||
|
DB_CLIENT: "sqlite3"
|
||||||
|
DB_FILENAME: "/directus/database/data.db"
|
||||||
|
# Configurações da Extensão (Baseadas na doc da directus-extension-auth)
|
||||||
|
OIDC_ISSUER: "http://localhost:8055"
|
||||||
|
OIDC_PRIVATE_KEY_PATH: "/directus/oidc_private.key"
|
||||||
|
# Exemplo de Client para o Grist
|
||||||
|
OIDC_CLIENTS: '[{"id":"grist","secret":"secret-do-grist","redirect_uris":["http://localhost:8484/oauth2/callback"]}]'
|
||||||
|
volumes:
|
||||||
|
- ./database:/directus/database
|
||||||
|
- ./uploads:/directus/uploads
|
||||||
10
docker-entrypoint-oidc.sh
Normal file
10
docker-entrypoint-oidc.sh
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Se a variável de ambiente existir, cria o arquivo de chave
|
||||||
|
if [ ! -z "$OIDC_PRIVATE_KEY" ]; then
|
||||||
|
echo "Injetando OIDC Private Key..."
|
||||||
|
echo "$OIDC_PRIVATE_KEY" > /directus/oidc_private.key
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Executa o comando original (o CMD do Dockerfile)
|
||||||
|
/usr/local/bin/docker-entrypoint.sh "$@"
|
||||||
Reference in New Issue
Block a user