2017-06-26 17:04:27 +00:00
#!/bin/bash
2018-02-09 02:19:12 +00:00
# first read settings
source $SNAP/bin/wekan-read-settings &>/dev/null
2018-02-21 18:41:03 +00:00
if [ "$CADDY_ENABLED" = "true" ]; then
# tweak port nunmber as it has been remapped
export PORT=${CADDY_PORT} &>/dev/null
fi
2017-06-26 17:04:27 +00:00
2018-08-14 21:22:46 +03:00
echo -e "Wekan: The open-source kanban.\n"
2018-02-22 11:47:26 +00:00
echo -e "Make sure you have connected all interfaces, check more by calling $ snap interfaces ${SNAP_NAME}"
2017-06-26 17:04:27 +00:00
echo -e "\n"
2018-02-22 11:47:26 +00:00
echo -e "${SNAP_NAME} has multiple services, to check status use systemctl"
echo -e "\t$ systemctl status snap.$SNAP_NAME.*"
2017-06-26 17:04:27 +00:00
echo -e "\n"
echo -e "To make backup of wekan's database use: $ ${SNAP_NAME}.database-backup [backup file]"
echo -e "\t backup file is optional parameter, if not passed backup is created in directory:"
echo -e "\t\t${SNAP_COMMON}/db-backups"
echo -e "To list existing backups in default directory: $ ${SNAP_NAME}.database-list-backups"
echo -e "To restore wekan's database use: ${SNAP_NAME}.database-restore <path to backup>"
echo -e "\n"
echo -e "wekan can be configured to share mongodb with other services using content interface"
echo -e "\t-sharing mongodb from $SNAP_NAME to other snap(s):"
echo -e "\t\t-connect mongodb-slot with plug from corresponding snap(s)"
echo -e "\t\t-configure corresponding service to use mongodb unix socket in shared directory, socket file name is: mongodb-$MONGODB_PORT.sock"
echo -e "\t-sharing mongodb from other snap to $SNAP_NAME:"
echo -e "\t\t-connect mongodb-plug with slot from snap providing mongodb"
echo -e "\t\t-disable mongodb in $SNAP_NAME by calling: $ snap set $SNAP_NAME set disable-mongodb='true'"
echo -e "\t\t-set mongodb-bind-unix-socket to point to serving mongodb. Use relative path inside shared directory, e.g run/mongodb-27017.sock"
echo -e "\n"
2018-07-24 18:09:30 +02:00
echo -e "To enable the API of wekan:"
echo -e "\t$ snap set $SNAP_NAME WITH_API='true'"
echo -e "\t-Disable the API:"
echo -e "\t$ snap set $SNAP_NAME WITH_API='false'"
2018-08-13 19:24:07 +03:00
echo -e "\n"
echo -e "Enable browser policy and allow one trusted URL that can have iframe that has Wekan embedded inside."
echo -e "\t\t Setting this to false is not recommended, it also disables all other browser policy protections"
echo -e "\t\t and allows all iframing etc. See wekan/server/policy.js"
echo -e "To enable the Content Policy of Wekan:"
echo -e "\t$ snap set $SNAP_NAME CONTENT_POLICY_ENABLED='true'"
echo -e "\t-Disable the Content Policy of Wekan:"
echo -e "\t$ snap set $SNAP_NAME CONTENT_POLICY_ENABLED='false'"
echo -e "\n"
echo -e "When browser policy is enabled, HTML code at this URL can have iframe that embeds Wekan inside."
echo -e "To enable the Trusted URL of Wekan:"
echo -e "\t$ snap set $SNAP_NAME TRUSTED_URL='https://example.com'"
echo -e "\t-Disable the Trusted URL of Wekan:"
echo -e "\t$ snap set $SNAP_NAME TRUSTED_URL=''"
echo -e "\n"
2018-08-22 22:19:06 +03:00
echo -e "What to send to Outgoing Webhook, or leave out. Example, that includes all that are default: cardId,listId,oldListId,boardId,comment,user,card,commentId ."
echo -e "To enable the Webhooks Attributes of Wekan:"
echo -e "\t$ snap set $SNAP_NAME WEBHOOKS_ATTRIBUTES='cardId,listId,oldListId,boardId,comment,user,card,commentId'"
2018-08-22 22:35:52 +03:00
echo -e "\t-Disable the Webhooks Attributes of Wekan to send all default ones:"
2018-08-22 22:19:06 +03:00
echo -e "\t$ snap set $SNAP_NAME WEBHOOKS_ATTRIBUTES=''"
echo -e "\n"
2018-08-25 00:49:02 +03:00
echo -e "OAuth2 Client ID, for example from Rocket.Chat. Example: abcde12345"
echo -e "To enable the OAuth2 Client ID of Wekan:"
echo -e "\t$ snap set $SNAP_NAME OAUTH2_CLIENT_ID='54321abcde'"
echo -e "\t-Disable the OAuth2 Client ID of Wekan:"
echo -e "\t$ snap set $SNAP_NAME OAUTH2_CLIENT_ID=''"
echo -e "\n"
echo -e "OAuth2 Secret, for example from Rocket.Chat. Example: 54321abcde"
echo -e "To enable the OAuth2 Secret of Wekan:"
echo -e "\t$ snap set $SNAP_NAME OAUTH2_SECRET='54321abcde'"
echo -e "\t-Disable the OAuth2 Secret of Wekan:"
echo -e "\t$ snap set $SNAP_NAME OAUTH2_SECRET=''"
echo -e "\n"
echo -e "OAuth2 Server URL, for example Rocket.Chat. Example: https://chat.example.com"
echo -e "To enable the OAuth2 Server URL of Wekan:"
echo -e "\t$ snap set $SNAP_NAME OAUTH2_SERVER_URL='https://chat.example.com'"
echo -e "\t-Disable the OAuth2 Server URL of Wekan:"
echo -e "\t$ snap set $SNAP_NAME OAUTH2_SERVER_URL=''"
echo -e "\n"
echo -e "OAuth2 Server URL, for example Rocket.Chat. Example: https://chat.example.com"
echo -e "To enable the OAuth2 Server URL of Wekan:"
echo -e "\t$ snap set $SNAP_NAME OAUTH2_SERVER_URL='https://chat.example.com'"
echo -e "\t-Disable the OAuth2 Server URL of Wekan:"
echo -e "\t$ snap set $SNAP_NAME OAUTH2_SERVER_URL=''"
echo -e "\n"
2018-08-28 19:01:00 +03:00
echo -e "OAuth2 Authorization Endpoint. Example: /oauth/authorize"
2018-08-25 00:49:02 +03:00
echo -e "To enable the OAuth2 Authorization Endpoint of Wekan:"
echo -e "\t$ snap set $SNAP_NAME OAUTH2_AUTH_ENDPOINT='/oauth/authorize'"
echo -e "\t-Disable the OAuth2 Authorization Endpoint of Wekan:"
echo -e "\t$ snap set $SNAP_NAME OAUTH2_AUTH_ENDPOINT=''"
echo -e "\n"
2018-08-28 19:01:00 +03:00
echo -e "OAuth2 Userinfo Endpoint. Example: /oauth/userinfo"
2018-08-25 00:49:02 +03:00
echo -e "To enable the OAuth2 Userinfo Endpoint of Wekan:"
echo -e "\t$ snap set $SNAP_NAME OAUTH2_USERINFO_ENDPOINT='/oauth/authorize'"
echo -e "\t-Disable the OAuth2 Userinfo Endpoint of Wekan:"
echo -e "\t$ snap set $SNAP_NAME OAUTH2_USERINFO_ENDPOINT=''"
echo -e "\n"
2018-08-28 19:01:00 +03:00
echo -e "OAuth2 Token Endpoint. Example: /oauth/token"
2018-08-25 00:49:02 +03:00
echo -e "To enable the OAuth2 Token Endpoint of Wekan:"
echo -e "\t$ snap set $SNAP_NAME OAUTH2_TOKEN_ENDPOINT='/oauth/token'"
echo -e "\t-Disable the OAuth2 Token Endpoint of Wekan:"
echo -e "\t$ snap set $SNAP_NAME OAUTH2_TOKEN_ENDPOINT=''"
echo -e "\n"
2017-06-26 17:04:27 +00:00
# parse config file for supported settings keys
echo -e "wekan supports settings keys"
echo -e "values can be changed by calling\n$ snap set $SNAP_NAME <key name>='<key value>'"
echo -e "list of supported keys:"
for key in ${keys[@]}
do
default_value="DEFAULT_$key"
description="DESCRIPTION_$key"
snappy_key="KEY_$key"
echo -e "\t${!snappy_key}: ${!description}"
if [ "x" == "x${!key}" ]; then
echo -e "\t\tNo value set, using default value: '${!default_value}'"
else
echo -e "\t\tCurrent value set to: '${!key}', (default value: '${!default_value}')"
fi
done
2017-11-06 10:47:24 +00:00
echo -e "\n!!!! Some changes result in restart of some or all services, use with caution !!!!!"