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.

188 lines
4.2 KiB

10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
  1. # Installation
  2. ## Prerequisites
  3. You will need a Twitter API key to make BirdsiteLIVE working. First create an **Standalone App** in the [Twitter developer portal](https://developer.twitter.com/en/portal/projects-and-apps) and retrieve the API Key and API Secret Key.
  4. ## Server prerequisites
  5. Your instance will need [docker](https://docs.docker.com/engine/install/) and [docker-compose](https://docs.docker.com/compose/install/) installed and working.
  6. ## Setup
  7. Download the [docker-compose file](https://git.gamers.exposed/pasture/BirdsiteLIVE/raw/branch/master/docker-compose.yml):
  8. ```
  9. sudo curl -L https://git.gamers.exposed/pasture/BirdsiteLIVE/raw/branch/master/docker-compose.yml -o docker-compose.yml
  10. ```
  11. Then edit file:
  12. ```
  13. sudo nano docker-compose.yml
  14. ```
  15. ### Attributes to change in the docker-compose file
  16. #### Personal info
  17. * `Instance:Domain` the domain name you'll be using, for example use `birdsite.live` for the URL `https://birdsite.live`
  18. * `Instance:AdminEmail` the admin's email, will be displayed in the instance /.well-known/nodeinfo endpoint
  19. * `Twitter:ConsumerKey` the Twitter API key
  20. * `Twitter:ConsumerSecret` the Twitter API secret key
  21. #### Database credentials
  22. The database credentials must be changed the same way in the **server** and **db** section.
  23. * database name:
  24. * `Db:Name`
  25. * `POSTGRES_DB`
  26. * database user name:
  27. * `Db:User`
  28. * `POSTGRES_USER`
  29. * database user password:
  30. * `Db:Password`
  31. * `POSTGRES_PASSWORD`
  32. ## Startup
  33. Launch the app with:
  34. ```
  35. docker-compose up -d
  36. ```
  37. By default the app will be available on the port 5000
  38. ## Nginx
  39. On a Debian based distrib:
  40. ```
  41. sudo apt update
  42. sudo apt install nginx
  43. ```
  44. Check nginx status:
  45. ```
  46. sudo systemctl status nginx
  47. ```
  48. ### Create nginx configuration
  49. Create your nginx configuration
  50. ```
  51. sudo nano /etc/nginx/sites-enabled/{your-domain-name.com}
  52. ```
  53. And fill your service block as follow:
  54. ```
  55. server {
  56. listen 80;
  57. server_name {your-domain-name.com};
  58. location / {
  59. proxy_pass http://localhost:5000;
  60. proxy_http_version 1.1;
  61. proxy_set_header Upgrade $http_upgrade;
  62. proxy_set_header Connection keep-alive;
  63. proxy_set_header Host $host;
  64. proxy_cache_bypass $http_upgrade;
  65. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  66. proxy_set_header X-Forwarded-Proto $scheme;
  67. }
  68. }
  69. ```
  70. Save and start/restart your Nginx service
  71. ```
  72. sudo service nginx start
  73. # or restart it if its already started
  74. sudo service nginx restart
  75. ```
  76. ### Secure your hosted application with SSL
  77. After having a domain name pointing to your instance, install and setup certbot:
  78. ```
  79. sudo apt install certbot python3-certbot-nginx
  80. sudo certbot --nginx -d {your-domain-name.com}
  81. ```
  82. Make sure you're redirecting all traffic to https when asked.
  83. Finally check that the auto-revewal will work as espected:
  84. ```
  85. sudo certbot renew --dry-run
  86. ```
  87. ### Set the firewall
  88. Make sure you're securing your firewall correctly:
  89. ```
  90. sudo apt install ufw #if not installed
  91. sudo ufw app list
  92. sudo ufw allow 22/tcp
  93. sudo ufw allow 80/tcp
  94. sudo ufw allow 443/tcp
  95. sudo ufw enable
  96. sudo ufw status
  97. ```
  98. You should now have an up and running BirdsiteLIVE instance!
  99. ## Updating
  100. Make sure your data belong outside the containers before migrating (set by default).
  101. To update your installation to the latest release:
  102. ```
  103. # Edit `docker-compose.yml` to update the version, if you have one specified
  104. # Pull new images
  105. docker-compose pull
  106. # Start a new container, automatically removes old one
  107. docker-compose up -d
  108. ```
  109. ## Auto-Updating
  110. To set auto-updates on your deployment, add to the `docker-compose.yml` file this section:
  111. ```diff
  112. version: "3"
  113. networks:
  114. birdsitelivenetwork:
  115. external: false
  116. services:
  117. server:
  118. image: pasture/birdsitelive:latest
  119. [...]
  120. db:
  121. image: postgres:13
  122. [...]
  123. + watchtower:
  124. + image: containrrr/watchtower
  125. + restart: always
  126. + container_name: watchtower
  127. + environment:
  128. + - WATCHTOWER_CLEANUP=true
  129. + volumes:
  130. + - /var/run/docker.sock:/var/run/docker.sock
  131. + command: --interval 300
  132. ```
  133. ## More options
  134. You can find more options available [here](https://github.com/NicolasConstant/BirdsiteLive/blob/master/VARIABLES.md)