From f6828e0b66933cfc4b4699037ab80dcf5286d9e4 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Sat, 12 May 2018 21:50:39 -0400 Subject: [PATCH 1/4] Fix blank topic on explore repo list (#3956) --- templates/explore/repo_list.tmpl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/templates/explore/repo_list.tmpl b/templates/explore/repo_list.tmpl index 16507df16..b8f4490c1 100644 --- a/templates/explore/repo_list.tmpl +++ b/templates/explore/repo_list.tmpl @@ -17,9 +17,13 @@ {{if .DescriptionHTML}}

{{.DescriptionHTML}}

{{end}} -
- {{range .Topics}}
{{.}}
{{end}} -
+ {{if .Topics }} +
+ {{range .Topics}} + {{if ne . "" }}
{{.}}
{{end}} + {{end}} +
+ {{end}}

{{$.i18n.Tr "org.repo_updated"}} {{TimeSinceUnix .UpdatedUnix $.i18n.Lang}}

{{else}} From 2c34ef5d979646c819682ed07b624440d2c5d833 Mon Sep 17 00:00:00 2001 From: GiteaBot Date: Sun, 13 May 2018 01:51:56 +0000 Subject: [PATCH 2/4] [skip ci] Updated translations via Crowdin --- options/locale/locale_uk-UA.ini | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/options/locale/locale_uk-UA.ini b/options/locale/locale_uk-UA.ini index ba7fe3271..a4281beda 100644 --- a/options/locale/locale_uk-UA.ini +++ b/options/locale/locale_uk-UA.ini @@ -127,6 +127,7 @@ default_keep_email_private=Приховати адресу електронно default_keep_email_private_popup=Приховати адресу електронної пошти нових облікових записів за замовчуванням. default_allow_create_organization=Дозволити створення організацій за замовчуванням default_enable_timetracking=Увімкнути відстеження часу за замовчуванням +no_reply_address=Прихований поштовий домен [home] uname_holder=Ім'я користувача або Ел. пошта @@ -302,8 +303,12 @@ emails=Адреса електронної пошти manage_emails=Керування адресами ел. пошти email_desc=Ваша основна адреса електронної пошти використовуватиметься для сповіщення та інших операцій. primary=Основний +primary_email=Зробити основним delete_email=Видалити +add_new_email=Додати нову адресу електронної пошти +add_email=Додати адресу електронної пошти keep_email_private=Приховати адресу електронної пошти +keep_email_private_popup=Вашу адресу електронної пошти буде приховано від інших користувачів. manage_ssh_keys=Керувати SSH ключами manage_gpg_keys=Керувати GPG ключами @@ -575,6 +580,7 @@ pulls.create=Створити запит на злиття pulls.title_desc=хоче злити %[1]d комітів з %[2]s до %[3]s pulls.tab_conversation=Обговорення pulls.tab_commits=Коміти +pulls.tab_files=Змінені файли pulls.reopen_to_merge=Будь ласка перевідкрийте цей запит щоб здіснити операцію злиття. pulls.merged=Злито pulls.can_auto_merge_desc=Цей запит можна об'єднати автоматично. @@ -657,7 +663,7 @@ search.search_repo=Пошук репозиторію settings=Налаштування settings.options=Репозиторій settings.collaboration.admin=Адміністратор -settings.collaboration.write=Написати +settings.collaboration.write=Запис settings.collaboration.read=Читати settings.collaboration.undefined=Не визначено settings.hooks=Веб-хуки @@ -687,6 +693,7 @@ settings.delete=Видалити цей репозиторій settings.delete_notices_1=- Цю операцію НЕ МОЖНА відмінити. settings.update_settings_success=Налаштування репозиторію було оновлено. settings.transfer_owner=Новий власник +settings.make_transfer=Здіснити перенесення settings.confirm_delete=Видалити репозиторій settings.delete_collaborator=Видалити settings.search_user_placeholder=Пошук користувача… @@ -707,6 +714,7 @@ settings.slack_icon_url=URL іконки settings.discord_username=Ім'я кристувача settings.discord_icon_url=URL іконки settings.slack_color=Колір +settings.event_send_everything=Всі події settings.event_create=Створити settings.event_create_desc=Гілку або тег створено. settings.event_pull_request=Запити до злиття @@ -804,6 +812,10 @@ settings.delete=Видалити організацію settings.delete_account=Видалити цю організацію settings.confirm_delete_account=Підтвердіть видалення +members.membership_visibility=Видимість учасника: +members.public_helper=зробити прихованим +members.private=Прихований +members.private_helper=зробити видимим members.member_role=Роль учасника: members.owner=Власник members.member=Учасник @@ -815,6 +827,8 @@ members.invite_now=Запросити зараз teams.join=Приєднатися teams.leave=Покинути teams.read_access=Доступ для читання +teams.write_access=Доступ на запис +teams.admin_access=Доступ адміністратора teams.settings=Налаштування teams.members=Учасники команди teams.update_settings=Оновити налаштування @@ -855,17 +869,28 @@ dashboard.gc_metadata_obtained=Отримано метаданих GC dashboard.other_system_allocation_obtained=Отримання інших виділень пам'яті dashboard.next_gc_recycle=Наступний цикл GC +users.user_manage_panel=Керування обліковими записами користувачів +users.new_account=Створити обліковий запис users.name=Ім'я кристувача users.activated=Активовано users.admin=Адміністратор users.repos=Репозиторії users.created=Створено users.last_login=Останній вхід +users.send_register_notify=Надіслати повідомлення про реєстрацію користувача users.edit=Редагувати users.auth_source=Джерело автентифікації users.local=Локальні users.max_repo_creation=Максимальна кількість репозиторіїв users.max_repo_creation_desc=(Введіть -1, щоб використовувати глобальний ліміт за замовчуванням.) +users.is_activated=Обліковий запис користувача увімкнено +users.prohibit_login=Вимкнути вхід +users.is_admin=Адміністратор +users.allow_git_hook=Може створювати Git хуки +users.allow_import_local=Може імпортувати локальні репозиторії +users.allow_create_organization=Може створювати організацій +users.update_profile=Оновити обліковий запис +users.delete_account=Видалити цей обліковий запис orgs.org_manage_panel=Керування організаціями orgs.name=Назва From e74055878f21c35e49faf2d17abb05e03bfe32e8 Mon Sep 17 00:00:00 2001 From: Lauris BH Date: Sun, 13 May 2018 08:10:50 +0300 Subject: [PATCH 3/4] Update xormstore dependency to fix OAuth2 support for MySQL (#3955) --- vendor/github.com/lafriks/xormstore/xormstore.go | 2 +- vendor/vendor.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vendor/github.com/lafriks/xormstore/xormstore.go b/vendor/github.com/lafriks/xormstore/xormstore.go index f73db2e27..85be25225 100644 --- a/vendor/github.com/lafriks/xormstore/xormstore.go +++ b/vendor/github.com/lafriks/xormstore/xormstore.go @@ -70,7 +70,7 @@ type Store struct { } type xormSession struct { - ID string `xorm:"VARCHAR(400) PK NAME 'id'"` + ID string `xorm:"VARCHAR(100) PK NAME 'id'"` Data string `xorm:"TEXT"` CreatedUnix util.TimeStamp `xorm:"created"` UpdatedUnix util.TimeStamp `xorm:"updated"` diff --git a/vendor/vendor.json b/vendor/vendor.json index e4f9dd5c9..8b8972b16 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -648,10 +648,10 @@ "revisionTime": "2016-10-16T15:41:25Z" }, { - "checksumSHA1": "/X7eCdN7MX8zgCjA9s0ktzgTPlA=", + "checksumSHA1": "1zVWfGXRsQi0EuZydyBHgkhl7tU=", "path": "github.com/lafriks/xormstore", - "revision": "3a80a383a04b29ec2e1bf61279dd948aa809335b", - "revisionTime": "2018-04-09T10:45:24Z" + "revision": "9cab149ea91875cf056211bd6ef82379fce9cb67", + "revisionTime": "2018-05-10T21:06:47Z" }, { "checksumSHA1": "Vxvfs8mukr9GOLSuGIPU4ODyOZc=", From 1546458f7df4a4f0e77b7ae5cb65baed6feae394 Mon Sep 17 00:00:00 2001 From: FabioFortini Date: Sun, 13 May 2018 09:51:16 +0200 Subject: [PATCH 4/4] issue-2768: added new option allow_only_external_registration (#3910) --- custom/conf/app.ini.sample | 2 ++ modules/auth/user_form.go | 1 + modules/setting/setting.go | 4 +++- options/locale/locale_en-US.ini | 2 ++ routers/install.go | 2 ++ routers/user/auth.go | 3 ++- templates/admin/config.tmpl | 2 ++ templates/install.tmpl | 6 ++++++ 8 files changed, 20 insertions(+), 2 deletions(-) diff --git a/custom/conf/app.ini.sample b/custom/conf/app.ini.sample index 90c2a9ab9..68f144c08 100644 --- a/custom/conf/app.ini.sample +++ b/custom/conf/app.ini.sample @@ -288,6 +288,8 @@ RESET_PASSWD_CODE_LIVE_MINUTES = 180 REGISTER_EMAIL_CONFIRM = false ; Disallow registration, only allow admins to create accounts. DISABLE_REGISTRATION = false +; Allow registration only using third part services, it works only when DISABLE_REGISTRATION is false +ALLOW_ONLY_EXTERNAL_REGISTRATION = false ; User must sign in to view anything. REQUIRE_SIGNIN_VIEW = false ; Mail notification diff --git a/modules/auth/user_form.go b/modules/auth/user_form.go index 956ebd944..5906abcd1 100644 --- a/modules/auth/user_form.go +++ b/modules/auth/user_form.go @@ -44,6 +44,7 @@ type InstallForm struct { EnableOpenIDSignIn bool EnableOpenIDSignUp bool DisableRegistration bool + AllowOnlyExternalRegistration bool EnableCaptcha bool RequireSignInView bool DefaultKeepEmailPrivate bool diff --git a/modules/setting/setting.go b/modules/setting/setting.go index af1a28242..9f20d955c 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -1143,6 +1143,7 @@ var Service struct { ResetPwdCodeLives int RegisterEmailConfirm bool DisableRegistration bool + AllowOnlyExternalRegistration bool ShowRegistrationButton bool RequireSignInView bool EnableNotifyMail bool @@ -1168,7 +1169,8 @@ func newService() { Service.ActiveCodeLives = sec.Key("ACTIVE_CODE_LIVE_MINUTES").MustInt(180) Service.ResetPwdCodeLives = sec.Key("RESET_PASSWD_CODE_LIVE_MINUTES").MustInt(180) Service.DisableRegistration = sec.Key("DISABLE_REGISTRATION").MustBool() - Service.ShowRegistrationButton = sec.Key("SHOW_REGISTRATION_BUTTON").MustBool(!Service.DisableRegistration) + Service.AllowOnlyExternalRegistration = sec.Key("ALLOW_ONLY_EXTERNAL_REGISTRATION").MustBool() + Service.ShowRegistrationButton = sec.Key("SHOW_REGISTRATION_BUTTON").MustBool(!(Service.DisableRegistration || Service.AllowOnlyExternalRegistration)) Service.RequireSignInView = sec.Key("REQUIRE_SIGNIN_VIEW").MustBool() Service.EnableReverseProxyAuth = sec.Key("ENABLE_REVERSE_PROXY_AUTHENTICATION").MustBool() Service.EnableReverseProxyAutoRegister = sec.Key("ENABLE_REVERSE_PROXY_AUTO_REGISTRATION").MustBool() diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 2c8e9cd0b..3082569bf 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -117,6 +117,7 @@ federated_avatar_lookup = Enable Federated Avatars federated_avatar_lookup_popup = Enable federated avatar lookup using Libravatar. disable_registration = Disable Self-Registration disable_registration_popup = Disable user self-registration. Only administrators will be able to create new user accounts. +allow_only_external_registration_popup=Enable the registration only through external services. openid_signin = Enable OpenID Sign-In openid_signin_popup = Enable user sign-in via OpenID. openid_signup = Enable OpenID Self-Registration @@ -1442,6 +1443,7 @@ config.db_path_helper = (for "sqlite3" and "tidb") config.service_config = Service Configuration config.register_email_confirm = Require Email Confirmation to Register config.disable_register = Disable Self-Registration +config.allow_only_external_registration = Enable the registration only through external services config.enable_openid_signup = Enable OpenID Self-Registration config.enable_openid_signin = Enable OpenID Sign-In config.show_registration_button = Show Register Button diff --git a/routers/install.go b/routers/install.go index 2a7ec93d2..84e506c70 100644 --- a/routers/install.go +++ b/routers/install.go @@ -112,6 +112,7 @@ func Install(ctx *context.Context) { form.EnableOpenIDSignIn = setting.Service.EnableOpenIDSignIn form.EnableOpenIDSignUp = setting.Service.EnableOpenIDSignUp form.DisableRegistration = setting.Service.DisableRegistration + form.AllowOnlyExternalRegistration = setting.Service.AllowOnlyExternalRegistration form.EnableCaptcha = setting.Service.EnableCaptcha form.RequireSignInView = setting.Service.RequireSignInView form.DefaultKeepEmailPrivate = setting.Service.DefaultKeepEmailPrivate @@ -304,6 +305,7 @@ func InstallPost(ctx *context.Context, form auth.InstallForm) { cfg.Section("openid").Key("ENABLE_OPENID_SIGNIN").SetValue(com.ToStr(form.EnableOpenIDSignIn)) cfg.Section("openid").Key("ENABLE_OPENID_SIGNUP").SetValue(com.ToStr(form.EnableOpenIDSignUp)) cfg.Section("service").Key("DISABLE_REGISTRATION").SetValue(com.ToStr(form.DisableRegistration)) + cfg.Section("service").Key("ALLOW_ONLY_EXTERNAL_REGISTRATION").SetValue(com.ToStr(form.AllowOnlyExternalRegistration)) cfg.Section("service").Key("ENABLE_CAPTCHA").SetValue(com.ToStr(form.EnableCaptcha)) cfg.Section("service").Key("REQUIRE_SIGNIN_VIEW").SetValue(com.ToStr(form.RequireSignInView)) cfg.Section("service").Key("DEFAULT_KEEP_EMAIL_PRIVATE").SetValue(com.ToStr(form.DefaultKeepEmailPrivate)) diff --git a/routers/user/auth.go b/routers/user/auth.go index 2a5cb8e4b..c8e1ada0d 100644 --- a/routers/user/auth.go +++ b/routers/user/auth.go @@ -741,7 +741,8 @@ func SignUpPost(ctx *context.Context, cpt *captcha.Captcha, form auth.RegisterFo ctx.Data["EnableCaptcha"] = setting.Service.EnableCaptcha - if setting.Service.DisableRegistration { + //Permission denied if DisableRegistration or AllowOnlyExternalRegistration options are true + if !setting.Service.ShowRegistrationButton { ctx.Error(403) return } diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl index 370325692..d8292a9e6 100644 --- a/templates/admin/config.tmpl +++ b/templates/admin/config.tmpl @@ -114,6 +114,8 @@
{{.i18n.Tr "admin.config.disable_register"}}
+
{{.i18n.Tr "admin.config.allow_only_external_registration"}}
+
{{.i18n.Tr "admin.config.show_registration_button"}}
{{.i18n.Tr "admin.config.enable_openid_signup"}}
diff --git a/templates/install.tmpl b/templates/install.tmpl index bd79b3a06..46439b497 100644 --- a/templates/install.tmpl +++ b/templates/install.tmpl @@ -200,6 +200,12 @@ +
+
+ + +
+