| 
									
										
										
										
											2022-12-31 11:27:25 -05:00
										 |  |  | #!/usr/bin/env bash
 | 
					
						
							| 
									
										
										
										
											2023-02-07 12:15:22 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-01 12:13:05 -05:00
										 |  |  | # Copyright (c) 2021-2024 tteck | 
					
						
							| 
									
										
										
										
											2023-02-07 12:15:22 -05:00
										 |  |  | # Author: tteck (tteckster) | 
					
						
							|  |  |  | # License: MIT | 
					
						
							|  |  |  | # https://github.com/tteck/Proxmox/raw/main/LICENSE | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-22 20:48:20 -04:00
										 |  |  | source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" | 
					
						
							|  |  |  | color | 
					
						
							|  |  |  | verb_ip6 | 
					
						
							|  |  |  | catch_errors | 
					
						
							|  |  |  | setting_up_container | 
					
						
							|  |  |  | network_check | 
					
						
							|  |  |  | update_os | 
					
						
							| 
									
										
										
										
											2022-12-31 11:27:25 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | msg_info "Installing Dependencies (Patience)" | 
					
						
							|  |  |  | $STD apt-get install -y curl | 
					
						
							|  |  |  | $STD apt-get install -y sudo | 
					
						
							| 
									
										
										
										
											2023-01-23 10:42:50 -05:00
										 |  |  | $STD apt-get install -y mc | 
					
						
							| 
									
										
										
										
											2022-12-31 11:27:25 -05:00
										 |  |  | $STD apt-get install -y exiftool | 
					
						
							|  |  |  | $STD apt-get install -y ffmpeg | 
					
						
							| 
									
										
										
										
											2023-08-23 05:51:24 -04:00
										 |  |  | $STD apt-get install -y libheif1 | 
					
						
							| 
									
										
										
										
											2023-11-02 10:48:47 -04:00
										 |  |  | $STD apt-get install -y libpng-dev | 
					
						
							|  |  |  | $STD apt-get install -y libjpeg-dev | 
					
						
							|  |  |  | $STD apt-get install -y libtiff-dev | 
					
						
							|  |  |  | $STD apt-get install -y imagemagick | 
					
						
							|  |  |  | $STD apt-get install -y darktable | 
					
						
							| 
									
										
										
										
											2024-03-06 13:58:29 +00:00
										 |  |  | $STD apt-get install -y rawtherapee | 
					
						
							| 
									
										
										
										
											2024-05-23 17:05:02 -04:00
										 |  |  | $STD apt-get install -y libvips42 | 
					
						
							| 
									
										
										
										
											2022-12-31 11:27:25 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-06 14:14:05 +00:00
										 |  |  | echo 'export PATH=/usr/local:$PATH' >>~/.bashrc | 
					
						
							|  |  |  | export PATH=/usr/local:$PATH | 
					
						
							| 
									
										
										
										
											2023-11-02 10:48:47 -04:00
										 |  |  | msg_ok "Installed Dependencies" | 
					
						
							| 
									
										
										
										
											2022-12-31 11:27:25 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-02 10:48:47 -04:00
										 |  |  | msg_info "Installing PhotoPrism (Patience)" | 
					
						
							| 
									
										
										
										
											2023-11-03 16:25:03 -04:00
										 |  |  | mkdir -p /opt/photoprism/{cache,config,photos/originals,photos/import,storage,temp} | 
					
						
							| 
									
										
										
										
											2023-11-02 10:48:47 -04:00
										 |  |  | wget -q -cO - https://dl.photoprism.app/pkg/linux/amd64.tar.gz | tar -xz -C /opt/photoprism --strip-components=1 | 
					
						
							|  |  |  | if [[ ${PCT_OSTYPE} == "ubuntu" ]]; then  | 
					
						
							|  |  |  |   wget -q -cO - https://dl.photoprism.app/dist/libheif/libheif-jammy-amd64-v1.17.1.tar.gz | tar -xzf - -C /usr/local --strip-components=1 | 
					
						
							| 
									
										
										
										
											2022-12-31 11:27:25 -05:00
										 |  |  | else | 
					
						
							| 
									
										
										
										
											2023-11-02 10:48:47 -04:00
										 |  |  |   wget -q -cO - https://dl.photoprism.app/dist/libheif/libheif-bookworm-amd64-v1.17.1.tar.gz | tar -xzf - -C /usr/local --strip-components=1 | 
					
						
							| 
									
										
										
										
											2022-12-31 11:27:25 -05:00
										 |  |  | fi | 
					
						
							| 
									
										
										
										
											2023-02-17 16:58:54 -05:00
										 |  |  | ldconfig | 
					
						
							| 
									
										
										
										
											2023-11-02 10:48:47 -04:00
										 |  |  | cat <<EOF >/opt/photoprism/config/.env | 
					
						
							| 
									
										
										
										
											2022-12-31 11:27:25 -05:00
										 |  |  | PHOTOPRISM_AUTH_MODE='password' | 
					
						
							|  |  |  | PHOTOPRISM_ADMIN_PASSWORD='changeme' | 
					
						
							|  |  |  | PHOTOPRISM_HTTP_HOST='0.0.0.0' | 
					
						
							|  |  |  | PHOTOPRISM_HTTP_PORT='2342' | 
					
						
							|  |  |  | PHOTOPRISM_SITE_CAPTION='https://tteck.github.io/Proxmox/' | 
					
						
							| 
									
										
										
										
											2023-11-02 10:48:47 -04:00
										 |  |  | PHOTOPRISM_STORAGE_PATH='/opt/photoprism/storage' | 
					
						
							|  |  |  | PHOTOPRISM_ORIGINALS_PATH='/opt/photoprism/photos/originals' | 
					
						
							|  |  |  | PHOTOPRISM_IMPORT_PATH='/opt/photoprism/photos/import' | 
					
						
							|  |  |  | EOF | 
					
						
							| 
									
										
										
										
											2024-07-02 20:23:52 -04:00
										 |  |  | ln -sf /opt/photoprism/bin/photoprism /usr/local/bin/photoprism | 
					
						
							| 
									
										
										
										
											2023-11-02 10:48:47 -04:00
										 |  |  | msg_ok "Installed PhotoPrism" | 
					
						
							| 
									
										
										
										
											2022-12-31 11:27:25 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | msg_info "Creating Service" | 
					
						
							| 
									
										
										
										
											2023-11-02 10:48:47 -04:00
										 |  |  | cat <<EOF >/etc/systemd/system/photoprism.service | 
					
						
							|  |  |  | [Unit] | 
					
						
							| 
									
										
										
										
											2022-12-31 11:27:25 -05:00
										 |  |  | Description=PhotoPrism service | 
					
						
							|  |  |  | After=network.target | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [Service] | 
					
						
							|  |  |  | Type=forking | 
					
						
							|  |  |  | User=root | 
					
						
							|  |  |  | WorkingDirectory=/opt/photoprism | 
					
						
							| 
									
										
										
										
											2023-11-02 10:48:47 -04:00
										 |  |  | EnvironmentFile=/opt/photoprism/config/.env | 
					
						
							| 
									
										
										
										
											2022-12-31 11:27:25 -05:00
										 |  |  | ExecStart=/opt/photoprism/bin/photoprism up -d | 
					
						
							|  |  |  | ExecStop=/opt/photoprism/bin/photoprism down | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [Install] | 
					
						
							| 
									
										
										
										
											2023-11-02 10:48:47 -04:00
										 |  |  | WantedBy=multi-user.target | 
					
						
							|  |  |  | EOF | 
					
						
							|  |  |  | systemctl enable -q --now photoprism | 
					
						
							| 
									
										
										
										
											2022-12-31 11:27:25 -05:00
										 |  |  | msg_ok "Created Service" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-22 20:48:20 -04:00
										 |  |  | motd_ssh | 
					
						
							| 
									
										
										
										
											2023-05-15 07:39:30 -04:00
										 |  |  | customize | 
					
						
							| 
									
										
										
										
											2022-12-31 11:27:25 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | msg_info "Cleaning up" | 
					
						
							| 
									
										
										
										
											2024-05-02 13:26:16 -04:00
										 |  |  | $STD apt-get -y autoremove | 
					
						
							|  |  |  | $STD apt-get -y autoclean | 
					
						
							| 
									
										
										
										
											2022-12-31 11:27:25 -05:00
										 |  |  | msg_ok "Cleaned" |