start-wekan.sh 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. #!/bin/bash
  2. function wekan_repo_check(){
  3. git_remotes="$(git remote show 2>/dev/null)"
  4. res=""
  5. for i in $git_remotes; do
  6. res="$(git remote get-url $i | sed 's/.*wekan\/wekan.*/wekan\/wekan/')"
  7. if [[ "$res" == "wekan/wekan" ]]; then
  8. break
  9. fi
  10. done
  11. if [[ "$res" != "wekan/wekan" ]]; then
  12. echo "$PWD is not a wekan repository"
  13. exit;
  14. fi
  15. }
  16. # If you want to restart even on crash, uncomment while and done lines.
  17. #while true; do
  18. wekan_repo_check
  19. cd .build/bundle
  20. #---------------------------------------------
  21. # Debug OIDC OAuth2 etc.
  22. #export DEBUG=true
  23. #---------------------------------------------
  24. export MONGO_URL='mongodb://127.0.0.1:27019/wekan'
  25. #---------------------------------------------
  26. # Production: https://example.com/wekan
  27. # Local: http://localhost:2000
  28. #export ipaddress=$(ifdata -pa eth0)
  29. export ROOT_URL='http://localhost:2000'
  30. #---------------------------------------------
  31. # https://github.com/wekan/wekan/wiki/Troubleshooting-Mail
  32. # https://github.com/wekan/wekan-mongodb/blob/master/docker-compose.yml
  33. export MAIL_URL='smtp://user:pass@mailserver.example.com:25/'
  34. #---------------------------------------------
  35. #export KADIRA_OPTIONS_ENDPOINT=http://127.0.0.1:11011
  36. #---------------------------------------------
  37. # This is local port where Wekan Node.js runs, same as below on Caddyfile settings.
  38. export PORT=2000
  39. #---------------------------------------------
  40. # Wekan Export Board works when WITH_API=true.
  41. # If you disable Wekan API with false, Export Board does not work.
  42. export WITH_API='true'
  43. #---------------------------------------------------------------
  44. # ==== PASSWORD BRUTE FORCE PROTECTION ====
  45. #https://atmospherejs.com/lucasantoniassi/accounts-lockout
  46. #Defaults below. Uncomment to change. wekan/server/accounts-lockout.js
  47. #export ACCOUNTS_LOCKOUT_KNOWN_USERS_FAILURES_BEFORE=3
  48. #export ACCOUNTS_LOCKOUT_KNOWN_USERS_PERIOD=60
  49. #export ACCOUNTS_LOCKOUT_KNOWN_USERS_FAILURE_WINDOW=15
  50. #export ACCOUNTS_LOCKOUT_UNKNOWN_USERS_FAILURES_BERORE=3
  51. #export ACCOUNTS_LOCKOUT_UNKNOWN_USERS_LOCKOUT_PERIOD=60
  52. #export ACCOUNTS_LOCKOUT_UNKNOWN_USERS_FAILURE_WINDOW=15
  53. #---------------------------------------------
  54. # CORS: Set Access-Control-Allow-Origin header. Example: *
  55. #export CORS=*
  56. #---------------------------------------------
  57. ## Optional: Integration with Matomo https://matomo.org that is installed to your server
  58. ## The address of the server where Matomo is hosted:
  59. ##export MATOMO_ADDRESS=https://example.com/matomo
  60. #export MATOMO_ADDRESS=
  61. ## The value of the site ID given in Matomo server for Wekan
  62. # Example: export MATOMO_SITE_ID=123456789
  63. #export MATOMO_SITE_ID=''
  64. ## The option do not track which enables users to not be tracked by matomo"
  65. #Example: export MATOMO_DO_NOT_TRACK=false
  66. #export MATOMO_DO_NOT_TRACK=true
  67. ## The option that allows matomo to retrieve the username:
  68. # Example: export MATOMO_WITH_USERNAME=true
  69. #export MATOMO_WITH_USERNAME='false'
  70. # Enable browser policy and allow one trusted URL that can have iframe that has Wekan embedded inside.
  71. # Setting this to false is not recommended, it also disables all other browser policy protections
  72. # and allows all iframing etc. See wekan/server/policy.js
  73. # Default value: true
  74. export BROWSER_POLICY_ENABLED=true
  75. # When browser policy is enabled, HTML code at this Trusted URL can have iframe that embeds Wekan inside.
  76. # Example: export TRUSTED_URL=http://example.com
  77. export TRUSTED_URL=''
  78. # What to send to Outgoing Webhook, or leave out. Example, that includes all that are default: cardId,listId,oldListId,boardId,comment,user,card,commentId .
  79. # Example: export WEBHOOKS_ATTRIBUTES=cardId,listId,oldListId,boardId,comment,user,card,commentId
  80. export WEBHOOKS_ATTRIBUTES=''
  81. #---------------------------------------------
  82. # ==== OAUTH2 AZURE ====
  83. # https://github.com/wekan/wekan/wiki/Azure
  84. # 1) Register the application with Azure. Make sure you capture
  85. # the application ID as well as generate a secret key.
  86. # 2) Configure the environment variables. This differs slightly
  87. # by installation type, but make sure you have the following:
  88. #export OAUTH2_ENABLED=true
  89. # OAuth2 docs: https://github.com/wekan/wekan/wiki/OAuth2
  90. # OAuth2 login style: popup or redirect.
  91. #export OAUTH2_LOGIN_STYLE=redirect
  92. # Application GUID captured during app registration:
  93. #export OAUTH2_CLIENT_ID=xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx
  94. # Secret key generated during app registration:
  95. #export OAUTH2_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  96. #export OAUTH2_SERVER_URL=https://login.microsoftonline.com/
  97. #export OAUTH2_AUTH_ENDPOINT=/oauth2/v2.0/authorize
  98. #export OAUTH2_USERINFO_ENDPOINT=https://graph.microsoft.com/oidc/userinfo
  99. #export OAUTH2_TOKEN_ENDPOINT=/oauth2/v2.0/token
  100. # The claim name you want to map to the unique ID field:
  101. #export OAUTH2_ID_MAP=email
  102. # The claim name you want to map to the username field:
  103. #export OAUTH2_USERNAME_MAP=email
  104. # The claim name you want to map to the full name field:
  105. #export OAUTH2_FULLNAME_MAP=name
  106. # The claim name you want to map to the email field:
  107. #export OAUTH2_EMAIL_MAP=email
  108. #-----------------------------------------------------------------
  109. # ==== OAUTH2 KEYCLOAK ====
  110. # https://github.com/wekan/wekan/wiki/Keycloak <== MAPPING INFO, REQUIRED
  111. #export OAUTH2_ENABLED=true
  112. # OAuth2 login style: popup or redirect.
  113. #export OAUTH2_LOGIN_STYLE=redirect
  114. #export OAUTH2_CLIENT_ID=<Keycloak create Client ID>
  115. #export OAUTH2_SERVER_URL=<Keycloak server name>/auth
  116. #export OAUTH2_AUTH_ENDPOINT=/realms/<keycloak realm>/protocol/openid-connect/auth
  117. #export OAUTH2_USERINFO_ENDPOINT=/realms/<keycloak realm>/protocol/openid-connect/userinfo
  118. #export OAUTH2_TOKEN_ENDPOINT=/realms/<keycloak realm>/protocol/openid-connect/token
  119. #export OAUTH2_SECRET=<keycloak client secret>
  120. #-----------------------------------------------------------------
  121. # ==== OAUTH2 DOORKEEPER ====
  122. # OAuth2 docs: https://github.com/wekan/wekan/wiki/OAuth2
  123. # https://github.com/wekan/wekan/issues/1874
  124. # https://github.com/wekan/wekan/wiki/OAuth2
  125. # Enable the OAuth2 connection
  126. #export OAUTH2_ENABLED=true
  127. # OAuth2 login style: popup or redirect.
  128. #export OAUTH2_LOGIN_STYLE=redirect
  129. # OAuth2 Client ID.
  130. #export OAUTH2_CLIENT_ID=abcde12345
  131. # OAuth2 Secret.
  132. #export OAUTH2_SECRET=54321abcde
  133. # OAuth2 Server URL.
  134. #export OAUTH2_SERVER_URL=https://chat.example.com
  135. # OAuth2 Authorization Endpoint.
  136. #export OAUTH2_AUTH_ENDPOINT=/oauth/authorize
  137. # OAuth2 Userinfo Endpoint.
  138. #export OAUTH2_USERINFO_ENDPOINT=/oauth/userinfo
  139. # OAuth2 Token Endpoint.
  140. #export OAUTH2_TOKEN_ENDPOINT=/oauth/token
  141. # OAuth2 ID Mapping
  142. #export OAUTH2_ID_MAP=
  143. # OAuth2 Username Mapping
  144. #export OAUTH2_USERNAME_MAP=
  145. # OAuth2 Fullname Mapping
  146. #export OAUTH2_FULLNAME_MAP=
  147. # OAuth2 Email Mapping
  148. #export OAUTH2_EMAIL_MAP=
  149. #---------------------------------------------
  150. # LDAP_ENABLE : Enable or not the connection by the LDAP
  151. # example : export LDAP_ENABLE=true
  152. #export LDAP_ENABLE=false
  153. # LDAP_PORT : The port of the LDAP server
  154. # example : export LDAP_PORT=389
  155. #export LDAP_PORT=389
  156. # LDAP_HOST : The host server for the LDAP server
  157. # example : export LDAP_HOST=localhost
  158. #export LDAP_HOST=
  159. # LDAP_BASEDN : The base DN for the LDAP Tree
  160. # example : export LDAP_BASEDN=ou=user,dc=example,dc=org
  161. #export LDAP_BASEDN=
  162. # LDAP_LOGIN_FALLBACK : Fallback on the default authentication method
  163. # example : export LDAP_LOGIN_FALLBACK=true
  164. #export LDAP_LOGIN_FALLBACK=false
  165. # LDAP_RECONNECT : Reconnect to the server if the connection is lost
  166. # example : export LDAP_RECONNECT=false
  167. #export LDAP_RECONNECT=true
  168. # LDAP_TIMEOUT : Overall timeout, in milliseconds
  169. # example : export LDAP_TIMEOUT=12345
  170. #export LDAP_TIMEOUT=10000
  171. # LDAP_IDLE_TIMEOUT : Specifies the timeout for idle LDAP connections in milliseconds
  172. # example : export LDAP_IDLE_TIMEOUT=12345
  173. #export LDAP_IDLE_TIMEOUT=10000
  174. # LDAP_CONNECT_TIMEOUT : Connection timeout, in milliseconds
  175. # example : export LDAP_CONNECT_TIMEOUT=12345
  176. #export LDAP_CONNECT_TIMEOUT=10000
  177. # LDAP_AUTHENTIFICATION : If the LDAP needs a user account to search
  178. # example : export LDAP_AUTHENTIFICATION=true
  179. #export LDAP_AUTHENTIFICATION=false
  180. # LDAP_AUTHENTIFICATION_USERDN : The search user DN
  181. # example : export LDAP_AUTHENTIFICATION_USERDN=cn=admin,dc=example,dc=org
  182. #export LDAP_AUTHENTIFICATION_USERDN=
  183. # LDAP_AUTHENTIFICATION_PASSWORD : The password for the search user
  184. # example : AUTHENTIFICATION_PASSWORD=admin
  185. #export LDAP_AUTHENTIFICATION_PASSWORD=
  186. # LDAP_LOG_ENABLED : Enable logs for the module
  187. # example : export LDAP_LOG_ENABLED=true
  188. #export LDAP_LOG_ENABLED=false
  189. # LDAP_BACKGROUND_SYNC : If the sync of the users should be done in the background
  190. # example : export LDAP_BACKGROUND_SYNC=true
  191. #export LDAP_BACKGROUND_SYNC=false
  192. # LDAP_BACKGROUND_SYNC_INTERVAL : At which interval does the background task sync in milliseconds
  193. # example : export LDAP_BACKGROUND_SYNC_INTERVAL=12345
  194. #export LDAP_BACKGROUND_SYNC_INTERVAL=100
  195. # LDAP_BACKGROUND_SYNC_KEEP_EXISTANT_USERS_UPDATED :
  196. # example : export LDAP_BACKGROUND_SYNC_KEEP_EXISTANT_USERS_UPDATED=true
  197. #export LDAP_BACKGROUND_SYNC_KEEP_EXISTANT_USERS_UPDATED=false
  198. # LDAP_BACKGROUND_SYNC_IMPORT_NEW_USERS :
  199. # example : export LDAP_BACKGROUND_SYNC_IMPORT_NEW_USERS=true
  200. #export LDAP_BACKGROUND_SYNC_IMPORT_NEW_USERS=false
  201. # LDAP_ENCRYPTION : If using LDAPS
  202. # example : export LDAP_ENCRYPTION=ssl
  203. #export LDAP_ENCRYPTION=false
  204. # LDAP_CA_CERT : The certification for the LDAPS server. Certificate needs to be included in this docker-compose.yml file.
  205. # example : export LDAP_CA_CERT=-----BEGIN CERTIFICATE-----MIIE+zCCA+OgAwIBAgIkAhwR/6TVLmdRY6hHxvUFWc0+Enmu/Hu6cj+G2FIdAgIC...-----END CERTIFICATE-----
  206. #export LDAP_CA_CERT=
  207. # LDAP_REJECT_UNAUTHORIZED : Reject Unauthorized Certificate
  208. # example : export LDAP_REJECT_UNAUTHORIZED=true
  209. #export LDAP_REJECT_UNAUTHORIZED=false
  210. # LDAP_USER_SEARCH_FILTER : Optional extra LDAP filters. Don't forget the outmost enclosing parentheses if needed
  211. # example : export LDAP_USER_SEARCH_FILTER=
  212. #export LDAP_USER_SEARCH_FILTER=
  213. # LDAP_USER_SEARCH_SCOPE : base (search only in the provided DN), one (search only in the provided DN and one level deep), or sub (search the whole subtree)
  214. # example : export LDAP_USER_SEARCH_SCOPE=one
  215. #export LDAP_USER_SEARCH_SCOPE=
  216. # LDAP_USER_SEARCH_FIELD : Which field is used to find the user
  217. # example : export LDAP_USER_SEARCH_FIELD=uid
  218. #export LDAP_USER_SEARCH_FIELD=
  219. # LDAP_SEARCH_PAGE_SIZE : Used for pagination (0=unlimited)
  220. # example : export LDAP_SEARCH_PAGE_SIZE=12345
  221. #export LDAP_SEARCH_PAGE_SIZE=0
  222. # LDAP_SEARCH_SIZE_LIMIT : The limit number of entries (0=unlimited)
  223. # example : export LDAP_SEARCH_SIZE_LIMIT=12345
  224. #export LDAP_SEARCH_SIZE_LIMIT=0
  225. # LDAP_GROUP_FILTER_ENABLE : Enable group filtering
  226. # example : export LDAP_GROUP_FILTER_ENABLE=true
  227. #export LDAP_GROUP_FILTER_ENABLE=false
  228. # LDAP_GROUP_FILTER_OBJECTCLASS : The object class for filtering
  229. # example : export LDAP_GROUP_FILTER_OBJECTCLASS=group
  230. #export LDAP_GROUP_FILTER_OBJECTCLASS=
  231. # LDAP_GROUP_FILTER_GROUP_ID_ATTRIBUTE :
  232. # example :
  233. #export LDAP_GROUP_FILTER_GROUP_ID_ATTRIBUTE=
  234. # LDAP_GROUP_FILTER_GROUP_MEMBER_ATTRIBUTE :
  235. # example :
  236. #export LDAP_GROUP_FILTER_GROUP_MEMBER_ATTRIBUTE=
  237. # LDAP_GROUP_FILTER_GROUP_MEMBER_FORMAT :
  238. # example :
  239. #export LDAP_GROUP_FILTER_GROUP_MEMBER_FORMAT=
  240. # LDAP_GROUP_FILTER_GROUP_NAME :
  241. # example :
  242. #export LDAP_GROUP_FILTER_GROUP_NAME=
  243. # LDAP_UNIQUE_IDENTIFIER_FIELD : This field is sometimes class GUID (Globally Unique Identifier)
  244. # example : export LDAP_UNIQUE_IDENTIFIER_FIELD=guid
  245. #export LDAP_UNIQUE_IDENTIFIER_FIELD=
  246. # LDAP_UTF8_NAMES_SLUGIFY : Convert the username to utf8
  247. # example : export LDAP_UTF8_NAMES_SLUGIFY=false
  248. #export LDAP_UTF8_NAMES_SLUGIFY=true
  249. # LDAP_USERNAME_FIELD : Which field contains the ldap username
  250. # example : export LDAP_USERNAME_FIELD=username
  251. #export LDAP_USERNAME_FIELD=
  252. # LDAP_FULLNAME_FIELD : Which field contains the ldap fullname
  253. # example : export LDAP_FULLNAME_FIELD=fullname
  254. #export LDAP_FULLNAME_FIELD=
  255. # LDAP_MERGE_EXISTING_USERS :
  256. # example : export LDAP_MERGE_EXISTING_USERS=true
  257. #export LDAP_MERGE_EXISTING_USERS=false
  258. # LDAP_EMAIL_MATCH_ENABLE : allow existing account matching by e-mail address when username does not match
  259. # example: LDAP_EMAIL_MATCH_ENABLE=true
  260. #export LDAP_EMAIL_MATCH_ENABLE=false
  261. # LDAP_EMAIL_MATCH_REQUIRE : require existing account matching by e-mail address when username does match
  262. # example: LDAP_EMAIL_MATCH_REQUIRE=true
  263. #export LDAP_EMAIL_MATCH_REQUIRE=false
  264. # LDAP_EMAIL_MATCH_VERIFIED : require existing account email address to be verified for matching
  265. # example: LDAP_EMAIL_MATCH_VERIFIED=true
  266. #export LDAP_EMAIL_MATCH_VERIFIED=false
  267. # LDAP_EMAIL_FIELD : which field contains the LDAP e-mail address
  268. # example: LDAP_EMAIL_FIELD=mail
  269. #export LDAP_EMAIL_FIELD=
  270. # LDAP_SYNC_USER_DATA :
  271. # example : export LDAP_SYNC_USER_DATA=true
  272. #export LDAP_SYNC_USER_DATA=false
  273. # LDAP_SYNC_USER_DATA_FIELDMAP :
  274. # example : export LDAP_SYNC_USER_DATA_FIELDMAP={"cn":"name", "mail":"email"}
  275. #export LDAP_SYNC_USER_DATA_FIELDMAP=
  276. # LDAP_SYNC_GROUP_ROLES :
  277. # example :
  278. #export LDAP_SYNC_GROUP_ROLES=
  279. # LDAP_DEFAULT_DOMAIN : The default domain of the ldap it is used to create email if the field is not map correctly with the LDAP_SYNC_USER_DATA_FIELDMAP
  280. # example :
  281. #export LDAP_DEFAULT_DOMAIN=
  282. # Enable/Disable syncing of admin status based on ldap groups:
  283. #export LDAP_SYNC_ADMIN_STATUS=true
  284. # Comma separated list of admin group names to sync.
  285. #export LDAP_SYNC_ADMIN_GROUPS=group1,group2
  286. #---------------------------------------------------------------------
  287. # Login to LDAP automatically with HTTP header.
  288. # In below example for siteminder, at right side of = is header name.
  289. #export HEADER_LOGIN_ID=HEADERUID
  290. #export HEADER_LOGIN_FIRSTNAME=HEADERFIRSTNAME
  291. #export HEADER_LOGIN_LASTNAME=HEADERLASTNAME
  292. #export HEADER_LOGIN_EMAIL=HEADEREMAILADDRESS
  293. #---------------------------------------------------------------------
  294. # LOGOUT_WITH_TIMER : Enables or not the option logout with timer
  295. # example : LOGOUT_WITH_TIMER=true
  296. #export LOGOUT_WITH_TIMER=
  297. # LOGOUT_IN : The number of days
  298. # example : LOGOUT_IN=1
  299. #export LOGOUT_IN=
  300. #export LOGOUT_ON_HOURS=
  301. # LOGOUT_ON_MINUTES : The number of minutes
  302. # example : LOGOUT_ON_MINUTES=55
  303. #export LOGOUT_ON_MINUTES=
  304. node main.js
  305. # & >> ../../wekan.log
  306. cd ../..
  307. #done