Skip to content

Commit

Permalink
Predefined service: Monica (#230)
Browse files Browse the repository at this point in the history
* Add predefined service template for Monica

* Add Readme

* Adjust access rights

* Fix bugs

* Fix typo

* Fix race condition in test
  • Loading branch information
marcauberer committed Nov 17, 2021
1 parent 3d61be3 commit bc6f0b3
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 19 deletions.
26 changes: 13 additions & 13 deletions docs/docs/supported-services.md

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions predefined-services/backend/monica/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Monica
Monica is an open-source personal relationship management system to organize interactions with the people around you.

### Setup
Monica is considered as backend service and can therefore be found in backends collection, when generating the compose configuration with Compose Generator.
56 changes: 56 additions & 0 deletions predefined-services/backend/monica/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"label": "Monica",
"preselected": "false",
"proxied": true,
"files": [
{
"path": "service.yml",
"type": "service"
},
{
"path": "README.md",
"type": "docs"
},
{
"path": "environment.env",
"type": "env"
}
],
"questions": [
{
"text": "On which url is your Monica instance accessible from the outside?",
"type": 2,
"defaultValue": "http://localhost",
"validator": "url",
"variable": "MONICA_APP_URL"
},
{
"text": "On which port you want to expose your Monica instance?",
"type": 2,
"defaultValue": "80",
"validator": "port",
"variable": "MONICA_PORT"
},
{
"text": "Which version of Monica do you want to use?",
"type": 2,
"defaultValue": "3.4",
"variable": "MONICA_VERSION"
}
],
"volumes": [
{
"text": "Custom path for Monica data volume?",
"defaultValue": "./volumes/monica-data",
"variable": "VOLUME_MONICA_DATA",
"advanced": true
}
],
"secrets": [
{
"name": "Monica app key",
"variable": "_PW_MONICA_APP_KEY",
"length": 32
}
]
}
8 changes: 8 additions & 0 deletions predefined-services/backend/monica/environment.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
DB_HOST=database-mysql
DB_DATABASE=${{MYSQL_DATABASE}}
DB_USERNAME=${{MYSQL_USER}}
DB_PASSWORD=${{_PW_MYSQL_USER}}
APP_ENV=production
APP_KEY=${{_PW_MONICA_APP_KEY}}
APP_URL=${{MONICA_APP_URL}}
APP_FORCE_URL=true
11 changes: 11 additions & 0 deletions predefined-services/backend/monica/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
image: monica:${{MONICA_VERSION}}
container_name: ${{PROJECT_NAME_CONTAINER}}-backend-monica
restart: always
networks:
- backend-database
ports:
- ${{MONICA_PORT}}:80
volumes:
- ${{VOLUME_MONICA_DATA}}:/var/www/html/storage
env_file:
- environment.env
2 changes: 1 addition & 1 deletion predefined-services/database/mysql/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"label": "MySQL",
"preselected": "services.frontend contains name == \"wordpress\" | services.frontend contains name == \"nextcloud\" | services.frontend contains name == \"owncloud\" | services.frontend contains name == \"matomo\" | services.frontend contains name == \"ghost\" | services.frontend contains name == \"drupal\" | services.frontend contains name == \"mediawiki\" | services.backend contains name == \"live-poll-api\"",
"preselected": "services.frontend contains name == \"wordpress\" | services.frontend contains name == \"nextcloud\" | services.frontend contains name == \"owncloud\" | services.frontend contains name == \"matomo\" | services.frontend contains name == \"ghost\" | services.frontend contains name == \"drupal\" | services.frontend contains name == \"mediawiki\" | services.backend contains name == \"live-poll-api\" | services.backend contains name == \"monica\"",
"proxied": false,
"files": [
{
Expand Down
9 changes: 4 additions & 5 deletions src/cmd/template-load_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,10 @@ func TestShowTemplateList1(t *testing.T) {
plCallCount := 0
pl = func(text string) {
plCallCount++
if plCallCount == 1 {
assert.Equal(t, "Template 1 (Saved at: Sep-25-21 2:20:23 PM)", text)
} else {
assert.Equal(t, "Template 2 (Saved at: Sep-25-21 2:21:01 PM)", text)
}
assert.Contains(t, []string{
"Template 1 (Saved at: Sep-25-21 2:20:23 PM)",
"Template 2 (Saved at: Sep-25-21 2:21:01 PM)",
}, text)
}
// Execute test
showTemplateList()
Expand Down

0 comments on commit bc6f0b3

Please sign in to comment.