summaryrefslogtreecommitdiffstats
path: root/conf
diff options
context:
space:
mode:
authorSandro Santilli <strk@kbt.io>2016-08-07 19:27:38 +0200
committer无闻 <u@gogs.io>2016-08-07 10:27:38 -0700
commit90dd0657b564210746c9c494c8c5b07dd8eee91f (patch)
tree228f1f1a684e355ef77c6d6798027dac76ce1d73 /conf
parentec92565f234deb75ea8df0c30a8772c4cd72bc2d (diff)
downloadgitea-90dd0657b564210746c9c494c8c5b07dd8eee91f.tar.gz
gitea-90dd0657b564210746c9c494c8c5b07dd8eee91f.zip
Add support for federated avatars (#3320)
* Add support for federated avatars Fixes #3105 Removes avatar fetching duplication code Adds an "Enable Federated Avatar" checkbox in user settings (defaults to unchecked) Moves avatar settings all in the same form, making local and remote avatars mutually exclusive Renames UploadAvatarForm to AvatarForm as it's not anymore only for uploading * Run gofmt on all modified files * Move Avatar form in its own page * Add go-libravatar dependency to vendor/ dir Hopefully helps with accepting the contribution. See also #3214 * Revert "Add go-libravatar dependency to vendor/ dir" This reverts commit a8cb93ae640bbb90f7d25012fc257bda9fae9b82. * Make federated avatar setting a global configuration Removes the per-user setting * Move avatar handling back to base tool, disable federated avatar in offline mode * Format, handle error * Properly set fallback host * Use unsupported github.com mirror for importing go-libravatar * Remove comment showing life exists outside of github.com ... pity, but contribution would not be accepted otherwise * Use Combo for Get and Post methods over /avatar * FEDERATED_AVATAR -> ENABLE_FEDERATED_AVATAR * Fix persistance of federated avatar lookup checkbox at install time * Federated Avatars -> Enable Federated Avatars * Use len(string) == 0 instead of string == "" * Move import line where it belong See https://github.com/Unknwon/go-code-convention/blob/master/en-US/import_packages.md Pity the import url is still the unofficial one, but oh well... * Save a line (and waste much more expensive time) * Remove redundant parens * Remove an empty line * Remove empty lines * Reorder lines to make diff smaller * Remove another newline Unknwon review got me start a fight against newlines * Move DISABLE_GRAVATAR and ENABLE_FEDERATED_AVATAR after OFFLINE_MODE On re-reading the diff I figured what Unknwon meant here: https://github.com/gogits/gogs/pull/3320/files#r73741106 * Remove newlines that weren't there before my intervention
Diffstat (limited to 'conf')
-rw-r--r--conf/app.ini3
-rw-r--r--conf/locale/locale_en-US.ini7
2 files changed, 9 insertions, 1 deletions
diff --git a/conf/app.ini b/conf/app.ini
index 3c36195ff6..e46436e65d 100644
--- a/conf/app.ini
+++ b/conf/app.ini
@@ -230,6 +230,9 @@ AVATAR_UPLOAD_PATH = data/avatars
; or a custom avatar source, like: http://cn.gravatar.com/avatar/
GRAVATAR_SOURCE = gravatar
DISABLE_GRAVATAR = false
+; Federated avatar lookup uses DNS to discover avatar associated
+; with emails, see http://www.libravatar.org
+ENABLE_FEDERATED_AVATAR = false
[attachment]
; Whether attachments are enabled. Defaults to `true`
diff --git a/conf/locale/locale_en-US.ini b/conf/locale/locale_en-US.ini
index dd3d54d6f8..99b5d17363 100644
--- a/conf/locale/locale_en-US.ini
+++ b/conf/locale/locale_en-US.ini
@@ -96,6 +96,7 @@ offline_mode = Enable Offline Mode
offline_mode_popup = Disable CDN even in production mode, all resource files will be served locally.
disable_gravatar = Disable Gravatar Service
disable_gravatar_popup = Disable Gravatar and custom sources, all avatars are uploaded by users or default.
+federated_avatar_lookup = Enable Federated Avatars Lookup
disable_registration = Disable Self-registration
disable_registration_popup = Disable user self-registration, only admin can create accounts.
enable_captcha = Enable Captcha
@@ -239,6 +240,7 @@ form.name_pattern_not_allowed = Username pattern '%s' is not allowed.
[settings]
profile = Profile
password = Password
+avatar = Avatar
ssh_keys = SSH Keys
social = Social Accounts
applications = Applications
@@ -259,7 +261,9 @@ change_username_prompt = This change will affect the way how links relate to you
continue = Continue
cancel = Cancel
-enable_custom_avatar = Enable Custom Avatar
+lookup_avatar_by_mail = Lookup Avatar by mail
+federated_avatar_lookup = Federated Avatar Lookup
+enable_custom_avatar = Use Custom Avatar
choose_new_avatar = Choose new avatar
update_avatar = Update Avatar Setting
delete_current_avatar = Delete Current Avatar
@@ -1044,6 +1048,7 @@ config.cookie_life_time = Cookie Life Time
config.picture_config = Picture Configuration
config.picture_service = Picture Service
config.disable_gravatar = Disable Gravatar
+config.enable_federated_avatar = Enable Federated Avatars
config.log_config = Log Configuration
config.log_mode = Log Mode