aboutsummaryrefslogtreecommitdiff
path: root/snap/snapcraft.yaml
blob: 09f7d2935c8438e70de550adfda22143d7f0764d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
name: onionshare
base: core22
version: "2.6.1.dev1"
summary: Securely and anonymously share files, host websites, and chat using Tor
description: |
  OnionShare lets you securely and anonymously send and receive files. It works by starting
  a web server, making it accessible as a Tor onion service, and generating an unguessable
  web address so others can download files from you, or upload files to you. It does _not_
  require setting up a separate server or using a third party file-sharing service.

grade: stable # stable or devel
confinement: strict

architectures:
  - build-on: i386
  - build-on: amd64
  - build-on: arm64
  - build-on: armhf

apps:
  onionshare:
    common-id: org.onionshare.OnionShare
    command: bin/onionshare
    plugs:
      - desktop
      - home
      - network
      - network-bind
      - removable-media
    environment:
      LANG: C.UTF-8
      PATH: $SNAP/bin:$SNAP/usr/bin:$SNAP/usr/local/bin:$PATH
      LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/local/lib

  cli:
    common-id: org.onionshare.OnionShareCli
    command: bin/onionshare-cli
    plugs:
      - home
      - network
      - network-bind
      - removable-media
    environment:
      LANG: C.UTF-8
      PATH: $SNAP/bin:$SNAP/usr/bin:$SNAP/usr/local/bin:$PATH
      LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/local/lib

parts:
  onionshare-cli:
    source: ./cli
    plugin: nil
    override-pull: |
      craftctl default
      rm pyproject.toml poetry.lock
    after: [tor, obfs4, snowflake-client, meek-client]

  onionshare:
    source: ./desktop
    plugin: python
    build-packages:
      - build-essential
      - libssl-dev
      - libffi-dev
      - python3-dev
      - python3-pip
      - rustc
      - cargo
    build-environment:
      - PATH: /usr/bin:$PATH
      - PYTHONPATH: ""
    stage-packages:
      - libasound2
      - libatk1.0-0
      - libcairo2
      - libcairo-gobject2
      - libcups2
      - libdrm2
      - libegl1
      - libfreetype6
      - libgdk-pixbuf2.0-0
      - libgl1
      - libglvnd0
      - libglx0
      - libgtk-3-0
      - libharfbuzz0b
      - libjpeg8
      - liblcms2-2
      - libnspr4
      - libnss3
      - libodbc1
      - libpango-1.0-0
      - libpangocairo-1.0-0
      - libpng16-16
      - libpq5
      - libpulse-mainloop-glib0
      - librsvg2-2
      - libspeechd2
      - libwayland-client0
      - libwayland-cursor0
      - libwayland-egl1
      - libwayland-server0
      - libx11-6
      - libx11-xcb1
      - libxau6
      - libxcb1
      - libxcb-glx0
      - libxcb-icccm4
      - libxcb-image0
      - libxcb-keysyms1
      - libxcb-render0
      - libxcb-render-util0
      - libxcb-shm0
      - libxcb-sync1
      - libxcb-xfixes0
      - libxcb-xinerama0
      - libxcb-xkb1
      - libxcomposite1
      - libxcursor1
      - libxdamage1
      - libxdmcp6
      - libxext6
      - libxfixes3
      - libxi6
      - libxkbcommon0
      - libxkbcommon-x11-0
      - libxml2
      - libxrandr2
      - libxrender1
      - libxslt1.1
      - libxtst6
      - qtwayland5
      - libgstreamer1.0-0
      - libgstreamer1.0-dev
      - libgstreamer-gl1.0-0
      - libgstreamer-plugins-base1.0-0
      - libmysqlclient21
      - libxcb-cursor0
      - libxkbfile1
    override-pull: |
      craftctl default
      rm pyproject.toml poetry.lock
      cat > requirements.txt << EOF
      # onionshare_cli
      click
      flask==2.3.2
      flask-compress==1.13
      flask-socketio==5.3.4
      psutil
      pysocks
      requests[socks]
      unidecode
      urllib3
      eventlet
      setuptools
      pynacl
      colorama
      gevent-websocket
      stem==1.8.1
      waitress
      werkzeug==2.3.4
      # onionshare
      PySide6==6.5.2
      qrcode
      packaging
      EOF
    override-build: |
      python3 -m venv $CRAFT_PART_INSTALL
      . $CRAFT_PART_INSTALL/bin/activate
      pip install -U pip setuptools wheel
      pip install -U -r requirements.txt
      pip install -U ../../onionshare-cli/src
      pip install -U .
      deactivate
      sed -i 's|'$CRAFT_PART_INSTALL'/bin/python3|/usr/bin/env python3|g' $CRAFT_PART_INSTALL/bin/onionshare
      sed -i 's|'$CRAFT_PART_INSTALL'/bin/python3|/usr/bin/env python3|g' $CRAFT_PART_INSTALL/bin/onionshare-cli
    after: [onionshare-cli]

  tor:
    source: https://dist.torproject.org/tor-0.4.8.5.tar.gz
    source-checksum: sha256/6957cfd14a29eee7555c52f8387a46f2ce2f5fe7dadf93547f1bc74b1657e119
    source-type: tar
    plugin: autotools
    autotools-configure-parameters:
      - "--with-libevent-dir=$CRAFT_PART_INSTALL/../../libevent/install/usr/local"
    build-packages:
      - libssl-dev
      - zlib1g-dev
    after: [libevent]

  libevent:
    source: https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz
    source-checksum: sha256/92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb
    source-type: tar
    plugin: autotools

  obfs4:
    plugin: go
    build-snaps:
      - go/latest/stable
    source: https://gitlab.com/yawning/obfs4.git
    source-type: git
    source-tag: obfs4proxy-0.0.14

  snowflake-client:
    plugin: go
    build-snaps:
      - go/latest/stable
    source: https://git.torproject.org/pluggable-transports/snowflake.git
    source-type: git
    source-tag: v2.6.0
    organize:
      bin/client: bin/snowflake-client

  meek-client:
    plugin: go
    build-snaps:
      - go/latest/stable
    source: https://git.torproject.org/pluggable-transports/meek.git
    source-type: git
    source-tag: v0.38.0
    override-build: |
      cd meek-client
      mkdir -p /build/onionshare/meek-client/install/bin
      go build -o /build/onionshare/meek-client/install/bin/meek-client ./...