Mac安装homepage

1. homepage介绍 官网地址:这里 一个现代化、完全静态、快速、安全、完全代理、高度可定制的应用程序仪表板,集成了 100 多种服务,并可翻译成多种语言。通过 YAML 文件或 Docker 标签发现轻松配置。 2. 为什么要写这个? 因为官网提供的是docker、k8s等安装方式,并没有提供mac本地安装,而我想在自己电脑上有这么一个。所以就要用源码安装了。 3. 普通安装会出来什么问题? mac新版本用iTrem2的nohup启动后,退出iTrem2后,Session会关闭,导致nohup不成功 4. 如何处理? 4.1 下载源码,切换分支 git clone https://github.com/gethomepage/homepage.git HomePage git checkout tags/v0.8.9 4.2 确定node版本,编译 # 应该在18以上,我是20 # 到工作目录 npm install npm run build 4.3 创建plist 地址:~/Library/LaunchAgents 名称:wiki.micah.homepage.plist 注意,这里必须plist结尾的 内容:xxx表示你的用户目录 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>wiki.micah.homepage</string> <key>RunAtLoad</key> <true/> <key>KeepAlive</key> <true/> <key>ThrottleInterval</key> <integer>60</integer> <key>EnvironmentVariables</key> <dict> <key>HOME_DIR</key> <string>/Users/xx</string> <key>APP_DIR</key> <string>/Users/xxx/HomePage</string> </dict> <key>ProgramArguments</key> <array> <string>/bin/zsh</string> <string>-c</string> <string>-l</string> <string>source $HOME_DIR/....

March 15, 2024

Springboot问题汇总

1. 编写starter时,引用后无法获取到bean 环境:使用版本Springboot3.1.4版本 问题:之前写starter的时候,一直是按照网上的教程,大部分是Springboot2.x版本,但自己使用了最新版本Springboot3.1.4版本,所以一直不成功。 深入代码查看后,发现以下跟老版本不一致。 新版本: SpringBootApplication --> EnableAutoConfiguration --> AutoConfigurationImportSelector.getCandidateConfigurations --> ImportCandidates.load --> LOCATION --> "META-INF/spring/%s.imports" 老版本: SpringBootApplication --> EnableAutoConfiguration --> AutoConfigurationImportSelector.getCandidateConfigurations --> SpringFactoriesLoader.loadFactoryNames --> Factories_RESOURCE_LOCATION --> "META-INF/spring.factories" 所以按照新版 META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports 进行编写的,可以正常识别。 注意: 这里的内容也不一样了,之前是需要写入一行,新版本支持多行格式 Enumeration<URL> urls = findUrlsInClasspath(classLoaderToUse, location); List<String> importCandidates = new ArrayList<>(); while (urls.hasMoreElements()) { // 如果有多行,直接支持了,把所有的都加入到importCandidates中去了 URL url = urls.nextElement(); importCandidates.addAll(readCandidateConfigurations(url)); }

October 14, 2023

SpringSecurity

SpringSecurity从入门到精通 课程介绍 本课件由三更草堂录制, 如果侵权,请联系micah.shi@gmail.com 0. 简介 ​ Spring Security 是 Spring 家族中的一个安全管理框架。相比与另外一个安全框架Shiro,它提供了更丰富的功能,社区资源也比Shiro丰富。 ​ 一般来说中大型的项目都是使用SpringSecurity 来做安全框架。小项目有Shiro的比较多,因为相比与SpringSecurity,Shiro的上手更加的简单。 ​ 一般Web应用的需要进行认证和授权。 ​ 认证:验证当前访问系统的是不是本系统的用户,并且要确认具体是哪个用户 ​ 授权:经过认证后判断当前用户是否有权限进行某个操作 ​ 而认证和授权也是SpringSecurity作为安全框架的核心功能。 1. 快速入门 1.1 准备工作 ​ 我们先要搭建一个简单的SpringBoot工程 ① 设置父工程 添加依赖 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.5.0</version> </parent> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <optional>true</optional> </dependency> </dependencies> ② 创建启动类 @SpringBootApplication public class SecurityApplication { public static void main(String[] args) { SpringApplication.run(SecurityApplication.class,args); } } ③ 创建Controller import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class HelloController { @RequestMapping("/hello") public String hello(){ return "hello"; } } 1....

October 8, 2023

Ubuntu服务器初始化

初始化需要的步骤 1. 更新 sudo apt upgrade 2. 安装软件 sudo apt-get install nginx # 修改启动用户为root vi /etc/nginx/nginx.conf # 第一行 # user root;

September 30, 2023

数组双指针

September 21, 2023