Go to file
Sam Atkins eefc0d41e1 chore: Fix eslint issues in helpers.js
Most of these are window fields that wanted `window.` prepended, but a
couple of issues are code that was using undefined variables (`ht` and
`dir_uuid`) and some switch-cases that I believe are intentionally
falling through.

/puter/src/helpers.js
    39:55   error  'auth_token' is not defined                                                                                            no-undef
    47:14   error  'api_origin' is not defined                                                                                            no-undef
    55:40   error  'auth_token' is not defined                                                                                            no-undef
    59:17   error  'logout' is not defined                                                                                                no-undef
   199:14   error  'api_origin' is not defined                                                                                            no-undef
   208:40   error  'auth_token' is not defined                                                                                            no-undef
   212:17   error  'logout' is not defined                                                                                                no-undef
   224:14   error  'api_origin' is not defined                                                                                            no-undef
   234:40   error  'auth_token' is not defined                                                                                            no-undef
   238:17   error  'logout' is not defined                                                                                                no-undef
   316:13   error  Expected a 'break' statement before 'case'                                                                             no-fallthrough
   323:13   error  Expected a 'break' statement before 'case'                                                                             no-fallthrough
   330:13   error  Expected a 'break' statement before 'case'                                                                             no-fallthrough
   337:13   error  Expected a 'break' statement before 'case'                                                                             no-fallthrough
   367:47   error  Unnecessary escape character: \/                                                                                       no-useless-escape
   411:14   error  'isString' is not defined                                                                                              no-undef
   420:47   error  'config' is not defined                                                                                                no-undef
   519:21   error  'globToRegExp' is not defined                                                                                          no-undef
   651:14   error  Empty block statement                                                                                                  no-empty
   656:9    error  'update_auth_data' is not defined                                                                                      no-undef
   678:36   error  'api_origin' is not defined                                                                                            no-undef
   722:5    error  'update_user_preferences' is not defined                                                                               no-undef
   740:24   error  'uuidv4' is not defined                                                                                                no-undef
   746:9    error  'appCallbackFunctions' is not defined                                                                                  no-undef
   789:14   error  'api_origin' is not defined                                                                                            no-undef
   794:40   error  'auth_token' is not defined                                                                                            no-undef
   861:33   error  'trash_path' is not defined                                                                                            no-undef
   867:21   error  Empty block statement                                                                                                  no-empty
   889:70   error  'trash_path' is not defined                                                                                            no-undef
   891:59   error  'trash_path' is not defined                                                                                            no-undef
   894:49   error  'trash_path' is not defined                                                                                            no-undef
   907:29   error  'docs_path' is not defined                                                                                             no-undef
   909:35   error  'pictures_path' is not defined                                                                                         no-undef
   911:35   error  'home_path' is not defined                                                                                             no-undef
   913:35   error  'videos_path' is not defined                                                                                           no-undef
   915:35   error  'desktop_path' is not defined                                                                                          no-undef
  1037:5    error  'getItem' is not defined                                                                                               no-undef
  1041:17   error  'setItem' is not defined                                                                                               no-undef
  1070:54   error  Empty block statement                                                                                                  no-empty
  1089:51   error  'ht' is not defined                                                                                                    no-undef
  1091:20   error  'desktop_loading_fade_delay' is not defined                                                                            no-undef
  1150:27   error  'operation_id' is not defined                                                                                          no-undef
  1151:5    error  'operation_cancelled' is not defined                                                                                   no-undef
  1169:21   error  'activate_item_name_editor' is not defined                                                                             no-undef
  1172:21   error  'actions_history' is not defined                                                                                       no-undef
  1181:54   error  'copy_progress_hide_delay' is not defined                                                                              no-undef
  1187:37   error  'copy_progress_hide_delay' is not defined                                                                              no-undef
  1211:21   error  'activate_item_name_editor' is not defined                                                                             no-undef
  1214:21   error  'actions_history' is not defined                                                                                       no-undef
  1245:22   error  'operation_id' is not defined                                                                                          no-undef
  1246:5    error  'operation_cancelled' is not defined                                                                                   no-undef
  1249:5    error  'update_explorer_footer_selected_items_count' is not defined                                                           no-undef
  1263:24   error  'clipboard' is not defined                                                                                             no-undef
  1264:29   error  'clipboard' is not defined                                                                                             no-undef
  1273:20   error  'operation_cancelled' is not defined                                                                                   no-undef
  1302:38   error  'clipboard' is not defined                                                                                             no-undef
  1303:38   error  'clipboard' is not defined                                                                                             no-undef
  1327:9    error  'actions_history' is not defined                                                                                       no-undef
  1335:40   error  'copy_progress_hide_delay' is not defined                                                                              no-undef
  1341:29   error  'copy_progress_hide_delay' is not defined                                                                              no-undef
  1354:22   error  'operation_id' is not defined                                                                                          no-undef
  1377:20   error  'operation_cancelled' is not defined                                                                                   no-undef
  1432:9    error  'actions_history' is not defined                                                                                       no-undef
  1440:40   error  'copy_progress_hide_delay' is not defined                                                                              no-undef
  1446:29   error  'copy_progress_hide_delay' is not defined                                                                              no-undef
  1486:17   error  'update_explorer_footer_item_count' is not defined                                                                     no-undef
  1487:17   error  'update_explorer_footer_selected_items_count' is not defined                                                           no-undef
  1500:8    error  'clipboard' is not defined                                                                                             no-undef
  1501:24   error  'clipboard' is not defined                                                                                             no-undef
  1502:61   error  'clipboard' is not defined                                                                                             no-undef
  1505:13   error  'move_items' is not defined                                                                                            no-undef
  1508:5    error  'clipboard' is not defined                                                                                             no-undef
  1537:23   error  'api_origin' is not defined                                                                                            no-undef
  1537:84   error  'auth_token' is not defined                                                                                            no-undef
  1556:34   error  'uuidv4' is not defined                                                                                                no-undef
  1565:45   error  'get_apps' is not defined                                                                                              no-undef
  1572:13   error  This branch can never execute. Its condition is a duplicate or covered by previous conditions in the if-else-if chain  no-dupe-else-if
  1639:21   error  'root_dirname' is not defined                                                                                          no-undef
  1684:37   error  'gui_origin' is not defined                                                                                            no-undef
  1711:60   error  'app_domain' is not defined                                                                                            no-undef
  1723:64   error  'auth_token' is not defined                                                                                            no-undef
  1737:49   error  'auth_token' is not defined                                                                                            no-undef
  1748:12   error  'api_origin' is not defined                                                                                            no-undef
  1749:64   error  'api_origin' is not defined                                                                                            no-undef
  1800:13   error  'launch_apps' is not defined                                                                                           no-undef
  1803:13   error  'launch_apps' is not defined                                                                                           no-undef
  1803:43   error  'launch_apps' is not defined                                                                                           no-undef
  1806:13   error  'launch_apps' is not defined                                                                                           no-undef
  1806:34   error  'launch_apps' is not defined                                                                                           no-undef
  1810:22   error  'api_origin' is not defined                                                                                            no-undef
  1819:48   error  'auth_token' is not defined                                                                                            no-undef
  1867:56   error  'trash_path' is not defined                                                                                            no-undef
  1873:34   error  'trash_path' is not defined                                                                                            no-undef
  1942:30   error  'busy_indicator_hide_delay' is not defined                                                                             no-undef
  1948:25   error  'busy_indicator_hide_delay' is not defined                                                                             no-undef
  1954:48   error  'user_preferences' is not defined                                                                                      no-undef
  1955:9    error  'launch_app' is not defined                                                                                            no-undef
  1956:19   error  'user_preferences' is not defined                                                                                      no-undef
  1967:9    error  'launch_app' is not defined                                                                                            no-undef
  1978:25   error  'item_icon' is not defined                                                                                             no-undef
  1992:9    error  'window_nav_history' is not defined                                                                                    no-undef
  1992:45   error  'window_nav_history' is not defined                                                                                    no-undef
  1992:88   error  'window_nav_history_current_position' is not defined                                                                   no-undef
  1993:9    error  'window_nav_history' is not defined                                                                                    no-undef
  1994:9    error  'window_nav_history_current_position' is not defined                                                                   no-undef
  1996:9    error  'update_window_path' is not defined                                                                                    no-undef
  2009:22   error  'api_origin' is not defined                                                                                            no-undef
  2017:48   error  'auth_token' is not defined                                                                                            no-undef
  2021:25   error  'logout' is not defined                                                                                                no-undef
  2025:20   error  Empty block statement                                                                                                  no-empty
  2029:70   error  'suggest_apps_for_fsentry' is not defined                                                                              no-undef
  2040:17   error  'unzipItem' is not defined                                                                                             no-undef
  2057:17   error  'trigger_download' is not defined                                                                                      no-undef
  2065:13   error  'launch_app' is not defined                                                                                            no-undef
  2087:22   error  'operation_id' is not defined                                                                                          no-undef
  2088:5    error  'operation_cancelled' is not defined                                                                                   no-undef
  2129:12   error  'operation_cancelled' is not defined                                                                                   no-undef
  2166:30   error  Empty block statement                                                                                                  no-empty
  2173:20   error  'operation_cancelled' is not defined                                                                                   no-undef
  2182:34   error  'trash_path' is not defined                                                                                            no-undef
  2196:55   error  'trash_path' is not defined                                                                                            no-undef
  2196:116  error  'trash_path' is not defined                                                                                            no-undef
  2197:57   error  'trash_path' is not defined                                                                                            no-undef
  2201:46   error  'trash_path' is not defined                                                                                            no-undef
  2215:47   error  'trash_path' is not defined                                                                                            no-undef
  2254:25   error  'update_explorer_footer_item_count' is not defined                                                                     no-undef
  2255:25   error  'update_explorer_footer_selected_items_count' is not defined                                                           no-undef
  2260:34   error  'trash_path' is not defined                                                                                            no-undef
  2270:25   error  'update_window_path' is not defined                                                                                    no-undef
  2274:34   error  'trash_path' is not defined                                                                                            no-undef
  2279:46   error  'dir_uuid' is not defined                                                                                              no-undef
  2302:33   error  'item_icon' is not defined                                                                                             no-undef
  2303:42   error  'trash_path' is not defined                                                                                            no-undef
  2309:47   error  'trash_path' is not defined                                                                                            no-undef
  2331:41   error  'item_icon' is not defined                                                                                             no-undef
  2343:21   error  'sort_items' is not defined                                                                                            no-undef
  2348:21   error  'sort_items' is not defined                                                                                            no-undef
  2391:47   error  'trash_path' is not defined                                                                                            no-undef
  2397:51   error  'trash_path' is not defined                                                                                            no-undef
  2398:53   error  'trash_path' is not defined                                                                                            no-undef
  2413:34   error  'trash_path' is not defined                                                                                            no-undef
  2414:9    error  'actions_history' is not defined                                                                                       no-undef
  2418:40   error  'trash_path' is not defined                                                                                            no-undef
  2419:9    error  'actions_history' is not defined                                                                                       no-undef
  2428:12   error  'copy_progress_hide_delay' is not defined                                                                              no-undef
  2641:21   error  'upload_items' is not defined                                                                                          no-undef
  2659:21   error  'trash_path' is not defined                                                                                            no-undef
  2679:21   error  'show_save_account_notice_if_needed' is not defined                                                                    no-undef
  2683:17   error  'active_uploads' is not defined                                                                                        no-undef
  2695:17   error  'active_uploads' is not defined                                                                                        no-undef
  2714:17   error  'actions_history' is not defined                                                                                       no-undef
  2722:25   error  'show_save_account_notice_if_needed' is not defined                                                                    no-undef
  2723:33   error  'upload_progress_hide_delay' is not defined                                                                            no-undef
  2726:24   error  'active_uploads' is not defined                                                                                        no-undef
  2733:24   error  'active_uploads' is not defined                                                                                        no-undef
  2739:24   error  'active_uploads' is not defined                                                                                        no-undef
  2766:17   error  'uuidv4' is not defined                                                                                                no-undef
  2772:16   error  'trash_path' is not defined                                                                                            no-undef
  2782:47   error  'trash_path' is not defined                                                                                            no-undef
  2782:108  error  'trash_path' is not defined                                                                                            no-undef
  2783:37   error  'trash_path' is not defined                                                                                            no-undef
  2786:36   error  'trash_path' is not defined                                                                                            no-undef
  2788:13   error  'update_explorer_footer_item_count' is not defined                                                                     no-undef
  2788:71   error  'trash_path' is not defined                                                                                            no-undef
  2793:28   error  'copy_progress_hide_delay' is not defined                                                                              no-undef
  2799:28   error  'copy_progress_hide_delay' is not defined                                                                              no-undef
  2815:18   error  'api_origin' is not defined                                                                                            no-undef
  2818:42   error  'auth_token' is not defined                                                                                            no-undef
  2991:28   error  'copy_progress_hide_delay' is not defined                                                                              no-undef
  2998:28   error  'copy_progress_hide_delay' is not defined                                                                              no-undef
  3066:24   error  'copy_progress_hide_delay' is not defined                                                                              no-undef
  3074:24   error  'copy_progress_hide_delay' is not defined                                                                              no-undef
  3086:17   error  'actions_history' is not defined                                                                                       no-undef
  3095:17   error  'suggest_apps_for_fsentry' is not defined                                                                              no-undef
  3104:95   error  'truncate_filename' is not defined                                                                                     no-undef
  3104:123  error  'TRUNCATE_LENGTH' is not defined                                                                                       no-undef
  3111:84   error  'item_icon' is not defined                                                                                             no-undef
  3150:23   error  'update_sites_cache' is not defined                                                                                    no-undef
  3153:27   error  'determine_website_url' is not defined                                                                                 no-undef
  3158:17   error  'update_window_path' is not defined                                                                                    no-undef
  3166:17   error  'sort_items' is not defined                                                                                            no-undef
  3171:34   error  'truncate_filename' is not defined                                                                                     no-undef
  3171:66   error  'TRUNCATE_LENGTH' is not defined                                                                                       no-undef
  3205:9    error  'actions_history' is not defined                                                                                       no-undef
  3206:29   error  'actions_history' is not defined                                                                                       no-undef
  3211:13   error  'undo_create_file_or_folder' is not defined                                                                            no-undef
  3214:13   error  'rename_file' is not defined                                                                                           no-undef
  3217:13   error  'undo_upload' is not defined                                                                                           no-undef
  3220:13   error  'undo_copy' is not defined                                                                                             no-undef
  3223:13   error  'undo_move' is not defined                                                                                             no-undef
  3226:13   error  'undo_delete' is not defined                                                                                           no-undef
  3249:26   error  'get_html_element_from_options' is not defined                                                                         no-undef
  3251:9    error  'move_items' is not defined                                                                                            no-undef
  3257:26   error  'get_html_element_from_options' is not defined                                                                         no-undef
  3259:9    error  'move_items' is not defined                                                                                            no-undef
  3265:21   error  'global_element_id' is not defined                                                                                     no-undef
  3282:23   error  'determine_website_url' is not defined                                                                                 no-undef
  3324:42   error  'byte_format' is not defined                                                                                           no-undef
  3381:116  error  'truncate_filename' is not defined                                                                                     no-undef
  3381:148  error  'TRUNCATE_LENGTH' is not defined                                                                                       no-undef
  3396:5    error  'is_auto_arrange_enabled' is not defined                                                                               no-undef
  3398:5    error  'desktop_item_positions' is not defined                                                                                no-undef
  3408:8    error  'reset_item_positions' is not defined                                                                                  no-undef
  3409:9    error  'delete_desktop_item_positions' is not defined                                                                         no-undef
  3415:26   error  'desktop_item_positions' is not defined                                                                                no-undef
  3426:44   error  'desktop_item_positions' is not defined                                                                                no-undef
  3430:5    error  'desktop_item_positions' is not defined                                                                                no-undef
  3438:28   error  'is_fullscreen' is not defined                                                                                         no-undef
  3462:14   error  'window_for_app_instance' is not defined                                                                               no-undef
  3469:31   error  'iframe_for_app_instance' is not defined                                                                               no-undef
  3483:23   error  'window_for_app_instance' is not defined                                                                               no-undef
  3514:42   error  Unnecessary escape character: \[                                                                                       no-useless-escape
  3514:59   error  Unnecessary escape character: \/                                                                                       no-useless-escape
2024-05-02 16:54:17 +01:00
.github Update Docker CI 2024-04-24 11:29:44 +02:00
doc refactor: normalize email calls 2024-04-29 17:34:24 -04:00
incubator/x86emu Add checklists for x86 emulation project 2024-03-14 14:15:10 -04:00
packages fix: Add missing TextEncoder to PTT 2024-05-02 11:21:50 +01:00
src chore: Fix eslint issues in helpers.js 2024-05-02 16:54:17 +01:00
tools Check that all uses of i18n() use keys that exist 2024-04-01 12:12:31 +01:00
volatile Release backend 2024-03-30 19:08:03 -04:00
.commit fix: use primary read in signup 2024-04-25 19:46:39 -04:00
.dockerignore Fix Dockerfile 2024-04-15 19:03:00 -04:00
.env.example Implement .env support for PORT property 2024-03-12 22:42:13 -07:00
.gitattributes Initial commit 2024-03-02 18:39:14 -08:00
.gitignore Fix casualty of phoenix due to Docker naming conventions 2024-04-15 12:12:28 -04:00
.is_puter_repository Release backend 2024-03-30 19:08:03 -04:00
build.js Migrate to JavaScript modules 2024-03-20 14:10:39 +00:00
CHANGELOG.md chore(main): release 2.2.0 2024-04-23 02:03:34 +00:00
CONTRIBUTING.md Add April-1st-appropriate commit message guidelines 2024-04-01 19:33:11 -04:00
dev-server.js Migrate to JavaScript modules 2024-03-20 14:10:39 +00:00
docker-compose.yml Update instructions & docker-compose to reflect production paths 2024-04-02 07:45:14 +02:00
Dockerfile Set NO_VAR_RUNTIME in Dockerfile 2024-04-15 20:47:27 -04:00
eslint.config.js chore: Set-up eslint 2024-05-02 11:21:50 +01:00
exports.js Release backend 2024-03-30 19:08:03 -04:00
l_checker_config.json Release backend 2024-03-30 19:08:03 -04:00
LICENSE.txt Initial commit 2024-03-02 18:39:14 -08:00
package-lock.json chore: Set-up eslint 2024-05-02 11:21:50 +01:00
package.json chore: Set-up eslint 2024-05-02 11:21:50 +01:00
puter-gui.json Add WIP color sliders 2024-04-06 02:35:06 -04:00
README.md docs: Explain self-host differences 2024-04-30 16:29:57 +01:00
run-selfhosted.js chore: Add missing import for node:console 2024-05-02 11:21:50 +01:00
SECURITY-ACKNOWLEDGEMENTS.md Update SECURITY-ACKNOWLEDGEMENTS.md to add Tim's GitHub 2024-03-13 18:55:14 -07:00
SECURITY.md Create SECURITY.md 2024-03-13 16:33:03 -07:00
test.txt fix: test release-please action #4 2024-04-22 18:40:49 -04:00
utils.js Migrate to JavaScript modules 2024-03-20 14:10:39 +00:00

Puter.com, The Personal Cloud Computer: All your files, apps, and games in one place accessible from anywhere at any time.

The Internet OS! Free, Open-Source, and Self-Hostable.

« LIVE DEMO »

Puter.com · SDK · Discord · Reddit · X (Twitter) · Bug Bounty

#1 on Hacker News #1 on Hacker News

screenshot


Puter

Puter is an advanced, open-source internet operating system designed to be feature-rich, exceptionally fast, and highly extensible. It can be used to build remote desktop environments or serve as an interface for cloud storage services, remote servers, web hosting platforms, and more.


Getting Started

After reading this section, please proceed to Self-Hosting and Configuration below. Read these instructions carefully or you may see errors due to an invalid setup.

Local Development

git clone https://github.com/HeyPuter/puter
cd puter
npm install
npm start

This will launch Puter at http://localhost:4000 (or the next available port).


Using Docker

note: it is not necessary to run this within a clone of this repository. For contributors, it is recommended to use the Local Development instructions.

mkdir puter && cd puter && mkdir -p puter/config puter/data && sudo chown -R 1000:1000 puter && docker run --rm -p 4100:4100 -v `pwd`/puter/config:/etc/puter -v `pwd`/puter/data:/var/puter  ghcr.io/heyputer/puter

Using Docker Compose

note: it is not necessary to run this within a clone of this repository. For contributors, it is recommended to use the Local Development instructions.

mkdir -p puter/config puter/data
sudo chown -R 1000:1000 puter
wget https://raw.githubusercontent.com/HeyPuter/puter/main/docker-compose.yml
docker compose up

See Configuration for next steps.


⚠️ Self-Hosting ⚠️

The self-hosted version of Puter is currently in alpha stage and should not be used in production yet. It is under active development and may contain bugs, other issues. Please exercise caution and use it for testing and evaluation purposes only.

Self-Hosting Differences

Currently, the self-hosted version of Puter is different in a few ways from Puter.com:

  • There is no built-in way to install or create other apps (see below)
  • Several "core" apps are missing, such as Code or Draw, because we can't include them in this repository
  • Some icons are different

Work is ongoing to improve the App Center and make it available on self-hosted. Until then, it's possible to add other apps by manually editing the database file. This process is not recommended unless you know what you are doing. The file will appear after you first launch Puter, and should be found in puter/data/puter-database.sqlite for Docker, or volatile/runtime/puter-database.sqlite otherwise. You will need a database tool that can understand SQLite databases.


Configuration

Running the server will generate a configuration file in one of these locations:

  • config/config.json when Using Docker
  • volatile/config/config.json in Local Development
  • /etc/puter/config.json on a server (or within a Docker container)

Domain Name

To access Puter on your device, you can simply go to the address printed in the server console (usually puter.localhost:4100).

To access Puter from another device, a domain name must be configured, as well as an api subdomain. For example, example.local might be the domain name pointing to the IP address of the server running puter, and api.example.com must point to this address as well. This domain must be specified in the configuration file (usually volatile/config/config.json) as well.

See domain configuration for more information.

Configure the Port

  • You can specify a custom port by setting http_port to a desired value
  • If you're using a reverse-proxy such as nginx or cloudflare, you should also set pub_port to the public (external) port (usually 443)
  • If you have HTTPS enabled on your reverse-proxy, ensure that protocol in config.json is set accordingly

Default User

By default, Puter will create a user called default_user. This user will have a randomly generated password, which will be printed in the development console. A warning will persist in the dev console until this user's password is changed. Please login to this user and change the password as your first step.


License

This repository is licensed under AGPL-3.0; However, our SDK (puter.js) is also available under Apache 2.0, as indicated by the license file in that section (packages/puter-js) of this repository.


FAQ

What's the use case for Puter?

Puter can be used as:

  • An alternative to Dropbox, Google Drive, OneDrive, etc. with a fresh interface and powerful features.
  • Remote desktop environment for servers and workstations.
  • A platform for building and hosting websites, web apps, and games.
  • A friendly, open-source project and community to learn about web development, cloud computing, distributed systems, and much more!

Why isn't Puter built with React, Angular, Vue, etc.?

For performance reasons, Puter is built with vanilla JavaScript and jQuery. Additionally, we'd like to avoid complex abstractions and to remain in control of the entire stack, as much as possible.

Also partly inspired by some of our favorite projects that are not built with frameworks: VSCode, Photopea, and OnlyOffice.


Why jQuery?

Puter interacts directly with the DOM and jQuery provides an elegant yet powerful API to manipulate the DOM, handle events, and much more. It's also fast, mature, and battle-tested.


#DoesItRunPuter


Credits

The default wallpaper is created by Milad Fakurian and published on Unsplash.

Icons by Papirus under GPL-3.0 license.

Icons by Iconoir under MIT license.

Icons by Elementary Icons under GPL-3.0 license.

Icons by Tabler Icons under MIT license.

Icons by bootstrap-icons under MIT license.