set nextcloud icon using an abra command
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				continuous-integration/drone/push Build is failing
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	continuous-integration/drone/push Build is failing
				
			This commit is contained in:
		| @ -43,3 +43,4 @@ COPY_ASSETS="$COPY_ASSETS icon.png|app:/web/dist/assets/icons/" | ||||
| # NEXTCLOUD_DOMAIN=nextcloud.example.com | ||||
| # SECRET_NEXTCLOUD_ID_VERSION=v1 | ||||
| # SECRET_NEXTCLOUD_SECRET_VERSION=v1 | ||||
| # APP_ICONS="nextcloud:~/.abra/recipes/authentik/icons/nextcloud.png" | ||||
|  | ||||
							
								
								
									
										16
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								README.md
									
									
									
									
									
								
							| @ -40,6 +40,22 @@ abra app cmd <app_name> db rotate_db_pass | ||||
| abra app cmd <app_name> app set_admin_pass | ||||
| ``` | ||||
|  | ||||
| ## Add SSO for Nextcloud | ||||
|  | ||||
| Uncomment Nextcloud configuration and set `NEXTCLOUD_DOMAIN` the using `abra app config <app_name>`: | ||||
|  | ||||
| ``` | ||||
| COMPOSE_FILE="$COMPOSE_FILE:compose.nextcloud.yml" | ||||
| NEXTCLOUD_DOMAIN=nextcloud.example.com | ||||
| SECRET_NEXTCLOUD_ID_VERSION=v1 | ||||
| SECRET_NEXTCLOUD_SECRET_VERSION=v1 | ||||
| APP_ICONS="nextcloud:~/.abra/recipes/authentik/icons/nextcloud.png" | ||||
| ``` | ||||
|  | ||||
| Set the nextcloud Icon using `abra app cmd -l -d <app_name> set_icons` | ||||
|  | ||||
| The configuration inside Nextcloud can be found in the [nextcloud recipe](https://git.coopcloud.tech/coop-cloud/nextcloud#authentik-integration) | ||||
|  | ||||
| ## Customization | ||||
|  | ||||
| Place the files you want to overwrite in a directory `<assets_path>`. | ||||
|  | ||||
							
								
								
									
										31
									
								
								abra.sh
									
									
									
									
									
								
							
							
						
						
									
										31
									
								
								abra.sh
									
									
									
									
									
								
							| @ -97,6 +97,37 @@ else: | ||||
|  | ||||
| } | ||||
|  | ||||
| set_icons(){ | ||||
| for icon in $APP_ICONS; do | ||||
|     app=$(echo $icon | cut -d ":" -f1) | ||||
|     file_path=$(eval echo $(echo $icon | cut -d ":" -f2)) | ||||
|     file=$(basename $file_path) | ||||
|     echo copy icon $file_path for $app | ||||
|     abra app cp $APP_NAME $file_path app:/media/ | ||||
|     abra app cmd -T $APP_NAME app set_app_icon $app /media/$file | ||||
| done | ||||
| } | ||||
|  | ||||
| set_app_icon() { | ||||
| TOKEN=$(cat /run/secrets/admin_token) | ||||
| python -c """ | ||||
| import requests | ||||
| import os | ||||
| my_token = '$TOKEN' | ||||
| application = '$1' | ||||
| icon_path = '$2' | ||||
| url = f'https://$DOMAIN/api/v3/core/applications/{application}/set_icon/' | ||||
| headers = {'Authorization':f'Bearer {my_token}'} | ||||
| with open(icon_path, 'rb') as img: | ||||
|   name_img = os.path.basename(icon_path) | ||||
|   files= {'file': (name_img,img,'image/png') } | ||||
|   with requests.Session() as s: | ||||
|     r = s.post(url,files=files,headers=headers) | ||||
|     print(r.status_code) | ||||
| """ | ||||
|  | ||||
| } | ||||
|  | ||||
| blueprint_cleanup() { | ||||
| /manage.py shell -c """ | ||||
| delete_flows = ['default-recovery-flow' , 'custom-authentication-flow' , 'invitation-enrollment-flow' , 'initial-setup'] | ||||
|  | ||||
		Reference in New Issue
	
	Block a user