Re: Snap sources

2016-10-10 Thread Spencer
One advantage of snaps, I believe, is that the dependencies are baked into 
them.  Otherwise, your app can stop working after installation if a dependency 
is updated or otherwise changed.  I'm not sure what other advantages there may 
be.  One downside is extra memory cost, but with storage up to a terabyte being 
typical, I don't think it matters too much.

Though I have an Intel machine, my snaps always say "amd64", which I think is 
confusing.

Supposedly, you can write snaps for the Ubuntu phone.  (I have an iPhone, so 
I'm not sure what that's about.). And there is something called the Ubuntu 
touch?  Is that like the iPad?  I think some Ubuntu specific features have been 
added to Qt as well to help promote development on Ubuntu.  I'm a big fan of 
wxWidgets, personally.

And then everything runs in a quarantined environment.  If you're going to open 
the flood gates on people writing and consuming programs, security becomes a 
necessary evil.

I haven't explored the plugs and slots yet.

> On Oct 10, 2016, at 7:09 PM, Manik Taneja  wrote:
> 
> 
> 
>> On Mon, Oct 10, 2016 at 5:41 PM, Chris  wrote:
>> On Mon, 2016-10-10 at 16:06 -0700, Manik Taneja wrote:
>> >
>> >
>> >
>> > On Mon, Oct 10, 2016 at 2:45 PM, Chris 
>> > wrote:
>> > > Other than those shown here - https://uappexplorer.com/apps?type=sn
>> > > appy
>> > > =title are there other places to get Snaps from?
>> > uappexplorer is just a web frontend to the Ubuntu Store
>> > infrastructure, which is our
>> > repository of snaps. There are no other publicly available snap repos
>> > that we are 
>> > aware of. Are you just looking to find out the exhaustive list of
>> > snaps available for
>> > consumption? or you are trying to solve something else?
>> >
>> > Cheers,
>> > Manik
>> >
>> Thanks Manik, I was looking for the available snaps. I'm using a few so
>> far and I really like the way they work and the ease of installation.
> That's great. Welcome to the club!
> 
> /Manik 
> -- 
> Snapcraft mailing list
> Snapcraft@lists.snapcraft.io
> Modify settings or unsubscribe at: 
> https://lists.ubuntu.com/mailman/listinfo/snapcraft
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Snap sources

2016-10-10 Thread Manik Taneja
On Mon, Oct 10, 2016 at 5:41 PM, Chris  wrote:

> On Mon, 2016-10-10 at 16:06 -0700, Manik Taneja wrote:
> >
> >
> >
> > On Mon, Oct 10, 2016 at 2:45 PM, Chris 
> > wrote:
> > > Other than those shown here - https://uappexplorer.com/apps?type=sn
> > > appy
> > > =title are there other places to get Snaps from?
> > uappexplorer is just a web frontend to the Ubuntu Store
> > infrastructure, which is our
> > repository of snaps. There are no other publicly available snap repos
> > that we are
> > aware of. Are you just looking to find out the exhaustive list of
> > snaps available for
> > consumption? or you are trying to solve something else?
> >
> > Cheers,
> > Manik
> >
> Thanks Manik, I was looking for the available snaps. I'm using a few so
> far and I really like the way they work and the ease of installation.
>
> That's great. Welcome to the club!

/Manik
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Snap sources

2016-10-10 Thread Chris
On Mon, 2016-10-10 at 16:06 -0700, Manik Taneja wrote:
> 
> 
> 
> On Mon, Oct 10, 2016 at 2:45 PM, Chris 
> wrote:
> > Other than those shown here - https://uappexplorer.com/apps?type=sn
> > appy
> > =title are there other places to get Snaps from?
> uappexplorer is just a web frontend to the Ubuntu Store
> infrastructure, which is our
> repository of snaps. There are no other publicly available snap repos
> that we are 
> aware of. Are you just looking to find out the exhaustive list of
> snaps available for
> consumption? or you are trying to solve something else?
> 
> Cheers,
> Manik
> 
Thanks Manik, I was looking for the available snaps. I'm using a few so
far and I really like the way they work and the ease of installation.

Chris

-- 
Chris
KeyID 0xE372A7DA98E6705C
31.11972; -97.90167 (Elev. 1092 ft)
19:36:46 up 1:46, 1 user, load average: 0.47, 0.43, 0.35
Ubuntu 16.04.1 LTS, kernel 4.4.0-42-generic #62-Ubuntu SMP Fri Oct 7 23:11:45 
UTC 2016


-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Different values of environment variables during build time and run time, eg. JAVA_HOME and PATH

2016-10-10 Thread Jian LUO
Hi,

I don't think it counts as cross compiling since Java (at least in my case)
is cross platform. Just wanted to compile Java with one JDK and run with
another.

Jian

On Oct 10, 2016 20:05, "Manik Taneja"  wrote:

>
>
> On Mon, Oct 10, 2016 at 6:33 AM, Jian LUO  wrote:
>
>> Hi List,
>>
>> Is there any formal way in snapcraft  to set environment variables
>> separately for build time and run time? The use case I'm facing is building
>> a Java snap on amd64 host for armhf target.
>>
> Snapcraft does not support cross-compilation. Consider building natively
> on armhf, or using this as reference-
>
> https://github.com/snapcore/snapd/blob/master/docs/cross-build.md
>
> and let us know if you see any issues.
>
> /Manik
>
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Ports,ports,ports..

2016-10-10 Thread Kyle Fazzari
On Oct 10, 2016 10:25, "Leo Arias"  wrote:
>
> On Mon, Oct 10, 2016 at 11:19 AM, Robert Park 
wrote:
>>
>> Any suggestions on how best to do that? Snaps don't offer any sort of
configuration interface like charms do.
>
>
> I suppose that will be documented soon:
https://trello.com/c/PpM4XRUQ/30-configuration-support

Does this help? https://github.com/snapcore/snapd/blob/master/docs/hooks.md

>
> --
> ¡paz y baile!
> http://www.ubuntu.com
>
> --
> Snapcraft mailing list
> Snapcraft@lists.snapcraft.io
> Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/snapcraft
>
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Different values of environment variables during build time and run time, eg. JAVA_HOME and PATH

2016-10-10 Thread Manik Taneja
On Mon, Oct 10, 2016 at 6:33 AM, Jian LUO  wrote:

> Hi List,
>
> Is there any formal way in snapcraft  to set environment variables
> separately for build time and run time? The use case I'm facing is building
> a Java snap on amd64 host for armhf target.
>
Snapcraft does not support cross-compilation. Consider building natively on
armhf, or using this as reference-

https://github.com/snapcore/snapd/blob/master/docs/cross-build.md

and let us know if you see any issues.

/Manik
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Ports,ports,ports..

2016-10-10 Thread Victor Palau
Hi Robert

Depends on the snap but adding an cli to configure it and then restart the
service could be an option (see local-proxy as an example)

On 10 Oct 2016 18:19, "Robert Park"  wrote:

On Oct 10, 2016 10:05 AM, "Victor Palau"  wrote:
>
> Overall, seems like it would be good practice that if a snap publishes a
service to a port, that:
> the port can be easily changed

Any suggestions on how best to do that? Snaps don't offer any sort of
configuration interface like charms do.
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Ports,ports,ports..

2016-10-10 Thread Leo Arias
On Mon, Oct 10, 2016 at 11:19 AM, Robert Park 
wrote:

> Any suggestions on how best to do that? Snaps don't offer any sort of
> configuration interface like charms do.
>

I suppose that will be documented soon:
https://trello.com/c/PpM4XRUQ/30-configuration-support

-- 
¡paz y baile!
http://www.ubuntu.com
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Ports,ports,ports..

2016-10-10 Thread Robert Park
On Oct 10, 2016 10:05 AM, "Victor Palau"  wrote:
>
> Overall, seems like it would be good practice that if a snap publishes a
service to a port, that:
> the port can be easily changed

Any suggestions on how best to do that? Snaps don't offer any sort of
configuration interface like charms do.
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Ports,ports,ports..

2016-10-10 Thread Victor Palau
+1

On Mon, Oct 10, 2016 at 6:11 PM, Leo Arias  wrote:

> Nice!
>
> On Mon, Oct 10, 2016 at 11:03 AM, Victor Palau  > wrote:
>
>> Overall, seems like it would be good practice that if a snap publishes a
>> service to a port, that:
>>
>>- the port can be easily changed
>>- the snap can be updated told that it will be proxy-ed, and work well
>>
>> I would add this one: To easily print which port is being used
> https://bugs.launchpad.net/snappy/+bug/1608572.
> Ideally for me, when the service is installed it should print the URL to
> access it.
>
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Ports,ports,ports..

2016-10-10 Thread Victor Palau
Hi,

As more snaps are published, the more I want to install on my PC,
device,... Many of them expose some cool services in
localhost:[randomport], and I find it that it is getting hard to remember
them all.

Building on an existing tinyproxy snap, I have published (amd64 only at the
mo) a local reverse-proxy snap called: local-proxy

sudo snap install local-proxy

This allows you to map a path to your app: http://localhost/yourapp/ -->
http://localhost:[highport]

It comes with a default fwd for snapweb from /snapweb/ to localhost:4200
It also comes with some utility commands like add,delete and print.

The local-proxy defaults to 8080, but you can change it by running:
local-proxy.port [your port]

and then restarting the service:
sudo systemctl restart snap.local-proxy.tinyproxy

However, there is still a problem that some of snaps assume that they can
take control of a popular port (such as 80) without facilities to change
it.
Also some do not take kindly to be proxy-ed (like snapweb) - although
tinyproxy has a great "magic cookie" feature that I have enabled by default
to work around this.

Overall, seems like it would be good practice that if a snap publishes a
service to a port, that:

   - the port can be easily changed
   - the snap can be updated told that it will be proxy-ed, and work well

A local reverse proxy feels like this is just a quick fix to a bigger
problem... any long term fix suggestions?

Thanks

Victor
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Has anybody ever snapped gunicorn?

2016-10-10 Thread Leo Arias
Hello,

On Mon, Oct 10, 2016 at 10:51 AM, Robert Park 
wrote:

> Well so far the only interfaces i need were network and network-bind. Is
> there even a snap interface that provides dac_override and chown? I
> couldn't find any in a quick google.
>

This is for chown: https://bugs.launchpad.net/snappy/+bug/1619888
Please leave your comment there about your use case.

For dac_override, I found this:
https://github.com/snapcore/snapd/blob/98c8e937625ce3134cf17025d8f0eb3e1016259a/interfaces/builtin/log_observe.go#L46
However, the comment in there makes me think you need a separate interface
not yet implemented. If that's the case, the process is to file a bug that
the security team will add to their backlog, or implement the interface
yourself.

pura vida
-- 
¡paz y baile!
http://www.ubuntu.com
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Has anybody ever snapped gunicorn?

2016-10-10 Thread Robert Park
Hi Alfonso, thanks for the response

On Oct 9, 2016 11:59 PM, "Alfonso Sanchez-Beato" <
alfonso.sanchez-be...@canonical.com> wrote:
> On Mon, Oct 10, 2016 at 1:56 AM, Robert Park 
wrote:
>>
>> Right, so that was a $PYTHONPATH issue indeed which I've fixed by
>> setting this in a wrapper script:
>>
>> export PYTHONPATH="$SNAP/usr/lib/python3/dist-packages:$SNAP/src"
>>
>>
>> But still gunicorn is not working. When I run it, I get this error:
>>
>> $ sudo quantifiedself.server
>> [2016-10-09 16:30:13 -0700] [4365] [INFO] Starting gunicorn 19.4.5
>> [2016-10-09 16:30:13 -0700] [4365] [INFO] Listening at:
>> http://0.0.0.0:8080 (4365)
>> [2016-10-09 16:30:13 -0700] [4365] [INFO] Using worker: sync
>> fish: “sudo quantifiedself.server” terminated by signal SIGSYS (Bad
system call)
>>
>>
>> All I can find in kern.log is this, but it doesn't mean much to me:
>>
>> 236:Oct  9 16:30:02 rouge kernel: [1793707.594342] audit: type=1400
>> audit(1476055802.615:377): apparmor="DENIED" operation="capable"
>> profile="snap.quantifiedself.server" pid=4236 comm="gunicorn3"
>> capability=1  capname="dac_override"
>> 237:Oct  9 16:30:13 rouge kernel: [1793718.438376] audit: type=1326
>> audit(1476055813.459:378): auid=1000 uid=0 gid=0 ses=1 pid=4365
>> comm="gunicorn3" exe="/usr/bin/python3.5" sig=31 arch=c03e
>> syscall=92 compat=0 ip=0x7f861dff2a47 code=0x0
>>
>>
>> Anybody have any ideas how to troubleshoot this?
>
>
> The first trace is for apparmor, you need to have
>
> capability dac_override,
>
> in the apparmor snippet of one of the interfaces you are using.
>
> The second one seems to be from seccomp when calling syscall 92, which
happens to be chown. You would need to have that call in the seccomp
snippet of one interface you are using.
>
> Not sure if you miss some interface/connection or if these need to be
added to one interface you are using.

Well so far the only interfaces i need were network and network-bind. Is
there even a snap interface that provides dac_override and chown? I
couldn't find any in a quick google.

Or am i better off digging into gunicorn and figuring out why it's trying
to chown and patching it to not do that?
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Different values of environment variables during build time and run time, eg. JAVA_HOME and PATH

2016-10-10 Thread Jian LUO
Hi List,

Is there any formal way in snapcraft  to set environment variables
separately for build time and run time? The use case I'm facing is building
a Java snap on amd64 host for armhf target.

Thanks!

Jian
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Question on where snaps are stored

2016-10-10 Thread Didier Roche
Le 10/10/2016 à 03:20, Chris a écrit :
> On Mon, 2016-10-10 at 10:59 +1000, Jacob Zimmermann wrote:
>> The snap packages themselves are simply copied into
>> /var/lib/snapd/snaps
>> and then mounted into /snap (via /dev/loop).
>>
>> The folders under ~/snap are for configuration files and per-package
>> home directories (for those packages that don't have a home plug and
>> therefore don't access your real home directory). If a given user
>> never
>> launched a certain snapped app, that user wouldn't have the
>> corresponding subdir under ~/snap.
>>
>> Or at least I believe that's how it works, please someone correct me
>> if
>> I'm wrong.
>>
> For instance I just reinstalled this snap - https://uappexplorer.com/ap
> p/hello-snap.muhammad and you're correct, the folder in ~/snap is not
> present until I run 'hello-world'. You're absolutely correct Jacob.

You are right Jacob, this is the intended behavior (only create the data
dir for a particular user for a version of a snap only the first time
this snap application/service is started)

Cheers,
Didier
>
>> On 10/10/16 10:43, Chris wrote:
>>> Firstly I'm just a user of snaps, not a developer however I like
>>> the
>>> way everything is packaged together and their ease of installation,
>>> updating and, if necessary removal. My question is in my ~/snap
>>> folder
>>> certain of the snaps I've installed have subfolders, however some
>>> don't. I was under the impression that all installed snaps are put
>>> there. For example:
>>>
>>> /dev/loop1   97M   97M 0 100% /snap/wallpaperdownloader/4
>>> drwxrwxr-x 3 chris chris 4096 Oct  8 11:36 wallpaperdownloader
>>> /dev/loop2   11M   11M 0 100% /snap/speed-test/2
>>> drwxr-xr-x 4 chris chris 4096 Oct  9 17:32 speed-test
>>> /dev/loop3   62M   62M 0 100% /snap/pencilsheep/5
>>> drwxr-xr-x 4 chris chris 4096 Oct  6 19:09 pencilsheep
>>> /dev/loop4  640K  640K 0 100% /snap/hello-snap/1
>>> (There is no folder for this under ~/snap)
>>> /dev/loop5  107M  107M 0 100% /snap/blender-tpaw/2
>>> drwxr-xr-x 4 chris chris 4096 Oct  6 20:12 blender-tpaw
>>>
>>> I've noticed other snaps I install do the same. They show up in the
>>> /dev/loop* however not as a folder in my ~/snap. Am I missing
>>> something
>>> on how they install?
>>>
>>> Chris
>>>


-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft