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
| [Unit] | |
| Description=Vaultwarden | |
| After=docker.service network.target | |
| Requires=docker.service network-online.target | |
| [Service] | |
| RemainAfterExit=true | |
| WorkingDirectory=/home/pi | |
| ExecStartPre=/usr/local/bin/docker-compose pull --quiet | |
| ExecStart=/usr/local/bin/docker-compose up |
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
| [Unit] | |
| Description=schedule vaultwarden backups | |
| [Timer] | |
| OnCalendar=04:00 | |
| Persistent=true | |
| [Install] | |
| WantedBy=multi-user.target |
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
| version: '3' | |
| services: | |
| bitwarden: | |
| image: vaultwarden/server:latest | |
| container_name: vaultwarden | |
| restart: always | |
| environment: | |
| - WEBSOCKET_ENABLED=true | |
| - SIGNUPS_ALLOWED=false |
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
| {$DOMAIN}:443 { | |
| log { | |
| level INFO | |
| output file {$LOG_FILE} { | |
| roll_size 10MB | |
| roll_keep 10 | |
| } | |
| } | |
| # Use the ACME HTTP-01 challenge to get a cert for the configured domain. |
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
| #!/usr/bin/env bash | |
| git remote prune origin && \ | |
| git branch --merged >/tmp/merged-branches && \ | |
| vim /tmp/merged-branches && \ | |
| xargs git branch -d </tmp/merged-branches && \ | |
| rm /tmp/merged-branches |
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
| class MockKJUnitRunner(private val testClass: Class<*>) : Runner() { | |
| private val methodDescriptions: MutableMap<Method, Description> = mutableMapOf() | |
| init { | |
| testClass.methods | |
| .map { method -> | |
| val annotation: Annotation? = method.getAnnotation(Test::class.java) | |
| method to annotation | |
| } |
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
| @RunWith(MockKJUnitRunner::class) | |
| class MyTest { | |
| @InjectMockKs | |
| lateinit var subject: Subject | |
| @MockK | |
| lateinit var mockedDependency: Dependency | |
| } |
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
| @Before | |
| fun setUp() { | |
| MockKAnnotations.init(this, relaxUnitFun = true) | |
| } |
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
| let url_auth = pm.variables.get("keycloak_url")+"/auth/realms/" + pm.variables.get("keycloak_realm") + "/protocol/openid-connect/token"; | |
| let params = "client_id=" + pm.variables.get("keycloak_client_id") | |
| + "&client_secret=" + pm.variables.get("keycloak_client_secret") | |
| + "&grant_type=client_credentials"; | |
| pm.sendRequest( | |
| { | |
| url: url_auth, | |
| method: 'POST', |
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
| let jsonData = JSON.parse(responseBody) | |
| pm.test("Cars have been received", () => { | |
| pm.response.to.have.status(200) | |
| pm.expect(jsonData).to.not.be.undefined | |
| pm.expect(jsonData).to.be.an('array') | |
| pm.expect(jsonData).to.not.be.empty | |
| }); |