Merge branch 'master' into 1.12.0

This commit is contained in:
L3D 2020-06-18 21:59:19 +02:00
commit 50fa6f1db5
No known key found for this signature in database
GPG key ID: CD08445BFF4313D1
6 changed files with 22 additions and 3 deletions

View file

@ -56,6 +56,8 @@ The following code has been tested with Debian 8, it should work on Ubuntu as we
* `gitea_version_check`: Check if installed version != `gitea_version` before initiating binary download * `gitea_version_check`: Check if installed version != `gitea_version` before initiating binary download
* `gitea_user`: UNIX user used by Gitea * `gitea_user`: UNIX user used by Gitea
* `gitea_home`: Base directory to work * `gitea_home`: Base directory to work
* `gitea_dl_url`: The URL, the compiled gitea-binary will be downloaded from
* `gitea_systemd_cap_net_bind_service`: Adds `AmbientCapabilities=CAP_NET_BIND_SERVICE` to systemd service file
### Look and feel ### Look and feel
@ -64,11 +66,14 @@ The following code has been tested with Debian 8, it should work on Ubuntu as we
* `gitea_disable_gravatar`: Do you want to disable Gravatar ? (privacy and so on) (true/false) * `gitea_disable_gravatar`: Do you want to disable Gravatar ? (privacy and so on) (true/false)
* `gitea_offline_mode`: Same but for disabling CDNs for frontend assets (true/false) * `gitea_offline_mode`: Same but for disabling CDNs for frontend assets (true/false)
* `gitea_disable_registration`: Do you want to disable user registration ? (true/false) * `gitea_disable_registration`: Do you want to disable user registration ? (true/false)
* `gitea_only_allow_external_registration`: Do you want to force registration only using third-party services ? (true/false)
* `gitea_show_registration_button`: Do you want to show the registration button? (true/false) * `gitea_show_registration_button`: Do you want to show the registration button? (true/false)
* `gitea_require_signin`: Do you require a signin to see repo's (even public ones) ? (true/false) * `gitea_require_signin`: Do you require a signin to see repo's (even public ones) ? (true/false)
* `gitea_enable_captcha`: Do you want to enable captcha's ? (true/false) * `gitea_enable_captcha`: Do you want to enable captcha's ? (true/false)
* `gitea_secret_key`: Cookie secret key * `gitea_secret_key`: Cookie secret key
* `gitea_internal_token`: Internal API token * `gitea_internal_token`: Internal API token
* `gitea_themes`: List of enabled themes
* `gitea_theme_default`: Default theme
### Limits ### Limits

View file

@ -1,12 +1,15 @@
--- ---
gitea_version: "1.12.0" gitea_version: "1.12.0"
gitea_version_check: true gitea_version_check: true
gitea_dl_url: "https://github.com/go-gitea/gitea/releases/download/v{{ gitea_version }}/gitea-{{ gitea_version }}-linux-{{ gitea_arch }}"
gitea_app_name: "Gitea" gitea_app_name: "Gitea"
gitea_user: "gitea" gitea_user: "gitea"
gitea_home: "/var/lib/gitea" gitea_home: "/var/lib/gitea"
gitea_shell: "/bin/false" gitea_shell: "/bin/false"
gitea_systemd_cap_net_bind_service: false
gitea_repository_root: "{{ gitea_home }}"
gitea_user_repo_limit: -1 gitea_user_repo_limit: -1
gitea_http_domain: localhost gitea_http_domain: localhost
@ -42,6 +45,7 @@ gitea_disable_registration: false
gitea_show_registration_button: true gitea_show_registration_button: true
gitea_require_signin: true gitea_require_signin: true
gitea_enable_captcha: true gitea_enable_captcha: true
gitea_only_allow_external_registration: false
gitea_force_private: false gitea_force_private: false
@ -64,3 +68,6 @@ gitea_oauth2_jwt_secret: ChangeMe
gitea_metrics_enabled: false gitea_metrics_enabled: false
gitea_metrics_token: ~ gitea_metrics_token: ~
gitea_themes: gitea,arc-green
gitea_theme_default: gitea

View file

@ -4,6 +4,8 @@
- name: "Check gitea version" - name: "Check gitea version"
shell: "set -eo pipefail; /usr/local/bin/gitea -v | cut -d' ' -f 3" shell: "set -eo pipefail; /usr/local/bin/gitea -v | cut -d' ' -f 3"
args:
executable: /bin/bash
register: gitea_active_version register: gitea_active_version
changed_when: false changed_when: false
failed_when: false failed_when: false
@ -11,7 +13,7 @@
- name: "Download the binary" - name: "Download the binary"
get_url: get_url:
url: "{{ gitea_dl_url }}/v{{ gitea_version }}/gitea-{{ gitea_version }}-linux-{{ gitea_arch }}" url: "{{ gitea_dl_url }}"
dest: /usr/local/bin/gitea dest: /usr/local/bin/gitea
owner: root owner: root
group: root group: root

View file

@ -13,7 +13,7 @@ RUN_USER = {{ gitea_user }}
RUN_MODE = prod RUN_MODE = prod
[repository] [repository]
ROOT = {{ gitea_home }} ROOT = {{ gitea_repository_root }}
; Force every new repository to be private ; Force every new repository to be private
FORCE_PRIVATE = {{ gitea_force_private }} FORCE_PRIVATE = {{ gitea_force_private }}
; Global limit of repositories per user, applied at creation time. -1 means no limit ; Global limit of repositories per user, applied at creation time. -1 means no limit
@ -26,6 +26,8 @@ DISABLE_HTTP_GIT = {{ gitea_disable_http_git }}
[ui] [ui]
; Whether the email of the user should be shown in the Explore Users page ; Whether the email of the user should be shown in the Explore Users page
SHOW_USER_EMAIL = {{ gitea_show_user_email }} SHOW_USER_EMAIL = {{ gitea_show_user_email }}
THEMES = {{ gitea_themes }}
DEFAULT_THEME = {{ gitea_theme_default }}
[server] [server]
; The protocol the server listens on. One of 'http', 'https', 'unix' or 'fcgi'. ; The protocol the server listens on. One of 'http', 'https', 'unix' or 'fcgi'.
@ -109,6 +111,7 @@ RECAPTCHA_SECRET =
RECAPTCHA_SITEKEY = RECAPTCHA_SITEKEY =
; Show Registration button ; Show Registration button
SHOW_REGISTRATION_BUTTON = {{ gitea_show_registration_button }} SHOW_REGISTRATION_BUTTON = {{ gitea_show_registration_button }}
ALLOW_ONLY_EXTERNAL_REGISTRATION = {{ gitea_only_allow_external_registration }}
[mailer] [mailer]
ENABLED = {{ gitea_mailer_enabled }} ENABLED = {{ gitea_mailer_enabled }}

View file

@ -7,6 +7,9 @@ User={{ gitea_user }}
ExecStart=/usr/local/bin/gitea web -c /etc/gitea/gitea.ini ExecStart=/usr/local/bin/gitea web -c /etc/gitea/gitea.ini
Restart=on-failure Restart=on-failure
WorkingDirectory={{ gitea_home }} WorkingDirectory={{ gitea_home }}
{% if gitea_systemd_cap_net_bind_service %}
AmbientCapabilities=CAP_NET_BIND_SERVICE
{% endif %}
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View file

@ -1,3 +1,2 @@
--- ---
gitea_arch: "{{ 'amd64' if ansible_architecture == 'x86_64' else ansible_architecture }}" gitea_arch: "{{ 'amd64' if ansible_architecture == 'x86_64' else ansible_architecture }}"
gitea_dl_url: "https://github.com/go-gitea/gitea/releases/download"