diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e961147 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.swp +*.swo + diff --git a/conf/app.src b/conf/app.src index 2d09448..e5619b3 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,6 +1,6 @@ -SOURCE_URL=https://github.com/wekan/wekan/releases/download/v0.45/wekan-0.45.tar.gz -SOURCE_SUM=4245f6674e407ad40bc899788058887213d5daf8d7620e0ae0c07af22b7c82aa +SOURCE_URL=https://github.com/wekan/wekan/releases/download/v0.63/wekan-0.63.tar.gz +SOURCE_SUM=5a582446859d2563bf7a5f6e7d7bc1e6d8c63a6021f0f2e024cab0ffea78c5aa SOURCE_SUM_PRG=sha256sum ARCH_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=wekan-0.45.tar.gz +SOURCE_FILENAME=wekan-0.62.tar.gz diff --git a/conf/systemd.service b/conf/systemd.service index f7a2860..70c3e2f 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -11,7 +11,7 @@ ExecStartPre=__NODEJS__ Environment="PATH=__ENV_PATH__" Environment=NODE_ENV=production Environment=MONGO_URL=mongodb://127.0.0.1:27017/__DB_NAME__ -Environment=ROOT_URL=http://127.0.0.1:__PORT____URI__ PORT=__PORT__ +Environment=ROOT_URL=https://__DOMAIN____URI__ PORT=__PORT__ WorkingDirectory=__FINALPATH__ ExecStart=/opt/node_n/bin/node __FINALPATH__/main.js Restart=on-failure diff --git a/manifest.json b/manifest.json index 022f9ae..13fde08 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name": "Wekan", "id": "wekan", "packaging_format": 1, - "version": "0.45-1", + "version": "0.63-1", "description": { "en": "Trello-like kanban", "fr": "Un kanban similaire à Trello" diff --git a/scripts/_future.sh b/scripts/_future.sh index abdb7ed..83a5313 100644 --- a/scripts/_future.sh +++ b/scripts/_future.sh @@ -209,3 +209,5 @@ EOF chmod +x "/etc/cron.daily/node_update" } + +ynh_version_gt() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"; } diff --git a/scripts/install b/scripts/install index 8e35fc6..9757760 100755 --- a/scripts/install +++ b/scripts/install @@ -48,11 +48,11 @@ ynh_app_setting_set $app port $port #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_install_nodejs 4.8.4 +ynh_install_nodejs 4.8.7 # Install mongodb -apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 -echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" > /etc/apt/sources.list.d/mongodb-org-3.2.list +wget https://www.mongodb.org/static/pgp/server-3.2.asc -o - | apt-key add - +echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.2 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list ynh_install_app_dependencies "mongodb-org mongodb-org-server mongodb-org-shell mongodb-org-mongos mongodb-org-tools" @@ -89,8 +89,8 @@ npm install popd # Start mogodb -systemctl start mongod systemctl enable mongod +systemctl restart mongod #================================================= # SETUP SYSTEMD @@ -99,8 +99,9 @@ systemctl enable mongod ynh_replace_string "__NODEJS__" "$nodejs_use_version" "../conf/systemd.service" ynh_replace_string "__ENV_PATH__" "$PATH" "../conf/systemd.service" ynh_replace_string "__DB_NAME__" "$app" "../conf/systemd.service" -ynh_replace_string "__URI__" "$path_url" "../conf/systemd.service" +ynh_replace_string "__URI__" "$path_url/" "../conf/systemd.service" ynh_replace_string "__PORT__" "$port" "../conf/systemd.service" +ynh_replace_string "__DOMAIN__" "$domain" "../conf/systemd.service" ynh_add_systemd_config #================================================= @@ -117,6 +118,7 @@ find "$final_path" -type d -print0 | xargs -0 chmod 750 # ADD SERVICE IN ADMIN PANEL #================================================= yunohost service add mongod --log "/var/log/mongodb.log" +yunohost service add $app #================================================= # SETUP SSOWAT @@ -132,5 +134,5 @@ fi #================================================= # RELOAD NGINX #================================================= +systemctl restart $app systemctl reload nginx -systemctl start $app diff --git a/scripts/remove b/scripts/remove index c0a17f5..f032562 100755 --- a/scripts/remove +++ b/scripts/remove @@ -54,7 +54,8 @@ ynh_remove_nodejs # REMOVE MONGODB #================================================= # TODO / FIXME : remove the keys added ? -#apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 +#apt-key del EA312927 +#apt-key del 0C49F3730359A14518585931BC711F9BA15703C6 #rm -f /etc/apt/sources.list.d/mongodb-org-3.2.list diff --git a/scripts/restore b/scripts/restore index 998b396..3ece36b 100644 --- a/scripts/restore +++ b/scripts/restore @@ -52,10 +52,10 @@ ynh_system_user_create $app "$final_path" #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_install_nodejs 4.8.4 +ynh_install_nodejs 4.8.7 # Install mongodb -apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 +wget https://www.mongodb.org/static/pgp/server-3.2.asc -o - | apt-key add - echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" > /etc/apt/sources.list.d/mongodb-org-3.2.list ynh_install_app_dependencies "mongodb-org mongodb-org-server mongodb-org-shell mongodb-org-mongos mongodb-org-tools" @@ -64,8 +64,8 @@ ynh_install_app_dependencies "mongodb-org mongodb-org-server mongodb-org-shell m # RESTORE DB #================================================= # Start mogodb -systemctl start mongod systemctl enable mongod +systemctl start mongod mongorestore --db $app ./dump #================================================= @@ -93,6 +93,7 @@ find "$final_path" -type d -print0 | xargs -0 chmod 750 # ADD SERVICE IN ADMIN PANEL #================================================= yunohost service add mongod --log "/var/log/mongodb.log" +yunohost service add $app #================================================= # SETUP SSOWAT @@ -108,4 +109,5 @@ fi #================================================= # RELOAD NGINX #================================================= +systemctl restart $app systemctl reload nginx diff --git a/scripts/upgrade b/scripts/upgrade index 0777e92..9427a4a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,7 +19,7 @@ domain=$(ynh_app_setting_get $app domain) path_url=$(ynh_app_setting_get $app path_url) is_public=$(ynh_app_setting_get $app is_public) final_path=$(ynh_app_setting_get $app final_path) -port=$(ynh_app_setting_get $app final_path) +port=$(ynh_app_setting_get $app port) #================================================= # Check version @@ -40,9 +40,24 @@ ynh_abort_if_errors # Exit if an error occurs during the execution of the script # ENSURE DOWNWARD COMPATIBILITY #================================================= -#if [ "${version}" = "20160501-7" ]; then - -#fi +if ynh_version_gt "0.45-2" "${version}" ; then + ynh_replace_string "Environment=ROOT_URL=http://127.0.0.1:$port$path_url" "Environment=ROOT_URL=https://$domain$path_url/" "/etc/systemd/system/$app.service" + systemctl daemon-reload +fi +if ynh_version_gt "0.45-3" "${version}" ; then + yunohost service add $app +fi +if ynh_version_gt "0.54-2" "${version}" ; then + systemctl enable mongod + systemctl restart mongod +fi +if ynh_version_gt "0.54-3" "${version}" ; then + apt-key del EA312927 + wget https://www.mongodb.org/static/pgp/server-3.2.asc -o - | apt-key add - +fi +if ynh_version_gt "0.63-1" "${version}" ; then + ynh_install_nodejs 4.8.7 +fi #================================================= # STANDARD UPGRADE STEPS @@ -67,4 +82,5 @@ find "$final_path" -type d -print0 | xargs -0 chmod 750 #================================================= # RELOAD NGINX #================================================= +systemctl restart $app systemctl reload nginx