forked from gethomepage/homepage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
265 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,8 @@ name: Docker | |
# documentation. | ||
|
||
on: | ||
schedule: | ||
- cron: '20 0 * * *' | ||
# schedule: | ||
# - cron: '20 0 * * *' | ||
push: | ||
branches: | ||
- main | ||
|
@@ -24,6 +24,7 @@ on: | |
- 'docs/**' | ||
- 'mkdocs.yml' | ||
merge_group: | ||
workflow_dispatch: | ||
|
||
env: | ||
# github.repository as <account>/<repo> | ||
|
@@ -45,20 +46,16 @@ jobs: | |
python-version: 3.x | ||
- | ||
name: Check files | ||
uses: pre-commit/[email protected].1 | ||
uses: pre-commit/[email protected].0 | ||
|
||
build: | ||
name: Docker Build & Push | ||
if: github.repository == 'gethomepage/homepage' | ||
runs-on: self-hosted | ||
runs-on: ubuntu-latest | ||
needs: | ||
- pre-commit | ||
permissions: | ||
contents: read | ||
packages: write | ||
# This is used to complete the identity challenge | ||
# with sigstore/fulcio when running outside of PRs. | ||
id-token: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
|
@@ -75,13 +72,13 @@ jobs: | |
|
||
# This step is being disabled because the runner is on a self-hosted machine | ||
# where the cache will stick between runs. | ||
# - name: Cache Docker layers | ||
# uses: actions/cache@v3 | ||
# with: | ||
# path: /tmp/.buildx-cache | ||
# key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
# restore-keys: | | ||
# ${{ runner.os }}-buildx- | ||
- name: Cache Docker layers | ||
uses: actions/cache@v3 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
# Login against a Docker registry except on PR | ||
# https://github.com/docker/login-action | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { checkAllowedGroup, readIdentitySettings } from "utils/identity/identity-helpers"; | ||
import { getSettings } from "utils/config/config"; | ||
|
||
export default async function handler(req, res) { | ||
const { group } = req.query; | ||
const { provider, groups } = readIdentitySettings(getSettings().identity); | ||
|
||
try { | ||
if (checkAllowedGroup(provider.getIdentity(req), groups, group)) { | ||
res.json({ group }); | ||
} else { | ||
res.status(401).json({ message: "Group unathorized" }); | ||
} | ||
} catch (err) { | ||
res.status(500).send("Error getting user identity"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
import { readIdentitySettings } from "utils/identity/identity-helpers"; | ||
import { bookmarksResponse } from "utils/config/api-response"; | ||
import { getSettings } from "utils/config/config"; | ||
|
||
export default async function handler(req, res) { | ||
res.send(await bookmarksResponse()); | ||
const { provider, groups } = readIdentitySettings(getSettings().identity); | ||
res.send(await bookmarksResponse(provider.getIdentity(req), groups)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
import { readIdentitySettings } from "utils/identity/identity-helpers"; | ||
import { servicesResponse } from "utils/config/api-response"; | ||
import { getSettings } from "utils/config/config"; | ||
|
||
export default async function handler(req, res) { | ||
res.send(await servicesResponse()); | ||
const { provider, groups } = readIdentitySettings(getSettings().identity); | ||
res.send(await servicesResponse(provider.getIdentity(req), groups)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
import { readIdentitySettings } from "utils/identity/identity-helpers"; | ||
import { widgetsResponse } from "utils/config/api-response"; | ||
import { getSettings } from "utils/config/config"; | ||
|
||
export default async function handler(req, res) { | ||
res.send(await widgetsResponse()); | ||
const { provider } = readIdentitySettings(getSettings().identity); | ||
res.send(await widgetsResponse(provider.getIdentity(req))); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.