You want to contribute to Kartverket.dev? Awesome! Thanks a lot for the support :) Here's how you can get started:
We use GitHub issues to track bugs and feature requests. You can find the backlog as well as the current roadmap in the following places:
- Project backlog: https://github.com/orgs/kartverket/projects/13/views/1
- Project board: https://github.com/orgs/kartverket/projects/13/views/2
- All issues: https://github.com/kartverket/kartverket.dev/issues
To start a local development environment, follow the instructions below.
- install nvm
nvm install 20
nvm use 20
- enable corepack
corepack enable
- Create a personal access token on GitHub with
repo
andworkflow
scopes. Authorize for Kartverket after creation. - Create app-config.local.yaml:
integrations:
github:
- host: github.com
token: your-token
- mkdir db
- add this snippet to your app-config.local.yaml
backend:
database:
client: better-sqlite3
connection:
directory: /<absolute>/<path>/<to>/<repo>/db
To app-config.local.yaml
add:
auth:
providers:
guest: {}
catalog:
rules:
- allow: [Component, API, Location, Resource, Template, Group, User]
locations:
- type: file
target: ../../test_data/org.yaml
To refresh the data, delete your local sqlites and sync with microsoft provider following the instructions below.
Then run the script extract_entities.py
in /test_data
Delete the sqlite
files in the db
folder before syncing.
For this you need to have the az cli and microsoft intune installed.
After setting up intune you can log in to az cli using: az login --allow-no-subscriptions --scope https://graph.microsoft.com//.default --use-device-code
You might have to ask IT to enroll your device.
Now you can use the following configuration in app-config.local.yaml
to get user data from microsoft graph. (it might take 5-10 minutes to sync)
catalog:
providers:
microsoftGraphOrg:
default:
tenantId: 7f74c8a2-43ce-46b2-b0e8-b6306cba73a3
queryMode: 'advanced'
user:
filter: accountEnabled eq true and userType eq 'member'
group:
filter: >
startswith(displayName, 'CLOUD_SK')
schedule:
frequency: PT1H
timeout: PT50M
We run with azure on kubernetes, but for local testing create your own app registration in Azure Portal or use an existing one.
Set the following API permissions: email
, offline_access
, openid
, profile
User.Read
.
Also remember to configure the redirect URI to http://localhost:7007/api/auth/github/handler/frame
Configure microsoft auth in app-config.local.yaml
:
auth:
environment: development
providers:
microsoft:
development:
clientId: x
clientSecret: x
tenantId: x
To login you NEED to use the anonymized data from Kartverket in test_data/org.yaml
.
Find a user in test_data/org.yaml
and replace annotations.graph.microsoft.com/user-id
with the object ID (OID) for your Microsoft Account found in Azure Portal.
apiVersion: backstage.io/v1alpha1
kind: User
metadata:
annotations:
graph.microsoft.com/user-id: YOUR-OID-FOUND-IN-ENTRA-ID
name: Lynn.Villanueva_kartverket.dev
namespace: default
uid: 40cdf86d-90a1-44b8-830a-db920aadac82
spec:
memberOf: []
profile:
displayName: Lynn Villanueva
email: Lynn.Villanueva@kartverket.dev
picture: https://i.imgur.com/zcal7OY.jpeg
yarn install
yarn dev
Linguist - Plugin to show languages in github repositories