This commit is contained in:
Tykayn 2020-11-26 14:54:38 +01:00 committed by tykayn
commit 5512ec4c50
4 changed files with 120 additions and 3 deletions

75
.gitignore vendored Normal file
View File

@ -0,0 +1,75 @@
# Created by .ignore support plugin (hsz.mobi)
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# Generated files
.idea/**/contentModel.xml
.idea
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

View File

@ -2,6 +2,8 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="76e62301-cc1d-40d1-8025-77ac5d7e8dda" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
<change afterPath="$PROJECT_DIR$/monitoring/check_version.sh" afterDir="false" />
<change beforePath="$PROJECT_DIR$/rapport_activite/rapport_activite.sh" beforeDir="false" afterPath="$PROJECT_DIR$/rapport_activite/rapport_activite.sh" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
@ -44,7 +46,7 @@
<workItem from="1605258559558" duration="1754000" />
<workItem from="1605602229773" duration="5663000" />
<workItem from="1605690163417" duration="137000" />
<workItem from="1606396769239" duration="1314000" />
<workItem from="1606396769239" duration="1952000" />
</task>
<servers />
</component>

View File

@ -0,0 +1,39 @@
#!/bin/bash
#
# Nagios plugin to check mobilizon's version
#
# program return value
# 0 : OK
# 1 : CRITICAL
# 2 : WARNING new version available
# 3 : UNKNOWN github or local repo not probable
# project api for gitlab https://docs.gitlab.com/ee/api/tags.html
# upgrade documentation https://docs.joinmobilizon.org/administration/upgrading/
LOCAL_REPO=/srv/mobilizon.chapril.org/live
FRAMAGIT_PROJECT_ID=20125
function usage() {
echo "Usage : $0"
}
#
if [ "$#" -ne 0 ]; then
usage
else
lastVersion=$(curl -s https://framagit.org/api/v4/projects/$FRAMAGIT_PROJECT_ID/releases | jshon -a -e name|cut -d '"' -f2|grep -v '[\^\(alpha\)]'|head -n 1)
currentVersion=$(cd $LOCAL_REPO && git branch | grep '*'|cut -c 11-100 )
# echo "current version: $currentVersion"
# echo "last version: $lastVersion"
if [ $currentVersion == $lastVersion ]; then
echo "OK"
result=0
else
echo "WARNING : new version available, current is $currentVersion, last is $lastVersion."
result=1
fi
fi
exit $result

View File

@ -18,11 +18,12 @@
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# access_log /var/log/nginx/mobilizon.chapril.org/mobilizon.chapril.org-access.log
# error_log /var/log/nginx/mobilizon.chapril.org/mobilizon.chapril.org-error.log
# ============================================
LOG_PREFIX="/var/log/apache2/mobilizon.chapril.org/mobilizon.chapril.org"
LOG_PREFIX="/var/log/nginx/mobilizon.chapril.org/mobilizon.chapril.org"
SERVICE_NAME="mobilizon.chapril.org"
source "/etc/mobilizon.chapril.org/mobilizonchaprilorg.conf"