first commit

This commit is contained in:
A.Hediehloo 2025-12-30 12:58:23 +03:30
commit 2e7a885a4c
6 changed files with 364 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
New Text Document.txt
.env

28
README.md Normal file
View File

@ -0,0 +1,28 @@
# راه‌اندازی کانفلوئنس
راه‌اندازی کانفلوئنس را می‌توان با استفاده از داکر کامپوزی که در پروژه‌ی کانفلوئنس وجود دارد انجام داد. برای آن که مشکلاتی در اجرا ایجاد نشود، لازم است متغیرهای محیطی مثل JVM_MAXIMUM_MEMORY و ReservedCodeCacheSize مشخص شوند.
پس از آن که در مرورگر، کانفلوئنس را باز می‌کنید، مقدار server-id را مشاهده می‌کنید. این مقدار را در جایی یادداشت کنید. برای کرک کردن کانفلوئنس لازم است دستور زیر را بزنید:
```
java -jar /var/agent/atlassian-agent.jar \
-d \
-p conf \
-m Hello@world.com \
-n Hello@world.com \
-o MHS \
-s server-id
```
تنظیمات دیتابیس هم، طوری انجام شود که به دیتابیسی که در کنار کانتینر کانفلوئنس بالا آورده شده، متصل گردد.
# اضافه کردن اکستنشن
برای اضافه کردن اکستنشن، ابتدا از یک user که admin هست باید login کنید. سپس به تنظیمات بروید. در آن‌جا به Manage apps بروید. گزینه‌ی Find new apps را بزنید. فرض کنید می‌خواهید LaTeX Math را نصب کنید. ابتدا LaTeX Math را سرچ کنید. سپس free trial را بزنید و آن را نصب کنید. حال به Manage apps بازگردید و در نوار مربوط به اکستنشن نصب شده، به قسمت App key توجه کنید. برای این اکستننن نوشته شده:
com.tensixtwo.conf.latexmath
سپس دستور زیر را در کانتینر مربوط به کانفلوئنس بزنید:
```
java -jar /var/agent/atlassian-agent.jar \
-d \
-p com.tensixtwo.conf.latexmath \
-m Hello@world.com \
-n Hello@world.com \
-o MHS \
-s server-id
```
در این دستور بعد از -p باید همان مقدار App key باشد و در -s باید همان server-id باشد در زمان فرایند نصب conflunece به دست آورده‌اید. بعد از اجرای این دستور، یک license code تولید میشود. این license code را در صفحه‌ی ui مربوط به confluence در قسمت مربوط به اکستنشن نصب شده، وارد کنید.

104
conf/server.xml Normal file
View File

@ -0,0 +1,104 @@
<Server port="8000" shutdown="SHUTDOWN">
<Service name="Tomcat-Standalone">
<!--
==============================================================================================================
DEFAULT - Direct connector with no proxy, for unproxied HTTP access to Confluence.
If using a http/https proxy, comment out this connector.
==============================================================================================================
-->
<Connector port="8090" connectionTimeout="20000" redirectPort="8443"
maxThreads="48" maxPostSize="16777216" minSpareThreads="10"
enableLookups="false" acceptCount="10" URIEncoding="UTF-8"
protocol="org.apache.coyote.http11.Http11NioProtocol"/>
<!--
==============================================================================================================
HTTP - Proxying Confluence via Apache or Nginx over HTTP
If you're proxying traffic to Confluence over HTTP, uncomment the connector below and comment out the others.
Make sure you provide the right information for proxyName and proxyPort.
For more information see:
Apache - https://confluence.atlassian.com/x/4xQLM
nginx - https://confluence.atlassian.com/x/TgSvEg
==============================================================================================================
-->
<!--
<Connector port="8090" connectionTimeout="20000" redirectPort="8443"
maxThreads="48" maxPostSize="16777216" minSpareThreads="10"
enableLookups="false" acceptCount="10" URIEncoding="UTF-8"
protocol="org.apache.coyote.http11.Http11NioProtocol"
scheme="http" proxyName="<subdomain>.<domain>.com" proxyPort="80"/>
-->
<!--
==============================================================================================================
HTTPS - Direct connector with no proxy, for unproxied HTTPS access to Confluence.
For more info see https://confluence.atlassian.com/x/s3UC
==============================================================================================================
-->
<!--
<Connector port="8443" maxHttpHeaderSize="8192"
maxThreads="150" maxPostSize="16777216" minSpareThreads="25"
protocol="org.apache.coyote.http11.Http11Nio2Protocol"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLSv1.2" sslEnabledProtocols="TLSv1.2" SSLEnabled="true"
URIEncoding="UTF-8" keystorePass="<MY_CERTIFICATE_PASSWORD>"/>
-->
<!--
==============================================================================================================
HTTPS - Proxying Confluence via Apache or Nginx over HTTPS
If you're proxying traffic to Confluence over HTTPS, uncomment the connector below and comment out the others.
Make sure you provide the right information for proxyName and proxyPort.
For more information see:
Apache - https://confluence.atlassian.com/x/PTT3MQ
nginx - https://confluence.atlassian.com/x/cNIvMw
==============================================================================================================
-->
<!--
<Connector port="8090" connectionTimeout="20000" redirectPort="8443"
maxThreads="48" maxPostSize="16777216" minSpareThreads="10"
enableLookups="false" acceptCount="10" URIEncoding="UTF-8"
protocol="org.apache.coyote.http11.Http11NioProtocol"
scheme="https" secure="true" proxyName="<subdomain>.<domain>.com" proxyPort="443"/>
-->
<Engine name="Standalone" defaultHost="localhost">
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="false" startStopThreads="4">
<Context path="" docBase="../confluence" reloadable="false" useHttpOnly="true">
<!-- Logging configuration for Confluence is specified in confluence/WEB-INF/classes/log4j.properties -->
<Manager pathname=""/>
<Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="60"/>
<!-- http://tomcat.apache.org/tomcat-9.0-doc/config/valve.html#Access_Log_Valve -->
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs"
maxDays="30"
pattern="%t %{X-AUSERNAME}o %I %h %r %s %Dms %b %{Referer}i %{User-Agent}i"
prefix="conf_access_log"
requestAttributesEnabled="true"
rotatable="true"
suffix=".log"
/>
<!-- http://tomcat.apache.org/tomcat-9.0-doc/config/valve.html#Remote_IP_Valve -->
<Valve className="org.apache.catalina.valves.RemoteIpValve" />
</Context>
<Context path="${confluence.context.path}/synchrony-proxy" docBase="../synchrony-proxy"
reloadable="false" useHttpOnly="true">
<Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="60"/>
</Context>
</Host>
</Engine>
</Service>
</Server>

51
docker-compose.yml Normal file
View File

@ -0,0 +1,51 @@
version: '3.4'
services:
confluence:
image: haxqer/confluence:9.5.3
container_name: confluence-srv
environment:
- TZ=Asia/Shanghai
- JVM_MINIMUM_MEMORY=1g
- JVM_MAXIMUM_MEMORY=12g
- JVM_CODE_CACHE_ARGS='-XX:InitialCodeCacheSize=1g -XX:ReservedCodeCacheSize=8g'
depends_on:
- mysql
ports:
- "8090:8090"
volumes:
- home_data:/var/confluence
- ./conf/server.xml:/opt/confluence/conf/server.xml
# - ./keystore:/root/.keystore
restart: unless-stopped
networks:
- network-bridge
stdin_open: true
tty: true
mysql:
image: mysql:8.0
container_name: mysql-confluence
environment:
- TZ=Asia/Shanghai
- MYSQL_DATABASE=confluence
- MYSQL_ROOT_PASSWORD=ThrVi6Mr1TTQKXDssi
- MYSQL_USER=confluence
- MYSQL_PASSWORD=YhKm4o8IihqFHr0Z4C
command: ['mysqld', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_bin', '--transaction-isolation=READ-COMMITTED', '--innodb_log_file_size=256M', '--max_allowed_packet=256M','--log_bin_trust_function_creators=1']
volumes:
- mysql_data:/var/lib/mysql
restart: unless-stopped
networks:
- network-bridge
stdin_open: true
tty: true
networks:
network-bridge:
driver: bridge
volumes:
home_data:
external: false
mysql_data:
external: false

72
instructions.md Normal file
View File

@ -0,0 +1,72 @@
https://github.com/haxqer/confluence
https://confluence.atlassian.com/doc/running-confluence-over-ssl-or-https-161203.html#RunningConfluenceOverSSLorHTTPS-serverconfig
keytool -genkeypair -keysize 2048 -alias tomcat -keyalg RSA -sigalg SHA256withRSA \
-validity 365 \
-keystore ~/confluence_program/keystore
h9zFBKj9Hp6Y7d
78.38.161.78
PHS
PHS
Tehran
Tehran
IR
keytool -certreq -keyalg RSA -alias tomcat -file certreq.csr -keystore ~/confluence_program/keystore
docker exec -it confluence-srv bash
java -jar /var/agent/atlassian-agent.jar \
-d \
-p conf \
-m Hello@world.com \
-n Hello@world.com \
-o MHS \
-s BMSN-E4LJ-I0K8-FN2R
Host:
mysql
3306
java -jar /var/agent/atlassian-agent.jar \
-d \
-p com.methoda.plugins.rtl-for-confluence \
-m Hello@world.com \
-n Hello@world.com \
-o MHS \
-s BMSN-E4LJ-I0K8-FN2R
java -jar /var/agent/atlassian-agent.jar \
-d \
-p com.stepstonetech.confluence.plugins.latex \
-m Hello@world.com \
-n Hello@world.com \
-o MHS \
-s BMSN-E4LJ-I0K8-FN2R
apt update
apt install texlive-latex-base
apt install dvipng
java -jar /var/agent/atlassian-agent.jar \
-d \
-p com.tensixtwo.conf.latexmath \
-m Hello@world.com \
-n Hello@world.com \
-o MHS \
-s BMSN-E4LJ-I0K8-FN2R

107
server.xml Normal file
View File

@ -0,0 +1,107 @@
root@062526feb368:/opt/confluence/conf# cat server.xml
<Server port="8000" shutdown="SHUTDOWN">
<Service name="Tomcat-Standalone">
<!--
==============================================================================================================
DEFAULT - Direct connector with no proxy, for unproxied HTTP access to Confluence.
If using a http/https proxy, comment out this connector.
==============================================================================================================
-->
<!--
<Connector port="8090" connectionTimeout="20000" redirectPort="8443"
maxThreads="48" maxPostSize="16777216" minSpareThreads="10"
enableLookups="false" acceptCount="10" URIEncoding="UTF-8"
protocol="org.apache.coyote.http11.Http11NioProtocol"/>
-->
<!--
==============================================================================================================
HTTP - Proxying Confluence via Apache or Nginx over HTTP
If you're proxying traffic to Confluence over HTTP, uncomment the connector below and comment out the others.
Make sure you provide the right information for proxyName and proxyPort.
For more information see:
Apache - https://confluence.atlassian.com/x/4xQLM
nginx - https://confluence.atlassian.com/x/TgSvEg
==============================================================================================================
-->
<!--
<Connector port="8090" connectionTimeout="20000" redirectPort="8443"
maxThreads="48" maxPostSize="16777216" minSpareThreads="10"
enableLookups="false" acceptCount="10" URIEncoding="UTF-8"
protocol="org.apache.coyote.http11.Http11NioProtocol"
scheme="http" proxyName="<subdomain>.<domain>.com" proxyPort="80"/>
-->
<!--
==============================================================================================================
HTTPS - Direct connector with no proxy, for unproxied HTTPS access to Confluence.
For more info see https://confluence.atlassian.com/x/s3UC
==============================================================================================================
-->
<!--
<Connector port="8443" maxHttpHeaderSize="8192"
maxThreads="150" maxPostSize="16777216" minSpareThreads="25"
protocol="org.apache.coyote.http11.Http11Nio2Protocol"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLSv1.2" sslEnabledProtocols="TLSv1.2" SSLEnabled="true"
URIEncoding="UTF-8" keystorePass="<MY_CERTIFICATE_PASSWORD>"/>
-->
<!--
==============================================================================================================
HTTPS - Proxying Confluence via Apache or Nginx over HTTPS
If you're proxying traffic to Confluence over HTTPS, uncomment the connector below and comment out the others.
Make sure you provide the right information for proxyName and proxyPort.
For more information see:
Apache - https://confluence.atlassian.com/x/PTT3MQ
nginx - https://confluence.atlassian.com/x/cNIvMw
==============================================================================================================
-->
<Connector port="8090" connectionTimeout="20000" redirectPort="8443"
maxThreads="48" maxPostSize="16777216" minSpareThreads="10"
enableLookups="false" acceptCount="10" URIEncoding="UTF-8"
protocol="org.apache.coyote.http11.Http11NioProtocol"
scheme="https" secure="true" proxyName="confluence.aiengines.ir" proxyPort="443"/>
<Engine name="Standalone" defaultHost="localhost">
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="false" startStopThreads="4">
<Context path="" docBase="../confluence" reloadable="false" useHttpOnly="true">
<!-- Logging configuration for Confluence is specified in confluence/WEB-INF/classes/log4j.properties -->
<Manager pathname=""/>
<Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="60"/>
<!-- http://tomcat.apache.org/tomcat-9.0-doc/config/valve.html#Access_Log_Valve -->
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs"
maxDays="30"
pattern="%t %{X-AUSERNAME}o %I %h %r %s %Dms %b %{Referer}i %{User-Agent}i"
prefix="conf_access_log"
requestAttributesEnabled="true"
rotatable="true"
suffix=".log"
/>
<!-- http://tomcat.apache.org/tomcat-9.0-doc/config/valve.html#Remote_IP_Valve -->
<Valve className="org.apache.catalina.valves.RemoteIpValve" />
</Context>
<Context path="${confluence.context.path}/synchrony-proxy" docBase="../synchrony-proxy"
reloadable="false" useHttpOnly="true">
<Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="60"/>
</Context>
</Host>
</Engine>
</Service>
</Server>