diff --git a/conf/nginx.conf b/conf/nginx.conf index 0345df9..7aebb6c 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,7 +1,7 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { - proxy_pass http://127.0.0.1:__PORT__; + proxy_pass http://127.0.0.1:__PORT__/; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; diff --git a/conf/systemd.service b/conf/systemd.service index 2df65bb..1141906 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -8,7 +8,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ -ExecStart=__INSTALL_DIR__/shiori serve --port __PORT__ --webroot __PATH__ +ExecStart=__INSTALL_DIR__/shiori server --port __PORT__ --webroot __PATH__ Restart=always Environment="SHIORI_DIR=__DATA_DIR__" diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md index 3c719a4..0ac921d 100644 --- a/doc/POST_INSTALL.md +++ b/doc/POST_INSTALL.md @@ -1 +1 @@ -The default account is `shiori` with password `gopher`. It is removed once another 'owner' account is created. +The default account is `shiori` with password `gopher`. Please manually remove it after you create your own account. diff --git a/doc/POST_INSTALL_fr.md b/doc/POST_INSTALL_fr.md index 3d29ddd..2eb087c 100644 --- a/doc/POST_INSTALL_fr.md +++ b/doc/POST_INSTALL_fr.md @@ -1 +1 @@ -Le compte par défaut est `shiori` avec le mot de passe `gopher`. Il est supprimé une fois qu'un autre compte « propriétaire » est créé. +Le compte par défaut est `shiori` avec le mot de passe `gopher`. Veuillez le supprimer manuellement après avoir créé votre propre compte. diff --git a/manifest.toml b/manifest.toml index a7a6433..76994bf 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Shiori" description.en = "Simple bookmark manager" description.fr = "Gestionnaire de liens simple" -version = "1.5.5~ynh4" +version = "1.6.0~ynh1" maintainers = [] @@ -45,12 +45,12 @@ ram.runtime = "50M" [resources.sources] [resources.sources.main] - amd64.url = "https://github.com/go-shiori/shiori/releases/download/v1.5.5-rc.2/shiori_Linux_x86_64.tar.gz" - amd64.sha256 = "928adfc3d927b718c7bd75396bbb3a34cb542676374b6c89bb3da92063ac099c" - arm64.url = "https://github.com/go-shiori/shiori/releases/download/v1.5.5-rc.2/shiori_Linux_aarch64.tar.gz" - arm64.sha256 = "98fc7c8114264b338838089a6ab7c4ce326224fac4f498b6ecc4bfab2d3d3c78" - armhf.url = "https://github.com/go-shiori/shiori/releases/download/v1.5.5-rc.2/shiori_Linux_arm.tar.gz" - armhf.sha256 = "3ac24d434ff7a76bb3a8810e6c23caf28a7040c67756fec99a2483f04a197f77" + amd64.url = "https://github.com/go-shiori/shiori/releases/download/v1.6.0/shiori_Linux_x86_64.tar.gz" + amd64.sha256 = "3bcc7557db94d8d6d8f8940f9e37412f198c30f520642e817f4b38a6fee1822e" + arm64.url = "https://github.com/go-shiori/shiori/releases/download/v1.6.0/shiori_Linux_aarch64.tar.gz" + arm64.sha256 = "74add39dc22bd59dcfe467571688cac29dcc85da90d4b7e4ce668182d9081d34" + armhf.url = "https://github.com/go-shiori/shiori/releases/download/v1.6.0/shiori_Linux_arm.tar.gz" + armhf.sha256 = "55e8ae7136d39b7f09401b87c6e297695dc6efe1bb2b55c119ecaf540fdf4a19" in_subdir = false autoupdate.strategy = "latest_github_release" autoupdate.asset.amd64 = "^shiori_Linux_x86_64.tar.gz$" diff --git a/scripts/backup b/scripts/backup index 737146f..c8931d8 100755 --- a/scripts/backup +++ b/scripts/backup @@ -21,6 +21,12 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$install_dir" +#================================================= +# BACKUP THE APP DATA DIR +#================================================= + +ynh_backup --src_path="$data_dir" --is_big + #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 9f1d860..145a290 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -40,6 +40,39 @@ chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" chmod +x "$install_dir/shiori" +#================================================= +# MIGRATE AND UPGRADE +#================================================= + +if [ "$upgrade_type" == "UPGRADE_APP" ] +then + if ynh_compare_current_package_version --comparison lt --version 1.50~ynh9 + then + ynh_script_progression --message="Migrating sqlite from version < 1.50~ynh9..." --weight=1 + FTS4_EXISTS=$(sqlite3 "$data_dir/shiori.db" "SELECT sql FROM sqlite_master WHERE type = 'table' AND name = 'bookmark_content' AND sql LIKE '%USING fts4%';") + if [ -z "$FTS4_EXISTS" ] + then + echo "No FTS4 table found or already migrated" + else + sqlite3 "$data_dir/shiori.db" "BEGIN TRANSACTION; CREATE VIRTUAL TABLE bookmark_content_fts5 USING fts5(title, content, html, docid); INSERT INTO bookmark_content_fts5 (title, content, html, docid) SELECT title, content, html, docid FROM bookmark_content; DROP TABLE bookmark_content; ALTER TABLE bookmark_content_fts5 RENAME TO bookmark_content; COMMIT;" + fi + + SCHEMA_MIGRATIONS_EXISTS=$(sqlite3 "$data_dir/shiori.db" "SELECT name FROM sqlite_master WHERE type='table' AND name='schema_migrations';") + if [ -z "$SCHEMA_MIGRATIONS_EXISTS" ]; then + echo "No schema_migrations table found, skipping" + else + DIRTY=$(sqlite3 "$data_dir/shiori.db" "SELECT dirty FROM schema_migrations WHERE dirty = 1;") + if [ -z "$DIRTY" ]; then + echo "No dirty migrations found, skipping" + else + VERSION=$(sqlite3 "$data_dir/shiori.db" "SELECT version FROM schema_migrations WHERE dirty = 1;") + NEW_VERSION=$((VERSION - 1)) + sqlite3 "$data_dir/shiori.db" "UPDATE schema_migrations SET version = $NEW_VERSION, dirty = 0 WHERE dirty = 1;" + fi + fi + fi +fi + #================================================= # REAPPLY SYSTEM CONFIGURATIONS #=================================================