Skip to content

Commit

Permalink
Merge branch 'develop' for release v6.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
epoupon committed Jun 13, 2023
2 parents aa6ffc4 + 08fa2e4 commit 833a0a6
Show file tree
Hide file tree
Showing 53 changed files with 1,487 additions and 1,321 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --yes build-essential cmake libboost-all-dev libconfig++-dev libgtest-dev
sudo apt-get install --yes build-essential cmake libboost-all-dev libconfig++-dev libgtest-dev libarchive-dev
export WT_VERSION=4.9.1
export WT_INSTALL_PREFIX=/usr
git clone https://github.com/emweb/wt.git /tmp/wt
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ find_package(Filesystem REQUIRED)
find_package(Boost REQUIRED COMPONENTS system program_options)
find_package(Wt REQUIRED COMPONENTS Wt Dbo DboSqlite3 HTTP)
pkg_check_modules(Config++ REQUIRED IMPORTED_TARGET libconfig++)
pkg_check_modules(Archive REQUIRED IMPORTED_TARGET libarchive)

# WT
if (NOT Wt_FOUND)
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile-build-alpine
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx
FROM --platform=$BUILDPLATFORM alpine:3.17
FROM --platform=$BUILDPLATFORM alpine:3.18

ARG BUILD_PACKAGES="\
clang \
Expand All @@ -16,6 +16,7 @@ ARG FILESHELTER_BUILD_PACKAGES=" \
musl-dev \
boost-dev \
libconfig-dev \
libarchive-dev \
wt-dev \
gtest-dev"

Expand Down
1 change: 1 addition & 0 deletions Dockerfile-build-arch
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ARG BUILD_PACKAGES="\
cmake \
boost \
gtest \
libarchive \
libconfig \
make \
pkgconfig \
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile-release
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ARG BUILD_PACKAGES=" \
coreutils \
curl \
g++ \
libarchive-dev \
libconfig-dev \
make \
openssl-dev \
Expand Down Expand Up @@ -80,6 +81,7 @@ ARG RUNTIME_PACKAGES=" \
boost-program_options \
boost-system \
boost-thread \
libarchive \
libconfig++"

ARG FILESHELTER_USER=fileshelter
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ A [demo](https://fileshelter-demo.poupon.dev) instance is available, with the fo
- Terms Of Service support, fully or partially customizable
- Multiple language support
- Low memory requirements: the demo instance runs on a _Raspberry Pi Zero W_
- Command line tools to list and create shares

Once the expiry date is reached, the share is no longer available for download. The files are actually deleted roughly two hours after the share has expired. This is to make sure to not interrupt a download in progress.

## Command line tools
* `fileshelter-list`: list all the shares available for download
* `fileshelter-create`: create a share using local files. The files are _not_ copied in the _Fileshelter_'s working directory. Therefore the files must still exist while the share is avalaible for download. The files are _not_ deleted once the share has expired.
## Command line tool
`fileshelter-cmd` is a command line tool with the following features:
* list all the shares available for download.
* create a share using local files. The files are _not_ copied in the _Fileshelter_'s working directory. Therefore the files must still exist while the share is available for download. The files are _not_ deleted once the share has expired.
* destroy shares.

## Installation
See [INSTALL.md](INSTALL.md) file.
Expand Down
1 change: 1 addition & 0 deletions approot/messages.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@
<message id="msg-upload-in-progress">Upload in progress...</message>
<message id="msg-upload">Upload</message>
<message id="msg-validity-period">Validity period</message>
<message id="msg-validity-period-unit">Validity period unit</message>
</messages>
3 changes: 2 additions & 1 deletion approot/messages_fr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
<message id="msg-unlock">Dévérouiller</message>
<message id="msg-upload-in-progress">Envoi en cours...</message>
<message id="msg-upload">Envoyer</message>
<message id="msg-validity-period">Durée de validité</message>
<message id="msg-validity-period">Période de validité</message>
<message id="msg-validity-period-unit">Unité de la période de validité</message>
<message id="Wt.WDateValidator.DateTooEarly">La date doit être après {1}</message>
<message id="Wt.WDateValidator.DateTooLate">La date doit être avant {1}</message>
<message id="Wt.WDateValidator.WrongDateRange">La date doit être comprise entre {1} et {2}</message>
Expand Down
251 changes: 77 additions & 174 deletions approot/templates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,92 +3,59 @@
<!--FORMS message blocks-->

<message id="template-main">
${navbar-top}
${navbar-top class="navbar-light bg-light mb-2"}
<div class="container">
${contents}
</div>
</message>

<message id="Wt.WNavigationBar.template">
<div class="container">
${collapse-button}
<div class="navbar-header">
${expand-button}
${title-link}
</div>
${contents}
</div>
</message>

<message id="template-share-create-form">
<h1><i class="fa fa-upload"></i> ${tr:msg-share-create}</h1>
${file-drop class="fs-horizontal-center"}
<div class="panel panel-default">
<div class="panel-heading">${tr:msg-files} <span class="badge">${share-size}</span></div>
<div class="panel-body">
${files}
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading fs-collapsible-panel-header" data-toggle="collapse" data-target="#collapsiblePanel">${tr:msg-advanced-options}</div>
<div id="collapsiblePanel" class="panel-collapse collapse">
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-2" for="${id:desc}">
${tr:msg-description}
</label>
<div class="col-sm-5">
${desc}
</div>
<div class="help-block col-sm-5">
${desc-info}
</div>
</div>
${<if-validity-period>}
<div class="form-group">
<label class="control-label col-sm-2" for="${id:validity-period}">
${tr:msg-validity-period}
</label>
<div class="col-sm-5">
<div class="row">
<div class="col-sm-6">
${validity-period}
</div>
<div class="col-sm-6">
${validity-period-unit}
</div>
</div>
</div>
<div class="help-block col-sm-5">
${validity-period-info}
</div>
</div>
${</if-validity-period>}

<div class="form-group">
<label class="control-label col-sm-2" for="${id:password}">
${tr:msg-password}
</label>
<div class="col-sm-5">
${password}
</div>
<div class="help-block col-sm-5">
${password-info}
</div>
</div>
<div class="card mb-3">
<div class="card-header">${tr:msg-files} <span class="badge bg-secondary">${share-size}</span></div>
<div class="card-body">${files}</div>
</div>
<div class="collapse" id="advancedOptions">
<div class="card mb-3">
<div class="card-header">${tr:msg-advanced-options}</div>
<div class="card-body">
<div class="row g-3">
${<if-validity-period>}
<div class="col-md-6">
<label class="form-label" for="${id:validity-period}">${tr:msg-validity-period}</label>
${validity-period class="form-control"}
<div class="form-text">${validity-period-info}</div>
</div>
<div class="col-md-6">
<label class="form-label" for="${id:validity-period-unit}">${tr:msg-validity-period-unit}</label>
${validity-period-unit class="form-control"}
<div class="form-text">${validity-period-unit-info}</div>
</div>
${</if-validity-period>}
<div class="col-md-6">
<label class="form-label" for="${id:desc}">${tr:msg-description}</label>
${desc class="form-control"}
<div class="form-text">${desc-info}</div>
</div>
<div class="col-md-6">
<label class="form-label" for="${id:password}">${tr:msg-password}</label>
${password class="form-control"}
<div class="form-text">${password-info}</div>
</div>
</div>
</div>
</div>
</div>
${error}
<div class="form-group">
${create-btn class="btn-primary fs-horizontal-center"}
<div class="mb-3">
${create-btn class="btn btn-primary me-2"}
<button class="btn btn-secondary" type="button" data-bs-toggle="collapse" data-bs-target="#advancedOptions" aria-expanded="false" aria-controls="advancedOptions">${tr:msg-advanced-options}</button>
</div>
</message>

<message id="template-share-create-error">
<div class="alert alert-danger">
<div class="alert alert-danger" role="alert">
<i class="fa fa-warning" aria-hidden="true"></i> ${error}
</div>
</message>
Expand Down Expand Up @@ -137,27 +104,13 @@

<message id="template-share-created">
<h1><i class="fa fa-check"></i> ${tr:msg-share-create-success}</h1>
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-2" for="${id:public-link}">
<i class="fa fa-download"></i> ${tr:msg-download-link}
</label>
<div class="col-sm-10">
<div class="well well-sm">
${download-link}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="${id:edit-link}">
<i class="fa fa-edit"></i> ${tr:msg-edit-link}
</label>
<div class="col-sm-10">
<div class="well well-sm">
${edit-link}
</div>
</div>
</div>
<div class="row mb-3">
<label class="col-form-label col-sm-2"><i class="fa fa-download"></i> ${tr:msg-download-link}</label>
<div class="col-sm-10">${download-link class="form-control"}</div>
</div>
<div class="row mb-3">
<label class="col-form-label col-sm-2"><i class="fa fa-edit"></i> ${tr:msg-edit-link}</label>
<div class="col-sm-10">${edit-link class="form-control"}</div>
</div>
</message>

Expand Down Expand Up @@ -193,54 +146,26 @@
${error}
</div>
${</if-error>}
<div class="form-horizontal">
${<if-desc>}
<div class="form-group">
<label class="control-label col-sm-2">
${tr:msg-description}
</label>
<div class="col-sm-10">
<div class="well well-sm">
${file-desc}
</div>
</div>
</div>
${</if-desc>}
<div class="form-group">
<label class="control-label col-sm-2">
${tr:msg-share-size}
</label>
<div class="col-sm-10">
<div class="well well-sm">
${share-size}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">
${tr:msg-expires}
</label>
<div class="col-sm-10">
<div class="well well-sm">
${expiry-date-time}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">
${tr:msg-files}
</label>
<div class="col-sm-10">
<div class="well well-sm">
${files}
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-5">
${download-btn class="btn-primary"}
</div>
</div>
${<if-desc>}
<div class="row mb-3">
<label class="col-form-label col-sm-2">${tr:msg-description}</label>
<div class="col-sm-10">${file-desc class="form-control"}</div>
</div>
${</if-desc>}
<div class="row mb-3">
<label class="col-form-label col-sm-2">${tr:msg-share-size}</label>
<div class="col-sm-10">${share-size class="form-control"}</div>
</div>
<div class="row mb-3">
<label class="col-form-label col-sm-2">${tr:msg-expires}</label>
<div class="col-sm-10">${expiry-date-time class="form-control"}</div>
</div>
<div class="row mb-3">
<label class="col-form-label col-sm-2">${tr:msg-files}</label>
<div class="col-sm-10">${files class="form-control"}</div>
</div>
<div class="row mb-3">
<div class="col-sm-10 offset-sm-2">${download-btn class="btn btn-primary"}</div>
</div>
</message>

Expand All @@ -253,42 +178,20 @@

<message id="template-share-edit">
<h1><i class="fa fa-edit"></i> ${tr:msg-share-edit}</h1>
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-2">
${tr:msg-expires}
</label>
<div class="col-sm-5">
<div class="well well-sm">
${expiry-date-time}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">
${tr:msg-download-count}
</label>
<div class="col-sm-5">
<div class="well well-sm">
${download-count}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">
${tr:msg-download-link}
</label>
<div class="col-sm-5">
<div class="well well-sm">
${download-link}
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-5">
${delete-btn class="btn-danger"}
</div>
</div>
<div class="row mb-3">
<label class="col-form-label col-sm-2">${tr:msg-expires}</label>
<div class="col-sm-10">${expiry-date-time class="form-control"}</div>
</div>
<div class="row mb-3">
<label class="col-form-label col-sm-2">${tr:msg-download-count}</label>
<div class="col-sm-10">${download-count class="form-control"}</div>
</div>
<div class="row mb-3">
<label class="col-form-label col-sm-2"><i class="fa fa-download"></i> ${tr:msg-download-link}</label>
<div class="col-sm-10">${download-link class="form-control"}</div>
</div>
<div class="row mb-3">
<div class="col-sm-10 offset-sm-2">${delete-btn class="btn btn-danger"}</div>
</div>
</message>

Expand Down
4 changes: 0 additions & 4 deletions docroot/css/fileshelter.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,3 @@ summary {
min-width: 50px;
color: darkgrey;
}

.fs-collapsible-panel-header {
cursor: pointer;
}
Loading

0 comments on commit 833a0a6

Please sign in to comment.