From 1c8ea43075ccff164c85807158d3ba053d0962d1 Mon Sep 17 00:00:00 2001 From: bearns Date: Wed, 14 Oct 2020 23:51:48 +0300 Subject: [PATCH] Cleanup and add missing --- .env | 1 + db.env~ | 0 docker-compose.yml~ | 154 ------------------ redmine/Dockerfile~ | 2 - .../views/settings/_ldap_password.html.erb | 6 + .../redmine_ldap_passwd/config/locales/ru.yml | 8 + redmine/redmine_ldap_passwd/init.rb~ | 36 ++++ 7 files changed, 51 insertions(+), 156 deletions(-) create mode 100644 .env delete mode 100644 db.env~ delete mode 100644 docker-compose.yml~ delete mode 100644 redmine/Dockerfile~ create mode 100644 redmine/redmine_ldap_passwd/app/views/settings/_ldap_password.html.erb create mode 100644 redmine/redmine_ldap_passwd/config/locales/ru.yml create mode 100644 redmine/redmine_ldap_passwd/init.rb~ diff --git a/.env b/.env new file mode 100644 index 0000000..fe9ad77 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +MYSQL_ROOT_PASSWORD=mrpassword \ No newline at end of file diff --git a/db.env~ b/db.env~ deleted file mode 100644 index e69de29..0000000 diff --git a/docker-compose.yml~ b/docker-compose.yml~ deleted file mode 100644 index f844fb3..0000000 --- a/docker-compose.yml~ +++ /dev/null @@ -1,154 +0,0 @@ -version: '3.3' - -services: - redmine: - build: - context: ./redmine - #container_name: redmine - restart: always - ports: - - 8080:3000 - environment: - REDMINE_DB_PASSWORD: "${MYSQL_ROOT_PASSWORD}" - REDMINE_DB_MYSQL: db - REDMINE_SECRET_KEY_BASE: supersecretkey - REDMINE_PLUGINS_MIGRATE: "true" - #env_file: - # - db.env - volumes: - - redmine-files:/usr/src/redmine/files - - redmine-config:/usr/src/redmine/config - - redmine-logs:/var/log/redmine - depends_on: - - db - - db: - image: mysql:5.7 - #container_name: mysql - restart: always - environment: - MYSQL_DATABASE: redmine - #env_file: - # - db.env - volumes: - - db:/var/lib/mysql - -volumes: - db: - driver_opts: - type: none - device: /tmp/docker/redmine-db - o: bind - redmine-files: - driver_opts: - type: none - device: /tmp/docker/redmine-files - o: bind - redmine-config: - driver_opts: - type: none - device: /tmp/docker/redmine-config - o: bind - redmine-logs: - driver_opts: - type: none - device: /tmp/docker/redmine-logs - o: bind - -# openldap: -# #build: ./ldap -# image: osixia/openldap:1.4.0 -# container_name: openldap -# restart: always -# environment: -# LDAP_LOG_LEVEL: "0x380" -# LDAP_ORGANISATION: "Example Inc." -# LDAP_DOMAIN: "example.org" -# LDAP_BASE_DN: "" -# LDAP_ADMIN_PASSWORD: "admin" -# LDAP_CONFIG_PASSWORD: "config" -# LDAP_READONLY_USER: "false" -# #LDAP_READONLY_USER_USERNAME: "readonly" -# #LDAP_READONLY_USER_PASSWORD: "readonly" -# LDAP_RFC2307BIS_SCHEMA: "false" -# LDAP_BACKEND: "mdb" -# LDAP_TLS: "true" -# LDAP_TLS_CRT_FILENAME: "ldap.crt" -# LDAP_TLS_KEY_FILENAME: "ldap.key" -# LDAP_TLS_DH_PARAM_FILENAME: "dhparam.pem" -# LDAP_TLS_CA_CRT_FILENAME: "ca.crt" -# LDAP_TLS_ENFORCE: "false" -# LDAP_TLS_CIPHER_SUITE: "SECURE256:+SECURE128:-VERS-TLS-ALL:+VERS-TLS1.2:-RSA:-DHE-DSS:-CAMELLIA-128-CBC:-CAMELLIA-256-CBC" -# LDAP_TLS_VERIFY_CLIENT: "never" -# LDAP_REPLICATION: "false" -# #LDAP_REPLICATION_CONFIG_SYNCPROV: "binddn="cn=admin,cn=config" bindmethod=simple credentials=$$LDAP_CONFIG_PASSWORD searchbase="cn=config" type=refreshAndPersist retry="60 +" timeout=1 starttls=critical" -# #LDAP_REPLICATION_DB_SYNCPROV: "binddn="cn=admin,$$LDAP_BASE_DN" bindmethod=simple credentials=$$LDAP_ADMIN_PASSWORD searchbase="$$LDAP_BASE_DN" type=refreshAndPersist interval=00:00:00:10 retry="60 +" timeout=1 starttls=critical" -# #LDAP_REPLICATION_HOSTS: "#PYTHON2BASH:['ldap://ldap.example.org','ldap://ldap2.example.org']" -# KEEP_EXISTING_CONFIG: "false" -# LDAP_REMOVE_CONFIG_AFTER_SETUP: "true" -# LDAP_SSL_HELPER_PREFIX: "ldap" -# tty: true -# stdin_open: true -# volumes: -# - /srv/docker/ldap/ldap:/var/lib/ldap -# - /srv/docker/ldap/slap.d:/etc/ldap/slapd.d -# - /srv/docker/ldap/certs:/container/service/slapd/assets/certs/ -# ports: -# - "389:389" -# - "636:636" -# -# # For replication to work correctly, domainname and hostname must be -# -# # set correctly so that "hostname"."domainname" equates to the -# -# # fully-qualified domain name for the host. -# -# domainname: "example.org" -# -# hostname: "ldap-server" -# -# phpldapadmin: -# -# image: osixia/phpldapadmin:latest -# -# container_name: phpldapadmin -# -# restart: always -# -# environment: -# -# PHPLDAPADMIN_LDAP_HOSTS: "openldap" -# -# PHPLDAPADMIN_HTTPS: "false" -# -# ports: -# -# - "8880:80" -# -# depends_on: -# -# - openldap -# -# svn: -# -# build: ./svn8 -# -# container_name: svn-server -# -# restart: always -# -# #ports: -# -# # - "80:80" -# -# # - "3690:3690" -# -# #environment: -# -# # - SVN_REPONAME=test_repo -# -# volumes: -# -# - /srv/docker/svn:/svn -# -# - /srv/docker/apache2/config:/config/apache diff --git a/redmine/Dockerfile~ b/redmine/Dockerfile~ deleted file mode 100644 index 89d09bb..0000000 --- a/redmine/Dockerfile~ +++ /dev/null @@ -1,2 +0,0 @@ -FROM redmine:latest -ADD ./redmine_ldap_passwd/ /usr/src/redmine/plugins/redmine_ldap_passwd/ \ No newline at end of file diff --git a/redmine/redmine_ldap_passwd/app/views/settings/_ldap_password.html.erb b/redmine/redmine_ldap_passwd/app/views/settings/_ldap_password.html.erb new file mode 100644 index 0000000..33a7d72 --- /dev/null +++ b/redmine/redmine_ldap_passwd/app/views/settings/_ldap_password.html.erb @@ -0,0 +1,6 @@ +<% defaults = Redmine::Plugin::registered_plugins[:redmine_ldap_passwd].settings[:default] %> +<% duua = defaults[:use_user_account] ? 1 : 0 %> +

+ + <%= check_box_tag('settings[use_user_account]', duua, @settings[:use_user_account]) %> +

diff --git a/redmine/redmine_ldap_passwd/config/locales/ru.yml b/redmine/redmine_ldap_passwd/config/locales/ru.yml new file mode 100644 index 0000000..4a79a96 --- /dev/null +++ b/redmine/redmine_ldap_passwd/config/locales/ru.yml @@ -0,0 +1,8 @@ +ru: + notice_new_password_and_confirmation_different: "Пароль и подтверждение не совпадают" + notice_new_password_format: "1. Пароль должен быть не менее 7 символов. 2. Пароль должен содержать 3 и более групп символов: (a) Заглавные буквы (b) Прописные буквы) (c) Цифры (0 - 9) (d) Спецсимволы (Например: !, $, or %). 3. Пароль не должен содержать 3 и более символов из имени учетной записи." + notice_can_t_change_password: "Не удалось изменить пароль." + notice_account_wrong_password: "Не верный пароль или имя пользователя." + notice_new_password_must_be_different: "Новый пароль должен отличаться от существующего." + notice_account_password_updated: "Пароль успешно изменен." + setting_use_user_account: "Использовать учетные данные пользователя для подключения к LDAP:" diff --git a/redmine/redmine_ldap_passwd/init.rb~ b/redmine/redmine_ldap_passwd/init.rb~ new file mode 100644 index 0000000..9f140ec --- /dev/null +++ b/redmine/redmine_ldap_passwd/init.rb~ @@ -0,0 +1,36 @@ +require 'redmine' + +require_dependency 'redmine/lib/plugins/redmine_ldap_passwd/lib/redmine_ldap_passwd_my_controller_patch' +require_dependency 'redmine_ldap_passwd_auth_sources_helper_patch' +require_dependency 'redmine_ldap_passwd_account_controller_patch' + +Redmine::Plugin.register :redmine_ldap_passwd do + name 'Redmine LDAP Change Password' + author 'Yura Zaplavnov' + description 'The plugin extends AuthSourceLdap to introduce the ability to recover or change user password.' + version '3.0.1' + url 'https://github.com/xeagle2/redmine_ldap_passwd' + author_url 'https://github.com/xeagle2' +end + +require 'dispatcher' unless Rails::VERSION::MAJOR >= 3 + +if Rails::VERSION::MAJOR >= 5 + ActiveSupport::Reloader.to_prepare do + MyController.send(:include, RedmineLdapPasswd::MyControllerPatch) + AuthSourcesHelper.send(:include, RedmineLdapPasswd::AuthSourcesHelperPatch) + AccountController.send(:include, RedmineLdapPasswd::AccountControllerPatch) + end +elsif Rails::VERSION::MAJOR >= 3 + ActionDispatch::Callbacks.to_prepare do + MyController.send(:include, RedmineLdapPasswd::MyControllerPatch) + AuthSourcesHelper.send(:include, RedmineLdapPasswd::AuthSourcesHelperPatch) + AccountController.send(:include, RedmineLdapPasswd::AccountControllerPatch) + end +else + Dispatcher.to_prepare do + MyController.send(:include, RedmineLdapPasswd::MyControllerPatch) + AuthSourcesHelper.send(:include, RedmineLdapPasswd::AuthSourcesHelperPatch) + AccountController.send(:include, RedmineLdapPasswd::AccountControllerPatch) + end +end \ No newline at end of file