Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,7 @@ _deps
*_CPack_Packages/
*.deb
out/

# Snapcraft output files
*.snap
squashfs-root/
4 changes: 4 additions & 0 deletions client-lite/src/util/do_persistence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ const std::string& GetConfigDirectory()

const std::string& GetSDKConfigFilePath()
{
#ifdef DO_BUILD_FOR_SNAP
static std::string configFilePath(DO_CONFIG_DIRECTORY_PATH "/configs/sdk-config.json");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather not have different paths like this. Instead, I think it is ok to allow write access to the entire /etc/deliveryoptimization-agent folder.

#else
static std::string configFilePath(DO_CONFIG_DIRECTORY_PATH "/sdk-config.json");
#endif
return configFilePath;
}

Expand Down
49 changes: 48 additions & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,41 @@ parts:
- libssh-4
- libwind0-heimdal

sdk:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think we should be including deb file within the snap. Since the recommendation is for DU to include the libDO.so in its own snap, let's keep this snapcraft file for the DO agent alone.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. This is for testing purposes only.

plugin: python
source: .
override-build: |
python3 ./build/build.py --project sdk --build-for-snap --package-for deb
mkdir -p ../install/bin
cp /tmp/build-deliveryoptimization-sdk/linux-debug/libdeliveryoptimization*.0.0_amd64.deb ../install/bin

after:
- installdeps

build-packages:
- file

stage-packages:
- libasn1-8-heimdal
- libboost-filesystem1.71.0
- libbrotli1
- libcurl4
- libgssapi3-heimdal
- libhcrypto4-heimdal
- libheimbase1-heimdal
- libheimntlm0-heimdal
- libhx509-5-heimdal
- libkrb5-26-heimdal
- libldap-2.4-2
- libnghttp2-14
- libproxy1v5
- libpsl5
- libroken18-heimdal
- librtmp1
- libsasl2-2
- libssh-4
- libwind0-heimdal

apps:
deliveryoptimization-client:
command: bin/deliveryoptimization-agent
Expand All @@ -80,7 +115,19 @@ slots:
content: port-number
read: [ $SNAP_DATA/var/run/deliveryoptimization-agent ]

# Share a folder containing sdk-config.json
config-file:
interface: content
content: config-file
write: [ $SNAP_DATA/etc/deliveryoptimization-agent/sdk-config.json ]
write: [ $SNAP_DATA/etc/deliveryoptimization-agent/configs ]

plugs:
client-downloads-folder:
interface: content
content: client-downloads-folder
target: $SNAP_DATA/deliveryoptimization-snap-downloads-root

layout:
# adu_data_dir
/var/lib/deliveryoptimization-snap-downloads-root:
symlink: $SNAP_DATA/deliveryoptimization-snap-downloads-root