1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/vaultwarden_ynh.git synced 2024-09-03 18:26:31 +02:00

Merge pull request #60 from YunoHost-Apps/testing

Testing
This commit is contained in:
yalh76 2020-04-09 17:09:46 +02:00 committed by GitHub
commit c73642b672
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 47 additions and 21 deletions

View file

@ -9,12 +9,11 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to
## Overview ## Overview
Open source password management solutions. Open source password management solutions.
**Shipped version:** 1.13.1 **Shipped version:** 1.14.1
## Important points to read before installing ## Important points to read before installing
1. **Bitwarden** require a dedicated **root domain**, eg. bitwarden.domain.tld 1. At the end of the installation, the admin user will receive a mail with the admin_token used to access https://your.domain.tld/bitwarden/admin.
1. At the end of the installation, the admin user will receive a mail with the admin_token used to access https://bitwarden.domain.tld/admin.
## Screenshots ## Screenshots

View file

@ -6,6 +6,7 @@
;; Test complet ;; Test complet
; Manifest ; Manifest
domain="domain.tld" (DOMAIN) domain="domain.tld" (DOMAIN)
path="/path" (PATH)
admin="john" (USER) admin="john" (USER)
is_public=1 (PUBLIC|public=1|private=0) is_public=1 (PUBLIC|public=1|private=0)
; Checks ; Checks
@ -22,7 +23,7 @@
# This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version. # This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version.
# incorrect_path=1 # incorrect_path=1
port_already_use=0 port_already_use=0
change_url=0 change_url=1
;;; Levels ;;; Levels
# If the level 5 (Package linter) is forced to 1. Please add justifications here. # If the level 5 (Package linter) is forced to 1. Please add justifications here.
Level 5=auto Level 5=auto

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/dani-garcia/bitwarden_rs/archive/1.13.1.tar.gz SOURCE_URL=https://github.com/dani-garcia/bitwarden_rs/archive/1.14.1.tar.gz
SOURCE_SUM=f032749606745ab1fd78cc0429fff3e9711522a94098f57d0134fa0f8dbfc07814d5b2a71e53028f8f911fd9c233fdedb8f68822096229a00cef189b41b6e717 SOURCE_SUM=223469e4c276d21e8d85cc24df2b71896580c516201ec5a238676c8cdfa19ed0b18c6475fdaedc8117265002f38aee81b93d39fd5b77e27dc5e467126e5304a1
SOURCE_SUM_PRG=sha512sum SOURCE_SUM_PRG=sha512sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

View file

@ -138,7 +138,7 @@ ADMIN_TOKEN=__ADMIN_TOKEN__
## It's recommended to configure this value, otherwise certain functionality might not work, ## It's recommended to configure this value, otherwise certain functionality might not work,
## like attachment downloads, email links and U2F. ## like attachment downloads, email links and U2F.
## For U2F to work, the server must use HTTPS, you can use Let's Encrypt for free certs ## For U2F to work, the server must use HTTPS, you can use Let's Encrypt for free certs
DOMAIN=https://__DOMAIN__ DOMAIN=https://__DOMAIN____PATH_URL__
## Yubico (Yubikey) Settings ## Yubico (Yubikey) Settings
## Set your Client ID and Secret Key for Yubikey OTP ## Set your Client ID and Secret Key for Yubikey OTP
@ -176,6 +176,7 @@ DOMAIN=https://__DOMAIN__
ROCKET_ADDRESS=127.0.0.1 ROCKET_ADDRESS=127.0.0.1
ROCKET_PORT=__ROCKET_PORT__ ROCKET_PORT=__ROCKET_PORT__
# ROCKET_TLS={certs="/path/to/certs.pem",key="/path/to/key.pem"} # ROCKET_TLS={certs="/path/to/certs.pem",key="/path/to/key.pem"}
# Workaround for YunoHost CI
ROCKET_WORKERS=1 ROCKET_WORKERS=1
## Mail specific settings, set SMTP_HOST and SMTP_FROM to enable the mail service. ## Mail specific settings, set SMTP_HOST and SMTP_FROM to enable the mail service.

View file

@ -19,7 +19,7 @@ location __PATH__/ {
include conf.d/yunohost_panel.conf.inc; include conf.d/yunohost_panel.conf.inc;
} }
location /notifications/hub { location __FINALPATH__/notifications/hub {
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@ -28,6 +28,6 @@ location /notifications/hub {
proxy_pass http://127.0.0.1:__WEBSOCKET_PORT__; proxy_pass http://127.0.0.1:__WEBSOCKET_PORT__;
} }
location /notifications/hub/negotiate { location __FINALPATH__/notifications/hub/negotiate {
proxy_pass http://127.0.0.1:__ROCKET_PORT__; proxy_pass http://127.0.0.1:__ROCKET_PORT__;
} }

View file

@ -1,6 +1,6 @@
SOURCE_URL=https://github.com/dani-garcia/bw_web_builds/releases/download/v2.12.0b/bw_web_v2.12.0b.tar.gz SOURCE_URL=https://github.com/dani-garcia/bw_web_builds/releases/download/v2.13.2/bw_web_v2.13.2.tar.gz
SOURCE_SUM=e511e061f9a064048f42a7d5b7a4b13a593bf2e1ff3fd72f4570a6aa18f45c06 SOURCE_SUM=2cdfbb91a9c084bb606cdaf17480b8eb25ced4ede768f127695c68c73af90bb874032173574d6a835098d04151d9ce41115a7e089e5fc6decdad3a1f7753d642
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha512sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=false SOURCE_IN_SUBDIR=true
SOURCE_FILENAME= SOURCE_FILENAME=

View file

@ -6,7 +6,7 @@
"en": "Manage passwords and other sensitive informations", "en": "Manage passwords and other sensitive informations",
"fr": "Géres les mots de passe et autres informations sensibles" "fr": "Géres les mots de passe et autres informations sensibles"
}, },
"version": "1.13.1~ynh1", "version": "1.14.1~ynh1",
"url": "https://github.com/dani-garcia/bitwarden_rs", "url": "https://github.com/dani-garcia/bitwarden_rs",
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",
"maintainer": { "maintainer": {
@ -30,6 +30,16 @@
}, },
"example": "example.com" "example": "example.com"
}, },
{
"name": "path",
"type": "path",
"ask": {
"en": "Choose a path for Bitwarden",
"fr": "Choisissez un chemin pour Bitwarden"
},
"example": "/bitwarden",
"default": "/bitwarden"
},
{ {
"name": "admin", "name": "admin",
"type": "user", "type": "user",

View file

@ -12,6 +12,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# RETRIEVE ARGUMENTS # RETRIEVE ARGUMENTS
#================================================= #=================================================
ynh_print_info --message="Retrieve arguments from the manifest"
old_domain=$YNH_APP_OLD_DOMAIN old_domain=$YNH_APP_OLD_DOMAIN
old_path=$YNH_APP_OLD_PATH old_path=$YNH_APP_OLD_PATH
@ -33,6 +34,8 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#db_name=$(ynh_app_setting_get --app=$app --key=db_name) #db_name=$(ynh_app_setting_get --app=$app --key=db_name)
#db_user=$db_name #db_user=$db_name
#db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) #db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
rocket_port=$(ynh_app_setting_get --app=$app --key=rocket_port)
websocket_port=$(ynh_app_setting_get --app=$app --key=websocket_port)
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
@ -92,7 +95,7 @@ then
domain="$old_domain" domain="$old_domain"
path_url="$new_path" path_url="$new_path"
# Create a dedicated nginx config # Create a dedicated nginx config
ynh_add_nginx_config ynh_add_nginx_config "websocket_port rocket_port"
fi fi
# Change the domain for nginx # Change the domain for nginx
@ -108,8 +111,18 @@ fi
#================================================= #=================================================
# SPECIFIC MODIFICATIONS # SPECIFIC MODIFICATIONS
#================================================= #=================================================
# ... # MODIFY A CONFIG FILE
#================================================= #=================================================
ynh_print_info --message="Modifying a config file..."
config="$final_path/live/bitwarden_rs.env"
ynh_backup_if_checksum_is_different --file="$config"
ynh_replace_string --match_string="DOMAIN=https://$old_domain$old_path" --replace_string="DOMAIN=https://$new_domain$new_path" --target_file="$config"
# Recalculate and store the checksum of the file for the next upgrade.
ynh_store_file_checksum --file="$config"
#================================================= #=================================================
# GENERIC FINALISATION # GENERIC FINALISATION

View file

@ -27,7 +27,7 @@ ynh_abort_if_errors
ynh_print_info --message="Retrieving arguments from the manifest..." ynh_print_info --message="Retrieving arguments from the manifest..."
domain=$YNH_APP_ARG_DOMAIN domain=$YNH_APP_ARG_DOMAIN
path_url="/" path_url=$YNH_APP_ARG_PATH
admin=$YNH_APP_ARG_ADMIN admin=$YNH_APP_ARG_ADMIN
is_public=$YNH_APP_ARG_IS_PUBLIC is_public=$YNH_APP_ARG_IS_PUBLIC
@ -88,10 +88,10 @@ ynh_print_info --message="Setting up source files..."
ynh_app_setting_set --app=$app --key=final_path --value=$final_path ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress the source of bitwarden_rs from app.src to his build directory # Download, check integrity, uncompress the source of bitwarden_rs from app.src to his build directory
ynh_setup_source --dest_dir="$final_path/build/" --source_id=app ynh_setup_source --dest_dir="$final_path/build/" --source_id="app"
# Download, check integrity, uncompress and patch the source from web.src # Download, check integrity, uncompress and patch the source from web.src
ynh_setup_source --dest_dir="$final_path/live/web-vault/" --source_id=web ynh_setup_source --dest_dir="$final_path/live/web-vault/" --source_id="web"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
@ -158,6 +158,7 @@ cp -f ../conf/bitwarden_rs.env "$config"
ynh_replace_string --match_string="__ADMIN_TOKEN__" --replace_string="$admin_token" --target_file="$config" ynh_replace_string --match_string="__ADMIN_TOKEN__" --replace_string="$admin_token" --target_file="$config"
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$config" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$config"
ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="$config"
ynh_replace_string --match_string="__WEBSOCKET_PORT__" --replace_string="$websocket_port" --target_file="$config" ynh_replace_string --match_string="__WEBSOCKET_PORT__" --replace_string="$websocket_port" --target_file="$config"
ynh_replace_string --match_string="__ROCKET_PORT__" --replace_string="$rocket_port" --target_file="$config" ynh_replace_string --match_string="__ROCKET_PORT__" --replace_string="$rocket_port" --target_file="$config"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$config" ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$config"

View file

@ -86,10 +86,10 @@ then
ynh_print_info --message="Upgrading source files..." ynh_print_info --message="Upgrading source files..."
# Download, check integrity, uncompress the source of bitwarden_rs from app.src to his build directory # Download, check integrity, uncompress the source of bitwarden_rs from app.src to his build directory
ynh_setup_source --dest_dir="$final_path/build/" --source_id=app ynh_setup_source --dest_dir="$final_path/build/" --source_id="app"
# Download, check integrity, uncompress and patch the source from web.src # Download, check integrity, uncompress and patch the source from web.src
ynh_setup_source --dest_dir="$final_path/live/web-vault/" --source_id=web ynh_setup_source --dest_dir="$final_path/live/web-vault/" --source_id="web"
fi fi
#================================================= #=================================================
@ -161,6 +161,7 @@ cp -f ../conf/bitwarden_rs.env "$config"
ynh_replace_string --match_string="__ADMIN_TOKEN__" --replace_string="$admin_token" --target_file="$config" ynh_replace_string --match_string="__ADMIN_TOKEN__" --replace_string="$admin_token" --target_file="$config"
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$config" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$config"
ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="$config"
ynh_replace_string --match_string="__WEBSOCKET_PORT__" --replace_string="$websocket_port" --target_file="$config" ynh_replace_string --match_string="__WEBSOCKET_PORT__" --replace_string="$websocket_port" --target_file="$config"
ynh_replace_string --match_string="__ROCKET_PORT__" --replace_string="$rocket_port" --target_file="$config" ynh_replace_string --match_string="__ROCKET_PORT__" --replace_string="$rocket_port" --target_file="$config"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$config" ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$config"