This file contains hidden or 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
| # copy file from container to your host system | |
| docker cp 70e320193513:/tmp/export.json export.json |
This file contains hidden or 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
| # login to your running keycloak container instance | |
| docker exec -it 70e320193513 bash | |
| # inside the container: | |
| /opt/jboss/keycloak/bin/standalone.sh \ | |
| -Djboss.socket.binding.port-offset=100 \ | |
| -Dkeycloak.migration.action=export \ | |
| -Dkeycloak.migration.provider=singleFile \ | |
| -Dkeycloak.migration.realmName=master \ | |
| -Dkeycloak.migration.usersExportStrategy=REALM_FILE \ |
This file contains hidden or 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
| # start keycloak | |
| docker run --publish 8080:8080 jboss/keycloak:11.0.2 | |
| # set up initial user | |
| docker exec 70e320193513 /opt/jboss/keycloak/bin/add-user-keycloak.sh -u admin -p admin | |
| docker restart 70e320193513 |
This file contains hidden or 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
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: traefik | |
| spec: | |
| replicas: 1 | |
| selector: | |
| matchLabels: | |
| app: traefik | |
| release: traefik |
This file contains hidden or 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
| apiVersion: traefik.containo.us/v1alpha1 | |
| kind: IngressRoute | |
| metadata: | |
| name: whoami | |
| spec: | |
| entryPoints: | |
| - websecure | |
| routes: | |
| - match: Host(`example.com`) && PathPrefix(/whoami`) | |
| kind: Rule |
This file contains hidden or 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
| public enum SearchType | |
| { | |
| GUID = 1, | |
| ID = 2, | |
| NAME = 3, | |
| UNDEFINED = 0 | |
| } | |
| public Computer GetComputer(string search) | |
| { |
This file contains hidden or 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
| public Computer GetComputer(string search) | |
| { | |
| // | |
| // guard | |
| // | |
| if (search is null) | |
| { | |
| return null; | |
| } |
This file contains hidden or 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
| public Computer GetComputer(string search) | |
| { | |
| Computer computer = null; | |
| if (search is null) | |
| search = string.Empty; | |
| if (search.ToUpper().StartsWith("GUID:") && search.Length >= 6 && Guid.TryParse(search.Substring(5), out Guid newGuid)) | |
| { | |
| computer = GetComputerByGUID(search); | |
| if (computer == null) |
This file contains hidden or 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
| # | |
| # functions | |
| # | |
| Function Edit-Hosts { | |
| # execute notepad++ in elevated mode | |
| Start-Process C:\"Program Files"\Notepad++\notepad++.exe -Verb runAs -ArgumentList c:\Windows\System32\Drivers\etc\hosts | |
| } |
This file contains hidden or 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
| import keycloak from 'keycloak-admin'; | |
| // | |
| // init | |
| // | |
| const kcAdminClient = new keycloak.default({ | |
| baseUrl: 'https://demo.com/auth', | |
| realmName: 'master' | |
| }); |