You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

217 lines
5.1 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. ***
  2. # Setting up the Nextcloud containers
  3. ## set up http auth in the traefik instance
  4. install apache2 utils and get the user+password in the right format for the docker-compose file
  5. Replace USER and PASS of coursse.
  6. ```bash
  7. suo apt-get install apache2-utils
  8. echo $(htpasswd -nbB <USER> "<PASS>") | sed -e s/\\$/\\$\\$/g
  9. ```
  10. In `docker/compose/docker-compose.yml` fill in the <output> to the right place
  11. In this case, in the beginning, put it under the nextcloud instance.
  12. Then later, when disabling nextcloud-web, uncomment and fill in under traefik middlewares
  13. regarding the labels of the deb-rust-sncf container.
  14. ```
  15. nextcloud-web:
  16. label:
  17. - "traefik.http.routers.nextcloud.middlewares=nextcloud, nextcloud-auth"
  18. - "traefik.http.middlewares.nextcloud-auth.basicauth.users=<output>
  19. ```
  20. ## Further changes in docker/compose/docker-compose.yml
  21. Go to docker-compose.yml and change all AAAAApw to your passwords.
  22. Then change example.org to your domain.
  23. ## Install and start docker compose
  24. Point your domain to the public ip of your server.
  25. Enter the command to start dockerd after installing docker on your host system:
  26. ```bash
  27. sudo systemctl start docker
  28. ```
  29. Install docker-compose on your host os.
  30. In the folder docker/compose do:
  31. ```bash
  32. sudo docker network create proxy
  33. sudo docker-compose up
  34. ```
  35. # Setting up nextcloud with deb-rust-sncf container
  36. ## Configure Nextcloud in the admin panel like in the SNCF Doku
  37. Then open example.org in your favourite browser.
  38. Create the admin account, uncheck install recommended apps.
  39. Do everything as described in sncf (uncheck things in settings, uninstall
  40. everything except forms, apporder).
  41. Except the alternative custom css:
  42. If you want a save button that does nothing than reload (nextcloud does already save realtime)
  43. But our thought was, the realtime saving could be confusing for some users.
  44. custom css code for save button:
  45. ```CSS
  46. #contactsmenu {
  47. display: none !important;
  48. }
  49. #appmenu {
  50. visibility: hidden;
  51. }
  52. #appmenu li:hover a, #appmenu li a:focus {
  53. font-size: 12px;
  54. }
  55. #appmenu li span {
  56. visibility: hidden;
  57. background-color: yellow;
  58. }
  59. #appmenu li svg {
  60. visibility: hidden;
  61. background-color: yellow;
  62. }
  63. #appmenu li a:last-child::after {
  64. content: "Save";
  65. #padding: 10px;
  66. #margin: 10px;
  67. height: 50%;
  68. width: 200%;
  69. padding-top: 7px;
  70. padding-right: 6px;
  71. #padding-bottom: 10px;
  72. padding-left: 10px;
  73. visibility: visible;
  74. background-color: rgba(237, 237, 237, .7);
  75. color: black;
  76. #text-shadow: 0px 0px 8px black;
  77. font-family: "Mono", Courier, monospace;
  78. font-weight: bold;
  79. border: 1px solid rgba(237, 237, 237, .7);
  80. border-radius: 15px;
  81. }
  82. #appmenu li a:last-child:hover:after {
  83. background-color: rgba(237, 237, 237, 0.7);
  84. border: 1px solid rgba(77, 77, 77, 0.3);
  85. #background-color: #fbc617;
  86. visibility: visible;
  87. }
  88. #appmenu li a:last-child:focus:after {
  89. content: "✓Save";
  90. background-color: rgba(237, 237, 237, 0.7);
  91. border: 1px solid rgba(77, 77, 77, 0.3);
  92. #background-color: #fbc617;
  93. visibility: visible;
  94. }
  95. #settings {
  96. display:none !important;
  97. }
  98. .app-sidebar-tabs__content > ul:nth-child(2) {
  99. display:none !important;
  100. }
  101. .app-sidebar-tabs__content > ul:nth-child(4) > li:nth-child(1) {
  102. display:none !important;
  103. }
  104. .app-sidebar-tabs__content > ul:nth-child(4) > li:nth-child(2) {
  105. display:none !important;
  106. }
  107. ```
  108. ## Change nextcloud config for deb-rust-sncf
  109. then changes (with your domain) in config.php
  110. (/opt/docker/overlays/nextcloud/html/config):
  111. ```PHP
  112. 'simpleSignUpLink.shown' => false
  113. 'defaultapp' => 'apporder'
  114. 'trusted_domains' =>
  115. array (
  116. 0 => 'nextcloud-web',
  117. 1 => 'example.org',
  118. ),
  119. 'trusted_proxies' => ['traefik', 'deb-rust-sncf'],
  120. 'overwrite.cli.url' => 'http://example.org',
  121. ```
  122. get the updated config.php in your nextcloud instance with the following command:
  123. ```bash
  124. sudo docker exec -u www-data nextcloud php occ files:scan --all
  125. ```
  126. ## Change nextcloud definition in compose file and uncomment deb-rust-sncf
  127. Then open the docker-compose.yml file, comment all labels of the container
  128. nextcloud-web.
  129. Now uncomment the whole deb-rust-sncf container.
  130. If you want to customize the landing or link page, some files are exposed already
  131. (and then copied in the container during build) in the folder `build/deb-rust-sncf`.
  132. Regarding the sncf proxy, the files link.html and forward.rs have changes.
  133. These changes give the functionality to send the admin link to users mail.
  134. Until now, the post http request and the mail adress are saved in a file on the
  135. container deb-rust-sncf.
  136. ## Configure rust build withing deb-rust-sncf
  137. Go to `docker/build/deb-rust-snc` anyway and make changes in config.toml according
  138. the sncf wiki.
  139. Change the passwords AAAAA and example.org to your domain.
  140. ## Remove and restart all containers
  141. Now stop all containers with either issuing
  142. ```bash
  143. sudo docker-compose stop
  144. ```
  145. or pressing `Ctrl-C`
  146. Delete the WHOLE network with the command
  147. ```bash
  148. sudo docker system prune --all
  149. ```
  150. Then restart with
  151. ```bash
  152. sudo docker-compose up
  153. ```
  154. in the folder `docker/compose`.