美文网首页工程项目管理Comm & Contral
JIRA 7.12.x安装配置和破解

JIRA 7.12.x安装配置和破解

作者: 九遐 | 来源:发表于2018-10-23 23:10 被阅读1172次

    我们平时说的JIRA主要是指JIRA Software. 相关软件的区别:

    • JIRA Core:主要做缺陷管理
    • JIRA Software:JIRA Core + Agile插件
    • JIRA Service Desk: JIRA Core + Agile插件 + Service Desk插件

    JIRA安装包下载地址 https://www.atlassian.com/software/jira/download。这里使用的是docker镜像。

    安装

    1. pull docker 镜像: jira:7.12.3(目前的最新版本) mysql:5.7
    docker pull cptactionhank/atlassian-jira-software
    docker pull mysql:5.7
    
    1. 启动mysql docker实例
    docker run --name atlassian-mysql --restart always -p 3306:3306 -v /opt/mysql_data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=passwd -d mysql:5.7   #记得修改passwd
    

    如果/opt无法挂载,可以挂到普通用户目录下面,比如/home/bob

    1. 连接mysql
      连接之前先修改mysql镜像的tag,避免程序尝试找最新版本的mysql:
    root@bob-virtual-machine:/home/bob# docker images|grep mysql
    mysql                                                             5.7                 1b30b36ae96a        7 days ago          372 MB
    root@bob-virtual-machine:/home/bob# docker tag 1b30b36ae96a mysql:latest
    

    连接mysql

    docker run -it --link atlassian-mysql:mysql --rm mysql sh -c 'exec mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD"'
    
    1. 创建jira数据库,并添加jira用户
    CREATE database jira default character set utf8 collate utf8_bin;
    CREATE USER `jira`@`%` IDENTIFIED BY 'jira';GRANT ALL ON *.* TO `jira`@`%` WITH GRANT OPTION;
    alter user 'jira'@'%' identified with mysql_native_password by 'jira';
    
    1. 修改mysql事物隔离级别
    set global transaction isolation level read committed;
    set session transaction isolation level read committed;
    
    1. 启动jira实例
    docker run --detach --restart always -v /data/atlassian/confluence:/home --publish 8080:8080 cptactionhank/atlassian-jira-software
    

    如果/data无法挂载,可以挂到普通用户目录下面,比如/home/bob

    image.png image.png image.png image.png image.png image.png image.png image.png image.png image.png image.png image.png image.png image.png
    image.png image.png image.png

    破解

    现在网上有两个破解文件,atlassian-extras-3.1.2.jar可以破解jira 12.x,但atlassian-extras-3.2.jar不可以。所以破解请用atlassian-extras-3.1.2.jar。

    破解:
    把/opt/atlassian/jira/atlassian-jira/WEB-INF/lib中的atlassian-extras-3.2.jar改为atlassian-extras-3.2.jar.bak,把atlassian-extras-3.1.2.jar复制到/opt/atlassian/jira/atlassian-jira/WEB-INF/lib重启jira服务即可。(windows中的相应路径是C:\Program Files\Atlassian\JIRA\atlassian-jira\WEB-INF\lib)

    docker exec --user root 97 mv /opt/atlassian/jira/atlassian-jira/WEB-INF/lib/atlassian-extras-3.2.jar /opt/atlassian/jira/atlassian-jira/WEB-INF/lib/atlassian-extras-3.2.jar_bak
    
    docker cp atlassian-extras-3.1.2.jar 97:/opt/atlassian/jira/atlassian-jira/WEB-INF/lib/
    
    docker restart 97     #97为jira容器id的最前面两位数字
    
    激活后的效果: image.png

    troubleshooting

    1. 不能选择最新的MYSQL 8.0, 会在后台提示语法错误,无法成功初始化JIRA。可以选老一点的版本,比如5.7 .

    2. 如果启动后报数据库连接错误,可以删除Application Data\JIRA目录下的dbconfig.xml文件,这里面写的是连接数据库的地址和用户名还有密码

    后记

    参考https://github.com/cptactionhank上面的Dockerfile, 我把破解文件直接加进了docker image, 启动后用试用版注册码进入JIRA, 进去后查看系统信息就会看到其实已经破解成功。加了破解文件的Dockerfile内容如下:

    FROM openjdk:8-alpine
    
    # Configuration variables.
    ENV JIRA_HOME     /var/atlassian/jira
    ENV JIRA_INSTALL  /opt/atlassian/jira
    ENV JIRA_VERSION  7.12.3
    
    # Install Atlassian JIRA and helper tools and setup initial home
    # directory structure.
    RUN set -x \
        && apk add --no-cache curl xmlstarlet bash ttf-dejavu libc6-compat \
        && mkdir -p                "${JIRA_HOME}" \
        && mkdir -p                "${JIRA_HOME}/caches/indexes" \
        && chmod -R 700            "${JIRA_HOME}" \
        && chown -R daemon:daemon  "${JIRA_HOME}" \
        && mkdir -p                "${JIRA_INSTALL}/conf/Catalina" \
        && curl -Ls                "https://www.atlassian.com/software/jira/downloads/binary/atlassian-jira-software-7.12.3.tar.gz" | tar -xz --directory "${JIRA_INSTALL}" --strip-components=1 --no-same-owner \
        && curl -Ls                "https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.38.tar.gz" | tar -xz --directory "${JIRA_INSTALL}/lib" --strip-components=1 --no-same-owner "mysql-connector-java-5.1.38/mysql-connector-java-5.1.38-bin.jar" \
        && rm -f                   "${JIRA_INSTALL}/lib/postgresql-9.1-903.jdbc4-atlassian-hosted.jar" \
        && curl -Ls                "https://jdbc.postgresql.org/download/postgresql-42.2.1.jar" -o "${JIRA_INSTALL}/lib/postgresql-42.2.1.jar" \
        && chmod -R 700            "${JIRA_INSTALL}/conf" \
        && chmod -R 700            "${JIRA_INSTALL}/logs" \
        && chmod -R 700            "${JIRA_INSTALL}/temp" \
        && chmod -R 700            "${JIRA_INSTALL}/work" \
        && chown -R daemon:daemon  "${JIRA_INSTALL}/conf" \
        && chown -R daemon:daemon  "${JIRA_INSTALL}/logs" \
        && chown -R daemon:daemon  "${JIRA_INSTALL}/temp" \
        && chown -R daemon:daemon  "${JIRA_INSTALL}/work" \
        && sed --in-place          "s/java version/openjdk version/g" "${JIRA_INSTALL}/bin/check-java.sh" \
        && echo -e                 "\njira.home=$JIRA_HOME" >> "${JIRA_INSTALL}/atlassian-jira/WEB-INF/classes/jira-application.properties" \
        && touch -d "@0"           "${JIRA_INSTALL}/conf/server.xml"
    
    # crack it
    COPY "atlassian-extras-3.1.2.jar" "/opt/atlassian/jira/atlassian-jira/WEB-INF/lib/"
    RUN mv /opt/atlassian/jira/atlassian-jira/WEB-INF/lib/atlassian-extras-3.2.jar /opt/atlassian/jira/atlassian-jira/WEB-INF/lib/atlassian-extras-3.2.jar_bak
    
    # Use the default unprivileged account. This could be considered bad practice
    # on systems where multiple processes end up being executed by 'daemon' but
    # here we only ever run one process anyway.
    
    USER daemon:daemon
    
    # Expose default HTTP connector port.
    EXPOSE 8080
    
    # Set volume mount points for installation and home directory. Changes to the
    # home directory needs to be persisted as well as parts of the installation
    # directory due to eg. logs.
    VOLUME ["/var/atlassian/jira", "/opt/atlassian/jira/logs"]
    
    # Set the default working directory as the installation directory.
    WORKDIR /var/atlassian/jira
    
    COPY "docker-entrypoint.sh" "/"
    ENTRYPOINT ["/docker-entrypoint.sh"]
    
    # Run Atlassian JIRA as a foreground process by default.
    CMD ["/opt/atlassian/jira/bin/start-jira.sh", "-fg"]
    

    其中的docker-entrypoint.sh来自于https://github.com/cptactionhank/docker-atlassian-jira/blob/master/docker-entrypoint.sh

    相关文章

      网友评论

        本文标题:JIRA 7.12.x安装配置和破解

        本文链接:https://www.haomeiwen.com/subject/hxvzzftx.html