25 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
40eecb6446
*: Move modules-enabled files to /usr/share
- This will leave /etc/{plinth,freedombox} empty by default making service more
robust to run across various environments and situations. See systemd's
explanation for more details.

- Use Debian maintainer scripts remove all the existing files in
/etc/plinth/modules-enabled.

- Read from /usr/share/freedombox/modules-enabled then from
/etc/plinth/modules-enabled and finally from /etc/freedombox/modules-enabled.
Later read ones override previously read files. Any file pointing to /dev/null
will mean the module must be ignored.

Tests:

- Clean up /etc/plinth, /etc/freedombox and
/usr/share/freedombox/modules-enabled. Run service and notice that files are
getting loaded from development folder using a debug message.

- Run setup.py and notice that files get installed in
/usr/share/freedombox/modules-enabled/ and in the next run they get loaded from
there.

- Create a override file in /etc/plinth/modules-enabled/transmission and notice
that overriden file gets priority over the one in
/usr/share/freedombox/modules-enabled.

- Link the file /etc/plinth/modules-enabled/transmission to /dev/null and notice
that is not loaded.

- Create another file in /etc/freedombox/modules-enabled/transmission and notice
that it overrides the previous two files.

- All affected modules are loaded.

- Build a new Debian package and ensure that upgrading 23.8 to new version
removes are all configuration files.

- Build developer documentation and test that Tutorial -> Full Code and Tutorial
-> Skeleton sections have been updated with references to
-.../modules-enabled/... paths.

- Install quassel and notice that certificates were copied to /var/lib/quassel
directory. Change domain to another domain and notice that certificates were
copied again to that directory.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-05-13 07:08:43 -04:00
Sunil Mohan Adapa
ac3754fa2f
theme: Move icons to app folders
- This improves modularity. Each app brings its own icons in its directory
instead of a centralized directory.

Tests:

- Install an app and notice that the installation notification has the icon.

- Visit an app's page in Apps and System (cockpit) section and ensure that the
app's icon is being shown.

- Visit the Apps and System section and notice that apps' icons are being shown.

- Visit the home page and notice that shortcuts' icons are being shown.

- Visit the URL /plinth/api/0/shortcuts and notice that the URLs for icons are
accessible and lead to proper icon files.

- Build developer documentation and notice that Tutorial -> View and Reference >
Menu pages show the expected updates.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-05-07 13:11:27 -04:00
Sunil Mohan Adapa
f6ef0135d2
*: Add setup method on all apps that don't have it
This is needed for the apps to get enabled soon after installation. In case of
'sharing' app, a shortcut will appear on the apps page. This also brings
uniformity to help later refactoring.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-08-15 10:36:19 -04:00
Sunil Mohan Adapa
a3d4d99b33
*: Drop use of module level version
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-12-04 16:38:08 -05:00
Sunil Mohan Adapa
cd2b2f5f2c
*: Use django.urls.re_path() instead of its alias url()
- In Django 2.2 django.conf.urls.url() is an alias to django.urls.re_path().

- In Django 4.0, url() function will be removed. On Django 3.2, it throws a
warning that this function will be removed in future.

Tests:

- Run unit tests with Django 3.2 and Django 2.2.

- With Django 3.2 there are no warnings when running unit tests and when running
FreedomBox Service.

- Visit a few affected apps with both Django versions.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-09-20 16:50:47 -04:00
Sunil Mohan Adapa
5b579ff06d
frontpage: Read custom shortcuts from multiple locations
Read from /etc/plinth, /usr/share/plinth and /var/lib/plinth.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-28 21:01:17 -04:00
Sunil Mohan Adapa
9368504da5
*.py: Use SPDX license identifier
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-02-19 14:38:55 +02:00
Alice Kile
eb83e00011
fix formatting issues
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-07 13:08:35 -05:00
Sunil Mohan Adapa
03dcaa57da
api: Fix regression with listing only enabled apps in mobile app
Closes: #1626

Tests:

- List apps in mobile app front page. Observe that all apps are shown including
  disabled apps.

- With the patch, observer that only enabled apps are shown.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-08-12 18:26:19 -04:00
Sunil Mohan Adapa
b684b07d11
names: Make all apps use new api to retrieve domain names
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-08-11 18:39:54 -04:00
Sunil Mohan Adapa
75c57d3e00
Turn frontpage shortcut into an app component
- Turn frontpage shortcut into an App component. Add tests and full
  documentation.

- Overridden implementations for tahoe, diaspora, mediawiki shortcuts to handle
  special cases. Special handling for ikiwiki.

- Extend App API for removing and retrieving a component.

- Add clients information into shortcuts to avoid hacks when presenting
  shortcuts to Mobile devices via API.

- Fixed unnecessary stripping and adding of '/' when setting home page redirect
  URLs. This fixes problem with setting Cockpit as home page.

- Replaced the use of term 'app' in favor of 'shortcut' as the term when setting
  frontpage shortcuts as home page.

- JSXC shortcut does not require login.

- Don't show shadowsocks for anonymous users.

- Simplify showing selected shortcut details.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-06-07 11:48:08 -07:00
Sunil Mohan Adapa
fdcbd46513
setup: Move app enabling files to respective apps
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-03-17 16:20:54 -04:00
Joseph Nuthalapati
1307e474da
customization: Show custom shortcuts on frontpage
Closes #1379

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-10-08 20:30:29 -04:00
Joseph Nuthalapati
5e06017e5c
customization: Serve custom shortcuts through the REST API
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-10-08 20:30:24 -04:00
Hemanth Kumar Veeranki
b605c9da8a
Add a way to refine shortcuts
- Add a field `allowed_groups` to shortcuts, which will contain groups which can
  access a particular app
- When a user is logged in, only return those shortcuts to the front page if the
  user is allowed to access them. This check is done based on the allowed_groups
  field of the shortcut
- Add allowed_groups for shortcuts of all apps with group-restricted access

Signed-off-by: Hemanth Kumar Veeranki <hemanthveeranki@gmail.com>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2018-06-21 18:53:45 +05:30
Joseph Nuthalapati
b9019017f0
shortcuts: Fix urls for ikiwiki shortcuts
The shortcuts api is currently showing all ikiwiki urls as /ikiwiki and not like
/ikiwiki/blog. This takes users on the Android app to a directory view where
they have to select the name of the blog or wiki. With this patch, users will be
directly taken to the appropriate blog or wiki.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-06-04 17:22:21 -04:00
Joseph Nuthalapati
3b753819d3
api: fix icon_url
The django template tag `static` already adds /plinth/static/. The url argument
also starts with static which makes it /plinth/static/static/...

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-02-24 19:34:28 +01:00
Sunil Mohan Adapa
8f0e2d6381
Rename Plinth to FreedomBox in module doc strings
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-02-16 20:10:25 -05:00
Sunil Mohan Adapa
dea4af17fb
Rename Plinth to FreedomBox in license headers
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-02-16 20:10:09 -05:00
Sunil Mohan Adapa
13c4c687da
api: Update for clarity (API breaking change)
- Change the term 'service' to 'shortcut' as what we want to present is actually
  shortcuts and not services. Services is already a confused term between
  firewall service and a service daemon.

- Fix icon paths containing relative URLs.

- Make the access information API extensible in future.

- Send full list of domains in access information and not just one domain per
  domain type.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2017-12-13 18:56:23 -05:00
Joseph Nuthalapati
6b9bbc8acc
Fix failing non-root tests
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2017-12-04 12:16:18 -05:00
Joseph Nuthalapati
d403782b77
Add client information for Matrix Synapse and Syncthing
- Add logos for desktop operating systems

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2017-12-04 12:14:42 -05:00
Prachi
98186e2c72
Add fields to the api response
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2017-12-04 12:14:15 -05:00
Prachi Srivastava
fbe08443f4
Refactor functions for api
- Change url to use hyphen instead of camelCase
- Refactor functions to be immutable

Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2017-09-08 14:56:30 +05:30
Prachi Srivastava
c0fb2abf46 Add api module for android app
- Add api end-point to get enabled-services in plinth
- Add api end-point to get acess info for plinth
2017-09-08 14:46:38 +05:30