mirror of
https://framagit.org/YunoHost-Apps/gitea_ynh.git
synced 2025-09-02 10:08:31 +02:00
Move all script in script folder
This commit is contained in:
@ -87,8 +87,8 @@ _set_permissions
|
||||
ynh_systemd_action --service_name="$app" --action=start --log_path="/var/log/$app/gitea.log" --line_match="$systemd_match_start_line"
|
||||
|
||||
# Add ldap config
|
||||
ynh_replace_string --match_string=__APP__ --replace_string="$app" --target_file=../conf/login_source.sql
|
||||
ynh_mysql_connect_as "$db_user" "$db_pwd" "$db_name" < ../conf/login_source.sql
|
||||
ynh_replace_string --match_string=__APP__ --replace_string="$app" --target_file=./login_source.sql
|
||||
ynh_mysql_connect_as "$db_user" "$db_pwd" "$db_name" < ./login_source.sql
|
||||
|
||||
# Stop the service to restart it just afterwards
|
||||
ynh_systemd_action --service_name="$app" --action='stop' --log_path="/var/log/$app/gitea.log"
|
||||
|
69
scripts/login_source.sql
Normal file
69
scripts/login_source.sql
Normal file
@ -0,0 +1,69 @@
|
||||
INSERT INTO `__APP__`.`login_source`
|
||||
(`id`, `type`, `name`, `is_active`, `cfg`, `created_unix`, `updated_unix`)
|
||||
VALUES
|
||||
('1', '2', 'YunoHost LDAP', '1',
|
||||
'{
|
||||
"Name": "YunoHost LDAP",
|
||||
"Host": "localhost",
|
||||
"Port": 389,
|
||||
"SecurityProtocol": 0,
|
||||
"SkipVerify": false,
|
||||
"BindDN": "",
|
||||
"BindPassword": "",
|
||||
"UserBase": "ou=users,dc=yunohost,dc=org",
|
||||
"UserDN": "",
|
||||
"AttributeUsername": "uid",
|
||||
"AttributeName": "givenName",
|
||||
"AttributeSurname": "sn",
|
||||
"AttributeMail": "mail",
|
||||
"AttributesInBind": false,
|
||||
"AttributeSSHPublicKey": "",
|
||||
"AttributeAvatar": "",
|
||||
"SearchPageSize": 0,
|
||||
"Filter": "(&(uid=%s)(objectClass=posixAccount)(permission=cn=__APP__.main,ou=permission,dc=yunohost,dc=org))",
|
||||
"AdminFilter": "(permission=cn=__APP__.admin,ou=permission,dc=yunohost,dc=org)",
|
||||
"RestrictedFilter": "",
|
||||
"Enabled": true,
|
||||
"AllowDeactivateAll": false,
|
||||
"GroupsEnabled": true,
|
||||
"GroupDN": "ou=groups,dc=yunohost,dc=org",
|
||||
"GroupFilter": "",
|
||||
"GroupMemberUID": "memberUid",
|
||||
"GroupTeamMap": "",
|
||||
"GroupTeamMapRemoval": true,
|
||||
"UserUID": "uid"
|
||||
}', UNIX_TIMESTAMP(NOW()), UNIX_TIMESTAMP(NOW()))
|
||||
ON DUPLICATE KEY
|
||||
UPDATE
|
||||
updated_unix=UNIX_TIMESTAMP(NOW()),
|
||||
cfg='{
|
||||
"Name": "YunoHost LDAP",
|
||||
"Host": "localhost",
|
||||
"Port": 389,
|
||||
"SecurityProtocol": 0,
|
||||
"SkipVerify": false,
|
||||
"BindDN": "",
|
||||
"BindPassword": "",
|
||||
"UserBase": "ou=users,dc=yunohost,dc=org",
|
||||
"UserDN": "",
|
||||
"AttributeUsername": "uid",
|
||||
"AttributeName": "givenName",
|
||||
"AttributeSurname": "sn",
|
||||
"AttributeMail": "mail",
|
||||
"AttributesInBind": false,
|
||||
"AttributeSSHPublicKey": "",
|
||||
"AttributeAvatar": "",
|
||||
"SearchPageSize": 0,
|
||||
"Filter": "(&(uid=%s)(objectClass=posixAccount)(permission=cn=__APP__.main,ou=permission,dc=yunohost,dc=org))",
|
||||
"AdminFilter": "(permission=cn=__APP__.admin,ou=permission,dc=yunohost,dc=org)",
|
||||
"RestrictedFilter": "",
|
||||
"Enabled": true,
|
||||
"AllowDeactivateAll": false,
|
||||
"GroupsEnabled": true,
|
||||
"GroupDN": "ou=groups,dc=yunohost,dc=org",
|
||||
"GroupFilter": "",
|
||||
"GroupMemberUID": "memberUid",
|
||||
"GroupTeamMap": "",
|
||||
"GroupTeamMapRemoval": true,
|
||||
"UserUID": "uid"
|
||||
}';
|
@ -100,8 +100,8 @@ ynh_add_config --template=app.ini --destination="$install_dir/custom/conf/app.in
|
||||
_set_permissions
|
||||
|
||||
# Update ldap config
|
||||
ynh_replace_string --match_string=__APP__ --replace_string="$app" --target_file=../conf/login_source.sql
|
||||
ynh_mysql_connect_as "$db_user" "$db_pwd" "$db_name" < ../conf/login_source.sql
|
||||
ynh_replace_string --match_string=__APP__ --replace_string="$app" --target_file=./login_source.sql
|
||||
ynh_mysql_connect_as "$db_user" "$db_pwd" "$db_name" < ./login_source.sql
|
||||
|
||||
#=================================================
|
||||
# REAPPLY SYSTEM CONFIGURATIONS
|
||||
|
Reference in New Issue
Block a user